syntaur 0.41.3 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/dashboard/dist/assets/{_basePickBy-ZMecMDb-.js → _basePickBy-DzTDKHYU.js} +1 -1
- package/dashboard/dist/assets/{_baseUniq-tVAi81J9.js → _baseUniq-DW7YJayj.js} +1 -1
- package/dashboard/dist/assets/{arc-BMB5nyvD.js → arc-BkeAbQzV.js} +1 -1
- package/dashboard/dist/assets/{architectureDiagram-2XIMDMQ5-1_ttZgNb.js → architectureDiagram-2XIMDMQ5-M_COTMq5.js} +1 -1
- package/dashboard/dist/assets/{blockDiagram-WCTKOSBZ-BAuowdCy.js → blockDiagram-WCTKOSBZ-BMSQm_8K.js} +1 -1
- package/dashboard/dist/assets/{c4Diagram-IC4MRINW-DgqpYWNQ.js → c4Diagram-IC4MRINW-Bte3s8bA.js} +1 -1
- package/dashboard/dist/assets/channel-BrnqMVFz.js +1 -0
- package/dashboard/dist/assets/{chunk-4BX2VUAB-Dul2PJq1.js → chunk-4BX2VUAB-BpEBr9cy.js} +1 -1
- package/dashboard/dist/assets/{chunk-55IACEB6-BNsItfH6.js → chunk-55IACEB6-C5vYlqEx.js} +1 -1
- package/dashboard/dist/assets/{chunk-FMBD7UC4-C3btqaF-.js → chunk-FMBD7UC4-C8wRljiW.js} +1 -1
- package/dashboard/dist/assets/{chunk-JSJVCQXG-BjrX5MC8.js → chunk-JSJVCQXG-svArzivt.js} +1 -1
- package/dashboard/dist/assets/{chunk-KX2RTZJC-xMrVR3MQ.js → chunk-KX2RTZJC-DPZbN7jl.js} +1 -1
- package/dashboard/dist/assets/{chunk-NQ4KR5QH-Dd67ojLx.js → chunk-NQ4KR5QH-ZqOPA0Z2.js} +1 -1
- package/dashboard/dist/assets/{chunk-QZHKN3VN-Dqombp1k.js → chunk-QZHKN3VN-BoxtsyU8.js} +1 -1
- package/dashboard/dist/assets/{chunk-WL4C6EOR-CCYZi5vV.js → chunk-WL4C6EOR-BoTByw-8.js} +1 -1
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-BfXVQbAH.js +1 -0
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-BfXVQbAH.js +1 -0
- package/dashboard/dist/assets/clone-Bm7jyblm.js +1 -0
- package/dashboard/dist/assets/{cose-bilkent-S5V4N54A-CYmvV1RQ.js → cose-bilkent-S5V4N54A-CV74D8s_.js} +1 -1
- package/dashboard/dist/assets/{dagre-KLK3FWXG-DXFT_Iz5.js → dagre-KLK3FWXG-NXFGSDTv.js} +1 -1
- package/dashboard/dist/assets/{diagram-E7M64L7V-CkCF8e9h.js → diagram-E7M64L7V-CO89mocJ.js} +1 -1
- package/dashboard/dist/assets/{diagram-IFDJBPK2-CqIk_zgE.js → diagram-IFDJBPK2-CGOOte10.js} +1 -1
- package/dashboard/dist/assets/{diagram-P4PSJMXO-BV-579JX.js → diagram-P4PSJMXO-tRYoQWNN.js} +1 -1
- package/dashboard/dist/assets/{erDiagram-INFDFZHY-CeFxcSCp.js → erDiagram-INFDFZHY-D88FnNdx.js} +1 -1
- package/dashboard/dist/assets/{flowDiagram-PKNHOUZH-D2IGFjb7.js → flowDiagram-PKNHOUZH-C2dCJPYX.js} +1 -1
- package/dashboard/dist/assets/{ganttDiagram-A5KZAMGK-CctYGwR7.js → ganttDiagram-A5KZAMGK-BVsm_TXU.js} +1 -1
- package/dashboard/dist/assets/{gitGraphDiagram-K3NZZRJ6-zt67Doyo.js → gitGraphDiagram-K3NZZRJ6-DeYEcfwg.js} +1 -1
- package/dashboard/dist/assets/{graph-DZiyaEGT.js → graph-iy97f49o.js} +1 -1
- package/dashboard/dist/assets/index-BqxbS9Wf.css +1 -0
- package/dashboard/dist/assets/index-esLcRMJY.js +566 -0
- package/dashboard/dist/assets/{infoDiagram-LFFYTUFH-jvCdU_x3.js → infoDiagram-LFFYTUFH-B_KPLd9N.js} +1 -1
- package/dashboard/dist/assets/{ishikawaDiagram-PHBUUO56-B3LJ4cf3.js → ishikawaDiagram-PHBUUO56-D0i4hG75.js} +1 -1
- package/dashboard/dist/assets/{journeyDiagram-4ABVD52K-CtEednnS.js → journeyDiagram-4ABVD52K-DxAv-6Dt.js} +1 -1
- package/dashboard/dist/assets/{kanban-definition-K7BYSVSG-BhPQqjK5.js → kanban-definition-K7BYSVSG-CFV3hwVv.js} +1 -1
- package/dashboard/dist/assets/{layout-DBtJEEbD.js → layout-DkzGMO0p.js} +1 -1
- package/dashboard/dist/assets/{linear-CSinjjkH.js → linear-Di0t2dWQ.js} +1 -1
- package/dashboard/dist/assets/{mermaid.core-Cu6allRd.js → mermaid.core-BWdLQDB3.js} +4 -4
- package/dashboard/dist/assets/{mindmap-definition-YRQLILUH-SFkGLxic.js → mindmap-definition-YRQLILUH-DHFtApR_.js} +1 -1
- package/dashboard/dist/assets/{pieDiagram-SKSYHLDU-CM63Vi0v.js → pieDiagram-SKSYHLDU-CKv_gkpa.js} +1 -1
- package/dashboard/dist/assets/{quadrantDiagram-337W2JSQ-KNLfFOZV.js → quadrantDiagram-337W2JSQ-D8d0F939.js} +1 -1
- package/dashboard/dist/assets/{requirementDiagram-Z7DCOOCP-CUTnDKwW.js → requirementDiagram-Z7DCOOCP-BpIRQ6xS.js} +1 -1
- package/dashboard/dist/assets/{sankeyDiagram-WA2Y5GQK-BJh1laae.js → sankeyDiagram-WA2Y5GQK-B6pEFLq9.js} +1 -1
- package/dashboard/dist/assets/{sequenceDiagram-2WXFIKYE-DLrWjp9t.js → sequenceDiagram-2WXFIKYE-C_UzJJ9L.js} +1 -1
- package/dashboard/dist/assets/{stateDiagram-RAJIS63D-AYRZyAEg.js → stateDiagram-RAJIS63D-DffNJyzP.js} +1 -1
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-Bb4Jseta.js +1 -0
- package/dashboard/dist/assets/{timeline-definition-YZTLITO2-BG2DbYEn.js → timeline-definition-YZTLITO2-BiMYMTvs.js} +1 -1
- package/dashboard/dist/assets/{treemap-KZPCXAKY-D8ZVNAo3.js → treemap-KZPCXAKY-CUEZz4mB.js} +1 -1
- package/dashboard/dist/assets/{vennDiagram-LZ73GAT5-BqBHdSLd.js → vennDiagram-LZ73GAT5-Cpol_IHC.js} +1 -1
- package/dashboard/dist/assets/{xychartDiagram-JWTSCODW-DBgm8PRH.js → xychartDiagram-JWTSCODW-CbnCJEuN.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dist/dashboard/server.js +2584 -431
- package/dist/dashboard/server.js.map +1 -1
- package/dist/index.js +4043 -999
- package/dist/index.js.map +1 -1
- package/dist/launch/index.d.ts +159 -6
- package/dist/launch/index.js +2162 -147
- package/dist/launch/index.js.map +1 -1
- package/package.json +1 -1
- package/platforms/claude-code/.claude-plugin/plugin.json +1 -1
- package/platforms/codex/.codex-plugin/plugin.json +1 -1
- package/platforms/hermes/plugins/syntaur/__pycache__/__init__.cpython-312.pyc +0 -0
- package/platforms/hermes/plugins/syntaur/__pycache__/boundary.cpython-312.pyc +0 -0
- package/dashboard/dist/assets/channel-CIhg4t-B.js +0 -1
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-Bmt2MjbS.js +0 -1
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-Bmt2MjbS.js +0 -1
- package/dashboard/dist/assets/clone-BfVm3try.js +0 -1
- package/dashboard/dist/assets/index-6uihSopA.css +0 -1
- package/dashboard/dist/assets/index-GK0h-4Nt.js +0 -566
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-BRhe6_kr.js +0 -1
|
@@ -1,566 +0,0 @@
|
|
|
1
|
-
var r2=Object.defineProperty;var s2=(e,t,n)=>t in e?r2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qb=(e,t,n)=>s2(e,typeof t!="symbol"?t+"":t,n);function o2(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in e)){const l=Object.getOwnPropertyDescriptor(s,a);l&&Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function Td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function YB(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}),n}var nm={exports:{}},pl={},rm={exports:{}},ft={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Zb;function a2(){if(Zb)return ft;Zb=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.iterator;function y(F){return F===null||typeof F!="object"?null:(F=g&&F[g]||F["@@iterator"],typeof F=="function"?F:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,j={};function w(F,Z,I){this.props=F,this.context=Z,this.refs=j,this.updater=I||b}w.prototype.isReactComponent={},w.prototype.setState=function(F,Z){if(typeof F!="object"&&typeof F!="function"&&F!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,F,Z,"setState")},w.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function k(){}k.prototype=w.prototype;function C(F,Z,I){this.props=F,this.context=Z,this.refs=j,this.updater=I||b}var N=C.prototype=new k;N.constructor=C,E(N,w.prototype),N.isPureReactComponent=!0;var T=Array.isArray,D=Object.prototype.hasOwnProperty,R={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function L(F,Z,I){var de,ge={},V=null,ae=null;if(Z!=null)for(de in Z.ref!==void 0&&(ae=Z.ref),Z.key!==void 0&&(V=""+Z.key),Z)D.call(Z,de)&&!$.hasOwnProperty(de)&&(ge[de]=Z[de]);var me=arguments.length-2;if(me===1)ge.children=I;else if(1<me){for(var ve=Array(me),ke=0;ke<me;ke++)ve[ke]=arguments[ke+2];ge.children=ve}if(F&&F.defaultProps)for(de in me=F.defaultProps,me)ge[de]===void 0&&(ge[de]=me[de]);return{$$typeof:e,type:F,key:V,ref:ae,props:ge,_owner:R.current}}function K(F,Z){return{$$typeof:e,type:F.type,key:Z,ref:F.ref,props:F.props,_owner:F._owner}}function B(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function O(F){var Z={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(I){return Z[I]})}var W=/\/+/g;function se(F,Z){return typeof F=="object"&&F!==null&&F.key!=null?O(""+F.key):Z.toString(36)}function z(F,Z,I,de,ge){var V=typeof F;(V==="undefined"||V==="boolean")&&(F=null);var ae=!1;if(F===null)ae=!0;else switch(V){case"string":case"number":ae=!0;break;case"object":switch(F.$$typeof){case e:case t:ae=!0}}if(ae)return ae=F,ge=ge(ae),F=de===""?"."+se(ae,0):de,T(ge)?(I="",F!=null&&(I=F.replace(W,"$&/")+"/"),z(ge,Z,I,"",function(ke){return ke})):ge!=null&&(B(ge)&&(ge=K(ge,I+(!ge.key||ae&&ae.key===ge.key?"":(""+ge.key).replace(W,"$&/")+"/")+F)),Z.push(ge)),1;if(ae=0,de=de===""?".":de+":",T(F))for(var me=0;me<F.length;me++){V=F[me];var ve=de+se(V,me);ae+=z(V,Z,I,ve,ge)}else if(ve=y(F),typeof ve=="function")for(F=ve.call(F),me=0;!(V=F.next()).done;)V=V.value,ve=de+se(V,me++),ae+=z(V,Z,I,ve,ge);else if(V==="object")throw Z=String(F),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.");return ae}function H(F,Z,I){if(F==null)return F;var de=[],ge=0;return z(F,de,"","",function(V){return Z.call(I,V,ge++)}),de}function ee(F){if(F._status===-1){var Z=F._result;Z=Z(),Z.then(function(I){(F._status===0||F._status===-1)&&(F._status=1,F._result=I)},function(I){(F._status===0||F._status===-1)&&(F._status=2,F._result=I)}),F._status===-1&&(F._status=0,F._result=Z)}if(F._status===1)return F._result.default;throw F._result}var ne={current:null},M={transition:null},G={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:M,ReactCurrentOwner:R};function A(){throw Error("act(...) is not supported in production builds of React.")}return ft.Children={map:H,forEach:function(F,Z,I){H(F,function(){Z.apply(this,arguments)},I)},count:function(F){var Z=0;return H(F,function(){Z++}),Z},toArray:function(F){return H(F,function(Z){return Z})||[]},only:function(F){if(!B(F))throw Error("React.Children.only expected to receive a single React element child.");return F}},ft.Component=w,ft.Fragment=n,ft.Profiler=a,ft.PureComponent=C,ft.StrictMode=s,ft.Suspense=p,ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=G,ft.act=A,ft.cloneElement=function(F,Z,I){if(F==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+F+".");var de=E({},F.props),ge=F.key,V=F.ref,ae=F._owner;if(Z!=null){if(Z.ref!==void 0&&(V=Z.ref,ae=R.current),Z.key!==void 0&&(ge=""+Z.key),F.type&&F.type.defaultProps)var me=F.type.defaultProps;for(ve in Z)D.call(Z,ve)&&!$.hasOwnProperty(ve)&&(de[ve]=Z[ve]===void 0&&me!==void 0?me[ve]:Z[ve])}var ve=arguments.length-2;if(ve===1)de.children=I;else if(1<ve){me=Array(ve);for(var ke=0;ke<ve;ke++)me[ke]=arguments[ke+2];de.children=me}return{$$typeof:e,type:F.type,key:ge,ref:V,props:de,_owner:ae}},ft.createContext=function(F){return F={$$typeof:c,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},F.Provider={$$typeof:l,_context:F},F.Consumer=F},ft.createElement=L,ft.createFactory=function(F){var Z=L.bind(null,F);return Z.type=F,Z},ft.createRef=function(){return{current:null}},ft.forwardRef=function(F){return{$$typeof:u,render:F}},ft.isValidElement=B,ft.lazy=function(F){return{$$typeof:h,_payload:{_status:-1,_result:F},_init:ee}},ft.memo=function(F,Z){return{$$typeof:m,type:F,compare:Z===void 0?null:Z}},ft.startTransition=function(F){var Z=M.transition;M.transition={};try{F()}finally{M.transition=Z}},ft.unstable_act=A,ft.useCallback=function(F,Z){return ne.current.useCallback(F,Z)},ft.useContext=function(F){return ne.current.useContext(F)},ft.useDebugValue=function(){},ft.useDeferredValue=function(F){return ne.current.useDeferredValue(F)},ft.useEffect=function(F,Z){return ne.current.useEffect(F,Z)},ft.useId=function(){return ne.current.useId()},ft.useImperativeHandle=function(F,Z,I){return ne.current.useImperativeHandle(F,Z,I)},ft.useInsertionEffect=function(F,Z){return ne.current.useInsertionEffect(F,Z)},ft.useLayoutEffect=function(F,Z){return ne.current.useLayoutEffect(F,Z)},ft.useMemo=function(F,Z){return ne.current.useMemo(F,Z)},ft.useReducer=function(F,Z,I){return ne.current.useReducer(F,Z,I)},ft.useRef=function(F){return ne.current.useRef(F)},ft.useState=function(F){return ne.current.useState(F)},ft.useSyncExternalStore=function(F,Z,I){return ne.current.useSyncExternalStore(F,Z,I)},ft.useTransition=function(){return ne.current.useTransition()},ft.version="18.3.1",ft}var ev;function Kh(){return ev||(ev=1,rm.exports=a2()),rm.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var tv;function i2(){if(tv)return pl;tv=1;var e=Kh(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(u,p,m){var h,g={},y=null,b=null;m!==void 0&&(y=""+m),p.key!==void 0&&(y=""+p.key),p.ref!==void 0&&(b=p.ref);for(h in p)s.call(p,h)&&!l.hasOwnProperty(h)&&(g[h]=p[h]);if(u&&u.defaultProps)for(h in p=u.defaultProps,p)g[h]===void 0&&(g[h]=p[h]);return{$$typeof:t,type:u,key:y,ref:b,props:g,_owner:a.current}}return pl.Fragment=n,pl.jsx=c,pl.jsxs=c,pl}var nv;function l2(){return nv||(nv=1,nm.exports=i2()),nm.exports}var r=l2(),f=Kh();const nn=Td(f),Fj=o2({__proto__:null,default:nn},[f]);var wu={},sm={exports:{}},er={},om={exports:{}},am={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var rv;function c2(){return rv||(rv=1,(function(e){function t(M,G){var A=M.length;M.push(G);e:for(;0<A;){var F=A-1>>>1,Z=M[F];if(0<a(Z,G))M[F]=G,M[A]=Z,A=F;else break e}}function n(M){return M.length===0?null:M[0]}function s(M){if(M.length===0)return null;var G=M[0],A=M.pop();if(A!==G){M[0]=A;e:for(var F=0,Z=M.length,I=Z>>>1;F<I;){var de=2*(F+1)-1,ge=M[de],V=de+1,ae=M[V];if(0>a(ge,A))V<Z&&0>a(ae,ge)?(M[F]=ae,M[V]=A,F=V):(M[F]=ge,M[de]=A,F=de);else if(V<Z&&0>a(ae,A))M[F]=ae,M[V]=A,F=V;else break e}}return G}function a(M,G){var A=M.sortIndex-G.sortIndex;return A!==0?A:M.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var p=[],m=[],h=1,g=null,y=3,b=!1,E=!1,j=!1,w=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(M){for(var G=n(m);G!==null;){if(G.callback===null)s(m);else if(G.startTime<=M)s(m),G.sortIndex=G.expirationTime,t(p,G);else break;G=n(m)}}function T(M){if(j=!1,N(M),!E)if(n(p)!==null)E=!0,ee(D);else{var G=n(m);G!==null&&ne(T,G.startTime-M)}}function D(M,G){E=!1,j&&(j=!1,k(L),L=-1),b=!0;var A=y;try{for(N(G),g=n(p);g!==null&&(!(g.expirationTime>G)||M&&!O());){var F=g.callback;if(typeof F=="function"){g.callback=null,y=g.priorityLevel;var Z=F(g.expirationTime<=G);G=e.unstable_now(),typeof Z=="function"?g.callback=Z:g===n(p)&&s(p),N(G)}else s(p);g=n(p)}if(g!==null)var I=!0;else{var de=n(m);de!==null&&ne(T,de.startTime-G),I=!1}return I}finally{g=null,y=A,b=!1}}var R=!1,$=null,L=-1,K=5,B=-1;function O(){return!(e.unstable_now()-B<K)}function W(){if($!==null){var M=e.unstable_now();B=M;var G=!0;try{G=$(!0,M)}finally{G?se():(R=!1,$=null)}}else R=!1}var se;if(typeof C=="function")se=function(){C(W)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,H=z.port2;z.port1.onmessage=W,se=function(){H.postMessage(null)}}else se=function(){w(W,0)};function ee(M){$=M,R||(R=!0,se())}function ne(M,G){L=w(function(){M(e.unstable_now())},G)}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(M){M.callback=null},e.unstable_continueExecution=function(){E||b||(E=!0,ee(D))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(p)},e.unstable_next=function(M){switch(y){case 1:case 2:case 3:var G=3;break;default:G=y}var A=y;y=G;try{return M()}finally{y=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,G){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var A=y;y=M;try{return G()}finally{y=A}},e.unstable_scheduleCallback=function(M,G,A){var F=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?F+A:F):A=F,M){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=A+Z,M={id:h++,callback:G,priorityLevel:M,startTime:A,expirationTime:Z,sortIndex:-1},A>F?(M.sortIndex=A,t(m,M),n(p)===null&&M===n(m)&&(j?(k(L),L=-1):j=!0,ne(T,A-F))):(M.sortIndex=Z,t(p,M),E||b||(E=!0,ee(D))),M},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(M){var G=y;return function(){var A=y;y=G;try{return M.apply(this,arguments)}finally{y=A}}}})(am)),am}var sv;function u2(){return sv||(sv=1,om.exports=c2()),om.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var ov;function d2(){if(ov)return er;ov=1;var e=Kh(),t=u2();function n(o){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)i+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function l(o,i){c(o,i),c(o+"Capture",i)}function c(o,i){for(a[o]=i,o=0;o<i.length;o++)s.add(i[o])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,m=/^[: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]*$/,h={},g={};function y(o){return p.call(g,o)?!0:p.call(h,o)?!1:m.test(o)?g[o]=!0:(h[o]=!0,!1)}function b(o,i,d,x){if(d!==null&&d.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return x?!1:d!==null?!d.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function E(o,i,d,x){if(i===null||typeof i>"u"||b(o,i,d,x))return!0;if(x)return!1;if(d!==null)switch(d.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function j(o,i,d,x,v,S,P){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=x,this.attributeNamespace=v,this.mustUseProperty=d,this.propertyName=o,this.type=i,this.sanitizeURL=S,this.removeEmptyString=P}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new j(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var i=o[0];w[i]=new j(i,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new j(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new j(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){w[o]=new j(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new j(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new j(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new j(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new j(o,5,!1,o.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function C(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var i=o.replace(k,C);w[i]=new j(i,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var i=o.replace(k,C);w[i]=new j(i,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var i=o.replace(k,C);w[i]=new j(i,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new j(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new j(o,1,!1,o.toLowerCase(),null,!0,!0)});function N(o,i,d,x){var v=w.hasOwnProperty(i)?w[i]:null;(v!==null?v.type!==0:x||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(E(i,d,v,x)&&(d=null),x||v===null?y(i)&&(d===null?o.removeAttribute(i):o.setAttribute(i,""+d)):v.mustUseProperty?o[v.propertyName]=d===null?v.type===3?!1:"":d:(i=v.attributeName,x=v.attributeNamespace,d===null?o.removeAttribute(i):(v=v.type,d=v===3||v===4&&d===!0?"":""+d,x?o.setAttributeNS(x,i,d):o.setAttribute(i,d))))}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),R=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),B=Symbol.for("react.provider"),O=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),M=Symbol.iterator;function G(o){return o===null||typeof o!="object"?null:(o=M&&o[M]||o["@@iterator"],typeof o=="function"?o:null)}var A=Object.assign,F;function Z(o){if(F===void 0)try{throw Error()}catch(d){var i=d.stack.trim().match(/\n( *(at )?)/);F=i&&i[1]||""}return`
|
|
34
|
-
`+F+o}var I=!1;function de(o,i){if(!o||I)return"";I=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(fe){var x=fe}Reflect.construct(o,[],i)}else{try{i.call()}catch(fe){x=fe}o.call(i.prototype)}else{try{throw Error()}catch(fe){x=fe}o()}}catch(fe){if(fe&&x&&typeof fe.stack=="string"){for(var v=fe.stack.split(`
|
|
35
|
-
`),S=x.stack.split(`
|
|
36
|
-
`),P=v.length-1,U=S.length-1;1<=P&&0<=U&&v[P]!==S[U];)U--;for(;1<=P&&0<=U;P--,U--)if(v[P]!==S[U]){if(P!==1||U!==1)do if(P--,U--,0>U||v[P]!==S[U]){var q=`
|
|
37
|
-
`+v[P].replace(" at new "," at ");return o.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",o.displayName)),q}while(1<=P&&0<=U);break}}}finally{I=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?Z(o):""}function ge(o){switch(o.tag){case 5:return Z(o.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return o=de(o.type,!1),o;case 11:return o=de(o.type.render,!1),o;case 1:return o=de(o.type,!0),o;default:return""}}function V(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case $:return"Fragment";case R:return"Portal";case K:return"Profiler";case L:return"StrictMode";case se:return"Suspense";case z:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case O:return(o.displayName||"Context")+".Consumer";case B:return(o._context.displayName||"Context")+".Provider";case W:var i=o.render;return o=o.displayName,o||(o=i.displayName||i.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case H:return i=o.displayName||null,i!==null?i:V(o.type)||"Memo";case ee:i=o._payload,o=o._init;try{return V(o(i))}catch{}}return null}function ae(o){var i=o.type;switch(o.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=i.render,o=o.displayName||o.name||"",i.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V(i);case 8:return i===L?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function me(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function ve(o){var i=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ke(o){var i=ve(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,i),x=""+o[i];if(!o.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var v=d.get,S=d.set;return Object.defineProperty(o,i,{configurable:!0,get:function(){return v.call(this)},set:function(P){x=""+P,S.call(this,P)}}),Object.defineProperty(o,i,{enumerable:d.enumerable}),{getValue:function(){return x},setValue:function(P){x=""+P},stopTracking:function(){o._valueTracker=null,delete o[i]}}}}function he(o){o._valueTracker||(o._valueTracker=ke(o))}function Je(o){if(!o)return!1;var i=o._valueTracker;if(!i)return!0;var d=i.getValue(),x="";return o&&(x=ve(o)?o.checked?"true":"false":o.value),o=x,o!==d?(i.setValue(o),!0):!1}function Ye(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function ot(o,i){var d=i.checked;return A({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??o._wrapperState.initialChecked})}function J(o,i){var d=i.defaultValue==null?"":i.defaultValue,x=i.checked!=null?i.checked:i.defaultChecked;d=me(i.value!=null?i.value:d),o._wrapperState={initialChecked:x,initialValue:d,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function Ie(o,i){i=i.checked,i!=null&&N(o,"checked",i,!1)}function Ne(o,i){Ie(o,i);var d=me(i.value),x=i.type;if(d!=null)x==="number"?(d===0&&o.value===""||o.value!=d)&&(o.value=""+d):o.value!==""+d&&(o.value=""+d);else if(x==="submit"||x==="reset"){o.removeAttribute("value");return}i.hasOwnProperty("value")?Xe(o,i.type,d):i.hasOwnProperty("defaultValue")&&Xe(o,i.type,me(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(o.defaultChecked=!!i.defaultChecked)}function Oe(o,i,d){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var x=i.type;if(!(x!=="submit"&&x!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+o._wrapperState.initialValue,d||i===o.value||(o.value=i),o.defaultValue=i}d=o.name,d!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,d!==""&&(o.name=d)}function Xe(o,i,d){(i!=="number"||Ye(o.ownerDocument)!==o)&&(d==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+d&&(o.defaultValue=""+d))}var Me=Array.isArray;function nt(o,i,d,x){if(o=o.options,i){i={};for(var v=0;v<d.length;v++)i["$"+d[v]]=!0;for(d=0;d<o.length;d++)v=i.hasOwnProperty("$"+o[d].value),o[d].selected!==v&&(o[d].selected=v),v&&x&&(o[d].defaultSelected=!0)}else{for(d=""+me(d),i=null,v=0;v<o.length;v++){if(o[v].value===d){o[v].selected=!0,x&&(o[v].defaultSelected=!0);return}i!==null||o[v].disabled||(i=o[v])}i!==null&&(i.selected=!0)}}function Ke(o,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return A({},i,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function gt(o,i){var d=i.value;if(d==null){if(d=i.children,i=i.defaultValue,d!=null){if(i!=null)throw Error(n(92));if(Me(d)){if(1<d.length)throw Error(n(93));d=d[0]}i=d}i==null&&(i=""),d=i}o._wrapperState={initialValue:me(d)}}function Rt(o,i){var d=me(i.value),x=me(i.defaultValue);d!=null&&(d=""+d,d!==o.value&&(o.value=d),i.defaultValue==null&&o.defaultValue!==d&&(o.defaultValue=d)),x!=null&&(o.defaultValue=""+x)}function at(o){var i=o.textContent;i===o._wrapperState.initialValue&&i!==""&&i!==null&&(o.value=i)}function ie(o){switch(o){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Y(o,i){return o==null||o==="http://www.w3.org/1999/xhtml"?ie(i):o==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var pe,Q=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,d,x,v){MSApp.execUnsafeLocalFunction(function(){return o(i,d,x,v)})}:o})(function(o,i){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=i;else{for(pe=pe||document.createElement("div"),pe.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=pe.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;i.firstChild;)o.appendChild(i.firstChild)}});function ye(o,i){if(i){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=i;return}}o.textContent=i}var Pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!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},lt=["Webkit","ms","Moz","O"];Object.keys(Pe).forEach(function(o){lt.forEach(function(i){i=i+o.charAt(0).toUpperCase()+o.substring(1),Pe[i]=Pe[o]})});function te(o,i,d){return i==null||typeof i=="boolean"||i===""?"":d||typeof i!="number"||i===0||Pe.hasOwnProperty(o)&&Pe[o]?(""+i).trim():i+"px"}function be(o,i){o=o.style;for(var d in i)if(i.hasOwnProperty(d)){var x=d.indexOf("--")===0,v=te(d,i[d],x);d==="float"&&(d="cssFloat"),x?o.setProperty(d,v):o[d]=v}}var Le=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function it(o,i){if(i){if(Le[o]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(n(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(n(61))}if(i.style!=null&&typeof i.style!="object")throw Error(n(62))}}function _e(o,i){if(o.indexOf("-")===-1)return typeof i.is=="string";switch(o){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 bt=null;function _t(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Gt=null,ue=null,Be=null;function Fe(o){if(o=Qi(o)){if(typeof Gt!="function")throw Error(n(280));var i=o.stateNode;i&&(i=Ic(i),Gt(o.stateNode,o.type,i))}}function Nt(o){ue?Be?Be.push(o):Be=[o]:ue=o}function $n(){if(ue){var o=ue,i=Be;if(Be=ue=null,Fe(o),i)for(o=0;o<i.length;o++)Fe(i[o])}}function Yt(o,i){return o(i)}function sn(){}var Wt=!1;function Gn(o,i,d){if(Wt)return o(i,d);Wt=!0;try{return Yt(o,i,d)}finally{Wt=!1,(ue!==null||Be!==null)&&(sn(),$n())}}function xt(o,i){var d=o.stateNode;if(d===null)return null;var x=Ic(d);if(x===null)return null;d=x[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(o=o.type,x=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!x;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(n(231,i,typeof d));return d}var jn=!1;if(u)try{var Pt={};Object.defineProperty(Pt,"passive",{get:function(){jn=!0}}),window.addEventListener("test",Pt,Pt),window.removeEventListener("test",Pt,Pt)}catch{jn=!1}function re(o,i,d,x,v,S,P,U,q){var fe=Array.prototype.slice.call(arguments,3);try{i.apply(d,fe)}catch(je){this.onError(je)}}var Ae=!1,Qe=null,Ft=!1,hn=null,Ct={onError:function(o){Ae=!0,Qe=o}};function jf(o,i,d,x,v,S,P,U,q){Ae=!1,Qe=null,re.apply(Ct,arguments)}function Ai(o,i,d,x,v,S,P,U,q){if(jf.apply(this,arguments),Ae){if(Ae){var fe=Qe;Ae=!1,Qe=null}else throw Error(n(198));Ft||(Ft=!0,hn=fe)}}function _r(o){var i=o,d=o;if(o.alternate)for(;i.return;)i=i.return;else{o=i;do i=o,(i.flags&4098)!==0&&(d=i.return),o=i.return;while(o)}return i.tag===3?d:null}function oa(o){if(o.tag===13){var i=o.memoizedState;if(i===null&&(o=o.alternate,o!==null&&(i=o.memoizedState)),i!==null)return i.dehydrated}return null}function aa(o){if(_r(o)!==o)throw Error(n(188))}function Di(o){var i=o.alternate;if(!i){if(i=_r(o),i===null)throw Error(n(188));return i!==o?null:o}for(var d=o,x=i;;){var v=d.return;if(v===null)break;var S=v.alternate;if(S===null){if(x=v.return,x!==null){d=x;continue}break}if(v.child===S.child){for(S=v.child;S;){if(S===d)return aa(v),o;if(S===x)return aa(v),i;S=S.sibling}throw Error(n(188))}if(d.return!==x.return)d=v,x=S;else{for(var P=!1,U=v.child;U;){if(U===d){P=!0,d=v,x=S;break}if(U===x){P=!0,x=v,d=S;break}U=U.sibling}if(!P){for(U=S.child;U;){if(U===d){P=!0,d=S,x=v;break}if(U===x){P=!0,x=S,d=v;break}U=U.sibling}if(!P)throw Error(n(189))}}if(d.alternate!==x)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?o:i}function ia(o){return o=Di(o),o!==null?la(o):null}function la(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var i=la(o);if(i!==null)return i;o=o.sibling}return null}var ca=t.unstable_scheduleCallback,go=t.unstable_cancelCallback,kf=t.unstable_shouldYield,ua=t.unstable_requestPaint,Lt=t.unstable_now,Sf=t.unstable_getCurrentPriorityLevel,$i=t.unstable_ImmediatePriority,xc=t.unstable_UserBlockingPriority,Bn=t.unstable_NormalPriority,Nf=t.unstable_LowPriority,yc=t.unstable_IdlePriority,da=null,vr=null;function Cf(o){if(vr&&typeof vr.onCommitFiberRoot=="function")try{vr.onCommitFiberRoot(da,o,void 0,(o.current.flags&128)===128)}catch{}}var jt=Math.clz32?Math.clz32:Ef,xo=Math.log,Li=Math.LN2;function Ef(o){return o>>>=0,o===0?32:31-(xo(o)/Li|0)|0}var fa=64,yo=4194304;function ys(o){switch(o&-o){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: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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function bo(o,i){var d=o.pendingLanes;if(d===0)return 0;var x=0,v=o.suspendedLanes,S=o.pingedLanes,P=d&268435455;if(P!==0){var U=P&~v;U!==0?x=ys(U):(S&=P,S!==0&&(x=ys(S)))}else P=d&~v,P!==0?x=ys(P):S!==0&&(x=ys(S));if(x===0)return 0;if(i!==0&&i!==x&&(i&v)===0&&(v=x&-x,S=i&-i,v>=S||v===16&&(S&4194240)!==0))return i;if((x&4)!==0&&(x|=d&16),i=o.entangledLanes,i!==0)for(o=o.entanglements,i&=x;0<i;)d=31-jt(i),v=1<<d,x|=o[d],i&=~v;return x}function vo(o,i){switch(o){case 1:case 2:case 4:return i+250;case 8:case 16:case 32:case 64: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 i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Oi(o,i){for(var d=o.suspendedLanes,x=o.pingedLanes,v=o.expirationTimes,S=o.pendingLanes;0<S;){var P=31-jt(S),U=1<<P,q=v[P];q===-1?((U&d)===0||(U&x)!==0)&&(v[P]=vo(U,i)):q<=i&&(o.expiredLanes|=U),S&=~U}}function Ii(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function bc(){var o=fa;return fa<<=1,(fa&4194240)===0&&(fa=64),o}function Ln(o){for(var i=[],d=0;31>d;d++)i.push(o);return i}function wo(o,i,d){o.pendingLanes|=i,i!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,i=31-jt(i),o[i]=d}function Mi(o,i){var d=o.pendingLanes&~i;o.pendingLanes=i,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=i,o.mutableReadLanes&=i,o.entangledLanes&=i,i=o.entanglements;var x=o.eventTimes;for(o=o.expirationTimes;0<d;){var v=31-jt(d),S=1<<v;i[v]=0,x[v]=-1,o[v]=-1,d&=~S}}function _i(o,i){var d=o.entangledLanes|=i;for(o=o.entanglements;d;){var x=31-jt(d),v=1<<x;v&i|o[x]&i&&(o[x]|=i),d&=~v}}var Et=0;function vc(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var es,_,le,xe,$e,ct=!1,pt=[],yt=null,cn=null,on=null,kn=new Map,Un=new Map,Fr=[],wc="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 submit".split(" ");function jo(o,i){switch(o){case"focusin":case"focusout":yt=null;break;case"dragenter":case"dragleave":cn=null;break;case"mouseover":case"mouseout":on=null;break;case"pointerover":case"pointerout":kn.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Un.delete(i.pointerId)}}function wr(o,i,d,x,v,S){return o===null||o.nativeEvent!==S?(o={blockedOn:i,domEventName:d,eventSystemFlags:x,nativeEvent:S,targetContainers:[v]},i!==null&&(i=Qi(i),i!==null&&_(i)),o):(o.eventSystemFlags|=x,i=o.targetContainers,v!==null&&i.indexOf(v)===-1&&i.push(v),o)}function CC(o,i,d,x,v){switch(i){case"focusin":return yt=wr(yt,o,i,d,x,v),!0;case"dragenter":return cn=wr(cn,o,i,d,x,v),!0;case"mouseover":return on=wr(on,o,i,d,x,v),!0;case"pointerover":var S=v.pointerId;return kn.set(S,wr(kn.get(S)||null,o,i,d,x,v)),!0;case"gotpointercapture":return S=v.pointerId,Un.set(S,wr(Un.get(S)||null,o,i,d,x,v)),!0}return!1}function Ix(o){var i=ko(o.target);if(i!==null){var d=_r(i);if(d!==null){if(i=d.tag,i===13){if(i=oa(d),i!==null){o.blockedOn=i,$e(o.priority,function(){le(d)});return}}else if(i===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function jc(o){if(o.blockedOn!==null)return!1;for(var i=o.targetContainers;0<i.length;){var d=Rf(o.domEventName,o.eventSystemFlags,i[0],o.nativeEvent);if(d===null){d=o.nativeEvent;var x=new d.constructor(d.type,d);bt=x,d.target.dispatchEvent(x),bt=null}else return i=Qi(d),i!==null&&_(i),o.blockedOn=d,!1;i.shift()}return!0}function Mx(o,i,d){jc(o)&&d.delete(i)}function EC(){ct=!1,yt!==null&&jc(yt)&&(yt=null),cn!==null&&jc(cn)&&(cn=null),on!==null&&jc(on)&&(on=null),kn.forEach(Mx),Un.forEach(Mx)}function Fi(o,i){o.blockedOn===i&&(o.blockedOn=null,ct||(ct=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,EC)))}function zi(o){function i(v){return Fi(v,o)}if(0<pt.length){Fi(pt[0],o);for(var d=1;d<pt.length;d++){var x=pt[d];x.blockedOn===o&&(x.blockedOn=null)}}for(yt!==null&&Fi(yt,o),cn!==null&&Fi(cn,o),on!==null&&Fi(on,o),kn.forEach(i),Un.forEach(i),d=0;d<Fr.length;d++)x=Fr[d],x.blockedOn===o&&(x.blockedOn=null);for(;0<Fr.length&&(d=Fr[0],d.blockedOn===null);)Ix(d),d.blockedOn===null&&Fr.shift()}var pa=T.ReactCurrentBatchConfig,kc=!0;function TC(o,i,d,x){var v=Et,S=pa.transition;pa.transition=null;try{Et=1,Tf(o,i,d,x)}finally{Et=v,pa.transition=S}}function RC(o,i,d,x){var v=Et,S=pa.transition;pa.transition=null;try{Et=4,Tf(o,i,d,x)}finally{Et=v,pa.transition=S}}function Tf(o,i,d,x){if(kc){var v=Rf(o,i,d,x);if(v===null)Kf(o,i,x,Sc,d),jo(o,x);else if(CC(v,o,i,d,x))x.stopPropagation();else if(jo(o,x),i&4&&-1<wc.indexOf(o)){for(;v!==null;){var S=Qi(v);if(S!==null&&es(S),S=Rf(o,i,d,x),S===null&&Kf(o,i,x,Sc,d),S===v)break;v=S}v!==null&&x.stopPropagation()}else Kf(o,i,x,null,d)}}var Sc=null;function Rf(o,i,d,x){if(Sc=null,o=_t(x),o=ko(o),o!==null)if(i=_r(o),i===null)o=null;else if(d=i.tag,d===13){if(o=oa(i),o!==null)return o;o=null}else if(d===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;o=null}else i!==o&&(o=null);return Sc=o,null}function _x(o){switch(o){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Sf()){case $i:return 1;case xc:return 4;case Bn:case Nf:return 16;case yc:return 536870912;default:return 16}default:return 16}}var Ms=null,Pf=null,Nc=null;function Fx(){if(Nc)return Nc;var o,i=Pf,d=i.length,x,v="value"in Ms?Ms.value:Ms.textContent,S=v.length;for(o=0;o<d&&i[o]===v[o];o++);var P=d-o;for(x=1;x<=P&&i[d-x]===v[S-x];x++);return Nc=v.slice(o,1<x?1-x:void 0)}function Cc(o){var i=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&i===13&&(o=13)):o=i,o===10&&(o=13),32<=o||o===13?o:0}function Ec(){return!0}function zx(){return!1}function cr(o){function i(d,x,v,S,P){this._reactName=d,this._targetInst=v,this.type=x,this.nativeEvent=S,this.target=P,this.currentTarget=null;for(var U in o)o.hasOwnProperty(U)&&(d=o[U],this[U]=d?d(S):S[U]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Ec:zx,this.isPropagationStopped=zx,this}return A(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Ec)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Ec)},persist:function(){},isPersistent:Ec}),i}var ma={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Af=cr(ma),Bi=A({},ma,{view:0,detail:0}),PC=cr(Bi),Df,$f,Ui,Tc=A({},Bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Of,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Ui&&(Ui&&o.type==="mousemove"?(Df=o.screenX-Ui.screenX,$f=o.screenY-Ui.screenY):$f=Df=0,Ui=o),Df)},movementY:function(o){return"movementY"in o?o.movementY:$f}}),Bx=cr(Tc),AC=A({},Tc,{dataTransfer:0}),DC=cr(AC),$C=A({},Bi,{relatedTarget:0}),Lf=cr($C),LC=A({},ma,{animationName:0,elapsedTime:0,pseudoElement:0}),OC=cr(LC),IC=A({},ma,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),MC=cr(IC),_C=A({},ma,{data:0}),Ux=cr(_C),FC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zC={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"},BC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UC(o){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(o):(o=BC[o])?!!i[o]:!1}function Of(){return UC}var VC=A({},Bi,{key:function(o){if(o.key){var i=FC[o.key]||o.key;if(i!=="Unidentified")return i}return o.type==="keypress"?(o=Cc(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?zC[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Of,charCode:function(o){return o.type==="keypress"?Cc(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Cc(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),HC=cr(VC),WC=A({},Tc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vx=cr(WC),KC=A({},Bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Of}),qC=cr(KC),GC=A({},ma,{propertyName:0,elapsedTime:0,pseudoElement:0}),YC=cr(GC),JC=A({},Tc,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),XC=cr(JC),QC=[9,13,27,32],If=u&&"CompositionEvent"in window,Vi=null;u&&"documentMode"in document&&(Vi=document.documentMode);var ZC=u&&"TextEvent"in window&&!Vi,Hx=u&&(!If||Vi&&8<Vi&&11>=Vi),Wx=" ",Kx=!1;function qx(o,i){switch(o){case"keyup":return QC.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gx(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var ha=!1;function eE(o,i){switch(o){case"compositionend":return Gx(i);case"keypress":return i.which!==32?null:(Kx=!0,Wx);case"textInput":return o=i.data,o===Wx&&Kx?null:o;default:return null}}function tE(o,i){if(ha)return o==="compositionend"||!If&&qx(o,i)?(o=Fx(),Nc=Pf=Ms=null,ha=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Hx&&i.locale!=="ko"?null:i.data;default:return null}}var nE={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 Yx(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i==="input"?!!nE[o.type]:i==="textarea"}function Jx(o,i,d,x){Nt(x),i=$c(i,"onChange"),0<i.length&&(d=new Af("onChange","change",null,d,x),o.push({event:d,listeners:i}))}var Hi=null,Wi=null;function rE(o){my(o,0)}function Rc(o){var i=va(o);if(Je(i))return o}function sE(o,i){if(o==="change")return i}var Xx=!1;if(u){var Mf;if(u){var _f="oninput"in document;if(!_f){var Qx=document.createElement("div");Qx.setAttribute("oninput","return;"),_f=typeof Qx.oninput=="function"}Mf=_f}else Mf=!1;Xx=Mf&&(!document.documentMode||9<document.documentMode)}function Zx(){Hi&&(Hi.detachEvent("onpropertychange",ey),Wi=Hi=null)}function ey(o){if(o.propertyName==="value"&&Rc(Wi)){var i=[];Jx(i,Wi,o,_t(o)),Gn(rE,i)}}function oE(o,i,d){o==="focusin"?(Zx(),Hi=i,Wi=d,Hi.attachEvent("onpropertychange",ey)):o==="focusout"&&Zx()}function aE(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Rc(Wi)}function iE(o,i){if(o==="click")return Rc(i)}function lE(o,i){if(o==="input"||o==="change")return Rc(i)}function cE(o,i){return o===i&&(o!==0||1/o===1/i)||o!==o&&i!==i}var zr=typeof Object.is=="function"?Object.is:cE;function Ki(o,i){if(zr(o,i))return!0;if(typeof o!="object"||o===null||typeof i!="object"||i===null)return!1;var d=Object.keys(o),x=Object.keys(i);if(d.length!==x.length)return!1;for(x=0;x<d.length;x++){var v=d[x];if(!p.call(i,v)||!zr(o[v],i[v]))return!1}return!0}function ty(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function ny(o,i){var d=ty(o);o=0;for(var x;d;){if(d.nodeType===3){if(x=o+d.textContent.length,o<=i&&x>=i)return{node:d,offset:i-o};o=x}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=ty(d)}}function ry(o,i){return o&&i?o===i?!0:o&&o.nodeType===3?!1:i&&i.nodeType===3?ry(o,i.parentNode):"contains"in o?o.contains(i):o.compareDocumentPosition?!!(o.compareDocumentPosition(i)&16):!1:!1}function sy(){for(var o=window,i=Ye();i instanceof o.HTMLIFrameElement;){try{var d=typeof i.contentWindow.location.href=="string"}catch{d=!1}if(d)o=i.contentWindow;else break;i=Ye(o.document)}return i}function Ff(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i&&(i==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||i==="textarea"||o.contentEditable==="true")}function uE(o){var i=sy(),d=o.focusedElem,x=o.selectionRange;if(i!==d&&d&&d.ownerDocument&&ry(d.ownerDocument.documentElement,d)){if(x!==null&&Ff(d)){if(i=x.start,o=x.end,o===void 0&&(o=i),"selectionStart"in d)d.selectionStart=i,d.selectionEnd=Math.min(o,d.value.length);else if(o=(i=d.ownerDocument||document)&&i.defaultView||window,o.getSelection){o=o.getSelection();var v=d.textContent.length,S=Math.min(x.start,v);x=x.end===void 0?S:Math.min(x.end,v),!o.extend&&S>x&&(v=x,x=S,S=v),v=ny(d,S);var P=ny(d,x);v&&P&&(o.rangeCount!==1||o.anchorNode!==v.node||o.anchorOffset!==v.offset||o.focusNode!==P.node||o.focusOffset!==P.offset)&&(i=i.createRange(),i.setStart(v.node,v.offset),o.removeAllRanges(),S>x?(o.addRange(i),o.extend(P.node,P.offset)):(i.setEnd(P.node,P.offset),o.addRange(i)))}}for(i=[],o=d;o=o.parentNode;)o.nodeType===1&&i.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<i.length;d++)o=i[d],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var dE=u&&"documentMode"in document&&11>=document.documentMode,ga=null,zf=null,qi=null,Bf=!1;function oy(o,i,d){var x=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Bf||ga==null||ga!==Ye(x)||(x=ga,"selectionStart"in x&&Ff(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),qi&&Ki(qi,x)||(qi=x,x=$c(zf,"onSelect"),0<x.length&&(i=new Af("onSelect","select",null,i,d),o.push({event:i,listeners:x}),i.target=ga)))}function Pc(o,i){var d={};return d[o.toLowerCase()]=i.toLowerCase(),d["Webkit"+o]="webkit"+i,d["Moz"+o]="moz"+i,d}var xa={animationend:Pc("Animation","AnimationEnd"),animationiteration:Pc("Animation","AnimationIteration"),animationstart:Pc("Animation","AnimationStart"),transitionend:Pc("Transition","TransitionEnd")},Uf={},ay={};u&&(ay=document.createElement("div").style,"AnimationEvent"in window||(delete xa.animationend.animation,delete xa.animationiteration.animation,delete xa.animationstart.animation),"TransitionEvent"in window||delete xa.transitionend.transition);function Ac(o){if(Uf[o])return Uf[o];if(!xa[o])return o;var i=xa[o],d;for(d in i)if(i.hasOwnProperty(d)&&d in ay)return Uf[o]=i[d];return o}var iy=Ac("animationend"),ly=Ac("animationiteration"),cy=Ac("animationstart"),uy=Ac("transitionend"),dy=new Map,fy="abort auxClick 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(" ");function _s(o,i){dy.set(o,i),l(i,[o])}for(var Vf=0;Vf<fy.length;Vf++){var Hf=fy[Vf],fE=Hf.toLowerCase(),pE=Hf[0].toUpperCase()+Hf.slice(1);_s(fE,"on"+pE)}_s(iy,"onAnimationEnd"),_s(ly,"onAnimationIteration"),_s(cy,"onAnimationStart"),_s("dblclick","onDoubleClick"),_s("focusin","onFocus"),_s("focusout","onBlur"),_s(uy,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gi="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(" "),mE=new Set("cancel close invalid load scroll toggle".split(" ").concat(Gi));function py(o,i,d){var x=o.type||"unknown-event";o.currentTarget=d,Ai(x,i,void 0,o),o.currentTarget=null}function my(o,i){i=(i&4)!==0;for(var d=0;d<o.length;d++){var x=o[d],v=x.event;x=x.listeners;e:{var S=void 0;if(i)for(var P=x.length-1;0<=P;P--){var U=x[P],q=U.instance,fe=U.currentTarget;if(U=U.listener,q!==S&&v.isPropagationStopped())break e;py(v,U,fe),S=q}else for(P=0;P<x.length;P++){if(U=x[P],q=U.instance,fe=U.currentTarget,U=U.listener,q!==S&&v.isPropagationStopped())break e;py(v,U,fe),S=q}}}if(Ft)throw o=hn,Ft=!1,hn=null,o}function zt(o,i){var d=i[Qf];d===void 0&&(d=i[Qf]=new Set);var x=o+"__bubble";d.has(x)||(hy(i,o,2,!1),d.add(x))}function Wf(o,i,d){var x=0;i&&(x|=4),hy(d,o,x,i)}var Dc="_reactListening"+Math.random().toString(36).slice(2);function Yi(o){if(!o[Dc]){o[Dc]=!0,s.forEach(function(d){d!=="selectionchange"&&(mE.has(d)||Wf(d,!1,o),Wf(d,!0,o))});var i=o.nodeType===9?o:o.ownerDocument;i===null||i[Dc]||(i[Dc]=!0,Wf("selectionchange",!1,i))}}function hy(o,i,d,x){switch(_x(i)){case 1:var v=TC;break;case 4:v=RC;break;default:v=Tf}d=v.bind(null,i,d,o),v=void 0,!jn||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(v=!0),x?v!==void 0?o.addEventListener(i,d,{capture:!0,passive:v}):o.addEventListener(i,d,!0):v!==void 0?o.addEventListener(i,d,{passive:v}):o.addEventListener(i,d,!1)}function Kf(o,i,d,x,v){var S=x;if((i&1)===0&&(i&2)===0&&x!==null)e:for(;;){if(x===null)return;var P=x.tag;if(P===3||P===4){var U=x.stateNode.containerInfo;if(U===v||U.nodeType===8&&U.parentNode===v)break;if(P===4)for(P=x.return;P!==null;){var q=P.tag;if((q===3||q===4)&&(q=P.stateNode.containerInfo,q===v||q.nodeType===8&&q.parentNode===v))return;P=P.return}for(;U!==null;){if(P=ko(U),P===null)return;if(q=P.tag,q===5||q===6){x=S=P;continue e}U=U.parentNode}}x=x.return}Gn(function(){var fe=S,je=_t(d),Ce=[];e:{var we=dy.get(o);if(we!==void 0){var ze=Af,Ve=o;switch(o){case"keypress":if(Cc(d)===0)break e;case"keydown":case"keyup":ze=HC;break;case"focusin":Ve="focus",ze=Lf;break;case"focusout":Ve="blur",ze=Lf;break;case"beforeblur":case"afterblur":ze=Lf;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ze=Bx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ze=DC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ze=qC;break;case iy:case ly:case cy:ze=OC;break;case uy:ze=YC;break;case"scroll":ze=PC;break;case"wheel":ze=XC;break;case"copy":case"cut":case"paste":ze=MC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ze=Vx}var qe=(i&4)!==0,an=!qe&&o==="scroll",oe=qe?we!==null?we+"Capture":null:we;qe=[];for(var X=fe,ce;X!==null;){ce=X;var Re=ce.stateNode;if(ce.tag===5&&Re!==null&&(ce=Re,oe!==null&&(Re=xt(X,oe),Re!=null&&qe.push(Ji(X,Re,ce)))),an)break;X=X.return}0<qe.length&&(we=new ze(we,Ve,null,d,je),Ce.push({event:we,listeners:qe}))}}if((i&7)===0){e:{if(we=o==="mouseover"||o==="pointerover",ze=o==="mouseout"||o==="pointerout",we&&d!==bt&&(Ve=d.relatedTarget||d.fromElement)&&(ko(Ve)||Ve[bs]))break e;if((ze||we)&&(we=je.window===je?je:(we=je.ownerDocument)?we.defaultView||we.parentWindow:window,ze?(Ve=d.relatedTarget||d.toElement,ze=fe,Ve=Ve?ko(Ve):null,Ve!==null&&(an=_r(Ve),Ve!==an||Ve.tag!==5&&Ve.tag!==6)&&(Ve=null)):(ze=null,Ve=fe),ze!==Ve)){if(qe=Bx,Re="onMouseLeave",oe="onMouseEnter",X="mouse",(o==="pointerout"||o==="pointerover")&&(qe=Vx,Re="onPointerLeave",oe="onPointerEnter",X="pointer"),an=ze==null?we:va(ze),ce=Ve==null?we:va(Ve),we=new qe(Re,X+"leave",ze,d,je),we.target=an,we.relatedTarget=ce,Re=null,ko(je)===fe&&(qe=new qe(oe,X+"enter",Ve,d,je),qe.target=ce,qe.relatedTarget=an,Re=qe),an=Re,ze&&Ve)t:{for(qe=ze,oe=Ve,X=0,ce=qe;ce;ce=ya(ce))X++;for(ce=0,Re=oe;Re;Re=ya(Re))ce++;for(;0<X-ce;)qe=ya(qe),X--;for(;0<ce-X;)oe=ya(oe),ce--;for(;X--;){if(qe===oe||oe!==null&&qe===oe.alternate)break t;qe=ya(qe),oe=ya(oe)}qe=null}else qe=null;ze!==null&&gy(Ce,we,ze,qe,!1),Ve!==null&&an!==null&&gy(Ce,an,Ve,qe,!0)}}e:{if(we=fe?va(fe):window,ze=we.nodeName&&we.nodeName.toLowerCase(),ze==="select"||ze==="input"&&we.type==="file")var Ge=sE;else if(Yx(we))if(Xx)Ge=lE;else{Ge=aE;var Ze=oE}else(ze=we.nodeName)&&ze.toLowerCase()==="input"&&(we.type==="checkbox"||we.type==="radio")&&(Ge=iE);if(Ge&&(Ge=Ge(o,fe))){Jx(Ce,Ge,d,je);break e}Ze&&Ze(o,we,fe),o==="focusout"&&(Ze=we._wrapperState)&&Ze.controlled&&we.type==="number"&&Xe(we,"number",we.value)}switch(Ze=fe?va(fe):window,o){case"focusin":(Yx(Ze)||Ze.contentEditable==="true")&&(ga=Ze,zf=fe,qi=null);break;case"focusout":qi=zf=ga=null;break;case"mousedown":Bf=!0;break;case"contextmenu":case"mouseup":case"dragend":Bf=!1,oy(Ce,d,je);break;case"selectionchange":if(dE)break;case"keydown":case"keyup":oy(Ce,d,je)}var et;if(If)e:{switch(o){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else ha?qx(o,d)&&(rt="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(rt="onCompositionStart");rt&&(Hx&&d.locale!=="ko"&&(ha||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&ha&&(et=Fx()):(Ms=je,Pf="value"in Ms?Ms.value:Ms.textContent,ha=!0)),Ze=$c(fe,rt),0<Ze.length&&(rt=new Ux(rt,o,null,d,je),Ce.push({event:rt,listeners:Ze}),et?rt.data=et:(et=Gx(d),et!==null&&(rt.data=et)))),(et=ZC?eE(o,d):tE(o,d))&&(fe=$c(fe,"onBeforeInput"),0<fe.length&&(je=new Ux("onBeforeInput","beforeinput",null,d,je),Ce.push({event:je,listeners:fe}),je.data=et))}my(Ce,i)})}function Ji(o,i,d){return{instance:o,listener:i,currentTarget:d}}function $c(o,i){for(var d=i+"Capture",x=[];o!==null;){var v=o,S=v.stateNode;v.tag===5&&S!==null&&(v=S,S=xt(o,d),S!=null&&x.unshift(Ji(o,S,v)),S=xt(o,i),S!=null&&x.push(Ji(o,S,v))),o=o.return}return x}function ya(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function gy(o,i,d,x,v){for(var S=i._reactName,P=[];d!==null&&d!==x;){var U=d,q=U.alternate,fe=U.stateNode;if(q!==null&&q===x)break;U.tag===5&&fe!==null&&(U=fe,v?(q=xt(d,S),q!=null&&P.unshift(Ji(d,q,U))):v||(q=xt(d,S),q!=null&&P.push(Ji(d,q,U)))),d=d.return}P.length!==0&&o.push({event:i,listeners:P})}var hE=/\r\n?/g,gE=/\u0000|\uFFFD/g;function xy(o){return(typeof o=="string"?o:""+o).replace(hE,`
|
|
38
|
-
`).replace(gE,"")}function Lc(o,i,d){if(i=xy(i),xy(o)!==i&&d)throw Error(n(425))}function Oc(){}var qf=null,Gf=null;function Yf(o,i){return o==="textarea"||o==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Jf=typeof setTimeout=="function"?setTimeout:void 0,xE=typeof clearTimeout=="function"?clearTimeout:void 0,yy=typeof Promise=="function"?Promise:void 0,yE=typeof queueMicrotask=="function"?queueMicrotask:typeof yy<"u"?function(o){return yy.resolve(null).then(o).catch(bE)}:Jf;function bE(o){setTimeout(function(){throw o})}function Xf(o,i){var d=i,x=0;do{var v=d.nextSibling;if(o.removeChild(d),v&&v.nodeType===8)if(d=v.data,d==="/$"){if(x===0){o.removeChild(v),zi(i);return}x--}else d!=="$"&&d!=="$?"&&d!=="$!"||x++;d=v}while(d);zi(i)}function Fs(o){for(;o!=null;o=o.nextSibling){var i=o.nodeType;if(i===1||i===3)break;if(i===8){if(i=o.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return o}function by(o){o=o.previousSibling;for(var i=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"){if(i===0)return o;i--}else d==="/$"&&i++}o=o.previousSibling}return null}var ba=Math.random().toString(36).slice(2),ts="__reactFiber$"+ba,Xi="__reactProps$"+ba,bs="__reactContainer$"+ba,Qf="__reactEvents$"+ba,vE="__reactListeners$"+ba,wE="__reactHandles$"+ba;function ko(o){var i=o[ts];if(i)return i;for(var d=o.parentNode;d;){if(i=d[bs]||d[ts]){if(d=i.alternate,i.child!==null||d!==null&&d.child!==null)for(o=by(o);o!==null;){if(d=o[ts])return d;o=by(o)}return i}o=d,d=o.parentNode}return null}function Qi(o){return o=o[ts]||o[bs],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function va(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function Ic(o){return o[Xi]||null}var Zf=[],wa=-1;function zs(o){return{current:o}}function Bt(o){0>wa||(o.current=Zf[wa],Zf[wa]=null,wa--)}function Ot(o,i){wa++,Zf[wa]=o.current,o.current=i}var Bs={},On=zs(Bs),Yn=zs(!1),So=Bs;function ja(o,i){var d=o.type.contextTypes;if(!d)return Bs;var x=o.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===i)return x.__reactInternalMemoizedMaskedChildContext;var v={},S;for(S in d)v[S]=i[S];return x&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=i,o.__reactInternalMemoizedMaskedChildContext=v),v}function Jn(o){return o=o.childContextTypes,o!=null}function Mc(){Bt(Yn),Bt(On)}function vy(o,i,d){if(On.current!==Bs)throw Error(n(168));Ot(On,i),Ot(Yn,d)}function wy(o,i,d){var x=o.stateNode;if(i=i.childContextTypes,typeof x.getChildContext!="function")return d;x=x.getChildContext();for(var v in x)if(!(v in i))throw Error(n(108,ae(o)||"Unknown",v));return A({},d,x)}function _c(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Bs,So=On.current,Ot(On,o),Ot(Yn,Yn.current),!0}function jy(o,i,d){var x=o.stateNode;if(!x)throw Error(n(169));d?(o=wy(o,i,So),x.__reactInternalMemoizedMergedChildContext=o,Bt(Yn),Bt(On),Ot(On,o)):Bt(Yn),Ot(Yn,d)}var vs=null,Fc=!1,ep=!1;function ky(o){vs===null?vs=[o]:vs.push(o)}function jE(o){Fc=!0,ky(o)}function Us(){if(!ep&&vs!==null){ep=!0;var o=0,i=Et;try{var d=vs;for(Et=1;o<d.length;o++){var x=d[o];do x=x(!0);while(x!==null)}vs=null,Fc=!1}catch(v){throw vs!==null&&(vs=vs.slice(o+1)),ca($i,Us),v}finally{Et=i,ep=!1}}return null}var ka=[],Sa=0,zc=null,Bc=0,jr=[],kr=0,No=null,ws=1,js="";function Co(o,i){ka[Sa++]=Bc,ka[Sa++]=zc,zc=o,Bc=i}function Sy(o,i,d){jr[kr++]=ws,jr[kr++]=js,jr[kr++]=No,No=o;var x=ws;o=js;var v=32-jt(x)-1;x&=~(1<<v),d+=1;var S=32-jt(i)+v;if(30<S){var P=v-v%5;S=(x&(1<<P)-1).toString(32),x>>=P,v-=P,ws=1<<32-jt(i)+v|d<<v|x,js=S+o}else ws=1<<S|d<<v|x,js=o}function tp(o){o.return!==null&&(Co(o,1),Sy(o,1,0))}function np(o){for(;o===zc;)zc=ka[--Sa],ka[Sa]=null,Bc=ka[--Sa],ka[Sa]=null;for(;o===No;)No=jr[--kr],jr[kr]=null,js=jr[--kr],jr[kr]=null,ws=jr[--kr],jr[kr]=null}var ur=null,dr=null,Kt=!1,Br=null;function Ny(o,i){var d=Er(5,null,null,0);d.elementType="DELETED",d.stateNode=i,d.return=o,i=o.deletions,i===null?(o.deletions=[d],o.flags|=16):i.push(d)}function Cy(o,i){switch(o.tag){case 5:var d=o.type;return i=i.nodeType!==1||d.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(o.stateNode=i,ur=o,dr=Fs(i.firstChild),!0):!1;case 6:return i=o.pendingProps===""||i.nodeType!==3?null:i,i!==null?(o.stateNode=i,ur=o,dr=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(d=No!==null?{id:ws,overflow:js}:null,o.memoizedState={dehydrated:i,treeContext:d,retryLane:1073741824},d=Er(18,null,null,0),d.stateNode=i,d.return=o,o.child=d,ur=o,dr=null,!0):!1;default:return!1}}function rp(o){return(o.mode&1)!==0&&(o.flags&128)===0}function sp(o){if(Kt){var i=dr;if(i){var d=i;if(!Cy(o,i)){if(rp(o))throw Error(n(418));i=Fs(d.nextSibling);var x=ur;i&&Cy(o,i)?Ny(x,d):(o.flags=o.flags&-4097|2,Kt=!1,ur=o)}}else{if(rp(o))throw Error(n(418));o.flags=o.flags&-4097|2,Kt=!1,ur=o}}}function Ey(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;ur=o}function Uc(o){if(o!==ur)return!1;if(!Kt)return Ey(o),Kt=!0,!1;var i;if((i=o.tag!==3)&&!(i=o.tag!==5)&&(i=o.type,i=i!=="head"&&i!=="body"&&!Yf(o.type,o.memoizedProps)),i&&(i=dr)){if(rp(o))throw Ty(),Error(n(418));for(;i;)Ny(o,i),i=Fs(i.nextSibling)}if(Ey(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,i=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"){if(i===0){dr=Fs(o.nextSibling);break e}i--}else d!=="$"&&d!=="$!"&&d!=="$?"||i++}o=o.nextSibling}dr=null}}else dr=ur?Fs(o.stateNode.nextSibling):null;return!0}function Ty(){for(var o=dr;o;)o=Fs(o.nextSibling)}function Na(){dr=ur=null,Kt=!1}function op(o){Br===null?Br=[o]:Br.push(o)}var kE=T.ReactCurrentBatchConfig;function Zi(o,i,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var x=d.stateNode}if(!x)throw Error(n(147,o));var v=x,S=""+o;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===S?i.ref:(i=function(P){var U=v.refs;P===null?delete U[S]:U[S]=P},i._stringRef=S,i)}if(typeof o!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,o))}return o}function Vc(o,i){throw o=Object.prototype.toString.call(i),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":o))}function Ry(o){var i=o._init;return i(o._payload)}function Py(o){function i(oe,X){if(o){var ce=oe.deletions;ce===null?(oe.deletions=[X],oe.flags|=16):ce.push(X)}}function d(oe,X){if(!o)return null;for(;X!==null;)i(oe,X),X=X.sibling;return null}function x(oe,X){for(oe=new Map;X!==null;)X.key!==null?oe.set(X.key,X):oe.set(X.index,X),X=X.sibling;return oe}function v(oe,X){return oe=Js(oe,X),oe.index=0,oe.sibling=null,oe}function S(oe,X,ce){return oe.index=ce,o?(ce=oe.alternate,ce!==null?(ce=ce.index,ce<X?(oe.flags|=2,X):ce):(oe.flags|=2,X)):(oe.flags|=1048576,X)}function P(oe){return o&&oe.alternate===null&&(oe.flags|=2),oe}function U(oe,X,ce,Re){return X===null||X.tag!==6?(X=Jp(ce,oe.mode,Re),X.return=oe,X):(X=v(X,ce),X.return=oe,X)}function q(oe,X,ce,Re){var Ge=ce.type;return Ge===$?je(oe,X,ce.props.children,Re,ce.key):X!==null&&(X.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===ee&&Ry(Ge)===X.type)?(Re=v(X,ce.props),Re.ref=Zi(oe,X,ce),Re.return=oe,Re):(Re=pu(ce.type,ce.key,ce.props,null,oe.mode,Re),Re.ref=Zi(oe,X,ce),Re.return=oe,Re)}function fe(oe,X,ce,Re){return X===null||X.tag!==4||X.stateNode.containerInfo!==ce.containerInfo||X.stateNode.implementation!==ce.implementation?(X=Xp(ce,oe.mode,Re),X.return=oe,X):(X=v(X,ce.children||[]),X.return=oe,X)}function je(oe,X,ce,Re,Ge){return X===null||X.tag!==7?(X=Lo(ce,oe.mode,Re,Ge),X.return=oe,X):(X=v(X,ce),X.return=oe,X)}function Ce(oe,X,ce){if(typeof X=="string"&&X!==""||typeof X=="number")return X=Jp(""+X,oe.mode,ce),X.return=oe,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case D:return ce=pu(X.type,X.key,X.props,null,oe.mode,ce),ce.ref=Zi(oe,null,X),ce.return=oe,ce;case R:return X=Xp(X,oe.mode,ce),X.return=oe,X;case ee:var Re=X._init;return Ce(oe,Re(X._payload),ce)}if(Me(X)||G(X))return X=Lo(X,oe.mode,ce,null),X.return=oe,X;Vc(oe,X)}return null}function we(oe,X,ce,Re){var Ge=X!==null?X.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number")return Ge!==null?null:U(oe,X,""+ce,Re);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case D:return ce.key===Ge?q(oe,X,ce,Re):null;case R:return ce.key===Ge?fe(oe,X,ce,Re):null;case ee:return Ge=ce._init,we(oe,X,Ge(ce._payload),Re)}if(Me(ce)||G(ce))return Ge!==null?null:je(oe,X,ce,Re,null);Vc(oe,ce)}return null}function ze(oe,X,ce,Re,Ge){if(typeof Re=="string"&&Re!==""||typeof Re=="number")return oe=oe.get(ce)||null,U(X,oe,""+Re,Ge);if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case D:return oe=oe.get(Re.key===null?ce:Re.key)||null,q(X,oe,Re,Ge);case R:return oe=oe.get(Re.key===null?ce:Re.key)||null,fe(X,oe,Re,Ge);case ee:var Ze=Re._init;return ze(oe,X,ce,Ze(Re._payload),Ge)}if(Me(Re)||G(Re))return oe=oe.get(ce)||null,je(X,oe,Re,Ge,null);Vc(X,Re)}return null}function Ve(oe,X,ce,Re){for(var Ge=null,Ze=null,et=X,rt=X=0,Cn=null;et!==null&&rt<ce.length;rt++){et.index>rt?(Cn=et,et=null):Cn=et.sibling;var kt=we(oe,et,ce[rt],Re);if(kt===null){et===null&&(et=Cn);break}o&&et&&kt.alternate===null&&i(oe,et),X=S(kt,X,rt),Ze===null?Ge=kt:Ze.sibling=kt,Ze=kt,et=Cn}if(rt===ce.length)return d(oe,et),Kt&&Co(oe,rt),Ge;if(et===null){for(;rt<ce.length;rt++)et=Ce(oe,ce[rt],Re),et!==null&&(X=S(et,X,rt),Ze===null?Ge=et:Ze.sibling=et,Ze=et);return Kt&&Co(oe,rt),Ge}for(et=x(oe,et);rt<ce.length;rt++)Cn=ze(et,oe,rt,ce[rt],Re),Cn!==null&&(o&&Cn.alternate!==null&&et.delete(Cn.key===null?rt:Cn.key),X=S(Cn,X,rt),Ze===null?Ge=Cn:Ze.sibling=Cn,Ze=Cn);return o&&et.forEach(function(Xs){return i(oe,Xs)}),Kt&&Co(oe,rt),Ge}function qe(oe,X,ce,Re){var Ge=G(ce);if(typeof Ge!="function")throw Error(n(150));if(ce=Ge.call(ce),ce==null)throw Error(n(151));for(var Ze=Ge=null,et=X,rt=X=0,Cn=null,kt=ce.next();et!==null&&!kt.done;rt++,kt=ce.next()){et.index>rt?(Cn=et,et=null):Cn=et.sibling;var Xs=we(oe,et,kt.value,Re);if(Xs===null){et===null&&(et=Cn);break}o&&et&&Xs.alternate===null&&i(oe,et),X=S(Xs,X,rt),Ze===null?Ge=Xs:Ze.sibling=Xs,Ze=Xs,et=Cn}if(kt.done)return d(oe,et),Kt&&Co(oe,rt),Ge;if(et===null){for(;!kt.done;rt++,kt=ce.next())kt=Ce(oe,kt.value,Re),kt!==null&&(X=S(kt,X,rt),Ze===null?Ge=kt:Ze.sibling=kt,Ze=kt);return Kt&&Co(oe,rt),Ge}for(et=x(oe,et);!kt.done;rt++,kt=ce.next())kt=ze(et,oe,rt,kt.value,Re),kt!==null&&(o&&kt.alternate!==null&&et.delete(kt.key===null?rt:kt.key),X=S(kt,X,rt),Ze===null?Ge=kt:Ze.sibling=kt,Ze=kt);return o&&et.forEach(function(n2){return i(oe,n2)}),Kt&&Co(oe,rt),Ge}function an(oe,X,ce,Re){if(typeof ce=="object"&&ce!==null&&ce.type===$&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case D:e:{for(var Ge=ce.key,Ze=X;Ze!==null;){if(Ze.key===Ge){if(Ge=ce.type,Ge===$){if(Ze.tag===7){d(oe,Ze.sibling),X=v(Ze,ce.props.children),X.return=oe,oe=X;break e}}else if(Ze.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===ee&&Ry(Ge)===Ze.type){d(oe,Ze.sibling),X=v(Ze,ce.props),X.ref=Zi(oe,Ze,ce),X.return=oe,oe=X;break e}d(oe,Ze);break}else i(oe,Ze);Ze=Ze.sibling}ce.type===$?(X=Lo(ce.props.children,oe.mode,Re,ce.key),X.return=oe,oe=X):(Re=pu(ce.type,ce.key,ce.props,null,oe.mode,Re),Re.ref=Zi(oe,X,ce),Re.return=oe,oe=Re)}return P(oe);case R:e:{for(Ze=ce.key;X!==null;){if(X.key===Ze)if(X.tag===4&&X.stateNode.containerInfo===ce.containerInfo&&X.stateNode.implementation===ce.implementation){d(oe,X.sibling),X=v(X,ce.children||[]),X.return=oe,oe=X;break e}else{d(oe,X);break}else i(oe,X);X=X.sibling}X=Xp(ce,oe.mode,Re),X.return=oe,oe=X}return P(oe);case ee:return Ze=ce._init,an(oe,X,Ze(ce._payload),Re)}if(Me(ce))return Ve(oe,X,ce,Re);if(G(ce))return qe(oe,X,ce,Re);Vc(oe,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"?(ce=""+ce,X!==null&&X.tag===6?(d(oe,X.sibling),X=v(X,ce),X.return=oe,oe=X):(d(oe,X),X=Jp(ce,oe.mode,Re),X.return=oe,oe=X),P(oe)):d(oe,X)}return an}var Ca=Py(!0),Ay=Py(!1),Hc=zs(null),Wc=null,Ea=null,ap=null;function ip(){ap=Ea=Wc=null}function lp(o){var i=Hc.current;Bt(Hc),o._currentValue=i}function cp(o,i,d){for(;o!==null;){var x=o.alternate;if((o.childLanes&i)!==i?(o.childLanes|=i,x!==null&&(x.childLanes|=i)):x!==null&&(x.childLanes&i)!==i&&(x.childLanes|=i),o===d)break;o=o.return}}function Ta(o,i){Wc=o,ap=Ea=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&i)!==0&&(Xn=!0),o.firstContext=null)}function Sr(o){var i=o._currentValue;if(ap!==o)if(o={context:o,memoizedValue:i,next:null},Ea===null){if(Wc===null)throw Error(n(308));Ea=o,Wc.dependencies={lanes:0,firstContext:o}}else Ea=Ea.next=o;return i}var Eo=null;function up(o){Eo===null?Eo=[o]:Eo.push(o)}function Dy(o,i,d,x){var v=i.interleaved;return v===null?(d.next=d,up(i)):(d.next=v.next,v.next=d),i.interleaved=d,ks(o,x)}function ks(o,i){o.lanes|=i;var d=o.alternate;for(d!==null&&(d.lanes|=i),d=o,o=o.return;o!==null;)o.childLanes|=i,d=o.alternate,d!==null&&(d.childLanes|=i),d=o,o=o.return;return d.tag===3?d.stateNode:null}var Vs=!1;function dp(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $y(o,i){o=o.updateQueue,i.updateQueue===o&&(i.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Ss(o,i){return{eventTime:o,lane:i,tag:0,payload:null,callback:null,next:null}}function Hs(o,i,d){var x=o.updateQueue;if(x===null)return null;if(x=x.shared,(vt&2)!==0){var v=x.pending;return v===null?i.next=i:(i.next=v.next,v.next=i),x.pending=i,ks(o,d)}return v=x.interleaved,v===null?(i.next=i,up(x)):(i.next=v.next,v.next=i),x.interleaved=i,ks(o,d)}function Kc(o,i,d){if(i=i.updateQueue,i!==null&&(i=i.shared,(d&4194240)!==0)){var x=i.lanes;x&=o.pendingLanes,d|=x,i.lanes=d,_i(o,d)}}function Ly(o,i){var d=o.updateQueue,x=o.alternate;if(x!==null&&(x=x.updateQueue,d===x)){var v=null,S=null;if(d=d.firstBaseUpdate,d!==null){do{var P={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};S===null?v=S=P:S=S.next=P,d=d.next}while(d!==null);S===null?v=S=i:S=S.next=i}else v=S=i;d={baseState:x.baseState,firstBaseUpdate:v,lastBaseUpdate:S,shared:x.shared,effects:x.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=i:o.next=i,d.lastBaseUpdate=i}function qc(o,i,d,x){var v=o.updateQueue;Vs=!1;var S=v.firstBaseUpdate,P=v.lastBaseUpdate,U=v.shared.pending;if(U!==null){v.shared.pending=null;var q=U,fe=q.next;q.next=null,P===null?S=fe:P.next=fe,P=q;var je=o.alternate;je!==null&&(je=je.updateQueue,U=je.lastBaseUpdate,U!==P&&(U===null?je.firstBaseUpdate=fe:U.next=fe,je.lastBaseUpdate=q))}if(S!==null){var Ce=v.baseState;P=0,je=fe=q=null,U=S;do{var we=U.lane,ze=U.eventTime;if((x&we)===we){je!==null&&(je=je.next={eventTime:ze,lane:0,tag:U.tag,payload:U.payload,callback:U.callback,next:null});e:{var Ve=o,qe=U;switch(we=i,ze=d,qe.tag){case 1:if(Ve=qe.payload,typeof Ve=="function"){Ce=Ve.call(ze,Ce,we);break e}Ce=Ve;break e;case 3:Ve.flags=Ve.flags&-65537|128;case 0:if(Ve=qe.payload,we=typeof Ve=="function"?Ve.call(ze,Ce,we):Ve,we==null)break e;Ce=A({},Ce,we);break e;case 2:Vs=!0}}U.callback!==null&&U.lane!==0&&(o.flags|=64,we=v.effects,we===null?v.effects=[U]:we.push(U))}else ze={eventTime:ze,lane:we,tag:U.tag,payload:U.payload,callback:U.callback,next:null},je===null?(fe=je=ze,q=Ce):je=je.next=ze,P|=we;if(U=U.next,U===null){if(U=v.shared.pending,U===null)break;we=U,U=we.next,we.next=null,v.lastBaseUpdate=we,v.shared.pending=null}}while(!0);if(je===null&&(q=Ce),v.baseState=q,v.firstBaseUpdate=fe,v.lastBaseUpdate=je,i=v.shared.interleaved,i!==null){v=i;do P|=v.lane,v=v.next;while(v!==i)}else S===null&&(v.shared.lanes=0);Po|=P,o.lanes=P,o.memoizedState=Ce}}function Oy(o,i,d){if(o=i.effects,i.effects=null,o!==null)for(i=0;i<o.length;i++){var x=o[i],v=x.callback;if(v!==null){if(x.callback=null,x=d,typeof v!="function")throw Error(n(191,v));v.call(x)}}}var el={},ns=zs(el),tl=zs(el),nl=zs(el);function To(o){if(o===el)throw Error(n(174));return o}function fp(o,i){switch(Ot(nl,i),Ot(tl,o),Ot(ns,el),o=i.nodeType,o){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:Y(null,"");break;default:o=o===8?i.parentNode:i,i=o.namespaceURI||null,o=o.tagName,i=Y(i,o)}Bt(ns),Ot(ns,i)}function Ra(){Bt(ns),Bt(tl),Bt(nl)}function Iy(o){To(nl.current);var i=To(ns.current),d=Y(i,o.type);i!==d&&(Ot(tl,o),Ot(ns,d))}function pp(o){tl.current===o&&(Bt(ns),Bt(tl))}var Jt=zs(0);function Gc(o){for(var i=o;i!==null;){if(i.tag===13){var d=i.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break;for(;i.sibling===null;){if(i.return===null||i.return===o)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var mp=[];function hp(){for(var o=0;o<mp.length;o++)mp[o]._workInProgressVersionPrimary=null;mp.length=0}var Yc=T.ReactCurrentDispatcher,gp=T.ReactCurrentBatchConfig,Ro=0,Xt=null,gn=null,Sn=null,Jc=!1,rl=!1,sl=0,SE=0;function In(){throw Error(n(321))}function xp(o,i){if(i===null)return!1;for(var d=0;d<i.length&&d<o.length;d++)if(!zr(o[d],i[d]))return!1;return!0}function yp(o,i,d,x,v,S){if(Ro=S,Xt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Yc.current=o===null||o.memoizedState===null?TE:RE,o=d(x,v),rl){S=0;do{if(rl=!1,sl=0,25<=S)throw Error(n(301));S+=1,Sn=gn=null,i.updateQueue=null,Yc.current=PE,o=d(x,v)}while(rl)}if(Yc.current=Zc,i=gn!==null&&gn.next!==null,Ro=0,Sn=gn=Xt=null,Jc=!1,i)throw Error(n(300));return o}function bp(){var o=sl!==0;return sl=0,o}function rs(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sn===null?Xt.memoizedState=Sn=o:Sn=Sn.next=o,Sn}function Nr(){if(gn===null){var o=Xt.alternate;o=o!==null?o.memoizedState:null}else o=gn.next;var i=Sn===null?Xt.memoizedState:Sn.next;if(i!==null)Sn=i,gn=o;else{if(o===null)throw Error(n(310));gn=o,o={memoizedState:gn.memoizedState,baseState:gn.baseState,baseQueue:gn.baseQueue,queue:gn.queue,next:null},Sn===null?Xt.memoizedState=Sn=o:Sn=Sn.next=o}return Sn}function ol(o,i){return typeof i=="function"?i(o):i}function vp(o){var i=Nr(),d=i.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var x=gn,v=x.baseQueue,S=d.pending;if(S!==null){if(v!==null){var P=v.next;v.next=S.next,S.next=P}x.baseQueue=v=S,d.pending=null}if(v!==null){S=v.next,x=x.baseState;var U=P=null,q=null,fe=S;do{var je=fe.lane;if((Ro&je)===je)q!==null&&(q=q.next={lane:0,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),x=fe.hasEagerState?fe.eagerState:o(x,fe.action);else{var Ce={lane:je,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null};q===null?(U=q=Ce,P=x):q=q.next=Ce,Xt.lanes|=je,Po|=je}fe=fe.next}while(fe!==null&&fe!==S);q===null?P=x:q.next=U,zr(x,i.memoizedState)||(Xn=!0),i.memoizedState=x,i.baseState=P,i.baseQueue=q,d.lastRenderedState=x}if(o=d.interleaved,o!==null){v=o;do S=v.lane,Xt.lanes|=S,Po|=S,v=v.next;while(v!==o)}else v===null&&(d.lanes=0);return[i.memoizedState,d.dispatch]}function wp(o){var i=Nr(),d=i.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var x=d.dispatch,v=d.pending,S=i.memoizedState;if(v!==null){d.pending=null;var P=v=v.next;do S=o(S,P.action),P=P.next;while(P!==v);zr(S,i.memoizedState)||(Xn=!0),i.memoizedState=S,i.baseQueue===null&&(i.baseState=S),d.lastRenderedState=S}return[S,x]}function My(){}function _y(o,i){var d=Xt,x=Nr(),v=i(),S=!zr(x.memoizedState,v);if(S&&(x.memoizedState=v,Xn=!0),x=x.queue,jp(By.bind(null,d,x,o),[o]),x.getSnapshot!==i||S||Sn!==null&&Sn.memoizedState.tag&1){if(d.flags|=2048,al(9,zy.bind(null,d,x,v,i),void 0,null),Nn===null)throw Error(n(349));(Ro&30)!==0||Fy(d,i,v)}return v}function Fy(o,i,d){o.flags|=16384,o={getSnapshot:i,value:d},i=Xt.updateQueue,i===null?(i={lastEffect:null,stores:null},Xt.updateQueue=i,i.stores=[o]):(d=i.stores,d===null?i.stores=[o]:d.push(o))}function zy(o,i,d,x){i.value=d,i.getSnapshot=x,Uy(i)&&Vy(o)}function By(o,i,d){return d(function(){Uy(i)&&Vy(o)})}function Uy(o){var i=o.getSnapshot;o=o.value;try{var d=i();return!zr(o,d)}catch{return!0}}function Vy(o){var i=ks(o,1);i!==null&&Wr(i,o,1,-1)}function Hy(o){var i=rs();return typeof o=="function"&&(o=o()),i.memoizedState=i.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:o},i.queue=o,o=o.dispatch=EE.bind(null,Xt,o),[i.memoizedState,o]}function al(o,i,d,x){return o={tag:o,create:i,destroy:d,deps:x,next:null},i=Xt.updateQueue,i===null?(i={lastEffect:null,stores:null},Xt.updateQueue=i,i.lastEffect=o.next=o):(d=i.lastEffect,d===null?i.lastEffect=o.next=o:(x=d.next,d.next=o,o.next=x,i.lastEffect=o)),o}function Wy(){return Nr().memoizedState}function Xc(o,i,d,x){var v=rs();Xt.flags|=o,v.memoizedState=al(1|i,d,void 0,x===void 0?null:x)}function Qc(o,i,d,x){var v=Nr();x=x===void 0?null:x;var S=void 0;if(gn!==null){var P=gn.memoizedState;if(S=P.destroy,x!==null&&xp(x,P.deps)){v.memoizedState=al(i,d,S,x);return}}Xt.flags|=o,v.memoizedState=al(1|i,d,S,x)}function Ky(o,i){return Xc(8390656,8,o,i)}function jp(o,i){return Qc(2048,8,o,i)}function qy(o,i){return Qc(4,2,o,i)}function Gy(o,i){return Qc(4,4,o,i)}function Yy(o,i){if(typeof i=="function")return o=o(),i(o),function(){i(null)};if(i!=null)return o=o(),i.current=o,function(){i.current=null}}function Jy(o,i,d){return d=d!=null?d.concat([o]):null,Qc(4,4,Yy.bind(null,i,o),d)}function kp(){}function Xy(o,i){var d=Nr();i=i===void 0?null:i;var x=d.memoizedState;return x!==null&&i!==null&&xp(i,x[1])?x[0]:(d.memoizedState=[o,i],o)}function Qy(o,i){var d=Nr();i=i===void 0?null:i;var x=d.memoizedState;return x!==null&&i!==null&&xp(i,x[1])?x[0]:(o=o(),d.memoizedState=[o,i],o)}function Zy(o,i,d){return(Ro&21)===0?(o.baseState&&(o.baseState=!1,Xn=!0),o.memoizedState=d):(zr(d,i)||(d=bc(),Xt.lanes|=d,Po|=d,o.baseState=!0),i)}function NE(o,i){var d=Et;Et=d!==0&&4>d?d:4,o(!0);var x=gp.transition;gp.transition={};try{o(!1),i()}finally{Et=d,gp.transition=x}}function eb(){return Nr().memoizedState}function CE(o,i,d){var x=Gs(o);if(d={lane:x,action:d,hasEagerState:!1,eagerState:null,next:null},tb(o))nb(i,d);else if(d=Dy(o,i,d,x),d!==null){var v=Hn();Wr(d,o,x,v),rb(d,i,x)}}function EE(o,i,d){var x=Gs(o),v={lane:x,action:d,hasEagerState:!1,eagerState:null,next:null};if(tb(o))nb(i,v);else{var S=o.alternate;if(o.lanes===0&&(S===null||S.lanes===0)&&(S=i.lastRenderedReducer,S!==null))try{var P=i.lastRenderedState,U=S(P,d);if(v.hasEagerState=!0,v.eagerState=U,zr(U,P)){var q=i.interleaved;q===null?(v.next=v,up(i)):(v.next=q.next,q.next=v),i.interleaved=v;return}}catch{}finally{}d=Dy(o,i,v,x),d!==null&&(v=Hn(),Wr(d,o,x,v),rb(d,i,x))}}function tb(o){var i=o.alternate;return o===Xt||i!==null&&i===Xt}function nb(o,i){rl=Jc=!0;var d=o.pending;d===null?i.next=i:(i.next=d.next,d.next=i),o.pending=i}function rb(o,i,d){if((d&4194240)!==0){var x=i.lanes;x&=o.pendingLanes,d|=x,i.lanes=d,_i(o,d)}}var Zc={readContext:Sr,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useInsertionEffect:In,useLayoutEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useDeferredValue:In,useTransition:In,useMutableSource:In,useSyncExternalStore:In,useId:In,unstable_isNewReconciler:!1},TE={readContext:Sr,useCallback:function(o,i){return rs().memoizedState=[o,i===void 0?null:i],o},useContext:Sr,useEffect:Ky,useImperativeHandle:function(o,i,d){return d=d!=null?d.concat([o]):null,Xc(4194308,4,Yy.bind(null,i,o),d)},useLayoutEffect:function(o,i){return Xc(4194308,4,o,i)},useInsertionEffect:function(o,i){return Xc(4,2,o,i)},useMemo:function(o,i){var d=rs();return i=i===void 0?null:i,o=o(),d.memoizedState=[o,i],o},useReducer:function(o,i,d){var x=rs();return i=d!==void 0?d(i):i,x.memoizedState=x.baseState=i,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:i},x.queue=o,o=o.dispatch=CE.bind(null,Xt,o),[x.memoizedState,o]},useRef:function(o){var i=rs();return o={current:o},i.memoizedState=o},useState:Hy,useDebugValue:kp,useDeferredValue:function(o){return rs().memoizedState=o},useTransition:function(){var o=Hy(!1),i=o[0];return o=NE.bind(null,o[1]),rs().memoizedState=o,[i,o]},useMutableSource:function(){},useSyncExternalStore:function(o,i,d){var x=Xt,v=rs();if(Kt){if(d===void 0)throw Error(n(407));d=d()}else{if(d=i(),Nn===null)throw Error(n(349));(Ro&30)!==0||Fy(x,i,d)}v.memoizedState=d;var S={value:d,getSnapshot:i};return v.queue=S,Ky(By.bind(null,x,S,o),[o]),x.flags|=2048,al(9,zy.bind(null,x,S,d,i),void 0,null),d},useId:function(){var o=rs(),i=Nn.identifierPrefix;if(Kt){var d=js,x=ws;d=(x&~(1<<32-jt(x)-1)).toString(32)+d,i=":"+i+"R"+d,d=sl++,0<d&&(i+="H"+d.toString(32)),i+=":"}else d=SE++,i=":"+i+"r"+d.toString(32)+":";return o.memoizedState=i},unstable_isNewReconciler:!1},RE={readContext:Sr,useCallback:Xy,useContext:Sr,useEffect:jp,useImperativeHandle:Jy,useInsertionEffect:qy,useLayoutEffect:Gy,useMemo:Qy,useReducer:vp,useRef:Wy,useState:function(){return vp(ol)},useDebugValue:kp,useDeferredValue:function(o){var i=Nr();return Zy(i,gn.memoizedState,o)},useTransition:function(){var o=vp(ol)[0],i=Nr().memoizedState;return[o,i]},useMutableSource:My,useSyncExternalStore:_y,useId:eb,unstable_isNewReconciler:!1},PE={readContext:Sr,useCallback:Xy,useContext:Sr,useEffect:jp,useImperativeHandle:Jy,useInsertionEffect:qy,useLayoutEffect:Gy,useMemo:Qy,useReducer:wp,useRef:Wy,useState:function(){return wp(ol)},useDebugValue:kp,useDeferredValue:function(o){var i=Nr();return gn===null?i.memoizedState=o:Zy(i,gn.memoizedState,o)},useTransition:function(){var o=wp(ol)[0],i=Nr().memoizedState;return[o,i]},useMutableSource:My,useSyncExternalStore:_y,useId:eb,unstable_isNewReconciler:!1};function Ur(o,i){if(o&&o.defaultProps){i=A({},i),o=o.defaultProps;for(var d in o)i[d]===void 0&&(i[d]=o[d]);return i}return i}function Sp(o,i,d,x){i=o.memoizedState,d=d(x,i),d=d==null?i:A({},i,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var eu={isMounted:function(o){return(o=o._reactInternals)?_r(o)===o:!1},enqueueSetState:function(o,i,d){o=o._reactInternals;var x=Hn(),v=Gs(o),S=Ss(x,v);S.payload=i,d!=null&&(S.callback=d),i=Hs(o,S,v),i!==null&&(Wr(i,o,v,x),Kc(i,o,v))},enqueueReplaceState:function(o,i,d){o=o._reactInternals;var x=Hn(),v=Gs(o),S=Ss(x,v);S.tag=1,S.payload=i,d!=null&&(S.callback=d),i=Hs(o,S,v),i!==null&&(Wr(i,o,v,x),Kc(i,o,v))},enqueueForceUpdate:function(o,i){o=o._reactInternals;var d=Hn(),x=Gs(o),v=Ss(d,x);v.tag=2,i!=null&&(v.callback=i),i=Hs(o,v,x),i!==null&&(Wr(i,o,x,d),Kc(i,o,x))}};function sb(o,i,d,x,v,S,P){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(x,S,P):i.prototype&&i.prototype.isPureReactComponent?!Ki(d,x)||!Ki(v,S):!0}function ob(o,i,d){var x=!1,v=Bs,S=i.contextType;return typeof S=="object"&&S!==null?S=Sr(S):(v=Jn(i)?So:On.current,x=i.contextTypes,S=(x=x!=null)?ja(o,v):Bs),i=new i(d,S),o.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=eu,o.stateNode=i,i._reactInternals=o,x&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=v,o.__reactInternalMemoizedMaskedChildContext=S),i}function ab(o,i,d,x){o=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(d,x),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(d,x),i.state!==o&&eu.enqueueReplaceState(i,i.state,null)}function Np(o,i,d,x){var v=o.stateNode;v.props=d,v.state=o.memoizedState,v.refs={},dp(o);var S=i.contextType;typeof S=="object"&&S!==null?v.context=Sr(S):(S=Jn(i)?So:On.current,v.context=ja(o,S)),v.state=o.memoizedState,S=i.getDerivedStateFromProps,typeof S=="function"&&(Sp(o,i,S,d),v.state=o.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(i=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),i!==v.state&&eu.enqueueReplaceState(v,v.state,null),qc(o,d,v,x),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308)}function Pa(o,i){try{var d="",x=i;do d+=ge(x),x=x.return;while(x);var v=d}catch(S){v=`
|
|
39
|
-
Error generating stack: `+S.message+`
|
|
40
|
-
`+S.stack}return{value:o,source:i,stack:v,digest:null}}function Cp(o,i,d){return{value:o,source:null,stack:d??null,digest:i??null}}function Ep(o,i){try{console.error(i.value)}catch(d){setTimeout(function(){throw d})}}var AE=typeof WeakMap=="function"?WeakMap:Map;function ib(o,i,d){d=Ss(-1,d),d.tag=3,d.payload={element:null};var x=i.value;return d.callback=function(){iu||(iu=!0,Up=x),Ep(o,i)},d}function lb(o,i,d){d=Ss(-1,d),d.tag=3;var x=o.type.getDerivedStateFromError;if(typeof x=="function"){var v=i.value;d.payload=function(){return x(v)},d.callback=function(){Ep(o,i)}}var S=o.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(d.callback=function(){Ep(o,i),typeof x!="function"&&(Ks===null?Ks=new Set([this]):Ks.add(this));var P=i.stack;this.componentDidCatch(i.value,{componentStack:P!==null?P:""})}),d}function cb(o,i,d){var x=o.pingCache;if(x===null){x=o.pingCache=new AE;var v=new Set;x.set(i,v)}else v=x.get(i),v===void 0&&(v=new Set,x.set(i,v));v.has(d)||(v.add(d),o=WE.bind(null,o,i,d),i.then(o,o))}function ub(o){do{var i;if((i=o.tag===13)&&(i=o.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return o;o=o.return}while(o!==null);return null}function db(o,i,d,x,v){return(o.mode&1)===0?(o===i?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(i=Ss(-1,1),i.tag=2,Hs(d,i,1))),d.lanes|=1),o):(o.flags|=65536,o.lanes=v,o)}var DE=T.ReactCurrentOwner,Xn=!1;function Vn(o,i,d,x){i.child=o===null?Ay(i,null,d,x):Ca(i,o.child,d,x)}function fb(o,i,d,x,v){d=d.render;var S=i.ref;return Ta(i,v),x=yp(o,i,d,x,S,v),d=bp(),o!==null&&!Xn?(i.updateQueue=o.updateQueue,i.flags&=-2053,o.lanes&=~v,Ns(o,i,v)):(Kt&&d&&tp(i),i.flags|=1,Vn(o,i,x,v),i.child)}function pb(o,i,d,x,v){if(o===null){var S=d.type;return typeof S=="function"&&!Yp(S)&&S.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(i.tag=15,i.type=S,mb(o,i,S,x,v)):(o=pu(d.type,null,x,i,i.mode,v),o.ref=i.ref,o.return=i,i.child=o)}if(S=o.child,(o.lanes&v)===0){var P=S.memoizedProps;if(d=d.compare,d=d!==null?d:Ki,d(P,x)&&o.ref===i.ref)return Ns(o,i,v)}return i.flags|=1,o=Js(S,x),o.ref=i.ref,o.return=i,i.child=o}function mb(o,i,d,x,v){if(o!==null){var S=o.memoizedProps;if(Ki(S,x)&&o.ref===i.ref)if(Xn=!1,i.pendingProps=x=S,(o.lanes&v)!==0)(o.flags&131072)!==0&&(Xn=!0);else return i.lanes=o.lanes,Ns(o,i,v)}return Tp(o,i,d,x,v)}function hb(o,i,d){var x=i.pendingProps,v=x.children,S=o!==null?o.memoizedState:null;if(x.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ot(Da,fr),fr|=d;else{if((d&1073741824)===0)return o=S!==null?S.baseLanes|d:d,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:o,cachePool:null,transitions:null},i.updateQueue=null,Ot(Da,fr),fr|=o,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},x=S!==null?S.baseLanes:d,Ot(Da,fr),fr|=x}else S!==null?(x=S.baseLanes|d,i.memoizedState=null):x=d,Ot(Da,fr),fr|=x;return Vn(o,i,v,d),i.child}function gb(o,i){var d=i.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(i.flags|=512,i.flags|=2097152)}function Tp(o,i,d,x,v){var S=Jn(d)?So:On.current;return S=ja(i,S),Ta(i,v),d=yp(o,i,d,x,S,v),x=bp(),o!==null&&!Xn?(i.updateQueue=o.updateQueue,i.flags&=-2053,o.lanes&=~v,Ns(o,i,v)):(Kt&&x&&tp(i),i.flags|=1,Vn(o,i,d,v),i.child)}function xb(o,i,d,x,v){if(Jn(d)){var S=!0;_c(i)}else S=!1;if(Ta(i,v),i.stateNode===null)nu(o,i),ob(i,d,x),Np(i,d,x,v),x=!0;else if(o===null){var P=i.stateNode,U=i.memoizedProps;P.props=U;var q=P.context,fe=d.contextType;typeof fe=="object"&&fe!==null?fe=Sr(fe):(fe=Jn(d)?So:On.current,fe=ja(i,fe));var je=d.getDerivedStateFromProps,Ce=typeof je=="function"||typeof P.getSnapshotBeforeUpdate=="function";Ce||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(U!==x||q!==fe)&&ab(i,P,x,fe),Vs=!1;var we=i.memoizedState;P.state=we,qc(i,x,P,v),q=i.memoizedState,U!==x||we!==q||Yn.current||Vs?(typeof je=="function"&&(Sp(i,d,je,x),q=i.memoizedState),(U=Vs||sb(i,d,U,x,we,q,fe))?(Ce||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount()),typeof P.componentDidMount=="function"&&(i.flags|=4194308)):(typeof P.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=x,i.memoizedState=q),P.props=x,P.state=q,P.context=fe,x=U):(typeof P.componentDidMount=="function"&&(i.flags|=4194308),x=!1)}else{P=i.stateNode,$y(o,i),U=i.memoizedProps,fe=i.type===i.elementType?U:Ur(i.type,U),P.props=fe,Ce=i.pendingProps,we=P.context,q=d.contextType,typeof q=="object"&&q!==null?q=Sr(q):(q=Jn(d)?So:On.current,q=ja(i,q));var ze=d.getDerivedStateFromProps;(je=typeof ze=="function"||typeof P.getSnapshotBeforeUpdate=="function")||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(U!==Ce||we!==q)&&ab(i,P,x,q),Vs=!1,we=i.memoizedState,P.state=we,qc(i,x,P,v);var Ve=i.memoizedState;U!==Ce||we!==Ve||Yn.current||Vs?(typeof ze=="function"&&(Sp(i,d,ze,x),Ve=i.memoizedState),(fe=Vs||sb(i,d,fe,x,we,Ve,q)||!1)?(je||typeof P.UNSAFE_componentWillUpdate!="function"&&typeof P.componentWillUpdate!="function"||(typeof P.componentWillUpdate=="function"&&P.componentWillUpdate(x,Ve,q),typeof P.UNSAFE_componentWillUpdate=="function"&&P.UNSAFE_componentWillUpdate(x,Ve,q)),typeof P.componentDidUpdate=="function"&&(i.flags|=4),typeof P.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof P.componentDidUpdate!="function"||U===o.memoizedProps&&we===o.memoizedState||(i.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||U===o.memoizedProps&&we===o.memoizedState||(i.flags|=1024),i.memoizedProps=x,i.memoizedState=Ve),P.props=x,P.state=Ve,P.context=q,x=fe):(typeof P.componentDidUpdate!="function"||U===o.memoizedProps&&we===o.memoizedState||(i.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||U===o.memoizedProps&&we===o.memoizedState||(i.flags|=1024),x=!1)}return Rp(o,i,d,x,S,v)}function Rp(o,i,d,x,v,S){gb(o,i);var P=(i.flags&128)!==0;if(!x&&!P)return v&&jy(i,d,!1),Ns(o,i,S);x=i.stateNode,DE.current=i;var U=P&&typeof d.getDerivedStateFromError!="function"?null:x.render();return i.flags|=1,o!==null&&P?(i.child=Ca(i,o.child,null,S),i.child=Ca(i,null,U,S)):Vn(o,i,U,S),i.memoizedState=x.state,v&&jy(i,d,!0),i.child}function yb(o){var i=o.stateNode;i.pendingContext?vy(o,i.pendingContext,i.pendingContext!==i.context):i.context&&vy(o,i.context,!1),fp(o,i.containerInfo)}function bb(o,i,d,x,v){return Na(),op(v),i.flags|=256,Vn(o,i,d,x),i.child}var Pp={dehydrated:null,treeContext:null,retryLane:0};function Ap(o){return{baseLanes:o,cachePool:null,transitions:null}}function vb(o,i,d){var x=i.pendingProps,v=Jt.current,S=!1,P=(i.flags&128)!==0,U;if((U=P)||(U=o!==null&&o.memoizedState===null?!1:(v&2)!==0),U?(S=!0,i.flags&=-129):(o===null||o.memoizedState!==null)&&(v|=1),Ot(Jt,v&1),o===null)return sp(i),o=i.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((i.mode&1)===0?i.lanes=1:o.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(P=x.children,o=x.fallback,S?(x=i.mode,S=i.child,P={mode:"hidden",children:P},(x&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=P):S=mu(P,x,0,null),o=Lo(o,x,d,null),S.return=i,o.return=i,S.sibling=o,i.child=S,i.child.memoizedState=Ap(d),i.memoizedState=Pp,o):Dp(i,P));if(v=o.memoizedState,v!==null&&(U=v.dehydrated,U!==null))return $E(o,i,P,x,U,v,d);if(S){S=x.fallback,P=i.mode,v=o.child,U=v.sibling;var q={mode:"hidden",children:x.children};return(P&1)===0&&i.child!==v?(x=i.child,x.childLanes=0,x.pendingProps=q,i.deletions=null):(x=Js(v,q),x.subtreeFlags=v.subtreeFlags&14680064),U!==null?S=Js(U,S):(S=Lo(S,P,d,null),S.flags|=2),S.return=i,x.return=i,x.sibling=S,i.child=x,x=S,S=i.child,P=o.child.memoizedState,P=P===null?Ap(d):{baseLanes:P.baseLanes|d,cachePool:null,transitions:P.transitions},S.memoizedState=P,S.childLanes=o.childLanes&~d,i.memoizedState=Pp,x}return S=o.child,o=S.sibling,x=Js(S,{mode:"visible",children:x.children}),(i.mode&1)===0&&(x.lanes=d),x.return=i,x.sibling=null,o!==null&&(d=i.deletions,d===null?(i.deletions=[o],i.flags|=16):d.push(o)),i.child=x,i.memoizedState=null,x}function Dp(o,i){return i=mu({mode:"visible",children:i},o.mode,0,null),i.return=o,o.child=i}function tu(o,i,d,x){return x!==null&&op(x),Ca(i,o.child,null,d),o=Dp(i,i.pendingProps.children),o.flags|=2,i.memoizedState=null,o}function $E(o,i,d,x,v,S,P){if(d)return i.flags&256?(i.flags&=-257,x=Cp(Error(n(422))),tu(o,i,P,x)):i.memoizedState!==null?(i.child=o.child,i.flags|=128,null):(S=x.fallback,v=i.mode,x=mu({mode:"visible",children:x.children},v,0,null),S=Lo(S,v,P,null),S.flags|=2,x.return=i,S.return=i,x.sibling=S,i.child=x,(i.mode&1)!==0&&Ca(i,o.child,null,P),i.child.memoizedState=Ap(P),i.memoizedState=Pp,S);if((i.mode&1)===0)return tu(o,i,P,null);if(v.data==="$!"){if(x=v.nextSibling&&v.nextSibling.dataset,x)var U=x.dgst;return x=U,S=Error(n(419)),x=Cp(S,x,void 0),tu(o,i,P,x)}if(U=(P&o.childLanes)!==0,Xn||U){if(x=Nn,x!==null){switch(P&-P){case 4:v=2;break;case 16:v=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:v=32;break;case 536870912:v=268435456;break;default:v=0}v=(v&(x.suspendedLanes|P))!==0?0:v,v!==0&&v!==S.retryLane&&(S.retryLane=v,ks(o,v),Wr(x,o,v,-1))}return Gp(),x=Cp(Error(n(421))),tu(o,i,P,x)}return v.data==="$?"?(i.flags|=128,i.child=o.child,i=KE.bind(null,o),v._reactRetry=i,null):(o=S.treeContext,dr=Fs(v.nextSibling),ur=i,Kt=!0,Br=null,o!==null&&(jr[kr++]=ws,jr[kr++]=js,jr[kr++]=No,ws=o.id,js=o.overflow,No=i),i=Dp(i,x.children),i.flags|=4096,i)}function wb(o,i,d){o.lanes|=i;var x=o.alternate;x!==null&&(x.lanes|=i),cp(o.return,i,d)}function $p(o,i,d,x,v){var S=o.memoizedState;S===null?o.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:x,tail:d,tailMode:v}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=x,S.tail=d,S.tailMode=v)}function jb(o,i,d){var x=i.pendingProps,v=x.revealOrder,S=x.tail;if(Vn(o,i,x.children,d),x=Jt.current,(x&2)!==0)x=x&1|2,i.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=i.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&wb(o,d,i);else if(o.tag===19)wb(o,d,i);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}x&=1}if(Ot(Jt,x),(i.mode&1)===0)i.memoizedState=null;else switch(v){case"forwards":for(d=i.child,v=null;d!==null;)o=d.alternate,o!==null&&Gc(o)===null&&(v=d),d=d.sibling;d=v,d===null?(v=i.child,i.child=null):(v=d.sibling,d.sibling=null),$p(i,!1,v,d,S);break;case"backwards":for(d=null,v=i.child,i.child=null;v!==null;){if(o=v.alternate,o!==null&&Gc(o)===null){i.child=v;break}o=v.sibling,v.sibling=d,d=v,v=o}$p(i,!0,d,null,S);break;case"together":$p(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function nu(o,i){(i.mode&1)===0&&o!==null&&(o.alternate=null,i.alternate=null,i.flags|=2)}function Ns(o,i,d){if(o!==null&&(i.dependencies=o.dependencies),Po|=i.lanes,(d&i.childLanes)===0)return null;if(o!==null&&i.child!==o.child)throw Error(n(153));if(i.child!==null){for(o=i.child,d=Js(o,o.pendingProps),i.child=d,d.return=i;o.sibling!==null;)o=o.sibling,d=d.sibling=Js(o,o.pendingProps),d.return=i;d.sibling=null}return i.child}function LE(o,i,d){switch(i.tag){case 3:yb(i),Na();break;case 5:Iy(i);break;case 1:Jn(i.type)&&_c(i);break;case 4:fp(i,i.stateNode.containerInfo);break;case 10:var x=i.type._context,v=i.memoizedProps.value;Ot(Hc,x._currentValue),x._currentValue=v;break;case 13:if(x=i.memoizedState,x!==null)return x.dehydrated!==null?(Ot(Jt,Jt.current&1),i.flags|=128,null):(d&i.child.childLanes)!==0?vb(o,i,d):(Ot(Jt,Jt.current&1),o=Ns(o,i,d),o!==null?o.sibling:null);Ot(Jt,Jt.current&1);break;case 19:if(x=(d&i.childLanes)!==0,(o.flags&128)!==0){if(x)return jb(o,i,d);i.flags|=128}if(v=i.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),Ot(Jt,Jt.current),x)break;return null;case 22:case 23:return i.lanes=0,hb(o,i,d)}return Ns(o,i,d)}var kb,Lp,Sb,Nb;kb=function(o,i){for(var d=i.child;d!==null;){if(d.tag===5||d.tag===6)o.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===i)break;for(;d.sibling===null;){if(d.return===null||d.return===i)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Lp=function(){},Sb=function(o,i,d,x){var v=o.memoizedProps;if(v!==x){o=i.stateNode,To(ns.current);var S=null;switch(d){case"input":v=ot(o,v),x=ot(o,x),S=[];break;case"select":v=A({},v,{value:void 0}),x=A({},x,{value:void 0}),S=[];break;case"textarea":v=Ke(o,v),x=Ke(o,x),S=[];break;default:typeof v.onClick!="function"&&typeof x.onClick=="function"&&(o.onclick=Oc)}it(d,x);var P;d=null;for(fe in v)if(!x.hasOwnProperty(fe)&&v.hasOwnProperty(fe)&&v[fe]!=null)if(fe==="style"){var U=v[fe];for(P in U)U.hasOwnProperty(P)&&(d||(d={}),d[P]="")}else fe!=="dangerouslySetInnerHTML"&&fe!=="children"&&fe!=="suppressContentEditableWarning"&&fe!=="suppressHydrationWarning"&&fe!=="autoFocus"&&(a.hasOwnProperty(fe)?S||(S=[]):(S=S||[]).push(fe,null));for(fe in x){var q=x[fe];if(U=v!=null?v[fe]:void 0,x.hasOwnProperty(fe)&&q!==U&&(q!=null||U!=null))if(fe==="style")if(U){for(P in U)!U.hasOwnProperty(P)||q&&q.hasOwnProperty(P)||(d||(d={}),d[P]="");for(P in q)q.hasOwnProperty(P)&&U[P]!==q[P]&&(d||(d={}),d[P]=q[P])}else d||(S||(S=[]),S.push(fe,d)),d=q;else fe==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,U=U?U.__html:void 0,q!=null&&U!==q&&(S=S||[]).push(fe,q)):fe==="children"?typeof q!="string"&&typeof q!="number"||(S=S||[]).push(fe,""+q):fe!=="suppressContentEditableWarning"&&fe!=="suppressHydrationWarning"&&(a.hasOwnProperty(fe)?(q!=null&&fe==="onScroll"&&zt("scroll",o),S||U===q||(S=[])):(S=S||[]).push(fe,q))}d&&(S=S||[]).push("style",d);var fe=S;(i.updateQueue=fe)&&(i.flags|=4)}},Nb=function(o,i,d,x){d!==x&&(i.flags|=4)};function il(o,i){if(!Kt)switch(o.tailMode){case"hidden":i=o.tail;for(var d=null;i!==null;)i.alternate!==null&&(d=i),i=i.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var x=null;d!==null;)d.alternate!==null&&(x=d),d=d.sibling;x===null?i||o.tail===null?o.tail=null:o.tail.sibling=null:x.sibling=null}}function Mn(o){var i=o.alternate!==null&&o.alternate.child===o.child,d=0,x=0;if(i)for(var v=o.child;v!==null;)d|=v.lanes|v.childLanes,x|=v.subtreeFlags&14680064,x|=v.flags&14680064,v.return=o,v=v.sibling;else for(v=o.child;v!==null;)d|=v.lanes|v.childLanes,x|=v.subtreeFlags,x|=v.flags,v.return=o,v=v.sibling;return o.subtreeFlags|=x,o.childLanes=d,i}function OE(o,i,d){var x=i.pendingProps;switch(np(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mn(i),null;case 1:return Jn(i.type)&&Mc(),Mn(i),null;case 3:return x=i.stateNode,Ra(),Bt(Yn),Bt(On),hp(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(o===null||o.child===null)&&(Uc(i)?i.flags|=4:o===null||o.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Br!==null&&(Wp(Br),Br=null))),Lp(o,i),Mn(i),null;case 5:pp(i);var v=To(nl.current);if(d=i.type,o!==null&&i.stateNode!=null)Sb(o,i,d,x,v),o.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!x){if(i.stateNode===null)throw Error(n(166));return Mn(i),null}if(o=To(ns.current),Uc(i)){x=i.stateNode,d=i.type;var S=i.memoizedProps;switch(x[ts]=i,x[Xi]=S,o=(i.mode&1)!==0,d){case"dialog":zt("cancel",x),zt("close",x);break;case"iframe":case"object":case"embed":zt("load",x);break;case"video":case"audio":for(v=0;v<Gi.length;v++)zt(Gi[v],x);break;case"source":zt("error",x);break;case"img":case"image":case"link":zt("error",x),zt("load",x);break;case"details":zt("toggle",x);break;case"input":J(x,S),zt("invalid",x);break;case"select":x._wrapperState={wasMultiple:!!S.multiple},zt("invalid",x);break;case"textarea":gt(x,S),zt("invalid",x)}it(d,S),v=null;for(var P in S)if(S.hasOwnProperty(P)){var U=S[P];P==="children"?typeof U=="string"?x.textContent!==U&&(S.suppressHydrationWarning!==!0&&Lc(x.textContent,U,o),v=["children",U]):typeof U=="number"&&x.textContent!==""+U&&(S.suppressHydrationWarning!==!0&&Lc(x.textContent,U,o),v=["children",""+U]):a.hasOwnProperty(P)&&U!=null&&P==="onScroll"&&zt("scroll",x)}switch(d){case"input":he(x),Oe(x,S,!0);break;case"textarea":he(x),at(x);break;case"select":case"option":break;default:typeof S.onClick=="function"&&(x.onclick=Oc)}x=v,i.updateQueue=x,x!==null&&(i.flags|=4)}else{P=v.nodeType===9?v:v.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=ie(d)),o==="http://www.w3.org/1999/xhtml"?d==="script"?(o=P.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof x.is=="string"?o=P.createElement(d,{is:x.is}):(o=P.createElement(d),d==="select"&&(P=o,x.multiple?P.multiple=!0:x.size&&(P.size=x.size))):o=P.createElementNS(o,d),o[ts]=i,o[Xi]=x,kb(o,i,!1,!1),i.stateNode=o;e:{switch(P=_e(d,x),d){case"dialog":zt("cancel",o),zt("close",o),v=x;break;case"iframe":case"object":case"embed":zt("load",o),v=x;break;case"video":case"audio":for(v=0;v<Gi.length;v++)zt(Gi[v],o);v=x;break;case"source":zt("error",o),v=x;break;case"img":case"image":case"link":zt("error",o),zt("load",o),v=x;break;case"details":zt("toggle",o),v=x;break;case"input":J(o,x),v=ot(o,x),zt("invalid",o);break;case"option":v=x;break;case"select":o._wrapperState={wasMultiple:!!x.multiple},v=A({},x,{value:void 0}),zt("invalid",o);break;case"textarea":gt(o,x),v=Ke(o,x),zt("invalid",o);break;default:v=x}it(d,v),U=v;for(S in U)if(U.hasOwnProperty(S)){var q=U[S];S==="style"?be(o,q):S==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,q!=null&&Q(o,q)):S==="children"?typeof q=="string"?(d!=="textarea"||q!=="")&&ye(o,q):typeof q=="number"&&ye(o,""+q):S!=="suppressContentEditableWarning"&&S!=="suppressHydrationWarning"&&S!=="autoFocus"&&(a.hasOwnProperty(S)?q!=null&&S==="onScroll"&&zt("scroll",o):q!=null&&N(o,S,q,P))}switch(d){case"input":he(o),Oe(o,x,!1);break;case"textarea":he(o),at(o);break;case"option":x.value!=null&&o.setAttribute("value",""+me(x.value));break;case"select":o.multiple=!!x.multiple,S=x.value,S!=null?nt(o,!!x.multiple,S,!1):x.defaultValue!=null&&nt(o,!!x.multiple,x.defaultValue,!0);break;default:typeof v.onClick=="function"&&(o.onclick=Oc)}switch(d){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return Mn(i),null;case 6:if(o&&i.stateNode!=null)Nb(o,i,o.memoizedProps,x);else{if(typeof x!="string"&&i.stateNode===null)throw Error(n(166));if(d=To(nl.current),To(ns.current),Uc(i)){if(x=i.stateNode,d=i.memoizedProps,x[ts]=i,(S=x.nodeValue!==d)&&(o=ur,o!==null))switch(o.tag){case 3:Lc(x.nodeValue,d,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&Lc(x.nodeValue,d,(o.mode&1)!==0)}S&&(i.flags|=4)}else x=(d.nodeType===9?d:d.ownerDocument).createTextNode(x),x[ts]=i,i.stateNode=x}return Mn(i),null;case 13:if(Bt(Jt),x=i.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Kt&&dr!==null&&(i.mode&1)!==0&&(i.flags&128)===0)Ty(),Na(),i.flags|=98560,S=!1;else if(S=Uc(i),x!==null&&x.dehydrated!==null){if(o===null){if(!S)throw Error(n(318));if(S=i.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(n(317));S[ts]=i}else Na(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Mn(i),S=!1}else Br!==null&&(Wp(Br),Br=null),S=!0;if(!S)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=d,i):(x=x!==null,x!==(o!==null&&o.memoizedState!==null)&&x&&(i.child.flags|=8192,(i.mode&1)!==0&&(o===null||(Jt.current&1)!==0?xn===0&&(xn=3):Gp())),i.updateQueue!==null&&(i.flags|=4),Mn(i),null);case 4:return Ra(),Lp(o,i),o===null&&Yi(i.stateNode.containerInfo),Mn(i),null;case 10:return lp(i.type._context),Mn(i),null;case 17:return Jn(i.type)&&Mc(),Mn(i),null;case 19:if(Bt(Jt),S=i.memoizedState,S===null)return Mn(i),null;if(x=(i.flags&128)!==0,P=S.rendering,P===null)if(x)il(S,!1);else{if(xn!==0||o!==null&&(o.flags&128)!==0)for(o=i.child;o!==null;){if(P=Gc(o),P!==null){for(i.flags|=128,il(S,!1),x=P.updateQueue,x!==null&&(i.updateQueue=x,i.flags|=4),i.subtreeFlags=0,x=d,d=i.child;d!==null;)S=d,o=x,S.flags&=14680066,P=S.alternate,P===null?(S.childLanes=0,S.lanes=o,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=P.childLanes,S.lanes=P.lanes,S.child=P.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=P.memoizedProps,S.memoizedState=P.memoizedState,S.updateQueue=P.updateQueue,S.type=P.type,o=P.dependencies,S.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),d=d.sibling;return Ot(Jt,Jt.current&1|2),i.child}o=o.sibling}S.tail!==null&&Lt()>$a&&(i.flags|=128,x=!0,il(S,!1),i.lanes=4194304)}else{if(!x)if(o=Gc(P),o!==null){if(i.flags|=128,x=!0,d=o.updateQueue,d!==null&&(i.updateQueue=d,i.flags|=4),il(S,!0),S.tail===null&&S.tailMode==="hidden"&&!P.alternate&&!Kt)return Mn(i),null}else 2*Lt()-S.renderingStartTime>$a&&d!==1073741824&&(i.flags|=128,x=!0,il(S,!1),i.lanes=4194304);S.isBackwards?(P.sibling=i.child,i.child=P):(d=S.last,d!==null?d.sibling=P:i.child=P,S.last=P)}return S.tail!==null?(i=S.tail,S.rendering=i,S.tail=i.sibling,S.renderingStartTime=Lt(),i.sibling=null,d=Jt.current,Ot(Jt,x?d&1|2:d&1),i):(Mn(i),null);case 22:case 23:return qp(),x=i.memoizedState!==null,o!==null&&o.memoizedState!==null!==x&&(i.flags|=8192),x&&(i.mode&1)!==0?(fr&1073741824)!==0&&(Mn(i),i.subtreeFlags&6&&(i.flags|=8192)):Mn(i),null;case 24:return null;case 25:return null}throw Error(n(156,i.tag))}function IE(o,i){switch(np(i),i.tag){case 1:return Jn(i.type)&&Mc(),o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 3:return Ra(),Bt(Yn),Bt(On),hp(),o=i.flags,(o&65536)!==0&&(o&128)===0?(i.flags=o&-65537|128,i):null;case 5:return pp(i),null;case 13:if(Bt(Jt),o=i.memoizedState,o!==null&&o.dehydrated!==null){if(i.alternate===null)throw Error(n(340));Na()}return o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 19:return Bt(Jt),null;case 4:return Ra(),null;case 10:return lp(i.type._context),null;case 22:case 23:return qp(),null;case 24:return null;default:return null}}var ru=!1,_n=!1,ME=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function Aa(o,i){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(x){en(o,i,x)}else d.current=null}function Op(o,i,d){try{d()}catch(x){en(o,i,x)}}var Cb=!1;function _E(o,i){if(qf=kc,o=sy(),Ff(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var x=d.getSelection&&d.getSelection();if(x&&x.rangeCount!==0){d=x.anchorNode;var v=x.anchorOffset,S=x.focusNode;x=x.focusOffset;try{d.nodeType,S.nodeType}catch{d=null;break e}var P=0,U=-1,q=-1,fe=0,je=0,Ce=o,we=null;t:for(;;){for(var ze;Ce!==d||v!==0&&Ce.nodeType!==3||(U=P+v),Ce!==S||x!==0&&Ce.nodeType!==3||(q=P+x),Ce.nodeType===3&&(P+=Ce.nodeValue.length),(ze=Ce.firstChild)!==null;)we=Ce,Ce=ze;for(;;){if(Ce===o)break t;if(we===d&&++fe===v&&(U=P),we===S&&++je===x&&(q=P),(ze=Ce.nextSibling)!==null)break;Ce=we,we=Ce.parentNode}Ce=ze}d=U===-1||q===-1?null:{start:U,end:q}}else d=null}d=d||{start:0,end:0}}else d=null;for(Gf={focusedElem:o,selectionRange:d},kc=!1,Ue=i;Ue!==null;)if(i=Ue,o=i.child,(i.subtreeFlags&1028)!==0&&o!==null)o.return=i,Ue=o;else for(;Ue!==null;){i=Ue;try{var Ve=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(Ve!==null){var qe=Ve.memoizedProps,an=Ve.memoizedState,oe=i.stateNode,X=oe.getSnapshotBeforeUpdate(i.elementType===i.type?qe:Ur(i.type,qe),an);oe.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var ce=i.stateNode.containerInfo;ce.nodeType===1?ce.textContent="":ce.nodeType===9&&ce.documentElement&&ce.removeChild(ce.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Re){en(i,i.return,Re)}if(o=i.sibling,o!==null){o.return=i.return,Ue=o;break}Ue=i.return}return Ve=Cb,Cb=!1,Ve}function ll(o,i,d){var x=i.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var v=x=x.next;do{if((v.tag&o)===o){var S=v.destroy;v.destroy=void 0,S!==void 0&&Op(i,d,S)}v=v.next}while(v!==x)}}function su(o,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var d=i=i.next;do{if((d.tag&o)===o){var x=d.create;d.destroy=x()}d=d.next}while(d!==i)}}function Ip(o){var i=o.ref;if(i!==null){var d=o.stateNode;switch(o.tag){case 5:o=d;break;default:o=d}typeof i=="function"?i(o):i.current=o}}function Eb(o){var i=o.alternate;i!==null&&(o.alternate=null,Eb(i)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(i=o.stateNode,i!==null&&(delete i[ts],delete i[Xi],delete i[Qf],delete i[vE],delete i[wE])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Tb(o){return o.tag===5||o.tag===3||o.tag===4}function Rb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Tb(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Mp(o,i,d){var x=o.tag;if(x===5||x===6)o=o.stateNode,i?d.nodeType===8?d.parentNode.insertBefore(o,i):d.insertBefore(o,i):(d.nodeType===8?(i=d.parentNode,i.insertBefore(o,d)):(i=d,i.appendChild(o)),d=d._reactRootContainer,d!=null||i.onclick!==null||(i.onclick=Oc));else if(x!==4&&(o=o.child,o!==null))for(Mp(o,i,d),o=o.sibling;o!==null;)Mp(o,i,d),o=o.sibling}function _p(o,i,d){var x=o.tag;if(x===5||x===6)o=o.stateNode,i?d.insertBefore(o,i):d.appendChild(o);else if(x!==4&&(o=o.child,o!==null))for(_p(o,i,d),o=o.sibling;o!==null;)_p(o,i,d),o=o.sibling}var Tn=null,Vr=!1;function Ws(o,i,d){for(d=d.child;d!==null;)Pb(o,i,d),d=d.sibling}function Pb(o,i,d){if(vr&&typeof vr.onCommitFiberUnmount=="function")try{vr.onCommitFiberUnmount(da,d)}catch{}switch(d.tag){case 5:_n||Aa(d,i);case 6:var x=Tn,v=Vr;Tn=null,Ws(o,i,d),Tn=x,Vr=v,Tn!==null&&(Vr?(o=Tn,d=d.stateNode,o.nodeType===8?o.parentNode.removeChild(d):o.removeChild(d)):Tn.removeChild(d.stateNode));break;case 18:Tn!==null&&(Vr?(o=Tn,d=d.stateNode,o.nodeType===8?Xf(o.parentNode,d):o.nodeType===1&&Xf(o,d),zi(o)):Xf(Tn,d.stateNode));break;case 4:x=Tn,v=Vr,Tn=d.stateNode.containerInfo,Vr=!0,Ws(o,i,d),Tn=x,Vr=v;break;case 0:case 11:case 14:case 15:if(!_n&&(x=d.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){v=x=x.next;do{var S=v,P=S.destroy;S=S.tag,P!==void 0&&((S&2)!==0||(S&4)!==0)&&Op(d,i,P),v=v.next}while(v!==x)}Ws(o,i,d);break;case 1:if(!_n&&(Aa(d,i),x=d.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=d.memoizedProps,x.state=d.memoizedState,x.componentWillUnmount()}catch(U){en(d,i,U)}Ws(o,i,d);break;case 21:Ws(o,i,d);break;case 22:d.mode&1?(_n=(x=_n)||d.memoizedState!==null,Ws(o,i,d),_n=x):Ws(o,i,d);break;default:Ws(o,i,d)}}function Ab(o){var i=o.updateQueue;if(i!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new ME),i.forEach(function(x){var v=qE.bind(null,o,x);d.has(x)||(d.add(x),x.then(v,v))})}}function Hr(o,i){var d=i.deletions;if(d!==null)for(var x=0;x<d.length;x++){var v=d[x];try{var S=o,P=i,U=P;e:for(;U!==null;){switch(U.tag){case 5:Tn=U.stateNode,Vr=!1;break e;case 3:Tn=U.stateNode.containerInfo,Vr=!0;break e;case 4:Tn=U.stateNode.containerInfo,Vr=!0;break e}U=U.return}if(Tn===null)throw Error(n(160));Pb(S,P,v),Tn=null,Vr=!1;var q=v.alternate;q!==null&&(q.return=null),v.return=null}catch(fe){en(v,i,fe)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)Db(i,o),i=i.sibling}function Db(o,i){var d=o.alternate,x=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Hr(i,o),ss(o),x&4){try{ll(3,o,o.return),su(3,o)}catch(qe){en(o,o.return,qe)}try{ll(5,o,o.return)}catch(qe){en(o,o.return,qe)}}break;case 1:Hr(i,o),ss(o),x&512&&d!==null&&Aa(d,d.return);break;case 5:if(Hr(i,o),ss(o),x&512&&d!==null&&Aa(d,d.return),o.flags&32){var v=o.stateNode;try{ye(v,"")}catch(qe){en(o,o.return,qe)}}if(x&4&&(v=o.stateNode,v!=null)){var S=o.memoizedProps,P=d!==null?d.memoizedProps:S,U=o.type,q=o.updateQueue;if(o.updateQueue=null,q!==null)try{U==="input"&&S.type==="radio"&&S.name!=null&&Ie(v,S),_e(U,P);var fe=_e(U,S);for(P=0;P<q.length;P+=2){var je=q[P],Ce=q[P+1];je==="style"?be(v,Ce):je==="dangerouslySetInnerHTML"?Q(v,Ce):je==="children"?ye(v,Ce):N(v,je,Ce,fe)}switch(U){case"input":Ne(v,S);break;case"textarea":Rt(v,S);break;case"select":var we=v._wrapperState.wasMultiple;v._wrapperState.wasMultiple=!!S.multiple;var ze=S.value;ze!=null?nt(v,!!S.multiple,ze,!1):we!==!!S.multiple&&(S.defaultValue!=null?nt(v,!!S.multiple,S.defaultValue,!0):nt(v,!!S.multiple,S.multiple?[]:"",!1))}v[Xi]=S}catch(qe){en(o,o.return,qe)}}break;case 6:if(Hr(i,o),ss(o),x&4){if(o.stateNode===null)throw Error(n(162));v=o.stateNode,S=o.memoizedProps;try{v.nodeValue=S}catch(qe){en(o,o.return,qe)}}break;case 3:if(Hr(i,o),ss(o),x&4&&d!==null&&d.memoizedState.isDehydrated)try{zi(i.containerInfo)}catch(qe){en(o,o.return,qe)}break;case 4:Hr(i,o),ss(o);break;case 13:Hr(i,o),ss(o),v=o.child,v.flags&8192&&(S=v.memoizedState!==null,v.stateNode.isHidden=S,!S||v.alternate!==null&&v.alternate.memoizedState!==null||(Bp=Lt())),x&4&&Ab(o);break;case 22:if(je=d!==null&&d.memoizedState!==null,o.mode&1?(_n=(fe=_n)||je,Hr(i,o),_n=fe):Hr(i,o),ss(o),x&8192){if(fe=o.memoizedState!==null,(o.stateNode.isHidden=fe)&&!je&&(o.mode&1)!==0)for(Ue=o,je=o.child;je!==null;){for(Ce=Ue=je;Ue!==null;){switch(we=Ue,ze=we.child,we.tag){case 0:case 11:case 14:case 15:ll(4,we,we.return);break;case 1:Aa(we,we.return);var Ve=we.stateNode;if(typeof Ve.componentWillUnmount=="function"){x=we,d=we.return;try{i=x,Ve.props=i.memoizedProps,Ve.state=i.memoizedState,Ve.componentWillUnmount()}catch(qe){en(x,d,qe)}}break;case 5:Aa(we,we.return);break;case 22:if(we.memoizedState!==null){Ob(Ce);continue}}ze!==null?(ze.return=we,Ue=ze):Ob(Ce)}je=je.sibling}e:for(je=null,Ce=o;;){if(Ce.tag===5){if(je===null){je=Ce;try{v=Ce.stateNode,fe?(S=v.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none"):(U=Ce.stateNode,q=Ce.memoizedProps.style,P=q!=null&&q.hasOwnProperty("display")?q.display:null,U.style.display=te("display",P))}catch(qe){en(o,o.return,qe)}}}else if(Ce.tag===6){if(je===null)try{Ce.stateNode.nodeValue=fe?"":Ce.memoizedProps}catch(qe){en(o,o.return,qe)}}else if((Ce.tag!==22&&Ce.tag!==23||Ce.memoizedState===null||Ce===o)&&Ce.child!==null){Ce.child.return=Ce,Ce=Ce.child;continue}if(Ce===o)break e;for(;Ce.sibling===null;){if(Ce.return===null||Ce.return===o)break e;je===Ce&&(je=null),Ce=Ce.return}je===Ce&&(je=null),Ce.sibling.return=Ce.return,Ce=Ce.sibling}}break;case 19:Hr(i,o),ss(o),x&4&&Ab(o);break;case 21:break;default:Hr(i,o),ss(o)}}function ss(o){var i=o.flags;if(i&2){try{e:{for(var d=o.return;d!==null;){if(Tb(d)){var x=d;break e}d=d.return}throw Error(n(160))}switch(x.tag){case 5:var v=x.stateNode;x.flags&32&&(ye(v,""),x.flags&=-33);var S=Rb(o);_p(o,S,v);break;case 3:case 4:var P=x.stateNode.containerInfo,U=Rb(o);Mp(o,U,P);break;default:throw Error(n(161))}}catch(q){en(o,o.return,q)}o.flags&=-3}i&4096&&(o.flags&=-4097)}function FE(o,i,d){Ue=o,$b(o)}function $b(o,i,d){for(var x=(o.mode&1)!==0;Ue!==null;){var v=Ue,S=v.child;if(v.tag===22&&x){var P=v.memoizedState!==null||ru;if(!P){var U=v.alternate,q=U!==null&&U.memoizedState!==null||_n;U=ru;var fe=_n;if(ru=P,(_n=q)&&!fe)for(Ue=v;Ue!==null;)P=Ue,q=P.child,P.tag===22&&P.memoizedState!==null?Ib(v):q!==null?(q.return=P,Ue=q):Ib(v);for(;S!==null;)Ue=S,$b(S),S=S.sibling;Ue=v,ru=U,_n=fe}Lb(o)}else(v.subtreeFlags&8772)!==0&&S!==null?(S.return=v,Ue=S):Lb(o)}}function Lb(o){for(;Ue!==null;){var i=Ue;if((i.flags&8772)!==0){var d=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:_n||su(5,i);break;case 1:var x=i.stateNode;if(i.flags&4&&!_n)if(d===null)x.componentDidMount();else{var v=i.elementType===i.type?d.memoizedProps:Ur(i.type,d.memoizedProps);x.componentDidUpdate(v,d.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var S=i.updateQueue;S!==null&&Oy(i,S,x);break;case 3:var P=i.updateQueue;if(P!==null){if(d=null,i.child!==null)switch(i.child.tag){case 5:d=i.child.stateNode;break;case 1:d=i.child.stateNode}Oy(i,P,d)}break;case 5:var U=i.stateNode;if(d===null&&i.flags&4){d=U;var q=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":q.autoFocus&&d.focus();break;case"img":q.src&&(d.src=q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var fe=i.alternate;if(fe!==null){var je=fe.memoizedState;if(je!==null){var Ce=je.dehydrated;Ce!==null&&zi(Ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}_n||i.flags&512&&Ip(i)}catch(we){en(i,i.return,we)}}if(i===o){Ue=null;break}if(d=i.sibling,d!==null){d.return=i.return,Ue=d;break}Ue=i.return}}function Ob(o){for(;Ue!==null;){var i=Ue;if(i===o){Ue=null;break}var d=i.sibling;if(d!==null){d.return=i.return,Ue=d;break}Ue=i.return}}function Ib(o){for(;Ue!==null;){var i=Ue;try{switch(i.tag){case 0:case 11:case 15:var d=i.return;try{su(4,i)}catch(q){en(i,d,q)}break;case 1:var x=i.stateNode;if(typeof x.componentDidMount=="function"){var v=i.return;try{x.componentDidMount()}catch(q){en(i,v,q)}}var S=i.return;try{Ip(i)}catch(q){en(i,S,q)}break;case 5:var P=i.return;try{Ip(i)}catch(q){en(i,P,q)}}}catch(q){en(i,i.return,q)}if(i===o){Ue=null;break}var U=i.sibling;if(U!==null){U.return=i.return,Ue=U;break}Ue=i.return}}var zE=Math.ceil,ou=T.ReactCurrentDispatcher,Fp=T.ReactCurrentOwner,Cr=T.ReactCurrentBatchConfig,vt=0,Nn=null,un=null,Rn=0,fr=0,Da=zs(0),xn=0,cl=null,Po=0,au=0,zp=0,ul=null,Qn=null,Bp=0,$a=1/0,Cs=null,iu=!1,Up=null,Ks=null,lu=!1,qs=null,cu=0,dl=0,Vp=null,uu=-1,du=0;function Hn(){return(vt&6)!==0?Lt():uu!==-1?uu:uu=Lt()}function Gs(o){return(o.mode&1)===0?1:(vt&2)!==0&&Rn!==0?Rn&-Rn:kE.transition!==null?(du===0&&(du=bc()),du):(o=Et,o!==0||(o=window.event,o=o===void 0?16:_x(o.type)),o)}function Wr(o,i,d,x){if(50<dl)throw dl=0,Vp=null,Error(n(185));wo(o,d,x),((vt&2)===0||o!==Nn)&&(o===Nn&&((vt&2)===0&&(au|=d),xn===4&&Ys(o,Rn)),Zn(o,x),d===1&&vt===0&&(i.mode&1)===0&&($a=Lt()+500,Fc&&Us()))}function Zn(o,i){var d=o.callbackNode;Oi(o,i);var x=bo(o,o===Nn?Rn:0);if(x===0)d!==null&&go(d),o.callbackNode=null,o.callbackPriority=0;else if(i=x&-x,o.callbackPriority!==i){if(d!=null&&go(d),i===1)o.tag===0?jE(_b.bind(null,o)):ky(_b.bind(null,o)),yE(function(){(vt&6)===0&&Us()}),d=null;else{switch(vc(x)){case 1:d=$i;break;case 4:d=xc;break;case 16:d=Bn;break;case 536870912:d=yc;break;default:d=Bn}d=Kb(d,Mb.bind(null,o))}o.callbackPriority=i,o.callbackNode=d}}function Mb(o,i){if(uu=-1,du=0,(vt&6)!==0)throw Error(n(327));var d=o.callbackNode;if(La()&&o.callbackNode!==d)return null;var x=bo(o,o===Nn?Rn:0);if(x===0)return null;if((x&30)!==0||(x&o.expiredLanes)!==0||i)i=fu(o,x);else{i=x;var v=vt;vt|=2;var S=zb();(Nn!==o||Rn!==i)&&(Cs=null,$a=Lt()+500,Do(o,i));do try{VE();break}catch(U){Fb(o,U)}while(!0);ip(),ou.current=S,vt=v,un!==null?i=0:(Nn=null,Rn=0,i=xn)}if(i!==0){if(i===2&&(v=Ii(o),v!==0&&(x=v,i=Hp(o,v))),i===1)throw d=cl,Do(o,0),Ys(o,x),Zn(o,Lt()),d;if(i===6)Ys(o,x);else{if(v=o.current.alternate,(x&30)===0&&!BE(v)&&(i=fu(o,x),i===2&&(S=Ii(o),S!==0&&(x=S,i=Hp(o,S))),i===1))throw d=cl,Do(o,0),Ys(o,x),Zn(o,Lt()),d;switch(o.finishedWork=v,o.finishedLanes=x,i){case 0:case 1:throw Error(n(345));case 2:$o(o,Qn,Cs);break;case 3:if(Ys(o,x),(x&130023424)===x&&(i=Bp+500-Lt(),10<i)){if(bo(o,0)!==0)break;if(v=o.suspendedLanes,(v&x)!==x){Hn(),o.pingedLanes|=o.suspendedLanes&v;break}o.timeoutHandle=Jf($o.bind(null,o,Qn,Cs),i);break}$o(o,Qn,Cs);break;case 4:if(Ys(o,x),(x&4194240)===x)break;for(i=o.eventTimes,v=-1;0<x;){var P=31-jt(x);S=1<<P,P=i[P],P>v&&(v=P),x&=~S}if(x=v,x=Lt()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*zE(x/1960))-x,10<x){o.timeoutHandle=Jf($o.bind(null,o,Qn,Cs),x);break}$o(o,Qn,Cs);break;case 5:$o(o,Qn,Cs);break;default:throw Error(n(329))}}}return Zn(o,Lt()),o.callbackNode===d?Mb.bind(null,o):null}function Hp(o,i){var d=ul;return o.current.memoizedState.isDehydrated&&(Do(o,i).flags|=256),o=fu(o,i),o!==2&&(i=Qn,Qn=d,i!==null&&Wp(i)),o}function Wp(o){Qn===null?Qn=o:Qn.push.apply(Qn,o)}function BE(o){for(var i=o;;){if(i.flags&16384){var d=i.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var x=0;x<d.length;x++){var v=d[x],S=v.getSnapshot;v=v.value;try{if(!zr(S(),v))return!1}catch{return!1}}}if(d=i.child,i.subtreeFlags&16384&&d!==null)d.return=i,i=d;else{if(i===o)break;for(;i.sibling===null;){if(i.return===null||i.return===o)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ys(o,i){for(i&=~zp,i&=~au,o.suspendedLanes|=i,o.pingedLanes&=~i,o=o.expirationTimes;0<i;){var d=31-jt(i),x=1<<d;o[d]=-1,i&=~x}}function _b(o){if((vt&6)!==0)throw Error(n(327));La();var i=bo(o,0);if((i&1)===0)return Zn(o,Lt()),null;var d=fu(o,i);if(o.tag!==0&&d===2){var x=Ii(o);x!==0&&(i=x,d=Hp(o,x))}if(d===1)throw d=cl,Do(o,0),Ys(o,i),Zn(o,Lt()),d;if(d===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=i,$o(o,Qn,Cs),Zn(o,Lt()),null}function Kp(o,i){var d=vt;vt|=1;try{return o(i)}finally{vt=d,vt===0&&($a=Lt()+500,Fc&&Us())}}function Ao(o){qs!==null&&qs.tag===0&&(vt&6)===0&&La();var i=vt;vt|=1;var d=Cr.transition,x=Et;try{if(Cr.transition=null,Et=1,o)return o()}finally{Et=x,Cr.transition=d,vt=i,(vt&6)===0&&Us()}}function qp(){fr=Da.current,Bt(Da)}function Do(o,i){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==-1&&(o.timeoutHandle=-1,xE(d)),un!==null)for(d=un.return;d!==null;){var x=d;switch(np(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&Mc();break;case 3:Ra(),Bt(Yn),Bt(On),hp();break;case 5:pp(x);break;case 4:Ra();break;case 13:Bt(Jt);break;case 19:Bt(Jt);break;case 10:lp(x.type._context);break;case 22:case 23:qp()}d=d.return}if(Nn=o,un=o=Js(o.current,null),Rn=fr=i,xn=0,cl=null,zp=au=Po=0,Qn=ul=null,Eo!==null){for(i=0;i<Eo.length;i++)if(d=Eo[i],x=d.interleaved,x!==null){d.interleaved=null;var v=x.next,S=d.pending;if(S!==null){var P=S.next;S.next=v,x.next=P}d.pending=x}Eo=null}return o}function Fb(o,i){do{var d=un;try{if(ip(),Yc.current=Zc,Jc){for(var x=Xt.memoizedState;x!==null;){var v=x.queue;v!==null&&(v.pending=null),x=x.next}Jc=!1}if(Ro=0,Sn=gn=Xt=null,rl=!1,sl=0,Fp.current=null,d===null||d.return===null){xn=1,cl=i,un=null;break}e:{var S=o,P=d.return,U=d,q=i;if(i=Rn,U.flags|=32768,q!==null&&typeof q=="object"&&typeof q.then=="function"){var fe=q,je=U,Ce=je.tag;if((je.mode&1)===0&&(Ce===0||Ce===11||Ce===15)){var we=je.alternate;we?(je.updateQueue=we.updateQueue,je.memoizedState=we.memoizedState,je.lanes=we.lanes):(je.updateQueue=null,je.memoizedState=null)}var ze=ub(P);if(ze!==null){ze.flags&=-257,db(ze,P,U,S,i),ze.mode&1&&cb(S,fe,i),i=ze,q=fe;var Ve=i.updateQueue;if(Ve===null){var qe=new Set;qe.add(q),i.updateQueue=qe}else Ve.add(q);break e}else{if((i&1)===0){cb(S,fe,i),Gp();break e}q=Error(n(426))}}else if(Kt&&U.mode&1){var an=ub(P);if(an!==null){(an.flags&65536)===0&&(an.flags|=256),db(an,P,U,S,i),op(Pa(q,U));break e}}S=q=Pa(q,U),xn!==4&&(xn=2),ul===null?ul=[S]:ul.push(S),S=P;do{switch(S.tag){case 3:S.flags|=65536,i&=-i,S.lanes|=i;var oe=ib(S,q,i);Ly(S,oe);break e;case 1:U=q;var X=S.type,ce=S.stateNode;if((S.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||ce!==null&&typeof ce.componentDidCatch=="function"&&(Ks===null||!Ks.has(ce)))){S.flags|=65536,i&=-i,S.lanes|=i;var Re=lb(S,U,i);Ly(S,Re);break e}}S=S.return}while(S!==null)}Ub(d)}catch(Ge){i=Ge,un===d&&d!==null&&(un=d=d.return);continue}break}while(!0)}function zb(){var o=ou.current;return ou.current=Zc,o===null?Zc:o}function Gp(){(xn===0||xn===3||xn===2)&&(xn=4),Nn===null||(Po&268435455)===0&&(au&268435455)===0||Ys(Nn,Rn)}function fu(o,i){var d=vt;vt|=2;var x=zb();(Nn!==o||Rn!==i)&&(Cs=null,Do(o,i));do try{UE();break}catch(v){Fb(o,v)}while(!0);if(ip(),vt=d,ou.current=x,un!==null)throw Error(n(261));return Nn=null,Rn=0,xn}function UE(){for(;un!==null;)Bb(un)}function VE(){for(;un!==null&&!kf();)Bb(un)}function Bb(o){var i=Wb(o.alternate,o,fr);o.memoizedProps=o.pendingProps,i===null?Ub(o):un=i,Fp.current=null}function Ub(o){var i=o;do{var d=i.alternate;if(o=i.return,(i.flags&32768)===0){if(d=OE(d,i,fr),d!==null){un=d;return}}else{if(d=IE(d,i),d!==null){d.flags&=32767,un=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{xn=6,un=null;return}}if(i=i.sibling,i!==null){un=i;return}un=i=o}while(i!==null);xn===0&&(xn=5)}function $o(o,i,d){var x=Et,v=Cr.transition;try{Cr.transition=null,Et=1,HE(o,i,d,x)}finally{Cr.transition=v,Et=x}return null}function HE(o,i,d,x){do La();while(qs!==null);if((vt&6)!==0)throw Error(n(327));d=o.finishedWork;var v=o.finishedLanes;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var S=d.lanes|d.childLanes;if(Mi(o,S),o===Nn&&(un=Nn=null,Rn=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||lu||(lu=!0,Kb(Bn,function(){return La(),null})),S=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||S){S=Cr.transition,Cr.transition=null;var P=Et;Et=1;var U=vt;vt|=4,Fp.current=null,_E(o,d),Db(d,o),uE(Gf),kc=!!qf,Gf=qf=null,o.current=d,FE(d),ua(),vt=U,Et=P,Cr.transition=S}else o.current=d;if(lu&&(lu=!1,qs=o,cu=v),S=o.pendingLanes,S===0&&(Ks=null),Cf(d.stateNode),Zn(o,Lt()),i!==null)for(x=o.onRecoverableError,d=0;d<i.length;d++)v=i[d],x(v.value,{componentStack:v.stack,digest:v.digest});if(iu)throw iu=!1,o=Up,Up=null,o;return(cu&1)!==0&&o.tag!==0&&La(),S=o.pendingLanes,(S&1)!==0?o===Vp?dl++:(dl=0,Vp=o):dl=0,Us(),null}function La(){if(qs!==null){var o=vc(cu),i=Cr.transition,d=Et;try{if(Cr.transition=null,Et=16>o?16:o,qs===null)var x=!1;else{if(o=qs,qs=null,cu=0,(vt&6)!==0)throw Error(n(331));var v=vt;for(vt|=4,Ue=o.current;Ue!==null;){var S=Ue,P=S.child;if((Ue.flags&16)!==0){var U=S.deletions;if(U!==null){for(var q=0;q<U.length;q++){var fe=U[q];for(Ue=fe;Ue!==null;){var je=Ue;switch(je.tag){case 0:case 11:case 15:ll(8,je,S)}var Ce=je.child;if(Ce!==null)Ce.return=je,Ue=Ce;else for(;Ue!==null;){je=Ue;var we=je.sibling,ze=je.return;if(Eb(je),je===fe){Ue=null;break}if(we!==null){we.return=ze,Ue=we;break}Ue=ze}}}var Ve=S.alternate;if(Ve!==null){var qe=Ve.child;if(qe!==null){Ve.child=null;do{var an=qe.sibling;qe.sibling=null,qe=an}while(qe!==null)}}Ue=S}}if((S.subtreeFlags&2064)!==0&&P!==null)P.return=S,Ue=P;else e:for(;Ue!==null;){if(S=Ue,(S.flags&2048)!==0)switch(S.tag){case 0:case 11:case 15:ll(9,S,S.return)}var oe=S.sibling;if(oe!==null){oe.return=S.return,Ue=oe;break e}Ue=S.return}}var X=o.current;for(Ue=X;Ue!==null;){P=Ue;var ce=P.child;if((P.subtreeFlags&2064)!==0&&ce!==null)ce.return=P,Ue=ce;else e:for(P=X;Ue!==null;){if(U=Ue,(U.flags&2048)!==0)try{switch(U.tag){case 0:case 11:case 15:su(9,U)}}catch(Ge){en(U,U.return,Ge)}if(U===P){Ue=null;break e}var Re=U.sibling;if(Re!==null){Re.return=U.return,Ue=Re;break e}Ue=U.return}}if(vt=v,Us(),vr&&typeof vr.onPostCommitFiberRoot=="function")try{vr.onPostCommitFiberRoot(da,o)}catch{}x=!0}return x}finally{Et=d,Cr.transition=i}}return!1}function Vb(o,i,d){i=Pa(d,i),i=ib(o,i,1),o=Hs(o,i,1),i=Hn(),o!==null&&(wo(o,1,i),Zn(o,i))}function en(o,i,d){if(o.tag===3)Vb(o,o,d);else for(;i!==null;){if(i.tag===3){Vb(i,o,d);break}else if(i.tag===1){var x=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(Ks===null||!Ks.has(x))){o=Pa(d,o),o=lb(i,o,1),i=Hs(i,o,1),o=Hn(),i!==null&&(wo(i,1,o),Zn(i,o));break}}i=i.return}}function WE(o,i,d){var x=o.pingCache;x!==null&&x.delete(i),i=Hn(),o.pingedLanes|=o.suspendedLanes&d,Nn===o&&(Rn&d)===d&&(xn===4||xn===3&&(Rn&130023424)===Rn&&500>Lt()-Bp?Do(o,0):zp|=d),Zn(o,i)}function Hb(o,i){i===0&&((o.mode&1)===0?i=1:(i=yo,yo<<=1,(yo&130023424)===0&&(yo=4194304)));var d=Hn();o=ks(o,i),o!==null&&(wo(o,i,d),Zn(o,d))}function KE(o){var i=o.memoizedState,d=0;i!==null&&(d=i.retryLane),Hb(o,d)}function qE(o,i){var d=0;switch(o.tag){case 13:var x=o.stateNode,v=o.memoizedState;v!==null&&(d=v.retryLane);break;case 19:x=o.stateNode;break;default:throw Error(n(314))}x!==null&&x.delete(i),Hb(o,d)}var Wb;Wb=function(o,i,d){if(o!==null)if(o.memoizedProps!==i.pendingProps||Yn.current)Xn=!0;else{if((o.lanes&d)===0&&(i.flags&128)===0)return Xn=!1,LE(o,i,d);Xn=(o.flags&131072)!==0}else Xn=!1,Kt&&(i.flags&1048576)!==0&&Sy(i,Bc,i.index);switch(i.lanes=0,i.tag){case 2:var x=i.type;nu(o,i),o=i.pendingProps;var v=ja(i,On.current);Ta(i,d),v=yp(null,i,x,o,v,d);var S=bp();return i.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,Jn(x)?(S=!0,_c(i)):S=!1,i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,dp(i),v.updater=eu,i.stateNode=v,v._reactInternals=i,Np(i,x,o,d),i=Rp(null,i,x,!0,S,d)):(i.tag=0,Kt&&S&&tp(i),Vn(null,i,v,d),i=i.child),i;case 16:x=i.elementType;e:{switch(nu(o,i),o=i.pendingProps,v=x._init,x=v(x._payload),i.type=x,v=i.tag=YE(x),o=Ur(x,o),v){case 0:i=Tp(null,i,x,o,d);break e;case 1:i=xb(null,i,x,o,d);break e;case 11:i=fb(null,i,x,o,d);break e;case 14:i=pb(null,i,x,Ur(x.type,o),d);break e}throw Error(n(306,x,""))}return i;case 0:return x=i.type,v=i.pendingProps,v=i.elementType===x?v:Ur(x,v),Tp(o,i,x,v,d);case 1:return x=i.type,v=i.pendingProps,v=i.elementType===x?v:Ur(x,v),xb(o,i,x,v,d);case 3:e:{if(yb(i),o===null)throw Error(n(387));x=i.pendingProps,S=i.memoizedState,v=S.element,$y(o,i),qc(i,x,null,d);var P=i.memoizedState;if(x=P.element,S.isDehydrated)if(S={element:x,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},i.updateQueue.baseState=S,i.memoizedState=S,i.flags&256){v=Pa(Error(n(423)),i),i=bb(o,i,x,d,v);break e}else if(x!==v){v=Pa(Error(n(424)),i),i=bb(o,i,x,d,v);break e}else for(dr=Fs(i.stateNode.containerInfo.firstChild),ur=i,Kt=!0,Br=null,d=Ay(i,null,x,d),i.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Na(),x===v){i=Ns(o,i,d);break e}Vn(o,i,x,d)}i=i.child}return i;case 5:return Iy(i),o===null&&sp(i),x=i.type,v=i.pendingProps,S=o!==null?o.memoizedProps:null,P=v.children,Yf(x,v)?P=null:S!==null&&Yf(x,S)&&(i.flags|=32),gb(o,i),Vn(o,i,P,d),i.child;case 6:return o===null&&sp(i),null;case 13:return vb(o,i,d);case 4:return fp(i,i.stateNode.containerInfo),x=i.pendingProps,o===null?i.child=Ca(i,null,x,d):Vn(o,i,x,d),i.child;case 11:return x=i.type,v=i.pendingProps,v=i.elementType===x?v:Ur(x,v),fb(o,i,x,v,d);case 7:return Vn(o,i,i.pendingProps,d),i.child;case 8:return Vn(o,i,i.pendingProps.children,d),i.child;case 12:return Vn(o,i,i.pendingProps.children,d),i.child;case 10:e:{if(x=i.type._context,v=i.pendingProps,S=i.memoizedProps,P=v.value,Ot(Hc,x._currentValue),x._currentValue=P,S!==null)if(zr(S.value,P)){if(S.children===v.children&&!Yn.current){i=Ns(o,i,d);break e}}else for(S=i.child,S!==null&&(S.return=i);S!==null;){var U=S.dependencies;if(U!==null){P=S.child;for(var q=U.firstContext;q!==null;){if(q.context===x){if(S.tag===1){q=Ss(-1,d&-d),q.tag=2;var fe=S.updateQueue;if(fe!==null){fe=fe.shared;var je=fe.pending;je===null?q.next=q:(q.next=je.next,je.next=q),fe.pending=q}}S.lanes|=d,q=S.alternate,q!==null&&(q.lanes|=d),cp(S.return,d,i),U.lanes|=d;break}q=q.next}}else if(S.tag===10)P=S.type===i.type?null:S.child;else if(S.tag===18){if(P=S.return,P===null)throw Error(n(341));P.lanes|=d,U=P.alternate,U!==null&&(U.lanes|=d),cp(P,d,i),P=S.sibling}else P=S.child;if(P!==null)P.return=S;else for(P=S;P!==null;){if(P===i){P=null;break}if(S=P.sibling,S!==null){S.return=P.return,P=S;break}P=P.return}S=P}Vn(o,i,v.children,d),i=i.child}return i;case 9:return v=i.type,x=i.pendingProps.children,Ta(i,d),v=Sr(v),x=x(v),i.flags|=1,Vn(o,i,x,d),i.child;case 14:return x=i.type,v=Ur(x,i.pendingProps),v=Ur(x.type,v),pb(o,i,x,v,d);case 15:return mb(o,i,i.type,i.pendingProps,d);case 17:return x=i.type,v=i.pendingProps,v=i.elementType===x?v:Ur(x,v),nu(o,i),i.tag=1,Jn(x)?(o=!0,_c(i)):o=!1,Ta(i,d),ob(i,x,v),Np(i,x,v,d),Rp(null,i,x,!0,o,d);case 19:return jb(o,i,d);case 22:return hb(o,i,d)}throw Error(n(156,i.tag))};function Kb(o,i){return ca(o,i)}function GE(o,i,d,x){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Er(o,i,d,x){return new GE(o,i,d,x)}function Yp(o){return o=o.prototype,!(!o||!o.isReactComponent)}function YE(o){if(typeof o=="function")return Yp(o)?1:0;if(o!=null){if(o=o.$$typeof,o===W)return 11;if(o===H)return 14}return 2}function Js(o,i){var d=o.alternate;return d===null?(d=Er(o.tag,i,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=i,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,i=o.dependencies,d.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function pu(o,i,d,x,v,S){var P=2;if(x=o,typeof o=="function")Yp(o)&&(P=1);else if(typeof o=="string")P=5;else e:switch(o){case $:return Lo(d.children,v,S,i);case L:P=8,v|=8;break;case K:return o=Er(12,d,i,v|2),o.elementType=K,o.lanes=S,o;case se:return o=Er(13,d,i,v),o.elementType=se,o.lanes=S,o;case z:return o=Er(19,d,i,v),o.elementType=z,o.lanes=S,o;case ne:return mu(d,v,S,i);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case B:P=10;break e;case O:P=9;break e;case W:P=11;break e;case H:P=14;break e;case ee:P=16,x=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return i=Er(P,d,i,v),i.elementType=o,i.type=x,i.lanes=S,i}function Lo(o,i,d,x){return o=Er(7,o,x,i),o.lanes=d,o}function mu(o,i,d,x){return o=Er(22,o,x,i),o.elementType=ne,o.lanes=d,o.stateNode={isHidden:!1},o}function Jp(o,i,d){return o=Er(6,o,null,i),o.lanes=d,o}function Xp(o,i,d){return i=Er(4,o.children!==null?o.children:[],o.key,i),i.lanes=d,i.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},i}function JE(o,i,d,x,v){this.tag=i,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ln(0),this.expirationTimes=Ln(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ln(0),this.identifierPrefix=x,this.onRecoverableError=v,this.mutableSourceEagerHydrationData=null}function Qp(o,i,d,x,v,S,P,U,q){return o=new JE(o,i,d,U,q),i===1?(i=1,S===!0&&(i|=8)):i=0,S=Er(3,null,null,i),o.current=S,S.stateNode=o,S.memoizedState={element:x,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},dp(S),o}function XE(o,i,d){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:x==null?null:""+x,children:o,containerInfo:i,implementation:d}}function qb(o){if(!o)return Bs;o=o._reactInternals;e:{if(_r(o)!==o||o.tag!==1)throw Error(n(170));var i=o;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(Jn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(n(171))}if(o.tag===1){var d=o.type;if(Jn(d))return wy(o,d,i)}return i}function Gb(o,i,d,x,v,S,P,U,q){return o=Qp(d,x,!0,o,v,S,P,U,q),o.context=qb(null),d=o.current,x=Hn(),v=Gs(d),S=Ss(x,v),S.callback=i??null,Hs(d,S,v),o.current.lanes=v,wo(o,v,x),Zn(o,x),o}function hu(o,i,d,x){var v=i.current,S=Hn(),P=Gs(v);return d=qb(d),i.context===null?i.context=d:i.pendingContext=d,i=Ss(S,P),i.payload={element:o},x=x===void 0?null:x,x!==null&&(i.callback=x),o=Hs(v,i,P),o!==null&&(Wr(o,v,P,S),Kc(o,v,P)),P}function gu(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function Yb(o,i){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<i?d:i}}function Zp(o,i){Yb(o,i),(o=o.alternate)&&Yb(o,i)}function QE(){return null}var Jb=typeof reportError=="function"?reportError:function(o){console.error(o)};function em(o){this._internalRoot=o}xu.prototype.render=em.prototype.render=function(o){var i=this._internalRoot;if(i===null)throw Error(n(409));hu(o,i,null,null)},xu.prototype.unmount=em.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var i=o.containerInfo;Ao(function(){hu(null,o,null,null)}),i[bs]=null}};function xu(o){this._internalRoot=o}xu.prototype.unstable_scheduleHydration=function(o){if(o){var i=xe();o={blockedOn:null,target:o,priority:i};for(var d=0;d<Fr.length&&i!==0&&i<Fr[d].priority;d++);Fr.splice(d,0,o),d===0&&Ix(o)}};function tm(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function yu(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function Xb(){}function ZE(o,i,d,x,v){if(v){if(typeof x=="function"){var S=x;x=function(){var fe=gu(P);S.call(fe)}}var P=Gb(i,x,o,0,null,!1,!1,"",Xb);return o._reactRootContainer=P,o[bs]=P.current,Yi(o.nodeType===8?o.parentNode:o),Ao(),P}for(;v=o.lastChild;)o.removeChild(v);if(typeof x=="function"){var U=x;x=function(){var fe=gu(q);U.call(fe)}}var q=Qp(o,0,!1,null,null,!1,!1,"",Xb);return o._reactRootContainer=q,o[bs]=q.current,Yi(o.nodeType===8?o.parentNode:o),Ao(function(){hu(i,q,d,x)}),q}function bu(o,i,d,x,v){var S=d._reactRootContainer;if(S){var P=S;if(typeof v=="function"){var U=v;v=function(){var q=gu(P);U.call(q)}}hu(i,P,o,v)}else P=ZE(d,i,o,v,x);return gu(P)}es=function(o){switch(o.tag){case 3:var i=o.stateNode;if(i.current.memoizedState.isDehydrated){var d=ys(i.pendingLanes);d!==0&&(_i(i,d|1),Zn(i,Lt()),(vt&6)===0&&($a=Lt()+500,Us()))}break;case 13:Ao(function(){var x=ks(o,1);if(x!==null){var v=Hn();Wr(x,o,1,v)}}),Zp(o,1)}},_=function(o){if(o.tag===13){var i=ks(o,134217728);if(i!==null){var d=Hn();Wr(i,o,134217728,d)}Zp(o,134217728)}},le=function(o){if(o.tag===13){var i=Gs(o),d=ks(o,i);if(d!==null){var x=Hn();Wr(d,o,i,x)}Zp(o,i)}},xe=function(){return Et},$e=function(o,i){var d=Et;try{return Et=o,i()}finally{Et=d}},Gt=function(o,i,d){switch(i){case"input":if(Ne(o,d),i=d.name,d.type==="radio"&&i!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<d.length;i++){var x=d[i];if(x!==o&&x.form===o.form){var v=Ic(x);if(!v)throw Error(n(90));Je(x),Ne(x,v)}}}break;case"textarea":Rt(o,d);break;case"select":i=d.value,i!=null&&nt(o,!!d.multiple,i,!1)}},Yt=Kp,sn=Ao;var e2={usingClientEntryPoint:!1,Events:[Qi,va,Ic,Nt,$n,Kp]},fl={findFiberByHostInstance:ko,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},t2={bundleType:fl.bundleType,version:fl.version,rendererPackageName:fl.rendererPackageName,rendererConfig:fl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=ia(o),o===null?null:o.stateNode},findFiberByHostInstance:fl.findFiberByHostInstance||QE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vu.isDisabled&&vu.supportsFiber)try{da=vu.inject(t2),vr=vu}catch{}}return er.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e2,er.createPortal=function(o,i){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tm(i))throw Error(n(200));return XE(o,i,null,d)},er.createRoot=function(o,i){if(!tm(o))throw Error(n(299));var d=!1,x="",v=Jb;return i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(x=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),i=Qp(o,1,!1,null,null,d,!1,x,v),o[bs]=i.current,Yi(o.nodeType===8?o.parentNode:o),new em(i)},er.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var i=o._reactInternals;if(i===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=ia(i),o=o===null?null:o.stateNode,o},er.flushSync=function(o){return Ao(o)},er.hydrate=function(o,i,d){if(!yu(i))throw Error(n(200));return bu(null,o,i,!0,d)},er.hydrateRoot=function(o,i,d){if(!tm(o))throw Error(n(405));var x=d!=null&&d.hydratedSources||null,v=!1,S="",P=Jb;if(d!=null&&(d.unstable_strictMode===!0&&(v=!0),d.identifierPrefix!==void 0&&(S=d.identifierPrefix),d.onRecoverableError!==void 0&&(P=d.onRecoverableError)),i=Gb(i,null,o,1,d??null,v,!1,S,P),o[bs]=i.current,Yi(o),x)for(o=0;o<x.length;o++)d=x[o],v=d._getVersion,v=v(d._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[d,v]:i.mutableSourceEagerHydrationData.push(d,v);return new xu(i)},er.render=function(o,i,d){if(!yu(i))throw Error(n(200));return bu(null,o,i,!1,d)},er.unmountComponentAtNode=function(o){if(!yu(o))throw Error(n(40));return o._reactRootContainer?(Ao(function(){bu(null,null,o,!1,function(){o._reactRootContainer=null,o[bs]=null})}),!0):!1},er.unstable_batchedUpdates=Kp,er.unstable_renderSubtreeIntoContainer=function(o,i,d,x){if(!yu(d))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return bu(o,i,d,!1,x)},er.version="18.3.1-next-f1338f8080-20240426",er}var av;function zj(){if(av)return sm.exports;av=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),sm.exports=d2(),sm.exports}var iv;function f2(){if(iv)return wu;iv=1;var e=zj();return wu.createRoot=e.createRoot,wu.hydrateRoot=e.hydrateRoot,wu}var p2=f2();/**
|
|
41
|
-
* react-router v7.13.1
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Remix Software Inc.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
-
*
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/var lv="popstate";function cv(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function m2(e={}){function t(s,a){var m;let l=(m=a.state)==null?void 0:m.masked,{pathname:c,search:u,hash:p}=l||s.location;return oh("",{pathname:c,search:u,hash:p},a.state&&a.state.usr||null,a.state&&a.state.key||"default",l?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,a){return typeof a=="string"?a:zl(a)}return g2(t,n,null,e)}function Qt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Kr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function h2(){return Math.random().toString(36).substring(2,10)}function uv(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function oh(e,t,n=null,s,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?gi(t):t,state:n,key:t&&t.key||s||h2(),unstable_mask:a}}function zl({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function gi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function g2(e,t,n,s={}){let{window:a=document.defaultView,v5Compat:l=!1}=s,c=a.history,u="POP",p=null,m=h();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function h(){return(c.state||{idx:null}).idx}function g(){u="POP";let w=h(),k=w==null?null:w-m;m=w,p&&p({action:u,location:j.location,delta:k})}function y(w,k){u="PUSH";let C=cv(w)?w:oh(j.location,w,k);m=h()+1;let N=uv(C,m),T=j.createHref(C.unstable_mask||C);try{c.pushState(N,"",T)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;a.location.assign(T)}l&&p&&p({action:u,location:j.location,delta:1})}function b(w,k){u="REPLACE";let C=cv(w)?w:oh(j.location,w,k);m=h();let N=uv(C,m),T=j.createHref(C.unstable_mask||C);c.replaceState(N,"",T),l&&p&&p({action:u,location:j.location,delta:0})}function E(w){return x2(w)}let j={get action(){return u},get location(){return e(a,c)},listen(w){if(p)throw new Error("A history only accepts one active listener");return a.addEventListener(lv,g),p=w,()=>{a.removeEventListener(lv,g),p=null}},createHref(w){return t(a,w)},createURL:E,encodeLocation(w){let k=E(w);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:y,replace:b,go(w){return c.go(w)}};return j}function x2(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Qt(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:zl(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function Bj(e,t,n="/"){return y2(e,t,n,!1)}function y2(e,t,n,s){let a=typeof t=="string"?gi(t):t,l=As(a.pathname||"/",n);if(l==null)return null;let c=Uj(e);b2(c);let u=null;for(let p=0;u==null&&p<c.length;++p){let m=P2(l);u=T2(c[p],m,s)}return u}function Uj(e,t=[],n=[],s="",a=!1){let l=(c,u,p=a,m)=>{let h={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(s)&&p)return;Qt(h.relativePath.startsWith(s),`Absolute route path "${h.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(s.length)}let g=us([s,h.relativePath]),y=n.concat(h);c.children&&c.children.length>0&&(Qt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Uj(c.children,t,y,g,p)),!(c.path==null&&!c.index)&&t.push({path:g,score:C2(g,c.index),routesMeta:y})};return e.forEach((c,u)=>{var p;if(c.path===""||!((p=c.path)!=null&&p.includes("?")))l(c,u);else for(let m of Vj(c.path))l(c,u,!0,m)}),t}function Vj(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,a=n.endsWith("?"),l=n.replace(/\?$/,"");if(s.length===0)return a?[l,""]:[l];let c=Vj(s.join("/")),u=[];return u.push(...c.map(p=>p===""?l:[l,p].join("/"))),a&&u.push(...c),u.map(p=>e.startsWith("/")&&p===""?"/":p)}function b2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:E2(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var v2=/^:[\w-]+$/,w2=3,j2=2,k2=1,S2=10,N2=-2,dv=e=>e==="*";function C2(e,t){let n=e.split("/"),s=n.length;return n.some(dv)&&(s+=N2),t&&(s+=j2),n.filter(a=>!dv(a)).reduce((a,l)=>a+(v2.test(l)?w2:l===""?k2:S2),s)}function E2(e,t){return e.length===t.length&&e.slice(0,-1).every((s,a)=>s===t[a])?e[e.length-1]-t[t.length-1]:0}function T2(e,t,n=!1){let{routesMeta:s}=e,a={},l="/",c=[];for(let u=0;u<s.length;++u){let p=s[u],m=u===s.length-1,h=l==="/"?t:t.slice(l.length)||"/",g=Zu({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},h),y=p.route;if(!g&&m&&n&&!s[s.length-1].route.index&&(g=Zu({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},h)),!g)return null;Object.assign(a,g.params),c.push({params:a,pathname:us([l,g.pathname]),pathnameBase:L2(us([l,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(l=us([l,g.pathnameBase]))}return c}function Zu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=R2(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let l=a[0],c=l.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:s.reduce((m,{paramName:h,isOptional:g},y)=>{if(h==="*"){let E=u[y]||"";c=l.slice(0,l.length-E.length).replace(/(.)\/+$/,"$1")}const b=u[y];return g&&!b?m[h]=void 0:m[h]=(b||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function R2(e,t=!1,n=!0){Kr(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 s=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,p,m,h)=>{if(s.push({paramName:u,isOptional:p!=null}),p){let g=h.charAt(m+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),s]}function P2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Kr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function As(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}var A2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function D2(e,t="/"){let{pathname:n,search:s="",hash:a=""}=typeof e=="string"?gi(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=fv(n.substring(1),"/"):l=fv(n,t)):l=t,{pathname:l,search:O2(s),hash:I2(a)}}function fv(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function im(e,t,n,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. 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 $2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Hj(e){let t=$2(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function qh(e,t,n,s=!1){let a;typeof e=="string"?a=gi(e):(a={...e},Qt(!a.pathname||!a.pathname.includes("?"),im("?","pathname","search",a)),Qt(!a.pathname||!a.pathname.includes("#"),im("#","pathname","hash",a)),Qt(!a.search||!a.search.includes("#"),im("#","search","hash",a)));let l=e===""||a.pathname==="",c=l?"/":a.pathname,u;if(c==null)u=n;else{let g=t.length-1;if(!s&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),g-=1;a.pathname=y.join("/")}u=g>=0?t[g]:"/"}let p=D2(a,u),m=c&&c!=="/"&&c.endsWith("/"),h=(l||c===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(m||h)&&(p.pathname+="/"),p}var us=e=>e.join("/").replace(/\/\/+/g,"/"),L2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),O2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,I2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,M2=class{constructor(e,t,n,s=!1){this.status=e,this.statusText=t||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function _2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function F2(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Wj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Kj(e,t){let n=e;if(typeof n!="string"||!A2.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,a=!1;if(Wj)try{let l=new URL(window.location.href),c=n.startsWith("//")?new URL(l.protocol+n):new URL(n),u=As(c.pathname,t);c.origin===l.origin&&u!=null?n=u+c.search+c.hash:a=!0}catch{Kr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var qj=["POST","PUT","PATCH","DELETE"];new Set(qj);var z2=["GET",...qj];new Set(z2);var xi=f.createContext(null);xi.displayName="DataRouter";var Rd=f.createContext(null);Rd.displayName="DataRouterState";var B2=f.createContext(!1),Gj=f.createContext({isTransitioning:!1});Gj.displayName="ViewTransition";var U2=f.createContext(new Map);U2.displayName="Fetchers";var V2=f.createContext(null);V2.displayName="Await";var Or=f.createContext(null);Or.displayName="Navigation";var tc=f.createContext(null);tc.displayName="Location";var Jr=f.createContext({outlet:null,matches:[],isDataRoute:!1});Jr.displayName="Route";var Gh=f.createContext(null);Gh.displayName="RouteError";var Yj="REACT_ROUTER_ERROR",H2="REDIRECT",W2="ROUTE_ERROR_RESPONSE";function K2(e){if(e.startsWith(`${Yj}:${H2}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function q2(e){if(e.startsWith(`${Yj}:${W2}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new M2(t.status,t.statusText,t.data)}catch{}}function G2(e,{relative:t}={}){Qt(nc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=f.useContext(Or),{hash:a,pathname:l,search:c}=rc(e,{relative:t}),u=l;return n!=="/"&&(u=l==="/"?n:us([n,l])),s.createHref({pathname:u,search:c,hash:a})}function nc(){return f.useContext(tc)!=null}function Wn(){return Qt(nc(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(tc).location}var Jj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Xj(e){f.useContext(Or).static||f.useLayoutEffect(e)}function Dt(){let{isDataRoute:e}=f.useContext(Jr);return e?cT():Y2()}function Y2(){Qt(nc(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(xi),{basename:t,navigator:n}=f.useContext(Or),{matches:s}=f.useContext(Jr),{pathname:a}=Wn(),l=JSON.stringify(Hj(s)),c=f.useRef(!1);return Xj(()=>{c.current=!0}),f.useCallback((p,m={})=>{if(Kr(c.current,Jj),!c.current)return;if(typeof p=="number"){n.go(p);return}let h=qh(p,JSON.parse(l),a,m.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:us([t,h.pathname])),(m.replace?n.replace:n.push)(h,m.state,m)},[t,n,l,a,e])}var J2=f.createContext(null);function X2(e){let t=f.useContext(Jr).outlet;return f.useMemo(()=>t&&f.createElement(J2.Provider,{value:e},t),[t,e])}function $t(){let{matches:e}=f.useContext(Jr),t=e[e.length-1];return t?t.params:{}}function rc(e,{relative:t}={}){let{matches:n}=f.useContext(Jr),{pathname:s}=Wn(),a=JSON.stringify(Hj(n));return f.useMemo(()=>qh(e,JSON.parse(a),s,t==="path"),[e,a,s,t])}function Q2(e,t){return Qj(e,t)}function Qj(e,t,n){var w;Qt(nc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=f.useContext(Or),{matches:a}=f.useContext(Jr),l=a[a.length-1],c=l?l.params:{},u=l?l.pathname:"/",p=l?l.pathnameBase:"/",m=l&&l.route;{let k=m&&m.path||"";e0(u,!m||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
50
|
-
|
|
51
|
-
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let h=Wn(),g;if(t){let k=typeof t=="string"?gi(t):t;Qt(p==="/"||((w=k.pathname)==null?void 0:w.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${k.pathname}" was given in the \`location\` prop.`),g=k}else g=h;let y=g.pathname||"/",b=y;if(p!=="/"){let k=p.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(k.length).join("/")}let E=Bj(e,{pathname:b});Kr(m||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Kr(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=rT(E&&E.map(k=>Object.assign({},k,{params:Object.assign({},c,k.params),pathname:us([p,s.encodeLocation?s.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?p:us([p,s.encodeLocation?s.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),a,n);return t&&j?f.createElement(tc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function Z2(){let e=lT(),t=_2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:s},l={padding:"2px 4px",backgroundColor:s},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:l},"ErrorBoundary")," or"," ",f.createElement("code",{style:l},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:a},n):null,c)}var eT=f.createElement(Z2,null),Zj=class extends f.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?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=q2(e.digest);n&&(e=n)}let t=e!==void 0?f.createElement(Jr.Provider,{value:this.props.routeContext},f.createElement(Gh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(tT,{error:e},t):t}};Zj.contextType=B2;var lm=new WeakMap;function tT({children:e,error:t}){let{basename:n}=f.useContext(Or);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=K2(t.digest);if(s){let a=lm.get(t);if(a)throw a;let l=Kj(s.location,n);if(Wj&&!lm.get(t))if(l.isExternal||s.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:s.replace}));throw lm.set(t,c),c}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function nT({routeContext:e,match:t,children:n}){let s=f.useContext(xi);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(Jr.Provider,{value:e},n)}function rT(e,t=[],n){let s=n==null?void 0:n.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let a=e,l=s==null?void 0:s.errors;if(l!=null){let h=a.findIndex(g=>g.route.id&&(l==null?void 0:l[g.route.id])!==void 0);Qt(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,h+1))}let c=!1,u=-1;if(n&&s){c=s.renderFallback;for(let h=0;h<a.length;h++){let g=a[h];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(u=h),g.route.id){let{loaderData:y,errors:b}=s,E=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!b||b[g.route.id]===void 0);if(g.route.lazy||E){n.isStatic&&(c=!0),u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}}let p=n==null?void 0:n.onError,m=s&&p?(h,g)=>{var y,b;p(h,{location:s.location,params:((b=(y=s.matches)==null?void 0:y[0])==null?void 0:b.params)??{},unstable_pattern:F2(s.matches),errorInfo:g})}:void 0;return a.reduceRight((h,g,y)=>{let b,E=!1,j=null,w=null;s&&(b=l&&g.route.id?l[g.route.id]:void 0,j=g.route.errorElement||eT,c&&(u<0&&y===0?(e0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,w=null):u===y&&(E=!0,w=g.route.hydrateFallbackElement||null)));let k=t.concat(a.slice(0,y+1)),C=()=>{let N;return b?N=j:E?N=w:g.route.Component?N=f.createElement(g.route.Component,null):g.route.element?N=g.route.element:N=h,f.createElement(nT,{match:g,routeContext:{outlet:h,matches:k,isDataRoute:s!=null},children:N})};return s&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?f.createElement(Zj,{location:s.location,revalidation:s.revalidation,component:j,error:b,children:C(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:m}):C()},null)}function Yh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sT(e){let t=f.useContext(xi);return Qt(t,Yh(e)),t}function oT(e){let t=f.useContext(Rd);return Qt(t,Yh(e)),t}function aT(e){let t=f.useContext(Jr);return Qt(t,Yh(e)),t}function Jh(e){let t=aT(e),n=t.matches[t.matches.length-1];return Qt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function iT(){return Jh("useRouteId")}function lT(){var s;let e=f.useContext(Gh),t=oT("useRouteError"),n=Jh("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[n]}function cT(){let{router:e}=sT("useNavigate"),t=Jh("useNavigate"),n=f.useRef(!1);return Xj(()=>{n.current=!0}),f.useCallback(async(a,l={})=>{Kr(n.current,Jj),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...l}))},[e,t])}var pv={};function e0(e,t,n){!t&&!pv[e]&&(pv[e]=!0,Kr(!1,n))}f.memo(uT);function uT({routes:e,future:t,state:n,isStatic:s,onError:a}){return Qj(e,void 0,{state:n,isStatic:s,onError:a})}function dT(e){return X2(e.context)}function He(e){Qt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function fT({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:a,static:l=!1,unstable_useTransitions:c}){Qt(!nc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),p=f.useMemo(()=>({basename:u,navigator:a,static:l,unstable_useTransitions:c,future:{}}),[u,a,l,c]);typeof n=="string"&&(n=gi(n));let{pathname:m="/",search:h="",hash:g="",state:y=null,key:b="default",unstable_mask:E}=n,j=f.useMemo(()=>{let w=As(m,u);return w==null?null:{location:{pathname:w,search:h,hash:g,state:y,key:b,unstable_mask:E},navigationType:s}},[u,m,h,g,y,b,s,E]);return Kr(j!=null,`<Router basename="${u}"> is not able to match the URL "${m}${h}${g}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:f.createElement(Or.Provider,{value:p},f.createElement(tc.Provider,{children:t,value:j}))}function pT({children:e,location:t}){return Q2(ah(e),t)}function ah(e,t=[]){let n=[];return f.Children.forEach(e,(s,a)=>{if(!f.isValidElement(s))return;let l=[...t,a];if(s.type===f.Fragment){n.push.apply(n,ah(s.props.children,l));return}Qt(s.type===He,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Qt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let c={id:s.props.id||l.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(c.children=ah(s.props.children,l)),n.push(c)}),n}var Fu="get",zu="application/x-www-form-urlencoded";function Pd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function mT(e){return Pd(e)&&e.tagName.toLowerCase()==="button"}function hT(e){return Pd(e)&&e.tagName.toLowerCase()==="form"}function gT(e){return Pd(e)&&e.tagName.toLowerCase()==="input"}function xT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yT(e,t){return e.button===0&&(!t||t==="_self")&&!xT(e)}function ih(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(a=>[n,a]):[[n,s]])},[]))}function bT(e,t){let n=ih(e);return t&&t.forEach((s,a)=>{n.has(a)||t.getAll(a).forEach(l=>{n.append(a,l)})}),n}var ju=null;function vT(){if(ju===null)try{new FormData(document.createElement("form"),0),ju=!1}catch{ju=!0}return ju}var wT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function cm(e){return e!=null&&!wT.has(e)?(Kr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${zu}"`),null):e}function jT(e,t){let n,s,a,l,c;if(hT(e)){let u=e.getAttribute("action");s=u?As(u,t):null,n=e.getAttribute("method")||Fu,a=cm(e.getAttribute("enctype"))||zu,l=new FormData(e)}else if(mT(e)||gT(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||u.getAttribute("action");if(s=p?As(p,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Fu,a=cm(e.getAttribute("formenctype"))||cm(u.getAttribute("enctype"))||zu,l=new FormData(u,e),!vT()){let{name:m,type:h,value:g}=e;if(h==="image"){let y=m?`${m}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else m&&l.append(m,g)}}else{if(Pd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Fu,s=null,a=zu,c=e}return l&&a==="text/plain"&&(c=l,l=void 0),{action:s,method:n.toLowerCase(),encType:a,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Xh(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function kT(e,t,n,s){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${s}`:a.pathname=`${a.pathname}.${s}`:a.pathname==="/"?a.pathname=`_root.${s}`:t&&As(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${s}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${s}`,a}async function ST(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function NT(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function CT(e,t,n){let s=await Promise.all(e.map(async a=>{let l=t.routes[a.route.id];if(l){let c=await ST(l,n);return c.links?c.links():[]}return[]}));return PT(s.flat(1).filter(NT).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function mv(e,t,n,s,a,l){let c=(p,m)=>n[m]?p.route.id!==n[m].route.id:!0,u=(p,m)=>{var h;return n[m].pathname!==p.pathname||((h=n[m].route.path)==null?void 0:h.endsWith("*"))&&n[m].params["*"]!==p.params["*"]};return l==="assets"?t.filter((p,m)=>c(p,m)||u(p,m)):l==="data"?t.filter((p,m)=>{var g;let h=s.routes[p.route.id];if(!h||!h.hasLoader)return!1;if(c(p,m)||u(p,m))return!0;if(p.route.shouldRevalidate){let y=p.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function ET(e,t,{includeHydrateFallback:n}={}){return TT(e.map(s=>{let a=t.routes[s.route.id];if(!a)return[];let l=[a.module];return a.clientActionModule&&(l=l.concat(a.clientActionModule)),a.clientLoaderModule&&(l=l.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(l=l.concat(a.hydrateFallbackModule)),a.imports&&(l=l.concat(a.imports)),l}).flat(1))}function TT(e){return[...new Set(e)]}function RT(e){let t={},n=Object.keys(e).sort();for(let s of n)t[s]=e[s];return t}function PT(e,t){let n=new Set;return new Set(t),e.reduce((s,a)=>{let l=JSON.stringify(RT(a));return n.has(l)||(n.add(l),s.push({key:l,link:a})),s},[])}function t0(){let e=f.useContext(xi);return Xh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function AT(){let e=f.useContext(Rd);return Xh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Qh=f.createContext(void 0);Qh.displayName="FrameworkContext";function n0(){let e=f.useContext(Qh);return Xh(e,"You must render this element inside a <HydratedRouter> element"),e}function DT(e,t){let n=f.useContext(Qh),[s,a]=f.useState(!1),[l,c]=f.useState(!1),{onFocus:u,onBlur:p,onMouseEnter:m,onMouseLeave:h,onTouchStart:g}=t,y=f.useRef(null);f.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=k=>{k.forEach(C=>{c(C.isIntersecting)})},w=new IntersectionObserver(j,{threshold:.5});return y.current&&w.observe(y.current),()=>{w.disconnect()}}},[e]),f.useEffect(()=>{if(s){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[s]);let b=()=>{a(!0)},E=()=>{a(!1),c(!1)};return n?e!=="intent"?[l,y,{}]:[l,y,{onFocus:ml(u,b),onBlur:ml(p,E),onMouseEnter:ml(m,b),onMouseLeave:ml(h,E),onTouchStart:ml(g,b)}]:[!1,y,{}]}function ml(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function $T({page:e,...t}){let{router:n}=t0(),s=f.useMemo(()=>Bj(n.routes,e,n.basename),[n.routes,e,n.basename]);return s?f.createElement(OT,{page:e,matches:s,...t}):null}function LT(e){let{manifest:t,routeModules:n}=n0(),[s,a]=f.useState([]);return f.useEffect(()=>{let l=!1;return CT(e,t,n).then(c=>{l||a(c)}),()=>{l=!0}},[e,t,n]),s}function OT({page:e,matches:t,...n}){let s=Wn(),{future:a,manifest:l,routeModules:c}=n0(),{basename:u}=t0(),{loaderData:p,matches:m}=AT(),h=f.useMemo(()=>mv(e,t,m,l,s,"data"),[e,t,m,l,s]),g=f.useMemo(()=>mv(e,t,m,l,s,"assets"),[e,t,m,l,s]),y=f.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let j=new Set,w=!1;if(t.forEach(C=>{var T;let N=l.routes[C.route.id];!N||!N.hasLoader||(!h.some(D=>D.route.id===C.route.id)&&C.route.id in p&&((T=c[C.route.id])!=null&&T.shouldRevalidate)||N.hasClientLoader?w=!0:j.add(C.route.id))}),j.size===0)return[];let k=kT(e,u,a.unstable_trailingSlashAwareDataRequests,"data");return w&&j.size>0&&k.searchParams.set("_routes",t.filter(C=>j.has(C.route.id)).map(C=>C.route.id).join(",")),[k.pathname+k.search]},[u,a.unstable_trailingSlashAwareDataRequests,p,s,l,h,t,e,c]),b=f.useMemo(()=>ET(g,l),[g,l]),E=LT(g);return f.createElement(f.Fragment,null,y.map(j=>f.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),b.map(j=>f.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),E.map(({key:j,link:w})=>f.createElement("link",{key:j,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function IT(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var MT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{MT&&(window.__reactRouterVersion="7.13.1")}catch{}function _T({basename:e,children:t,unstable_useTransitions:n,window:s}){let a=f.useRef();a.current==null&&(a.current=m2({window:s,v5Compat:!0}));let l=a.current,[c,u]=f.useState({action:l.action,location:l.location}),p=f.useCallback(m=>{n===!1?u(m):f.startTransition(()=>u(m))},[n]);return f.useLayoutEffect(()=>l.listen(p),[l,p]),f.createElement(fT,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:l,unstable_useTransitions:n})}var r0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ee=f.forwardRef(function({onClick:t,discover:n="render",prefetch:s="none",relative:a,reloadDocument:l,replace:c,unstable_mask:u,state:p,target:m,to:h,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b,...E},j){let{basename:w,navigator:k,unstable_useTransitions:C}=f.useContext(Or),N=typeof h=="string"&&r0.test(h),T=Kj(h,w);h=T.to;let D=G2(h,{relative:a}),R=Wn(),$=null;if(u){let H=qh(u,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);w!=="/"&&(H.pathname=H.pathname==="/"?w:us([w,H.pathname])),$=k.createHref(H)}let[L,K,B]=DT(s,E),O=UT(h,{replace:c,unstable_mask:u,state:p,target:m,preventScrollReset:g,relative:a,viewTransition:y,unstable_defaultShouldRevalidate:b,unstable_useTransitions:C});function W(H){t&&t(H),H.defaultPrevented||O(H)}let se=!(T.isExternal||l),z=f.createElement("a",{...E,...B,href:(se?$:void 0)||T.absoluteURL||D,onClick:se?W:t,ref:IT(j,K),target:m,"data-discover":!N&&n==="render"?"true":void 0});return L&&!N?f.createElement(f.Fragment,null,z,f.createElement($T,{page:D})):z});Ee.displayName="Link";var FT=f.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:s="",end:a=!1,style:l,to:c,viewTransition:u,children:p,...m},h){let g=rc(c,{relative:m.relative}),y=Wn(),b=f.useContext(Rd),{navigator:E,basename:j}=f.useContext(Or),w=b!=null&&qT(g)&&u===!0,k=E.encodeLocation?E.encodeLocation(g).pathname:g.pathname,C=y.pathname,N=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(C=C.toLowerCase(),N=N?N.toLowerCase():null,k=k.toLowerCase()),N&&j&&(N=As(N,j)||N);const T=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let D=C===k||!a&&C.startsWith(k)&&C.charAt(T)==="/",R=N!=null&&(N===k||!a&&N.startsWith(k)&&N.charAt(k.length)==="/"),$={isActive:D,isPending:R,isTransitioning:w},L=D?t:void 0,K;typeof s=="function"?K=s($):K=[s,D?"active":null,R?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let B=typeof l=="function"?l($):l;return f.createElement(Ee,{...m,"aria-current":L,className:K,ref:h,style:B,to:c,viewTransition:u},typeof p=="function"?p($):p)});FT.displayName="NavLink";var zT=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:s,replace:a,state:l,method:c=Fu,action:u,onSubmit:p,relative:m,preventScrollReset:h,viewTransition:g,unstable_defaultShouldRevalidate:y,...b},E)=>{let{unstable_useTransitions:j}=f.useContext(Or),w=WT(),k=KT(u,{relative:m}),C=c.toLowerCase()==="get"?"get":"post",N=typeof u=="string"&&r0.test(u),T=D=>{if(p&&p(D),D.defaultPrevented)return;D.preventDefault();let R=D.nativeEvent.submitter,$=(R==null?void 0:R.getAttribute("formmethod"))||c,L=()=>w(R||D.currentTarget,{fetcherKey:t,method:$,navigate:n,replace:a,state:l,relative:m,preventScrollReset:h,viewTransition:g,unstable_defaultShouldRevalidate:y});j&&n!==!1?f.startTransition(()=>L()):L()};return f.createElement("form",{ref:E,method:C,action:k,onSubmit:s?p:T,...b,"data-discover":!N&&e==="render"?"true":void 0})});zT.displayName="Form";function BT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function s0(e){let t=f.useContext(xi);return Qt(t,BT(e)),t}function UT(e,{target:t,replace:n,unstable_mask:s,state:a,preventScrollReset:l,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:p,unstable_useTransitions:m}={}){let h=Dt(),g=Wn(),y=rc(e,{relative:c});return f.useCallback(b=>{if(yT(b,t)){b.preventDefault();let E=n!==void 0?n:zl(g)===zl(y),j=()=>h(e,{replace:E,unstable_mask:s,state:a,preventScrollReset:l,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:p});m?f.startTransition(()=>j()):j()}},[g,h,y,n,s,a,t,e,l,c,u,p,m])}function hs(e){Kr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=f.useRef(ih(e)),n=f.useRef(!1),s=Wn(),a=f.useMemo(()=>bT(s.search,n.current?null:t.current),[s.search]),l=Dt(),c=f.useCallback((u,p)=>{const m=ih(typeof u=="function"?u(new URLSearchParams(a)):u);n.current=!0,l("?"+m,p)},[l,a]);return[a,c]}var VT=0,HT=()=>`__${String(++VT)}__`;function WT(){let{router:e}=s0("useSubmit"),{basename:t}=f.useContext(Or),n=iT(),s=e.fetch,a=e.navigate;return f.useCallback(async(l,c={})=>{let{action:u,method:p,encType:m,formData:h,body:g}=jT(l,t);if(c.navigate===!1){let y=c.fetcherKey||HT();await s(y,n,c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:h,body:g,formMethod:c.method||p,formEncType:c.encType||m,flushSync:c.flushSync})}else await a(c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:h,body:g,formMethod:c.method||p,formEncType:c.encType||m,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[s,a,t,n])}function KT(e,{relative:t}={}){let{basename:n}=f.useContext(Or),s=f.useContext(Jr);Qt(s,"useFormAction must be used inside a RouteContext");let[a]=s.matches.slice(-1),l={...rc(e||".",{relative:t})},c=Wn();if(e==null){l.search=c.search;let u=new URLSearchParams(l.search),p=u.getAll("index");if(p.some(h=>h==="")){u.delete("index"),p.filter(g=>g).forEach(g=>u.append("index",g));let h=u.toString();l.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:us([n,l.pathname])),zl(l)}function qT(e,{relative:t}={}){let n=f.useContext(Gj);Qt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=s0("useViewTransitionState"),a=rc(e,{relative:t});if(!n.isTransitioning)return!1;let l=As(n.currentLocation.pathname,s)||n.currentLocation.pathname,c=As(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Zu(a.pathname,c)!=null||Zu(a.pathname,l)!=null}var Rs=zj();const GT=Td(Rs);/**
|
|
52
|
-
* @license lucide-react v0.460.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const YT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),o0=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
|
|
57
|
-
* @license lucide-react v0.460.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/var JT={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"};/**
|
|
62
|
-
* @license lucide-react v0.460.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const XT=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:a="",children:l,iconNode:c,...u},p)=>f.createElement("svg",{ref:p,...JT,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:o0("lucide",a),...u},[...c.map(([m,h])=>f.createElement(m,h)),...Array.isArray(l)?l:[l]]));/**
|
|
67
|
-
* @license lucide-react v0.460.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const De=(e,t)=>{const n=f.forwardRef(({className:s,...a},l)=>f.createElement(XT,{ref:l,iconNode:t,className:o0(`lucide-${YT(e)}`,s),...a}));return n.displayName=`${e}`,n};/**
|
|
72
|
-
* @license lucide-react v0.460.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const Ad=De("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"}]]);/**
|
|
77
|
-
* @license lucide-react v0.460.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const ed=De("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
|
|
82
|
-
* @license lucide-react v0.460.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const Dd=De("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"}]]);/**
|
|
87
|
-
* @license lucide-react v0.460.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const td=De("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
92
|
-
* @license lucide-react v0.460.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const $d=De("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"}]]);/**
|
|
97
|
-
* @license lucide-react v0.460.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const a0=De("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
102
|
-
* @license lucide-react v0.460.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const nd=De("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
|
107
|
-
* @license lucide-react v0.460.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const QT=De("BookOpenText",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M6 8h2",key:"30oboj"}]]);/**
|
|
112
|
-
* @license lucide-react v0.460.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const i0=De("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
117
|
-
* @license lucide-react v0.460.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const Ld=De("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"}]]);/**
|
|
122
|
-
* @license lucide-react v0.460.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const ZT=De("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
127
|
-
* @license lucide-react v0.460.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const Xr=De("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
132
|
-
* @license lucide-react v0.460.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const br=De("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
137
|
-
* @license lucide-react v0.460.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const eR=De("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
142
|
-
* @license lucide-react v0.460.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const l0=De("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
147
|
-
* @license lucide-react v0.460.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const c0=De("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
152
|
-
* @license lucide-react v0.460.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const lh=De("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"}]]);/**
|
|
157
|
-
* @license lucide-react v0.460.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const Zh=De("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
162
|
-
* @license lucide-react v0.460.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const ch=De("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
|
|
167
|
-
* @license lucide-react v0.460.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const tR=De("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
|
|
172
|
-
* @license lucide-react v0.460.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const nR=De("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
177
|
-
* @license lucide-react v0.460.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const rR=De("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
|
|
182
|
-
* @license lucide-react v0.460.0 - ISC
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the ISC license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const sR=De("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
187
|
-
* @license lucide-react v0.460.0 - ISC
|
|
188
|
-
*
|
|
189
|
-
* This source code is licensed under the ISC license.
|
|
190
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const oR=De("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
192
|
-
* @license lucide-react v0.460.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const Od=De("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/**
|
|
197
|
-
* @license lucide-react v0.460.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const aR=De("Columns3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
202
|
-
* @license lucide-react v0.460.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const u0=De("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
207
|
-
* @license lucide-react v0.460.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const rd=De("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
212
|
-
* @license lucide-react v0.460.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const iR=De("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
217
|
-
* @license lucide-react v0.460.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const lR=De("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
222
|
-
* @license lucide-react v0.460.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const yi=De("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"}]]);/**
|
|
227
|
-
* @license lucide-react v0.460.0 - ISC
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the ISC license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const hv=De("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"}]]);/**
|
|
232
|
-
* @license lucide-react v0.460.0 - ISC
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the ISC license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const cR=De("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
|
|
237
|
-
* @license lucide-react v0.460.0 - ISC
|
|
238
|
-
*
|
|
239
|
-
* This source code is licensed under the ISC license.
|
|
240
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const uR=De("FilePenLine",[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]]);/**
|
|
242
|
-
* @license lucide-react v0.460.0 - ISC
|
|
243
|
-
*
|
|
244
|
-
* This source code is licensed under the ISC license.
|
|
245
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const d0=De("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"}]]);/**
|
|
247
|
-
* @license lucide-react v0.460.0 - ISC
|
|
248
|
-
*
|
|
249
|
-
* This source code is licensed under the ISC license.
|
|
250
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const eg=De("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"}]]);/**
|
|
252
|
-
* @license lucide-react v0.460.0 - ISC
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the ISC license.
|
|
255
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const dR=De("GitBranchPlus",[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]]);/**
|
|
257
|
-
* @license lucide-react v0.460.0 - ISC
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the ISC license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const tg=De("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"}]]);/**
|
|
262
|
-
* @license lucide-react v0.460.0 - ISC
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the ISC license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const fR=De("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
|
|
267
|
-
* @license lucide-react v0.460.0 - ISC
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the ISC license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const f0=De("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"}]]);/**
|
|
272
|
-
* @license lucide-react v0.460.0 - ISC
|
|
273
|
-
*
|
|
274
|
-
* This source code is licensed under the ISC license.
|
|
275
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const pR=De("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/**
|
|
277
|
-
* @license lucide-react v0.460.0 - ISC
|
|
278
|
-
*
|
|
279
|
-
* This source code is licensed under the ISC license.
|
|
280
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const ng=De("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
282
|
-
* @license lucide-react v0.460.0 - ISC
|
|
283
|
-
*
|
|
284
|
-
* This source code is licensed under the ISC license.
|
|
285
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const uh=De("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
|
|
287
|
-
* @license lucide-react v0.460.0 - ISC
|
|
288
|
-
*
|
|
289
|
-
* This source code is licensed under the ISC license.
|
|
290
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const p0=De("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
|
|
292
|
-
* @license lucide-react v0.460.0 - ISC
|
|
293
|
-
*
|
|
294
|
-
* This source code is licensed under the ISC license.
|
|
295
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const mR=De("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
|
|
297
|
-
* @license lucide-react v0.460.0 - ISC
|
|
298
|
-
*
|
|
299
|
-
* This source code is licensed under the ISC license.
|
|
300
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
-
*/const hR=De("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"}]]);/**
|
|
302
|
-
* @license lucide-react v0.460.0 - ISC
|
|
303
|
-
*
|
|
304
|
-
* This source code is licensed under the ISC license.
|
|
305
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/const gR=De("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
|
|
307
|
-
* @license lucide-react v0.460.0 - ISC
|
|
308
|
-
*
|
|
309
|
-
* This source code is licensed under the ISC license.
|
|
310
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
-
*/const xR=De("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"}]]);/**
|
|
312
|
-
* @license lucide-react v0.460.0 - ISC
|
|
313
|
-
*
|
|
314
|
-
* This source code is licensed under the ISC license.
|
|
315
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/const rg=De("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
317
|
-
* @license lucide-react v0.460.0 - ISC
|
|
318
|
-
*
|
|
319
|
-
* This source code is licensed under the ISC license.
|
|
320
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const yR=De("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
322
|
-
* @license lucide-react v0.460.0 - ISC
|
|
323
|
-
*
|
|
324
|
-
* This source code is licensed under the ISC license.
|
|
325
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const bR=De("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
327
|
-
* @license lucide-react v0.460.0 - ISC
|
|
328
|
-
*
|
|
329
|
-
* This source code is licensed under the ISC license.
|
|
330
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/const sg=De("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
332
|
-
* @license lucide-react v0.460.0 - ISC
|
|
333
|
-
*
|
|
334
|
-
* This source code is licensed under the ISC license.
|
|
335
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
-
*/const vR=De("MoonStar",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9",key:"4ay0iu"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}]]);/**
|
|
337
|
-
* @license lucide-react v0.460.0 - ISC
|
|
338
|
-
*
|
|
339
|
-
* This source code is licensed under the ISC license.
|
|
340
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/const um=De("NotebookPen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);/**
|
|
342
|
-
* @license lucide-react v0.460.0 - ISC
|
|
343
|
-
*
|
|
344
|
-
* This source code is licensed under the ISC license.
|
|
345
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/const m0=De("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
|
|
347
|
-
* @license lucide-react v0.460.0 - ISC
|
|
348
|
-
*
|
|
349
|
-
* This source code is licensed under the ISC license.
|
|
350
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
-
*/const bi=De("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
352
|
-
* @license lucide-react v0.460.0 - ISC
|
|
353
|
-
*
|
|
354
|
-
* This source code is licensed under the ISC license.
|
|
355
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/const wR=De("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
357
|
-
* @license lucide-react v0.460.0 - ISC
|
|
358
|
-
*
|
|
359
|
-
* This source code is licensed under the ISC license.
|
|
360
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const rn=De("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
362
|
-
* @license lucide-react v0.460.0 - ISC
|
|
363
|
-
*
|
|
364
|
-
* This source code is licensed under the ISC license.
|
|
365
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/const h0=De("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"}]]);/**
|
|
367
|
-
* @license lucide-react v0.460.0 - ISC
|
|
368
|
-
*
|
|
369
|
-
* This source code is licensed under the ISC license.
|
|
370
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/const jR=De("Replace",[["path",{d:"M14 4a2 2 0 0 1 2-2",key:"1w2hp7"}],["path",{d:"M16 10a2 2 0 0 1-2-2",key:"shjach"}],["path",{d:"M20 2a2 2 0 0 1 2 2",key:"188mtx"}],["path",{d:"M22 8a2 2 0 0 1-2 2",key:"ddf4tu"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a3 3 0 0 1 3-3h1",key:"3y3t5z"}],["rect",{x:"2",y:"14",width:"8",height:"8",rx:"2",key:"4rksxw"}]]);/**
|
|
372
|
-
* @license lucide-react v0.460.0 - ISC
|
|
373
|
-
*
|
|
374
|
-
* This source code is licensed under the ISC license.
|
|
375
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/const kR=De("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
|
|
377
|
-
* @license lucide-react v0.460.0 - ISC
|
|
378
|
-
*
|
|
379
|
-
* This source code is licensed under the ISC license.
|
|
380
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
-
*/const io=De("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"}]]);/**
|
|
382
|
-
* @license lucide-react v0.460.0 - ISC
|
|
383
|
-
*
|
|
384
|
-
* This source code is licensed under the ISC license.
|
|
385
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/const Id=De("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
387
|
-
* @license lucide-react v0.460.0 - ISC
|
|
388
|
-
*
|
|
389
|
-
* This source code is licensed under the ISC license.
|
|
390
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
-
*/const SR=De("SearchCheck",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
392
|
-
* @license lucide-react v0.460.0 - ISC
|
|
393
|
-
*
|
|
394
|
-
* This source code is licensed under the ISC license.
|
|
395
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
-
*/const fo=De("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
397
|
-
* @license lucide-react v0.460.0 - ISC
|
|
398
|
-
*
|
|
399
|
-
* This source code is licensed under the ISC license.
|
|
400
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
-
*/const NR=De("SendToBack",[["rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",key:"1b0bso"}],["rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",key:"1x09vl"}],["path",{d:"M7 14v1a2 2 0 0 0 2 2h1",key:"pao6x6"}],["path",{d:"M14 7h1a2 2 0 0 1 2 2v1",key:"19tdru"}]]);/**
|
|
402
|
-
* @license lucide-react v0.460.0 - ISC
|
|
403
|
-
*
|
|
404
|
-
* This source code is licensed under the ISC license.
|
|
405
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
-
*/const CR=De("ServerOff",[["path",{d:"M7 2h13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-5",key:"bt2siv"}],["path",{d:"M10 10 2.5 2.5C2 2 2 2.5 2 5v3a2 2 0 0 0 2 2h6z",key:"1hjrv1"}],["path",{d:"M22 17v-1a2 2 0 0 0-2-2h-1",key:"1iynyr"}],["path",{d:"M4 14a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16.5l1-.5.5.5-8-8H4z",key:"161ggg"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
407
|
-
* @license lucide-react v0.460.0 - ISC
|
|
408
|
-
*
|
|
409
|
-
* This source code is licensed under the ISC license.
|
|
410
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
-
*/const ER=De("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"}]]);/**
|
|
412
|
-
* @license lucide-react v0.460.0 - ISC
|
|
413
|
-
*
|
|
414
|
-
* This source code is licensed under the ISC license.
|
|
415
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
-
*/const TR=De("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"}]]);/**
|
|
417
|
-
* @license lucide-react v0.460.0 - ISC
|
|
418
|
-
*
|
|
419
|
-
* This source code is licensed under the ISC license.
|
|
420
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
-
*/const Dr=De("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
422
|
-
* @license lucide-react v0.460.0 - ISC
|
|
423
|
-
*
|
|
424
|
-
* This source code is licensed under the ISC license.
|
|
425
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
-
*/const gv=De("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
427
|
-
* @license lucide-react v0.460.0 - ISC
|
|
428
|
-
*
|
|
429
|
-
* This source code is licensed under the ISC license.
|
|
430
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
-
*/const xv=De("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"}]]);/**
|
|
432
|
-
* @license lucide-react v0.460.0 - ISC
|
|
433
|
-
*
|
|
434
|
-
* This source code is licensed under the ISC license.
|
|
435
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
-
*/const og=De("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
437
|
-
* @license lucide-react v0.460.0 - ISC
|
|
438
|
-
*
|
|
439
|
-
* This source code is licensed under the ISC license.
|
|
440
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
-
*/const RR=De("SunMedium",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]]);/**
|
|
442
|
-
* @license lucide-react v0.460.0 - ISC
|
|
443
|
-
*
|
|
444
|
-
* This source code is licensed under the ISC license.
|
|
445
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
-
*/const g0=De("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"}]]);/**
|
|
447
|
-
* @license lucide-react v0.460.0 - ISC
|
|
448
|
-
*
|
|
449
|
-
* This source code is licensed under the ISC license.
|
|
450
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
451
|
-
*/const Za=De("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
452
|
-
* @license lucide-react v0.460.0 - ISC
|
|
453
|
-
*
|
|
454
|
-
* This source code is licensed under the ISC license.
|
|
455
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
-
*/const or=De("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"}]]);/**
|
|
457
|
-
* @license lucide-react v0.460.0 - ISC
|
|
458
|
-
*
|
|
459
|
-
* This source code is licensed under the ISC license.
|
|
460
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
461
|
-
*/const ag=De("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"}]]);/**
|
|
462
|
-
* @license lucide-react v0.460.0 - ISC
|
|
463
|
-
*
|
|
464
|
-
* This source code is licensed under the ISC license.
|
|
465
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
466
|
-
*/const PR=De("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
|
|
467
|
-
* @license lucide-react v0.460.0 - ISC
|
|
468
|
-
*
|
|
469
|
-
* This source code is licensed under the ISC license.
|
|
470
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
-
*/const AR=De("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
472
|
-
* @license lucide-react v0.460.0 - ISC
|
|
473
|
-
*
|
|
474
|
-
* This source code is licensed under the ISC license.
|
|
475
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
476
|
-
*/const ig=De("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function x0(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=x0(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function DR(){for(var e,t,n=0,s="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=x0(e))&&(s&&(s+=" "),s+=t);return s}const lg="-",$R=e=>{const t=OR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const u=c.split(lg);return u[0]===""&&u.length!==1&&u.shift(),y0(u,t)||LR(c)},getConflictingClassGroupIds:(c,u)=>{const p=n[c]||[];return u&&s[c]?[...p,...s[c]]:p}}},y0=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),a=s?y0(e.slice(1),s):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join(lg);return(c=t.validators.find(({validator:u})=>u(l)))==null?void 0:c.classGroupId},yv=/^\[(.+)\]$/,LR=e=>{if(yv.test(e)){const t=yv.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},OR=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return MR(Object.entries(e.classGroups),n).forEach(([l,c])=>{dh(c,s,l,t)}),s},dh=(e,t,n,s)=>{e.forEach(a=>{if(typeof a=="string"){const l=a===""?t:bv(t,a);l.classGroupId=n;return}if(typeof a=="function"){if(IR(a)){dh(a(s),t,n,s);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([l,c])=>{dh(c,bv(t,l),n,s)})})},bv=(e,t)=>{let n=e;return t.split(lg).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},IR=e=>e.isThemeGetter,MR=(e,t)=>t?e.map(([n,s])=>{const a=s.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,u])=>[t+c,u])):l);return[n,a]}):e,_R=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const a=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,s=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=s.get(l))!==void 0)return a(l,c),c},set(l,c){n.has(l)?n.set(l,c):a(l,c)}}},b0="!",FR=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,a=t[0],l=t.length,c=u=>{const p=[];let m=0,h=0,g;for(let w=0;w<u.length;w++){let k=u[w];if(m===0){if(k===a&&(s||u.slice(w,w+l)===t)){p.push(u.slice(h,w)),h=w+l;continue}if(k==="/"){g=w;continue}}k==="["?m++:k==="]"&&m--}const y=p.length===0?u:u.substring(h),b=y.startsWith(b0),E=b?y.substring(1):y,j=g&&g>h?g-h:void 0;return{modifiers:p,hasImportantModifier:b,baseClassName:E,maybePostfixModifierPosition:j}};return n?u=>n({className:u,parseClassName:c}):c},zR=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},BR=e=>({cache:_R(e.cacheSize),parseClassName:FR(e),...$R(e)}),UR=/\s+/,VR=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:a}=t,l=[],c=e.trim().split(UR);let u="";for(let p=c.length-1;p>=0;p-=1){const m=c[p],{modifiers:h,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:b}=n(m);let E=!!b,j=s(E?y.substring(0,b):y);if(!j){if(!E){u=m+(u.length>0?" "+u:u);continue}if(j=s(y),!j){u=m+(u.length>0?" "+u:u);continue}E=!1}const w=zR(h).join(":"),k=g?w+b0:w,C=k+j;if(l.includes(C))continue;l.push(C);const N=a(j,E);for(let T=0;T<N.length;++T){const D=N[T];l.push(k+D)}u=m+(u.length>0?" "+u:u)}return u};function HR(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=v0(t))&&(s&&(s+=" "),s+=n);return s}const v0=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=v0(e[s]))&&(n&&(n+=" "),n+=t);return n};function WR(e,...t){let n,s,a,l=c;function c(p){const m=t.reduce((h,g)=>g(h),e());return n=BR(m),s=n.cache.get,a=n.cache.set,l=u,u(p)}function u(p){const m=s(p);if(m)return m;const h=VR(p,n);return a(p,h),h}return function(){return l(HR.apply(null,arguments))}}const Ut=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},w0=/^\[(?:([a-z-]+):)?(.+)\]$/i,KR=/^\d+\/\d+$/,qR=new Set(["px","full","screen"]),GR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,YR=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,JR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,XR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Es=e=>ei(e)||qR.has(e)||KR.test(e),Qs=e=>vi(e,"length",aP),ei=e=>!!e&&!Number.isNaN(Number(e)),dm=e=>vi(e,"number",ei),hl=e=>!!e&&Number.isInteger(Number(e)),ZR=e=>e.endsWith("%")&&ei(e.slice(0,-1)),ut=e=>w0.test(e),Zs=e=>GR.test(e),eP=new Set(["length","size","percentage"]),tP=e=>vi(e,eP,j0),nP=e=>vi(e,"position",j0),rP=new Set(["image","url"]),sP=e=>vi(e,rP,lP),oP=e=>vi(e,"",iP),gl=()=>!0,vi=(e,t,n)=>{const s=w0.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},aP=e=>YR.test(e)&&!JR.test(e),j0=()=>!1,iP=e=>XR.test(e),lP=e=>QR.test(e),cP=()=>{const e=Ut("colors"),t=Ut("spacing"),n=Ut("blur"),s=Ut("brightness"),a=Ut("borderColor"),l=Ut("borderRadius"),c=Ut("borderSpacing"),u=Ut("borderWidth"),p=Ut("contrast"),m=Ut("grayscale"),h=Ut("hueRotate"),g=Ut("invert"),y=Ut("gap"),b=Ut("gradientColorStops"),E=Ut("gradientColorStopPositions"),j=Ut("inset"),w=Ut("margin"),k=Ut("opacity"),C=Ut("padding"),N=Ut("saturate"),T=Ut("scale"),D=Ut("sepia"),R=Ut("skew"),$=Ut("space"),L=Ut("translate"),K=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",ut,t],W=()=>[ut,t],se=()=>["",Es,Qs],z=()=>["auto",ei,ut],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ee=()=>["solid","dashed","dotted","double","none"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",ut],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[ei,ut];return{cacheSize:500,separator:":",theme:{colors:[gl],spacing:[Es,Qs],blur:["none","",Zs,ut],brightness:F(),borderColor:[e],borderRadius:["none","","full",Zs,ut],borderSpacing:W(),borderWidth:se(),contrast:F(),grayscale:G(),hueRotate:F(),invert:G(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[ZR,Qs],inset:O(),margin:O(),opacity:F(),padding:W(),saturate:F(),scale:F(),sepia:G(),skew:F(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",ut]}],container:["container"],columns:[{columns:[Zs]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),ut]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",hl,ut]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ut]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",hl,ut]}],"grid-cols":[{"grid-cols":[gl]}],"col-start-end":[{col:["auto",{span:["full",hl,ut]},ut]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[gl]}],"row-start-end":[{row:["auto",{span:[hl,ut]},ut]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ut]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ut]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ut,t]}],"min-w":[{"min-w":[ut,t,"min","max","fit"]}],"max-w":[{"max-w":[ut,t,"none","full","min","max","fit","prose",{screen:[Zs]},Zs]}],h:[{h:[ut,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ut,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ut,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ut,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Zs,Qs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",dm]}],"font-family":[{font:[gl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ut]}],"line-clamp":[{"line-clamp":["none",ei,dm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Es,ut]}],"list-image":[{"list-image":["none",ut]}],"list-style-type":[{list:["none","disc","decimal",ut]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Es,Qs]}],"underline-offset":[{"underline-offset":["auto",Es,ut]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ut]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ut]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),nP]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",tP]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},sP]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...ee(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:ee()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...ee()]}],"outline-offset":[{"outline-offset":[Es,ut]}],"outline-w":[{outline:[Es,Qs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[Es,Qs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Zs,oP]}],"shadow-color":[{shadow:[gl]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...ne(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ne()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",Zs,ut]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[g]}],saturate:[{saturate:[N]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ut]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",ut]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",ut]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[hl,ut]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ut]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ut]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ut]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Es,Qs,dm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},uP=WR(cP);function Se(...e){return uP(DR(e))}function Dn(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function Lr(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function k0(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function S0(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function N0(e){if(!e)return"—";const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=Math.floor((Date.now()-t.getTime())/1e3);if(n<60)return"just now";const s=Math.floor(n/60);if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function sd(e){return e.toLocaleString("en-US")}function od(e){return`$${e.toFixed(4)}`}function dP(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return e;const[,n,s,a]=t,l=new Date(Number(n),Number(s)-1,Number(a));return Number.isNaN(l.getTime())?e:l.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function yn(e){return e.split(/[_\s-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function C0(e){return!e||e==="/"?"/":e.endsWith("/")?e.slice(0,-1):e}function fP(e){let t=C0(e);const n=t.match(/^\/w\/[^/]+(\/.*)?$/);return n&&(t=n[1]||"/"),t==="/"?"/":t.startsWith("/archive")?"/archive":t.startsWith("/projects")?/^\/projects\/[^/]+\/assignments\//.test(t)?"/assignments":"/projects":t.startsWith("/assignments")?"/assignments":t.startsWith("/servers")?"/servers":t.startsWith("/inventories")?"/inventories":t.startsWith("/usage")?"/usage":t.startsWith("/agent-sessions")?"/agent-sessions":t.startsWith("/playbooks")?"/playbooks":t.startsWith("/memories")?"/memories":t.startsWith("/resources")?"/resources":t.startsWith("/todos")?"/todos":t.startsWith("/views")?"/views":t.startsWith("/help")?"/help":t.startsWith("/settings")?"/settings":null}function E0(e,t){return fP(e)===t}function T0(e){let n=C0(e).split("/").filter(Boolean);const s=[];let a="Overview",l=null,c="";if(n[0]==="w"&&n[1]&&(c=`/w/${n[1]}`,s.push({label:yn(n[1]),path:`${c}/projects`}),n=n.slice(2)),n.length===0)return{title:a,breadcrumbs:s,projectSlug:l};if(n[0]==="projects"){if(s.push({label:"Projects",path:`${c}/projects`}),a="Projects",n[1]&&(l=n[1],s.push({label:yn(n[1]),path:`${c}/projects/${n[1]}`}),a=yn(n[1])),n[2]==="edit")a="Edit Project";else if(n[2]==="create"&&n[3]==="assignment")a="Create Assignment";else if(n[2]==="assignments"&&n[3])s.push({label:yn(n[3]),path:`${c}/projects/${n[1]}/assignments/${n[3]}`}),a=yn(n[3]),n[4]==="edit"?a="Edit Assignment":n[4]==="plan"&&n[5]==="edit"?a="Edit Plan":n[4]==="scratchpad"&&n[5]==="edit"?a="Edit Scratchpad":n[4]==="handoff"&&n[5]==="edit"?a="Append Handoff":n[4]==="decision-record"&&n[5]==="edit"&&(a="Append Decision");else if((n[2]==="memories"||n[2]==="resources")&&n[3]){const u=n[2]==="memories"?"Memories":"Resources",p=n[2]==="memories"?"/memories":"/resources";s.push({label:u,path:p}),s.push({label:yn(n[3]),path:`${c}/projects/${n[1]}/${n[2]}/${n[3]}`}),a=yn(n[3]),n[4]==="edit"&&(a=n[2]==="memories"?"Edit Memory":"Edit Resource")}}else n[0]==="servers"?(a="Servers",s.push({label:"Servers",path:`${c}/servers`})):n[0]==="inventories"?(a="Inventories",s.push({label:"Inventories",path:`${c}/inventories`})):n[0]==="usage"?(a="Usage",s.push({label:"Usage",path:`${c}/usage`})):n[0]==="agent-sessions"?(a="Agent Sessions",s.push({label:"Agent Sessions",path:`${c}/agent-sessions`})):n[0]==="assignments"?(a="Assignments",s.push({label:"Assignments",path:`${c}/assignments`})):n[0]==="archive"?(a="Archive",s.push({label:"Archive",path:"/archive"})):n[0]==="playbooks"?(s.push({label:"Playbooks",path:"/playbooks"}),a="Playbooks",n[1]==="create"?a="Create Playbook":n[1]&&n[2]==="edit"?(s.push({label:yn(n[1]),path:`/playbooks/${n[1]}`}),a="Edit Playbook"):n[1]&&(s.push({label:yn(n[1]),path:`/playbooks/${n[1]}`}),a=yn(n[1]))):n[0]==="memories"?(s.push({label:"Memories",path:"/memories"}),a="Memories",n[1]==="new"&&(a="New Memory")):n[0]==="resources"?(s.push({label:"Resources",path:"/resources"}),a="Resources",n[1]==="new"&&(a="New Resource")):n[0]==="todos"?(a="Todos",s.push({label:"Todos",path:`${c}/todos`})):n[0]==="views"?(a="Saved Views",s.push({label:"Saved Views",path:`${c}/views`}),n[1]&&(a="View")):n[0]==="help"?(a="Help",s.push({label:"Help",path:"/help"})):n[0]==="settings"?(a="Settings",s.push({label:"Settings",path:"/settings"})):n[0]==="create"&&n[1]==="project"&&(a="Create Project",s.push({label:"Create Project",path:`${c}/create/project`}));return{title:a,breadcrumbs:s,projectSlug:l}}function vv({items:e,onNavigate:t}){const n=Wn();return r.jsx("nav",{className:"space-y-1",children:e.map(s=>{const a=s.icon,l=E0(n.pathname,s.to)&&!n.pathname.startsWith("/w/");return r.jsxs(Ee,{to:s.to,onClick:t,className:Se("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition",l?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-background/80 hover:text-foreground"),children:[r.jsx(a,{className:"h-4 w-4"}),r.jsx("span",{children:s.label})]},s.to)})})}const R0=[{slug:"default",label:"Syntaur",description:"Brand purple, warm yellow, coral & teal accents.",swatches:{primary:"oklch(70% 0.18 290)",secondary:"oklch(80% 0.14 75)",coral:"oklch(72% 0.17 15)",teal:"oklch(72% 0.14 185)",amber:"oklch(82% 0.16 75)"}},{slug:"ocean",label:"Midnight",description:"Deep indigo-blue with cyan accents. Inspired by One Dark Pro.",swatches:{primary:"oklch(70% 0.16 240)",secondary:"oklch(78% 0.13 200)",coral:"oklch(72% 0.18 350)",teal:"oklch(78% 0.14 195)",amber:"oklch(84% 0.15 90)"}},{slug:"forest",label:"Verdant",description:"Saturated emerald and pine on a dark olive base.",swatches:{primary:"oklch(72% 0.17 145)",secondary:"oklch(80% 0.13 110)",coral:"oklch(72% 0.17 25)",teal:"oklch(75% 0.13 175)",amber:"oklch(82% 0.16 95)"}},{slug:"sunset",label:"Ember",description:"Warm sepia surfaces with copper and amber accents.",swatches:{primary:"oklch(72% 0.18 35)",secondary:"oklch(80% 0.16 60)",coral:"oklch(72% 0.19 15)",teal:"oklch(72% 0.12 180)",amber:"oklch(86% 0.17 70)"}}],pP=R0.map(e=>e.slug),ad="default";function P0(e){return typeof e=="string"&&pP.includes(e)}const A0={preset:ad,custom:!1};let Tl=null,Oa=null;function cg(e){if(!e||typeof e!="object")return A0;const t=e;return{preset:P0(t.preset)?t.preset:ad,custom:t.custom===!0}}function mP(){return Tl?Promise.resolve(Tl):Oa||(Oa=fetch("/api/config/theme").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=cg(e);return Tl=t,Oa=null,t}).catch(()=>(Oa=null,A0)),Oa)}async function hP(e){const t=await fetch("/api/config/theme",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({preset:e})});if(!t.ok){const s=await t.json().catch(()=>({error:`HTTP ${t.status}`}));throw new Error(s.error??"Failed to save theme")}const n=cg(await t.json());return Tl=n,n}async function gP(){const e=await fetch("/api/config/theme",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=cg(await e.json());return Tl=t,t}const fh="syntaur-theme",Bu="syntaur-preset",D0=f.createContext(null);function ph(){try{const e=window.localStorage.getItem(fh);return e==="light"||e==="dark"?e:null}catch{return null}}function $0(){try{const e=window.localStorage.getItem(Bu);return P0(e)?e:ad}catch{return ad}}function L0(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function O0(e){document.documentElement.classList.toggle("dark",e==="dark")}function I0(e){document.documentElement.dataset.theme=e}function xP(){typeof document>"u"||(O0(ph()??L0()),I0($0()))}function yP({children:e}){const[t,n]=f.useState(()=>ph()),[s,a]=f.useState(()=>ph()??L0()),[l,c]=f.useState(()=>$0());f.useEffect(()=>{O0(s)},[s]),f.useEffect(()=>{I0(l)},[l]),f.useEffect(()=>{let h=!1;return mP().then(g=>{if(!h&&g.preset!==l){c(g.preset);try{window.localStorage.setItem(Bu,g.preset)}catch{}}}),()=>{h=!0}},[]),f.useEffect(()=>{if(!window.matchMedia)return;const h=window.matchMedia("(prefers-color-scheme: dark)"),g=()=>{t||a(h.matches?"dark":"light")};return g(),h.addEventListener("change",g),()=>{h.removeEventListener("change",g)}},[t]);async function u(h){c(h);try{window.localStorage.setItem(Bu,h)}catch{}await hP(h)}async function p(){const h=await gP();c(h.preset);try{window.localStorage.setItem(Bu,h.preset)}catch{}}const m={resolvedTheme:s,explicitTheme:t,setTheme:h=>{window.localStorage.setItem(fh,h),n(h),a(h)},toggleTheme:()=>{const h=s==="dark"?"light":"dark";window.localStorage.setItem(fh,h),n(h),a(h)},preset:l,setPreset:u,resetPreset:p};return r.jsx(D0.Provider,{value:m,children:e})}function ug(){const e=f.useContext(D0);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const Uu=new Set;let nr=null,ti=null;function bP(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function M0(){nr&&(nr.readyState===WebSocket.OPEN||nr.readyState===WebSocket.CONNECTING)||(nr=new WebSocket(bP()),nr.onmessage=e=>{try{const t=JSON.parse(e.data);for(const n of Uu)n(t)}catch{}},nr.onclose=()=>{nr=null,ti&&clearTimeout(ti),ti=setTimeout(M0,2e3)},nr.onerror=()=>{nr==null||nr.close()})}function sc(e){const t=f.useRef(e);t.current=e,f.useEffect(()=>{const n=s=>t.current(s);return Uu.add(n),M0(),()=>{Uu.delete(n),Uu.size===0&&nr&&(ti&&clearTimeout(ti),ti=null,nr.close(),nr=null)}},[])}function Zt(e,t,n=!0,s=!1){const[a,l]=f.useState(null),[c,u]=f.useState(!0),[p,m]=f.useState(null),[h,g]=f.useState(0),y=n?e:null,b=f.useCallback(()=>{g(j=>j+1)},[]),E=f.useRef(y);return s&&E.current!==y&&(E.current=y,l(null),m(null)),f.useEffect(()=>{if(!y){u(!1),l(null);return}let j=!1;return u(!0),m(null),fetch(y).then(async w=>{if(!w.ok){const k=await w.json().catch(()=>null);throw new Error((k==null?void 0:k.error)||`HTTP ${w.status}`)}return w.json()}).then(w=>{j||(l(w),u(!1))}).catch(w=>{j||(m(w.message),u(!1))}),()=>{j=!0}},[y,h]),sc(j=>{!t||!y||((j.type==="project-updated"||j.type==="assignment-updated")&&b(),j.type==="servers-updated"&&t==="servers"&&b(),j.type==="agent-sessions-updated"&&(t==="agent-sessions"||t==="overview")&&b(),j.type==="playbooks-updated"&&t==="playbooks"&&b(),j.type==="leases-updated"&&t==="inventories"&&b())}),{data:a,loading:c,error:p,refetch:b}}function Jo(e=!0){return Zt("/api/projects","projects",e)}function oc(){return Zt("/api/workspaces","projects")}function ln(){const{workspace:e}=$t();return e?`/w/${e}`:""}function vP(e={}){const t=new URLSearchParams;typeof e.staleLimit=="number"&&Number.isFinite(e.staleLimit)&&t.set("staleLimit",String(e.staleLimit)),typeof e.staleOffset=="number"&&Number.isFinite(e.staleOffset)&&t.set("staleOffset",String(e.staleOffset));const n=t.toString(),s=n?`/api/overview?${n}`:"/api/overview";return Zt(s,"overview")}function Md(e=!0){return Zt("/api/assignments","assignments",e)}function wP(e=!0){return Zt("/api/archived","assignments",e)}function _0(){return Zt("/api/help")}function F0(e){const t=e?`/api/projects/${e}`:null;return Zt(t,"project")}function jP(e,t){const n=e&&t?`/api/projects/${e}/assignments/${t}`:null;return Zt(n,"assignment")}function kP(e){const t=e?`/api/assignments/${e}`:null;return Zt(t,"assignment")}function z0(e){return Zt(e)}function dg(e=!0){return Zt("/api/servers","servers",e)}function B0(){return Zt("/api/leases","inventories")}function U0(){return Zt("/api/agent-sessions","agent-sessions")}function SP(e,t){const n=e&&t?`/api/agent-sessions/${e}?assignment=${t}`:null;return Zt(n,"agent-sessions")}function NP(e){const t=e?`/api/assignments/${e}/sessions`:null;return Zt(t,"agent-sessions")}function CP(e,t){const n=e&&t?`/api/usage/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}`:null;return Zt(n,void 0,!0,!0)}function EP(e){const t=e?`/api/usage/standalone/${encodeURIComponent(e)}`:null;return Zt(t,void 0,!0,!0)}function fg(e=!0){return Zt("/api/playbooks","playbooks",e)}function TP(e){const t=e?`/api/playbooks/${e}`:null;return Zt(t,"playbooks")}function RP(){return Zt("/api/memories","project")}function PP(e,t){const n=e&&t?`/api/projects/${e}/memories/${t}`:null;return Zt(n,"project")}function AP(){return Zt("/api/resources","project")}function DP(e,t){const n=e&&t?`/api/projects/${e}/resources/${t}`:null;return Zt(n,"project")}const _d=["new-workspace","new-project","new-todo","new-assignment"];function $P(e){return typeof e=="string"&&_d.includes(e)}const LP=["mod+k","mod+shift+k","?","escape","enter","shift+t","g","g o","g m","g a","g t","g s","g !","g ,","j","k","o","a","e","/","r","p","h","d","s","[","]"],OP=["mod","ctrl","alt","shift"];function rr(e){if(typeof e!="string")return"";const t=e.trim();if(!t)return"";if(/\s/.test(t)&&!t.includes("+"))return t.split(/\s+/).map(rr).filter(u=>u.length>0).join(" ");const n=t.split("+").map(u=>u.trim()).filter(u=>u.length>0);if(n.length===0)return"";if(n.length===1)return n[0].toLowerCase();const s=n[n.length-1].toLowerCase(),a=n.slice(0,-1).map(u=>u.toLowerCase()),l=new Set,c=[];for(const u of OP)a.includes(u)&&!l.has(u)&&(c.push(u),l.add(u));for(const u of a)l.has(u)||(c.push(u),l.add(u));return[...c,s].join("+")}function IP(e){const t=rr(e);return t?LP.includes(t):!1}const MP={"new-workspace":rr("Mod+Shift+Alt+w"),"new-project":rr("Mod+Shift+Alt+p"),"new-todo":rr("Mod+Shift+Alt+t"),"new-assignment":rr("Mod+Shift+Alt+a")};function _P(e){const t={...MP};for(const n of _d){const s=e[n];typeof s=="string"&&s.length>0&&(t[n]=s)}return t}function zo(){if(typeof navigator>"u")return!1;const e=navigator.platform||"",t=navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/.test(e)||/Mac OS X/.test(t)}function FP(e){const t=e.split("+").map(a=>a.trim()),n=t[t.length-1]??"",s=new Set(t.slice(0,-1).map(a=>a.toLowerCase()));return{key:n.toLowerCase(),mod:s.has("mod"),shift:s.has("shift"),alt:s.has("alt"),ctrl:s.has("ctrl")}}function ku(e,t){const n=FP(t);if(e.key.toLowerCase()!==n.key)return!1;const a=zo()?e.metaKey:e.ctrlKey;return!(n.mod&&!a||!n.mod&&!n.ctrl&&a||n.ctrl&&!e.ctrlKey||n.shift&&!e.shiftKey||!n.shift&&!(n.key.length===1&&!/^[a-z0-9]$/.test(n.key))&&e.shiftKey||n.alt&&!e.altKey||!n.alt&&e.altKey)}function V0(e){const t=[],n=zo()?e.metaKey:e.ctrlKey;n&&t.push("mod"),e.ctrlKey&&!n&&t.push("ctrl"),e.altKey&&t.push("alt");const s=e.key;let a;s===" "||s==="Spacebar"?a="space":(s.length,a=s.toLowerCase());const l=a.length===1&&/^[a-z0-9]$/.test(a);e.shiftKey&&l&&t.push("shift");const c=[...t,a].join("+");return rr(c)}function ds(e){return e.split("+").map(n=>{const s=n.toLowerCase();return s==="mod"?zo()?"⌘":"Ctrl":s==="shift"?zo()?"⇧":"Shift":s==="alt"?zo()?"⌥":"Alt":s==="ctrl"?zo()?"⌃":"Ctrl":s==="enter"?"↵":s==="escape"?"Esc":s==="arrowup"?"↑":s==="arrowdown"?"↓":n.length===1?n.toUpperCase():n}).join(zo()?"":"+")}function zP(e){const[t,n]=f.useState(null),[s,a]=f.useState(!0),[l,c]=f.useState(null),u=f.useCallback(async()=>{try{const p=await fetch(`/api/todos/${encodeURIComponent(e)}`);if(!p.ok)throw new Error(`HTTP ${p.status}`);n(await p.json()),c(null)}catch(p){c(p instanceof Error?p.message:"Failed to fetch todos")}finally{a(!1)}},[e]);return f.useEffect(()=>{u()},[u]),sc(p=>{p.type==="todos-updated"&&!p.projectSlug&&u()}),{data:t,loading:s,error:l,refetch:u}}function H0(e=!0){const[t,n]=f.useState(null),[s,a]=f.useState(!0),[l,c]=f.useState(null),u=f.useCallback(async()=>{try{const p=await fetch("/api/todos");if(!p.ok)throw new Error(`HTTP ${p.status}`);n(await p.json()),c(null)}catch(p){c(p instanceof Error?p.message:"Failed to fetch todos")}finally{a(!1)}},[]);return f.useEffect(()=>{if(!e){a(!1);return}u()},[u,e]),sc(p=>{e&&p.type==="todos-updated"&&!p.projectSlug&&u()}),{data:t,loading:s,error:l,refetch:u}}async function pg(e,t,n){await fetch(`/api/todos/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,tags:n})})}async function W0(e,t,n){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({summary:"Completed."})})}async function K0(e,t,n){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/block`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:n})})}async function q0(e,t,n){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:n})})}async function G0(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function Y0(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}`,{method:"DELETE"})}async function J0(e,t,n){const s=await fetch(`/api/todos/${encodeURIComponent(e)}/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:n})});if(!s.ok)throw new Error(await s.text().catch(()=>"")||`HTTP ${s.status}`)}function mg(e,t,n){return`/api/todos/${encodeURIComponent(e)}/${t}/attachments/${encodeURIComponent(n)}`}async function X0(e,t,n){for(const s of n){const a=await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/attachments`,{method:"POST",headers:{"Content-Type":"application/octet-stream","x-attachment-filename":encodeURIComponent(s.name||"file"),"x-attachment-mime":s.type||"application/octet-stream"},body:s});if(!a.ok)throw new Error(await a.text().catch(()=>"")||`HTTP ${a.status}`)}}async function Q0(e,t,n){const s=await fetch(mg(e,t,n),{method:"DELETE"});if(!s.ok)throw new Error(await s.text().catch(()=>"")||`HTTP ${s.status}`)}async function hg(e,t){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.text().catch(()=>"");let a=null;try{a=s?JSON.parse(s):null}catch{}const l=(a==null?void 0:a.error)||s||`HTTP ${n.status}`,c=new Error(l);throw c.status=n.status,c}return n.json().catch(()=>({}))}async function BP(e,t){return await hg(`/api/todos/${encodeURIComponent(e)}/promote`,t)}async function UP(e){return await hg("/api/todos/promote-bulk",e)}async function VP(e,t,n){await hg(`/api/todos/${encodeURIComponent(e)}/${t}/move`,{to:n})}const HP=new Set(["/projects","/assignments","/servers","/todos"]);function Vu(e,t){return HP.has(e)?`${t}${e}`:e}const WP=[{id:"page-overview",title:"Overview",basePath:"/",keywords:["home","dashboard"]},{id:"page-projects",title:"Projects",basePath:"/projects",keywords:[]},{id:"page-assignments",title:"Assignments",basePath:"/assignments",keywords:[]},{id:"page-todos",title:"Todos",basePath:"/todos",keywords:["tasks"]},{id:"page-servers",title:"Servers",basePath:"/servers",keywords:["sessions"]},{id:"page-playbooks",title:"Playbooks",basePath:"/playbooks",keywords:[]},{id:"page-memories",title:"Memories",basePath:"/memories",keywords:["knowledge","learnings"]},{id:"page-resources",title:"Resources",basePath:"/resources",keywords:["knowledge","reference"]},{id:"page-settings",title:"Settings",basePath:"/settings",keywords:[]},{id:"page-help",title:"Help",basePath:"/help",keywords:["shortcuts"]}];function KP(e){const t=[];for(const n of WP)t.push({type:"page",id:n.id,title:n.title,keywords:[...n.keywords],route:Vu(n.basePath,e.wsPrefix)});for(const n of e.projects??[]){const s=n.workspace?`/w/${n.workspace}`:"";t.push({type:"project",id:`project-${n.slug}`,title:n.title,subtitle:n.slug,keywords:n.tags,route:`${s}/projects/${n.slug}`}),t.push({type:"todo",id:`project-todos-${n.slug}`,title:`${n.title} todos`,subtitle:`${n.slug} · project`,keywords:[...n.tags??[],"project","todos"],route:`${s}/projects/${n.slug}?tab=todos`})}for(const n of e.assignments??[]){const s=n.projectWorkspace?`/w/${n.projectWorkspace}`:"";t.push({type:"assignment",id:n.projectSlug===null?`assignment-standalone-${n.id}`:`assignment-${n.projectSlug}-${n.slug}`,title:n.title,subtitle:`${n.projectTitle} · ${n.status}`,keywords:[n.projectSlug??"standalone",n.assignee??""].filter(a=>!!a),route:n.projectSlug===null?`/assignments/${n.id}`:`${s}/projects/${n.projectSlug}/assignments/${n.slug}`})}for(const n of e.playbooks??[])t.push({type:"playbook",id:`playbook-${n.slug}`,title:n.name,subtitle:n.description,keywords:n.tags,route:`/playbooks/${n.slug}`});for(const n of e.servers??[])t.push({type:"server",id:`server-${n.name}`,title:n.name,subtitle:n.alive?"alive":"dead",route:`${Vu("/servers",e.wsPrefix)}#server-${encodeURIComponent(n.name)}`});for(const n of e.todos??[]){const s=n.workspace&&n.workspace!=="_ungrouped"?`/w/${n.workspace}`:e.wsPrefix,a=Vu("/todos",s);t.push({type:"todo",id:`todo-${n.id}`,title:n.description,subtitle:n.status,keywords:n.tags,route:`${a}?focus=${encodeURIComponent(n.id)}`})}return t}function mr(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Hu(e){return/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e)}async function qP(e,t,n){const s=t?"disable":"enable",a=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${s}`,{method:"POST"});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error||`Failed to ${s} playbook`)}n()}async function fm(e,t){const n=await fetch(`/api/todos/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t})});if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s.error||`Failed to create todo (HTTP ${n.status})`)}}async function wv(){const e=await fetch("/api/workspaces");if(!e.ok)throw new Error(`Failed to load workspaces (HTTP ${e.status})`);const t=await e.json();return{workspaces:Array.isArray(t.workspaces)?t.workspaces:[],hasUngrouped:t.hasUngrouped===!0}}async function jv(){const e=await fetch("/api/projects");if(!e.ok)throw new Error(`Failed to load projects (HTTP ${e.status})`);const t=await e.json();return Array.isArray(t)?t:[]}async function pm(e){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to load template (HTTP ${t.status})`);const n=await t.json();if(!n.content)throw new Error("Template returned no content");return n.content}function Oo(e,t,n){const s=e.match(/^(---\n)([\s\S]*?)(\n---)/);if(!s)return`---
|
|
477
|
-
${t}: ${JSON.stringify(n)}
|
|
478
|
-
---
|
|
479
|
-
${e}`;const a=s[1],l=s[2],c=s[3],u=e.slice(s[0].length),p=JSON.stringify(n),m=new RegExp(`^${t}:\\s*.*$`,"m");let h;return m.test(l)?h=l.replace(m,`${t}: ${p}`):h=`${l}
|
|
480
|
-
${t}: ${p}`,`${a}${h}${c}${u}`}const GP=/^[a-z0-9][a-z0-9-]*$/;function YP(e){const{playbooks:t,projectSlug:n,currentProjectTitle:s,currentProjectWorkspace:a,wsPrefix:l,refetchPlaybooks:c,navigate:u,toggleTheme:p}=e,m=[];if(m.push({id:"new-workspace",title:"New Workspace",subtitle:"Create a Syntaur workspace",group:"Create",keywords:["new","create","workspace"],bindableKind:"new-workspace",flow:{steps:[{kind:"text",id:"name",label:"Workspace name",placeholder:"lowercase, hyphenated (e.g. acme-app)",required:!0,pattern:{regex:GP,message:"Use lowercase letters, digits, and hyphens (e.g. acme-app). Must start with a letter or digit."}}],submit:async(h,g)=>{const y=(h.name??"").trim();if(!y)throw new Error("Name is required");const b=await fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:y})});if(!b.ok){const E=await b.json().catch(()=>({}));throw new Error(E.error||`Failed to create workspace (HTTP ${b.status})`)}g.navigate(`/w/${y}/projects`)}}}),m.push({id:"new-project",title:"New Project",subtitle:"Create a project (pick workspace)",group:"Create",keywords:["new","create","project"],bindableKind:"new-project",flow:{steps:[{kind:"picker",id:"workspace",label:"Workspace",emptyMessage:'No workspaces yet — create one with "New Workspace"',loadOptions:async()=>{const{workspaces:h,hasUngrouped:g}=await wv(),y=[{value:"_ungrouped",label:"Ungrouped",hint:"no workspace"}];for(const b of h)y.push({value:b,label:b,hint:"workspace"});return y}},{kind:"text",id:"title",label:"Project title",placeholder:"e.g. Marketing site rebuild",required:!0}],submit:async(h,g)=>{const y=(h.workspace??"").trim(),b=(h.title??"").trim();if(!b)throw new Error("Title is required");const E=mr(b);if(!E)throw new Error("Title must contain at least one alphanumeric character");let j=await pm("/api/templates/project");j=Oo(j,"slug",E),j=Oo(j,"title",b),y&&y!=="_ungrouped"&&(j=Oo(j,"workspace",y));const w=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:j})}),k=await w.json().catch(()=>({}));if(!w.ok)throw new Error(k.error||`Failed to create project (HTTP ${w.status})`);const C=y&&y!=="_ungrouped"?`/w/${y}/projects/${k.slug??E}`:`/projects/${k.slug??E}`;g.navigate(C)}}}),m.push({id:"new-todo",title:"New Todo",subtitle:"Pick scope (global / workspace / project)",group:"Create",keywords:["new","create","todo","task"],bindableKind:"new-todo",flow:{steps:[{kind:"picker",id:"scope",label:"Scope",loadOptions:async()=>{const[{workspaces:h},g]=await Promise.all([wv(),jv()]),y=[{value:"_ungrouped",label:"Global",hint:"no workspace"}];for(const b of h)y.push({value:b,label:b,hint:"workspace"});for(const b of g){const E=b.workspace??"_ungrouped";y.push({value:E,label:`${b.title}`,hint:`project · ${b.workspace??"ungrouped"}`})}return y}},{kind:"text",id:"description",label:"Description",placeholder:"Describe the todo…",required:!0}],submit:async h=>{const g=(h.scope??"_ungrouped").trim()||"_ungrouped",y=(h.description??"").trim();if(!y)throw new Error("Description is required");await pg(g,y)}}}),m.push({id:"new-assignment",title:"New Assignment",subtitle:"Pick standalone or a project",group:"Create",keywords:["new","create","assignment"],bindableKind:"new-assignment",flow:{steps:[{kind:"picker",id:"project",label:"Project",loadOptions:async()=>{const h=await jv(),g=[{value:"_standalone",label:"Standalone",hint:"one-off / not in a project"}];for(const y of h)g.push({value:y.slug,label:y.title,hint:y.workspace?`workspace · ${y.workspace}`:"ungrouped"});return g}},{kind:"text",id:"title",label:"Assignment title",placeholder:"What needs to get done?",required:!0}],submit:async(h,g)=>{var N;const y=(h.project??"_standalone").trim()||"_standalone",b=(h.title??"").trim();if(!b)throw new Error("Title is required");const E=mr(b);if(!E)throw new Error("Title must contain at least one alphanumeric character");if(y==="_standalone"){let T=await pm("/api/templates/assignment?standalone=1");T=Oo(T,"slug",E),T=Oo(T,"title",b);const D=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:T})}),R=await D.json().catch(()=>({}));if(!D.ok)throw new Error(R.error||`Failed to create assignment (HTTP ${D.status})`);const $=((N=R==null?void 0:R.assignment)==null?void 0:N.id)??(R==null?void 0:R.id);$?g.navigate(`/assignments/${$}`):g.navigate("/assignments");return}let j=await pm("/api/templates/assignment");j=Oo(j,"slug",E),j=Oo(j,"title",b);const w=await fetch(`/api/projects/${encodeURIComponent(y)}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:j})}),k=await w.json().catch(()=>({}));if(!w.ok)throw new Error(k.error||`Failed to create assignment (HTTP ${w.status})`);const C=k.slug??E;g.navigate(`/projects/${y}/assignments/${C}`)}}}),m.push({id:"create-project-route",title:"New Project (advanced editor)",subtitle:"Open the markdown editor",group:"Create",keywords:["new","create","project","advanced","editor"],run:()=>u(`${l}/create/project`)}),m.push({id:"create-standalone-assignment",title:"New Standalone Assignment (editor)",subtitle:"Open the markdown editor",group:"Create",keywords:["new","create","assignment","standalone","one-off","editor"],run:()=>u(`${l}/assignments/new`)}),n&&m.push({id:`create-assignment-in-${n}`,title:`New Assignment in ${s??n}`,subtitle:n,group:"Create",keywords:["new","create","assignment",n],run:()=>u(`${l}/projects/${n}/create/assignment`)}),m.push({id:"create-playbook",title:"New Playbook",group:"Create",keywords:["new","create","playbook"],run:()=>u("/playbooks/create")}),m.push({id:"create-todo-global",title:"New Todo (global, quick)",subtitle:"Ungrouped, single-step",group:"Create",keywords:["new","create","todo","global","ungrouped","quick"],requiresInput:{placeholder:"Describe the todo…",runWithInput:async h=>{const g=h.trim();g&&await fm("_ungrouped",g)}}}),l){const h=l.replace(/^\/w\//,"");m.push({id:`create-todo-workspace-${h}`,title:`New Todo in workspace ${h}`,subtitle:h,group:"Create",keywords:["new","create","todo","workspace",h],requiresInput:{placeholder:`Describe the todo for workspace ${h}…`,runWithInput:async g=>{const y=g.trim();y&&await fm(h,y)}}})}n&&a&&m.push({id:`create-todo-project-${n}`,title:`New Todo in project ${s??n}`,subtitle:`${n} · workspace ${a}`,group:"Create",keywords:["new","create","todo","project",n,a],requiresInput:{placeholder:`Describe the todo for project ${s??n}…`,runWithInput:async h=>{const g=h.trim();g&&await fm(a,g)}}});for(const h of t)m.push({id:`toggle-playbook-${h.slug}`,title:`Toggle Playbook: ${h.name}`,subtitle:h.enabled?"enabled":"disabled",group:"Toggle",keywords:["toggle","playbook",h.slug,...h.tags??[]],run:()=>qP(h.slug,h.enabled,c)});return m.push({id:"toggle-theme",title:"Toggle theme",subtitle:"Light / dark",group:"Theme",keywords:["theme","toggle","light","dark","appearance"],run:()=>p()}),m}function qt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function kv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fd(...e){return t=>{let n=!1;const s=e.map(a=>{const l=kv(a,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let a=0;a<s.length;a++){const l=s[a];typeof l=="function"?l():kv(e[a],null)}}}}function Fn(...e){return f.useCallback(Fd(...e),e)}function JP(e,t){const n=f.createContext(t),s=l=>{const{children:c,...u}=l,p=f.useMemo(()=>u,Object.values(u));return r.jsx(n.Provider,{value:p,children:c})};s.displayName=e+"Provider";function a(l){const c=f.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[s,a]}function Xo(e,t=[]){let n=[];function s(l,c){const u=f.createContext(c),p=n.length;n=[...n,c];const m=g=>{var k;const{scope:y,children:b,...E}=g,j=((k=y==null?void 0:y[e])==null?void 0:k[p])||u,w=f.useMemo(()=>E,Object.values(E));return r.jsx(j.Provider,{value:w,children:b})};m.displayName=l+"Provider";function h(g,y){var j;const b=((j=y==null?void 0:y[e])==null?void 0:j[p])||u,E=f.useContext(b);if(E)return E;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${l}\``)}return[m,h]}const a=()=>{const l=n.map(c=>f.createContext(c));return function(u){const p=(u==null?void 0:u[e])||l;return f.useMemo(()=>({[`__scope${e}`]:{...u,[e]:p}}),[u,p])}};return a.scopeName=e,[s,XP(a,...t)]}function XP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(l){const c=s.reduce((u,{useScope:p,scopeName:m})=>{const g=p(l)[`__scope${m}`];return{...u,...g}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var lo=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},QP=Fj[" useId ".trim().toString()]||(()=>{}),ZP=0;function ni(e){const[t,n]=f.useState(QP());return lo(()=>{n(s=>s??String(ZP++))},[e]),e||(t?`radix-${t}`:"")}var eA=Fj[" useInsertionEffect ".trim().toString()]||lo;function zd({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[a,l,c]=tA({defaultProp:t,onChange:n}),u=e!==void 0,p=u?e:a;{const h=f.useRef(e!==void 0);f.useEffect(()=>{const g=h.current;g!==u&&console.warn(`${s} is changing from ${g?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=u},[u,s])}const m=f.useCallback(h=>{var g;if(u){const y=nA(h)?h(e):h;y!==e&&((g=c.current)==null||g.call(c,y))}else l(h)},[u,e,l,c]);return[p,m]}function tA({defaultProp:e,onChange:t}){const[n,s]=f.useState(e),a=f.useRef(n),l=f.useRef(t);return eA(()=>{l.current=t},[t]),f.useEffect(()=>{var c;a.current!==n&&((c=l.current)==null||c.call(l,n),a.current=n)},[n,a]),[n,s,l]}function nA(e){return typeof e=="function"}function rA(e){const t=sA(e),n=f.forwardRef((s,a)=>{const{children:l,...c}=s,u=f.Children.toArray(l),p=u.find(aA);if(p){const m=p.props.children,h=u.map(g=>g===p?f.Children.count(m)>1?f.Children.only(null):f.isValidElement(m)?m.props.children:null:g);return r.jsx(t,{...c,ref:a,children:f.isValidElement(m)?f.cloneElement(m,void 0,h):null})}return r.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function sA(e){const t=f.forwardRef((n,s)=>{const{children:a,...l}=n;if(f.isValidElement(a)){const c=lA(a),u=iA(l,a.props);return a.type!==f.Fragment&&(u.ref=s?Fd(s,c):c),f.cloneElement(a,u)}return f.Children.count(a)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oA=Symbol("radix.slottable");function aA(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oA}function iA(e,t){const n={...t};for(const s in t){const a=e[s],l=t[s];/^on[A-Z]/.test(s)?a&&l?n[s]=(...u)=>{const p=l(...u);return a(...u),p}:a&&(n[s]=a):s==="style"?n[s]={...a,...l}:s==="className"&&(n[s]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function lA(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mn=cA.reduce((e,t)=>{const n=rA(`Primitive.${t}`),s=f.forwardRef((a,l)=>{const{asChild:c,...u}=a,p=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(p,{...u,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function uA(e,t){e&&Rs.flushSync(()=>e.dispatchEvent(t))}function Ko(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function dA(e,t=globalThis==null?void 0:globalThis.document){const n=Ko(e);f.useEffect(()=>{const s=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var fA="DismissableLayer",mh="dismissableLayer.update",pA="dismissableLayer.pointerDownOutside",mA="dismissableLayer.focusOutside",Sv,Z0=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gg=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...p}=e,m=f.useContext(Z0),[h,g]=f.useState(null),y=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=f.useState({}),E=Fn(t,$=>g($)),j=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),k=j.indexOf(w),C=h?j.indexOf(h):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,T=C>=k,D=xA($=>{const L=$.target,K=[...m.branches].some(B=>B.contains(L));!T||K||(a==null||a($),c==null||c($),$.defaultPrevented||u==null||u())},y),R=yA($=>{const L=$.target;[...m.branches].some(B=>B.contains(L))||(l==null||l($),c==null||c($),$.defaultPrevented||u==null||u())},y);return dA($=>{C===m.layers.size-1&&(s==null||s($),!$.defaultPrevented&&u&&($.preventDefault(),u()))},y),f.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Sv=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),Nv(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=Sv)}},[h,y,n,m]),f.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),Nv())},[h,m]),f.useEffect(()=>{const $=()=>b({});return document.addEventListener(mh,$),()=>document.removeEventListener(mh,$)},[]),r.jsx(mn.div,{...p,ref:E,style:{pointerEvents:N?T?"auto":"none":void 0,...e.style},onFocusCapture:qt(e.onFocusCapture,R.onFocusCapture),onBlurCapture:qt(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:qt(e.onPointerDownCapture,D.onPointerDownCapture)})});gg.displayName=fA;var hA="DismissableLayerBranch",gA=f.forwardRef((e,t)=>{const n=f.useContext(Z0),s=f.useRef(null),a=Fn(t,s);return f.useEffect(()=>{const l=s.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),r.jsx(mn.div,{...e,ref:a})});gA.displayName=hA;function xA(e,t=globalThis==null?void 0:globalThis.document){const n=Ko(e),s=f.useRef(!1),a=f.useRef(()=>{});return f.useEffect(()=>{const l=u=>{if(u.target&&!s.current){let p=function(){ek(pA,n,m,{discrete:!0})};const m={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=p,t.addEventListener("click",a.current,{once:!0})):p()}else t.removeEventListener("click",a.current);s.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function yA(e,t=globalThis==null?void 0:globalThis.document){const n=Ko(e),s=f.useRef(!1);return f.useEffect(()=>{const a=l=>{l.target&&!s.current&&ek(mA,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Nv(){const e=new CustomEvent(mh);document.dispatchEvent(e)}function ek(e,t,n,{discrete:s}){const a=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),s?uA(a,l):a.dispatchEvent(l)}var mm="focusScope.autoFocusOnMount",hm="focusScope.autoFocusOnUnmount",Cv={bubbles:!1,cancelable:!0},bA="FocusScope",tk=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:l,...c}=e,[u,p]=f.useState(null),m=Ko(a),h=Ko(l),g=f.useRef(null),y=Fn(t,j=>p(j)),b=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(s){let j=function(N){if(b.paused||!u)return;const T=N.target;u.contains(T)?g.current=T:ro(g.current,{select:!0})},w=function(N){if(b.paused||!u)return;const T=N.relatedTarget;T!==null&&(u.contains(T)||ro(g.current,{select:!0}))},k=function(N){if(document.activeElement===document.body)for(const D of N)D.removedNodes.length>0&&ro(u)};document.addEventListener("focusin",j),document.addEventListener("focusout",w);const C=new MutationObserver(k);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",w),C.disconnect()}}},[s,u,b.paused]),f.useEffect(()=>{if(u){Tv.add(b);const j=document.activeElement;if(!u.contains(j)){const k=new CustomEvent(mm,Cv);u.addEventListener(mm,m),u.dispatchEvent(k),k.defaultPrevented||(vA(NA(nk(u)),{select:!0}),document.activeElement===j&&ro(u))}return()=>{u.removeEventListener(mm,m),setTimeout(()=>{const k=new CustomEvent(hm,Cv);u.addEventListener(hm,h),u.dispatchEvent(k),k.defaultPrevented||ro(j??document.body,{select:!0}),u.removeEventListener(hm,h),Tv.remove(b)},0)}}},[u,m,h,b]);const E=f.useCallback(j=>{if(!n&&!s||b.paused)return;const w=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,k=document.activeElement;if(w&&k){const C=j.currentTarget,[N,T]=wA(C);N&&T?!j.shiftKey&&k===T?(j.preventDefault(),n&&ro(N,{select:!0})):j.shiftKey&&k===N&&(j.preventDefault(),n&&ro(T,{select:!0})):k===C&&j.preventDefault()}},[n,s,b.paused]);return r.jsx(mn.div,{tabIndex:-1,...c,ref:y,onKeyDown:E})});tk.displayName=bA;function vA(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(ro(s,{select:t}),document.activeElement!==n)return}function wA(e){const t=nk(e),n=Ev(t,e),s=Ev(t.reverse(),e);return[n,s]}function nk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ev(e,t){for(const n of e)if(!jA(n,{upTo:t}))return n}function jA(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function kA(e){return e instanceof HTMLInputElement&&"select"in e}function ro(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&kA(e)&&t&&e.select()}}var Tv=SA();function SA(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Rv(e,t),e.unshift(t)},remove(t){var n;e=Rv(e,t),(n=e[0])==null||n.resume()}}}function Rv(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function NA(e){return e.filter(t=>t.tagName!=="A")}var CA="Portal",xg=f.forwardRef((e,t)=>{var u;const{container:n,...s}=e,[a,l]=f.useState(!1);lo(()=>l(!0),[]);const c=n||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?GT.createPortal(r.jsx(mn.div,{...s,ref:t}),c):null});xg.displayName=CA;function EA(e,t){return f.useReducer((n,s)=>t[n][s]??n,e)}var Qo=e=>{const{present:t,children:n}=e,s=TA(t),a=typeof n=="function"?n({present:s.isPresent}):f.Children.only(n),l=Fn(s.ref,RA(a));return typeof n=="function"||s.isPresent?f.cloneElement(a,{ref:l}):null};Qo.displayName="Presence";function TA(e){const[t,n]=f.useState(),s=f.useRef(null),a=f.useRef(e),l=f.useRef("none"),c=e?"mounted":"unmounted",[u,p]=EA(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const m=Su(s.current);l.current=u==="mounted"?m:"none"},[u]),lo(()=>{const m=s.current,h=a.current;if(h!==e){const y=l.current,b=Su(m);e?p("MOUNT"):b==="none"||(m==null?void 0:m.display)==="none"?p("UNMOUNT"):p(h&&y!==b?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,p]),lo(()=>{if(t){let m;const h=t.ownerDocument.defaultView??window,g=b=>{const j=Su(s.current).includes(CSS.escape(b.animationName));if(b.target===t&&j&&(p("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",m=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},y=b=>{b.target===t&&(l.current=Su(s.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{h.clearTimeout(m),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:f.useCallback(m=>{s.current=m?getComputedStyle(m):null,n(m)},[])}}function Su(e){return(e==null?void 0:e.animationName)||"none"}function RA(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gm=0;function PA(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Pv()),document.body.insertAdjacentElement("beforeend",e[1]??Pv()),gm++,()=>{gm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),gm--}},[])}function Pv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var is=function(){return is=Object.assign||function(t){for(var n,s=1,a=arguments.length;s<a;s++){n=arguments[s];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},is.apply(this,arguments)};function rk(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(n[s[a]]=e[s[a]]);return n}function AA(e,t,n){if(n||arguments.length===2)for(var s=0,a=t.length,l;s<a;s++)(l||!(s in t))&&(l||(l=Array.prototype.slice.call(t,0,s)),l[s]=t[s]);return e.concat(l||Array.prototype.slice.call(t))}var Wu="right-scroll-bar-position",Ku="width-before-scroll-bar",DA="with-scroll-bars-hidden",$A="--removed-body-scroll-bar-size";function xm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function LA(e,t){var n=f.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var a=n.value;a!==s&&(n.value=s,n.callback(s,a))}}}})[0];return n.callback=t,n.facade}var OA=typeof window<"u"?f.useLayoutEffect:f.useEffect,Av=new WeakMap;function IA(e,t){var n=LA(null,function(s){return e.forEach(function(a){return xm(a,s)})});return OA(function(){var s=Av.get(n);if(s){var a=new Set(s),l=new Set(e),c=n.current;a.forEach(function(u){l.has(u)||xm(u,null)}),l.forEach(function(u){a.has(u)||xm(u,c)})}Av.set(n,e)},[e]),n}function MA(e){return e}function _A(e,t){t===void 0&&(t=MA);var n=[],s=!1,a={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var c=t(l,s);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(l){for(s=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(u){return l(u)},filter:function(){return n}}},assignMedium:function(l){s=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(l),c=n}var p=function(){var h=c;c=[],h.forEach(l)},m=function(){return Promise.resolve().then(p)};m(),n={push:function(h){c.push(h),m()},filter:function(h){return c=c.filter(h),n}}}};return a}function FA(e){e===void 0&&(e={});var t=_A(null);return t.options=is({async:!0,ssr:!1},e),t}var sk=function(e){var t=e.sideCar,n=rk(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return f.createElement(s,is({},n))};sk.isSideCarExport=!0;function zA(e,t){return e.useMedium(t),sk}var ok=FA(),ym=function(){},Bd=f.forwardRef(function(e,t){var n=f.useRef(null),s=f.useState({onScrollCapture:ym,onWheelCapture:ym,onTouchMoveCapture:ym}),a=s[0],l=s[1],c=e.forwardProps,u=e.children,p=e.className,m=e.removeScrollBar,h=e.enabled,g=e.shards,y=e.sideCar,b=e.noRelative,E=e.noIsolation,j=e.inert,w=e.allowPinchZoom,k=e.as,C=k===void 0?"div":k,N=e.gapMode,T=rk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=y,R=IA([n,t]),$=is(is({},T),a);return f.createElement(f.Fragment,null,h&&f.createElement(D,{sideCar:ok,removeScrollBar:m,shards:g,noRelative:b,noIsolation:E,inert:j,setCallbacks:l,allowPinchZoom:!!w,lockRef:n,gapMode:N}),c?f.cloneElement(f.Children.only(u),is(is({},$),{ref:R})):f.createElement(C,is({},$,{className:p,ref:R}),u))});Bd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bd.classNames={fullWidth:Ku,zeroRight:Wu};var BA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function UA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=BA();return t&&e.setAttribute("nonce",t),e}function VA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var WA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=UA())&&(VA(t,n),HA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},KA=function(){var e=WA();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ak=function(){var e=KA(),t=function(n){var s=n.styles,a=n.dynamic;return e(s,a),null};return t},qA={left:0,top:0,right:0,gap:0},bm=function(e){return parseInt(e||"",10)||0},GA=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[bm(n),bm(s),bm(a)]},YA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qA;var t=GA(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},JA=ak(),ri="data-scroll-locked",XA=function(e,t,n,s){var a=e.left,l=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
481
|
-
.`.concat(DA,` {
|
|
482
|
-
overflow: hidden `).concat(s,`;
|
|
483
|
-
padding-right: `).concat(u,"px ").concat(s,`;
|
|
484
|
-
}
|
|
485
|
-
body[`).concat(ri,`] {
|
|
486
|
-
overflow: hidden `).concat(s,`;
|
|
487
|
-
overscroll-behavior: contain;
|
|
488
|
-
`).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
|
|
489
|
-
padding-left: `.concat(a,`px;
|
|
490
|
-
padding-top: `).concat(l,`px;
|
|
491
|
-
padding-right: `).concat(c,`px;
|
|
492
|
-
margin-left:0;
|
|
493
|
-
margin-top:0;
|
|
494
|
-
margin-right: `).concat(u,"px ").concat(s,`;
|
|
495
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
.`).concat(Wu,` {
|
|
499
|
-
right: `).concat(u,"px ").concat(s,`;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
.`).concat(Ku,` {
|
|
503
|
-
margin-right: `).concat(u,"px ").concat(s,`;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
.`).concat(Wu," .").concat(Wu,` {
|
|
507
|
-
right: 0 `).concat(s,`;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
.`).concat(Ku," .").concat(Ku,` {
|
|
511
|
-
margin-right: 0 `).concat(s,`;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
body[`).concat(ri,`] {
|
|
515
|
-
`).concat($A,": ").concat(u,`px;
|
|
516
|
-
}
|
|
517
|
-
`)},Dv=function(){var e=parseInt(document.body.getAttribute(ri)||"0",10);return isFinite(e)?e:0},QA=function(){f.useEffect(function(){return document.body.setAttribute(ri,(Dv()+1).toString()),function(){var e=Dv()-1;e<=0?document.body.removeAttribute(ri):document.body.setAttribute(ri,e.toString())}},[])},ZA=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,a=s===void 0?"margin":s;QA();var l=f.useMemo(function(){return YA(a)},[a]);return f.createElement(JA,{styles:XA(l,!t,a,n?"":"!important")})},hh=!1;if(typeof window<"u")try{var Nu=Object.defineProperty({},"passive",{get:function(){return hh=!0,!0}});window.addEventListener("test",Nu,Nu),window.removeEventListener("test",Nu,Nu)}catch{hh=!1}var Ia=hh?{passive:!1}:!1,e3=function(e){return e.tagName==="TEXTAREA"},ik=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!e3(e)&&n[t]==="visible")},t3=function(e){return ik(e,"overflowY")},n3=function(e){return ik(e,"overflowX")},$v=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var a=lk(e,s);if(a){var l=ck(e,s),c=l[1],u=l[2];if(c>u)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},r3=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},s3=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},lk=function(e,t){return e==="v"?t3(t):n3(t)},ck=function(e,t){return e==="v"?r3(t):s3(t)},o3=function(e,t){return e==="h"&&t==="rtl"?-1:1},a3=function(e,t,n,s,a){var l=o3(e,window.getComputedStyle(t).direction),c=l*s,u=n.target,p=t.contains(u),m=!1,h=c>0,g=0,y=0;do{if(!u)break;var b=ck(e,u),E=b[0],j=b[1],w=b[2],k=j-w-l*E;(E||k)&&lk(e,u)&&(g+=k,y+=E);var C=u.parentNode;u=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!p&&u!==document.body||p&&(t.contains(u)||t===u));return(h&&Math.abs(g)<1||!h&&Math.abs(y)<1)&&(m=!0),m},Cu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Lv=function(e){return[e.deltaX,e.deltaY]},Ov=function(e){return e&&"current"in e?e.current:e},i3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},l3=function(e){return`
|
|
518
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
519
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
520
|
-
`)},c3=0,Ma=[];function u3(e){var t=f.useRef([]),n=f.useRef([0,0]),s=f.useRef(),a=f.useState(c3++)[0],l=f.useState(ak)[0],c=f.useRef(e);f.useEffect(function(){c.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var j=AA([e.lockRef.current],(e.shards||[]).map(Ov),!0).filter(Boolean);return j.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),j.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=f.useCallback(function(j,w){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var k=Cu(j),C=n.current,N="deltaX"in j?j.deltaX:C[0]-k[0],T="deltaY"in j?j.deltaY:C[1]-k[1],D,R=j.target,$=Math.abs(N)>Math.abs(T)?"h":"v";if("touches"in j&&$==="h"&&R.type==="range")return!1;var L=window.getSelection(),K=L&&L.anchorNode,B=K?K===R||K.contains(R):!1;if(B)return!1;var O=$v($,R);if(!O)return!0;if(O?D=$:(D=$==="v"?"h":"v",O=$v($,R)),!O)return!1;if(!s.current&&"changedTouches"in j&&(N||T)&&(s.current=D),!D)return!0;var W=s.current||D;return a3(W,w,j,W==="h"?N:T)},[]),p=f.useCallback(function(j){var w=j;if(!(!Ma.length||Ma[Ma.length-1]!==l)){var k="deltaY"in w?Lv(w):Cu(w),C=t.current.filter(function(D){return D.name===w.type&&(D.target===w.target||w.target===D.shadowParent)&&i3(D.delta,k)})[0];if(C&&C.should){w.cancelable&&w.preventDefault();return}if(!C){var N=(c.current.shards||[]).map(Ov).filter(Boolean).filter(function(D){return D.contains(w.target)}),T=N.length>0?u(w,N[0]):!c.current.noIsolation;T&&w.cancelable&&w.preventDefault()}}},[]),m=f.useCallback(function(j,w,k,C){var N={name:j,delta:w,target:k,should:C,shadowParent:d3(k)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(T){return T!==N})},1)},[]),h=f.useCallback(function(j){n.current=Cu(j),s.current=void 0},[]),g=f.useCallback(function(j){m(j.type,Lv(j),j.target,u(j,e.lockRef.current))},[]),y=f.useCallback(function(j){m(j.type,Cu(j),j.target,u(j,e.lockRef.current))},[]);f.useEffect(function(){return Ma.push(l),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",p,Ia),document.addEventListener("touchmove",p,Ia),document.addEventListener("touchstart",h,Ia),function(){Ma=Ma.filter(function(j){return j!==l}),document.removeEventListener("wheel",p,Ia),document.removeEventListener("touchmove",p,Ia),document.removeEventListener("touchstart",h,Ia)}},[]);var b=e.removeScrollBar,E=e.inert;return f.createElement(f.Fragment,null,E?f.createElement(l,{styles:l3(a)}):null,b?f.createElement(ZA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function d3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const f3=zA(ok,u3);var uk=f.forwardRef(function(e,t){return f.createElement(Bd,is({},e,{ref:t,sideCar:f3}))});uk.classNames=Bd.classNames;var p3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},_a=new WeakMap,Eu=new WeakMap,Tu={},vm=0,dk=function(e){return e&&(e.host||dk(e.parentNode))},m3=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=dk(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},h3=function(e,t,n,s){var a=m3(t,Array.isArray(e)?e:[e]);Tu[n]||(Tu[n]=new WeakMap);var l=Tu[n],c=[],u=new Set,p=new Set(a),m=function(g){!g||u.has(g)||(u.add(g),m(g.parentNode))};a.forEach(m);var h=function(g){!g||p.has(g)||Array.prototype.forEach.call(g.children,function(y){if(u.has(y))h(y);else try{var b=y.getAttribute(s),E=b!==null&&b!=="false",j=(_a.get(y)||0)+1,w=(l.get(y)||0)+1;_a.set(y,j),l.set(y,w),c.push(y),j===1&&E&&Eu.set(y,!0),w===1&&y.setAttribute(n,"true"),E||y.setAttribute(s,"true")}catch(k){console.error("aria-hidden: cannot operate on ",y,k)}})};return h(t),u.clear(),vm++,function(){c.forEach(function(g){var y=_a.get(g)-1,b=l.get(g)-1;_a.set(g,y),l.set(g,b),y||(Eu.has(g)||g.removeAttribute(s),Eu.delete(g)),b||g.removeAttribute(n)}),vm--,vm||(_a=new WeakMap,_a=new WeakMap,Eu=new WeakMap,Tu={})}},g3=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),a=p3(e);return a?(s.push.apply(s,Array.from(a.querySelectorAll("[aria-live], script"))),h3(s,a,n,"aria-hidden")):function(){return null}};function x3(e){const t=y3(e),n=f.forwardRef((s,a)=>{const{children:l,...c}=s,u=f.Children.toArray(l),p=u.find(v3);if(p){const m=p.props.children,h=u.map(g=>g===p?f.Children.count(m)>1?f.Children.only(null):f.isValidElement(m)?m.props.children:null:g);return r.jsx(t,{...c,ref:a,children:f.isValidElement(m)?f.cloneElement(m,void 0,h):null})}return r.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function y3(e){const t=f.forwardRef((n,s)=>{const{children:a,...l}=n;if(f.isValidElement(a)){const c=j3(a),u=w3(l,a.props);return a.type!==f.Fragment&&(u.ref=s?Fd(s,c):c),f.cloneElement(a,u)}return f.Children.count(a)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var b3=Symbol("radix.slottable");function v3(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===b3}function w3(e,t){const n={...t};for(const s in t){const a=e[s],l=t[s];/^on[A-Z]/.test(s)?a&&l?n[s]=(...u)=>{const p=l(...u);return a(...u),p}:a&&(n[s]=a):s==="style"?n[s]={...a,...l}:s==="className"&&(n[s]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function j3(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ud="Dialog",[fk,pk]=Xo(Ud),[k3,Qr]=fk(Ud),mk=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,u=f.useRef(null),p=f.useRef(null),[m,h]=zd({prop:s,defaultProp:a??!1,onChange:l,caller:Ud});return r.jsx(k3,{scope:t,triggerRef:u,contentRef:p,contentId:ni(),titleId:ni(),descriptionId:ni(),open:m,onOpenChange:h,onOpenToggle:f.useCallback(()=>h(g=>!g),[h]),modal:c,children:n})};mk.displayName=Ud;var hk="DialogTrigger",gk=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Qr(hk,n),l=Fn(t,a.triggerRef);return r.jsx(mn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":vg(a.open),...s,ref:l,onClick:qt(e.onClick,a.onOpenToggle)})});gk.displayName=hk;var yg="DialogPortal",[S3,xk]=fk(yg,{forceMount:void 0}),yk=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:a}=e,l=Qr(yg,t);return r.jsx(S3,{scope:t,forceMount:n,children:f.Children.map(s,c=>r.jsx(Qo,{present:n||l.open,children:r.jsx(xg,{asChild:!0,container:a,children:c})}))})};yk.displayName=yg;var id="DialogOverlay",bk=f.forwardRef((e,t)=>{const n=xk(id,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,l=Qr(id,e.__scopeDialog);return l.modal?r.jsx(Qo,{present:s||l.open,children:r.jsx(C3,{...a,ref:t})}):null});bk.displayName=id;var N3=x3("DialogOverlay.RemoveScroll"),C3=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Qr(id,n);return r.jsx(uk,{as:N3,allowPinchZoom:!0,shards:[a.contentRef],children:r.jsx(mn.div,{"data-state":vg(a.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),qo="DialogContent",vk=f.forwardRef((e,t)=>{const n=xk(qo,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,l=Qr(qo,e.__scopeDialog);return r.jsx(Qo,{present:s||l.open,children:l.modal?r.jsx(E3,{...a,ref:t}):r.jsx(T3,{...a,ref:t})})});vk.displayName=qo;var E3=f.forwardRef((e,t)=>{const n=Qr(qo,e.__scopeDialog),s=f.useRef(null),a=Fn(t,n.contentRef,s);return f.useEffect(()=>{const l=s.current;if(l)return g3(l)},[]),r.jsx(wk,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qt(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:qt(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&l.preventDefault()}),onFocusOutside:qt(e.onFocusOutside,l=>l.preventDefault())})}),T3=f.forwardRef((e,t)=>{const n=Qr(qo,e.__scopeDialog),s=f.useRef(!1),a=f.useRef(!1);return r.jsx(wk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(s.current||(u=n.triggerRef.current)==null||u.focus(),l.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:l=>{var p,m;(p=e.onInteractOutside)==null||p.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&a.current&&l.preventDefault()}})}),wk=f.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,...c}=e,u=Qr(qo,n),p=f.useRef(null),m=Fn(t,p);return PA(),r.jsxs(r.Fragment,{children:[r.jsx(tk,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:l,children:r.jsx(gg,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":vg(u.open),...c,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(P3,{titleId:u.titleId}),r.jsx(D3,{contentRef:p,descriptionId:u.descriptionId})]})]})}),bg="DialogTitle",jk=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Qr(bg,n);return r.jsx(mn.h2,{id:a.titleId,...s,ref:t})});jk.displayName=bg;var kk="DialogDescription",Sk=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Qr(kk,n);return r.jsx(mn.p,{id:a.descriptionId,...s,ref:t})});Sk.displayName=kk;var Nk="DialogClose",Ck=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Qr(Nk,n);return r.jsx(mn.button,{type:"button",...s,ref:t,onClick:qt(e.onClick,()=>a.onOpenChange(!1))})});Ck.displayName=Nk;function vg(e){return e?"open":"closed"}var Ek="DialogTitleWarning",[R3,Tk]=JP(Ek,{contentName:qo,titleName:bg,docsSlug:"dialog"}),P3=({titleId:e})=>{const t=Tk(Ek),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
521
|
-
|
|
522
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
523
|
-
|
|
524
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},A3="DialogDescriptionWarning",D3=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tk(A3).contentName}}.`;return f.useEffect(()=>{var l;const a=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},Rk=mk,Pk=gk,Ak=yk,wg=bk,jg=vk,kg=jk,Sg=Sk,Ng=Ck;const ar=Rk,$3=Pk,L3=Ak,O3=Ng,Dk=f.forwardRef(({className:e,...t},n)=>r.jsx(wg,{ref:n,className:Se("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));Dk.displayName=wg.displayName;const Kn=f.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(L3,{children:[r.jsx(Dk,{}),r.jsx(jg,{ref:s,className:Se("chrome-card fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 !p-6 outline-none",e),...n,children:t})]}));Kn.displayName=jg.displayName;function Zr({className:e,...t}){return r.jsx("div",{className:Se("flex flex-col space-y-2 text-left",e),...t})}function Ls({className:e,...t}){return r.jsx("div",{className:Se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const qn=f.forwardRef(({className:e,...t},n)=>r.jsx(kg,{ref:n,className:Se("text-lg font-semibold tracking-tight text-foreground",e),...t}));qn.displayName=kg.displayName;const gs=f.forwardRef(({className:e,...t},n)=>r.jsx(Sg,{ref:n,className:Se("text-sm leading-6 text-muted-foreground",e),...t}));gs.displayName=Sg.displayName;const I3=-1,M3=-40;function wm(e,t){if(e.length===0)return 0;if(t.length===0)return-1/0;let n=0,s=0,a=-2,l=0;for(let c=0;c<e.length;c++){const u=e[c];let p=!1;for(;s<t.length;)if(t[s]===u){if(n+=100,s===a+1&&(n+=20),s===0)n+=30;else{const m=t[s-1];(m===" "||m==="-"||m==="_"||m==="/")&&(n+=15)}l>0&&(n+=Math.max(M3,l*I3)),a=s,l=0,s++,p=!0;break}else l++,s++;if(!p)return-1/0}return n}const Iv={page:0,project:1,assignment:2,playbook:3,server:4,todo:5};function Cg(e,t,n=50){const s=e.toLowerCase();if(!s)return t.slice(0,n).map(c=>({...c,score:0}));const l=t.map(c=>{var g;const u=wm(s,c.title.toLowerCase())*1,p=c.subtitle?wm(s,c.subtitle.toLowerCase())*.5:-1/0,m=(g=c.keywords)!=null&&g.length?wm(s,c.keywords.join(" ").toLowerCase())*.3:-1/0,h=Math.max(u,p,m);return{...c,score:h}}).filter(c=>c.score>-1/0);return l.sort((c,u)=>u.score!==c.score?u.score-c.score:c.title.length!==u.title.length?c.title.length-u.title.length:c.title!==u.title?c.title<u.title?-1:1:(Iv[c.type]??99)-(Iv[u.type]??99)),l.slice(0,n)}const _3={page:"Page",project:"Project",assignment:"Assignment",playbook:"Playbook",server:"Server",todo:"Todo"};function F3({entries:e}){const{paletteOpen:t,closePalette:n}=po(),s=Dt(),[a,l]=f.useState(""),[c,u]=f.useState(0),p=f.useRef(null),m=f.useMemo(()=>Cg(a,e,50),[a,e]);f.useEffect(()=>{u(0)},[a,t]),f.useEffect(()=>{t||l("")},[t]),f.useEffect(()=>{var b;const y=(b=p.current)==null?void 0:b.querySelector(`[data-palette-idx="${c}"]`);y==null||y.scrollIntoView({block:"nearest"})},[c]);function h(y){s(y.route),n()}function g(y){if(y.key==="ArrowDown")y.preventDefault(),u(b=>Math.min(m.length-1,b+1));else if(y.key==="ArrowUp")y.preventDefault(),u(b=>Math.max(0,b-1));else if(y.key==="Enter"){y.preventDefault();const b=m[c];b&&h(b)}}return r.jsx(ar,{open:t,onOpenChange:y=>y?null:n(),children:r.jsxs(Kn,{className:"max-w-xl p-0 gap-0",children:[r.jsx(qn,{className:"sr-only",children:"Command palette"}),r.jsx("input",{autoFocus:!0,type:"text",value:a,onChange:y=>l(y.target.value),onKeyDown:g,placeholder:"Search projects, assignments, playbooks, servers, todos…",className:"w-full rounded-t-xl border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0"}),r.jsx("div",{ref:p,className:"max-h-[60vh] overflow-y-auto p-1",children:m.length===0?r.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:a?"No matches":"Start typing to search"}):m.map((y,b)=>{const E=b===c;return r.jsxs("button",{type:"button","data-palette-idx":b,onClick:()=>h(y),onMouseEnter:()=>u(b),className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors ${E?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[r.jsx("span",{className:"shrink-0 rounded border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:_3[y.type]??y.type}),r.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.title}),y.subtitle?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:y.subtitle}):null]},y.id)})}),r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsxs("span",{children:["↑↓"," navigate ","·"," ","↵"," open ","·"," Esc close"]}),r.jsxs("span",{children:[m.length," result",m.length===1?"":"s"]})]})]})})}function z3({label:e,onBack:t,disabled:n,stepCounter:s}){return r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-3 py-2",children:[r.jsxs("button",{type:"button",onClick:t,disabled:n,className:"inline-flex h-7 items-center gap-1 rounded border border-border/70 bg-background/60 px-2 text-[11px] text-muted-foreground transition-colors hover:bg-accent/40 hover:text-foreground disabled:opacity-50","aria-label":"Back",children:[r.jsx(eR,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsx("span",{children:"Back"})]}),r.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:e}),s?r.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground/80",children:["step ",s.current," of ",s.total]}):null]})}function B3({step:e,initialValue:t,disabled:n,onSubmit:s}){const[a,l]=f.useState(t??""),[c,u]=f.useState(!1),p=f.useRef(null);f.useEffect(()=>{var E;(E=p.current)==null||E.focus()},[]);const m=a.trim(),h=e.required!==!1,g=e.pattern&&m.length>0&&!e.pattern.regex.test(m),y=!n&&(!h||m.length>0)&&!g;function b(E){if(E.key==="Enter"){if(E.preventDefault(),!y){u(!0);return}s(m)}}return r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:p,type:"text",value:a,onChange:E=>{l(E.target.value),u(!1)},onKeyDown:b,placeholder:e.placeholder,disabled:n,className:"w-full border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),c&&e.pattern&&g?r.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:e.pattern.message}):null]})}function U3({step:e,disabled:t,onSubmit:n}){const[s,a]=f.useState({phase:"loading"}),[l,c]=f.useState(""),[u,p]=f.useState(0),[m,h]=f.useState(0),g=f.useRef(null),y=f.useRef(null);f.useEffect(()=>{var j;(j=g.current)==null||j.focus()},[]),f.useEffect(()=>{let j=!1;return a({phase:"loading"}),Promise.resolve().then(()=>e.loadOptions()).then(w=>{j||a({phase:"loaded",options:w})}).catch(w=>{if(j)return;const k=w instanceof Error?w.message:"Failed to load options";a({phase:"error",message:k})}),()=>{j=!0}},[e,m]);const b=f.useMemo(()=>{if(s.phase!=="loaded")return[];const j=s.options.map(w=>({type:"option",title:w.label,subtitle:w.hint,keywords:[w.value],option:w}));return Cg(l,j,100)},[s,l]);f.useEffect(()=>{p(0)},[b.length]),f.useEffect(()=>{var w;const j=(w=y.current)==null?void 0:w.querySelector(`[data-picker-idx="${u}"]`);j==null||j.scrollIntoView({block:"nearest"})},[u]);function E(j){if(s.phase==="loaded"){if(j.key==="ArrowDown")j.preventDefault(),p(w=>Math.min(b.length-1,w+1));else if(j.key==="ArrowUp")j.preventDefault(),p(w=>Math.max(0,w-1));else if(j.key==="Enter"){j.preventDefault();const w=b[u];w&&n(w.option.value)}}}return r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:g,type:"text",value:l,onChange:j=>c(j.target.value),onKeyDown:E,placeholder:`Filter ${e.label.toLowerCase()}…`,disabled:t||s.phase==="loading",className:"w-full border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),r.jsx("div",{ref:y,className:"max-h-[60vh] min-h-[120px] overflow-y-auto p-1",children:s.phase==="loading"?r.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"Loading…"}):s.phase==="error"?r.jsxs("div",{className:"px-4 py-4 text-sm",children:[r.jsxs("div",{className:"mb-2 text-destructive",children:["Failed to load: ",s.message]}),r.jsx("button",{type:"button",onClick:()=>h(j=>j+1),className:"rounded border border-border/70 bg-background/60 px-2 py-1 text-xs text-foreground hover:bg-accent/40",children:"Retry"})]}):b.length===0?r.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:s.options.length===0?e.emptyMessage??"No options available":"No matches"}):b.map((j,w)=>{const k=w===u;return r.jsxs("button",{type:"button","data-picker-idx":w,onClick:()=>n(j.option.value),onMouseEnter:()=>p(w),disabled:t,className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors disabled:opacity-60 ${k?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[r.jsx("span",{className:"min-w-0 flex-1 truncate",children:j.option.label}),j.option.hint?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:j.option.hint}):null]},j.option.value)})})]})}function V3({entries:e}){var de,ge;const t=Dt(),{actionsPaletteOpen:n,closeActionsPalette:s,customBindings:a,bindAction:l,findConflict:c,pendingActionKind:u,consumePendingActionKind:p}=po(),[m,h]=f.useState(""),[g,y]=f.useState(0),[b,E]=f.useState(null),[j,w]=f.useState(""),[k,C]=f.useState(null),[N,T]=f.useState(null),[D,R]=f.useState(!1),[$,L]=f.useState(null),K=f.useRef(null),B=f.useMemo(()=>e.map(V=>({type:V.group.toLowerCase(),title:V.title,subtitle:V.subtitle,keywords:V.keywords,action:V})),[e]),O=f.useMemo(()=>Cg(m,B,50),[m,B]);f.useEffect(()=>{y(0)},[m,n]),f.useEffect(()=>{n||(h(""),E(null),w(""),C(null),T(null),R(!1),L(null))},[n]),f.useEffect(()=>{if(!n||!u)return;const V=p();if(!V)return;const ae=e.find(me=>me.bindableKind===V);ae&&W(ae)},[n,u]),f.useEffect(()=>{var ae;const V=(ae=K.current)==null?void 0:ae.querySelector(`[data-palette-idx="${g}"]`);V==null||V.scrollIntoView({block:"nearest"})},[g]);async function W(V){if(!D){if(V.flow&&V.flow.steps.length>0){C({action:V,stepIndex:0,values:{}}),L(null);return}if(V.requiresInput){E(V),w(""),L(null);return}if(V.run){R(!0),L(null);try{await V.run(),s()}catch(ae){L(ae instanceof Error?ae.message:"Action failed")}finally{R(!1)}}}}async function se(V){if(!k)return;const ae=k.action.flow.steps[k.stepIndex],me={...k.values,[ae.id]:V};if(k.stepIndex+1<k.action.flow.steps.length){C({action:k.action,stepIndex:k.stepIndex+1,values:me});return}R(!0),L(null);try{await k.action.flow.submit(me,{navigate:t}),s()}catch(ve){L(ve instanceof Error?ve.message:"Action failed")}finally{R(!1)}}function z(){if(k&&!D){if(k.stepIndex===0){C(null),L(null);return}C({action:k.action,stepIndex:k.stepIndex-1,values:k.values}),L(null)}}async function H(){if(D||!(b!=null&&b.requiresInput))return;const V=j.trim();if(V){R(!0),L(null);try{await b.requiresInput.runWithInput(V),s()}catch(ae){L(ae instanceof Error?ae.message:"Action failed")}finally{R(!1)}}}function ee(V){if(V.key==="ArrowDown")V.preventDefault(),y(ae=>Math.min(O.length-1,ae+1));else if(V.key==="ArrowUp")V.preventDefault(),y(ae=>Math.max(0,ae-1));else if(V.key==="Enter"&&(V.metaKey||V.ctrlKey)){V.preventDefault();const ae=O[g];ae!=null&&ae.action.bindableKind&&T({action:ae.action,combo:null,conflict:null,saving:!1,error:null})}else if(V.key==="Enter"){V.preventDefault();const ae=O[g];ae&&W(ae.action)}}function ne(V){V.key==="Enter"?(V.preventDefault(),H()):V.key==="Escape"&&(V.preventDefault(),E(null),w(""))}function M(V){if(!N||V.key==="Escape"||V.key==="Enter"&&!N.combo)return;V.preventDefault(),V.stopPropagation();const ae=V0(V.nativeEvent);if(!ae)return;const me=c(ae,N.action.bindableKind);T({...N,combo:ae,conflict:me,error:null})}async function G(){var V;if(!(!N||!N.combo||!N.action.bindableKind)){if((V=N.conflict)!=null&&V.description){T({...N,error:`Reserved: ${N.conflict.description}`});return}T({...N,saving:!0,error:null});try{await l(N.action.bindableKind,N.combo),T(null)}catch(ae){T({...N,saving:!1,error:ae instanceof Error?ae.message:"Failed to save binding"})}}}const A=b!==null,F=k!==null,Z=N!==null,I=k?k.action.flow.steps[k.stepIndex]:null;return r.jsx(ar,{open:n,onOpenChange:V=>V?null:s(),children:r.jsxs(Kn,{className:"max-w-xl p-0 gap-0",onEscapeKeyDown:V=>{if(!D){if(Z){V.preventDefault(),T(null);return}if(F){V.preventDefault(),z();return}A&&(V.preventDefault(),E(null),w(""),L(null))}},children:[r.jsx(qn,{className:"sr-only",children:"Actions palette"}),Z&&N?r.jsxs("div",{onKeyDown:M,tabIndex:-1,autoFocus:!0,children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-4 py-3",children:[r.jsx(uh,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),r.jsxs("span",{className:"text-sm text-foreground",children:["Bind hotkey for ",N.action.title]})]}),r.jsx("div",{className:"px-4 py-6 text-center",children:N.combo?r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"text-2xl font-semibold tracking-wide text-foreground",children:ds(N.combo)}),(de=N.conflict)!=null&&de.description?r.jsxs("div",{className:"text-sm text-destructive",children:["Reserved: ",N.conflict.description," (cannot bind)"]}):(ge=N.conflict)!=null&&ge.kind?r.jsxs("div",{className:"text-sm text-amber-500 dark:text-amber-400",children:['Already bound to "',N.conflict.kind,'". Press Enter to overwrite.']}):r.jsx("div",{className:"text-sm text-muted-foreground",children:"Press Enter to save, or another key to retry."}),N.error?r.jsx("div",{className:"text-sm text-destructive",children:N.error}):null]}):r.jsx("div",{className:"text-sm text-muted-foreground",children:"Press the key combination you want to bind…"})}),r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsx("span",{children:"any key records · Enter saves · Esc cancels"}),r.jsx("span",{children:N.saving?"Saving…":""})]}),r.jsx("button",{type:"button",className:"sr-only",onClick:()=>void G(),"data-bind-confirm":!0}),r.jsx("input",{type:"hidden",onKeyDown:V=>{V.key==="Enter"&&G()}})]}):F&&I&&k?r.jsxs(r.Fragment,{children:[r.jsx(z3,{label:`${k.action.title} · ${I.label}`,onBack:z,disabled:D,stepCounter:{current:k.stepIndex+1,total:k.action.flow.steps.length}}),I.kind==="text"?r.jsx(B3,{step:I,initialValue:k.values[I.id],disabled:D,onSubmit:se}):r.jsx(U3,{step:I,disabled:D,onSubmit:se}),$?r.jsx("div",{className:"border-t border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:$}):null,r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsx("span",{children:"↵ next · ← back · Esc back"}),r.jsx("span",{children:D?"Running…":""})]})]}):A?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-4 py-3",children:[r.jsx("span",{className:"shrink-0 rounded border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:b.group}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:b.title})]}),r.jsx("input",{autoFocus:!0,type:"text",value:j,onChange:V=>w(V.target.value),onKeyDown:ne,placeholder:b.requiresInput.placeholder,disabled:D,className:"w-full border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),$?r.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:$}):null,r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsxs("span",{children:["↵"," submit ","·"," Esc back"]}),r.jsx("span",{children:D?"Running…":""})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("input",{autoFocus:!0,type:"text",value:m,onChange:V=>h(V.target.value),onKeyDown:ee,placeholder:"Run an action: new project, new todo, toggle…",disabled:D,className:"w-full rounded-t-xl border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),$?r.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:$}):null,r.jsx("div",{ref:K,className:"max-h-[60vh] overflow-y-auto p-1",children:O.length===0?r.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:m?"No matches":"Start typing to search actions"}):O.map((V,ae)=>{const me=ae===g,ve=V.action.bindableKind,ke=ve?a[ve]:void 0;return r.jsxs("button",{type:"button","data-palette-idx":ae,onClick:()=>W(V.action),onMouseEnter:()=>y(ae),disabled:D,className:`group flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors disabled:opacity-60 ${me?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[r.jsx("span",{className:"shrink-0 rounded border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:V.action.group}),r.jsx("span",{className:"min-w-0 flex-1 truncate",children:V.action.title}),V.action.subtitle?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:V.action.subtitle}):null,ke?r.jsx("span",{className:"shrink-0 rounded border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] font-medium tracking-wide text-foreground",children:ds(ke)}):null,ve?r.jsx("span",{role:"button",tabIndex:-1,"aria-label":"Bind hotkey",onClick:he=>{he.preventDefault(),he.stopPropagation(),T({action:V.action,combo:null,conflict:null,saving:!1,error:null})},className:`shrink-0 inline-flex h-6 w-6 items-center justify-center rounded border border-border/70 bg-background/60 text-muted-foreground transition-opacity hover:text-foreground ${me?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:r.jsx(uh,{className:"h-3.5 w-3.5","aria-hidden":"true"})}):null]},V.action.id)})}),r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsxs("span",{children:["↑↓"," navigate ","·"," ","↵"," run ","·"," ⌘↵ bind ","·"," Esc close"]}),r.jsx("span",{children:D?"Running…":`${O.length} action${O.length===1?"":"s"}`})]})]})]})})}const H3=[{combo:"mod+k",description:"Open command palette",scope:"global"},{combo:"mod+shift+k",description:"Open actions palette",scope:"global"},{combo:"?",description:"Show keyboard shortcuts",scope:"global"},{combo:"escape",description:"Close dialog or cancel",scope:"global"},{combo:"enter",description:"Activate selected item",scope:"global"},{combo:"shift+t",description:"Toggle light/dark theme",scope:"global"},{combo:"g",description:"Start navigation chord",scope:"global"},{combo:"g o",description:"Go to Overview",scope:"global"},{combo:"g m",description:"Go to Projects",scope:"global"},{combo:"g a",description:"Go to Assignments",scope:"global"},{combo:"g t",description:"Go to Todos",scope:"global"},{combo:"g s",description:"Go to Servers",scope:"global"},{combo:"g !",description:"Go to Attention",scope:"global"},{combo:"g ,",description:"Go to Settings",scope:"global"},{combo:"j",description:"Move selection down",scope:"list"},{combo:"k",description:"Move selection up",scope:"list"},{combo:"o",description:"Open selected item",scope:"list"},{combo:"a",description:"New assignment in project",scope:"project"},{combo:"e",description:"Edit project / assignment",scope:"project|assignment"},{combo:"/",description:"Focus search",scope:"assignments-board"},{combo:"r",description:"Refresh board",scope:"assignments-board"},{combo:"p",description:"Edit plan",scope:"assignment"},{combo:"h",description:"Append handoff",scope:"assignment"},{combo:"d",description:"Append decision record",scope:"assignment"},{combo:"s",description:"Edit scratchpad",scope:"assignment"},{combo:"[",description:"Previous assignment",scope:"assignment"},{combo:"]",description:"Next assignment",scope:"assignment"}];function W3(e){const t=rr(e);return t?H3.find(n=>n.combo===t)??null:null}const xl={"new-workspace":"New Workspace","new-project":"New Project","new-todo":"New Todo","new-assignment":"New Assignment"},K3={global:"Global","list:overview":"Overview","list:projects":"Projects list","list:assignments":"Assignments list","list:todos":"Todos list",assignment:"Assignment detail",project:"Project detail"},q3=["global","list:overview","list:projects","list:assignments","list:todos","project","assignment"];function Mv(e){if(e.includes(" ")){const[t,n]=e.split(" ");return`${ds(t)} then ${ds(n)}`}return ds(e)}function G3(){const{cheatsheetOpen:e,closeCheatsheet:t,listBindings:n,customBindings:s,actionEntries:a}=po(),l=f.useMemo(()=>{const p=new Set;for(const m of Object.values(s))typeof m=="string"&&m&&p.add(rr(m));return p},[s]),c=f.useMemo(()=>{if(!e)return new Map;const p=n(),m=new Map;for(const h of p){if(l.has(rr(h.keys)))continue;const g=m.get(h.scope)??[];g.push({keys:h.keys,description:h.description}),m.set(h.scope,g)}return m},[e,n,l]),u=f.useMemo(()=>{const p=[];for(const[m,h]of Object.entries(s)){if(!h)continue;const g=a.find(y=>y.bindableKind===m);p.push({kind:m,combo:h,title:g?g.title:m})}return p},[s,a]);return r.jsx(ar,{open:e,onOpenChange:p=>p?null:t(),children:r.jsxs(Kn,{className:"max-w-2xl",children:[r.jsx(qn,{children:"Keyboard shortcuts"}),r.jsxs(gs,{children:["Press Esc to close. ",ds("Mod+k")," opens the command palette. Press g twice to restart the chord timer."]}),r.jsxs("div",{className:"mt-2 max-h-[60vh] space-y-4 overflow-y-auto pr-1",children:[q3.map(p=>{const m=c.get(p);return!m||m.length===0?null:r.jsxs("section",{children:[r.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:K3[p]}),r.jsx("ul",{className:"space-y-1",children:m.map((h,g)=>r.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-1.5 text-sm",children:[r.jsx("span",{className:"text-foreground",children:h.description}),r.jsx("kbd",{className:"shrink-0 rounded border border-border/70 bg-muted px-2 py-0.5 font-mono text-xs text-muted-foreground",children:Mv(h.keys)})]},`${p}-${h.keys}-${g}`))})]},p)}),u.length>0?r.jsxs("section",{children:[r.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Custom bindings"}),r.jsx("ul",{className:"space-y-1",children:u.map(p=>r.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-1.5 text-sm",children:[r.jsx("span",{className:"text-foreground",children:p.title}),r.jsx("kbd",{className:"shrink-0 rounded border border-border/70 bg-muted px-2 py-0.5 font-mono text-xs text-muted-foreground",children:Mv(p.combo)})]},`custom-${p.kind}`))})]}):null]})]})})}const Eg={bindings:{},custom:!1};let Rl=null,Fa=null;const gh=new Set;function $k(e){Rl=e;for(const t of gh)t(e)}function Tg(e){if(!e||typeof e!="object")return Eg;const t=e,n={};if(t.bindings&&typeof t.bindings=="object"&&!Array.isArray(t.bindings))for(const[s,a]of Object.entries(t.bindings)){if(!$P(s)||typeof a!="string"||a.trim()==="")continue;const l=rr(a);l&&(n[s]=l)}return{bindings:n,custom:t.custom===!0}}function Y3(){return Rl?Promise.resolve(Rl):Fa||(Fa=fetch("/api/config/hotkeys").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=Tg(e);return Rl=t,Fa=null,t}).catch(()=>(Fa=null,Eg)),Fa)}function J3(){const[e,t]=f.useState(()=>Rl??Eg);return f.useEffect(()=>{let n=!1;return Y3().then(s=>{n||t(s)}),gh.add(t),()=>{n=!0,gh.delete(t)}},[]),e}async function _v(e){const t={};for(const a of _d){const l=e[a];if(typeof l!="string")continue;const c=rr(l);c&&(t[a]=c)}const n=await fetch("/api/config/hotkeys",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({bindings:t})});if(!n.ok){const a=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw new Error(a.error??"Failed to save hotkey bindings")}const s=Tg(await n.json());return $k(s),s}async function X3(){const e=await fetch("/api/config/hotkeys",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=Tg(await e.json());return $k(t),t}const Fv=1500;function Q3(e){const t=e.match(/^\/w\/([^/]+)(?:\/|$)/);return t?`/w/${t[1]}`:""}const Lk=f.createContext(null);function Z3({children:e}){const{toggleTheme:t}=ug(),n=Wn(),s=Dt(),a=Q3(n.pathname),[l,c]=f.useState(!1),u=Jo(l),p=Md(l),m=fg(l),h=dg(l),g=H0(l),y=f.useMemo(()=>{var nt,Ke,gt,Rt;const J=u.data??[],Ie=((nt=p.data)==null?void 0:nt.assignments)??[],Ne=((Ke=m.data)==null?void 0:Ke.playbooks)??[],Oe=((gt=h.data)==null?void 0:gt.sessions)??[],Me=(((Rt=g.data)==null?void 0:Rt.workspaces)??[]).flatMap(at=>at.items.map(ie=>({...ie,workspace:at.workspace})));return KP({projects:J,assignments:Ie,playbooks:Ne,servers:Oe,todos:Me,wsPrefix:a})},[u.data,p.data,m.data,h.data,g.data,a]),E=f.useMemo(()=>T0(n.pathname),[n.pathname]).projectSlug,j=f.useMemo(()=>{var J;return E?((J=u.data)==null?void 0:J.find(Ie=>Ie.slug===E))??null:null},[u.data,E]),w=(j==null?void 0:j.title)??null,k=(j==null?void 0:j.workspace)??null,C=f.useMemo(()=>{var J;return YP({playbooks:((J=m.data)==null?void 0:J.playbooks)??[],projectSlug:E,currentProjectTitle:w,currentProjectWorkspace:k,wsPrefix:a,refetchPlaybooks:m.refetch,navigate:s,toggleTheme:t})},[m.data,m.refetch,E,w,k,a,s,t]),N=f.useRef(new Map),T=f.useRef(["global"]),D=f.useRef({phase:"idle"}),R=f.useRef(null),$=f.useRef(1),[L,K]=f.useState(!1),[B,O]=f.useState(!1),[W,se]=f.useState(!1),[z,H]=f.useState(null);f.useEffect(()=>{(L||W)&&c(!0)},[L,W]);const{bindings:ee}=J3(),ne=f.useMemo(()=>_P(ee),[ee]),M=f.useCallback(J=>{const Ie=$.current++;return N.current.set(Ie,{...J,id:Ie}),Ie},[]),G=f.useCallback(J=>{N.current.delete(J)},[]),A=f.useCallback(J=>{T.current.push(J)},[]),F=f.useCallback(J=>{const Ie=T.current;for(let Ne=Ie.length-1;Ne>=0;Ne--)if(Ie[Ne]===J){Ie.splice(Ne,1);return}},[]),Z=f.useCallback(()=>K(!0),[]),I=f.useCallback(()=>K(!1),[]),de=f.useCallback(()=>O(!0),[]),ge=f.useCallback(()=>O(!1),[]),V=f.useCallback(()=>se(!0),[]),ae=f.useCallback(()=>{se(!1),H(null)},[]),me=f.useCallback(()=>Array.from(N.current.values()),[]),ve=f.useCallback(()=>{let J=null;return H(Ie=>(J=Ie,null)),J},[]),ke=f.useCallback(J=>{H(J),se(!0)},[]),he=f.useCallback((J,Ie)=>{const Ne=rr(J);if(!Ne)return null;if(IP(Ne)){const Oe=W3(Ne);return{description:(Oe==null?void 0:Oe.description)??"Reserved built-in shortcut"}}for(const[Oe,Xe]of Object.entries(ne))if(!(Ie&&Oe===Ie)&&Xe===Ne)return{kind:Oe};return null},[ne]),Je=f.useCallback(async(J,Ie)=>{const Ne=rr(Ie);if(!Ne)throw new Error("Empty combo");const Oe=he(Ne,J);if(Oe){const Me=Oe.description?`Reserved: ${Oe.description}`:`Already bound to "${Oe.kind}"`;throw new Error(Me)}const Xe={...ee,[J]:Ne};return await _v(Xe),Ne},[ee,he]),Ye=f.useCallback(async J=>{if(!ee[J])return;const Ie={...ee};delete Ie[J],await _v(Ie)},[ee]);f.useEffect(()=>{D.current={phase:"idle"},R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[n.pathname]),f.useEffect(()=>{function J(Me){if(!(Me instanceof HTMLElement))return!1;const nt=Me.tagName;return!!(nt==="INPUT"||nt==="TEXTAREA"||nt==="SELECT"||Me.isContentEditable||Me.closest('[role="combobox"], [role="textbox"]'))}function Ie(){return!!(document.querySelector('[role="dialog"][data-state="open"]')||document.querySelector('[role="alertdialog"][data-state="open"]'))}function Ne(){const Me=T.current;return Me[Me.length-1]??"global"}function Oe(Me){return Me.scope==="global"?!0:Me.scope===Ne()}function Xe(Me){const nt=ku(Me,"Mod+k"),Ke=ku(Me,"Mod+Shift+k"),gt=Me.key==="Escape",Rt=nt||Ke||gt;if(Ie()&&!Rt||J(Me.target)&&!Rt)return;const at=D.current;if(at.phase==="awaiting-second")if(Date.now()-at.startedAt>Fv)D.current={phase:"idle"},R.current!==null&&(window.clearTimeout(R.current),R.current=null);else{const pe=Array.from(N.current.values());for(const Q of pe){if(!Oe(Q))continue;const ye=Q.keys.split(" ");if(!(ye.length!==2||ye[0]!=="g")&&ku(Me,ye[1])&&!(Q.when&&!Q.when())){Me.preventDefault(),D.current={phase:"idle"},R.current!==null&&(window.clearTimeout(R.current),R.current=null),Q.handler(Me);return}}D.current={phase:"idle"},R.current!==null&&(window.clearTimeout(R.current),R.current=null)}const ie=Array.from(N.current.values());for(const Y of ie){if(!Oe(Y))continue;const pe=Y.keys.split(" ");if(pe.length===1&&ku(Me,pe[0])&&!(Y.when&&!Y.when())){Me.preventDefault(),Y.handler(Me);return}}Me.key==="g"&&!Me.metaKey&&!Me.ctrlKey&&!Me.altKey&&!Me.shiftKey&&Array.from(N.current.values()).some(pe=>Oe(pe)&&pe.keys.startsWith("g "))&&(Me.preventDefault(),D.current={phase:"awaiting-second",startedAt:Date.now()},R.current!==null&&window.clearTimeout(R.current),R.current=window.setTimeout(()=>{D.current={phase:"idle"},R.current=null},Fv))}return window.addEventListener("keydown",Xe),()=>{window.removeEventListener("keydown",Xe),R.current!==null&&(window.clearTimeout(R.current),R.current=null)}},[]),f.useEffect(()=>{const J=M({keys:"Shift+t",handler:()=>t(),scope:"global",description:"Toggle light/dark theme"});return()=>G(J)},[M,G,t]),f.useEffect(()=>{const J=M({keys:"?",scope:"global",description:"Show keyboard shortcuts",handler:()=>de()});return()=>G(J)},[M,G,de]),f.useEffect(()=>{const J=M({keys:"Mod+k",scope:"global",description:"Open command palette",handler:()=>{if(L){I();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||Z()}});return()=>G(J)},[M,G,Z,I,L]),f.useEffect(()=>{const J=M({keys:"Mod+Shift+k",scope:"global",description:"Open actions palette",handler:()=>{if(W){ae();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||V()}});return()=>G(J)},[M,G,V,ae,W]),f.useEffect(()=>{const Ie=[{suffix:"o",basePath:"/",desc:"Go to Overview"},{suffix:"m",basePath:"/projects",desc:"Go to Projects"},{suffix:"a",basePath:"/assignments",desc:"Go to Assignments"},{suffix:"t",basePath:"/todos",desc:"Go to Todos"},{suffix:"s",basePath:"/servers",desc:"Go to Servers"},{suffix:",",basePath:"/settings",desc:"Go to Settings"}].map(Ne=>M({keys:`g ${Ne.suffix}`,scope:"global",description:Ne.desc,handler:()=>s(Vu(Ne.basePath,a))}));return()=>Ie.forEach(G)},[M,G,s,a]),f.useEffect(()=>{const J=[];for(const[Ie,Ne]of Object.entries(ne)){if(!Ne)continue;const Oe=C.find(Me=>Me.bindableKind===Ie),Xe=Oe?`Custom: ${Oe.title}`:`Custom: ${Ie}`;J.push(M({keys:Ne,scope:"global",description:Xe,handler:()=>{H(Ie),se(!0)}}))}return()=>J.forEach(G)},[M,G,ne,C]);const ot=f.useMemo(()=>({register:M,unregister:G,pushScope:A,popScope:F,openPalette:Z,closePalette:I,paletteOpen:L,openCheatsheet:de,closeCheatsheet:ge,cheatsheetOpen:B,openActionsPalette:V,closeActionsPalette:ae,actionsPaletteOpen:W,listBindings:me,wsPrefix:a,paletteEntries:y,actionEntries:C,userBindings:ee,customBindings:ne,bindAction:Je,unbindAction:Ye,findConflict:he,openActionsPaletteWithAction:ke,pendingActionKind:z,consumePendingActionKind:ve}),[M,G,A,F,Z,I,L,de,ge,B,V,ae,W,me,a,y,C,ee,ne,Je,Ye,he,ke,z,ve]);return r.jsxs(Lk.Provider,{value:ot,children:[e,r.jsx(F3,{entries:y}),r.jsx(V3,{entries:C}),r.jsx(G3,{})]})}function po(){const e=f.useContext(Lk);if(!e)throw new Error("useHotkeyContext must be used within HotkeyProvider");return e}function Ht({keys:e,handler:t,scope:n="global",description:s,when:a,enabled:l=!0}){const{register:c,unregister:u}=po(),p=f.useRef(t),m=f.useRef(a);f.useEffect(()=>{p.current=t,m.current=a},[t,a]),f.useEffect(()=>{if(!l)return;const h=c({keys:e,handler:g=>p.current(g),scope:n,description:s,when:m.current?()=>m.current():void 0});return()=>u(h)},[c,u,e,n,s,l])}function mo(e){const{pushScope:t,popScope:n}=po();f.useEffect(()=>(t(e),()=>n(e)),[t,n,e])}function ac(e,t){const[n,s]=f.useState(e.length===0?-1:0),a=Wn();f.useEffect(()=>{s(e.length===0?-1:0)},[a.pathname]),f.useEffect(()=>{s(c=>e.length===0?-1:Math.min(Math.max(0,c),e.length-1))},[e.length]),f.useEffect(()=>{if(document.querySelectorAll("[data-hotkey-row-index]").forEach(u=>{const p=Number(u.getAttribute("data-hotkey-row-index"));u.setAttribute("data-hotkey-selected",p===n?"true":"false")}),n>=0){const u=document.querySelector(`[data-hotkey-row-index="${n}"]`);u==null||u.scrollIntoView({block:"nearest"})}},[n,e.length]),Ht({keys:"j",scope:t.scope,description:"Select next row",handler:()=>s(c=>e.length===0?-1:Math.min(e.length-1,c<0?0:c+1))}),Ht({keys:"k",scope:t.scope,description:"Select previous row",handler:()=>s(c=>e.length===0?-1:Math.max(0,c<0?0:c-1))}),Ht({keys:"Enter",scope:t.scope,description:"Open selected row",handler:()=>{n>=0&&n<e.length&&t.onOpen(e[n],n)}}),Ht({keys:"o",scope:t.scope,description:"Open selected row",enabled:t.bindO??!0,handler:()=>{n>=0&&n<e.length&&t.onOpen(e[n],n)}});const l=f.useCallback(c=>({"data-hotkey-row-index":c,"data-hotkey-selected":c===n?"true":"false"}),[n]);return{selectedIndex:n,hotkeyRowProps:l}}function eD({title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:s}){const a=ln(),{resolvedTheme:l,toggleTheme:c}=ug(),{openPalette:u}=po();return r.jsx("header",{className:"sticky top-0 z-30 border-b border-border/70 bg-background/70 backdrop-blur",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 lg:px-6",children:[r.jsx("button",{type:"button",onClick:s,className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/70 bg-card/80 text-foreground lg:hidden","aria-label":"Open navigation",children:r.jsx(bR,{className:"h-4 w-4"})}),r.jsx("div",{className:"min-w-0 flex-1",children:r.jsxs("div",{className:"flex items-center gap-2",children:[t.length>1?r.jsxs("nav",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-[0.1em] text-muted-foreground",children:[t.slice(0,-1).map((p,m)=>r.jsxs("span",{className:"flex items-center gap-1.5",children:[m>0?r.jsx("span",{children:"/"}):null,r.jsx(Ee,{to:p.path,className:"hover:text-foreground",children:p.label})]},p.path)),r.jsx("span",{children:"/"})]}):null,r.jsx("h1",{className:"min-w-0 truncate text-base font-semibold text-foreground",children:e})]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{type:"button",onClick:u,className:"shell-action","aria-label":"Open command palette",children:[r.jsx(fo,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline font-mono text-xs",children:ds("Mod+k")})]}),r.jsx(Ee,{className:"shell-action",to:"/help",children:"Help"}),r.jsxs(Ee,{className:"shell-action",to:`${a}/create/project`,children:[r.jsx(rn,{className:"h-4 w-4"}),r.jsx("span",{children:"New Project"})]}),n?r.jsxs(Ee,{className:"shell-action",to:`${a}/projects/${n}/create/assignment`,children:[r.jsx(rn,{className:"h-4 w-4"}),r.jsx("span",{children:"New Assignment"})]}):null,r.jsxs("button",{type:"button",onClick:c,className:"shell-action","aria-label":"Toggle theme",children:[l==="dark"?r.jsx(RR,{className:"h-4 w-4"}):r.jsx(vR,{className:"h-4 w-4"}),r.jsx("span",{children:l==="dark"?"Light":"Dark"})]})]})]})})}const ld="_ungrouped",tD=256;function nD(e){if(!Array.isArray(e))return[];const t=new Set,n=[];for(const s of e){if(typeof s!="string")continue;const a=s.trim();a.length!==0&&(a.length>tD||/[\r\n]/.test(a)||t.has(a)||(t.add(a),n.push(a)))}return n}function rD(e,t){if(t.length===0)return[...e];const n=new Set(t);return e.filter(s=>!n.has(s))}function sD(e,t){return t.includes(e)}const Rg={hidden:[],custom:!1};let Ps=null,Mo=null,Bl=0;const xh=new Set;function Ok(e){Ps=e;for(const t of xh)t(e)}function Pg(e){if(!e||typeof e!="object")return Rg;const t=e;return{hidden:nD(t.hidden),custom:t.custom===!0}}function oD(){if(Ps)return Promise.resolve({value:Ps,ok:!0});if(Mo)return Mo;const e=++Bl;return Mo=fetch("/api/config/workspace-visibility").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{Mo=null;const n=Pg(t);return e!==Bl?{value:Ps??n,ok:!0}:(Ps=n,{value:n,ok:!0})}).catch(()=>(Mo=null,{value:Rg,ok:!1})),Mo}function Ik(){const[e,t]=f.useState(()=>Ps??Rg),[n,s]=f.useState(()=>Ps===null),[a,l]=f.useState(!1),[c,u]=f.useState(0);f.useEffect(()=>{let m=!1;return s(Ps===null),oD().then(h=>{m||(t(h.value),s(!1),l(!h.ok))}),xh.add(t),()=>{m=!0,xh.delete(t)}},[c]);function p(){aD(),u(m=>m+1)}return{...e,loading:n,error:a,reload:p}}function aD(){Ps=null,Mo=null,++Bl}async function iD(e){++Bl;const t=await fetch("/api/config/workspace-visibility",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hidden:e})});if(!t.ok){const s=await t.json().catch(()=>null);throw new Error((s==null?void 0:s.error)??`HTTP ${t.status}`)}const n=Pg(await t.json());return Ok(n),n}async function lD(){++Bl;const e=await fetch("/api/config/workspace-visibility",{method:"DELETE"});if(!e.ok){const n=await e.json().catch(()=>null);throw new Error((n==null?void 0:n.error)??`HTTP ${e.status}`)}const t=Pg(await e.json());return Ok(t),t}var cD=Symbol("radix.slottable");function uD(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=cD,t}var Mk="AlertDialog",[dD]=Xo(Mk,[pk]),Os=pk(),_k=e=>{const{__scopeAlertDialog:t,...n}=e,s=Os(t);return r.jsx(Rk,{...s,...n,modal:!0})};_k.displayName=Mk;var fD="AlertDialogTrigger",pD=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=Os(n);return r.jsx(Pk,{...a,...s,ref:t})});pD.displayName=fD;var mD="AlertDialogPortal",Fk=e=>{const{__scopeAlertDialog:t,...n}=e,s=Os(t);return r.jsx(Ak,{...s,...n})};Fk.displayName=mD;var hD="AlertDialogOverlay",zk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=Os(n);return r.jsx(wg,{...a,...s,ref:t})});zk.displayName=hD;var si="AlertDialogContent",[gD,xD]=dD(si),yD=uD("AlertDialogContent"),Bk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:s,...a}=e,l=Os(n),c=f.useRef(null),u=Fn(t,c),p=f.useRef(null);return r.jsx(R3,{contentName:si,titleName:Uk,docsSlug:"alert-dialog",children:r.jsx(gD,{scope:n,cancelRef:p,children:r.jsxs(jg,{role:"alertdialog",...l,...a,ref:u,onOpenAutoFocus:qt(a.onOpenAutoFocus,m=>{var h;m.preventDefault(),(h=p.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[r.jsx(yD,{children:s}),r.jsx(vD,{contentRef:c})]})})})});Bk.displayName=si;var Uk="AlertDialogTitle",Vk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=Os(n);return r.jsx(kg,{...a,...s,ref:t})});Vk.displayName=Uk;var Hk="AlertDialogDescription",Wk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=Os(n);return r.jsx(Sg,{...a,...s,ref:t})});Wk.displayName=Hk;var bD="AlertDialogAction",Kk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=Os(n);return r.jsx(Ng,{...a,...s,ref:t})});Kk.displayName=bD;var qk="AlertDialogCancel",Gk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:a}=xD(qk,n),l=Os(n),c=Fn(t,a);return r.jsx(Ng,{...l,...s,ref:c})});Gk.displayName=qk;var vD=({contentRef:e})=>{const t=`\`${si}\` requires a description for the component to be accessible for screen reader users.
|
|
525
|
-
|
|
526
|
-
You can add a description to the \`${si}\` by passing a \`${Hk}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
527
|
-
|
|
528
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${si}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
529
|
-
|
|
530
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return f.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},wD=_k,jD=Fk,Yk=zk,Jk=Bk,Xk=Kk,Qk=Gk,Zk=Vk,e1=Wk;const Ga=wD,kD=jD,t1=f.forwardRef(({className:e,...t},n)=>r.jsx(Yk,{ref:n,className:Se("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));t1.displayName=Yk.displayName;const Bo=f.forwardRef(({className:e,...t},n)=>r.jsxs(kD,{children:[r.jsx(t1,{}),r.jsx(Jk,{ref:n,className:Se("chrome-card fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 !p-6 outline-none",e),...t})]}));Bo.displayName=Jk.displayName;function Ya({className:e,...t}){return r.jsx("div",{className:Se("flex flex-col space-y-2 text-left",e),...t})}function Ja({className:e,...t}){return r.jsx("div",{className:Se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const Uo=f.forwardRef(({className:e,...t},n)=>r.jsx(Zk,{ref:n,className:Se("text-lg font-semibold tracking-tight text-foreground",e),...t}));Uo.displayName=Zk.displayName;const Vo=f.forwardRef(({className:e,...t},n)=>r.jsx(e1,{ref:n,className:Se("text-sm leading-6 text-muted-foreground",e),...t}));Vo.displayName=e1.displayName;const oo=f.forwardRef(({className:e,...t},n)=>r.jsx(Xk,{ref:n,className:Se(e),...t}));oo.displayName=Xk.displayName;const Ul=f.forwardRef(({className:e,...t},n)=>r.jsx(Qk,{ref:n,className:Se(e),...t}));Ul.displayName=Qk.displayName;const SD=[{to:"/",label:"Overview",icon:u0},{to:"/playbooks",label:"Playbooks",icon:i0},{to:"/memories",label:"Memories",icon:ZT},{to:"/resources",label:"Resources",icon:mR},{to:"/inventories",label:"Inventories",icon:Ld},{to:"/usage",label:"Usage",icon:Od},{to:"/todos",label:"Todos",icon:Dr},{to:"/views",label:"Saved Views",icon:p0},{to:"/archive",label:"Archive",icon:Dd}],ND=[{suffix:"/projects",label:"Projects",icon:eg},{suffix:"/assignments",label:"Assignments",icon:xR},{suffix:"/servers",label:"Servers",icon:sg},{suffix:"/inventories",label:"Inventories",icon:Ld},{suffix:"/usage",label:"Usage",icon:Od},{suffix:"/agent-sessions",label:"Agent Sessions",icon:Ad},{suffix:"/todos",label:"Todos",icon:Dr}],CD=[{to:"/help",label:"Help",icon:hR},{to:"/settings",label:"Settings",icon:ER}];function ED({title:e,breadcrumbs:t,projectSlug:n,workspace:s,children:a}){const[l,c]=f.useState(!1);return Ht({keys:"Escape",scope:"global",description:"Close mobile navigation",enabled:l,handler:()=>c(!1)}),r.jsx("div",{className:"min-h-screen bg-background",children:r.jsxs("div",{className:"relative grid min-h-screen lg:grid-cols-[240px_minmax(0,1fr)]",children:[r.jsx("aside",{className:"hidden max-h-screen sticky top-0 overflow-y-auto border-r border-border/70 bg-sidebar px-4 py-4 lg:flex lg:flex-col",children:r.jsx(zv,{activeWorkspace:s})}),l?r.jsx("div",{className:"fixed inset-0 z-40 bg-overlay/40 lg:hidden",children:r.jsxs("div",{className:"h-full max-w-xs border-r border-border/70 bg-sidebar p-4 shadow-2xl",children:[r.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[r.jsx(Ee,{to:"/",className:"text-lg font-semibold text-foreground",onClick:()=>c(!1),children:"Syntaur"}),r.jsx("button",{type:"button",onClick:()=>c(!1),className:"inline-flex h-9 w-9 items-center justify-center rounded-md border border-border/70 bg-background/80",children:r.jsx(ig,{className:"h-4 w-4"})})]}),r.jsx(zv,{activeWorkspace:s,onNavigate:()=>c(!1)})]})}):null,r.jsxs("div",{className:"min-w-0",children:[r.jsx(eD,{title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:()=>c(!0)}),r.jsx("main",{className:"mx-auto w-full max-w-[1480px] px-4 py-4 lg:px-6 lg:py-5",children:a})]})]})})}function zv({activeWorkspace:e,onNavigate:t}){const{data:n}=oc(),s=(n==null?void 0:n.workspaces)??[],a=(n==null?void 0:n.hasUngrouped)??!1,{hidden:l}=Ik(),c=Wn(),[u,p]=f.useState(new Set),[m,h]=f.useState(!1),[g,y]=f.useState(""),[b,E]=f.useState(null),[j,w]=f.useState(null),[k,C]=f.useState(null),[N,T]=f.useState(!1),D=Dt();function R(B){p(O=>{const W=new Set(O);return W.has(B)?W.delete(B):W.add(B),W})}const $=rD([...s,...a?[ld]:[]],l);async function L(B){if(j){T(!0);try{const O=`/api/workspaces/${encodeURIComponent(j)}${B?"?cascade=true":""}`,W=await fetch(O,{method:"DELETE"});if(W.status===409){const se=await W.json().catch(()=>({}));C((se==null?void 0:se.blockedBy)??{projects:[],standalones:[]});return}if(!W.ok){const se=await W.json().catch(()=>({}));throw new Error(se.error||"Failed to delete workspace")}w(null),C(null)}catch(O){console.error(O),alert(O instanceof Error?O.message:"Failed to delete workspace")}finally{T(!1)}}}async function K(B,O){try{if(B.type==="project"){const W=await fetch(`/api/projects/${encodeURIComponent(B.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:O})});if(!W.ok){const se=await W.json().catch(()=>({}));throw new Error(se.error||"Failed to move project")}return}if(B.type==="standalone-assignment"){const W=await fetch(`/api/assignments/${encodeURIComponent(B.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:O})});if(!W.ok){const se=await W.json().catch(()=>({}));throw new Error(se.error||"Failed to move assignment")}return}if(B.type==="project-assignment"){alert("Assignments inherit workspace from their project — drag the project (or move it) to change workspaces.");return}}catch(W){console.error(W),alert(W instanceof Error?W.message:"Failed to move item")}}return r.jsxs("div",{className:"flex h-full flex-col gap-3",children:[r.jsx("div",{className:"space-y-3",children:r.jsxs(Ee,{to:"/",className:"inline-flex items-center gap-3",onClick:t,children:[r.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-lg bg-card text-foreground shadow-sm ring-1 ring-border/60",children:r.jsxs("svg",{viewBox:"0 0 43 51","aria-label":"Syntaur",role:"img",className:"h-4 w-auto",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("path",{d:"M13 2C13 0.89543 13.8954 0 15 0H41C42.1046 0 43 0.895431 43 2V12C43 13.1046 42.1046 14 41 14H13V2Z"}),r.jsx("path",{d:"M0 15C0 13.8954 0.895431 13 2 13H14V25C14 26.1046 13.1046 27 12 27H2C0.89543 27 0 26.1046 0 25V15Z"}),r.jsx("path",{d:"M30 49C30 50.1046 29.1046 51 28 51L2 51C0.89543 51 0 50.1046 0 49L0 39C0 37.8954 0.895431 37 2 37L30 37L30 49Z"}),r.jsx("path",{d:"M42.9646 36C42.9646 37.1046 42.0692 38 40.9646 38H28.9646V26C28.9646 24.8954 29.86 24 30.9646 24H40.9646C42.0692 24 42.9646 24.8954 42.9646 26V36Z"})]})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Syntaur"}),r.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Local-first project control"})]})]})}),r.jsx(vv,{items:SD,onNavigate:t}),r.jsx("div",{className:"border-t border-border/40"}),r.jsxs("div",{className:"flex-1 space-y-1 overflow-y-auto",children:[$.length===0&&!m&&r.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground/60",children:"No workspaces yet"}),$.map(B=>{const O=B==="_ungrouped",W=O?"Ungrouped":yn(B),se=O?"/w/_ungrouped":`/w/${B}`,z=u.has(B),H=e===B||e===null&&O&&c.pathname.startsWith("/w/_ungrouped"),ee=b===B;return r.jsxs("div",{className:`rounded-md transition ${ee?"bg-accent/40 ring-1 ring-ring/40":""}`,onDragOver:ne=>{ne.dataTransfer.types.includes("application/json")&&(ne.preventDefault(),ne.dataTransfer.dropEffect="move",E(B))},onDragLeave:ne=>{ne.currentTarget.contains(ne.relatedTarget)||E(M=>M===B?null:M)},onDrop:async ne=>{try{const M=ne.dataTransfer.getData("application/json");if(!M)return;ne.preventDefault();let G;try{G=JSON.parse(M)}catch{return}if(!(G!=null&&G.type)||!(G!=null&&G.id))return;await K(G,O?null:B)}finally{E(null)}},children:[r.jsxs("div",{className:"group flex items-center",children:[r.jsxs("button",{type:"button",onClick:()=>R(B),className:`flex flex-1 items-center gap-2 rounded-md px-3 py-1.5 text-xs font-semibold uppercase tracking-wider transition ${H?"text-foreground":"text-muted-foreground/70 hover:text-muted-foreground"}`,children:[r.jsx(br,{className:`h-3 w-3 transition-transform ${z?"-rotate-90":""}`}),W]}),O?null:r.jsx("button",{type:"button",onClick:ne=>{ne.stopPropagation(),w(B),C(null)},title:`Delete workspace "${B}"`,"aria-label":`Delete workspace "${B}"`,className:"mr-1 flex h-6 w-6 items-center justify-center rounded text-muted-foreground/60 opacity-0 transition hover:bg-destructive/10 hover:text-destructive focus-visible:opacity-100 group-hover:opacity-100",children:r.jsx(or,{className:"h-3 w-3"})})]}),!z&&r.jsx("nav",{className:"ml-2 space-y-0.5",children:ND.map(ne=>{const M=`${se}${ne.suffix}`,G=E0(c.pathname,ne.suffix)&&c.pathname.startsWith(se),A=ne.icon;return r.jsxs(Ee,{to:M,onClick:t,className:`flex items-center gap-3 rounded-md px-3 py-1.5 text-sm font-medium transition ${G?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-background/80 hover:text-foreground"}`,children:[r.jsx(A,{className:"h-4 w-4"}),r.jsx("span",{children:ne.label})]},M)})})]},B)}),m?r.jsx("form",{className:"px-3 py-1.5",onSubmit:B=>{B.preventDefault();const O=g.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");O&&(h(!1),y(""),fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:O})}).then(()=>{t==null||t(),D(`/w/${O}/projects`)}))},children:r.jsx("input",{autoFocus:!0,type:"text",value:g,onChange:B=>y(B.target.value),onKeyDown:B=>{B.key==="Escape"&&(h(!1),y(""))},onBlur:()=>{g.trim()||(h(!1),y(""))},placeholder:"workspace-name",className:"w-full rounded-md border border-border/60 bg-background/80 px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-foreground/40 focus:outline-none"})}):r.jsxs("button",{type:"button",onClick:()=>h(!0),className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs font-medium text-muted-foreground/60 transition hover:text-muted-foreground",children:[r.jsx(rn,{className:"h-3 w-3"}),"New Workspace"]})]}),r.jsx("div",{className:"border-t border-border/40"}),r.jsx(vv,{items:CD,onNavigate:t}),r.jsx(Ga,{open:j!==null,onOpenChange:B=>{N||B||(w(null),C(null))},children:r.jsxs(Bo,{children:[r.jsxs(Ya,{children:[r.jsx(Uo,{children:k?"Workspace has references":"Delete workspace?"}),r.jsx(Vo,{children:k?r.jsxs(r.Fragment,{children:["The workspace ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:j})," is still referenced by:"]}):r.jsxs(r.Fragment,{children:["Remove the workspace ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:j})," from the registry. This does not affect projects or standalones unless you choose to cascade."]})})]}),k?r.jsxs("div",{className:"space-y-2 text-sm",children:[k.projects.length>0?r.jsxs("div",{children:[r.jsxs("p",{className:"font-medium text-foreground",children:["Projects (",k.projects.length,")"]}),r.jsx("ul",{className:"mt-1 list-disc pl-5 text-muted-foreground",children:k.projects.map(B=>r.jsx("li",{children:r.jsx(Ee,{to:`/projects/${B}`,className:"hover:underline",children:B})},B))})]}):null,k.standalones.length>0?r.jsxs("div",{children:[r.jsxs("p",{className:"font-medium text-foreground",children:["Standalones (",k.standalones.length,")"]}),r.jsx("ul",{className:"mt-1 list-disc pl-5 text-muted-foreground",children:k.standalones.map(B=>r.jsx("li",{children:r.jsx(Ee,{to:`/assignments/${B}`,className:"hover:underline",children:B})},B))})]}):null,r.jsxs("p",{className:"text-xs text-muted-foreground",children:['Choose "Clear references and delete" to set ',r.jsx("code",{children:"workspace:"})," / ",r.jsx("code",{children:"workspaceGroup:"})," to ",r.jsx("code",{children:"null"})," on each, then remove the workspace."]})]}):null,r.jsxs(Ja,{children:[r.jsx(Ul,{disabled:N,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),k?r.jsx(oo,{disabled:N,onClick:B=>{B.preventDefault(),L(!0)},className:"shell-action mt-0 border-destructive/80 bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:cursor-not-allowed disabled:opacity-50",children:N?"Working…":"Clear references and delete"}):r.jsx(oo,{disabled:N,onClick:B=>{B.preventDefault(),L(!1)},className:"shell-action mt-0 border-destructive/80 bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:cursor-not-allowed disabled:opacity-50",children:N?"Working…":"Delete"})]})]})})]})}function TD(){const e=Wn(),{workspace:t}=$t(),{title:n,breadcrumbs:s,projectSlug:a}=T0(e.pathname);return r.jsx(ED,{title:n,breadcrumbs:s,projectSlug:a,workspace:t??null,children:r.jsx(dT,{})})}function mt({label:e="Loading dashboard data…"}){return r.jsx("div",{className:"flex min-h-[240px] items-center justify-center",children:r.jsx("div",{className:"chrome-card !px-4 !py-3",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:e})})})}function wt({title:e="Something went wrong",error:t,action:n}){return r.jsx("div",{className:"rounded-lg border border-error-foreground/30 bg-error px-4 py-5",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"text-lg font-semibold text-error-foreground",children:e}),r.jsx("p",{className:"text-sm leading-6 text-error-foreground/90",children:t}),n?r.jsx("div",{className:"pt-2",children:n}):null]})})}function qu({command:e,description:t,example:n}){return r.jsxs("div",{className:"rounded-lg border border-border/70 bg-code px-3 py-3 text-code-foreground shadow-sm",children:[r.jsx("code",{className:"block overflow-x-auto font-mono text-sm",children:e}),t?r.jsx("p",{className:"mt-2 text-sm text-code-foreground/80",children:t}):null,n?r.jsx("p",{className:"mt-2 font-mono text-xs text-code-foreground/60",children:n}):null]})}function We({title:e,description:t,children:n,className:s,actions:a}){return r.jsxs("section",{className:Se("surface-panel space-y-3",s),children:[e||a?r.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[e?r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e}):null,t?r.jsx("p",{className:"text-sm text-muted-foreground",children:t}):null]}),a]}):null,n]})}function RD({help:e,compact:t=!1}){const n=t?(e==null?void 0:e.firstProjectChecklist.slice(0,3))??[]:(e==null?void 0:e.firstProjectChecklist)??[];return r.jsx(We,{title:t?"Getting Started Refresher":"Getting Started",description:t?"A fast reminder of the real flow for creating and running work in Syntaur.":"A first-run checklist that maps to the current CLI and dashboard flow.",actions:r.jsx(Ee,{className:"text-sm font-semibold text-primary hover:underline",to:"/help",children:"Open full help"}),children:r.jsx("div",{className:"space-y-3",children:n.map((s,a)=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full bg-foreground text-xs font-semibold text-background",children:a+1}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:s.title}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:s.detail}),s.command?r.jsx(qu,{command:s.command.command,example:s.command.example}):null]})]})},s.title))})})}const jm={review:"{total} items ready for your review","review.singular":"Review {title}",ready_to_implement:"{total} plans ready to implement — start with {title}","ready_to_implement.singular":"Start implementing {title}",ready_for_planning:"{total} assignments ready to plan — start with {title}","ready_for_planning.singular":"Plan {title}",in_progress:"Resume {title} ({total} in progress)","in_progress.singular":"Resume {title}",draft:"Shape your {total} drafts — start with {title}","draft.singular":"Shape {title}",blocked:"Unblock {title} ({total} blocked)","blocked.singular":"Unblock {title}",stale:"Triage {total} stale items","stale.singular":"Triage {title} — sitting stale",clean:"You’re all clear. Nothing needs you right now."},Ho={emptyStateCleanTitle:"You’re all clear",emptyStateCleanCTA:"Browse projects",recentSessionsEmptyTitle:"No recent sessions",recentSessionsEmptyHint:"Use /grab-assignment or `syntaur track-session` to register one.",recentSessionsCopyPathLabel:"Copy path",recentSessionsCopyPathDisabled:"Session has no path",recentSessionsCopyFallbackHint:"Press ⌘C to copy"};function PD(e,t){return e.replace(/\{(\w+)\}/g,(n,s)=>String(t[s]??`{${s}}`))}function AD({hero:e,itemsById:t}){const n=ln();if(e.kind==="clean")return r.jsxs("section",{"aria-labelledby":"overview-hero-title",className:"rounded-xl border border-border/60 bg-background/60 p-6 shadow-sm",children:[r.jsx("p",{className:"eyebrow",children:Ho.emptyStateCleanTitle}),r.jsx("h2",{id:"overview-hero-title",className:"mt-2 text-2xl font-semibold tracking-tight text-foreground",children:jm.clean}),r.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"When work shows up — a draft, a review, a stale row — it’ll surface here."}),r.jsx("div",{className:"mt-4",children:r.jsx(Ee,{to:`${n}/projects`,className:"shell-action shell-action--cta",children:Ho.emptyStateCleanCTA})})]});const s=e.itemId?t[e.itemId]:void 0,a=(s==null?void 0:s.assignmentTitle)??"",l=jm[e.copyKey]??jm[e.kind],c=PD(l,{total:e.total,title:a}),u=s?DD(s,n):`${n}/assignments`;return r.jsxs("section",{"aria-labelledby":"overview-hero-title",className:"rounded-xl border border-primary/20 bg-primary/5 p-6 shadow-sm",children:[r.jsx("p",{className:"eyebrow",children:"What needs you today"}),r.jsx("h2",{id:"overview-hero-title",className:"mt-2 text-2xl font-semibold tracking-tight text-foreground",children:c}),s?r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["In ",r.jsx("span",{className:"font-medium text-foreground",children:s.projectTitle??"Standalone"})," ","· status ",r.jsx("span",{className:"font-medium text-foreground",children:s.status})]}):null,r.jsx("div",{className:"mt-4",children:r.jsxs(Ee,{to:u,className:"shell-action shell-action--cta",children:["Open ",a||"assignment"]})})]})}function DD(e,t){return e.projectSlug?`${t}${e.href}`:e.href}const Ag=["kanban","list","table"],n1=["title","status","priority","assignee","dependencies","created","updated"],$D=["asc","desc"],LD=["comfortable","compact"],OD=["none","status","type","priority","assignee","project"],ID=["last_24h","last_7d","last_30d","last_90d","older_7d","older_30d"];function tt(e){const t=e===void 0?[]:Array.isArray(e)?e:[e],n=[];for(const s of t){if(typeof s!="string")continue;const a=s.trim();!a||a==="all"||n.includes(a)||n.push(a)}return n}function MD(e,t){const n=tt(e),s=tt(t);return n.length===s.length&&n.every(a=>s.includes(a))}const _D={defaultView:"kanban",sortField:"updated",sortDirection:"desc",density:"comfortable",grouping:"none",filters:{status:"all",type:"all",priority:"all",assignee:"all",project:"all",activity:"all"}},Vl={version:1,global:_D,projects:{}};function km(e){return e==="table"?"table":"kanban"}function FD(e,t){return t?{...e,...t}:{...e}}function r1(e,t){const n=e.global;if(t===null)return n;const s=e.projects[t];return s?{defaultView:s.defaultView??n.defaultView,sortField:s.sortField??n.sortField,sortDirection:s.sortDirection??n.sortDirection,density:n.density,grouping:s.grouping??n.grouping,filters:FD(n.filters,s.filters)}:n}const Sm=["title","status","priority","assignee","dependencies","created","updated"],zD=["small","wide","tall","large"],BD={status:"all",priority:"all",assignee:"all",project:"all",activity:"all"},Bv="2026-05-21T00:00:00Z";function Nm(e,t,n){return{id:e,name:t,workspace:null,config:{viewMode:"list",filters:{...BD,...n},sortField:"updated",sortDirection:"desc",listSectionVisibility:{collapsed:[]},kanbanColumnVisibility:{hidden:[]},tableColumnVisibility:{hidden:[]}},createdAt:Bv,updatedAt:Bv}}const ao={version:1,views:[Nm("default-recently-updated","Recently updated",{}),Nm("default-high-priority","High priority",{priority:"high"}),Nm("default-stale","Stale",{activity:"stale"})],dashboard:{version:1,slots:[{id:"slot-0",widget:{kind:"agent-sessions"}},{id:"slot-1",widget:{kind:"saved-view",viewId:"default-recently-updated"}},{id:"slot-2",widget:{kind:"saved-view",viewId:"default-high-priority"}},{id:"slot-3",widget:{kind:"saved-view",viewId:"default-stale"}},{id:"slot-4",widget:{kind:"inventories"}}]}};function s1(e,t){const n=tt(e.filters.project),s=n.length===0||n.length===1&&n[0]===t,a=e.filters.activity,l=typeof e.filters.search=="string"&&e.filters.search.trim().length>0;return s&&(!a||a==="all")&&!l}function o1(e,t){switch(t.kind){case"global":return e.workspace===null;case"workspace":return e.workspace===t.workspace||e.workspace===null;case"project":return e.workspace===t.workspace||e.workspace===null?s1(e.config,t.slug):!1}}const a1=`syntaur.savedViews.cache.v${ao.version}`;let oi=UD(),_o=null,Dg=null;const yh=new Set,cd=new Set;let i1=0;function l1(){return++i1}function bh(e){return e===i1}function UD(){if(typeof window>"u"||!window.localStorage)return null;try{const e=window.localStorage.getItem(a1);if(!e)return null;const t=JSON.parse(e);return t.version!==ao.version?null:t}catch{return null}}function VD(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(a1,JSON.stringify(e))}catch{}}function c1(e){oi=e,Dg=null,VD(e);for(const t of yh)t(e);for(const t of cd)t(null)}function HD(e){Dg=e;for(const t of cd)t(e)}function u1(e){if(!e||typeof e!="object")return ao;const t=e;return t.version!==ao.version||!Array.isArray(t.views)||!t.dashboard?ao:t}function Uv(){if(_o)return _o;const e=l1();return _o=fetch("/api/saved-views").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{const n=u1(t);return bh(e)&&c1(n),_o=null,oi??n}).catch(t=>{const n=t instanceof Error?t:new Error(String(t));return bh(e)&&HD(n),_o=null,oi??ao}),_o}function $g(){const[e,t]=f.useState(()=>oi??ao),[n,s]=f.useState(()=>oi===null),[a,l]=f.useState(!1),[c,u]=f.useState(()=>Dg);return f.useEffect(()=>{let m=!1;oi===null&&s(!0),Uv().then(y=>{m||(t(y),s(!1),l(!0))});const h=y=>{m||(t(y),s(!1),l(!0),u(null))},g=y=>{m||(u(y),s(!1),l(!0))};return yh.add(h),cd.add(g),()=>{m=!0,yh.delete(h),cd.delete(g)}},[]),{file:e,loading:n,ready:a,error:c,refetch:()=>{_o=null,s(!0),u(null),l(!1),Uv()}}}function Vd(){const{file:e,loading:t}=$g();return{views:e.views,loading:t}}function WD(){const{file:e,loading:t}=$g();return{layout:e.dashboard,loading:t}}function Go(e){const{file:t,loading:n,ready:s,error:a,refetch:l}=$g();return e?{view:t.views.find(u=>u.id===e)??null,loading:n,ready:s,error:a,refetch:l}:{view:null,loading:!1,ready:!0,error:null,refetch:l}}async function Hd(e,t,n){const s=l1(),a=await fetch(t,{method:e,headers:n!==void 0?{"Content-Type":"application/json"}:void 0,body:n!==void 0?JSON.stringify(n):void 0});if(!a.ok){const c=await a.json().catch(()=>({error:`HTTP ${a.status}`}));throw new Error(c.error??`HTTP ${a.status}`)}const l=u1(await a.json());return bh(s)&&c1(l),l}function Wd(e){return Hd("POST","/api/saved-views",e)}function Lg(e,t){return Hd("PATCH",`/api/saved-views/${encodeURIComponent(e)}`,t)}function KD(e){return Hd("DELETE",`/api/saved-views/${encodeURIComponent(e)}`)}function qD(e){return Hd("PUT","/api/dashboard",{slots:e})}const GD=["top","right","bottom","left"],co=Math.min,hr=Math.max,ud=Math.round,Ru=Math.floor,fs=e=>({x:e,y:e}),YD={left:"right",right:"left",bottom:"top",top:"bottom"};function vh(e,t,n){return hr(e,co(t,n))}function Ds(e,t){return typeof e=="function"?e(t):e}function $s(e){return e.split("-")[0]}function wi(e){return e.split("-")[1]}function Og(e){return e==="x"?"y":"x"}function Ig(e){return e==="y"?"height":"width"}function cs(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Mg(e){return Og(cs(e))}function JD(e,t,n){n===void 0&&(n=!1);const s=wi(e),a=Mg(e),l=Ig(a);let c=a==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=dd(c)),[c,dd(c)]}function XD(e){const t=dd(e);return[wh(e),t,wh(t)]}function wh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Vv=["left","right"],Hv=["right","left"],QD=["top","bottom"],ZD=["bottom","top"];function e4(e,t,n){switch(e){case"top":case"bottom":return n?t?Hv:Vv:t?Vv:Hv;case"left":case"right":return t?QD:ZD;default:return[]}}function t4(e,t,n,s){const a=wi(e);let l=e4($s(e),n==="start",s);return a&&(l=l.map(c=>c+"-"+a),t&&(l=l.concat(l.map(wh)))),l}function dd(e){const t=$s(e);return YD[t]+e.slice(t.length)}function n4(e){return{top:0,right:0,bottom:0,left:0,...e}}function d1(e){return typeof e!="number"?n4(e):{top:e,right:e,bottom:e,left:e}}function fd(e){const{x:t,y:n,width:s,height:a}=e;return{width:s,height:a,top:n,left:t,right:t+s,bottom:n+a,x:t,y:n}}function Wv(e,t,n){let{reference:s,floating:a}=e;const l=cs(t),c=Mg(t),u=Ig(c),p=$s(t),m=l==="y",h=s.x+s.width/2-a.width/2,g=s.y+s.height/2-a.height/2,y=s[u]/2-a[u]/2;let b;switch(p){case"top":b={x:h,y:s.y-a.height};break;case"bottom":b={x:h,y:s.y+s.height};break;case"right":b={x:s.x+s.width,y:g};break;case"left":b={x:s.x-a.width,y:g};break;default:b={x:s.x,y:s.y}}switch(wi(t)){case"start":b[c]-=y*(n&&m?-1:1);break;case"end":b[c]+=y*(n&&m?-1:1);break}return b}async function r4(e,t){var n;t===void 0&&(t={});const{x:s,y:a,platform:l,rects:c,elements:u,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:h="viewport",elementContext:g="floating",altBoundary:y=!1,padding:b=0}=Ds(t,e),E=d1(b),w=u[y?g==="floating"?"reference":"floating":g],k=fd(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(w)))==null||n?w:w.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(u.floating)),boundary:m,rootBoundary:h,strategy:p})),C=g==="floating"?{x:s,y:a,width:c.floating.width,height:c.floating.height}:c.reference,N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u.floating)),T=await(l.isElement==null?void 0:l.isElement(N))?await(l.getScale==null?void 0:l.getScale(N))||{x:1,y:1}:{x:1,y:1},D=fd(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:C,offsetParent:N,strategy:p}):C);return{top:(k.top-D.top+E.top)/T.y,bottom:(D.bottom-k.bottom+E.bottom)/T.y,left:(k.left-D.left+E.left)/T.x,right:(D.right-k.right+E.right)/T.x}}const s4=50,o4=async(e,t,n)=>{const{placement:s="bottom",strategy:a="absolute",middleware:l=[],platform:c}=n,u=c.detectOverflow?c:{...c,detectOverflow:r4},p=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:g}=Wv(m,s,p),y=s,b=0;const E={};for(let j=0;j<l.length;j++){const w=l[j];if(!w)continue;const{name:k,fn:C}=w,{x:N,y:T,data:D,reset:R}=await C({x:h,y:g,initialPlacement:s,placement:y,strategy:a,middlewareData:E,rects:m,platform:u,elements:{reference:e,floating:t}});h=N??h,g=T??g,E[k]={...E[k],...D},R&&b<s4&&(b++,typeof R=="object"&&(R.placement&&(y=R.placement),R.rects&&(m=R.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):R.rects),{x:h,y:g}=Wv(m,y,p)),j=-1)}return{x:h,y:g,placement:y,strategy:a,middlewareData:E}},a4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:a,rects:l,platform:c,elements:u,middlewareData:p}=t,{element:m,padding:h=0}=Ds(e,t)||{};if(m==null)return{};const g=d1(h),y={x:n,y:s},b=Mg(a),E=Ig(b),j=await c.getDimensions(m),w=b==="y",k=w?"top":"left",C=w?"bottom":"right",N=w?"clientHeight":"clientWidth",T=l.reference[E]+l.reference[b]-y[b]-l.floating[E],D=y[b]-l.reference[b],R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let $=R?R[N]:0;(!$||!await(c.isElement==null?void 0:c.isElement(R)))&&($=u.floating[N]||l.floating[E]);const L=T/2-D/2,K=$/2-j[E]/2-1,B=co(g[k],K),O=co(g[C],K),W=B,se=$-j[E]-O,z=$/2-j[E]/2+L,H=vh(W,z,se),ee=!p.arrow&&wi(a)!=null&&z!==H&&l.reference[E]/2-(z<W?B:O)-j[E]/2<0,ne=ee?z<W?z-W:z-se:0;return{[b]:y[b]+ne,data:{[b]:H,centerOffset:z-H-ne,...ee&&{alignmentOffset:ne}},reset:ee}}}),i4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:a,middlewareData:l,rects:c,initialPlacement:u,platform:p,elements:m}=t,{mainAxis:h=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:j=!0,...w}=Ds(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const k=$s(a),C=cs(u),N=$s(u)===u,T=await(p.isRTL==null?void 0:p.isRTL(m.floating)),D=y||(N||!j?[dd(u)]:XD(u)),R=E!=="none";!y&&R&&D.push(...t4(u,j,E,T));const $=[u,...D],L=await p.detectOverflow(t,w),K=[];let B=((s=l.flip)==null?void 0:s.overflows)||[];if(h&&K.push(L[k]),g){const z=JD(a,c,T);K.push(L[z[0]],L[z[1]])}if(B=[...B,{placement:a,overflows:K}],!K.every(z=>z<=0)){var O,W;const z=(((O=l.flip)==null?void 0:O.index)||0)+1,H=$[z];if(H&&(!(g==="alignment"?C!==cs(H):!1)||B.every(M=>cs(M.placement)===C?M.overflows[0]>0:!0)))return{data:{index:z,overflows:B},reset:{placement:H}};let ee=(W=B.filter(ne=>ne.overflows[0]<=0).sort((ne,M)=>ne.overflows[1]-M.overflows[1])[0])==null?void 0:W.placement;if(!ee)switch(b){case"bestFit":{var se;const ne=(se=B.filter(M=>{if(R){const G=cs(M.placement);return G===C||G==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(G=>G>0).reduce((G,A)=>G+A,0)]).sort((M,G)=>M[1]-G[1])[0])==null?void 0:se[0];ne&&(ee=ne);break}case"initialPlacement":ee=u;break}if(a!==ee)return{reset:{placement:ee}}}return{}}}};function Kv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qv(e){return GD.some(t=>e[t]>=0)}const l4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:a="referenceHidden",...l}=Ds(e,t);switch(a){case"referenceHidden":{const c=await s.detectOverflow(t,{...l,elementContext:"reference"}),u=Kv(c,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:qv(u)}}}case"escaped":{const c=await s.detectOverflow(t,{...l,altBoundary:!0}),u=Kv(c,n.floating);return{data:{escapedOffsets:u,escaped:qv(u)}}}default:return{}}}}},f1=new Set(["left","top"]);async function c4(e,t){const{placement:n,platform:s,elements:a}=e,l=await(s.isRTL==null?void 0:s.isRTL(a.floating)),c=$s(n),u=wi(n),p=cs(n)==="y",m=f1.has(c)?-1:1,h=l&&p?-1:1,g=Ds(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:E}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof E=="number"&&(b=u==="end"?E*-1:E),p?{x:b*h,y:y*m}:{x:y*m,y:b*h}}const u4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:a,y:l,placement:c,middlewareData:u}=t,p=await c4(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(s=u.arrow)!=null&&s.alignmentOffset?{}:{x:a+p.x,y:l+p.y,data:{...p,placement:c}}}}},d4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:a,platform:l}=t,{mainAxis:c=!0,crossAxis:u=!1,limiter:p={fn:k=>{let{x:C,y:N}=k;return{x:C,y:N}}},...m}=Ds(e,t),h={x:n,y:s},g=await l.detectOverflow(t,m),y=cs($s(a)),b=Og(y);let E=h[b],j=h[y];if(c){const k=b==="y"?"top":"left",C=b==="y"?"bottom":"right",N=E+g[k],T=E-g[C];E=vh(N,E,T)}if(u){const k=y==="y"?"top":"left",C=y==="y"?"bottom":"right",N=j+g[k],T=j-g[C];j=vh(N,j,T)}const w=p.fn({...t,[b]:E,[y]:j});return{...w,data:{x:w.x-n,y:w.y-s,enabled:{[b]:c,[y]:u}}}}}},f4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:a,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:p=!0,crossAxis:m=!0}=Ds(e,t),h={x:n,y:s},g=cs(a),y=Og(g);let b=h[y],E=h[g];const j=Ds(u,t),w=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(p){const N=y==="y"?"height":"width",T=l.reference[y]-l.floating[N]+w.mainAxis,D=l.reference[y]+l.reference[N]-w.mainAxis;b<T?b=T:b>D&&(b=D)}if(m){var k,C;const N=y==="y"?"width":"height",T=f1.has($s(a)),D=l.reference[g]-l.floating[N]+(T&&((k=c.offset)==null?void 0:k[g])||0)+(T?0:w.crossAxis),R=l.reference[g]+l.reference[N]+(T?0:((C=c.offset)==null?void 0:C[g])||0)-(T?w.crossAxis:0);E<D?E=D:E>R&&(E=R)}return{[y]:b,[g]:E}}}},p4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:a,rects:l,platform:c,elements:u}=t,{apply:p=()=>{},...m}=Ds(e,t),h=await c.detectOverflow(t,m),g=$s(a),y=wi(a),b=cs(a)==="y",{width:E,height:j}=l.floating;let w,k;g==="top"||g==="bottom"?(w=g,k=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(k=g,w=y==="end"?"top":"bottom");const C=j-h.top-h.bottom,N=E-h.left-h.right,T=co(j-h[w],C),D=co(E-h[k],N),R=!t.middlewareData.shift;let $=T,L=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&($=C),R&&!y){const B=hr(h.left,0),O=hr(h.right,0),W=hr(h.top,0),se=hr(h.bottom,0);b?L=E-2*(B!==0||O!==0?B+O:hr(h.left,h.right)):$=j-2*(W!==0||se!==0?W+se:hr(h.top,h.bottom))}await p({...t,availableWidth:L,availableHeight:$});const K=await c.getDimensions(u.floating);return E!==K.width||j!==K.height?{reset:{rects:!0}}:{}}}};function Kd(){return typeof window<"u"}function ji(e){return p1(e)?(e.nodeName||"").toLowerCase():"#document"}function yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xs(e){var t;return(t=(p1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function p1(e){return Kd()?e instanceof Node||e instanceof yr(e).Node:!1}function qr(e){return Kd()?e instanceof Element||e instanceof yr(e).Element:!1}function Is(e){return Kd()?e instanceof HTMLElement||e instanceof yr(e).HTMLElement:!1}function Gv(e){return!Kd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yr(e).ShadowRoot}function ic(e){const{overflow:t,overflowX:n,overflowY:s,display:a}=Gr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&a!=="inline"&&a!=="contents"}function m4(e){return/^(table|td|th)$/.test(ji(e))}function qd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const h4=/transform|translate|scale|rotate|perspective|filter/,g4=/paint|layout|strict|content/,Io=e=>!!e&&e!=="none";let Cm;function _g(e){const t=qr(e)?Gr(e):e;return Io(t.transform)||Io(t.translate)||Io(t.scale)||Io(t.rotate)||Io(t.perspective)||!Fg()&&(Io(t.backdropFilter)||Io(t.filter))||h4.test(t.willChange||"")||g4.test(t.contain||"")}function x4(e){let t=uo(e);for(;Is(t)&&!fi(t);){if(_g(t))return t;if(qd(t))return null;t=uo(t)}return null}function Fg(){return Cm==null&&(Cm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Cm}function fi(e){return/^(html|body|#document)$/.test(ji(e))}function Gr(e){return yr(e).getComputedStyle(e)}function Gd(e){return qr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function uo(e){if(ji(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gv(e)&&e.host||xs(e);return Gv(t)?t.host:t}function m1(e){const t=uo(e);return fi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Is(t)&&ic(t)?t:m1(t)}function Hl(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=m1(e),l=a===((s=e.ownerDocument)==null?void 0:s.body),c=yr(a);if(l){const u=jh(c);return t.concat(c,c.visualViewport||[],ic(a)?a:[],u&&n?Hl(u):[])}else return t.concat(a,Hl(a,[],n))}function jh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function h1(e){const t=Gr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const a=Is(e),l=a?e.offsetWidth:n,c=a?e.offsetHeight:s,u=ud(n)!==l||ud(s)!==c;return u&&(n=l,s=c),{width:n,height:s,$:u}}function zg(e){return qr(e)?e:e.contextElement}function ai(e){const t=zg(e);if(!Is(t))return fs(1);const n=t.getBoundingClientRect(),{width:s,height:a,$:l}=h1(t);let c=(l?ud(n.width):n.width)/s,u=(l?ud(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const y4=fs(0);function g1(e){const t=yr(e);return!Fg()||!t.visualViewport?y4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function b4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yr(e)?!1:t}function Yo(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),l=zg(e);let c=fs(1);t&&(s?qr(s)&&(c=ai(s)):c=ai(e));const u=b4(l,n,s)?g1(l):fs(0);let p=(a.left+u.x)/c.x,m=(a.top+u.y)/c.y,h=a.width/c.x,g=a.height/c.y;if(l){const y=yr(l),b=s&&qr(s)?yr(s):s;let E=y,j=jh(E);for(;j&&s&&b!==E;){const w=ai(j),k=j.getBoundingClientRect(),C=Gr(j),N=k.left+(j.clientLeft+parseFloat(C.paddingLeft))*w.x,T=k.top+(j.clientTop+parseFloat(C.paddingTop))*w.y;p*=w.x,m*=w.y,h*=w.x,g*=w.y,p+=N,m+=T,E=yr(j),j=jh(E)}}return fd({width:h,height:g,x:p,y:m})}function Yd(e,t){const n=Gd(e).scrollLeft;return t?t.left+n:Yo(xs(e)).left+n}function x1(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-Yd(e,n),a=n.top+t.scrollTop;return{x:s,y:a}}function v4(e){let{elements:t,rect:n,offsetParent:s,strategy:a}=e;const l=a==="fixed",c=xs(s),u=t?qd(t.floating):!1;if(s===c||u&&l)return n;let p={scrollLeft:0,scrollTop:0},m=fs(1);const h=fs(0),g=Is(s);if((g||!g&&!l)&&((ji(s)!=="body"||ic(c))&&(p=Gd(s)),g)){const b=Yo(s);m=ai(s),h.x=b.x+s.clientLeft,h.y=b.y+s.clientTop}const y=c&&!g&&!l?x1(c,p):fs(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-p.scrollLeft*m.x+h.x+y.x,y:n.y*m.y-p.scrollTop*m.y+h.y+y.y}}function w4(e){return Array.from(e.getClientRects())}function j4(e){const t=xs(e),n=Gd(e),s=e.ownerDocument.body,a=hr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),l=hr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let c=-n.scrollLeft+Yd(e);const u=-n.scrollTop;return Gr(s).direction==="rtl"&&(c+=hr(t.clientWidth,s.clientWidth)-a),{width:a,height:l,x:c,y:u}}const Yv=25;function k4(e,t){const n=yr(e),s=xs(e),a=n.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,p=0;if(a){l=a.width,c=a.height;const h=Fg();(!h||h&&t==="fixed")&&(u=a.offsetLeft,p=a.offsetTop)}const m=Yd(s);if(m<=0){const h=s.ownerDocument,g=h.body,y=getComputedStyle(g),b=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,E=Math.abs(s.clientWidth-g.clientWidth-b);E<=Yv&&(l-=E)}else m<=Yv&&(l+=m);return{width:l,height:c,x:u,y:p}}function S4(e,t){const n=Yo(e,!0,t==="fixed"),s=n.top+e.clientTop,a=n.left+e.clientLeft,l=Is(e)?ai(e):fs(1),c=e.clientWidth*l.x,u=e.clientHeight*l.y,p=a*l.x,m=s*l.y;return{width:c,height:u,x:p,y:m}}function Jv(e,t,n){let s;if(t==="viewport")s=k4(e,n);else if(t==="document")s=j4(xs(e));else if(qr(t))s=S4(t,n);else{const a=g1(e);s={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return fd(s)}function y1(e,t){const n=uo(e);return n===t||!qr(n)||fi(n)?!1:Gr(n).position==="fixed"||y1(n,t)}function N4(e,t){const n=t.get(e);if(n)return n;let s=Hl(e,[],!1).filter(u=>qr(u)&&ji(u)!=="body"),a=null;const l=Gr(e).position==="fixed";let c=l?uo(e):e;for(;qr(c)&&!fi(c);){const u=Gr(c),p=_g(c);!p&&u.position==="fixed"&&(a=null),(l?!p&&!a:!p&&u.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||ic(c)&&!p&&y1(e,c))?s=s.filter(h=>h!==c):a=u,c=uo(c)}return t.set(e,s),s}function C4(e){let{element:t,boundary:n,rootBoundary:s,strategy:a}=e;const c=[...n==="clippingAncestors"?qd(t)?[]:N4(t,this._c):[].concat(n),s],u=Jv(t,c[0],a);let p=u.top,m=u.right,h=u.bottom,g=u.left;for(let y=1;y<c.length;y++){const b=Jv(t,c[y],a);p=hr(b.top,p),m=co(b.right,m),h=co(b.bottom,h),g=hr(b.left,g)}return{width:m-g,height:h-p,x:g,y:p}}function E4(e){const{width:t,height:n}=h1(e);return{width:t,height:n}}function T4(e,t,n){const s=Is(t),a=xs(t),l=n==="fixed",c=Yo(e,!0,l,t);let u={scrollLeft:0,scrollTop:0};const p=fs(0);function m(){p.x=Yd(a)}if(s||!s&&!l)if((ji(t)!=="body"||ic(a))&&(u=Gd(t)),s){const b=Yo(t,!0,l,t);p.x=b.x+t.clientLeft,p.y=b.y+t.clientTop}else a&&m();l&&!s&&a&&m();const h=a&&!s&&!l?x1(a,u):fs(0),g=c.left+u.scrollLeft-p.x-h.x,y=c.top+u.scrollTop-p.y-h.y;return{x:g,y,width:c.width,height:c.height}}function Em(e){return Gr(e).position==="static"}function Xv(e,t){if(!Is(e)||Gr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xs(e)===n&&(n=n.ownerDocument.body),n}function b1(e,t){const n=yr(e);if(qd(e))return n;if(!Is(e)){let a=uo(e);for(;a&&!fi(a);){if(qr(a)&&!Em(a))return a;a=uo(a)}return n}let s=Xv(e,t);for(;s&&m4(s)&&Em(s);)s=Xv(s,t);return s&&fi(s)&&Em(s)&&!_g(s)?n:s||x4(e)||n}const R4=async function(e){const t=this.getOffsetParent||b1,n=this.getDimensions,s=await n(e.floating);return{reference:T4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function P4(e){return Gr(e).direction==="rtl"}const A4={convertOffsetParentRelativeRectToViewportRelativeRect:v4,getDocumentElement:xs,getClippingRect:C4,getOffsetParent:b1,getElementRects:R4,getClientRects:w4,getDimensions:E4,getScale:ai,isElement:qr,isRTL:P4};function v1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function D4(e,t){let n=null,s;const a=xs(e);function l(){var u;clearTimeout(s),(u=n)==null||u.disconnect(),n=null}function c(u,p){u===void 0&&(u=!1),p===void 0&&(p=1),l();const m=e.getBoundingClientRect(),{left:h,top:g,width:y,height:b}=m;if(u||t(),!y||!b)return;const E=Ru(g),j=Ru(a.clientWidth-(h+y)),w=Ru(a.clientHeight-(g+b)),k=Ru(h),N={rootMargin:-E+"px "+-j+"px "+-w+"px "+-k+"px",threshold:hr(0,co(1,p))||1};let T=!0;function D(R){const $=R[0].intersectionRatio;if($!==p){if(!T)return c();$?c(!1,$):s=setTimeout(()=>{c(!1,1e-7)},1e3)}$===1&&!v1(m,e.getBoundingClientRect())&&c(),T=!1}try{n=new IntersectionObserver(D,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(D,N)}n.observe(e)}return c(!0),l}function $4(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:p=!1}=s,m=zg(e),h=a||l?[...m?Hl(m):[],...t?Hl(t):[]]:[];h.forEach(k=>{a&&k.addEventListener("scroll",n,{passive:!0}),l&&k.addEventListener("resize",n)});const g=m&&u?D4(m,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(k=>{let[C]=k;C&&C.target===m&&b&&t&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var N;(N=b)==null||N.observe(t)})),n()}),m&&!p&&b.observe(m),t&&b.observe(t));let E,j=p?Yo(e):null;p&&w();function w(){const k=Yo(e);j&&!v1(j,k)&&n(),j=k,E=requestAnimationFrame(w)}return n(),()=>{var k;h.forEach(C=>{a&&C.removeEventListener("scroll",n),l&&C.removeEventListener("resize",n)}),g==null||g(),(k=b)==null||k.disconnect(),b=null,p&&cancelAnimationFrame(E)}}const L4=u4,O4=d4,I4=i4,M4=p4,_4=l4,Qv=a4,F4=f4,z4=(e,t,n)=>{const s=new Map,a={platform:A4,...n},l={...a.platform,_c:s};return o4(e,t,{...a,platform:l})};var B4=typeof document<"u",U4=function(){},Gu=B4?f.useLayoutEffect:U4;function pd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!pd(e[s],t[s]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,a[s]))return!1;for(s=n;s--!==0;){const l=a[s];if(!(l==="_owner"&&e.$$typeof)&&!pd(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function w1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zv(e,t){const n=w1(e);return Math.round(t*n)/n}function Tm(e){const t=f.useRef(e);return Gu(()=>{t.current=e}),t}function V4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:a,elements:{reference:l,floating:c}={},transform:u=!0,whileElementsMounted:p,open:m}=e,[h,g]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=f.useState(s);pd(y,s)||b(s);const[E,j]=f.useState(null),[w,k]=f.useState(null),C=f.useCallback(M=>{M!==R.current&&(R.current=M,j(M))},[]),N=f.useCallback(M=>{M!==$.current&&($.current=M,k(M))},[]),T=l||E,D=c||w,R=f.useRef(null),$=f.useRef(null),L=f.useRef(h),K=p!=null,B=Tm(p),O=Tm(a),W=Tm(m),se=f.useCallback(()=>{if(!R.current||!$.current)return;const M={placement:t,strategy:n,middleware:y};O.current&&(M.platform=O.current),z4(R.current,$.current,M).then(G=>{const A={...G,isPositioned:W.current!==!1};z.current&&!pd(L.current,A)&&(L.current=A,Rs.flushSync(()=>{g(A)}))})},[y,t,n,O,W]);Gu(()=>{m===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,g(M=>({...M,isPositioned:!1})))},[m]);const z=f.useRef(!1);Gu(()=>(z.current=!0,()=>{z.current=!1}),[]),Gu(()=>{if(T&&(R.current=T),D&&($.current=D),T&&D){if(B.current)return B.current(T,D,se);se()}},[T,D,se,B,K]);const H=f.useMemo(()=>({reference:R,floating:$,setReference:C,setFloating:N}),[C,N]),ee=f.useMemo(()=>({reference:T,floating:D}),[T,D]),ne=f.useMemo(()=>{const M={position:n,left:0,top:0};if(!ee.floating)return M;const G=Zv(ee.floating,h.x),A=Zv(ee.floating,h.y);return u?{...M,transform:"translate("+G+"px, "+A+"px)",...w1(ee.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:A}},[n,u,ee.floating,h.x,h.y]);return f.useMemo(()=>({...h,update:se,refs:H,elements:ee,floatingStyles:ne}),[h,se,H,ee,ne])}const H4=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:a}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?Qv({element:s.current,padding:a}).fn(n):{}:s?Qv({element:s,padding:a}).fn(n):{}}}},W4=(e,t)=>{const n=L4(e);return{name:n.name,fn:n.fn,options:[e,t]}},K4=(e,t)=>{const n=O4(e);return{name:n.name,fn:n.fn,options:[e,t]}},q4=(e,t)=>({fn:F4(e).fn,options:[e,t]}),G4=(e,t)=>{const n=I4(e);return{name:n.name,fn:n.fn,options:[e,t]}},Y4=(e,t)=>{const n=M4(e);return{name:n.name,fn:n.fn,options:[e,t]}},J4=(e,t)=>{const n=_4(e);return{name:n.name,fn:n.fn,options:[e,t]}},X4=(e,t)=>{const n=H4(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Q4="Arrow",j1=f.forwardRef((e,t)=>{const{children:n,width:s=10,height:a=5,...l}=e;return r.jsx(mn.svg,{...l,ref:t,width:s,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:r.jsx("polygon",{points:"0,0 30,0 15,10"})})});j1.displayName=Q4;var Z4=j1;function e$(e){const[t,n]=f.useState(void 0);return lo(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const l=a[0];let c,u;if("borderBoxSize"in l){const p=l.borderBoxSize,m=Array.isArray(p)?p[0]:p;c=m.inlineSize,u=m.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var Bg="Popper",[k1,S1]=Xo(Bg),[t$,N1]=k1(Bg),C1=e=>{const{__scopePopper:t,children:n}=e,[s,a]=f.useState(null);return r.jsx(t$,{scope:t,anchor:s,onAnchorChange:a,children:n})};C1.displayName=Bg;var E1="PopperAnchor",T1=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...a}=e,l=N1(E1,n),c=f.useRef(null),u=Fn(t,c),p=f.useRef(null);return f.useEffect(()=>{const m=p.current;p.current=(s==null?void 0:s.current)||c.current,m!==p.current&&l.onAnchorChange(p.current)}),s?null:r.jsx(mn.div,{...a,ref:u})});T1.displayName=E1;var Ug="PopperContent",[n$,r$]=k1(Ug),R1=f.forwardRef((e,t)=>{var ae,me,ve,ke,he,Je;const{__scopePopper:n,side:s="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:E,...j}=e,w=N1(Ug,n),[k,C]=f.useState(null),N=Fn(t,Ye=>C(Ye)),[T,D]=f.useState(null),R=e$(T),$=(R==null?void 0:R.width)??0,L=(R==null?void 0:R.height)??0,K=s+(l!=="center"?"-"+l:""),B=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},O=Array.isArray(m)?m:[m],W=O.length>0,se={padding:B,boundary:O.filter(o$),altBoundary:W},{refs:z,floatingStyles:H,placement:ee,isPositioned:ne,middlewareData:M}=V4({strategy:"fixed",placement:K,whileElementsMounted:(...Ye)=>$4(...Ye,{animationFrame:b==="always"}),elements:{reference:w.anchor},middleware:[W4({mainAxis:a+L,alignmentAxis:c}),p&&K4({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?q4():void 0,...se}),p&&G4({...se}),Y4({...se,apply:({elements:Ye,rects:ot,availableWidth:J,availableHeight:Ie})=>{const{width:Ne,height:Oe}=ot.reference,Xe=Ye.floating.style;Xe.setProperty("--radix-popper-available-width",`${J}px`),Xe.setProperty("--radix-popper-available-height",`${Ie}px`),Xe.setProperty("--radix-popper-anchor-width",`${Ne}px`),Xe.setProperty("--radix-popper-anchor-height",`${Oe}px`)}}),T&&X4({element:T,padding:u}),a$({arrowWidth:$,arrowHeight:L}),y&&J4({strategy:"referenceHidden",...se})]}),[G,A]=D1(ee),F=Ko(E);lo(()=>{ne&&(F==null||F())},[ne,F]);const Z=(ae=M.arrow)==null?void 0:ae.x,I=(me=M.arrow)==null?void 0:me.y,de=((ve=M.arrow)==null?void 0:ve.centerOffset)!==0,[ge,V]=f.useState();return lo(()=>{k&&V(window.getComputedStyle(k).zIndex)},[k]),r.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:ne?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(ke=M.transformOrigin)==null?void 0:ke.x,(he=M.transformOrigin)==null?void 0:he.y].join(" "),...((Je=M.hide)==null?void 0:Je.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:r.jsx(n$,{scope:n,placedSide:G,onArrowChange:D,arrowX:Z,arrowY:I,shouldHideArrow:de,children:r.jsx(mn.div,{"data-side":G,"data-align":A,...j,ref:N,style:{...j.style,animation:ne?void 0:"none"}})})})});R1.displayName=Ug;var P1="PopperArrow",s$={top:"bottom",right:"left",bottom:"top",left:"right"},A1=f.forwardRef(function(t,n){const{__scopePopper:s,...a}=t,l=r$(P1,s),c=s$[l.placedSide];return r.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:r.jsx(Z4,{...a,ref:n,style:{...a.style,display:"block"}})})});A1.displayName=P1;function o$(e){return e!==null}var a$=e=>({name:"transformOrigin",options:e,fn(t){var w,k,C;const{placement:n,rects:s,middlewareData:a}=t,c=((w=a.arrow)==null?void 0:w.centerOffset)!==0,u=c?0:e.arrowWidth,p=c?0:e.arrowHeight,[m,h]=D1(n),g={start:"0%",center:"50%",end:"100%"}[h],y=(((k=a.arrow)==null?void 0:k.x)??0)+u/2,b=(((C=a.arrow)==null?void 0:C.y)??0)+p/2;let E="",j="";return m==="bottom"?(E=c?g:`${y}px`,j=`${-p}px`):m==="top"?(E=c?g:`${y}px`,j=`${s.floating.height+p}px`):m==="right"?(E=`${-p}px`,j=c?g:`${b}px`):m==="left"&&(E=`${s.floating.width+p}px`,j=c?g:`${b}px`),{data:{x:E,y:j}}}});function D1(e){const[t,n="center"]=e.split("-");return[t,n]}var i$=C1,l$=T1,c$=R1,u$=A1,d$=Symbol("radix.slottable");function f$(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=d$,t}var p$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),m$="VisuallyHidden",$1=f.forwardRef((e,t)=>r.jsx(mn.span,{...e,ref:t,style:{...p$,...e.style}}));$1.displayName=m$;var h$=$1,[Jd]=Xo("Tooltip",[S1]),Xd=S1(),L1="TooltipProvider",g$=700,kh="tooltip.open",[x$,Vg]=Jd(L1),O1=e=>{const{__scopeTooltip:t,delayDuration:n=g$,skipDelayDuration:s=300,disableHoverableContent:a=!1,children:l}=e,c=f.useRef(!0),u=f.useRef(!1),p=f.useRef(0);return f.useEffect(()=>{const m=p.current;return()=>window.clearTimeout(m)},[]),r.jsx(x$,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(p.current),c.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>c.current=!0,s)},[s]),isPointerInTransitRef:u,onPointerInTransitChange:f.useCallback(m=>{u.current=m},[]),disableHoverableContent:a,children:l})};O1.displayName=L1;var Wl="Tooltip",[y$,lc]=Jd(Wl),I1=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:a,onOpenChange:l,disableHoverableContent:c,delayDuration:u}=e,p=Vg(Wl,e.__scopeTooltip),m=Xd(t),[h,g]=f.useState(null),y=ni(),b=f.useRef(0),E=c??p.disableHoverableContent,j=u??p.delayDuration,w=f.useRef(!1),[k,C]=zd({prop:s,defaultProp:a??!1,onChange:$=>{$?(p.onOpen(),document.dispatchEvent(new CustomEvent(kh))):p.onClose(),l==null||l($)},caller:Wl}),N=f.useMemo(()=>k?w.current?"delayed-open":"instant-open":"closed",[k]),T=f.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,C(!0)},[C]),D=f.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C(!1)},[C]),R=f.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{w.current=!0,C(!0),b.current=0},j)},[j,C]);return f.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),r.jsx(i$,{...m,children:r.jsx(y$,{scope:t,contentId:y,open:k,stateAttribute:N,trigger:h,onTriggerChange:g,onTriggerEnter:f.useCallback(()=>{p.isOpenDelayedRef.current?R():T()},[p.isOpenDelayedRef,R,T]),onTriggerLeave:f.useCallback(()=>{E?D():(window.clearTimeout(b.current),b.current=0)},[D,E]),onOpen:T,onClose:D,disableHoverableContent:E,children:n})})};I1.displayName=Wl;var Sh="TooltipTrigger",M1=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,a=lc(Sh,n),l=Vg(Sh,n),c=Xd(n),u=f.useRef(null),p=Fn(t,u,a.onTriggerChange),m=f.useRef(!1),h=f.useRef(!1),g=f.useCallback(()=>m.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),r.jsx(l$,{asChild:!0,...c,children:r.jsx(mn.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...s,ref:p,onPointerMove:qt(e.onPointerMove,y=>{y.pointerType!=="touch"&&!h.current&&!l.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:qt(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:qt(e.onPointerDown,()=>{a.open&&a.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:qt(e.onFocus,()=>{m.current||a.onOpen()}),onBlur:qt(e.onBlur,a.onClose),onClick:qt(e.onClick,a.onClose)})})});M1.displayName=Sh;var Hg="TooltipPortal",[b$,v$]=Jd(Hg,{forceMount:void 0}),_1=e=>{const{__scopeTooltip:t,forceMount:n,children:s,container:a}=e,l=lc(Hg,t);return r.jsx(b$,{scope:t,forceMount:n,children:r.jsx(Qo,{present:n||l.open,children:r.jsx(xg,{asChild:!0,container:a,children:s})})})};_1.displayName=Hg;var pi="TooltipContent",F1=f.forwardRef((e,t)=>{const n=v$(pi,e.__scopeTooltip),{forceMount:s=n.forceMount,side:a="top",...l}=e,c=lc(pi,e.__scopeTooltip);return r.jsx(Qo,{present:s||c.open,children:c.disableHoverableContent?r.jsx(z1,{side:a,...l,ref:t}):r.jsx(w$,{side:a,...l,ref:t})})}),w$=f.forwardRef((e,t)=>{const n=lc(pi,e.__scopeTooltip),s=Vg(pi,e.__scopeTooltip),a=f.useRef(null),l=Fn(t,a),[c,u]=f.useState(null),{trigger:p,onClose:m}=n,h=a.current,{onPointerInTransitChange:g}=s,y=f.useCallback(()=>{u(null),g(!1)},[g]),b=f.useCallback((E,j)=>{const w=E.currentTarget,k={x:E.clientX,y:E.clientY},C=C$(k,w.getBoundingClientRect()),N=E$(k,C),T=T$(j.getBoundingClientRect()),D=P$([...N,...T]);u(D),g(!0)},[g]);return f.useEffect(()=>()=>y(),[y]),f.useEffect(()=>{if(p&&h){const E=w=>b(w,h),j=w=>b(w,p);return p.addEventListener("pointerleave",E),h.addEventListener("pointerleave",j),()=>{p.removeEventListener("pointerleave",E),h.removeEventListener("pointerleave",j)}}},[p,h,b,y]),f.useEffect(()=>{if(c){const E=j=>{const w=j.target,k={x:j.clientX,y:j.clientY},C=(p==null?void 0:p.contains(w))||(h==null?void 0:h.contains(w)),N=!R$(k,c);C?y():N&&(y(),m())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[p,h,c,m,y]),r.jsx(z1,{...e,ref:l})}),[j$,k$]=Jd(Wl,{isInside:!1}),S$=f$("TooltipContent"),z1=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":a,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=e,p=lc(pi,n),m=Xd(n),{onClose:h}=p;return f.useEffect(()=>(document.addEventListener(kh,h),()=>document.removeEventListener(kh,h)),[h]),f.useEffect(()=>{if(p.trigger){const g=y=>{const b=y.target;b!=null&&b.contains(p.trigger)&&h()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[p.trigger,h]),r.jsx(gg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:r.jsxs(c$,{"data-state":p.stateAttribute,...m,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[r.jsx(S$,{children:s}),r.jsx(j$,{scope:n,isInside:!0,children:r.jsx(h$,{id:p.contentId,role:"tooltip",children:a||s})})]})})});F1.displayName=pi;var B1="TooltipArrow",N$=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,a=Xd(n);return k$(B1,n).isInside?null:r.jsx(u$,{...a,...s,ref:t})});N$.displayName=B1;function C$(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,s,a,l)){case l:return"left";case a:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function E$(e,t,n=5){const s=[];switch(t){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function T$(e){const{top:t,right:n,bottom:s,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:s},{x:a,y:s}]}function R$(e,t){const{x:n,y:s}=e;let a=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const u=t[l],p=t[c],m=u.x,h=u.y,g=p.x,y=p.y;h>s!=y>s&&n<(g-m)*(s-h)/(y-h)+m&&(a=!a)}return a}function P$(e){const t=e.slice();return t.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),A$(t)}function A$(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const a=e[s];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(a.y-c.y)>=(l.y-c.y)*(a.x-c.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const a=e[s];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(a.y-c.y)>=(l.y-c.y)*(a.x-c.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var D$=O1,$$=I1,L$=M1,O$=_1,U1=F1;const Wo=D$,Pr=$$,Ar=L$,gr=f.forwardRef(({className:e,sideOffset:t=4,...n},s)=>r.jsx(O$,{children:r.jsx(U1,{ref:s,sideOffset:t,className:Se("z-50 overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));gr.displayName=U1.displayName;function Wg({items:e,align:t="end"}){const[n,s]=f.useState(!1),[a,l]=f.useState(null),c=f.useRef(null);if(f.useEffect(()=>{if(!n){l(null);return}function p(h){c.current&&!c.current.contains(h.target)&&s(!1)}function m(h){h.key==="Escape"&&s(!1)}return document.addEventListener("mousedown",p),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",m)}},[n]),e.length===0)return null;function u(p,m){const h=p.icon,g=Se("flex w-full items-center gap-2 px-3 py-1.5 text-sm text-left transition",m&&"pl-8",p.disabled?"opacity-50 cursor-not-allowed":p.destructive?"text-destructive hover:bg-destructive/10":"hover:bg-foreground/5"),y=m?p.active?r.jsx(Xr,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}):r.jsx("span",{className:"h-4 w-4 shrink-0","aria-hidden":"true"}):h?r.jsx(h,{className:"h-4 w-4 shrink-0"}):null,b=r.jsxs(r.Fragment,{children:[y,r.jsx("span",{className:"block min-w-0 truncate",children:p.label})]});if(p.disabled){const E=r.jsx("span",{tabIndex:0,className:"inline-block w-full outline-none focus-visible:ring-1 focus-visible:ring-ring",children:r.jsx("button",{type:"button",disabled:!0,className:g,children:b})});return p.disabledReason?r.jsxs(Pr,{children:[r.jsx(Ar,{asChild:!0,children:E}),r.jsx(gr,{side:"left",children:p.disabledReason})]},p.key):r.jsx("div",{children:E},p.key)}return p.href?r.jsx(Ee,{to:p.href,className:g,onClick:()=>s(!1),children:b},p.key):r.jsx("button",{type:"button",className:g,onClick:()=>{var E;(E=p.onSelect)==null||E.call(p),s(!1)},children:b},p.key)}return r.jsxs("div",{className:"relative",ref:c,children:[r.jsx("button",{type:"button",onClick:()=>s(p=>!p),className:"shell-action",title:"More actions","aria-haspopup":"true","aria-expanded":n,children:r.jsx(lR,{className:"h-4 w-4"})}),n&&r.jsx("div",{className:Se("absolute top-full mt-1 z-30 min-w-[220px] rounded-md border border-border/70 bg-background shadow-lg py-1",t==="end"?"right-0":"left-0"),children:r.jsx(Wo,{delayDuration:200,children:e.map(p=>{if(p.submenu&&p.submenu.length>0){const m=p.icon,h=a===p.key;return r.jsxs("div",{children:[r.jsxs("button",{type:"button",className:Se("flex w-full items-center gap-2 px-3 py-1.5 text-sm text-left transition hover:bg-foreground/5"),"aria-expanded":h,onClick:()=>l(h?null:p.key),children:[m?r.jsx(m,{className:"h-4 w-4 shrink-0"}):null,r.jsx("span",{className:"block min-w-0 flex-1 truncate",children:p.label}),h?r.jsx(br,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}):r.jsx(l0,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"})]}),h?p.submenu.map(g=>u(g,!0)):null]},p.key)}return u(p,!1)})})})]})}function ew(e){const t=Date.parse(e);return Number.isNaN(t)?!1:Date.now()-t>10080*60*1e3}const I$={last_24h:1440*60*1e3,last_7d:10080*60*1e3,last_30d:720*60*60*1e3,last_90d:2160*60*60*1e3,older_7d:10080*60*1e3,older_30d:720*60*60*1e3};function M$(e){const[t,n,s]=e.split("-").map(Number);return new Date(t,n-1,s,0,0,0,0).getTime()}function _$(e){const[t,n,s]=e.split("-").map(Number);return new Date(t,n-1,s,23,59,59,999).getTime()}function F$(e,t,n=Date.now()){if(!t)return!0;const s=t.field==="created"?e.created??e.updated:e.updated,a=Date.parse(s);if(Number.isNaN(a))return!1;if(t.preset){const u=I$[t.preset];return u===void 0?!0:t.preset.startsWith("older_")?n-a>u:a>=n-u&&a<=n}const l=t.from&&t.from.length>0?t.from:void 0,c=t.to&&t.to.length>0?t.to:void 0;return!l&&!c?!0:!(l&&a<M$(l)||c&&a>_$(c))}function Kg(e,t,n={}){const{workspace:s,search:a,includeArchived:l}=n;if(e.archived===!0&&!l)return!1;const c=tt(t.status),u=tt(t.priority),p=tt(t.type),m=tt(t.assignee),h=tt(t.project),g=tt(t.tags),{activity:y}=t;if(s){if(s==="_ungrouped"){if(e.projectWorkspace!=null)return!1}else if(e.projectWorkspace!==s)return!1}if(c.length&&!c.includes(e.status)||u.length&&!u.includes(e.priority)||p.length&&!p.includes(e.type??"")||y==="stale"&&!ew(e.updated)||y==="fresh"&&ew(e.updated))return!1;if(m.length){const b=e.assignee??"__unassigned__";if(!m.includes(b))return!1}if(h.length&&!h.some(E=>E==="__standalone__"?e.projectSlug==null:e.projectSlug===E))return!1;if(g.length){const b=e.tags??[];if(!g.some(E=>b.includes(E)))return!1}if(!F$(e,t.dateRange))return!1;if(a){const b=a.trim().toLowerCase();if(b&&!`${e.title??""} ${e.slug??""} ${e.projectTitle??"standalone"} ${e.projectSlug??""}`.toLowerCase().includes(b))return!1}return!0}function Kl(e){return e.projectSlug===null?`/assignments/${e.id}`:`${e.projectWorkspace?`/w/${e.projectWorkspace}`:""}/projects/${e.projectSlug}/assignments/${e.slug}`}const V1={statuses:[{id:"pending",label:"Pending"},{id:"in_progress",label:"In Progress"},{id:"blocked",label:"Blocked"},{id:"review",label:"Review"},{id:"completed",label:"Completed"},{id:"failed",label:"Failed"}],order:["pending","in_progress","blocked","review","completed","failed"],transitions:[],custom:!1};let Pl=null,Fo=null;function z$(){return Pl?Promise.resolve(Pl):Fo||(Fo=fetch("/api/config/statuses").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>(Pl=e,Fo=null,e)).catch(()=>(Fo=null,V1)),Fo)}function Zo(){const[e,t]=f.useState(()=>Pl??V1);return f.useEffect(()=>{z$().then(t)},[]),e}function tw(){Pl=null,Fo=null}function cc(e,t){const n=e.statuses.find(s=>s.id===t);return(n==null?void 0:n.label)??t.replace(/_/g," ").replace(/\b\w/g,s=>s.toUpperCase())}const nw={critical:0,high:1,medium:2,low:3};function Pu(e){return Date.parse(e??"")||0}function uc(e,t,n){return[...e].sort((a,l)=>{let c=0;switch(t){case"title":c=a.title.localeCompare(l.title);break;case"status":c=a.status.localeCompare(l.status);break;case"priority":c=(nw[a.priority]??99)-(nw[l.priority]??99);break;case"assignee":c=(a.assignee??"").localeCompare(l.assignee??"");break;case"dependencies":c=a.dependsOn.length-l.dependsOn.length;break;case"created":c=Pu(a.created)-Pu(l.created);break;case"updated":c=Pu(a.updated)-Pu(l.updated);break}return n==="asc"?c:-c})}function St({title:e,description:t,actions:n}){return r.jsx("div",{className:"rounded-lg border border-dashed border-border bg-muted/40 px-4 py-6 text-center",children:r.jsxs("div",{className:"mx-auto max-w-xl space-y-2",children:[r.jsx("h3",{className:"text-base font-semibold text-foreground",children:e}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:t}),n?r.jsx("div",{className:"flex flex-wrap justify-center gap-3 pt-2",children:n}):null]})})}const mi='a, button, input, select, textarea, [contenteditable="true"], [role="button"], [data-no-drag]';function Qd({columns:e,items:t,getItemId:n,getColumnId:s,renderCard:a,canDrop:l,onMove:c,getExternalDragData:u,onCardContextMenu:p,emptyMessage:m="No cards in this column.",hiddenColumnIds:h,onHideColumn:g,compact:y=!1,dragDisabled:b=!1}){const E=f.useMemo(()=>new Set(h??[]),[h]),j=f.useMemo(()=>e.filter(z=>!E.has(z.id)),[e,E]),w=f.useMemo(()=>e.filter(z=>E.has(z.id)),[e,E]),[k,C]=f.useState(null),[N,T]=f.useState(null),D=f.useRef(null),R=f.useMemo(()=>new Map(t.map(z=>[n(z),z])),[n,t]),$=f.useMemo(()=>j.map(z=>({column:z,items:t.filter(H=>s(H)===z.id)})),[j,s,t]),L=k?R.get(k)??null:null;function K(z){if(!L)return{allowed:!1};const H=s(L);return(l==null?void 0:l({item:L,fromColumnId:H,toColumnId:z}))??{allowed:!0}}function B(){C(null),T(null)}function O(z,H,ee){if(b)return;const ne=(u==null?void 0:u(H))??null;!c&&!ne||(z.dataTransfer.effectAllowed="move",z.dataTransfer.setData("text/plain",ee),ne&&z.dataTransfer.setData("application/json",JSON.stringify(ne)),c&&C(ee))}function W(z,H,ee){b||!c||!L||!K(H).allowed||(z.preventDefault(),z.dataTransfer.dropEffect="move",T(M=>(M==null?void 0:M.columnId)===H&&M.index===ee?M:{columnId:H,index:ee}))}async function se(z,H,ee){var F;if(z.preventDefault(),b||!c||!L){B();return}const ne=s(L),G=(((F=$.find(Z=>Z.column.id===ne))==null?void 0:F.items)??[]).findIndex(Z=>n(Z)===n(L));if(!K(H).allowed||G<0){B();return}if(ne===H&&(ee===G||ee===G+1)){B();return}try{await c({item:L,fromColumnId:ne,toColumnId:H,fromIndex:G,toIndex:ee})}finally{B()}}return r.jsxs("div",{className:"relative overflow-x-auto pb-2",style:{scrollbarColor:"oklch(var(--border)) transparent",scrollbarWidth:"thin"},children:[w.length>0&&g?r.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx("span",{children:"Hidden:"}),w.map(z=>r.jsxs("button",{type:"button",onClick:()=>g(z.id),className:"rounded-full border border-dashed border-border/60 px-2 py-0.5 hover:border-border hover:text-foreground",title:`Restore "${z.title}" column`,children:[z.title," ×"]},z.id))]}):null,r.jsx("div",{className:Se("grid min-w-max grid-flow-col gap-4",y?"auto-cols-[minmax(200px,240px)]":"auto-cols-[minmax(260px,320px)]"),children:$.map(({column:z,items:H})=>{const ee=K(z.id),ne=(N==null?void 0:N.columnId)===z.id;return r.jsxs("section",{className:Se("flex flex-col rounded-lg border border-border/60 bg-card/85 shadow-sm",y?"min-h-[200px] p-2":"min-h-[320px] p-3",L&&!ee.allowed?"border-dashed opacity-65":"",L&&ee.allowed?"border-primary/30 bg-accent/30":"",ne?"ring-2 ring-ring/30":""),title:L&&!ee.allowed?ee.reason:void 0,children:[r.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h2",{className:Se("font-semibold uppercase tracking-[0.16em] text-muted-foreground",y?"text-xs":"text-sm"),children:z.title}),z.description&&!y?r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:z.description}):null]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs font-semibold text-foreground",children:H.length}),g?r.jsx("button",{type:"button",onClick:()=>g(z.id),className:"rounded-full border border-transparent px-1.5 py-0.5 text-xs text-muted-foreground hover:border-border hover:text-foreground",title:`Hide "${z.title}" column`,"aria-label":`Hide column ${z.title}`,children:"×"}):null]})]}),r.jsxs("div",{className:"flex flex-1 flex-col gap-3",onDragOver:M=>W(M,z.id,H.length),onDrop:M=>se(M,z.id,H.length),children:[H.length===0?b?r.jsx("div",{className:"flex min-h-[128px] items-center justify-center rounded-lg border border-border/60 bg-background/50 px-4 text-center text-sm text-muted-foreground",children:typeof m=="function"?m(z):m}):r.jsx(B$,{active:(N==null?void 0:N.columnId)===z.id&&N.index===0,disabled:!!L&&!ee.allowed,children:typeof m=="function"?m(z):m}):null,H.map((M,G)=>{const A=n(M),F=k===A;return r.jsxs(f.Fragment,{children:[r.jsx("div",{className:Se("h-2 rounded-full transition",(N==null?void 0:N.columnId)===z.id&&N.index===G?"bg-primary/70":"bg-transparent"),onDragOver:Z=>W(Z,z.id,G),onDrop:Z=>se(Z,z.id,G)}),r.jsx("div",{draggable:!b&&!!(c||u),onMouseDown:Z=>{D.current=Z.target},onDragStart:Z=>{const I=D.current;if(I!=null&&I.closest(mi)){Z.preventDefault();return}O(Z,M,A)},onDragEnd:B,onContextMenu:Z=>{if(!p)return;const I=Z.target;I!=null&&I.closest(mi)||p(M,Z)},className:Se("transition",!b&&(c||u)?"cursor-grab active:cursor-grabbing":"",F?"scale-[0.98] opacity-50":""),children:a(M,{dragging:F})})]},A)}),H.length>0&&!b?r.jsx("div",{className:Se("mt-1 rounded-md border border-dashed px-3 py-2 text-center text-xs text-muted-foreground transition",(N==null?void 0:N.columnId)===z.id&&N.index===H.length?"border-primary/50 bg-primary/10 text-foreground":"border-border/60",L&&!ee.allowed?"opacity-40":""),children:"Drop here to place at the end"}):null]})]},z.id)})})]})}function B$({active:e,disabled:t,children:n}){return r.jsx("div",{className:Se("flex min-h-[128px] items-center justify-center rounded-lg border border-dashed px-4 text-center text-sm text-muted-foreground transition",e?"border-primary/60 bg-primary/10 text-foreground":"border-border/60 bg-background/50",t?"opacity-45":""),children:n})}const El="border-status-pending-foreground/30 bg-status-pending text-status-pending-foreground",Rm="border-status-in-progress-foreground/30 bg-status-in-progress text-status-in-progress-foreground",U$="border-status-blocked-foreground/30 bg-status-blocked text-status-blocked-foreground",V$="border-status-review-foreground/30 bg-status-review text-status-review-foreground",H$="border-status-completed-foreground/30 bg-status-completed text-status-completed-foreground",W$="border-status-failed-foreground/30 bg-status-failed text-status-failed-foreground",K$="border-status-archived-foreground/30 bg-status-archived text-status-archived-foreground",md={draft:{label:"Draft",description:"Just-created stub; not yet shaped.",className:El,icon:bi},pending:{label:"Pending",description:"Waiting to start or waiting on dependencies.",className:El,icon:rR},ready_for_planning:{label:"Ready for Planning",description:"Objective and acceptance criteria written; awaiting a plan.",className:El,icon:u0},ready_to_implement:{label:"Ready to Implement",description:"Plan written and approved; ready to start coding.",className:Rm,icon:wR},in_progress:{label:"In Progress",description:"Actively being worked on.",className:Rm,icon:rg},blocked:{label:"Blocked",description:"Blocked by an explicit obstacle that needs intervention.",className:U$,icon:lh},review:{label:"Review",description:"Ready for inspection or approval.",className:V$,icon:SR},completed:{label:"Completed",description:"Finished successfully.",className:H$,icon:Zh},failed:{label:"Failed",description:"Could not be completed as planned.",className:W$,icon:lh},active:{label:"Active",description:"The project has active or review work in flight.",className:Rm,icon:ch},stopped:{label:"Stopped",description:"Session ended without completing.",className:El,icon:tR},archived:{label:"Archived",description:"Hidden from normal views; restorable from the Archive page.",className:K$,icon:ch}};function hd(e){const t=md[e];return t||{className:El,icon:ch,label:e.replace(/_/g," ").replace(/\b\w/g,n=>n.toUpperCase()),description:`Status: ${e}`}}function H1(e,t){return Se("inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 py-0.5 text-xs font-medium tracking-normal","shadow-[inset_0_0_0_1px_oklch(100%_0_0_/_0)] dark:shadow-[inset_0_0_0_1px_oklch(100%_0_0_/_0.04)]",hd(e).className,t)}function pn({status:e,className:t,showIcon:n=!0,progress:s}){const a=hd(e),l=a.icon,c=s&&s.total>0,u=c?Math.min(1,Math.max(0,s.checked/s.total)):0,p=c?`${a.description} (${s.checked}/${s.total} criteria)`:a.description,m=n?c?r.jsxs("span",{className:"relative inline-flex h-3.5 w-3.5 items-center justify-center",children:[r.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"absolute inset-0 h-full w-full -rotate-90",children:[r.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"none",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"1.5"}),r.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:2*Math.PI*7,strokeDashoffset:2*Math.PI*7*(1-u)})]}),r.jsx(l,{className:"h-2.5 w-2.5"})]}):r.jsx(l,{className:"h-3.5 w-3.5"}):null;return r.jsxs("span",{title:p,className:H1(e,t),children:[m,r.jsx("span",{children:a.label})]})}function Zd(e){var t;return((t=md[e])==null?void 0:t.description)??`Status: ${e}`}const W1={definitions:[{id:"feature",label:"Feature"},{id:"bug",label:"Bug"},{id:"refactor",label:"Refactor"},{id:"research",label:"Research"},{id:"chore",label:"Chore"}],default:"feature",custom:!1};let Yu=null,za=null;function q$(){return Yu?Promise.resolve(Yu):za||(za=fetch("/api/config/types").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>(Yu=e,za=null,e)).catch(()=>(za=null,W1)),za)}function ef(){const[e,t]=f.useState(()=>Yu??W1);return f.useEffect(()=>{q$().then(t)},[]),e}function ii(e,t){if(!t)return"—";const n=e.definitions.find(s=>s.id===t);return(n==null?void 0:n.label)??t.replace(/_/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function G$(e,t){return t?e.definitions.find(n=>n.id===t)??null:null}function ea({type:e,className:t,compact:n=!1}){const s=ef();if(!e)return null;const a=G$(s,e),l=(a==null?void 0:a.label)??e.replace(/_/g," ").replace(/\b\w/g,u=>u.toUpperCase()),c=a!=null&&a.color?{backgroundColor:`color-mix(in oklch, ${a.color} 18%, transparent)`,borderColor:`color-mix(in oklch, ${a.color} 50%, transparent)`,color:a.color}:void 0;return r.jsx("span",{title:(a==null?void 0:a.description)??`Type: ${l}`,style:c,className:Se("inline-flex items-center whitespace-nowrap rounded-full border text-xs capitalize",n?"px-2 py-0.5":"px-2.5 py-1",!c&&"border-border/60 text-muted-foreground",t),children:l})}function $r({value:e,label:t,disabled:n=!1,disabledReason:s,onError:a}){const[l,c]=f.useState(!1);async function u(){if(!n)try{if(!navigator.clipboard||typeof navigator.clipboard.writeText!="function")throw new Error("Clipboard API is unavailable in this context.");await navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),1500)}catch(p){a==null||a(p instanceof Error?p:new Error(String(p)))}}return n?r.jsx("button",{type:"button",disabled:!0,"aria-disabled":"true",className:"cursor-not-allowed text-muted-foreground/50",title:s??"Copy unavailable","aria-label":t??"Copy",children:r.jsx(rd,{className:"h-3 w-3","aria-hidden":"true"})}):r.jsx("button",{type:"button",onClick:u,className:"text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 rounded",title:l?"Copied!":t??`Copy: ${e}`,"aria-label":t??"Copy",children:l?r.jsx(Xr,{className:"h-3 w-3 text-status-completed-foreground","aria-hidden":"true"}):r.jsx(rd,{className:"h-3 w-3","aria-hidden":"true"})})}function Y$(e){return e.projectSlug===null?`/assignments/${e.id}`:`${e.projectWorkspace?`/w/${e.projectWorkspace}`:""}/projects/${e.projectSlug}/assignments/${e.slug}`}function J$({items:e,statusOrder:t,sortField:n,sortDirection:s,listSectionVisibility:a,compact:l=!1}){const c=Zo(),[u,p]=f.useState(()=>new Set(a.collapsed));f.useEffect(()=>{p(new Set(a.collapsed))},[a]);const m=h=>{p(g=>{const y=new Set(g);return y.has(h)?y.delete(h):y.add(h),y})};return r.jsx("div",{className:Se("space-y-2",l?"space-y-1.5":"space-y-3"),children:t.map(h=>{const g=uc(e.filter(E=>E.status===h),n,s);if(g.length===0)return null;const y=!u.has(h),b=cc(c,h);return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/90",children:[r.jsxs("button",{type:"button",onClick:()=>m(h),className:Se("flex w-full items-center gap-2 text-left",l?"px-3 py-2 text-xs":"px-4 py-3 text-sm"),children:[r.jsx(br,{className:Se("text-muted-foreground transition-transform",l?"h-3.5 w-3.5":"h-4 w-4",y?"":"-rotate-90")}),r.jsx("span",{className:"font-semibold text-foreground",children:b}),r.jsx("span",{className:Se("rounded-full border border-border/60 text-muted-foreground",l?"px-1.5 py-0 text-[10px]":"px-2 py-0.5 text-xs"),children:g.length})]}),y&&r.jsx("ul",{className:Se("divide-y divide-border/40 border-t border-border/40",l?"text-xs":"text-sm"),children:g.map(E=>{const j=Y$(E);return r.jsx("li",{children:r.jsxs(Ee,{to:j,className:Se("flex items-center gap-3 hover:bg-muted/40",l?"px-3 py-1.5":"px-4 py-2.5"),children:[r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:E.title}),E.projectTitle?r.jsx("span",{className:"hidden truncate text-muted-foreground sm:inline",children:E.projectTitle}):null,r.jsx("span",{className:"shrink-0 text-muted-foreground",children:Dn(E.updated)})]})},`${E.projectSlug??"standalone"}:${E.id}`)})})]},h)})})}function X$(e){return e.projectSlug===null?`/assignments/${e.id}`:`${e.projectWorkspace?`/w/${e.projectWorkspace}`:""}/projects/${e.projectSlug}/assignments/${e.slug}`}function Q$({items:e,sortField:t,sortDirection:n,tableColumnVisibility:s,compact:a=!1}){const l=new Set(s.hidden);l.delete("title");const c=h=>!l.has(h),u=uc(e,t,n),p=a?"py-2 pr-3":"py-3 pr-4",m=a?"text-xs":"text-sm";return r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:Se("w-full text-left",m),children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[c("title")?r.jsx("th",{className:Se("font-medium",p),children:"Assignment"}):null,c("status")?r.jsx("th",{className:Se("font-medium",p),children:"Status"}):null,c("priority")?r.jsx("th",{className:Se("font-medium",p),children:"Priority"}):null,c("assignee")?r.jsx("th",{className:Se("font-medium",p),children:"Assignee"}):null,c("dependencies")?r.jsx("th",{className:Se("font-medium",p),children:"Dependencies"}):null,c("created")?r.jsx("th",{className:Se("font-medium",p),children:"Created"}):null,c("updated")?r.jsx("th",{className:Se("font-medium",p),children:"Updated"}):null]})}),r.jsx("tbody",{children:u.map(h=>{const g=X$(h),y=`${h.projectSlug??"standalone"}:${h.id}`;return r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[c("title")?r.jsxs("td",{className:p,children:[r.jsx(Ee,{to:g,className:"font-semibold text-foreground hover:text-primary",children:h.title}),h.projectTitle?r.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:h.projectTitle}):null]}):null,c("status")?r.jsx("td",{className:p,children:r.jsx(pn,{status:h.status})}):null,c("priority")?r.jsx("td",{className:Se("capitalize text-muted-foreground",p),children:h.priority}):null,c("assignee")?r.jsx("td",{className:Se("text-muted-foreground",p),children:h.assignee??"Unassigned"}):null,c("dependencies")?r.jsx("td",{className:Se("text-muted-foreground",p),children:h.dependsOn.length}):null,c("created")?r.jsx("td",{className:Se("text-muted-foreground",p),children:Dn(h.created)}):null,c("updated")?r.jsx("td",{className:Se("text-muted-foreground",p),children:Dn(h.updated)}):null]},y)})})]})})}function Z$(e,t,n){return e.filter(s=>Kg(s,t,{workspace:n,search:t.search}))}function K1({view:e,compact:t,emptyDescription:n}){const{data:s,loading:a,error:l}=Md(),c=Zo(),u=f.useMemo(()=>c.order.map(m=>({id:m,title:cc(c,m),description:Zd(m)})),[c]),p=f.useMemo(()=>{if(!s)return[];const m=Z$(s.assignments,e.config.filters,e.workspace);return uc(m,e.config.sortField,e.config.sortDirection)},[s,e]);if(a&&!s)return r.jsx(mt,{label:"Loading assignments…"});if(l)return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load assignments"}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:l})]});if(p.length===0)return r.jsx(St,{title:"No assignments match this view.",description:n??"Adjust the view's filters to surface different work."});switch(e.config.viewMode){case"kanban":return r.jsx(Qd,{compact:t,dragDisabled:!0,columns:u,items:p,getItemId:m=>m.slug||m.id,getColumnId:m=>m.status,hiddenColumnIds:e.config.kanbanColumnVisibility.hidden,renderCard:m=>t?r.jsx(eL,{item:m}):r.jsx(tL,{item:m})});case"list":return r.jsx(J$,{items:p,statusOrder:c.order,sortField:e.config.sortField,sortDirection:e.config.sortDirection,listSectionVisibility:e.config.listSectionVisibility,compact:t});case"table":return r.jsx(Q$,{items:p,sortField:e.config.sortField,sortDirection:e.config.sortDirection,tableColumnVisibility:e.config.tableColumnVisibility,compact:t})}}function eL({item:e}){const t=Kl(e);return r.jsxs("div",{className:Se("rounded-md border border-border/60 bg-background/85 p-2 shadow-sm"),children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx(Ee,{to:t,className:"block truncate text-sm font-semibold text-foreground hover:text-primary",children:e.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:e.projectTitle??"Standalone"})]}),r.jsx(pn,{status:e.status})]}),r.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2 text-[10px] uppercase tracking-[0.08em] text-muted-foreground",children:[r.jsx("span",{className:"truncate",children:e.assignee??"Unassigned"}),r.jsx("span",{className:"shrink-0",children:Dn(e.updated)})]}),e.id?r.jsxs("p",{className:"mt-1 inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground/70",children:[e.id.slice(0,8),r.jsx($r,{value:e.id})]}):null]})}function tL({item:e}){const t=Kl(e);return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx(Ee,{to:t,className:"block truncate text-sm font-semibold text-foreground hover:text-primary",children:e.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:e.projectTitle??"Standalone"})]}),r.jsx(pn,{status:e.status})]}),r.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[r.jsx(ea,{type:e.type,compact:!0}),r.jsx("span",{className:"text-xs capitalize text-muted-foreground",children:e.priority})]}),r.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2 text-[11px] text-muted-foreground",children:[r.jsx("span",{className:"truncate",children:e.assignee??"Unassigned"}),r.jsx("span",{className:"shrink-0",children:Dn(e.updated)})]})]})}function nL({viewId:e,onPickAnother:t}){const{view:n,loading:s,error:a,refetch:l}=Go(e);return s?r.jsx(mt,{label:"Loading view…"}):a?r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load view"}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:a.message}),r.jsx("button",{type:"button",onClick:()=>l(),className:"shell-action mt-3",children:"Retry"})]}):n?r.jsx(K1,{view:n,compact:!0,emptyDescription:"Adjust the view's filters to surface different work, or pick another widget for this slot."}):r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"View no longer exists"}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"The saved view this slot was bound to has been deleted."}),r.jsx("button",{type:"button",onClick:t,className:"shell-action mt-3",children:"Pick another widget"})]})}function rL({sessions:e}){return r.jsxs("aside",{"aria-labelledby":"overview-sessions-title",className:"rounded-xl border border-border/60 bg-background/60 shadow-sm",children:[r.jsx("header",{className:"border-b border-border/40 px-4 py-3",children:r.jsx("h3",{id:"overview-sessions-title",className:"text-sm font-semibold text-foreground",children:"Recent Sessions"})}),e.length===0?r.jsxs("div",{className:"px-4 py-6 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:Ho.recentSessionsEmptyTitle}),r.jsx("p",{className:"mt-1 text-muted-foreground",children:Ho.recentSessionsEmptyHint})]}):r.jsx("ul",{className:"divide-y divide-border/40",children:e.map(t=>r.jsx("li",{children:r.jsx(sL,{session:t})},t.sessionId))})]})}function sL({session:e}){const t=ln(),[n,s]=f.useState(!1),a=oL(e,t),l=aL(e),c=!e.path;return r.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx(Ee,{to:a,className:"block text-sm font-medium text-foreground hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:e.agent}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[l," · ",N0(e.started)]}),n&&e.path?r.jsxs("div",{className:"mt-1 space-y-0.5",children:[r.jsx("code",{className:"block w-full select-all rounded bg-muted/40 px-1.5 py-0.5 text-xs text-foreground",children:e.path}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:Ho.recentSessionsCopyFallbackHint})]}):null]}),r.jsx($r,{value:e.path,label:Ho.recentSessionsCopyPathLabel,disabled:c,disabledReason:Ho.recentSessionsCopyPathDisabled,onError:()=>s(!0)})]})}function oL(e,t){return e.projectSlug&&e.assignmentSlug?`${t}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`:(!e.projectSlug&&e.assignmentSlug,"/agent-sessions")}function aL(e){return e.assignmentSlug&&e.projectSlug?`${e.projectSlug}/${e.assignmentSlug}`:e.assignmentSlug?`standalone/${e.assignmentSlug}`:"standalone"}function iL(){const{data:e,loading:t,error:n}=U0();return t&&!e?r.jsx(mt,{label:"Loading sessions…"}):n?r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm text-muted-foreground",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load sessions"}),r.jsx("p",{className:"mt-1 text-xs",children:n})]}):r.jsx(rL,{sessions:(e==null?void 0:e.sessions)??[]})}const lL=5;function cL(){const{data:e,loading:t,error:n}=B0();if(t&&!e)return r.jsx(mt,{label:"Loading inventories…"});if(n)return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm text-muted-foreground",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load inventories"}),r.jsx("p",{className:"mt-1 text-xs",children:n})]});const a=((e==null?void 0:e.inventories)??[]).slice(0,lL);return r.jsxs("aside",{"aria-labelledby":"overview-inventories-title",className:"rounded-xl border border-border/60 bg-background/60 shadow-sm",children:[r.jsxs("header",{className:"flex items-center justify-between border-b border-border/40 px-4 py-3",children:[r.jsx("h3",{id:"overview-inventories-title",className:"text-sm font-semibold text-foreground",children:"Inventories"}),r.jsx(Ee,{to:"/inventories",className:"text-xs text-muted-foreground hover:text-foreground",children:"View all →"})]}),a.length===0?r.jsxs("div",{className:"px-4 py-6 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"No inventories yet."}),r.jsx("p",{className:"mt-1 text-muted-foreground",children:"Create one to track leased resources across agents."})]}):r.jsx("ul",{className:"divide-y divide-border/40",children:a.map(l=>{const c=l.inventory,u=l.active_leases.length,p=l.members.length,m=c.display_name??c.slug;return r.jsx("li",{children:r.jsxs(Ee,{to:`/inventories/${encodeURIComponent(c.slug)}`,className:"flex items-center gap-3 px-4 py-2.5 text-sm hover:bg-muted/40",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:m}),r.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:[u,"/",p," leased"]})]})},c.slug)})})]})}const q1={"saved-view":{title:"Saved view",icon:p0,render:(e,t)=>e.kind!=="saved-view"?null:f.createElement(nL,{viewId:e.viewId,onPickAnother:t.onPickAnother})},"agent-sessions":{title:"Agent sessions",icon:Ad,render:()=>f.createElement(iL)},inventories:{title:"Inventories",icon:Ld,render:()=>f.createElement(cL)}},uL={small:"min-h-[320px]",wide:"xl:col-span-2 min-h-[320px]",tall:"min-h-[560px]",large:"xl:col-span-2 min-h-[560px]"},dL={small:"Small",wide:"Wide",tall:"Tall",large:"Large"};function fL({slot:e,onReplace:t,onRemove:n,onResize:s}){const a=e.size??"small",l=uL[a];if(e.widget===null)return r.jsx("div",{className:Se("flex items-center justify-center rounded-lg border border-dashed border-border/60 bg-card/40 p-3 shadow-sm",l),children:r.jsxs("button",{type:"button",onClick:t,className:"shell-action inline-flex items-center gap-2",children:[r.jsx(rn,{className:"h-4 w-4"}),"Add widget"]})});const c=q1[e.widget.kind];if(!c)return r.jsx("div",{className:Se("overflow-auto rounded-lg border border-border/60 bg-card/85 p-3 shadow-sm",l),children:r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/60 px-3 py-2 text-sm text-muted-foreground",children:["Unknown widget kind: ",e.widget.kind]})});const u=c.icon;return r.jsxs("div",{className:Se("overflow-auto rounded-lg border border-border/60 bg-card/85 p-3 shadow-sm",l),children:[r.jsxs("header",{className:"mb-2 flex items-center justify-between gap-2",children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs uppercase tracking-[0.12em] text-muted-foreground",children:[r.jsx(u,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsx("span",{className:"truncate",children:r.jsx(pL,{slot:e,fallback:c.title})})]}),r.jsx(Wg,{items:[{key:"replace",label:"Replace…",icon:jR,onSelect:t},{key:"size",label:"Size",icon:yR,submenu:zD.map(p=>({key:`size-${p}`,label:dL[p],active:p===a,onSelect:()=>s(p)}))},{key:"remove",label:"Remove",icon:or,destructive:!0,onSelect:n}]})]}),r.jsx("div",{children:c.render(e.widget,{slotId:e.id,onPickAnother:t})})]})}function pL({slot:e,fallback:t}){var a,l;const n=((a=e.widget)==null?void 0:a.kind)==="saved-view"?e.widget.viewId:null,{view:s}=Go(n);return((l=e.widget)==null?void 0:l.kind)==="saved-view"&&s?r.jsx(r.Fragment,{children:s.name}):r.jsx(r.Fragment,{children:t})}const mL=["agent-sessions","inventories"];function hL({open:e,onOpenChange:t,onSelect:n}){const{views:s,loading:a}=Vd();function l(c){n(c),t(!1)}return r.jsx(ar,{open:e,onOpenChange:t,children:r.jsxs(Kn,{className:"max-w-xl",children:[r.jsxs(Zr,{children:[r.jsx(qn,{children:"Add a widget"}),r.jsx(gs,{children:"Choose a built-in widget or one of your saved views."})]}),r.jsxs("section",{className:"space-y-2",children:[r.jsx("h3",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:"Built-in widgets"}),r.jsx("ul",{className:"divide-y divide-border/40 rounded-md border border-border/60",children:mL.map(c=>{const u=q1[c],p=u.icon;return r.jsx("li",{children:r.jsxs("button",{type:"button",onClick:()=>l({kind:c}),className:"flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm hover:bg-muted/40",children:[r.jsx(p,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),r.jsx("span",{className:"font-medium text-foreground",children:u.title})]})},c)})})]}),r.jsxs("section",{className:"space-y-2",children:[r.jsx("h3",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:"Saved views"}),a?r.jsx("div",{className:"rounded-md border border-border/60 px-3 py-4 text-sm text-muted-foreground",children:"Loading saved views…"}):s.length===0?r.jsxs("div",{className:"rounded-md border border-border/60 px-3 py-4 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"No saved views yet"}),r.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Save a view from the assignments page first."," ",r.jsx(Ee,{to:"/views",className:"text-foreground underline hover:opacity-80",children:"Manage views →"})]})]}):r.jsx("ul",{className:"max-h-72 divide-y divide-border/40 overflow-auto rounded-md border border-border/60",children:s.map(c=>r.jsx("li",{children:r.jsxs("button",{type:"button",onClick:()=>l({kind:"saved-view",viewId:c.id}),className:"flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm hover:bg-muted/40",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:c.name}),c.workspace!==null?r.jsx("span",{className:"shrink-0 rounded-full border border-border/60 px-2 py-0.5 text-[10px] text-muted-foreground",title:`Scoped to workspace: ${c.workspace}`,children:c.workspace}):null,r.jsx("span",{className:"shrink-0 rounded-full border border-border/60 px-2 py-0.5 text-[10px] capitalize text-muted-foreground",children:c.config.viewMode})]})},c.id))}),!a&&s.some(c=>c.workspace!==null)?r.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Workspace-scoped views on the global Overview will only show items from that workspace."}):null]})]})})}function gL(){const{data:e,error:t,refetch:n}=vP(),{data:s}=_0(),{layout:a}=WD(),[l,c]=f.useState(!1),[u,p]=f.useState(null),[m,h]=f.useState(null);mo("list:overview"),Ht({keys:"r",description:"Refresh",scope:"list:overview",handler:()=>{n()}});const g=f.useCallback(k=>{p(k),c(!0)},[]),y=f.useCallback(async k=>{h(null);try{await qD(k)}catch(C){h(C instanceof Error?C.message:String(C))}},[]),b=f.useCallback(k=>{if(u===null)return;const C=a.slots.map((N,T)=>T===u?{...N,widget:k}:N);p(null),y(C)},[a.slots,u,y]),E=f.useCallback(k=>{const C=a.slots.map((N,T)=>T===k?{...N,widget:null}:N);y(C)},[a.slots,y]),j=f.useCallback((k,C)=>{const N=a.slots.map((T,D)=>D===k?{...T,size:C}:T);y(N)},[a.slots,y]),w={};if(e)for(const k of Object.keys(e.segments))for(const C of e.segments[k].items)w[C.id]=C;return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("header",{className:"space-y-2",children:[r.jsx("p",{className:"eyebrow",children:"Workspace Overview"}),r.jsx("h1",{className:"text-4xl font-semibold tracking-display text-foreground md:text-5xl",children:"What needs you today"})]}),e?r.jsx(AD,{hero:e.hero,itemsById:w}):t?r.jsx(wt,{error:t}):r.jsx(mt,{label:"Loading overview…"}),e!=null&&e.firstRun?r.jsx(RD,{help:s}):null,m?r.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:["Couldn't save dashboard layout: ",m]}):null,r.jsx("div",{className:"grid grid-flow-dense grid-cols-1 gap-4 xl:grid-cols-2",children:a.slots.map((k,C)=>r.jsx(fL,{slot:k,index:C,onReplace:()=>g(C),onRemove:()=>E(C),onResize:N=>j(C,N)},k.id))}),e!=null&&e.serverStats?r.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(sg,{className:"h-3 w-3","aria-hidden":"true"}),r.jsxs("span",{children:["● ",e.serverStats.totalPorts," ports ·"," ",e.serverStats.deadSessions>0?`${e.serverStats.deadSessions} dead`:"all healthy"]})]}):null,r.jsx(hL,{open:l,onOpenChange:k=>{c(k),k||p(null)},onSelect:b})]})}function xL({term:e,description:t}){return r.jsx("span",{title:t,className:"cursor-help rounded-full border border-border/70 bg-background/80 px-2.5 py-1 text-xs font-medium text-foreground underline decoration-dotted underline-offset-4",children:e})}function yL(){const{data:e,loading:t,error:n}=_0(),{openCheatsheet:s}=po();return t?r.jsx(mt,{label:"Loading help…"}):n||!e?r.jsx(wt,{error:n||"Help content is unavailable."}):r.jsxs("div",{className:"space-y-5",children:[r.jsx(We,{title:"Keyboard Shortcuts",description:"Navigate the dashboard without reaching for the mouse.",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx("button",{type:"button",onClick:s,className:"inline-flex items-center gap-2 rounded-md border border-border/70 bg-background/80 px-3 py-1.5 text-sm font-medium text-foreground hover:bg-accent",children:"Open shortcuts cheatsheet"}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["or press ",r.jsx("kbd",{className:"rounded border border-border/70 bg-muted px-1.5 py-0.5 font-mono text-[11px]",children:"?"})," ","anywhere. ",ds("Mod+k")," opens the command palette."]})]})}),r.jsx(We,{title:"What Syntaur Is",description:e.whatIsSyntaur.summary,children:r.jsx("div",{className:"grid gap-3 md:grid-cols-3",children:e.whatIsSyntaur.bullets.map(a=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3 text-sm leading-6 text-muted-foreground",children:a},a))})}),r.jsx(We,{title:"Getting Started",children:r.jsx("div",{className:"space-y-3",children:e.workflow.map((a,l)=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full bg-foreground text-xs font-semibold text-background",children:l+1}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:a.title}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:a.detail}),a.command?r.jsx(qu,{command:a.command.command,description:a.command.description,example:a.command.example}):null,a.href?r.jsx(Ee,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open the related surface"}):null]})]})},a.title))})}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsxs(We,{title:"Core Concepts",children:[r.jsx("div",{className:"flex flex-wrap gap-2",children:e.coreConcepts.map(a=>r.jsx(xL,{term:a.term,description:a.description},a.term))}),r.jsx("div",{className:"grid gap-3 pt-2",children:e.coreConcepts.map(a=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:a.term}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.description})]},a.term))})]}),r.jsx(We,{title:"Status Guide",children:r.jsx("div",{className:"space-y-3",children:e.statusGuide.map(a=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(pn,{status:a.status}),r.jsx("p",{className:"font-semibold text-foreground",children:a.meaning})]}),r.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:a.useWhen})]},a.status))})})]}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsx(We,{title:"Ownership And File Rules",children:r.jsx("div",{className:"space-y-3",children:e.ownershipRules.map(a=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:a.label}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.description}),r.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:a.files.map(l=>r.jsx("span",{className:"rounded-full border border-border/60 bg-card/90 px-2.5 py-1 font-mono text-xs text-foreground",children:l},l))})]},a.label))})}),r.jsx(We,{title:"How To Navigate The Dashboard",children:r.jsx("div",{className:"space-y-3",children:e.navigation.map(a=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:a.label}),r.jsx(Ee,{className:"text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open"})]}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.description})]},a.label))})})]}),r.jsx(We,{title:"CLI Quick Reference",children:r.jsx("div",{className:"grid gap-3 xl:grid-cols-2",children:e.commands.map(a=>r.jsx(qu,{command:a.command,description:a.description,example:a.example},a.command))})}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsx(We,{title:"FAQ",children:r.jsx("div",{className:"space-y-3",children:e.faq.map(a=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:a.question}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.answer})]},a.question))})}),r.jsx(We,{title:"First Project Checklist",children:r.jsx("div",{className:"space-y-3",children:e.firstProjectChecklist.map((a,l)=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full bg-foreground text-xs font-semibold text-background",children:l+1}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:a.title}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:a.detail}),a.command?r.jsx(qu,{command:a.command.command,example:a.command.example}):null,a.href?r.jsx(Ee,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open the related surface"}):null]})]})},a.title))})})]})]})}function qg({children:e}){return r.jsx("div",{className:"chrome-card flex flex-col gap-2 !p-2.5 md:flex-row md:flex-wrap md:items-center",children:e})}const tf=f.forwardRef(({value:e,onChange:t,placeholder:n="Search"},s)=>r.jsxs("label",{className:"relative flex min-w-[220px] flex-1 items-center",children:[r.jsx(fo,{className:"pointer-events-none absolute left-3 h-4 w-4 text-muted-foreground"}),r.jsx("input",{ref:s,value:e,onChange:a=>t(a.target.value),placeholder:n,className:"h-9 w-full rounded-md border border-border/60 bg-background/90 pl-9 pr-3 text-sm text-foreground outline-none transition focus:border-primary focus:ring-2 focus:ring-ring/30"})]}));tf.displayName="SearchInput";function nf({value:e,options:t,onChange:n}){return r.jsx("div",{className:"inline-flex rounded-md border border-border/60 bg-background/80 p-1",children:t.map(s=>r.jsx("button",{type:"button","aria-pressed":e===s.value,onClick:()=>n(s.value),className:Se("rounded-sm px-2.5 py-1.5 text-sm font-medium transition",e===s.value?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:s.label},s.value))})}const bL={completed:"bg-status-completed-foreground",in_progress:"bg-status-in-progress-foreground",review:"bg-status-review-foreground",blocked:"bg-status-blocked-foreground",failed:"bg-status-failed-foreground",pending:"bg-status-pending-foreground"},rw=["bg-primary","bg-secondary","bg-accent-coral","bg-accent-teal","bg-accent-amber"];function gd({progress:e,className:t,showLegend:n=!1}){const s=Zo(),a=f.useMemo(()=>{let c=0;return(s.order.length>0?s.order:Object.keys(e).filter(p=>p!=="total")).map(p=>({key:p,className:bL[p]??rw[c++%rw.length]}))},[s.order,e]),l=a.filter(c=>(e[c.key]??0)>0);return r.jsxs("div",{className:Se("space-y-2",t),children:[r.jsx("div",{className:"flex h-1.5 w-full overflow-hidden rounded-lg border border-border/70 bg-muted/60",children:e.total===0?r.jsx("div",{className:"h-full w-full bg-muted"}):l.map(c=>r.jsx("div",{className:c.className,style:{width:`${(e[c.key]??0)/e.total*100}%`},title:`${yn(c.key)}: ${e[c.key]??0}`},c.key))}),n?r.jsx("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:a.map(c=>r.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full border border-border/60 bg-background/80 px-2 py-1",children:[r.jsx("span",{className:Se("h-2 w-2 rounded-full",c.className)}),r.jsx("span",{children:yn(c.key)}),r.jsx("span",{className:"font-medium text-foreground",children:e[c.key]??0})]},c.key))}):null]})}const vL=["pending","active","blocked","failed","completed"],Gg=vL,wL=["draft","pending","ready_for_planning","ready_to_implement","in_progress","blocked","review","completed","failed"];function G1(e){return e&&e.length>0?e:[...wL]}function jL(e,t,n){if(t<0||t>=e.length)return e;const s=[...e],[a]=s.splice(t,1),l=t<n?n-1:n;return s.splice(Math.max(0,Math.min(l,s.length)),0,a),s}const kL=220,Au=8;function Y1({anchor:e,items:t,onClose:n}){const s=f.useRef(null),[a,l]=f.useState(null);return f.useLayoutEffect(()=>{if(!e){l(null);return}const c=s.current,u=(c==null?void 0:c.offsetWidth)??kL,p=(c==null?void 0:c.offsetHeight)??0,m=Math.max(Au,window.innerWidth-u-Au),h=Math.max(Au,window.innerHeight-p-Au);l({left:Math.min(e.x,m),top:Math.min(e.y,h)})},[e]),f.useEffect(()=>{if(!e)return;function c(m){s.current&&!s.current.contains(m.target)&&n()}function u(m){m.key==="Escape"&&n()}function p(){n()}return document.addEventListener("mousedown",c),document.addEventListener("keydown",u),document.addEventListener("contextmenu",c),window.addEventListener("scroll",p,!0),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",u),document.removeEventListener("contextmenu",c),window.removeEventListener("scroll",p,!0)}},[e,n]),!e||t.length===0?null:r.jsx("div",{ref:s,role:"menu",className:"fixed z-50 min-w-[220px] rounded-md border border-border/70 bg-background py-1 shadow-lg",style:{left:(a==null?void 0:a.left)??e.x,top:(a==null?void 0:a.top)??e.y,visibility:a?"visible":"hidden"},children:r.jsx(Wo,{delayDuration:200,children:t.map(c=>{const u=c.icon,p=Se("flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm transition",c.disabled?"cursor-not-allowed opacity-50":c.destructive?"text-destructive hover:bg-destructive/10":"hover:bg-foreground/5"),m=r.jsxs(r.Fragment,{children:[u?r.jsx(u,{className:"h-4 w-4 shrink-0"}):null,r.jsx("span",{className:"block min-w-0 truncate",children:c.label})]});if(c.disabled){const h=r.jsx("span",{tabIndex:0,className:"inline-block w-full outline-none focus-visible:ring-1 focus-visible:ring-ring",children:r.jsx("button",{type:"button",disabled:!0,className:p,children:m})});return c.disabledReason?r.jsxs(Pr,{children:[r.jsx(Ar,{asChild:!0,children:h}),r.jsx(gr,{side:"left",children:c.disabledReason})]},c.key):r.jsx("div",{children:h},c.key)}return c.href?r.jsx(Ee,{to:c.href,className:p,onClick:()=>n(),children:m},c.key):r.jsx("button",{type:"button",className:p,onClick:()=>{var h;(h=c.onSelect)==null||h.call(c),n()},children:m},c.key)})})})}const SL="__ungrouped__";function Yg({open:e,onOpenChange:t,currentWorkspace:n,onSubmit:s,title:a="Move to workspace",description:l="Pick the workspace this item should belong to."}){const{data:c,loading:u}=oc(),[p,m]=f.useState(n),[h,g]=f.useState(!1),[y,b]=f.useState(null);f.useEffect(()=>{e&&(m(n),b(null))},[e,n]);const E=f.useMemo(()=>[...((c==null?void 0:c.workspaces)??[]).map(C=>({key:C,label:C,value:C})),{key:SL,label:"Ungrouped",value:null}],[c]),j=!h&&p!==n;async function w(){if(j){g(!0),b(null);try{await s(p),t(!1)}catch(k){b(k instanceof Error?k.message:"Failed to move item")}finally{g(!1)}}}return r.jsx(ar,{open:e,onOpenChange:k=>h?void 0:t(k),children:r.jsxs(Kn,{children:[r.jsxs(Zr,{children:[r.jsx(qn,{children:a}),r.jsx(gs,{children:l})]}),r.jsx("div",{className:"my-2 max-h-[320px] overflow-y-auto rounded-md border border-border/60",children:u&&E.length===0?r.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 text-sm text-muted-foreground",children:[r.jsx(rg,{className:"h-4 w-4 animate-spin"})," Loading workspaces…"]}):E.map(k=>{const C=k.value===n,N=k.value===p;return r.jsxs("button",{type:"button",disabled:C||h,onClick:()=>m(k.value),className:Se("flex w-full items-center justify-between px-3 py-2 text-left text-sm transition",C?"cursor-not-allowed bg-foreground/5 text-muted-foreground":N?"bg-accent/40 text-foreground":"hover:bg-foreground/5"),children:[r.jsxs("span",{className:Se("block min-w-0 truncate",k.value===null?"italic text-muted-foreground":""),children:[k.label,C?r.jsx("span",{className:"ml-2 text-xs",children:"(current)"}):null]}),N?r.jsx(Xr,{className:"h-4 w-4 text-foreground"}):null]},k.key)})}),y?r.jsx("p",{className:"text-sm text-destructive",role:"alert",children:y}):null,r.jsxs(Ls,{children:[r.jsx("button",{type:"button",onClick:()=>t(!1),disabled:h,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",onClick:w,disabled:!j,className:"shell-action mt-0 shell-action--cta disabled:cursor-not-allowed disabled:opacity-50",children:h?"Moving…":"Move"})]})]})})}function sw(){const{workspace:e}=$t(),t=ln(),n=Dt(),{data:s,loading:a,error:l,refetch:c}=Jo(),u=f.useRef(null);mo("list:projects");const[p,m]=f.useState(""),[h,g]=f.useState("all"),[y,b]=f.useState("all"),[E,j]=f.useState("updated"),[w,k]=hs(),C=w.get("view"),N=C==="table"||C==="kanban"?C:"cards",T=M=>{k(G=>{const A=new URLSearchParams(G);return M==="cards"?A.delete("view"):A.set("view",M),A})},[D,R]=f.useState({}),[$,L]=f.useState(null),[K,B]=f.useState(null),O=f.useMemo(()=>s?s.filter(M=>{if(e){if(e==="_ungrouped"){if(M.workspace!==null)return!1}else if(M.workspace!==e)return!1}return h!=="all"&&M.status!==h||y!=="all"&&!M.tags.includes(y)?!1:p.trim()?`${M.title} ${M.tags.join(" ")} ${M.slug}`.toLowerCase().includes(p.toLowerCase()):!0}).sort((M,G)=>EL(M,G,E)):[],[s,p,h,y,E,e]),W=O.map(M=>`${M.slug}:${M.status}`).join("|");f.useEffect(()=>{R(TL(O))},[W,E]);const se=f.useMemo(()=>{const M=new Map(O.map(G=>[G.slug,G]));return Gg.flatMap(G=>(D[G]??O.filter(F=>F.status===G).map(F=>F.slug)).map(F=>M.get(F)).filter(F=>!!F))},[O,D]),{visibleItems:z,visibleIndexByKey:H}=f.useMemo(()=>{const M=N==="kanban"?se:O,G=new Map;return M.forEach((A,F)=>G.set(A.slug,F)),{visibleItems:M,visibleIndexByKey:G}},[N,O,se]),{hotkeyRowProps:ee}=ac(z,{scope:"list:projects",onOpen:M=>n(`${t}/projects/${M.slug}`)});if(Ht({keys:"/",scope:"list:projects",description:"Focus filter",handler:()=>{var M;return(M=u.current)==null?void 0:M.focus()}}),Ht({keys:"r",scope:"list:projects",description:"Refresh",handler:()=>c()}),a)return r.jsx(mt,{label:"Loading projects…"});if(l||!s)return r.jsx(wt,{error:l||"Project list is unavailable."});const ne=Array.from(new Set(s.flatMap(M=>M.tags))).sort();return r.jsxs("div",{className:"space-y-5",children:[r.jsxs(qg,{children:[r.jsx(tf,{ref:u,value:p,onChange:m,placeholder:"Search by project title or tag"}),r.jsxs("select",{value:h,onChange:M=>g(M.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All statuses"}),r.jsx("option",{value:"pending",children:"Pending"}),r.jsx("option",{value:"active",children:"Active"}),r.jsx("option",{value:"blocked",children:"Blocked"}),r.jsx("option",{value:"failed",children:"Failed"}),r.jsx("option",{value:"completed",children:"Completed"})]}),r.jsxs("select",{value:y,onChange:M=>b(M.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All tags"}),ne.map(M=>r.jsx("option",{value:M,children:M},M))]}),r.jsxs("select",{value:E,onChange:M=>j(M.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"updated",children:"Sort: Updated"}),r.jsx("option",{value:"created",children:"Sort: Created"}),r.jsx("option",{value:"title",children:"Sort: Title"}),r.jsx("option",{value:"attention",children:"Sort: Attention"})]}),r.jsx(nf,{value:N,onChange:M=>T(M),options:[{value:"cards",label:"Cards"},{value:"table",label:"Table"},{value:"kanban",label:"Kanban"}]})]}),O.length===0?s.length===0?r.jsxs("div",{className:"rounded-frame border border-border/60 bg-card px-6 py-16 text-center",children:[r.jsx("p",{className:"eyebrow mx-auto justify-center",children:"Start here"}),r.jsx("h2",{className:"mx-auto mt-4 max-w-2xl text-3xl font-semibold tracking-display text-foreground md:text-4xl",children:"The task manager built for agents, by agents"}),r.jsx("p",{className:"mx-auto mt-3 max-w-xl text-sm leading-6 text-muted-foreground",children:"A project groups assignments, resources, and memories under one objective. Markdown stays authoritative — the dashboard is just a view."}),r.jsxs("div",{className:"mt-6 flex flex-wrap justify-center gap-3",children:[r.jsx(Ee,{className:"shell-action shell-action--solid",to:`${t}/create/project`,children:"Create your first project"}),r.jsx(Ee,{className:"shell-action",to:"/help",children:"Read the spec"})]})]}):r.jsx(St,{title:"No projects match these filters",description:"Adjust the current search and filters or create a new project.",actions:r.jsx(Ee,{className:"shell-action shell-action--solid",to:`${t}/create/project`,children:"Create Project"})}):N==="cards"?r.jsx("div",{className:"grid gap-3 lg:grid-cols-2 2xl:grid-cols-3",children:O.map((M,G)=>r.jsxs(Ee,{to:`${t}/projects/${M.slug}`,className:"block rounded-lg border border-border/60 bg-card/90 p-3 shadow-sm transition hover:border-primary/40 hover:shadow-md",...ee(G),children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:M.title}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",Dn(M.updated)]})]}),r.jsx(pn,{status:M.status})]}),r.jsxs("div",{className:"mt-4 space-y-3",children:[r.jsx(gd,{progress:M.progress,showLegend:!0}),r.jsx("div",{className:"flex flex-wrap gap-2",children:M.tags.map(A=>r.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs text-foreground",children:A},A))}),r.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("p",{className:"text-muted-foreground",children:"Needs attention"}),r.jsx("p",{className:"mt-1 font-semibold text-foreground",children:M.needsAttention.blockedCount+M.needsAttention.failedCount})]}),r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("p",{className:"text-muted-foreground",children:"Assignments"}),r.jsx("p",{className:"mt-1 font-semibold text-foreground",children:M.progress.total})]})]})]})]},M.slug))}):N==="table"?r.jsx(We,{title:`${O.length} project${O.length===1?"":"s"}`,children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[r.jsx("th",{className:"pb-3 font-medium",children:"Project"}),r.jsx("th",{className:"pb-3 font-medium",children:"Status"}),r.jsx("th",{className:"pb-3 font-medium",children:"Progress"}),r.jsx("th",{className:"pb-3 font-medium",children:"Attention"}),r.jsx("th",{className:"pb-3 font-medium",children:"Updated"})]})}),r.jsx("tbody",{children:O.map((M,G)=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",...ee(G),children:[r.jsxs("td",{className:"py-4 pr-4",children:[r.jsx(Ee,{to:`${t}/projects/${M.slug}`,className:"font-semibold text-foreground hover:text-primary",children:M.title}),r.jsx("div",{className:"mt-1 flex flex-wrap gap-2",children:M.tags.map(A=>r.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:A},A))})]}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx(pn,{status:M.status})}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx("div",{className:"min-w-[220px]",children:r.jsx(gd,{progress:M.progress})})}),r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:M.needsAttention.blockedCount+M.needsAttention.failedCount}),r.jsx("td",{className:"py-4 text-muted-foreground",children:Dn(M.updated)})]},M.slug))})]})})}):r.jsx(Qd,{columns:CL,items:se,getItemId:M=>M.slug,getColumnId:M=>M.status,canDrop:({fromColumnId:M,toColumnId:G})=>({allowed:!0,reason:M===G?void 0:"This will set a manual status override on the project."}),onMove:({item:M,fromColumnId:G,toColumnId:A,fromIndex:F,toIndex:Z})=>{if(G===A){const I=D[G]??O.filter(de=>de.status===G).map(de=>de.slug);R(de=>({...de,[G]:jL(I,F,Z)}));return}fetch(`/api/projects/${M.slug}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:A})}).then(()=>{window.location.reload()})},getExternalDragData:M=>({type:"project",id:M.slug}),onCardContextMenu:(M,G)=>{G.preventDefault(),L({project:M,anchor:{x:G.clientX,y:G.clientY}})},emptyMessage:M=>`No ${M.title.toLowerCase()} projects.`,renderCard:(M,{dragging:G})=>{const A=H.get(M.slug)??-1;return r.jsx("div",{...A>=0?ee(A):{},children:r.jsx(RL,{project:M,dragging:G})})}}),r.jsx(Y1,{anchor:($==null?void 0:$.anchor)??null,items:$?[{key:"edit",label:"Edit",icon:bi,onSelect:()=>n(`${t}/projects/${$.project.slug}`)},{key:"move",label:"Move to workspace…",icon:$d,onSelect:()=>B($.project)}]:[],onClose:()=>L(null)}),r.jsx(Yg,{open:K!==null,onOpenChange:M=>{M||B(null)},currentWorkspace:(K==null?void 0:K.workspace)??null,title:"Move project to workspace",onSubmit:async M=>{if(!K)return;const G=await fetch(`/api/projects/${encodeURIComponent(K.slug)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:M})});if(!G.ok){const A=await G.json().catch(()=>({}));throw new Error(A.error||"Failed to move project")}c()}}),r.jsx("div",{className:"rounded-lg border border-border/60 bg-card/80 p-3 text-sm text-muted-foreground",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(ng,{className:"mt-0.5 h-4 w-4"}),r.jsxs("p",{children:["Project status is derived from assignment state by default.",N==="kanban"?" Drag projects between columns or use":" Use"," the status override on the project detail page to set a manual status."]})]})})]})}const NL={pending:"Pending",active:"Active",blocked:"Blocked",failed:"Failed",completed:"Completed"},CL=Gg.map(e=>({id:e,title:NL[e],description:Zd(e)}));function EL(e,t,n){switch(n){case"created":return t.created.localeCompare(e.created);case"title":return e.title.localeCompare(t.title);case"attention":return ow(t)-ow(e);case"updated":default:return t.updated.localeCompare(e.updated)}}function ow(e){return e.needsAttention.failedCount*10+e.needsAttention.blockedCount*5+e.needsAttention.openQuestions}function TL(e){return Object.fromEntries(Gg.map(t=>[t,e.filter(n=>n.status===t).map(n=>n.slug)]))}function RL({project:e,dragging:t}){const n=ln();return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Ee,{to:`${n}/projects/${e.slug}`,className:"text-base font-semibold text-foreground hover:text-primary",children:e.title}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",Dn(e.updated)]})]}),r.jsx(pn,{status:e.status})]}),r.jsx("div",{className:"mt-4",children:r.jsx(gd,{progress:e.progress})}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.tags.map(s=>r.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs text-foreground",children:s},s)),r.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.progress.total," assignments"]}),r.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.needsAttention.blockedCount+e.needsAttention.failedCount," needs attention"]})]}),r.jsx("div",{className:"mt-4 text-xs uppercase tracking-[0.08em] text-muted-foreground",children:t?"Reordering within status":"Derived project lane"})]})}function xd({title:e,description:t,actions:n,className:s}){return r.jsxs("div",{className:Se("flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",s),children:[r.jsxs("div",{className:"space-y-1",children:[e?r.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground sm:text-2xl",children:e}):null,t?r.jsx("p",{className:"max-w-3xl text-sm leading-5 text-muted-foreground",children:t}):null]}),n?r.jsx("div",{className:"flex flex-wrap items-center gap-3",children:n}):null]})}const PL=4e3;function ta(){const[e,t]=f.useState(null),n=f.useRef(null),s=f.useCallback(()=>{n.current!==null&&(clearTimeout(n.current),n.current=null),t(null)},[]),a=f.useCallback((l,c="error")=>{n.current!==null&&clearTimeout(n.current),t({id:Date.now()+Math.random(),message:l,kind:c}),n.current=setTimeout(()=>{t(null),n.current=null},PL)},[]);return f.useEffect(()=>()=>{n.current!==null&&clearTimeout(n.current)},[]),{toast:e,showToast:a,dismissToast:s}}function na({toast:e,onDismiss:t}){if(!e)return null;const n=e.kind==="error";return r.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-50 flex max-w-sm",role:"status","aria-live":"polite",children:r.jsx("button",{type:"button",onClick:t,className:Se("syntaur-toast pointer-events-auto rounded-md border px-4 py-3 text-sm font-medium shadow-lg transition",n?"border-error-foreground/30 bg-error text-error-foreground hover:opacity-90":"border-success-foreground/30 bg-success text-success-foreground hover:opacity-90"),children:e.message},e.id)})}function AL(){return r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-status-archived-foreground/30 bg-status-archived px-2 py-0.5 text-xs font-medium text-status-archived-foreground",children:[r.jsx(Dd,{className:"h-3 w-3"}),"Archived"]})}function aw(e){return e.projectSlug?`/projects/${e.projectSlug}/assignments/${e.slug}`:`/assignments/${e.id}`}function DL(){const{data:e,loading:t,error:n,refetch:s}=wP(),[a,l]=f.useState(null),[c,u]=f.useState(null),[p,m]=f.useState({}),{toast:h,showToast:g,dismissToast:y}=ta();async function b(N,T,D){l(T),u(null);try{const R=await fetch(N,{method:"POST",headers:{"Content-Type":"application/json"}});if(!R.ok){const $=await R.json().catch(()=>null);throw new Error(($==null?void 0:$.error)||`HTTP ${R.status}`)}s(),g(D,"success")}catch(R){u(R instanceof Error?R.message:"Restore failed")}finally{l(null)}}function E(N){return b(`/api/projects/${N.slug}/unarchive`,`project:${N.slug}`,"Project restored")}function j(N){const T=N.projectSlug?`/api/projects/${N.projectSlug}/assignments/${N.slug}/unarchive`:`/api/assignments/${N.id}/unarchive`;return b(T,`assignment:${N.id}`,"Assignment restored")}if(t)return r.jsx(mt,{label:"Loading archived content…"});if(n)return r.jsx(wt,{error:n});const w=(e==null?void 0:e.projects)??[],k=(e==null?void 0:e.assignments)??[],C=w.length===0&&k.length===0;return r.jsxs("div",{className:"space-y-6",children:[r.jsx(na,{toast:h,onDismiss:y}),r.jsx(xd,{title:"Archive",description:"Archived projects and individually-archived assignments. Restoring a project also brings back its cascade-hidden assignments; assignments archived on their own stay archived until restored here."}),c?r.jsx("div",{className:"rounded border border-status-failed-foreground/30 bg-status-failed px-3 py-2 text-sm text-status-failed-foreground",children:c}):null,C?r.jsx(St,{title:"Nothing archived",description:"Archived projects and assignments will appear here, ready to restore."}):r.jsxs(r.Fragment,{children:[w.length>0&&r.jsx(We,{title:"Archived Projects",description:"Restoring a project unhides every cascade-hidden assignment; individually-archived children stay archived.",children:r.jsx("ul",{className:"divide-y divide-border",children:w.map(N=>{const T=p[N.slug]??!1;return r.jsxs("li",{className:"py-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsxs("button",{type:"button",onClick:()=>m(D=>({...D,[N.slug]:!T})),className:"inline-flex items-center gap-1.5 text-left text-sm font-medium text-foreground hover:text-foreground/80","aria-expanded":T,children:[T?r.jsx(br,{className:"h-4 w-4"}):r.jsx(l0,{className:"h-4 w-4"}),r.jsx(eg,{className:"h-4 w-4 text-muted-foreground"}),N.title,r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",N.assignments.length," assignment",N.assignments.length===1?"":"s",")"]})]}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Archived ",N.archivedAt?Lr(N.archivedAt):"with no timestamp",N.archivedReason?` · ${N.archivedReason}`:""]}),r.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[r.jsx(Ee,{to:`/projects/${N.slug}`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Open"}),r.jsxs("button",{type:"button",onClick:()=>E(N),disabled:a===`project:${N.slug}`,className:"inline-flex items-center gap-1.5 rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground disabled:opacity-50",children:[r.jsx(ed,{className:"h-3 w-3"}),"Restore"]})]})]}),T&&N.assignments.length>0&&r.jsx("ul",{className:"mt-2 space-y-1 pl-9",children:N.assignments.map(D=>r.jsxs("li",{className:"flex flex-wrap items-center gap-2 text-sm",children:[r.jsx(Ee,{to:aw(D),className:"text-foreground hover:text-foreground/80",children:D.title}),r.jsx(pn,{status:D.status,showIcon:!1}),r.jsx("span",{className:"text-xs text-muted-foreground",children:D.archived?"Archived individually — stays archived after restore":"Hidden via project — returns on restore"})]},D.id))})]},N.slug)})})}),k.length>0&&r.jsx(We,{title:"Archived Assignments",description:"Individually-archived assignments whose project is still active.",children:r.jsx("ul",{className:"divide-y divide-border",children:k.map(N=>r.jsxs("li",{className:"flex flex-wrap items-center gap-3 py-3",children:[r.jsx(Ee,{to:aw(N),className:"text-sm font-medium text-foreground hover:text-foreground/80",children:N.title}),r.jsx(pn,{status:N.status,showIcon:!1}),r.jsx(AL,{}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[N.projectTitle??"Standalone"," · Archived"," ",N.archivedAt?Lr(N.archivedAt):"with no timestamp",N.archivedReason?` · ${N.archivedReason}`:""]}),r.jsxs("button",{type:"button",onClick:()=>j(N),disabled:a===`assignment:${N.id}`,className:"ml-auto inline-flex items-center gap-1.5 rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground disabled:opacity-50",children:[r.jsx(ed,{className:"h-3 w-3"}),"Restore"]})]},N.id))})})]})]})}const iw="inline-flex max-w-[14rem] items-center gap-1 whitespace-nowrap rounded-full border px-2 py-0.5 text-[11px] font-semibold tracking-wide border-border/60 text-muted-foreground",lw="block min-w-0 truncate";function Jg({externalIds:e,className:t}){return e.length===0?null:r.jsx("span",{className:Se("flex flex-wrap items-center gap-1.5",t),children:e.map((n,s)=>{const a=`${n.system}:${n.id}`,l=`${n.system}:${n.id}:${s}`;return n.url!=null&&n.url.length>0?r.jsxs("a",{href:n.url??void 0,target:"_blank",rel:"noopener noreferrer",className:Se(iw,"transition-colors hover:text-foreground hover:border-foreground/40"),title:`Open ${a} in ${n.system}`,children:[r.jsx("span",{className:lw,children:a}),r.jsx(yi,{className:"h-2.5 w-2.5 shrink-0"})]},l):r.jsx("span",{className:iw,title:a,children:r.jsx("span",{className:lw,children:a})},l)})})}const $L={default:"chrome-card",info:"rounded-lg border border-primary/30 bg-primary/5 p-3 dark:border-primary/40 dark:bg-primary/10",warn:"rounded-lg border border-warning-foreground/30 bg-warning p-3",danger:"rounded-lg border border-error-foreground/30 bg-error p-3",success:"rounded-lg border border-success-foreground/30 bg-success p-3"};function An({label:e,value:t,description:n,icon:s,tone:a="default",to:l}){const c=r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.1em] text-muted-foreground",children:e}),r.jsx("p",{className:"text-2xl font-semibold text-foreground",children:t})]}),s?r.jsx("span",{className:"rounded-md border border-border/60 bg-background/80 p-1.5 text-muted-foreground",children:r.jsx(s,{className:"h-5 w-5"})}):null]}),n?r.jsx("p",{className:"mt-2 text-sm leading-5 text-muted-foreground",children:n}):null]}),u=Se($L[a],l?"block transition hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40":"");return l?r.jsx(Ee,{to:l,className:u,children:c}):r.jsx("article",{className:u,children:c})}function cw(e){const t=LL(e),n=f.forwardRef((s,a)=>{const{children:l,...c}=s,u=f.Children.toArray(l),p=u.find(IL);if(p){const m=p.props.children,h=u.map(g=>g===p?f.Children.count(m)>1?f.Children.only(null):f.isValidElement(m)?m.props.children:null:g);return r.jsx(t,{...c,ref:a,children:f.isValidElement(m)?f.cloneElement(m,void 0,h):null})}return r.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function LL(e){const t=f.forwardRef((n,s)=>{const{children:a,...l}=n;if(f.isValidElement(a)){const c=_L(a),u=ML(l,a.props);return a.type!==f.Fragment&&(u.ref=s?Fd(s,c):c),f.cloneElement(a,u)}return f.Children.count(a)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var OL=Symbol("radix.slottable");function IL(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OL}function ML(e,t){const n={...t};for(const s in t){const a=e[s],l=t[s];/^on[A-Z]/.test(s)?a&&l?n[s]=(...u)=>{const p=l(...u);return a(...u),p}:a&&(n[s]=a):s==="style"?n[s]={...a,...l}:s==="className"&&(n[s]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function _L(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function FL(e){const t=e+"CollectionProvider",[n,s]=Xo(t),[a,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=j=>{const{scope:w,children:k}=j,C=nn.useRef(null),N=nn.useRef(new Map).current;return r.jsx(a,{scope:w,itemMap:N,collectionRef:C,children:k})};c.displayName=t;const u=e+"CollectionSlot",p=cw(u),m=nn.forwardRef((j,w)=>{const{scope:k,children:C}=j,N=l(u,k),T=Fn(w,N.collectionRef);return r.jsx(p,{ref:T,children:C})});m.displayName=u;const h=e+"CollectionItemSlot",g="data-radix-collection-item",y=cw(h),b=nn.forwardRef((j,w)=>{const{scope:k,children:C,...N}=j,T=nn.useRef(null),D=Fn(w,T),R=l(h,k);return nn.useEffect(()=>(R.itemMap.set(T,{ref:T,...N}),()=>void R.itemMap.delete(T))),r.jsx(y,{[g]:"",ref:D,children:C})});b.displayName=h;function E(j){const w=l(e+"CollectionConsumer",j);return nn.useCallback(()=>{const C=w.collectionRef.current;if(!C)return[];const N=Array.from(C.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((R,$)=>N.indexOf(R.ref.current)-N.indexOf($.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:b},E,s]}var zL=f.createContext(void 0);function J1(e){const t=f.useContext(zL);return e||t||"ltr"}var Pm="rovingFocusGroup.onEntryFocus",BL={bubbles:!1,cancelable:!0},dc="RovingFocusGroup",[Nh,X1,UL]=FL(dc),[VL,Q1]=Xo(dc,[UL]),[HL,WL]=VL(dc),Z1=f.forwardRef((e,t)=>r.jsx(Nh.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(Nh.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(KL,{...e,ref:t})})}));Z1.displayName=dc;var KL=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:a=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:h=!1,...g}=e,y=f.useRef(null),b=Fn(t,y),E=J1(l),[j,w]=zd({prop:c,defaultProp:u??null,onChange:p,caller:dc}),[k,C]=f.useState(!1),N=Ko(m),T=X1(n),D=f.useRef(!1),[R,$]=f.useState(0);return f.useEffect(()=>{const L=y.current;if(L)return L.addEventListener(Pm,N),()=>L.removeEventListener(Pm,N)},[N]),r.jsx(HL,{scope:n,orientation:s,dir:E,loop:a,currentTabStopId:j,onItemFocus:f.useCallback(L=>w(L),[w]),onItemShiftTab:f.useCallback(()=>C(!0),[]),onFocusableItemAdd:f.useCallback(()=>$(L=>L+1),[]),onFocusableItemRemove:f.useCallback(()=>$(L=>L-1),[]),children:r.jsx(mn.div,{tabIndex:k||R===0?-1:0,"data-orientation":s,...g,ref:b,style:{outline:"none",...e.style},onMouseDown:qt(e.onMouseDown,()=>{D.current=!0}),onFocus:qt(e.onFocus,L=>{const K=!D.current;if(L.target===L.currentTarget&&K&&!k){const B=new CustomEvent(Pm,BL);if(L.currentTarget.dispatchEvent(B),!B.defaultPrevented){const O=T().filter(ee=>ee.focusable),W=O.find(ee=>ee.active),se=O.find(ee=>ee.id===j),H=[W,se,...O].filter(Boolean).map(ee=>ee.ref.current);nS(H,h)}}D.current=!1}),onBlur:qt(e.onBlur,()=>C(!1))})})}),eS="RovingFocusGroupItem",tS=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:a=!1,tabStopId:l,children:c,...u}=e,p=ni(),m=l||p,h=WL(eS,n),g=h.currentTabStopId===m,y=X1(n),{onFocusableItemAdd:b,onFocusableItemRemove:E,currentTabStopId:j}=h;return f.useEffect(()=>{if(s)return b(),()=>E()},[s,b,E]),r.jsx(Nh.ItemSlot,{scope:n,id:m,focusable:s,active:a,children:r.jsx(mn.span,{tabIndex:g?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:qt(e.onMouseDown,w=>{s?h.onItemFocus(m):w.preventDefault()}),onFocus:qt(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:qt(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){h.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const k=YL(w,h.orientation,h.dir);if(k!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let N=y().filter(T=>T.focusable).map(T=>T.ref.current);if(k==="last")N.reverse();else if(k==="prev"||k==="next"){k==="prev"&&N.reverse();const T=N.indexOf(w.currentTarget);N=h.loop?JL(N,T+1):N.slice(T+1)}setTimeout(()=>nS(N))}}),children:typeof c=="function"?c({isCurrentTabStop:g,hasTabStop:j!=null}):c})})});tS.displayName=eS;var qL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function GL(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function YL(e,t,n){const s=GL(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return qL[s]}function nS(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}function JL(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var XL=Z1,QL=tS,rf="Tabs",[ZL]=Xo(rf,[Q1]),rS=Q1(),[eO,Xg]=ZL(rf),sS=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:a,defaultValue:l,orientation:c="horizontal",dir:u,activationMode:p="automatic",...m}=e,h=J1(u),[g,y]=zd({prop:s,onChange:a,defaultProp:l??"",caller:rf});return r.jsx(eO,{scope:n,baseId:ni(),value:g,onValueChange:y,orientation:c,dir:h,activationMode:p,children:r.jsx(mn.div,{dir:h,"data-orientation":c,...m,ref:t})})});sS.displayName=rf;var oS="TabsList",aS=f.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...a}=e,l=Xg(oS,n),c=rS(n);return r.jsx(XL,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:s,children:r.jsx(mn.div,{role:"tablist","aria-orientation":l.orientation,...a,ref:t})})});aS.displayName=oS;var iS="TabsTrigger",lS=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:a=!1,...l}=e,c=Xg(iS,n),u=rS(n),p=dS(c.baseId,s),m=fS(c.baseId,s),h=s===c.value;return r.jsx(QL,{asChild:!0,...u,focusable:!a,active:h,children:r.jsx(mn.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":m,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:p,...l,ref:t,onMouseDown:qt(e.onMouseDown,g=>{!a&&g.button===0&&g.ctrlKey===!1?c.onValueChange(s):g.preventDefault()}),onKeyDown:qt(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(s)}),onFocus:qt(e.onFocus,()=>{const g=c.activationMode!=="manual";!h&&!a&&g&&c.onValueChange(s)})})})});lS.displayName=iS;var cS="TabsContent",uS=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:a,children:l,...c}=e,u=Xg(cS,n),p=dS(u.baseId,s),m=fS(u.baseId,s),h=s===u.value,g=f.useRef(h);return f.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),r.jsx(Qo,{present:a||h,children:({present:y})=>r.jsx(mn.div,{"data-state":h?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":p,hidden:!y,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:y&&l})})});uS.displayName=cS;function dS(e,t){return`${e}-trigger-${t}`}function fS(e,t){return`${e}-content-${t}`}var pS=sS,mS=aS,Ch=lS,Eh=uS;function Qg({value:e,onValueChange:t,items:n,className:s}){return r.jsxs(pS,{value:e,onValueChange:t,className:s,children:[r.jsx(mS,{className:"scrollbar-none flex gap-2 overflow-x-auto rounded-md border border-border/70 bg-card/80 p-1",children:n.map(a=>r.jsxs(Ch,{value:a.value,className:Se("inline-flex items-center gap-2 rounded-sm px-3 py-1.5 text-sm font-medium text-muted-foreground transition","data-[state=active]:bg-foreground data-[state=active]:text-background"),children:[r.jsx("span",{children:a.label}),typeof a.count=="number"?r.jsx("span",{className:"rounded-full bg-background/20 px-2 py-0.5 text-xs data-[state=active]:bg-background/20",children:a.count}):null]},a.value))}),n.map(a=>r.jsx(Eh,{value:a.value,className:"pt-3",children:a.content},a.value))]})}const tO="modulepreload",nO=function(e){return"/"+e},uw={},rO=function(t,n,s){let a=Promise.resolve();if(n&&n.length>0){let c=function(m){return Promise.all(m.map(h=>Promise.resolve(h).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),p=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));a=c(n.map(m=>{if(m=nO(m),m in uw)return;uw[m]=!0;const h=m.endsWith(".css"),g=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const y=document.createElement("link");if(y.rel=h?"stylesheet":tO,h||(y.as="script"),y.crossOrigin="",y.href=m,p&&y.setAttribute("nonce",p),document.head.appendChild(y),h)return new Promise((b,E)=>{y.addEventListener("load",b),y.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return a.then(c=>{for(const u of c||[])u.status==="rejected"&&l(u.reason);return t().catch(l)})};function sO({definition:e,className:t,nodeRoutes:n={}}){const s=f.useRef(null),[a,l]=f.useState(null),[c,u]=f.useState(!0),p=Dt(),m=document.documentElement.classList.contains("dark")?"dark":"default";return f.useEffect(()=>{let h=!1;async function g(){if(s.current)try{const y=(await rO(async()=>{const{default:j}=await import("./mermaid.core-Cu6allRd.js").then(w=>w.bF);return{default:j}},[])).default;if(y.initialize({startOnLoad:!1,theme:"base",themeVariables:oO(m==="dark")}),h)return;const b=`mermaid-${Date.now()}`,{svg:E}=await y.render(b,e);if(h||!s.current)return;s.current.innerHTML=E,aO(s.current,n,p),u(!1)}catch(y){h||(l(y instanceof Error?y.message:"Failed to render graph"),u(!1))}}return u(!0),l(null),g(),()=>{h=!0}},[e,p,n,m]),a?r.jsxs("div",{className:Se("rounded-lg border border-border bg-card p-4",t),children:[r.jsxs("p",{className:"text-sm text-error-foreground",children:["Failed to render dependency graph: ",a]}),r.jsx("pre",{className:"mt-2 text-xs text-muted-foreground overflow-auto",children:e})]}):r.jsxs("div",{className:Se("rounded-lg border border-border bg-card p-4",t),children:[c&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading graph..."}),r.jsx("div",{ref:s,className:"overflow-auto"})]})}function oO(e){const t=document.documentElement,n=g=>{const y=getComputedStyle(t).getPropertyValue(g).trim();return y?`oklch(${y})`:""},s=n("--card"),a=n("--card-foreground"),l=n("--border"),c=n("--primary"),u=n("--primary-foreground"),p=n("--muted"),m=n("--muted-foreground"),h=n("--secondary");return{background:s,primaryColor:s,primaryTextColor:a,primaryBorderColor:l,secondaryColor:p,secondaryTextColor:a,secondaryBorderColor:l,tertiaryColor:p,tertiaryTextColor:m,tertiaryBorderColor:l,lineColor:e?m:l,textColor:a,mainBkg:s,nodeBkg:s,nodeTextColor:a,nodeBorder:l,clusterBkg:p,clusterBorder:l,edgeLabelBackground:s,titleColor:a,activeTaskBkgColor:c,activeTaskBorderColor:c,altBackground:p,labelColor:a,errorBkgColor:h,errorTextColor:u}}function aO(e,t,n){var s;for(const a of e.querySelectorAll(".node")){const l=((s=a.textContent)==null?void 0:s.replace(/\s+/g," ").trim())??"",c=t[l];if(!c)continue;a.style.cursor="pointer",a.setAttribute("role","link"),a.setAttribute("tabindex","0"),a.setAttribute("aria-label",`Open ${l}`);const u=()=>n(c);a.addEventListener("click",u),a.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),u())})}}function iO(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const lO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uO={};function dw(e,t){return(uO.jsx?cO:lO).test(e)}const dO=/[ \t\n\f\r]/g;function fO(e){return typeof e=="object"?e.type==="text"?fw(e.value):!1:fw(e)}function fw(e){return e.replace(dO,"")===""}class fc{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}fc.prototype.normal={};fc.prototype.property={};fc.prototype.space=void 0;function hS(e,t){const n={},s={};for(const a of e)Object.assign(n,a.property),Object.assign(s,a.normal);return new fc(n,s,t)}function Th(e){return e.toLowerCase()}class ir{constructor(t,n){this.attribute=n,this.property=t}}ir.prototype.attribute="";ir.prototype.booleanish=!1;ir.prototype.boolean=!1;ir.prototype.commaOrSpaceSeparated=!1;ir.prototype.commaSeparated=!1;ir.prototype.defined=!1;ir.prototype.mustUseProperty=!1;ir.prototype.number=!1;ir.prototype.overloadedBoolean=!1;ir.prototype.property="";ir.prototype.spaceSeparated=!1;ir.prototype.space=void 0;let pO=0;const dt=ra(),dn=ra(),Rh=ra(),Te=ra(),It=ra(),li=ra(),pr=ra();function ra(){return 2**++pO}const Ph=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:dn,commaOrSpaceSeparated:pr,commaSeparated:li,number:Te,overloadedBoolean:Rh,spaceSeparated:It},Symbol.toStringTag,{value:"Module"})),Am=Object.keys(Ph);class Zg extends ir{constructor(t,n,s,a){let l=-1;if(super(t,n),pw(this,"space",a),typeof s=="number")for(;++l<Am.length;){const c=Am[l];pw(this,Am[l],(s&Ph[c])===Ph[c])}}}Zg.prototype.defined=!0;function pw(e,t,n){n&&(e[t]=n)}function ki(e){const t={},n={};for(const[s,a]of Object.entries(e.properties)){const l=new Zg(s,e.transform(e.attributes||{},s),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(l.mustUseProperty=!0),t[s]=l,n[Th(s)]=s,n[Th(l.attribute)]=s}return new fc(t,n,e.space)}const gS=ki({properties:{ariaActiveDescendant:null,ariaAtomic:dn,ariaAutoComplete:null,ariaBusy:dn,ariaChecked:dn,ariaColCount:Te,ariaColIndex:Te,ariaColSpan:Te,ariaControls:It,ariaCurrent:null,ariaDescribedBy:It,ariaDetails:null,ariaDisabled:dn,ariaDropEffect:It,ariaErrorMessage:null,ariaExpanded:dn,ariaFlowTo:It,ariaGrabbed:dn,ariaHasPopup:null,ariaHidden:dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:It,ariaLevel:Te,ariaLive:null,ariaModal:dn,ariaMultiLine:dn,ariaMultiSelectable:dn,ariaOrientation:null,ariaOwns:It,ariaPlaceholder:null,ariaPosInSet:Te,ariaPressed:dn,ariaReadOnly:dn,ariaRelevant:null,ariaRequired:dn,ariaRoleDescription:It,ariaRowCount:Te,ariaRowIndex:Te,ariaRowSpan:Te,ariaSelected:dn,ariaSetSize:Te,ariaSort:null,ariaValueMax:Te,ariaValueMin:Te,ariaValueNow:Te,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function xS(e,t){return t in e?e[t]:t}function yS(e,t){return xS(e,t.toLowerCase())}const mO=ki({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:li,acceptCharset:It,accessKey:It,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:It,autoFocus:dt,autoPlay:dt,blocking:It,capture:null,charSet:null,checked:dt,cite:null,className:It,cols:Te,colSpan:null,content:null,contentEditable:dn,controls:dt,controlsList:It,coords:Te|li,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:Rh,draggable:dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:It,height:Te,hidden:Rh,high:Te,href:null,hrefLang:null,htmlFor:It,httpEquiv:It,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:It,itemRef:It,itemScope:dt,itemType:It,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:Te,manifest:null,max:null,maxLength:Te,media:null,method:null,min:null,minLength:Te,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:dt,optimum:Te,pattern:null,ping:It,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:It,required:dt,reversed:dt,rows:Te,rowSpan:Te,sandbox:It,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:Te,sizes:null,slot:null,span:Te,spellCheck:dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Te,step:null,style:null,tabIndex:Te,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:dn,width:Te,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:It,axis:null,background:null,bgColor:null,border:Te,borderColor:null,bottomMargin:Te,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:Te,leftMargin:Te,link:null,longDesc:null,lowSrc:null,marginHeight:Te,marginWidth:Te,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:Te,rules:null,scheme:null,scrolling:dn,standby:null,summary:null,text:null,topMargin:Te,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Te,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:Te,security:null,unselectable:null},space:"html",transform:yS}),hO=ki({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:pr,accentHeight:Te,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Te,amplitude:Te,arabicForm:null,ascent:Te,attributeName:null,attributeType:null,azimuth:Te,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Te,by:null,calcMode:null,capHeight:Te,className:It,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Te,diffuseConstant:Te,direction:null,display:null,dur:null,divisor:Te,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Te,enableBackground:null,end:null,event:null,exponent:Te,externalResourcesRequired:null,fill:null,fillOpacity:Te,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:li,g2:li,glyphName:li,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Te,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Te,horizOriginX:Te,horizOriginY:Te,id:null,ideographic:Te,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Te,k:Te,k1:Te,k2:Te,k3:Te,k4:Te,kernelMatrix:pr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Te,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Te,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Te,overlineThickness:Te,paintOrder:null,panose1:null,path:null,pathLength:Te,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:It,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Te,pointsAtY:Te,pointsAtZ:Te,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pr,rev:pr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pr,requiredFeatures:pr,requiredFonts:pr,requiredFormats:pr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Te,specularExponent:Te,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Te,strikethroughThickness:Te,string:null,stroke:null,strokeDashArray:pr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Te,strokeOpacity:Te,strokeWidth:null,style:null,surfaceScale:Te,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pr,tabIndex:Te,tableValues:null,target:null,targetX:Te,targetY:Te,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Te,underlineThickness:Te,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Te,values:null,vAlphabetic:Te,vMathematical:Te,vectorEffect:null,vHanging:Te,vIdeographic:Te,version:null,vertAdvY:Te,vertOriginX:Te,vertOriginY:Te,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Te,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:xS}),bS=ki({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),vS=ki({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yS}),wS=ki({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),gO={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},xO=/[A-Z]/g,mw=/-[a-z]/g,yO=/^data[-\w.:]+$/i;function bO(e,t){const n=Th(t);let s=t,a=ir;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&yO.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(mw,wO);s="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!mw.test(l)){let c=l.replace(xO,vO);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}a=Zg}return new a(s,t)}function vO(e){return"-"+e.toLowerCase()}function wO(e){return e.charAt(1).toUpperCase()}const jO=hS([gS,mO,bS,vS,wS],"html"),ex=hS([gS,hO,bS,vS,wS],"svg");function kO(e){return e.join(" ").trim()}var Ba={},Dm,hw;function SO(){if(hw)return Dm;hw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,u=/^\s+|\s+$/g,p=`
|
|
531
|
-
`,m="/",h="*",g="",y="comment",b="declaration";function E(w,k){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];k=k||{};var C=1,N=1;function T(z){var H=z.match(t);H&&(C+=H.length);var ee=z.lastIndexOf(p);N=~ee?z.length-ee:N+z.length}function D(){var z={line:C,column:N};return function(H){return H.position=new R(z),K(),H}}function R(z){this.start=z,this.end={line:C,column:N},this.source=k.source}R.prototype.content=w;function $(z){var H=new Error(k.source+":"+C+":"+N+": "+z);if(H.reason=z,H.filename=k.source,H.line=C,H.column=N,H.source=w,!k.silent)throw H}function L(z){var H=z.exec(w);if(H){var ee=H[0];return T(ee),w=w.slice(ee.length),H}}function K(){L(n)}function B(z){var H;for(z=z||[];H=O();)H!==!1&&z.push(H);return z}function O(){var z=D();if(!(m!=w.charAt(0)||h!=w.charAt(1))){for(var H=2;g!=w.charAt(H)&&(h!=w.charAt(H)||m!=w.charAt(H+1));)++H;if(H+=2,g===w.charAt(H-1))return $("End of comment missing");var ee=w.slice(2,H-2);return N+=2,T(ee),w=w.slice(H),N+=2,z({type:y,comment:ee})}}function W(){var z=D(),H=L(s);if(H){if(O(),!L(a))return $("property missing ':'");var ee=L(l),ne=z({type:b,property:j(H[0].replace(e,g)),value:ee?j(ee[0].replace(e,g)):g});return L(c),ne}}function se(){var z=[];B(z);for(var H;H=W();)H!==!1&&(z.push(H),B(z));return z}return K(),se()}function j(w){return w?w.replace(u,g):g}return Dm=E,Dm}var gw;function NO(){if(gw)return Ba;gw=1;var e=Ba&&Ba.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.default=n;const t=e(SO());function n(s,a){let l=null;if(!s||typeof s!="string")return l;const c=(0,t.default)(s),u=typeof a=="function";return c.forEach(p=>{if(p.type!=="declaration")return;const{property:m,value:h}=p;u?a(m,h,p):h&&(l=l||{},l[m]=h)}),l}return Ba}var yl={},xw;function CO(){if(xw)return yl;xw=1,Object.defineProperty(yl,"__esModule",{value:!0}),yl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(m){return!m||n.test(m)||e.test(m)},c=function(m,h){return h.toUpperCase()},u=function(m,h){return"".concat(h,"-")},p=function(m,h){return h===void 0&&(h={}),l(m)?m:(m=m.toLowerCase(),h.reactCompat?m=m.replace(a,u):m=m.replace(s,u),m.replace(t,c))};return yl.camelCase=p,yl}var bl,yw;function EO(){if(yw)return bl;yw=1;var e=bl&&bl.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(NO()),n=CO();function s(a,l){var c={};return!a||typeof a!="string"||(0,t.default)(a,function(u,p){u&&p&&(c[(0,n.camelCase)(u,l)]=p)}),c}return s.default=s,bl=s,bl}var TO=EO();const RO=Td(TO),jS=kS("end"),tx=kS("start");function kS(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function PO(e){const t=tx(e),n=jS(e);if(t&&n)return{start:t,end:n}}function Al(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bw(e.position):"start"in e||"end"in e?bw(e):"line"in e||"column"in e?Ah(e):""}function Ah(e){return vw(e&&e.line)+":"+vw(e&&e.column)}function bw(e){return Ah(e&&e.start)+"-"+Ah(e&&e.end)}function vw(e){return e&&typeof e=="number"?e:1}class zn extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let a="",l={},c=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(c=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof s=="string"){const p=s.indexOf(":");p===-1?l.ruleId=s:(l.source=s.slice(0,p),l.ruleId=s.slice(p+1))}if(!l.place&&l.ancestors&&l.ancestors){const p=l.ancestors[l.ancestors.length-1];p&&(l.place=p.position)}const u=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=u?u.line:void 0,this.name=Al(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=c&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}zn.prototype.file="";zn.prototype.name="";zn.prototype.reason="";zn.prototype.message="";zn.prototype.stack="";zn.prototype.column=void 0;zn.prototype.line=void 0;zn.prototype.ancestors=void 0;zn.prototype.cause=void 0;zn.prototype.fatal=void 0;zn.prototype.place=void 0;zn.prototype.ruleId=void 0;zn.prototype.source=void 0;const nx={}.hasOwnProperty,AO=new Map,DO=/[A-Z]/g,$O=new Set(["table","tbody","thead","tfoot","tr"]),LO=new Set(["td","th"]),SS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function OO(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=VO(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=UO(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ex:jO,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=NS(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function NS(e,t,n){if(t.type==="element")return IO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return MO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return FO(e,t,n);if(t.type==="mdxjsEsm")return _O(e,t);if(t.type==="root")return zO(e,t,n);if(t.type==="text")return BO(e,t)}function IO(e,t,n){const s=e.schema;let a=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(a=ex,e.schema=a),e.ancestors.push(t);const l=ES(e,t.tagName,!1),c=HO(e,t);let u=sx(e,t);return $O.has(t.tagName)&&(u=u.filter(function(p){return typeof p=="string"?!fO(p):!0})),CS(e,c,l,t),rx(c,u),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function MO(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}ql(e,t.position)}function _O(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ql(e,t.position)}function FO(e,t,n){const s=e.schema;let a=s;t.name==="svg"&&s.space==="html"&&(a=ex,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:ES(e,t.name,!0),c=WO(e,t),u=sx(e,t);return CS(e,c,l,t),rx(c,u),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function zO(e,t,n){const s={};return rx(s,sx(e,t)),e.create(t,e.Fragment,s,n)}function BO(e,t){return t.value}function CS(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function rx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function UO(e,t,n){return s;function s(a,l,c,u){const m=Array.isArray(c.children)?n:t;return u?m(l,c,u):m(l,c)}}function VO(e,t){return n;function n(s,a,l,c){const u=Array.isArray(l.children),p=tx(s);return t(a,l,c,u,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function HO(e,t){const n={};let s,a;for(a in t.properties)if(a!=="children"&&nx.call(t.properties,a)){const l=KO(e,a,t.properties[a]);if(l){const[c,u]=l;e.tableCellAlignToStyle&&c==="align"&&typeof u=="string"&&LO.has(t.tagName)?s=u:n[c]=u}}if(s){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function WO(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const l=s.data.estree.body[0];l.type;const c=l.expression;c.type;const u=c.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else ql(e,t.position);else{const a=s.name;let l;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const u=s.value.data.estree.body[0];u.type,l=e.evaluater.evaluateExpression(u.expression)}else ql(e,t.position);else l=s.value===null?!0:s.value;n[a]=l}return n}function sx(e,t){const n=[];let s=-1;const a=e.passKeys?new Map:AO;for(;++s<t.children.length;){const l=t.children[s];let c;if(e.passKeys){const p=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(p){const m=a.get(p)||0;c=p+"-"+m,a.set(p,m+1)}}const u=NS(e,l,c);u!==void 0&&n.push(u)}return n}function KO(e,t,n){const s=bO(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?iO(n):kO(n)),s.property==="style"){let a=typeof n=="object"?n:qO(e,String(n));return e.stylePropertyNameCase==="css"&&(a=GO(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&s.space?gO[s.property]||s.property:s.attribute,n]}}function qO(e,t){try{return RO(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,a=new zn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=SS+"#cannot-parse-style-attribute",a}}function ES(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let l=-1,c;for(;++l<a.length;){const u=dw(a[l])?{type:"Identifier",name:a[l]}:{type:"Literal",value:a[l]};c=c?{type:"MemberExpression",object:c,property:u,computed:!!(l&&u.type==="Literal"),optional:!1}:u}s=c}else s=dw(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const a=s.value;return nx.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(s);ql(e)}function ql(e,t){const n=new zn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=SS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function GO(e){const t={};let n;for(n in e)nx.call(e,n)&&(t[YO(n)]=e[n]);return t}function YO(e){let t=e.replace(DO,JO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function JO(e){return"-"+e.toLowerCase()}const $m={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},XO={};function QO(e,t){const n=XO,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return TS(e,s,a)}function TS(e,t,n){if(ZO(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ww(e.children,t,n)}return Array.isArray(e)?ww(e,t,n):""}function ww(e,t,n){const s=[];let a=-1;for(;++a<e.length;)s[a]=TS(e[a],t,n);return s.join("")}function ZO(e){return!!(e&&typeof e=="object")}const jw=document.createElement("i");function ox(e){const t="&"+e+";";jw.innerHTML=t;const n=jw.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ps(e,t,n,s){const a=e.length;let l=0,c;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,s.length<1e4)c=Array.from(s),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);l<s.length;)c=s.slice(l,l+1e4),c.unshift(t,0),e.splice(...c),l+=1e4,t+=1e4}function Rr(e,t){return e.length>0?(ps(e,e.length,0,t),e):t}const kw={}.hasOwnProperty;function eI(e){const t={};let n=-1;for(;++n<e.length;)tI(t,e[n]);return t}function tI(e,t){let n;for(n in t){const a=(kw.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let c;if(l)for(c in l){kw.call(a,c)||(a[c]=[]);const u=l[c];nI(a[c],Array.isArray(u)?u:u?[u]:[])}}}function nI(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);ps(e,0,0,s)}function RS(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ci(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ls=ho(/[A-Za-z]/),xr=ho(/[\dA-Za-z]/),rI=ho(/[#-'*+\--9=?A-Z^-~]/);function Dh(e){return e!==null&&(e<32||e===127)}const $h=ho(/\d/),sI=ho(/[\dA-Fa-f]/),oI=ho(/[!-/:-@[-`{-~]/);function st(e){return e!==null&&e<-2}function sr(e){return e!==null&&(e<0||e===32)}function Tt(e){return e===-2||e===-1||e===32}const aI=ho(new RegExp("\\p{P}|\\p{S}","u")),iI=ho(/\s/);function ho(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Si(e){const t=[];let n=-1,s=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let c="";if(l===37&&xr(e.charCodeAt(n+1))&&xr(e.charCodeAt(n+2)))a=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(c=String.fromCharCode(l));else if(l>55295&&l<57344){const u=e.charCodeAt(n+1);l<56320&&u>56319&&u<57344?(c=String.fromCharCode(l,u),a=1):c="�"}else c=String.fromCharCode(l);c&&(t.push(e.slice(s,n),encodeURIComponent(c)),s=n+a+1,c=""),a&&(n+=a,a=0)}return t.join("")+e.slice(s)}function Mt(e,t,n,s){const a=s?s-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(p){return Tt(p)?(e.enter(n),u(p)):t(p)}function u(p){return Tt(p)&&l++<a?(e.consume(p),u):(e.exit(n),t(p))}}const lI={tokenize:cI};function cI(e){const t=e.attempt(this.parser.constructs.contentInitial,s,a);let n;return t;function s(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Mt(e,t,"linePrefix")}function a(u){return e.enter("paragraph"),l(u)}function l(u){const p=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=p),n=p,c(u)}function c(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return st(u)?(e.consume(u),e.exit("chunkText"),l):(e.consume(u),c)}}const uI={tokenize:dI},Sw={tokenize:fI};function dI(e){const t=this,n=[];let s=0,a,l,c;return u;function u(N){if(s<n.length){const T=n[s];return t.containerState=T[1],e.attempt(T[0].continuation,p,m)(N)}return m(N)}function p(N){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const T=t.events.length;let D=T,R;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){R=t.events[D][1].end;break}k(s);let $=T;for(;$<t.events.length;)t.events[$][1].end={...R},$++;return ps(t.events,D+1,0,t.events.slice(T)),t.events.length=$,m(N)}return u(N)}function m(N){if(s===n.length){if(!a)return y(N);if(a.currentConstruct&&a.currentConstruct.concrete)return E(N);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Sw,h,g)(N)}function h(N){return a&&C(),k(s),y(N)}function g(N){return t.parser.lazy[t.now().line]=s!==n.length,c=t.now().offset,E(N)}function y(N){return t.containerState={},e.attempt(Sw,b,E)(N)}function b(N){return s++,n.push([t.currentConstruct,t.containerState]),y(N)}function E(N){if(N===null){a&&C(),k(0),e.consume(N);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),j(N)}function j(N){if(N===null){w(e.exit("chunkFlow"),!0),k(0),e.consume(N);return}return st(N)?(e.consume(N),w(e.exit("chunkFlow")),s=0,t.interrupt=void 0,u):(e.consume(N),j)}function w(N,T){const D=t.sliceStream(N);if(T&&D.push(null),N.previous=l,l&&(l.next=N),l=N,a.defineSkip(N.start),a.write(D),t.parser.lazy[N.start.line]){let R=a.events.length;for(;R--;)if(a.events[R][1].start.offset<c&&(!a.events[R][1].end||a.events[R][1].end.offset>c))return;const $=t.events.length;let L=$,K,B;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(K){B=t.events[L][1].end;break}K=!0}for(k(s),R=$;R<t.events.length;)t.events[R][1].end={...B},R++;ps(t.events,L+1,0,t.events.slice($)),t.events.length=R}}function k(N){let T=n.length;for(;T-- >N;){const D=n[T];t.containerState=D[1],D[0].exit.call(t,e)}n.length=N}function C(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function fI(e,t,n){return Mt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Nw(e){if(e===null||sr(e)||iI(e))return 1;if(aI(e))return 2}function ax(e,t,n){const s=[];let a=-1;for(;++a<e.length;){const l=e[a].resolveAll;l&&!s.includes(l)&&(t=l(t,n),s.push(l))}return t}const Lh={name:"attention",resolveAll:pI,tokenize:mI};function pI(e,t){let n=-1,s,a,l,c,u,p,m,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(s=n;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[s][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;p=e[s][1].end.offset-e[s][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[s][1].end},y={...e[n][1].start};Cw(g,-p),Cw(y,p),c={type:p>1?"strongSequence":"emphasisSequence",start:g,end:{...e[s][1].end}},u={type:p>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:p>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},a={type:p>1?"strong":"emphasis",start:{...c.start},end:{...u.end}},e[s][1].end={...c.start},e[n][1].start={...u.end},m=[],e[s][1].end.offset-e[s][1].start.offset&&(m=Rr(m,[["enter",e[s][1],t],["exit",e[s][1],t]])),m=Rr(m,[["enter",a,t],["enter",c,t],["exit",c,t],["enter",l,t]]),m=Rr(m,ax(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),m=Rr(m,[["exit",l,t],["enter",u,t],["exit",u,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,m=Rr(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ps(e,s-1,n-s+3,m),n=s+m.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function mI(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,a=Nw(s);let l;return c;function c(p){return l=p,e.enter("attentionSequence"),u(p)}function u(p){if(p===l)return e.consume(p),u;const m=e.exit("attentionSequence"),h=Nw(p),g=!h||h===2&&a||n.includes(p),y=!a||a===2&&h||n.includes(s);return m._open=!!(l===42?g:g&&(a||!y)),m._close=!!(l===42?y:y&&(h||!g)),t(p)}}function Cw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hI={name:"autolink",tokenize:gI};function gI(e,t,n){let s=0;return a;function a(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return ls(b)?(e.consume(b),c):b===64?n(b):m(b)}function c(b){return b===43||b===45||b===46||xr(b)?(s=1,u(b)):m(b)}function u(b){return b===58?(e.consume(b),s=0,p):(b===43||b===45||b===46||xr(b))&&s++<32?(e.consume(b),u):(s=0,m(b))}function p(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Dh(b)?n(b):(e.consume(b),p)}function m(b){return b===64?(e.consume(b),h):rI(b)?(e.consume(b),m):n(b)}function h(b){return xr(b)?g(b):n(b)}function g(b){return b===46?(e.consume(b),s=0,h):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):y(b)}function y(b){if((b===45||xr(b))&&s++<63){const E=b===45?y:g;return e.consume(b),E}return n(b)}}const sf={partial:!0,tokenize:xI};function xI(e,t,n){return s;function s(l){return Tt(l)?Mt(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||st(l)?t(l):n(l)}}const PS={continuation:{tokenize:bI},exit:vI,name:"blockQuote",tokenize:yI};function yI(e,t,n){const s=this;return a;function a(c){if(c===62){const u=s.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),l}return n(c)}function l(c){return Tt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function bI(e,t,n){const s=this;return a;function a(c){return Tt(c)?Mt(e,l,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return e.attempt(PS,t,n)(c)}}function vI(e){e.exit("blockQuote")}const AS={name:"characterEscape",tokenize:wI};function wI(e,t,n){return s;function s(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),a}function a(l){return oI(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const DS={name:"characterReference",tokenize:jI};function jI(e,t,n){const s=this;let a=0,l,c;return u;function u(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),p}function p(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),l=31,c=xr,h(g))}function m(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,c=sI,h):(e.enter("characterReferenceValue"),l=7,c=$h,h(g))}function h(g){if(g===59&&a){const y=e.exit("characterReferenceValue");return c===xr&&!ox(s.sliceSerialize(y))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&a++<l?(e.consume(g),h):n(g)}}const Ew={partial:!0,tokenize:SI},Tw={concrete:!0,name:"codeFenced",tokenize:kI};function kI(e,t,n){const s=this,a={partial:!0,tokenize:D};let l=0,c=0,u;return p;function p(R){return m(R)}function m(R){const $=s.events[s.events.length-1];return l=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,u=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(R)}function h(R){return R===u?(c++,e.consume(R),h):c<3?n(R):(e.exit("codeFencedFenceSequence"),Tt(R)?Mt(e,g,"whitespace")(R):g(R))}function g(R){return R===null||st(R)?(e.exit("codeFencedFence"),s.interrupt?t(R):e.check(Ew,j,T)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(R))}function y(R){return R===null||st(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(R)):Tt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Mt(e,b,"whitespace")(R)):R===96&&R===u?n(R):(e.consume(R),y)}function b(R){return R===null||st(R)?g(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(R))}function E(R){return R===null||st(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(R)):R===96&&R===u?n(R):(e.consume(R),E)}function j(R){return e.attempt(a,T,w)(R)}function w(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),k}function k(R){return l>0&&Tt(R)?Mt(e,C,"linePrefix",l+1)(R):C(R)}function C(R){return R===null||st(R)?e.check(Ew,j,T)(R):(e.enter("codeFlowValue"),N(R))}function N(R){return R===null||st(R)?(e.exit("codeFlowValue"),C(R)):(e.consume(R),N)}function T(R){return e.exit("codeFenced"),t(R)}function D(R,$,L){let K=0;return B;function B(H){return R.enter("lineEnding"),R.consume(H),R.exit("lineEnding"),O}function O(H){return R.enter("codeFencedFence"),Tt(H)?Mt(R,W,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):W(H)}function W(H){return H===u?(R.enter("codeFencedFenceSequence"),se(H)):L(H)}function se(H){return H===u?(K++,R.consume(H),se):K>=c?(R.exit("codeFencedFenceSequence"),Tt(H)?Mt(R,z,"whitespace")(H):z(H)):L(H)}function z(H){return H===null||st(H)?(R.exit("codeFencedFence"),$(H)):L(H)}}}function SI(e,t,n){const s=this;return a;function a(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l)}function l(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}const Lm={name:"codeIndented",tokenize:CI},NI={partial:!0,tokenize:EI};function CI(e,t,n){const s=this;return a;function a(m){return e.enter("codeIndented"),Mt(e,l,"linePrefix",5)(m)}function l(m){const h=s.events[s.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?c(m):n(m)}function c(m){return m===null?p(m):st(m)?e.attempt(NI,c,p)(m):(e.enter("codeFlowValue"),u(m))}function u(m){return m===null||st(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),u)}function p(m){return e.exit("codeIndented"),t(m)}}function EI(e,t,n){const s=this;return a;function a(c){return s.parser.lazy[s.now().line]?n(c):st(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):Mt(e,l,"linePrefix",5)(c)}function l(c){const u=s.events[s.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(c):st(c)?a(c):n(c)}}const TI={name:"codeText",previous:PI,resolve:RI,tokenize:AI};function RI(e){let t=e.length-4,n=3,s,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s<t;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(s=n-1,t++;++s<=t;)a===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(a=s):(s===t||e[s][1].type==="lineEnding")&&(e[a][1].type="codeTextData",s!==a+2&&(e[a][1].end=e[s-1][1].end,e.splice(a+2,s-a-2),t-=s-a-2,s=a+2),a=void 0);return e}function PI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function AI(e,t,n){let s=0,a,l;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),u(g)}function u(g){return g===96?(e.consume(g),s++,u):(e.exit("codeTextSequence"),p(g))}function p(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),p):g===96?(l=e.enter("codeTextSequence"),a=0,h(g)):st(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("codeTextData"),m(g))}function m(g){return g===null||g===32||g===96||st(g)?(e.exit("codeTextData"),p(g)):(e.consume(g),m)}function h(g){return g===96?(e.consume(g),a++,h):a===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(l.type="codeTextData",m(g))}}class DI{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const s=n??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,n,s){const a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return s&&vl(this.left,s),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),vl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),vl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);vl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);vl(this.left,n.reverse())}}}function vl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $S(e){const t={};let n=-1,s,a,l,c,u,p,m;const h=new DI(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(s=h.get(n),n&&s[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(p=s[1]._tokenizer.events,l=0,l<p.length&&p[l][1].type==="lineEndingBlank"&&(l+=2),l<p.length&&p[l][1].type==="content"))for(;++l<p.length&&p[l][1].type!=="content";)p[l][1].type==="chunkText"&&(p[l][1]._isInFirstContentOfListItem=!0,l++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,$I(h,n)),n=t[n],m=!0);else if(s[1]._container){for(l=n,a=void 0;l--;)if(c=h.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(a&&(h.get(a)[1].type="lineEndingBlank"),c[1].type="lineEnding",a=l);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;a&&(s[1].end={...h.get(a)[1].start},u=h.slice(a,n),u.unshift(s),h.splice(a,n-a+1,u))}}return ps(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!m}function $I(e,t){const n=e.get(t)[1],s=e.get(t)[2];let a=t-1;const l=[];let c=n._tokenizer;c||(c=s.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const u=c.events,p=[],m={};let h,g,y=-1,b=n,E=0,j=0;const w=[j];for(;b;){for(;e.get(++a)[1]!==b;);l.push(a),b._tokenizer||(h=s.sliceStream(b),b.next||h.push(null),g&&c.defineSkip(b.start),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(h),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=n;++y<u.length;)u[y][0]==="exit"&&u[y-1][0]==="enter"&&u[y][1].type===u[y-1][1].type&&u[y][1].start.line!==u[y][1].end.line&&(j=y+1,w.push(j),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(c.events=[],b?(b._tokenizer=void 0,b.previous=void 0):w.pop(),y=w.length;y--;){const k=u.slice(w[y],w[y+1]),C=l.pop();p.push([C,C+k.length-1]),e.splice(C,2,k)}for(p.reverse(),y=-1;++y<p.length;)m[E+p[y][0]]=E+p[y][1],E+=p[y][1]-p[y][0]-1;return m}const LI={resolve:II,tokenize:MI},OI={partial:!0,tokenize:_I};function II(e){return $S(e),e}function MI(e,t){let n;return s;function s(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(u)}function a(u){return u===null?l(u):st(u)?e.check(OI,c,l)(u):(e.consume(u),a)}function l(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function c(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function _I(e,t,n){const s=this;return a;function a(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Mt(e,l,"linePrefix")}function l(c){if(c===null||st(c))return n(c);const u=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(c):e.interrupt(s.parser.constructs.flow,n,t)(c)}}function LS(e,t,n,s,a,l,c,u,p){const m=p||Number.POSITIVE_INFINITY;let h=0;return g;function g(k){return k===60?(e.enter(s),e.enter(a),e.enter(l),e.consume(k),e.exit(l),y):k===null||k===32||k===41||Dh(k)?n(k):(e.enter(s),e.enter(c),e.enter(u),e.enter("chunkString",{contentType:"string"}),j(k))}function y(k){return k===62?(e.enter(l),e.consume(k),e.exit(l),e.exit(a),e.exit(s),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===62?(e.exit("chunkString"),e.exit(u),y(k)):k===null||k===60||st(k)?n(k):(e.consume(k),k===92?E:b)}function E(k){return k===60||k===62||k===92?(e.consume(k),b):b(k)}function j(k){return!h&&(k===null||k===41||sr(k))?(e.exit("chunkString"),e.exit(u),e.exit(c),e.exit(s),t(k)):h<m&&k===40?(e.consume(k),h++,j):k===41?(e.consume(k),h--,j):k===null||k===32||k===40||Dh(k)?n(k):(e.consume(k),k===92?w:j)}function w(k){return k===40||k===41||k===92?(e.consume(k),j):j(k)}}function OS(e,t,n,s,a,l){const c=this;let u=0,p;return m;function m(b){return e.enter(s),e.enter(a),e.consume(b),e.exit(a),e.enter(l),h}function h(b){return u>999||b===null||b===91||b===93&&!p||b===94&&!u&&"_hiddenFootnoteSupport"in c.parser.constructs?n(b):b===93?(e.exit(l),e.enter(a),e.consume(b),e.exit(a),e.exit(s),t):st(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||st(b)||u++>999?(e.exit("chunkString"),h(b)):(e.consume(b),p||(p=!Tt(b)),b===92?y:g)}function y(b){return b===91||b===92||b===93?(e.consume(b),u++,g):g(b)}}function IS(e,t,n,s,a,l){let c;return u;function u(y){return y===34||y===39||y===40?(e.enter(s),e.enter(a),e.consume(y),e.exit(a),c=y===40?41:y,p):n(y)}function p(y){return y===c?(e.enter(a),e.consume(y),e.exit(a),e.exit(s),t):(e.enter(l),m(y))}function m(y){return y===c?(e.exit(l),p(c)):y===null?n(y):st(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Mt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===c||y===null||st(y)?(e.exit("chunkString"),m(y)):(e.consume(y),y===92?g:h)}function g(y){return y===c||y===92?(e.consume(y),h):h(y)}}function Dl(e,t){let n;return s;function s(a){return st(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,s):Tt(a)?Mt(e,s,n?"linePrefix":"lineSuffix")(a):t(a)}}const FI={name:"definition",tokenize:BI},zI={partial:!0,tokenize:UI};function BI(e,t,n){const s=this;let a;return l;function l(b){return e.enter("definition"),c(b)}function c(b){return OS.call(s,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function u(b){return a=ci(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),p):n(b)}function p(b){return sr(b)?Dl(e,m)(b):m(b)}function m(b){return LS(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function h(b){return e.attempt(zI,g,g)(b)}function g(b){return Tt(b)?Mt(e,y,"whitespace")(b):y(b)}function y(b){return b===null||st(b)?(e.exit("definition"),s.parser.defined.push(a),t(b)):n(b)}}function UI(e,t,n){return s;function s(u){return sr(u)?Dl(e,a)(u):n(u)}function a(u){return IS(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function l(u){return Tt(u)?Mt(e,c,"whitespace")(u):c(u)}function c(u){return u===null||st(u)?t(u):n(u)}}const VI={name:"hardBreakEscape",tokenize:HI};function HI(e,t,n){return s;function s(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return st(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const WI={name:"headingAtx",resolve:KI,tokenize:qI};function KI(e,t){let n=e.length-2,s=3,a,l;return e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s&&(a={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},l={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"},ps(e,s,n-s+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function qI(e,t,n){let s=0;return a;function a(h){return e.enter("atxHeading"),l(h)}function l(h){return e.enter("atxHeadingSequence"),c(h)}function c(h){return h===35&&s++<6?(e.consume(h),c):h===null||sr(h)?(e.exit("atxHeadingSequence"),u(h)):n(h)}function u(h){return h===35?(e.enter("atxHeadingSequence"),p(h)):h===null||st(h)?(e.exit("atxHeading"),t(h)):Tt(h)?Mt(e,u,"whitespace")(h):(e.enter("atxHeadingText"),m(h))}function p(h){return h===35?(e.consume(h),p):(e.exit("atxHeadingSequence"),u(h))}function m(h){return h===null||h===35||sr(h)?(e.exit("atxHeadingText"),u(h)):(e.consume(h),m)}}const GI=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Rw=["pre","script","style","textarea"],YI={concrete:!0,name:"htmlFlow",resolveTo:QI,tokenize:ZI},JI={partial:!0,tokenize:t5},XI={partial:!0,tokenize:e5};function QI(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ZI(e,t,n){const s=this;let a,l,c,u,p;return m;function m(I){return h(I)}function h(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),g}function g(I){return I===33?(e.consume(I),y):I===47?(e.consume(I),l=!0,j):I===63?(e.consume(I),a=3,s.interrupt?t:A):ls(I)?(e.consume(I),c=String.fromCharCode(I),w):n(I)}function y(I){return I===45?(e.consume(I),a=2,b):I===91?(e.consume(I),a=5,u=0,E):ls(I)?(e.consume(I),a=4,s.interrupt?t:A):n(I)}function b(I){return I===45?(e.consume(I),s.interrupt?t:A):n(I)}function E(I){const de="CDATA[";return I===de.charCodeAt(u++)?(e.consume(I),u===de.length?s.interrupt?t:W:E):n(I)}function j(I){return ls(I)?(e.consume(I),c=String.fromCharCode(I),w):n(I)}function w(I){if(I===null||I===47||I===62||sr(I)){const de=I===47,ge=c.toLowerCase();return!de&&!l&&Rw.includes(ge)?(a=1,s.interrupt?t(I):W(I)):GI.includes(c.toLowerCase())?(a=6,de?(e.consume(I),k):s.interrupt?t(I):W(I)):(a=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(I):l?C(I):N(I))}return I===45||xr(I)?(e.consume(I),c+=String.fromCharCode(I),w):n(I)}function k(I){return I===62?(e.consume(I),s.interrupt?t:W):n(I)}function C(I){return Tt(I)?(e.consume(I),C):B(I)}function N(I){return I===47?(e.consume(I),B):I===58||I===95||ls(I)?(e.consume(I),T):Tt(I)?(e.consume(I),N):B(I)}function T(I){return I===45||I===46||I===58||I===95||xr(I)?(e.consume(I),T):D(I)}function D(I){return I===61?(e.consume(I),R):Tt(I)?(e.consume(I),D):N(I)}function R(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),p=I,$):Tt(I)?(e.consume(I),R):L(I)}function $(I){return I===p?(e.consume(I),p=null,K):I===null||st(I)?n(I):(e.consume(I),$)}function L(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||sr(I)?D(I):(e.consume(I),L)}function K(I){return I===47||I===62||Tt(I)?N(I):n(I)}function B(I){return I===62?(e.consume(I),O):n(I)}function O(I){return I===null||st(I)?W(I):Tt(I)?(e.consume(I),O):n(I)}function W(I){return I===45&&a===2?(e.consume(I),ee):I===60&&a===1?(e.consume(I),ne):I===62&&a===4?(e.consume(I),F):I===63&&a===3?(e.consume(I),A):I===93&&a===5?(e.consume(I),G):st(I)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(JI,Z,se)(I)):I===null||st(I)?(e.exit("htmlFlowData"),se(I)):(e.consume(I),W)}function se(I){return e.check(XI,z,Z)(I)}function z(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),H}function H(I){return I===null||st(I)?se(I):(e.enter("htmlFlowData"),W(I))}function ee(I){return I===45?(e.consume(I),A):W(I)}function ne(I){return I===47?(e.consume(I),c="",M):W(I)}function M(I){if(I===62){const de=c.toLowerCase();return Rw.includes(de)?(e.consume(I),F):W(I)}return ls(I)&&c.length<8?(e.consume(I),c+=String.fromCharCode(I),M):W(I)}function G(I){return I===93?(e.consume(I),A):W(I)}function A(I){return I===62?(e.consume(I),F):I===45&&a===2?(e.consume(I),A):W(I)}function F(I){return I===null||st(I)?(e.exit("htmlFlowData"),Z(I)):(e.consume(I),F)}function Z(I){return e.exit("htmlFlow"),t(I)}}function e5(e,t,n){const s=this;return a;function a(c){return st(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):n(c)}function l(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}function t5(e,t,n){return s;function s(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(sf,t,n)}}const n5={name:"htmlText",tokenize:r5};function r5(e,t,n){const s=this;let a,l,c;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),p}function p(A){return A===33?(e.consume(A),m):A===47?(e.consume(A),D):A===63?(e.consume(A),N):ls(A)?(e.consume(A),L):n(A)}function m(A){return A===45?(e.consume(A),h):A===91?(e.consume(A),l=0,E):ls(A)?(e.consume(A),C):n(A)}function h(A){return A===45?(e.consume(A),b):n(A)}function g(A){return A===null?n(A):A===45?(e.consume(A),y):st(A)?(c=g,ne(A)):(e.consume(A),g)}function y(A){return A===45?(e.consume(A),b):g(A)}function b(A){return A===62?ee(A):A===45?y(A):g(A)}function E(A){const F="CDATA[";return A===F.charCodeAt(l++)?(e.consume(A),l===F.length?j:E):n(A)}function j(A){return A===null?n(A):A===93?(e.consume(A),w):st(A)?(c=j,ne(A)):(e.consume(A),j)}function w(A){return A===93?(e.consume(A),k):j(A)}function k(A){return A===62?ee(A):A===93?(e.consume(A),k):j(A)}function C(A){return A===null||A===62?ee(A):st(A)?(c=C,ne(A)):(e.consume(A),C)}function N(A){return A===null?n(A):A===63?(e.consume(A),T):st(A)?(c=N,ne(A)):(e.consume(A),N)}function T(A){return A===62?ee(A):N(A)}function D(A){return ls(A)?(e.consume(A),R):n(A)}function R(A){return A===45||xr(A)?(e.consume(A),R):$(A)}function $(A){return st(A)?(c=$,ne(A)):Tt(A)?(e.consume(A),$):ee(A)}function L(A){return A===45||xr(A)?(e.consume(A),L):A===47||A===62||sr(A)?K(A):n(A)}function K(A){return A===47?(e.consume(A),ee):A===58||A===95||ls(A)?(e.consume(A),B):st(A)?(c=K,ne(A)):Tt(A)?(e.consume(A),K):ee(A)}function B(A){return A===45||A===46||A===58||A===95||xr(A)?(e.consume(A),B):O(A)}function O(A){return A===61?(e.consume(A),W):st(A)?(c=O,ne(A)):Tt(A)?(e.consume(A),O):K(A)}function W(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),a=A,se):st(A)?(c=W,ne(A)):Tt(A)?(e.consume(A),W):(e.consume(A),z)}function se(A){return A===a?(e.consume(A),a=void 0,H):A===null?n(A):st(A)?(c=se,ne(A)):(e.consume(A),se)}function z(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||sr(A)?K(A):(e.consume(A),z)}function H(A){return A===47||A===62||sr(A)?K(A):n(A)}function ee(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function ne(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),M}function M(A){return Tt(A)?Mt(e,G,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):G(A)}function G(A){return e.enter("htmlTextData"),c(A)}}const ix={name:"labelEnd",resolveAll:i5,resolveTo:l5,tokenize:c5},s5={tokenize:u5},o5={tokenize:d5},a5={tokenize:f5};function i5(e){let t=-1;const n=[];for(;++t<e.length;){const s=e[t][1];if(n.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const a=s.type==="labelImage"?4:2;s.type="data",t+=a}}return e.length!==n.length&&ps(e,0,e.length,n),e}function l5(e,t){let n=e.length,s=0,a,l,c,u;for(;n--;)if(a=e[n][1],l){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(l=n,a.type!=="labelLink")){s=2;break}}else a.type==="labelEnd"&&(c=n);const p={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[l][1].start},end:{...e[c][1].end}},h={type:"labelText",start:{...e[l+s+2][1].end},end:{...e[c-2][1].start}};return u=[["enter",p,t],["enter",m,t]],u=Rr(u,e.slice(l+1,l+s+3)),u=Rr(u,[["enter",h,t]]),u=Rr(u,ax(t.parser.constructs.insideSpan.null,e.slice(l+s+4,c-3),t)),u=Rr(u,[["exit",h,t],e[c-2],e[c-1],["exit",m,t]]),u=Rr(u,e.slice(c+1)),u=Rr(u,[["exit",p,t]]),ps(e,l,e.length,u),e}function c5(e,t,n){const s=this;let a=s.events.length,l,c;for(;a--;)if((s.events[a][1].type==="labelImage"||s.events[a][1].type==="labelLink")&&!s.events[a][1]._balanced){l=s.events[a][1];break}return u;function u(y){return l?l._inactive?g(y):(c=s.parser.defined.includes(ci(s.sliceSerialize({start:l.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),p):n(y)}function p(y){return y===40?e.attempt(s5,h,c?h:g)(y):y===91?e.attempt(o5,h,c?m:g)(y):c?h(y):g(y)}function m(y){return e.attempt(a5,h,g)(y)}function h(y){return t(y)}function g(y){return l._balanced=!0,n(y)}}function u5(e,t,n){return s;function s(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),a}function a(g){return sr(g)?Dl(e,l)(g):l(g)}function l(g){return g===41?h(g):LS(e,c,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return sr(g)?Dl(e,p)(g):h(g)}function u(g){return n(g)}function p(g){return g===34||g===39||g===40?IS(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):h(g)}function m(g){return sr(g)?Dl(e,h)(g):h(g)}function h(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function d5(e,t,n){const s=this;return a;function a(u){return OS.call(s,e,l,c,"reference","referenceMarker","referenceString")(u)}function l(u){return s.parser.defined.includes(ci(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function c(u){return n(u)}}function f5(e,t,n){return s;function s(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),a}function a(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const p5={name:"labelStartImage",resolveAll:ix.resolveAll,tokenize:m5};function m5(e,t,n){const s=this;return a;function a(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),l}function l(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),c):n(u)}function c(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(u):t(u)}}const h5={name:"labelStartLink",resolveAll:ix.resolveAll,tokenize:g5};function g5(e,t,n){const s=this;return a;function a(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),l}function l(c){return c===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(c):t(c)}}const Om={name:"lineEnding",tokenize:x5};function x5(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Mt(e,t,"linePrefix")}}const Ju={name:"thematicBreak",tokenize:y5};function y5(e,t,n){let s=0,a;return l;function l(m){return e.enter("thematicBreak"),c(m)}function c(m){return a=m,u(m)}function u(m){return m===a?(e.enter("thematicBreakSequence"),p(m)):s>=3&&(m===null||st(m))?(e.exit("thematicBreak"),t(m)):n(m)}function p(m){return m===a?(e.consume(m),s++,p):(e.exit("thematicBreakSequence"),Tt(m)?Mt(e,u,"whitespace")(m):u(m))}}const tr={continuation:{tokenize:j5},exit:S5,name:"list",tokenize:w5},b5={partial:!0,tokenize:N5},v5={partial:!0,tokenize:k5};function w5(e,t,n){const s=this,a=s.events[s.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,c=0;return u;function u(b){const E=s.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!s.containerState.marker||b===s.containerState.marker:$h(b)){if(s.containerState.type||(s.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Ju,n,m)(b):m(b);if(!s.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(b)}return n(b)}function p(b){return $h(b)&&++c<10?(e.consume(b),p):(!s.interrupt||c<2)&&(s.containerState.marker?b===s.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),m(b)):n(b)}function m(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||b,e.check(sf,s.interrupt?n:h,e.attempt(b5,y,g))}function h(b){return s.containerState.initialBlankLine=!0,l++,y(b)}function g(b){return Tt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return s.containerState.size=l+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function j5(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(sf,a,l);function a(u){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,Mt(e,t,"listItemIndent",s.containerState.size+1)(u)}function l(u){return s.containerState.furtherBlankLines||!Tt(u)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(u)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(v5,t,c)(u))}function c(u){return s.containerState._closeFlow=!0,s.interrupt=void 0,Mt(e,e.attempt(tr,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function k5(e,t,n){const s=this;return Mt(e,a,"listItemIndent",s.containerState.size+1);function a(l){const c=s.events[s.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===s.containerState.size?t(l):n(l)}}function S5(e){e.exit(this.containerState.type)}function N5(e,t,n){const s=this;return Mt(e,a,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const c=s.events[s.events.length-1];return!Tt(l)&&c&&c[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Pw={name:"setextUnderline",resolveTo:C5,tokenize:E5};function C5(e,t){let n=e.length,s,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const c={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",c,t]),e.splice(l+1,0,["exit",e[s][1],t]),e[s][1].end={...e[l][1].end}):e[s][1]=c,e.push(["exit",c,t]),e}function E5(e,t,n){const s=this;let a;return l;function l(m){let h=s.events.length,g;for(;h--;)if(s.events[h][1].type!=="lineEnding"&&s.events[h][1].type!=="linePrefix"&&s.events[h][1].type!=="content"){g=s.events[h][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||g)?(e.enter("setextHeadingLine"),a=m,c(m)):n(m)}function c(m){return e.enter("setextHeadingLineSequence"),u(m)}function u(m){return m===a?(e.consume(m),u):(e.exit("setextHeadingLineSequence"),Tt(m)?Mt(e,p,"lineSuffix")(m):p(m))}function p(m){return m===null||st(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const T5={tokenize:R5};function R5(e){const t=this,n=e.attempt(sf,s,e.attempt(this.parser.constructs.flowInitial,a,Mt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(LI,a)),"linePrefix")));return n;function s(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const P5={resolveAll:_S()},A5=MS("string"),D5=MS("text");function MS(e){return{resolveAll:_S(e==="text"?$5:void 0),tokenize:t};function t(n){const s=this,a=this.parser.constructs[e],l=n.attempt(a,c,u);return c;function c(h){return m(h)?l(h):u(h)}function u(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),p}function p(h){return m(h)?(n.exit("data"),l(h)):(n.consume(h),p)}function m(h){if(h===null)return!0;const g=a[h];let y=-1;if(g)for(;++y<g.length;){const b=g[y];if(!b.previous||b.previous.call(s,s.previous))return!0}return!1}}}function _S(e){return t;function t(n,s){let a=-1,l;for(;++a<=n.length;)l===void 0?n[a]&&n[a][1].type==="data"&&(l=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==l+2&&(n[l][1].end=n[a-1][1].end,n.splice(l+2,a-l-2),a=l+2),l=void 0);return e?e(n,s):n}}function $5(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const s=e[n-1][1],a=t.sliceStream(s);let l=a.length,c=-1,u=0,p;for(;l--;){const m=a[l];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)u++,c--;if(c)break;c=-1}else if(m===-2)p=!0,u++;else if(m!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const m={type:n===e.length||p||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:s.start._bufferIndex+c,_index:s.start._index+l,line:s.end.line,column:s.end.column-u,offset:s.end.offset-u},end:{...s.end}};s.end={...m.start},s.start.offset===s.end.offset?Object.assign(s,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const L5={42:tr,43:tr,45:tr,48:tr,49:tr,50:tr,51:tr,52:tr,53:tr,54:tr,55:tr,56:tr,57:tr,62:PS},O5={91:FI},I5={[-2]:Lm,[-1]:Lm,32:Lm},M5={35:WI,42:Ju,45:[Pw,Ju],60:YI,61:Pw,95:Ju,96:Tw,126:Tw},_5={38:DS,92:AS},F5={[-5]:Om,[-4]:Om,[-3]:Om,33:p5,38:DS,42:Lh,60:[hI,n5],91:h5,92:[VI,AS],93:ix,95:Lh,96:TI},z5={null:[Lh,P5]},B5={null:[42,95]},U5={null:[]},V5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:B5,contentInitial:O5,disable:U5,document:L5,flow:M5,flowInitial:I5,insideSpan:z5,string:_5,text:F5},Symbol.toStringTag,{value:"Module"}));function H5(e,t,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},l=[];let c=[],u=[];const p={attempt:$(D),check:$(R),consume:C,enter:N,exit:T,interrupt:$(R,{interrupt:!0})},m={code:null,containerState:{},defineSkip:j,events:[],now:E,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:g};let h=t.tokenize.call(m,p);return t.resolveAll&&l.push(t),m;function g(O){return c=Rr(c,O),w(),c[c.length-1]!==null?[]:(L(t,0),m.events=ax(l,m.events,m),m.events)}function y(O,W){return K5(b(O),W)}function b(O){return W5(c,O)}function E(){const{_bufferIndex:O,_index:W,line:se,column:z,offset:H}=s;return{_bufferIndex:O,_index:W,line:se,column:z,offset:H}}function j(O){a[O.line]=O.column,B()}function w(){let O;for(;s._index<c.length;){const W=c[s._index];if(typeof W=="string")for(O=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===O&&s._bufferIndex<W.length;)k(W.charCodeAt(s._bufferIndex));else k(W)}}function k(O){h=h(O)}function C(O){st(O)?(s.line++,s.column=1,s.offset+=O===-3?2:1,B()):O!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===c[s._index].length&&(s._bufferIndex=-1,s._index++)),m.previous=O}function N(O,W){const se=W||{};return se.type=O,se.start=E(),m.events.push(["enter",se,m]),u.push(se),se}function T(O){const W=u.pop();return W.end=E(),m.events.push(["exit",W,m]),W}function D(O,W){L(O,W.from)}function R(O,W){W.restore()}function $(O,W){return se;function se(z,H,ee){let ne,M,G,A;return Array.isArray(z)?Z(z):"tokenize"in z?Z([z]):F(z);function F(V){return ae;function ae(me){const ve=me!==null&&V[me],ke=me!==null&&V.null,he=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(ke)?ke:ke?[ke]:[]];return Z(he)(me)}}function Z(V){return ne=V,M=0,V.length===0?ee:I(V[M])}function I(V){return ae;function ae(me){return A=K(),G=V,V.partial||(m.currentConstruct=V),V.name&&m.parser.constructs.disable.null.includes(V.name)?ge():V.tokenize.call(W?Object.assign(Object.create(m),W):m,p,de,ge)(me)}}function de(V){return O(G,A),H}function ge(V){return A.restore(),++M<ne.length?I(ne[M]):ee}}}function L(O,W){O.resolveAll&&!l.includes(O)&&l.push(O),O.resolve&&ps(m.events,W,m.events.length-W,O.resolve(m.events.slice(W),m)),O.resolveTo&&(m.events=O.resolveTo(m.events,m))}function K(){const O=E(),W=m.previous,se=m.currentConstruct,z=m.events.length,H=Array.from(u);return{from:z,restore:ee};function ee(){s=O,m.previous=W,m.currentConstruct=se,m.events.length=z,u=H,B()}}function B(){s.line in a&&s.column<2&&(s.column=a[s.line],s.offset+=a[s.line]-1)}}function W5(e,t){const n=t.start._index,s=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;let c;if(n===a)c=[e[n].slice(s,l)];else{if(c=e.slice(n,a),s>-1){const u=c[0];typeof u=="string"?c[0]=u.slice(s):c.shift()}l>0&&c.push(e[a].slice(0,l))}return c}function K5(e,t){let n=-1;const s=[];let a;for(;++n<e.length;){const l=e[n];let c;if(typeof l=="string")c=l;else switch(l){case-5:{c="\r";break}case-4:{c=`
|
|
532
|
-
`;break}case-3:{c=`\r
|
|
533
|
-
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&a)continue;c=" ";break}default:c=String.fromCharCode(l)}a=l===-2,s.push(c)}return s.join("")}function q5(e){const s={constructs:eI([V5,...(e||{}).extensions||[]]),content:a(lI),defined:[],document:a(uI),flow:a(T5),lazy:{},string:a(A5),text:a(D5)};return s;function a(l){return c;function c(u){return H5(s,l,u)}}}function G5(e){for(;!$S(e););return e}const Aw=/[\0\t\n\r]/g;function Y5(){let e=1,t="",n=!0,s;return a;function a(l,c,u){const p=[];let m,h,g,y,b;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(c||void 0).decode(l)),g=0,t="",n&&(l.charCodeAt(0)===65279&&g++,n=void 0);g<l.length;){if(Aw.lastIndex=g,m=Aw.exec(l),y=m&&m.index!==void 0?m.index:l.length,b=l.charCodeAt(y),!m){t=l.slice(g);break}if(b===10&&g===y&&s)p.push(-3),s=void 0;else switch(s&&(p.push(-5),s=void 0),g<y&&(p.push(l.slice(g,y)),e+=y-g),b){case 0:{p.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,p.push(-2);e++<h;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:s=!0,e=1}g=y+1}return u&&(s&&p.push(-5),t&&p.push(t),p.push(null)),p}}const J5=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function X5(e){return e.replace(J5,Q5)}function Q5(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return RS(n.slice(l?2:1),l?16:10)}return ox(n)||e}const FS={}.hasOwnProperty;function Z5(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),eM(n)(G5(q5(n).document().write(Y5()(e,t,!0))))}function eM(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Xe),autolinkProtocol:K,autolinkEmail:K,atxHeading:l(J),blockQuote:l(ke),characterEscape:K,characterReference:K,codeFenced:l(he),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(he,c),codeText:l(Je,c),codeTextData:K,data:K,codeFlowValue:K,definition:l(Ye),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(ot),hardBreakEscape:l(Ie),hardBreakTrailing:l(Ie),htmlFlow:l(Ne,c),htmlFlowData:K,htmlText:l(Ne,c),htmlTextData:K,image:l(Oe),label:c,link:l(Xe),listItem:l(nt),listItemValue:y,listOrdered:l(Me,g),listUnordered:l(Me),paragraph:l(Ke),reference:I,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(J),strong:l(gt),thematicBreak:l(at)},exit:{atxHeading:p(),atxHeadingSequence:D,autolink:p(),autolinkEmail:ve,autolinkProtocol:me,blockQuote:p(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:V,characterReference:ae,codeFenced:p(w),codeFencedFence:j,codeFencedFenceInfo:b,codeFencedFenceMeta:E,codeFlowValue:B,codeIndented:p(k),codeText:p(H),codeTextData:B,data:B,definition:p(),definitionDestinationString:T,definitionLabelString:C,definitionTitleString:N,emphasis:p(),hardBreakEscape:p(W),hardBreakTrailing:p(W),htmlFlow:p(se),htmlFlowData:B,htmlText:p(z),htmlTextData:B,image:p(ne),label:G,labelText:M,lineEnding:O,link:p(ee),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:de,resourceDestinationString:A,resourceTitleString:F,resource:Z,setextHeading:p(L),setextHeadingLineSequence:$,setextHeadingText:R,strong:p(),thematicBreak:p()}};zS(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(ie){let Y={type:"root",children:[]};const pe={stack:[Y],tokenStack:[],config:t,enter:u,exit:m,buffer:c,resume:h,data:n},Q=[];let ye=-1;for(;++ye<ie.length;)if(ie[ye][1].type==="listOrdered"||ie[ye][1].type==="listUnordered")if(ie[ye][0]==="enter")Q.push(ye);else{const Pe=Q.pop();ye=a(ie,Pe,ye)}for(ye=-1;++ye<ie.length;){const Pe=t[ie[ye][0]];FS.call(Pe,ie[ye][1].type)&&Pe[ie[ye][1].type].call(Object.assign({sliceSerialize:ie[ye][2].sliceSerialize},pe),ie[ye][1])}if(pe.tokenStack.length>0){const Pe=pe.tokenStack[pe.tokenStack.length-1];(Pe[1]||Dw).call(pe,void 0,Pe[0])}for(Y.position={start:eo(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:eo(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},ye=-1;++ye<t.transforms.length;)Y=t.transforms[ye](Y)||Y;return Y}function a(ie,Y,pe){let Q=Y-1,ye=-1,Pe=!1,lt,te,be,Le;for(;++Q<=pe;){const it=ie[Q];switch(it[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{it[0]==="enter"?ye++:ye--,Le=void 0;break}case"lineEndingBlank":{it[0]==="enter"&&(lt&&!Le&&!ye&&!be&&(be=Q),Le=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Le=void 0}if(!ye&&it[0]==="enter"&&it[1].type==="listItemPrefix"||ye===-1&&it[0]==="exit"&&(it[1].type==="listUnordered"||it[1].type==="listOrdered")){if(lt){let _e=Q;for(te=void 0;_e--;){const bt=ie[_e];if(bt[1].type==="lineEnding"||bt[1].type==="lineEndingBlank"){if(bt[0]==="exit")continue;te&&(ie[te][1].type="lineEndingBlank",Pe=!0),bt[1].type="lineEnding",te=_e}else if(!(bt[1].type==="linePrefix"||bt[1].type==="blockQuotePrefix"||bt[1].type==="blockQuotePrefixWhitespace"||bt[1].type==="blockQuoteMarker"||bt[1].type==="listItemIndent"))break}be&&(!te||be<te)&&(lt._spread=!0),lt.end=Object.assign({},te?ie[te][1].start:it[1].end),ie.splice(te||Q,0,["exit",lt,it[2]]),Q++,pe++}if(it[1].type==="listItemPrefix"){const _e={type:"listItem",_spread:!1,start:Object.assign({},it[1].start),end:void 0};lt=_e,ie.splice(Q,0,["enter",_e,it[2]]),Q++,pe++,be=void 0,Le=!0}}}return ie[Y][1]._spread=Pe,pe}function l(ie,Y){return pe;function pe(Q){u.call(this,ie(Q),Q),Y&&Y.call(this,Q)}}function c(){this.stack.push({type:"fragment",children:[]})}function u(ie,Y,pe){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([Y,pe||void 0]),ie.position={start:eo(Y.start),end:void 0}}function p(ie){return Y;function Y(pe){ie&&ie.call(this,pe),m.call(this,pe)}}function m(ie,Y){const pe=this.stack.pop(),Q=this.tokenStack.pop();if(Q)Q[0].type!==ie.type&&(Y?Y.call(this,ie,Q[0]):(Q[1]||Dw).call(this,ie,Q[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Al({start:ie.start,end:ie.end})+"): it’s not open");pe.position.end=eo(ie.end)}function h(){return QO(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(ie){if(this.data.expectingFirstListItemValue){const Y=this.stack[this.stack.length-2];Y.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ie=this.resume(),Y=this.stack[this.stack.length-1];Y.lang=ie}function E(){const ie=this.resume(),Y=this.stack[this.stack.length-1];Y.meta=ie}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const ie=this.resume(),Y=this.stack[this.stack.length-1];Y.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ie=this.resume(),Y=this.stack[this.stack.length-1];Y.value=ie.replace(/(\r?\n|\r)$/g,"")}function C(ie){const Y=this.resume(),pe=this.stack[this.stack.length-1];pe.label=Y,pe.identifier=ci(this.sliceSerialize(ie)).toLowerCase()}function N(){const ie=this.resume(),Y=this.stack[this.stack.length-1];Y.title=ie}function T(){const ie=this.resume(),Y=this.stack[this.stack.length-1];Y.url=ie}function D(ie){const Y=this.stack[this.stack.length-1];if(!Y.depth){const pe=this.sliceSerialize(ie).length;Y.depth=pe}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function $(ie){const Y=this.stack[this.stack.length-1];Y.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function K(ie){const pe=this.stack[this.stack.length-1].children;let Q=pe[pe.length-1];(!Q||Q.type!=="text")&&(Q=Rt(),Q.position={start:eo(ie.start),end:void 0},pe.push(Q)),this.stack.push(Q)}function B(ie){const Y=this.stack.pop();Y.value+=this.sliceSerialize(ie),Y.position.end=eo(ie.end)}function O(ie){const Y=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=Y.children[Y.children.length-1];pe.position.end=eo(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Y.type)&&(K.call(this,ie),B.call(this,ie))}function W(){this.data.atHardBreak=!0}function se(){const ie=this.resume(),Y=this.stack[this.stack.length-1];Y.value=ie}function z(){const ie=this.resume(),Y=this.stack[this.stack.length-1];Y.value=ie}function H(){const ie=this.resume(),Y=this.stack[this.stack.length-1];Y.value=ie}function ee(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=Y,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function ne(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=Y,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function M(ie){const Y=this.sliceSerialize(ie),pe=this.stack[this.stack.length-2];pe.label=X5(Y),pe.identifier=ci(Y).toLowerCase()}function G(){const ie=this.stack[this.stack.length-1],Y=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const Q=ie.children;pe.children=Q}else pe.alt=Y}function A(){const ie=this.resume(),Y=this.stack[this.stack.length-1];Y.url=ie}function F(){const ie=this.resume(),Y=this.stack[this.stack.length-1];Y.title=ie}function Z(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function de(ie){const Y=this.resume(),pe=this.stack[this.stack.length-1];pe.label=Y,pe.identifier=ci(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function ge(ie){this.data.characterReferenceType=ie.type}function V(ie){const Y=this.sliceSerialize(ie),pe=this.data.characterReferenceType;let Q;pe?(Q=RS(Y,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Q=ox(Y);const ye=this.stack[this.stack.length-1];ye.value+=Q}function ae(ie){const Y=this.stack.pop();Y.position.end=eo(ie.end)}function me(ie){B.call(this,ie);const Y=this.stack[this.stack.length-1];Y.url=this.sliceSerialize(ie)}function ve(ie){B.call(this,ie);const Y=this.stack[this.stack.length-1];Y.url="mailto:"+this.sliceSerialize(ie)}function ke(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function Je(){return{type:"inlineCode",value:""}}function Ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ot(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function Ie(){return{type:"break"}}function Ne(){return{type:"html",value:""}}function Oe(){return{type:"image",title:null,url:"",alt:null}}function Xe(){return{type:"link",title:null,url:"",children:[]}}function Me(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function nt(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Ke(){return{type:"paragraph",children:[]}}function gt(){return{type:"strong",children:[]}}function Rt(){return{type:"text",value:""}}function at(){return{type:"thematicBreak"}}}function eo(e){return{line:e.line,column:e.column,offset:e.offset}}function zS(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?zS(e,s):tM(e,s)}}function tM(e,t){let n;for(n in t)if(FS.call(t,n))switch(n){case"canContainEols":{const s=t[n];s&&e[n].push(...s);break}case"transforms":{const s=t[n];s&&e[n].push(...s);break}case"enter":case"exit":{const s=t[n];s&&Object.assign(e[n],s);break}}}function Dw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Al({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Al({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Al({start:t.start,end:t.end})+") is still open")}function nM(e){const t=this;t.parser=n;function n(s){return Z5(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function rM(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function sM(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
534
|
-
`}]}function oM(e,t){const n=t.value?t.value+`
|
|
535
|
-
`:"",s={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(s.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function aM(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iM(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lM(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),a=Si(s.toLowerCase()),l=e.footnoteOrder.indexOf(s);let c,u=e.footnoteCounts.get(s);u===void 0?(u=0,e.footnoteOrder.push(s),c=e.footnoteOrder.length):c=l+1,u+=1,e.footnoteCounts.set(s,u);const p={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,p);const m={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,m),e.applyData(t,m)}function cM(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uM(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function BS(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const c=a[a.length-1];return c&&c.type==="text"?c.value+=s:a.push({type:"text",value:s}),a}function dM(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return BS(e,t);const a={src:Si(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(a.title=s.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function fM(e,t){const n={src:Si(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function pM(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,s),e.applyData(t,s)}function mM(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return BS(e,t);const a={href:Si(s.url||"")};s.title!==null&&s.title!==void 0&&(a.title=s.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function hM(e,t){const n={href:Si(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function gM(e,t,n){const s=e.all(t),a=n?xM(n):US(t),l={},c=[];if(typeof t.checked=="boolean"){const h=s[0];let g;h&&h.type==="element"&&h.tagName==="p"?g=h:(g={type:"element",tagName:"p",properties:{},children:[]},s.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let u=-1;for(;++u<s.length;){const h=s[u];(a||u!==0||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
|
|
536
|
-
`}),h.type==="element"&&h.tagName==="p"&&!a?c.push(...h.children):c.push(h)}const p=s[s.length-1];p&&(a||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
|
|
537
|
-
`});const m={type:"element",tagName:"li",properties:l,children:c};return e.patch(t,m),e.applyData(t,m)}function xM(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let s=-1;for(;!t&&++s<n.length;)t=US(n[s])}return t}function US(e){const t=e.spread;return t??e.children.length>1}function yM(e,t){const n={},s=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<s.length;){const c=s[a];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function bM(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vM(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function wM(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jM(e,t){const n=e.all(t),s=n.shift(),a=[];if(s){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],c),a.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=tx(t.children[1]),p=jS(t.children[t.children.length-1]);u&&p&&(c.position={start:u,end:p}),a.push(c)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function kM(e,t,n){const s=n?n.children:void 0,l=(s?s.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,u=c?c.length:t.children.length;let p=-1;const m=[];for(;++p<u;){const g=t.children[p],y={},b=c?c[p]:void 0;b&&(y.align=b);let E={type:"element",tagName:l,properties:y,children:[]};g&&(E.children=e.all(g),e.patch(g,E),E=e.applyData(g,E)),m.push(E)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,h),e.applyData(t,h)}function SM(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const $w=9,Lw=32;function NM(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),a=0;const l=[];for(;s;)l.push(Ow(t.slice(a,s.index),a>0,!0),s[0]),a=s.index+s[0].length,s=n.exec(t);return l.push(Ow(t.slice(a),a>0,!1)),l.join("")}function Ow(e,t,n){let s=0,a=e.length;if(t){let l=e.codePointAt(s);for(;l===$w||l===Lw;)s++,l=e.codePointAt(s)}if(n){let l=e.codePointAt(a-1);for(;l===$w||l===Lw;)a--,l=e.codePointAt(a-1)}return a>s?e.slice(s,a):""}function CM(e,t){const n={type:"text",value:NM(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function EM(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const TM={blockquote:rM,break:sM,code:oM,delete:aM,emphasis:iM,footnoteReference:lM,heading:cM,html:uM,imageReference:dM,image:fM,inlineCode:pM,linkReference:mM,link:hM,listItem:gM,list:yM,paragraph:bM,root:vM,strong:wM,table:jM,tableCell:SM,tableRow:kM,text:CM,thematicBreak:EM,toml:Du,yaml:Du,definition:Du,footnoteDefinition:Du};function Du(){}const VS=-1,of=0,$l=1,yd=2,lx=3,cx=4,ux=5,dx=6,HS=7,WS=8,Iw=typeof self=="object"?self:globalThis,RM=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),s=a=>{if(e.has(a))return e.get(a);const[l,c]=t[a];switch(l){case of:case VS:return n(c,a);case $l:{const u=n([],a);for(const p of c)u.push(s(p));return u}case yd:{const u=n({},a);for(const[p,m]of c)u[s(p)]=s(m);return u}case lx:return n(new Date(c),a);case cx:{const{source:u,flags:p}=c;return n(new RegExp(u,p),a)}case ux:{const u=n(new Map,a);for(const[p,m]of c)u.set(s(p),s(m));return u}case dx:{const u=n(new Set,a);for(const p of c)u.add(s(p));return u}case HS:{const{name:u,message:p}=c;return n(new Iw[u](p),a)}case WS:return n(BigInt(c),a);case"BigInt":return n(Object(BigInt(c)),a);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:u}=new Uint8Array(c);return n(new DataView(u),c)}}return n(new Iw[l](c),a)};return s},Mw=e=>RM(new Map,e)(0),Ua="",{toString:PM}={},{keys:AM}=Object,wl=e=>{const t=typeof e;if(t!=="object"||!e)return[of,t];const n=PM.call(e).slice(8,-1);switch(n){case"Array":return[$l,Ua];case"Object":return[yd,Ua];case"Date":return[lx,Ua];case"RegExp":return[cx,Ua];case"Map":return[ux,Ua];case"Set":return[dx,Ua];case"DataView":return[$l,n]}return n.includes("Array")?[$l,n]:n.includes("Error")?[HS,n]:[yd,n]},$u=([e,t])=>e===of&&(t==="function"||t==="symbol"),DM=(e,t,n,s)=>{const a=(c,u)=>{const p=s.push(c)-1;return n.set(u,p),p},l=c=>{if(n.has(c))return n.get(c);let[u,p]=wl(c);switch(u){case of:{let h=c;switch(p){case"bigint":u=WS,h=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);h=null;break;case"undefined":return a([VS],c)}return a([u,h],c)}case $l:{if(p){let y=c;return p==="DataView"?y=new Uint8Array(c.buffer):p==="ArrayBuffer"&&(y=new Uint8Array(c)),a([p,[...y]],c)}const h=[],g=a([u,h],c);for(const y of c)h.push(l(y));return g}case yd:{if(p)switch(p){case"BigInt":return a([p,c.toString()],c);case"Boolean":case"Number":case"String":return a([p,c.valueOf()],c)}if(t&&"toJSON"in c)return l(c.toJSON());const h=[],g=a([u,h],c);for(const y of AM(c))(e||!$u(wl(c[y])))&&h.push([l(y),l(c[y])]);return g}case lx:return a([u,c.toISOString()],c);case cx:{const{source:h,flags:g}=c;return a([u,{source:h,flags:g}],c)}case ux:{const h=[],g=a([u,h],c);for(const[y,b]of c)(e||!($u(wl(y))||$u(wl(b))))&&h.push([l(y),l(b)]);return g}case dx:{const h=[],g=a([u,h],c);for(const y of c)(e||!$u(wl(y)))&&h.push(l(y));return g}}const{message:m}=c;return a([u,{name:p,message:m}],c)};return l},_w=(e,{json:t,lossy:n}={})=>{const s=[];return DM(!(t||n),!!t,new Map,s)(e),s},bd=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Mw(_w(e,t)):structuredClone(e):(e,t)=>Mw(_w(e,t));function $M(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function LM(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function OM(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||$M,s=e.options.footnoteBackLabel||LM,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let p=-1;for(;++p<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[p]);if(!m)continue;const h=e.all(m),g=String(m.identifier).toUpperCase(),y=Si(g.toLowerCase());let b=0;const E=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++b<=j;){E.length>0&&E.push({type:"text",value:" "});let C=typeof n=="string"?n:n(p,b);typeof C=="string"&&(C={type:"text",value:C}),E.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(p,b),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const w=h[h.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const C=w.children[w.children.length-1];C&&C.type==="text"?C.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...E)}else h.push(...E);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(h,!0)};e.patch(m,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...bd(c),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
538
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
539
|
-
`}]}}const KS=(function(e){if(e==null)return FM;if(typeof e=="function")return af(e);if(typeof e=="object")return Array.isArray(e)?IM(e):MM(e);if(typeof e=="string")return _M(e);throw new Error("Expected function, string, or object as test")});function IM(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=KS(e[n]);return af(s);function s(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function MM(e){const t=e;return af(n);function n(s){const a=s;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function _M(e){return af(t);function t(n){return n&&n.type===e}}function af(e){return t;function t(n,s,a){return!!(zM(n)&&e.call(this,n,typeof s=="number"?s:void 0,a||void 0))}}function FM(){return!0}function zM(e){return e!==null&&typeof e=="object"&&"type"in e}const qS=[],BM=!0,Fw=!1,UM="skip";function VM(e,t,n,s){let a;typeof t=="function"&&typeof n!="function"?(s=n,n=t):a=t;const l=KS(a),c=s?-1:1;u(e,void 0,[])();function u(p,m,h){const g=p&&typeof p=="object"?p:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(p.type+(b?"<"+b+">":""))+")"})}return y;function y(){let b=qS,E,j,w;if((!t||l(p,m,h[h.length-1]||void 0))&&(b=HM(n(p,h)),b[0]===Fw))return b;if("children"in p&&p.children){const k=p;if(k.children&&b[0]!==UM)for(j=(s?k.children.length:-1)+c,w=h.concat(k);j>-1&&j<k.children.length;){const C=k.children[j];if(E=u(C,j,w)(),E[0]===Fw)return E;j=typeof E[1]=="number"?E[1]:j+c}}return b}}}function HM(e){return Array.isArray(e)?e:typeof e=="number"?[BM,e]:e==null?qS:[e]}function GS(e,t,n,s){let a,l,c;typeof t=="function"&&typeof n!="function"?(l=void 0,c=t,a=n):(l=t,c=n,a=s),VM(e,l,u,a);function u(p,m){const h=m[m.length-1],g=h?h.children.indexOf(p):void 0;return c(p,g,h)}}const Oh={}.hasOwnProperty,WM={};function KM(e,t){const n=t||WM,s=new Map,a=new Map,l=new Map,c={...TM,...n.handlers},u={all:m,applyData:GM,definitionById:s,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:c,one:p,options:n,patch:qM,wrap:JM};return GS(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const g=h.type==="definition"?s:a,y=String(h.identifier).toUpperCase();g.has(y)||g.set(y,h)}}),u;function p(h,g){const y=h.type,b=u.handlers[y];if(Oh.call(u.handlers,y)&&b)return b(u,h,g);if(u.options.passThrough&&u.options.passThrough.includes(y)){if("children"in h){const{children:j,...w}=h,k=bd(w);return k.children=u.all(h),k}return bd(h)}return(u.options.unknownHandler||YM)(u,h,g)}function m(h){const g=[];if("children"in h){const y=h.children;let b=-1;for(;++b<y.length;){const E=u.one(y[b],h);if(E){if(b&&y[b-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=zw(E.value)),!Array.isArray(E)&&E.type==="element")){const j=E.children[0];j&&j.type==="text"&&(j.value=zw(j.value))}Array.isArray(E)?g.push(...E):g.push(E)}}}return g}}function qM(e,t){e.position&&(t.position=PO(e))}function GM(e,t){let n=t;if(e&&e.data){const s=e.data.hName,a=e.data.hChildren,l=e.data.hProperties;if(typeof s=="string")if(n.type==="element")n.tagName=s;else{const c="children"in n?n.children:[n];n={type:"element",tagName:s,properties:{},children:c}}n.type==="element"&&l&&Object.assign(n.properties,bd(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function YM(e,t){const n=t.data||{},s="value"in t&&!(Oh.call(n,"hProperties")||Oh.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function JM(e,t){const n=[];let s=-1;for(t&&n.push({type:"text",value:`
|
|
540
|
-
`});++s<e.length;)s&&n.push({type:"text",value:`
|
|
541
|
-
`}),n.push(e[s]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
542
|
-
`}),n}function zw(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Bw(e,t){const n=KM(e,t),s=n.one(e,void 0),a=OM(n),l=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return a&&l.children.push({type:"text",value:`
|
|
543
|
-
`},a),l}function XM(e,t){return e&&"run"in e?async function(n,s){const a=Bw(n,{file:s,...t});await e.run(a,s)}:function(n,s){return Bw(n,{file:s,...e||t})}}function Uw(e){if(e)throw e}var Im,Vw;function QM(){if(Vw)return Im;Vw=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},l=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var h=e.call(m,"constructor"),g=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!h&&!g)return!1;var y;for(y in m);return typeof y>"u"||e.call(m,y)},c=function(m,h){n&&h.name==="__proto__"?n(m,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):m[h.name]=h.newValue},u=function(m,h){if(h==="__proto__")if(e.call(m,h)){if(s)return s(m,h).value}else return;return m[h]};return Im=function p(){var m,h,g,y,b,E,j=arguments[0],w=1,k=arguments.length,C=!1;for(typeof j=="boolean"&&(C=j,j=arguments[1]||{},w=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});w<k;++w)if(m=arguments[w],m!=null)for(h in m)g=u(j,h),y=u(m,h),j!==y&&(C&&y&&(l(y)||(b=a(y)))?(b?(b=!1,E=g&&a(g)?g:[]):E=g&&l(g)?g:{},c(j,{name:h,newValue:p(C,E,y)})):typeof y<"u"&&c(j,{name:h,newValue:y}));return j},Im}var ZM=QM();const Mm=Td(ZM);function Ih(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function e_(){const e=[],t={run:n,use:s};return t;function n(...a){let l=-1;const c=a.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);u(null,...a);function u(p,...m){const h=e[++l];let g=-1;if(p){c(p);return}for(;++g<a.length;)(m[g]===null||m[g]===void 0)&&(m[g]=a[g]);a=m,h?t_(h,u)(...m):c(null,...m)}}function s(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function t_(e,t){let n;return s;function s(...c){const u=e.length>c.length;let p;u&&c.push(a);try{p=e.apply(this,c)}catch(m){const h=m;if(u&&n)throw h;return a(h)}u||(p&&p.then&&typeof p.then=="function"?p.then(l,a):p instanceof Error?a(p):l(p))}function a(c,...u){n||(n=!0,t(c,...u))}function l(c){a(null,c)}}const as={basename:n_,dirname:r_,extname:s_,join:o_,sep:"/"};function n_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');pc(e);let n=0,s=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else s<0&&(l=!0,s=a+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let c=-1,u=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else c<0&&(l=!0,c=a+1),u>-1&&(e.codePointAt(a)===t.codePointAt(u--)?u<0&&(s=a):(u=-1,s=c));return n===s?s=c:s<0&&(s=e.length),e.slice(n,s)}function r_(e){if(pc(e),e.length===0)return".";let t=-1,n=e.length,s;for(;--n;)if(e.codePointAt(n)===47){if(s){t=n;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function s_(e){pc(e);let t=e.length,n=-1,s=0,a=-1,l=0,c;for(;t--;){const u=e.codePointAt(t);if(u===47){if(c){s=t+1;break}continue}n<0&&(c=!0,n=t+1),u===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===s+1?"":e.slice(a,n)}function o_(...e){let t=-1,n;for(;++t<e.length;)pc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":a_(n)}function a_(e){pc(e);const t=e.codePointAt(0)===47;let n=i_(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function i_(e,t){let n="",s=0,a=-1,l=0,c=-1,u,p;for(;++c<=e.length;){if(c<e.length)u=e.codePointAt(c);else{if(u===47)break;u=47}if(u===47){if(!(a===c-1||l===1))if(a!==c-1&&l===2){if(n.length<2||s!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(p=n.lastIndexOf("/"),p!==n.length-1){p<0?(n="",s=0):(n=n.slice(0,p),s=n.length-1-n.lastIndexOf("/")),a=c,l=0;continue}}else if(n.length>0){n="",s=0,a=c,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(a+1,c):n=e.slice(a+1,c),s=c-a-1;a=c,l=0}else u===46&&l>-1?l++:l=-1}return n}function pc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const l_={cwd:c_};function c_(){return"/"}function Mh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function u_(e){if(typeof e=="string")e=new URL(e);else if(!Mh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return d_(e)}function d_(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const s=t.codePointAt(n+2);if(s===70||s===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const _m=["history","path","basename","stem","extname","dirname"];class YS{constructor(t){let n;t?Mh(t)?n={path:t}:typeof t=="string"||f_(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":l_.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<_m.length;){const l=_m[s];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let a;for(a in n)_m.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?as.basename(this.path):void 0}set basename(t){zm(t,"basename"),Fm(t,"basename"),this.path=as.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?as.dirname(this.path):void 0}set dirname(t){Hw(this.basename,"dirname"),this.path=as.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?as.extname(this.path):void 0}set extname(t){if(Fm(t,"extname"),Hw(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=as.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Mh(t)&&(t=u_(t)),zm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?as.basename(this.path,this.extname):void 0}set stem(t){zm(t,"stem"),Fm(t,"stem"),this.path=as.join(this.dirname||"",t+(this.extname||""))}fail(t,n,s){const a=this.message(t,n,s);throw a.fatal=!0,a}info(t,n,s){const a=this.message(t,n,s);return a.fatal=void 0,a}message(t,n,s){const a=new zn(t,n,s);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Fm(e,t){if(e&&e.includes(as.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+as.sep+"`")}function zm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Hw(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function f_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const p_=(function(e){const s=this.constructor.prototype,a=s[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,s),l}),m_={}.hasOwnProperty;class fx extends p_{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=e_()}copy(){const t=new fx;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(Mm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Vm("data",this.frozen),this.namespace[t]=n,this):m_.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Vm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const a=n.call(t,...s);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Lu(t),s=this.parser||this.Parser;return Bm("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),Bm("process",this.parser||this.Parser),Um("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,c){const u=Lu(t),p=s.parse(u);s.run(p,u,function(h,g,y){if(h||!g||!y)return m(h);const b=g,E=s.stringify(b,y);x_(E)?y.value=E:y.result=E,m(h,y)});function m(h,g){h||!g?c(h):l?l(g):n(void 0,g)}}}processSync(t){let n=!1,s;return this.freeze(),Bm("processSync",this.parser||this.Parser),Um("processSync",this.compiler||this.Compiler),this.process(t,a),Kw("processSync","process",n),s;function a(l,c){n=!0,Uw(l),s=c}}run(t,n,s){Ww(t),this.freeze();const a=this.transformers;return!s&&typeof n=="function"&&(s=n,n=void 0),s?l(void 0,s):new Promise(l);function l(c,u){const p=Lu(n);a.run(t,p,m);function m(h,g,y){const b=g||t;h?u(h):c?c(b):s(void 0,b,y)}}}runSync(t,n){let s=!1,a;return this.run(t,n,l),Kw("runSync","run",s),a;function l(c,u){Uw(c),a=u,s=!0}}stringify(t,n){this.freeze();const s=Lu(n),a=this.compiler||this.Compiler;return Um("stringify",a),Ww(t),a(t,s)}use(t,...n){const s=this.attachers,a=this.namespace;if(Vm("use",this.frozen),t!=null)if(typeof t=="function")p(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(m){if(typeof m=="function")p(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[h,...g]=m;p(h,g)}else c(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function c(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(m.plugins),m.settings&&(a.settings=Mm(!0,a.settings,m.settings))}function u(m){let h=-1;if(m!=null)if(Array.isArray(m))for(;++h<m.length;){const g=m[h];l(g)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function p(m,h){let g=-1,y=-1;for(;++g<s.length;)if(s[g][0]===m){y=g;break}if(y===-1)s.push([m,...h]);else if(h.length>0){let[b,...E]=h;const j=s[y][1];Ih(j)&&Ih(b)&&(b=Mm(!0,j,b)),s[y]=[m,b,...E]}}}}const h_=new fx().freeze();function Bm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Um(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Vm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ww(e){if(!Ih(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Kw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Lu(e){return g_(e)?e:new YS(e)}function g_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function x_(e){return typeof e=="string"||y_(e)}function y_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const b_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",qw=[],Gw={allowDangerousHtml:!0},v_=/^(https?|ircs?|mailto|xmpp)$/i,w_=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function j_(e){const t=k_(e),n=S_(e);return N_(t.runSync(t.parse(n),n),e)}function k_(e){const t=e.rehypePlugins||qw,n=e.remarkPlugins||qw,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gw}:Gw;return h_().use(nM).use(n).use(XM,s).use(t)}function S_(e){const t=e.children||"",n=new YS;return typeof t=="string"&&(n.value=t),n}function N_(e,t){const n=t.allowedElements,s=t.allowElement,a=t.components,l=t.disallowedElements,c=t.skipHtml,u=t.unwrapDisallowed,p=t.urlTransform||C_;for(const h of w_)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+b_+h.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),GS(e,m),OO(e,{Fragment:r.Fragment,components:a,ignoreInvalidStyle:!0,jsx:r.jsx,jsxs:r.jsxs,passKeys:!0,passNode:!0});function m(h,g,y){if(h.type==="raw"&&y&&typeof g=="number")return c?y.children.splice(g,1):y.children[g]={type:"text",value:h.value},g;if(h.type==="element"){let b;for(b in $m)if(Object.hasOwn($m,b)&&Object.hasOwn(h.properties,b)){const E=h.properties[b],j=$m[b];(j===null||j.includes(h.tagName))&&(h.properties[b]=p(String(E||""),b,h))}}if(h.type==="element"){let b=n?!n.includes(h.tagName):l?l.includes(h.tagName):!1;if(!b&&s&&typeof g=="number"&&(b=!s(h,g,y)),b&&y&&typeof g=="number")return u&&h.children?y.children.splice(g,1,...h.children):y.children.splice(g,1),g}}}function C_(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||s!==-1&&t>s||v_.test(e.slice(0,t))?e:""}function fn({content:e,className:t,emptyState:n="No markdown content yet."}){const s=e.replace(/<!--[\s\S]*?-->/g,"");return s.trim()?r.jsx("div",{className:Se("prose-syntaur max-w-none",t),children:r.jsx(j_,{children:s})}):r.jsx("div",{className:"rounded-md border border-dashed border-border/80 bg-muted/30 px-3 py-4 text-sm text-muted-foreground",children:n})}function Ir(e){return`/api/projects/${encodeURIComponent(e)}/todos`}function E_(e){const[t,n]=f.useState(null),[s,a]=f.useState(!0),[l,c]=f.useState(null),u=f.useCallback(async()=>{if(e)try{const p=await fetch(Ir(e));if(!p.ok)throw new Error(`HTTP ${p.status}`);n(await p.json()),c(null)}catch(p){c(p instanceof Error?p.message:"Failed to fetch todos")}finally{a(!1)}},[e]);return f.useEffect(()=>{u()},[u]),sc(p=>{p.type==="todos-updated"&&p.projectSlug===e&&u()}),{data:t,loading:s,error:l,refetch:u}}async function T_(e,t,n){await fetch(Ir(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,tags:n})})}async function R_(e,t,n){await fetch(`${Ir(e)}/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({summary:"Completed."})})}async function P_(e,t,n){await fetch(`${Ir(e)}/${t}/block`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:n})})}async function A_(e,t,n){await fetch(`${Ir(e)}/${t}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:n})})}async function D_(e,t){await fetch(`${Ir(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function $_(e,t){await fetch(`${Ir(e)}/${t}`,{method:"DELETE"})}async function L_(e,t,n){const s=await fetch(`${Ir(e)}/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:n})});if(!s.ok)throw new Error(await s.text().catch(()=>"")||`HTTP ${s.status}`)}function JS(e,t,n){return`${Ir(e)}/${t}/attachments/${encodeURIComponent(n)}`}async function O_(e,t,n){for(const s of n){const a=await fetch(`${Ir(e)}/${t}/attachments`,{method:"POST",headers:{"Content-Type":"application/octet-stream","x-attachment-filename":encodeURIComponent(s.name||"file"),"x-attachment-mime":s.type||"application/octet-stream"},body:s});if(!a.ok)throw new Error(await a.text().catch(()=>"")||`HTTP ${a.status}`)}}async function I_(e,t,n){const s=await fetch(JS(e,t,n),{method:"DELETE"});if(!s.ok)throw new Error(await s.text().catch(()=>"")||`HTTP ${s.status}`)}async function XS(e,t){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.text().catch(()=>"");let a=null;try{a=s?JSON.parse(s):null}catch{}const l=(a==null?void 0:a.error)||s||`HTTP ${n.status}`,c=new Error(l);throw c.status=n.status,c}return n.json().catch(()=>({}))}async function M_(e,t){return await XS(`${Ir(e)}/promote`,t)}async function __(e,t,n){await XS(`${Ir(e)}/${t}/move`,{to:n})}const Yw=[{value:"open",icon:"○",label:"Open",color:"text-muted-foreground"},{value:"in_progress",icon:"◉",label:"In Progress",color:"text-status-in-progress-foreground"},{value:"completed",icon:"✓",label:"Completed",color:"text-status-completed-foreground"},{value:"blocked",icon:"✕",label:"Blocked",color:"text-status-blocked-foreground"}];function QS({status:e,onChange:t}){const[n,s]=f.useState(!1),a=f.useRef(null);f.useEffect(()=>{if(!n)return;function c(u){a.current&&!a.current.contains(u.target)&&s(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]);const l=Yw.find(c=>c.value===e);return r.jsxs("div",{className:"relative",ref:a,onClick:c=>c.stopPropagation(),children:[r.jsx("button",{onClick:()=>s(!n),className:`text-lg leading-none ${l.color} hover:opacity-70 transition`,title:l.label,children:l.icon}),n&&r.jsx("div",{className:"absolute left-0 top-full mt-1 z-20 min-w-[140px] rounded-md border border-border/70 bg-background shadow-lg py-1",children:Yw.filter(c=>c.value!==e).map(c=>r.jsxs("button",{onClick:()=>{t(c.value),s(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-sm hover:bg-foreground/5 transition ${c.color}`,children:[r.jsx("span",{className:"text-base leading-none",children:c.icon}),r.jsx("span",{children:c.label})]},c.value))})]})}function ZS({item:e,copiedId:t,selected:n,editing:s,onBeginEdit:a,onEndEdit:l,onPatchDescription:c,onAddAttachments:u,onDeleteAttachment:p,attachmentUrl:m,onToggleSelected:h,onMoveOne:g,onStatusChange:y,onCopyId:b,onDelete:E,hotkeyRowProps:j,onDragOrigin:w,onDragStart:k,onDragEnd:C,isDragging:N}){return r.jsxs("div",{draggable:!0,"data-todo-id":e.id,...j??{},onMouseDown:w,onDragStart:T=>k(T,e.id),onDragEnd:C,className:`surface-panel flex items-start gap-3 px-3 py-2 cursor-grab active:cursor-grabbing hover:bg-foreground/[0.03] transition ${N?"opacity-50 shadow-lg":""}`,children:[r.jsx("input",{type:"checkbox","data-no-drag":!0,"aria-label":`Select todo ${e.id}`,title:"Select",checked:n,onChange:T=>h(e.id,T),onClick:T=>T.stopPropagation(),className:"mt-1 h-4 w-4 shrink-0 cursor-pointer accent-foreground"}),r.jsx("span",{className:"mt-0.5 self-stretch w-px bg-border/60","aria-hidden":"true"}),r.jsx("div",{className:"mt-0.5 shrink-0",children:r.jsx(QS,{status:e.status,onChange:T=>y(e.id,T)})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-baseline flex-wrap gap-x-2",children:[r.jsx(eN,{description:e.description,status:e.status,editing:s,onBeginEdit:()=>a(e.id),onEndEdit:l,onSave:T=>c(e.id,T)}),e.tags.length>0&&r.jsx("span",{className:"text-xs text-muted-foreground",children:e.tags.map(T=>`#${T}`).join(" ")}),e.session&&r.jsxs("span",{className:"text-xs text-info-foreground/70 font-mono",children:["session:",e.session.slice(0,8)]}),r.jsx(V_,{item:e})]}),r.jsx(tN,{item:e,attachmentUrl:m,onAdd:T=>u(e.id,T),onDelete:T=>p(e.id,T)})]}),t===e.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(Xr,{className:"h-3 w-3"})," Copied to clipboard"]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{"data-no-drag":!0,className:"text-xs text-muted-foreground/60 font-mono hover:text-foreground transition",onClick:T=>b(T,e.id),children:["t:",e.id]}),r.jsx("button",{"data-no-drag":!0,className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:T=>b(T,e.id),children:r.jsx(rd,{className:"h-3 w-3"})}),r.jsx("button",{"data-no-drag":!0,className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:T=>g(e.id,T),children:r.jsx($d,{className:"h-3 w-3"})}),r.jsx("button",{"data-no-drag":!0,className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:T=>E(T,e.id,e.description),children:r.jsx(or,{className:"h-3 w-3"})})]})]})}function eN({description:e,status:t,editing:n,onBeginEdit:s,onEndEdit:a,onSave:l}){return n?r.jsx(F_,{initialValue:e,onSave:l,onExit:a}):r.jsx("button",{type:"button","data-no-drag":!0,onClick:c=>{c.stopPropagation(),s()},title:"Click to edit",className:Se("text-left text-sm rounded-sm transition hover:text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",t==="completed"?"line-through text-muted-foreground":"text-foreground"),children:e})}function F_({initialValue:e,onSave:t,onExit:n}){const s=f.useRef(e),[a,l]=f.useState(e),[c,u]=f.useState(!1),[p,m]=f.useState(!1),h=f.useRef(null),g=f.useRef(!1);f.useEffect(()=>{const j=h.current;j&&(j.focus(),j.select())},[]);const y=f.useCallback(()=>{var j;m(!0),window.setTimeout(()=>m(!1),260),(j=h.current)==null||j.focus()},[]),b=f.useCallback(async()=>{if(g.current)return;const j=a.trim();if(j.length===0){y();return}if(j===s.current){n();return}g.current=!0,u(!0);try{await t(j)}catch{}finally{u(!1),n()}},[a,n,t,y]);function E(j){j.key==="Enter"?(j.preventDefault(),b()):j.key==="Escape"&&(j.preventDefault(),g.current=!0,n())}return r.jsx("input",{ref:h,type:"text","data-no-drag":!0,disabled:c,value:a,onClick:j=>j.stopPropagation(),onChange:j=>l(j.target.value),onKeyDown:E,onBlur:()=>void b(),className:Se("w-full rounded-sm border border-border bg-background px-1.5 py-0.5 text-sm text-foreground outline-none transition focus:border-ring focus:ring-1 focus:ring-ring",p&&"syntaur-input-shake",c&&"opacity-70")})}function z_(e){return e.startsWith("image/")&&e!=="image/svg+xml"}function B_(e){const t=e.clipboardData,n=[];if(t.files&&t.files.length&&n.push(...Array.from(t.files)),!n.length&&t.items){for(const s of Array.from(t.items))if(s.kind==="file"){const a=s.getAsFile();a&&n.push(a)}}return n}function tN({item:e,attachmentUrl:t,onAdd:n,onDelete:s}){const a=e.attachments??[],[l,c]=f.useState(!1),[u,p]=f.useState(!1),m=f.useRef(null),h=f.useRef(null);f.useEffect(()=>{var y;l&&((y=h.current)==null||y.focus())},[l]);const g=f.useCallback(async y=>{if(y.length){p(!0);try{await n(y),c(!1)}finally{p(!1)}}},[n]);return r.jsxs("div",{className:"mt-1","data-no-drag":!0,onClick:y=>y.stopPropagation(),children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.map(y=>r.jsx(U_,{att:y,url:t(e.id,y.id),onDelete:()=>void s(y.id)},y.id)),r.jsxs("button",{type:"button","data-no-drag":!0,title:"Attach files",onClick:()=>c(y=>!y),className:"inline-flex items-center gap-1 rounded-md border border-border/60 px-1.5 py-0.5 text-xs text-muted-foreground hover:text-foreground hover:border-border transition",children:[r.jsx(m0,{className:"h-3 w-3"}),a.length===0?"Attach":""]})]}),l&&r.jsxs("div",{ref:h,"data-no-drag":!0,tabIndex:0,role:"button","aria-label":"Add attachments: drop, paste, or click",onPaste:y=>{const b=B_(y);b.length&&(y.preventDefault(),g(b))},onDragOver:y=>{Array.from(y.dataTransfer.types).includes("Files")&&y.preventDefault()},onDrop:y=>{const b=Array.from(y.dataTransfer.files);b.length&&(y.preventDefault(),g(b))},onClick:()=>{var y;return(y=m.current)==null?void 0:y.click()},className:"mt-1 cursor-pointer rounded-md border border-dashed border-border/70 px-3 py-2 text-xs text-muted-foreground hover:border-border focus:outline-none focus:ring-2 focus:ring-ring/40",children:[u?"Uploading…":"Drop, paste (⌘V / Ctrl+V), or click to add files",r.jsx("input",{ref:m,type:"file",multiple:!0,className:"hidden",onChange:y=>{const b=Array.from(y.target.files??[]);y.target.value="",g(b)}})]})]})}function U_({att:e,url:t,onDelete:n}){return r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-border/60 bg-background px-1.5 py-0.5 text-xs",children:[z_(e.mime)?r.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",title:e.filename,children:r.jsx("img",{src:t,alt:e.filename,className:"h-6 w-6 rounded object-cover"})}):r.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-foreground hover:text-primary",children:[r.jsx(m0,{className:"h-3 w-3"}),r.jsx("span",{className:"block max-w-[160px] truncate",children:e.filename})]}),r.jsx("button",{type:"button",title:"Remove attachment",onClick:n,className:"text-muted-foreground/60 hover:text-destructive transition",children:r.jsx(ig,{className:"h-3 w-3"})})]})}function V_({item:e}){return!(e.branch||e.planDir||e.worktreePath||e.createdAt||e.updatedAt)?null:r.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[e.branch?r.jsx(Wo,{delayDuration:120,children:r.jsxs(Pr,{children:[r.jsx(Ar,{asChild:!0,children:r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-info-foreground/30 bg-info/30 px-1.5 py-0.5 text-[10px] font-mono text-info-foreground",children:[r.jsx(tg,{className:"h-2.5 w-2.5"}),r.jsx("span",{className:"block min-w-0 max-w-[120px] truncate",children:e.branch})]})}),r.jsx(gr,{children:e.branch})]})}):null,e.planDir?r.jsx(Wo,{delayDuration:120,children:r.jsxs(Pr,{children:[r.jsx(Ar,{asChild:!0,children:r.jsx("button",{type:"button","data-no-drag":!0,onClick:n=>{n.stopPropagation(),navigator.clipboard.writeText(e.planDir)},className:"inline-flex items-center rounded-full border border-status-completed-foreground/40 bg-status-completed/30 p-1 text-status-completed-foreground hover:bg-status-completed/50","aria-label":"Copy plan directory path",children:r.jsx(d0,{className:"h-2.5 w-2.5"})})}),r.jsxs(gr,{children:["Plan: ",e.planDir]})]})}):null,e.worktreePath||e.createdAt||e.updatedAt?r.jsx(Wo,{delayDuration:120,children:r.jsxs(Pr,{children:[r.jsx(Ar,{asChild:!0,children:r.jsx("span",{className:"text-[10px] text-muted-foreground/60 cursor-default",children:"·"})}),r.jsx(gr,{children:r.jsxs("div",{className:"space-y-0.5 text-xs font-mono",children:[e.worktreePath?r.jsxs("div",{children:["worktree: ",e.worktreePath]}):null,e.createdAt?r.jsxs("div",{children:["created: ",e.createdAt]}):null,e.updatedAt?r.jsxs("div",{children:["updated: ",e.updatedAt]}):null]})})]})}):null]})}const nN="__one_off__";function px({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:a,defaultProject:l,defaultTitle:c,allowOneOff:u=!0}){const[p,m]=f.useState("new"),[h,g]=f.useState(!1),[y,b]=f.useState(null),[E,j]=f.useState(null),[w,k]=f.useState(null),[C,N]=f.useState(""),[T,D]=f.useState(""),[R,$]=f.useState(""),[L,K]=f.useState(""),[B,O]=f.useState(""),[W,se]=f.useState(""),[z,H]=f.useState(null),[ee,ne]=f.useState(!1),M=t.length>1;f.useEffect(()=>{if(!e){m("new"),b(null),N(""),D(""),$(""),K(""),O(""),se(""),H(null);return}N(l??""),D(c??"");let de=!1;return(async()=>{try{const ge=await fetch("/api/projects");if(!ge.ok)throw new Error(`HTTP ${ge.status}`);const V=await ge.json();de||j(V.filter(ae=>!ae.archived))}catch(ge){de||k(ge instanceof Error?ge.message:String(ge))}})(),()=>{de=!0}},[e,l,c]),f.useEffect(()=>{if(!B){H(null);return}let de=!1;return ne(!0),(async()=>{try{const ge=await fetch(`/api/projects/${encodeURIComponent(B)}/assignments`);if(!ge.ok)throw new Error(`HTTP ${ge.status}`);const V=await ge.json();de||H(V)}catch{de||H([])}finally{de||ne(!1)}})(),()=>{de=!0}},[B]);const G=f.useMemo(()=>E??[],[E]);async function A(de){if(de.preventDefault(),!C){b('Pick a target project (or "One-off").');return}if(M&&!T.trim()){b("Title is required when promoting multiple todos.");return}const ge=C===nN?{oneOff:!0}:{project:C};if(n.kind==="aggregate"){const ae={groups:n.groups,mode:"new-assignment",target:ge,title:T.trim()||void 0,type:R.trim()||void 0,priority:L||void 0};await I(ae);return}const V={todoIds:t,mode:"new-assignment",target:ge,title:T.trim()||void 0,type:R.trim()||void 0,priority:L||void 0};await Z(V)}async function F(de){if(de.preventDefault(),n.kind==="aggregate"){b("Existing-assignment mode does not support cross-workspace selections yet.");return}if(!B||!W){b("Pick both project and assignment.");return}const ge={todoIds:t,mode:"to-assignment",target:{assignment:`${B}/${W}`}};await Z(ge)}async function Z(de){g(!0),b(null);try{let ge;if(n.kind==="workspace")ge=await BP(n.workspace,de);else if(n.kind==="project")ge=await M_(n.projectId,de);else throw new Error("Aggregate scope requires runBulkMutation.");a(ge),s(!1)}catch(ge){b(ge instanceof Error?ge.message:String(ge))}finally{g(!1)}}async function I(de){g(!0),b(null);try{const ge=await UP(de);a(ge),s(!1)}catch(ge){b(ge instanceof Error?ge.message:String(ge))}finally{g(!1)}}return r.jsx(ar,{open:e,onOpenChange:de=>h?void 0:s(de),children:r.jsxs(Kn,{className:"max-w-xl",children:[r.jsxs(Zr,{children:[r.jsxs(qn,{children:["Promote ",t.length," todo",t.length===1?"":"s"]}),r.jsxs(gs,{children:["Convert the selected todo",t.length===1?"":"s"," to a new or existing assignment. Source todo",t.length===1?"":"s"," will be marked ",r.jsx("strong",{children:"in progress"})," and linked to the new assignment (auto-completed when the assignment closes)."]})]}),r.jsxs(pS,{value:p,onValueChange:de=>m(de),children:[r.jsxs(mS,{className:"flex gap-2 rounded-md border border-border/70 bg-card/80 p-1 mb-4",children:[r.jsx(Ch,{value:"new",className:Se("inline-flex items-center gap-2 rounded-sm px-3 py-1.5 text-sm font-medium text-muted-foreground transition","data-[state=active]:bg-foreground data-[state=active]:text-background"),children:"New assignment"}),r.jsx(Ch,{value:"existing",className:Se("inline-flex items-center gap-2 rounded-sm px-3 py-1.5 text-sm font-medium text-muted-foreground transition","data-[state=active]:bg-foreground data-[state=active]:text-background"),children:"Existing assignment"})]}),r.jsx(Eh,{value:"new",children:r.jsxs("form",{onSubmit:A,className:"space-y-4",children:[r.jsx(Va,{label:"Target project",children:r.jsx(Jw,{value:C,onChange:N,projects:G,error:w,disabled:h,allowOneOff:u})}),r.jsx(Va,{label:M?"Title (required)":"Title (defaults to first todo)",children:r.jsx("input",{type:"text",value:T,onChange:de=>D(de.target.value),disabled:h,className:"editor-input bg-background/95 font-sans"})}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx(Va,{label:"Type",children:r.jsx("input",{type:"text",value:R,onChange:de=>$(de.target.value),placeholder:"feature",disabled:h,className:"editor-input bg-background/95 font-sans"})}),r.jsx(Va,{label:"Priority",children:r.jsxs("select",{value:L,onChange:de=>K(de.target.value),disabled:h,className:"editor-input bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"—"}),r.jsx("option",{value:"low",children:"low"}),r.jsx("option",{value:"medium",children:"medium"}),r.jsx("option",{value:"high",children:"high"}),r.jsx("option",{value:"critical",children:"critical"})]})})]}),y?r.jsx(Xw,{message:y}):null,r.jsx(Qw,{onCancel:()=>s(!1),submitting:h,submitLabel:"Promote"})]})}),r.jsx(Eh,{value:"existing",children:r.jsxs("form",{onSubmit:F,className:"space-y-4",children:[r.jsx(Va,{label:"Project",children:r.jsx(Jw,{value:B,onChange:de=>{O(de),se("")},projects:G,error:w,disabled:h})}),r.jsx(Va,{label:ee?"Assignment (loading...)":"Assignment",children:r.jsxs("select",{value:W,onChange:de=>se(de.target.value),disabled:h||!B||ee,className:"editor-input bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:B?"Select assignment...":"Pick a project first"}),(z??[]).map(de=>r.jsxs("option",{value:de.slug,children:[de.title," (",de.status,")"]},de.slug))]})}),y?r.jsx(Xw,{message:y}):null,r.jsx(Qw,{onCancel:()=>s(!1),submitting:h,submitLabel:"Promote"})]})})]})]})})}function Va({label:e,children:t}){return r.jsxs("label",{className:"block space-y-1.5",children:[r.jsx("span",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:e}),t]})}function Jw({value:e,onChange:t,projects:n,error:s,disabled:a,allowOneOff:l}){return s?r.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load projects: ",s]}):r.jsxs("select",{value:e,onChange:c=>t(c.target.value),disabled:a,className:"editor-input bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"Select project..."}),l?r.jsx("option",{value:nN,children:"One-off (no project)"}):null,n.map(c=>r.jsxs("option",{value:c.slug,children:[c.title," (",c.slug,")"]},c.slug))]})}function Xw({message:e}){return r.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:e})}function Qw({onCancel:e,submitting:t,submitLabel:n}){return r.jsxs(Ls,{children:[r.jsx("button",{type:"button",onClick:e,disabled:t,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"submit",disabled:t,className:"shell-action shell-action--cta disabled:cursor-not-allowed disabled:opacity-50",children:t?"Submitting...":n})]})}function rN({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:a}){const[l,c]=f.useState("project"),[u,p]=f.useState(""),[m,h]=f.useState(""),[g,y]=f.useState(!1),[b,E]=f.useState(null),[j,w]=f.useState(null),[k,C]=f.useState(null);f.useEffect(()=>{if(!e){c("project"),p(""),h(""),E(null),w(null);return}let $=!1;return(async()=>{try{const L=await fetch("/api/projects");if(!L.ok)throw new Error(`HTTP ${L.status}`);const K=await L.json();$||C(K.filter(B=>!B.archived))}catch(L){$||w(L instanceof Error?L.message:String(L))}})(),()=>{$=!0}},[e]);const N=f.useMemo(()=>k?n.kind==="project"?k.filter($=>$.slug!==n.projectId):k:[],[k,n]);function T(){if(l==="global")return{global:!0};if(l==="workspace"){const $=u.trim();return $?{workspace:$}:"Workspace name is required."}return m?{project:m}:"Pick a target project."}async function D($,L){try{return n.kind==="workspace"?await VP(n.workspace,$,L):await __(n.projectId,$,L),{ok:!0}}catch(K){return{ok:!1,error:K instanceof Error?K.message:String(K)}}}async function R($){$.preventDefault(),w(null);const L=T();if(typeof L=="string"){w(L);return}y(!0),E(null);const K=[],B=[];for(const O of t){const W=await D(O,L);W.ok?K.push(O):B.push({id:O,error:W.error})}y(!1),a(),B.length===0?s(!1):E({succeeded:K,failed:B})}return r.jsx(ar,{open:e,onOpenChange:$=>g?void 0:s($),children:r.jsx(Kn,{className:"max-w-xl",children:r.jsxs("form",{onSubmit:R,className:"space-y-4",children:[r.jsxs(Zr,{children:[r.jsxs(qn,{children:["Move ",t.length," todo",t.length===1?"":"s"]}),r.jsxs(gs,{children:["Move the selected todo",t.length===1?"":"s"," to a different scope. id, tags, branch, timestamps, and plan dir are preserved."]})]}),r.jsxs("fieldset",{className:"space-y-2",disabled:g,children:[r.jsx("legend",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground mb-1",children:"Target scope"}),r.jsx(Hm,{kind:"project",checked:l==="project",onChange:()=>c("project"),label:"Project"}),r.jsx(Hm,{kind:"workspace",checked:l==="workspace",onChange:()=>c("workspace"),label:"Workspace"}),r.jsx(Hm,{kind:"global",checked:l==="global",onChange:()=>c("global"),label:"Global"})]}),l==="project"?r.jsx(Zw,{label:"Target project",children:r.jsxs("select",{value:m,onChange:$=>h($.target.value),disabled:g,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"Select project..."}),N.map($=>r.jsxs("option",{value:$.slug,children:[$.title," (",$.slug,")"]},$.slug))]})}):null,l==="workspace"?r.jsx(Zw,{label:"Target workspace name",children:r.jsx("input",{type:"text",value:u,onChange:$=>p($.target.value),disabled:g,placeholder:"e.g. syntaur",className:"editor-textarea w-full bg-background/95 font-sans"})}):null,j?r.jsx(H_,{message:j}):null,b?r.jsxs("div",{className:"rounded-md border border-warning-foreground/30 bg-warning px-3 py-2 text-sm text-warning-foreground space-y-1",children:[r.jsxs("div",{className:"font-medium",children:["Moved ",b.succeeded.length," of ",t.length,"; ",b.failed.length," failed."]}),r.jsx("ul",{className:"text-xs space-y-0.5",children:b.failed.map($=>r.jsxs("li",{children:["[t:",$.id,"] ",$.error]},$.id))})]}):null,r.jsxs(Ls,{children:[r.jsx("button",{type:"button",onClick:()=>s(!1),disabled:g,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:b?"Close":"Cancel"}),b===null?r.jsx("button",{type:"submit",disabled:g,className:"shell-action shell-action--cta disabled:cursor-not-allowed disabled:opacity-50",children:g?"Moving...":"Move"}):null]})]})})})}function Zw({label:e,children:t}){return r.jsxs("label",{className:"block space-y-1.5",children:[r.jsx("span",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:e}),t]})}function Hm({kind:e,checked:t,onChange:n,label:s}){return r.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[r.jsx("input",{type:"radio",name:"move-target-kind",value:e,checked:t,onChange:n}),r.jsx("span",{children:s})]})}function H_({message:e}){return r.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:e})}function mx({label:e,count:t,expanded:n,onToggle:s,isDropTarget:a=!1,onDragOver:l,onDragLeave:c,onDrop:u,children:p}){return r.jsxs("div",{className:Se("rounded-lg border border-border/60 bg-card/40 transition",a&&"ring-2 ring-ring/30"),onDragOver:l,onDragLeave:c,onDrop:u,children:[r.jsxs("button",{type:"button",onClick:s,"aria-expanded":n,className:"flex w-full items-center gap-2 px-3 py-2.5 text-left",children:[r.jsx(br,{className:Se("h-4 w-4 text-muted-foreground transition-transform",!n&&"-rotate-90")}),r.jsx("span",{className:"font-semibold text-foreground",children:e}),r.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:t})]}),n&&r.jsx("div",{className:"space-y-1 px-2 pb-2",children:p})]})}const sN=[{id:"open-blocked",label:"Open / Blocked",statuses:["open","blocked"],dropStatus:"open",defaultCollapsed:!1},{id:"in-progress",label:"In Progress",statuses:["in_progress"],dropStatus:"in_progress",defaultCollapsed:!1},{id:"done",label:"Done",statuses:["completed"],dropStatus:"completed",defaultCollapsed:!0}];function lf(e){switch(e){case"in_progress":return"in-progress";case"completed":return"done";case"open":case"blocked":default:return"open-blocked"}}function hx(e){const t={"open-blocked":[],"in-progress":[],done:[]};for(const n of e)t[lf(n.status)].push(n);return sN.map(n=>({config:n,items:t[n.id]}))}const oN="syntaur.todos.sections.collapsed.v1",ej=Object.fromEntries(sN.map(e=>[e.id,e.defaultCollapsed]));function Wm(){if(typeof window>"u"||!window.localStorage)return{};try{const e=window.localStorage.getItem(oN);if(!e)return{};const t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function W_(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(oN,JSON.stringify(e))}catch{}}function gx(e){const[t,n]=f.useState(()=>Wm()[e]??{});f.useEffect(()=>{n(Wm()[e]??{})},[e]);const s=f.useCallback(l=>t[l]??ej[l],[t]),a=f.useCallback(l=>{const c=Wm(),u=c[e]??{},p=u[l]??ej[l],m={...u,[l]:!p};c[e]=m,W_(c),n(m)},[e]);return{isCollapsed:s,toggle:a}}function K_({projectId:e}){const{data:t,loading:n,error:s,refetch:a}=E_(e),[l,c]=f.useState(""),[u,p]=f.useState(""),[m,h]=f.useState(""),[g,y]=f.useState(""),[b,E]=f.useState(null),[j,w]=f.useState(null),[k,C]=f.useState(new Set),[N,T]=f.useState(!1),[D,R]=f.useState(!1),[$,L]=f.useState(null),K=f.useRef(null);mo("list:todos");const B=gx("project:"+e),[O,W]=f.useState(null),[se,z]=f.useState(null),H=f.useRef(null);function ee(Y,pe){Y.stopPropagation(),navigator.clipboard.writeText(pe),E(pe),setTimeout(()=>E(Q=>Q===pe?null:Q),1500)}const ne=f.useMemo(()=>{if(!(t!=null&&t.items))return[];const Y=new Set;for(const pe of t.items)for(const Q of pe.tags)Y.add(Q);return Array.from(Y).sort()},[t]),M=f.useMemo(()=>{if(!(t!=null&&t.items))return[];let Y=t.items;if(l.trim()){const pe=l.toLowerCase();Y=Y.filter(Q=>Q.description.toLowerCase().includes(pe)||Q.tags.some(ye=>ye.toLowerCase().includes(pe))||Q.id.includes(pe))}return u&&(Y=Y.filter(pe=>pe.status===u)),m&&(Y=Y.filter(pe=>pe.tags.includes(m))),Y},[t,l,u,m]);f.useEffect(()=>{C(new Set)},[l,u,m,e]);const G=f.useMemo(()=>M.filter(Y=>k.has(Y.id)).length,[M,k]),A=M.length>0&&G===M.length,F=G>0&&!A;function Z(Y){C(pe=>{const Q=new Set(pe);return Q.has(Y)?Q.delete(Y):Q.add(Y),Q})}function I(){C(Y=>{const pe=new Set(Y);if(A)for(const Q of M)pe.delete(Q.id);else for(const Q of M)pe.add(Q.id);return pe})}function de(){C(new Set)}const ge=$?[$]:Array.from(k);function V(){C(new Set),L(null),a()}function ae(){C(new Set),a()}async function me(){g.trim()&&(await T_(e,g.trim()),y(""),a())}async function ve(Y,pe,Q){Y.stopPropagation(),window.confirm(`Delete "${Q}"? This can't be undone.`)&&(await $_(e,pe),a())}async function ke(Y,pe){switch(pe){case"open":await D_(e,Y);break;case"in_progress":await A_(e,Y);break;case"completed":await R_(e,Y);break;case"blocked":await P_(e,Y);break}a()}async function he(Y,pe){await L_(e,Y,pe),a()}async function Je(Y,pe){await O_(e,Y,pe),a()}async function Ye(Y,pe){await I_(e,Y,pe),a()}const ot=hx(M),J=ot.filter(Y=>!B.isCollapsed(Y.config.id)).flatMap(Y=>Y.items),{hotkeyRowProps:Ie}=ac(J,{scope:"list:todos",bindO:!1,onOpen:Y=>w(Y.id)});Ht({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var Y;return(Y=K.current)==null?void 0:Y.focus()}}),Ht({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>a()});const[Ne,Oe]=hs(),Xe=Ne.get("focus");f.useEffect(()=>{if(!Xe||!(t!=null&&t.items))return;const Y=t.items.find(Q=>Q.id===Xe);if(!Y)return;const pe=lf(Y.status);B.isCollapsed(pe)&&B.toggle(pe)},[Xe,t==null?void 0:t.items]),f.useEffect(()=>{if(!Xe)return;const Y=document.querySelector(`[data-todo-id="${window.CSS.escape(Xe)}"]`);if(!Y)return;Y.scrollIntoView({block:"nearest"}),Y.classList.add("ring-2","ring-primary/60");const pe=window.setTimeout(()=>{Y.classList.remove("ring-2","ring-primary/60"),Oe(Q=>{const ye=new URLSearchParams(Q);return ye.delete("focus"),ye},{replace:!0})},1500);return()=>window.clearTimeout(pe)},[Xe,J.length,Oe]);const Me=O?(t==null?void 0:t.items.find(Y=>Y.id===O))??null:null;function nt(Y,pe){const Q=H.current;if(Q!=null&&Q.closest(mi)){Y.preventDefault();return}Y.dataTransfer.effectAllowed="move",Y.dataTransfer.setData("text/plain",pe),W(pe)}function Ke(){W(null),z(null)}function gt(Y,pe){!Me||pe.statuses.includes(Me.status)||(Y.preventDefault(),Y.dataTransfer.dropEffect="move",z(pe.id))}function Rt(Y,pe){se===pe.id&&!Y.currentTarget.contains(Y.relatedTarget)&&z(null)}function at(Y,pe){Y.preventDefault();const Q=Me;Ke(),!(!Q||pe.statuses.includes(Q.status))&&ke(Q.id,pe.dropStatus)}if(n)return r.jsx(mt,{label:"Loading todos..."});if(s)return r.jsx(wt,{error:s});const ie=(t==null?void 0:t.counts)||{open:0,in_progress:0,blocked:0,total:0};return r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[r.jsx(An,{label:"Open",value:ie.open,icon:Dr}),r.jsx(An,{label:"In Progress",value:ie.in_progress,icon:Dr,tone:"info"}),r.jsx(An,{label:"Blocked",value:ie.blocked,icon:ag,tone:"warn"}),r.jsx(An,{label:"Total",value:ie.total,icon:Dr})]}),r.jsx("div",{className:"surface-panel p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{type:"text",placeholder:"Add a todo...",value:g,onChange:Y=>y(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&me(),className:"h-9 flex-1 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),r.jsxs("button",{onClick:me,disabled:!g.trim(),className:"inline-flex h-9 items-center gap-1.5 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-40",children:[r.jsx(rn,{className:"h-4 w-4"}),"Add"]})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(fo,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:K,type:"text",placeholder:"Search...",value:l,onChange:Y=>c(Y.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs("select",{value:u,onChange:Y=>p(Y.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All statuses"}),r.jsx("option",{value:"open",children:"Open"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"blocked",children:"Blocked"})]}),ne.length>0&&r.jsxs("select",{value:m,onChange:Y=>h(Y.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All tags"}),ne.map(Y=>r.jsxs("option",{value:Y,children:["#",Y]},Y))]})]}),k.size>0?r.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[r.jsxs("span",{className:"text-sm font-medium",children:[k.size," selected"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>T(!0),className:"shell-action shell-action--cta",children:"Promote selected"}),r.jsx("button",{type:"button",onClick:()=>{L(null),R(!0)},className:"shell-action",children:"Move to…"}),r.jsx("button",{type:"button",onClick:de,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,M.length>0&&r.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:A,ref:Y=>{Y&&(Y.indeterminate=F)},onChange:I,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",M.length,")"]})]}),r.jsx("div",{className:"space-y-3",children:(()=>{let Y=-1;return ot.map(({config:pe,items:Q})=>{const ye=!B.isCollapsed(pe.id);return r.jsx(mx,{label:pe.label,count:Q.length,expanded:ye,onToggle:()=>B.toggle(pe.id),isDropTarget:se===pe.id,onDragOver:Pe=>gt(Pe,pe),onDragLeave:Pe=>Rt(Pe,pe),onDrop:Pe=>at(Pe,pe),children:ye&&Q.map(Pe=>(Y+=1,r.jsx(ZS,{item:Pe,copiedId:b,selected:k.has(Pe.id),editing:j===Pe.id,onBeginEdit:lt=>w(lt),onEndEdit:()=>w(null),onPatchDescription:he,onAddAttachments:Je,onDeleteAttachment:Ye,attachmentUrl:(lt,te)=>JS(e,lt,te),onToggleSelected:lt=>Z(lt),onMoveOne:(lt,te)=>{te.stopPropagation(),L(lt),R(!0)},onStatusChange:ke,onCopyId:ee,onDelete:ve,hotkeyRowProps:Ie(Y),onDragOrigin:lt=>{H.current=lt.target},onDragStart:nt,onDragEnd:Ke,isDragging:O===Pe.id},Pe.id)))},pe.id)})})()}),r.jsx(px,{open:N,selectedIds:Array.from(k),scope:{kind:"project",projectId:e},onOpenChange:T,onDone:ae}),r.jsx(rN,{open:D,selectedIds:ge,scope:{kind:"project",projectId:e},onOpenChange:Y=>{R(Y),Y||L(null)},onDone:V})]})}const q_={title:"Assignment",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",created:"Created",updated:"Updated"},tj=new Set(["title"]);function aN({visibility:e,onChange:t}){const[n,s]=f.useState(!1);function a(c){if(tj.has(c))return;const p=e.hidden.includes(c)?e.hidden.filter(m=>m!==c):[...e.hidden,c];t({hidden:p})}const l=e.hidden.length;return r.jsxs(ar,{open:n,onOpenChange:s,children:[r.jsx($3,{asChild:!0,children:r.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:"Show or hide table columns",children:[r.jsx(aR,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsxs("span",{children:["Columns",l>0?` (${Sm.length-l}/${Sm.length})`:""]})]})}),r.jsxs(Kn,{className:"max-w-sm",children:[r.jsx(Zr,{children:r.jsx(qn,{children:"Columns"})}),r.jsx("div",{className:"space-y-2",children:Sm.map(c=>{const u=e.hidden.includes(c),p=tj.has(c);return r.jsxs("label",{className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm ${p?"opacity-60":"cursor-pointer hover:bg-background/80"}`,children:[r.jsx("input",{type:"checkbox",checked:!u,onChange:()=>a(c),disabled:p,className:"h-4 w-4 rounded border-border accent-foreground"}),r.jsx("span",{children:q_[c]}),p?r.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"always shown"}):null]},c)})})]})]})}const ui={...Vl,custom:!1},iN=`view-prefs.cache.v${Vl.version}`;let Gl=G_(),Ha=null;const Yl=new Set;let lN=0;function xx(){return++lN}function yx(e){return e===lN}function G_(){if(typeof window>"u"||!window.localStorage)return null;try{const e=window.localStorage.getItem(iN);if(!e)return null;const t=JSON.parse(e);return t.version!==Vl.version?null:t}catch{return null}}function Y_(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(iN,JSON.stringify(e))}catch{}}function bx(e){Gl=e,Y_(e);for(const t of Yl)t(e)}function vx(e){if(!e||typeof e!="object")return ui;const t=e;return t.version!==Vl.version||!t.global||!t.projects?ui:{version:Vl.version,global:t.global,projects:t.projects,custom:t.custom===!0}}function wx(){if(Ha)return Ha;const e=xx();return Ha=fetch("/api/view-prefs").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{const n=vx(t);return yx(e)&&bx(n),Ha=null,Gl??n}).catch(()=>(Ha=null,Gl??ui)),Ha}function cN(e){const[t,n]=f.useState(()=>Gl??ui);return f.useEffect(()=>{let s=!1;return wx().then(a=>{s||n(a)}),Yl.add(n),()=>{s=!0,Yl.delete(n)}},[]),r1(t,e??null)}function J_(){const[e,t]=f.useState(()=>Gl??ui);return f.useEffect(()=>{let n=!1;return wx().then(s=>{n||t(s)}),Yl.add(t),()=>{n=!0,Yl.delete(t)}},[]),e}async function uN(e){const t=xx(),n=await fetch("/api/view-prefs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok){const a=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw new Error(a.error??"Failed to save view-prefs")}const s=vx(await n.json());return yx(t)&&bx(s),s}function dN(e){return uN({global:e})}function fN(e,t){return uN({projects:{[e]:t}})}async function X_(){const e=xx(),t=await fetch("/api/view-prefs",{method:"DELETE"});if(!t.ok)throw new Error(`HTTP ${t.status}`);const n=vx(await t.json());return yx(e)&&bx(n),n}const nj=80;function pN({open:e,onOpenChange:t,initialName:n="",onSubmit:s,title:a="Save view"}){const[l,c]=f.useState(n),[u,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{e&&(c(n),h(null),p(!1))},[e,n]);const g=l.trim(),y=g.length>0&&g.length<=nj;return r.jsx(ar,{open:e,onOpenChange:t,children:r.jsx(Kn,{className:"max-w-md",children:r.jsxs("form",{className:"space-y-4",onSubmit:async b=>{if(b.preventDefault(),!(!y||u)){p(!0),h(null);try{await s(g)}catch(E){h(E instanceof Error?E.message:String(E)),p(!1)}}},children:[r.jsx(Zr,{children:r.jsx(qn,{children:a})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{type:"text",value:l,autoFocus:!0,required:!0,maxLength:nj,onChange:b=>c(b.target.value),placeholder:"View name",className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),m?r.jsx("p",{className:"text-xs text-error-foreground",role:"alert",children:m}):null]}),r.jsxs(Ls,{children:[r.jsx("button",{type:"button",onClick:()=>t(!1),className:"shell-action",disabled:u,children:"Cancel"}),r.jsx("button",{type:"submit",disabled:!y||u,className:"shell-action shell-action--cta disabled:opacity-50",children:u?"Saving…":"Save"})]})]})})})}function mN({scope:e,loadedViewId:t,onApply:n,onOpenSaveDialog:s}){const{views:a,loading:l}=Vd(),[c,u]=f.useState(!1),p=f.useRef(null);f.useEffect(()=>{if(!c)return;function y(E){p.current&&!p.current.contains(E.target)&&u(!1)}function b(E){E.key==="Escape"&&u(!1)}return document.addEventListener("mousedown",y),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",b)}},[c]);const m=f.useMemo(()=>a.filter(y=>o1(y,e)),[a,e]),h=t?a.find(y=>y.id===t)??null:null,g=l?"Saved views…":h?h.name:"Saved views";return r.jsxs("div",{className:"relative",ref:p,children:[r.jsxs("button",{type:"button",disabled:l,onClick:()=>u(y=>!y),className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background disabled:opacity-50","aria-haspopup":"true","aria-expanded":c,title:"Saved views",children:[r.jsx("span",{className:"max-w-[160px] truncate",children:g}),r.jsx(br,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),c&&r.jsx("div",{className:"absolute right-0 top-full z-30 mt-1 min-w-[240px] rounded-md border border-border/70 bg-background shadow-lg py-1",children:m.length===0?r.jsxs("div",{className:"px-3 py-3 text-sm text-muted-foreground",children:[r.jsx("p",{className:"mb-2",children:"No saved views yet — Save the current view to start."}),r.jsx("button",{type:"button",onClick:()=>{u(!1),s()},className:"shell-action w-full justify-center",children:"Save current view"})]}):m.map(y=>{const b=y.id===t;return r.jsxs("button",{type:"button",onClick:()=>{u(!1),n(y)},className:Se("flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm transition hover:bg-foreground/5",b&&"font-semibold text-foreground"),children:[r.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:b?r.jsx(Xr,{className:"h-3.5 w-3.5","aria-hidden":"true"}):null}),r.jsx("span",{className:"truncate",children:y.name})]},y.id)})})]})}const Q_={__unassigned__:"Unassigned",__standalone__:"No project"};function Pn({options:e,value:t,onChange:n,allLabel:s="Any",className:a,disabled:l,ariaLabel:c}){const[u,p]=f.useState(!1),m=f.useRef(null),h=f.useRef(null),g=f.useRef([]),y=f.useMemo(()=>{const C=new Set(e.map(T=>T.value)),N=t.filter(T=>!C.has(T)).map(T=>({value:T,label:Q_[T]??T}));return[...e,...N]},[e,t]),b=f.useMemo(()=>new Set(t),[t]);f.useEffect(()=>{if(!u)return;function C(N){m.current&&!m.current.contains(N.target)&&p(!1)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[u]),f.useEffect(()=>{var C;u&&((C=g.current[0])==null||C.focus())},[u]);const E=f.useMemo(()=>{if(t.length===0)return s;if(t.length===1){const C=y.find(N=>N.value===t[0]);return C?C.label:t[0]}return`${t.length} selected`},[t,y,s]);function j(C){n(b.has(C)?t.filter(N=>N!==C):[...t,C])}function w(C){var T;const N=Math.max(0,Math.min(C,y.length-1));(T=g.current[N])==null||T.focus()}function k(C){var R;const N=g.current,T=document.activeElement,D=N.findIndex($=>$===T);C.key==="ArrowDown"?(C.preventDefault(),w(D<0?0:D+1)):C.key==="ArrowUp"?(C.preventDefault(),w(D<0?y.length-1:D-1)):C.key==="Home"?(C.preventDefault(),w(0)):C.key==="End"?(C.preventDefault(),w(y.length-1)):C.key==="Escape"&&(C.preventDefault(),p(!1),(R=h.current)==null||R.focus())}return r.jsxs("div",{className:"relative",ref:m,children:[r.jsxs("button",{type:"button",ref:h,disabled:l,"aria-haspopup":"menu","aria-expanded":u,"aria-label":c,onClick:()=>p(C=>!C),onKeyDown:C=>{!u&&(C.key==="ArrowDown"||C.key==="ArrowUp")&&(C.preventDefault(),p(!0))},className:Se("editor-input inline-flex items-center justify-between gap-1.5 text-left",t.length>0&&"border-foreground/40 text-foreground",a),children:[r.jsx("span",{className:"truncate",children:E}),r.jsx(br,{className:"h-3.5 w-3.5 shrink-0 opacity-60","aria-hidden":"true"})]}),u?r.jsxs("div",{role:"menu","aria-label":c,onKeyDown:k,className:"absolute left-0 top-full z-30 mt-1 max-h-72 min-w-[200px] overflow-auto rounded-md border border-border/70 bg-background py-1 shadow-lg",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-1",children:[r.jsx("button",{type:"button",role:"menuitem",className:"text-xs text-muted-foreground hover:text-foreground disabled:opacity-40",disabled:t.length===y.length,onClick:()=>n(y.map(C=>C.value)),children:"Select all"}),r.jsx("button",{type:"button",role:"menuitem",className:"text-xs text-muted-foreground hover:text-foreground disabled:opacity-40",disabled:t.length===0,onClick:()=>n([]),children:"Clear"})]}),y.length===0?r.jsx("p",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"No options"}):y.map((C,N)=>{const T=b.has(C.value);return r.jsxs("button",{ref:D=>{g.current[N]=D},type:"button",role:"menuitemcheckbox","aria-checked":T,tabIndex:-1,onClick:()=>j(C.value),className:Se("flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm transition hover:bg-foreground/5",T?"text-foreground":"text-muted-foreground"),children:[r.jsx("span",{className:Se("flex h-4 w-4 shrink-0 items-center justify-center rounded border",T?"border-foreground bg-foreground text-background":"border-border/70"),"aria-hidden":"true",children:T?r.jsx(Xr,{className:"h-3 w-3"}):null}),r.jsx("span",{className:"truncate",children:C.label})]},C.value)})]}):null]})}const rj={last_24h:"Last 24 hours",last_7d:"Last 7 days",last_30d:"Last 30 days",last_90d:"Last 90 days",older_7d:"Older than 7 days",older_30d:"Older than 30 days"},Z_=["updated","created"];function jx({value:e,onChange:t,className:n,ariaLabel:s="Date range filter"}){const[a,l]=f.useState(!1),c=f.useRef(null),u=(e==null?void 0:e.field)??"updated",p=!!(e&&!e.preset&&(e.from||e.to)),[m,h]=f.useState(p);f.useEffect(()=>h(p),[p]),f.useEffect(()=>{if(!a)return;function k(N){c.current&&!c.current.contains(N.target)&&l(!1)}function C(N){N.key==="Escape"&&l(!1)}return document.addEventListener("mousedown",k),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",C)}},[a]);const g=!!(e&&(e.preset||e.from||e.to)),y=f.useMemo(()=>!g||!e?"Any date":e.preset?`${u}: ${rj[e.preset]??e.preset}`:`${u}: ${e.from||"…"} → ${e.to||"…"}`,[g,e,u]);function b(k){t(e?{...e,field:k}:{field:k,preset:"",from:"",to:""})}function E(k){h(!1),t({field:u,preset:k,from:"",to:""})}function j(){h(!1),t(null)}function w(k,C){const N={field:u,preset:"",from:(e==null?void 0:e.from)??"",to:(e==null?void 0:e.to)??""};t({...N,[k]:C})}return r.jsxs("div",{className:"relative",ref:c,children:[r.jsxs("button",{type:"button","aria-haspopup":"dialog","aria-expanded":a,"aria-label":s,onClick:()=>l(k=>!k),className:Se("editor-input inline-flex items-center justify-between gap-1.5 text-left",g&&"border-foreground/40 text-foreground",n),children:[r.jsx("span",{className:"truncate",children:y}),r.jsx(br,{className:"h-3.5 w-3.5 shrink-0 opacity-60","aria-hidden":"true"})]}),a?r.jsxs("div",{className:"absolute left-0 top-full z-30 mt-1 w-64 rounded-md border border-border/70 bg-background p-2 shadow-lg",children:[r.jsx("div",{className:"mb-2 inline-flex rounded-md border border-border/60 bg-background/80 p-0.5",children:Z_.map(k=>r.jsx("button",{type:"button","aria-pressed":u===k,onClick:()=>b(k),className:Se("rounded-sm px-2.5 py-1 text-xs font-medium capitalize transition",u===k?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:k},k))}),r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Km,{label:"Any date",selected:!g,onClick:j}),ID.map(k=>r.jsx(Km,{label:rj[k],selected:(e==null?void 0:e.preset)===k,onClick:()=>E(k)},k)),r.jsx(Km,{label:"Custom range…",selected:m,onClick:()=>{h(!0),t({field:u,preset:"",from:(e==null?void 0:e.from)??"",to:(e==null?void 0:e.to)??""})}})]}),m?r.jsxs("div",{className:"mt-2 space-y-1.5 border-t border-border/60 pt-2",children:[r.jsxs("label",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground",children:["From",r.jsx("input",{type:"date",value:(e==null?void 0:e.from)??"",max:(e==null?void 0:e.to)||void 0,onChange:k=>w("from",k.target.value),className:"editor-input w-40"})]}),r.jsxs("label",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground",children:["To",r.jsx("input",{type:"date",value:(e==null?void 0:e.to)??"",min:(e==null?void 0:e.from)||void 0,onChange:k=>w("to",k.target.value),className:"editor-input w-40"})]})]}):null]}):null]})}function Km({label:e,selected:t,onClick:n}){return r.jsxs("button",{type:"button",onClick:n,className:Se("flex w-full items-center justify-between gap-2 rounded px-2 py-1.5 text-left text-sm transition hover:bg-foreground/5",t?"text-foreground":"text-muted-foreground"),children:[r.jsx("span",{children:e}),t?r.jsx(Xr,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}):null]})}const eF=new Set(["status","type","priority","assignee","project","tags","activity","dateRange","search"]);function tF(e,t){const n={};for(const[s,a]of Object.entries(e))eF.has(s)||(n[s]=a);return{...n,...t}}function kx(e,t,n){return{...e,viewMode:t.viewMode,filters:tF(e.filters,t.filters),sortField:t.sortField,sortDirection:t.sortDirection,listSectionVisibility:{collapsed:[...n.listSectionVisibility.collapsed]},kanbanColumnVisibility:{hidden:[...n.kanbanColumnVisibility.hidden]},tableColumnVisibility:{hidden:[...n.tableColumnVisibility.hidden]}}}function nF(e,t){var m;const n={},s=tt(e.status);s.length&&(n.status=s);const a=tt(e.type);a.length&&(n.type=a);const l=tt(e.priority);l.length&&(n.priority=l);const c=tt(e.assignee);c.length&&(n.assignee=c);const u=tt(e.tags);if(u.length&&(n.tags=u),t&&t!=="all")n.project=[t];else{const h=tt(e.project);h.length&&(n.project=h)}e.activity&&e.activity!=="all"&&(n.activity=e.activity),e.dateRange&&(n.dateRange=e.dateRange);const p=(m=e.search)==null?void 0:m.trim();return p&&(n.search=p),n}function Jl(e){const t={viewMode:e.state.viewMode,filters:nF(e.state.filters,e.context.projectSlug),sortField:e.state.sortField,sortDirection:e.state.sortDirection,listSectionVisibility:{collapsed:[...e.state.listSectionVisibility.collapsed]},kanbanColumnVisibility:{hidden:[...e.state.kanbanColumnVisibility.hidden]},tableColumnVisibility:{hidden:[...e.state.tableColumnVisibility.hidden]}};return{name:e.name.trim(),workspace:e.context.workspace,config:t}}const Wa={viewMode:"kanban",sortField:"updated",sortDirection:"desc"};function hN(e,t){const{config:n}=Jl({name:"",context:{workspace:t,projectSlug:null},state:{viewMode:e.viewMode,filters:e.filters,sortField:e.sortField,sortDirection:e.sortDirection,listSectionVisibility:{collapsed:[]},kanbanColumnVisibility:{hidden:[]},tableColumnVisibility:{hidden:[]}}});return{workspace:t,config:n}}function Xl(e){if(!e)return;if(e.preset)return{field:e.field,preset:e.preset};const t=e.from&&e.from.length>0?e.from:void 0,n=e.to&&e.to.length>0?e.to:void 0;if(!t&&!n)return;const s={field:e.field};return t&&(s.from=t),n&&(s.to=n),s}function gN(e){return e?{field:e.field,preset:e.preset??"",from:e.from??"",to:e.to??""}:null}function xN(e,t){var s,a,l,c,u,p,m,h,g,y,b,E,j,w;const{config:n}=e;if((s=t.setViewMode)==null||s.call(t,n.viewMode),(a=t.setStatusFilter)==null||a.call(t,tt(n.filters.status)),(l=t.setTypeFilter)==null||l.call(t,tt(n.filters.type)),(c=t.setPriorityFilter)==null||c.call(t,tt(n.filters.priority)),(u=t.setAssigneeFilter)==null||u.call(t,tt(n.filters.assignee)),(p=t.setProjectFilter)==null||p.call(t,tt(n.filters.project)),(m=t.setTagsFilter)==null||m.call(t,tt(n.filters.tags)),(h=t.setDateRange)==null||h.call(t,gN(n.filters.dateRange)),(g=t.setSearch)==null||g.call(t,n.filters.search??""),t.setActivityFilter){const k=n.filters.activity??"all";t.setActivityFilter(k==="fresh"||k==="stale"?k:"all")}(y=t.setSortField)==null||y.call(t,n.sortField),(b=t.setSortDirection)==null||b.call(t,n.sortDirection),(E=t.setListSectionVisibility)==null||E.call(t,{collapsed:[...n.listSectionVisibility.collapsed]}),(j=t.setKanbanColumnVisibility)==null||j.call(t,{hidden:[...n.kanbanColumnVisibility.hidden]}),(w=t.setTableColumnVisibility)==null||w.call(t,{hidden:[...n.tableColumnVisibility.hidden]})}function Xu(e){return e?`/w/${e}/views`:"/views"}function yN(e){return`${Xu(e.workspace)}/${encodeURIComponent(e.id)}`}function bN(e){const t=e.workspace?`/w/${e.workspace}`:"",n=tt(e.config.filters.project);return n.length===1&&n[0]!=="__standalone__"&&s1(e.config,n[0])?`${t}/projects/${n[0]}?tab=assignments&loadView=${encodeURIComponent(e.id)}`:`${t}/assignments?loadView=${encodeURIComponent(e.id)}`}const rF=["critical","high","medium","low"],sF={last_24h:"last 24 hours",last_7d:"last 7 days",last_30d:"last 30 days",last_90d:"last 90 days",older_7d:"older than 7 days",older_30d:"older than 30 days"};function oF(e){if(e.preset)return`${e.field} ${sF[e.preset]??e.preset}`;const t=e.from??"…",n=e.to??"…";return`${e.field} ${t}→${n}`}function vN(e){var s;const t=[];for(const a of["status","priority","type","assignee","project","tags"]){const l=tt(e[a]);l.length&&t.push(`${a}=${l.join(", ")}`)}e.activity&&e.activity!=="all"&&t.push(`activity=${e.activity}`),e.dateRange&&t.push(oF(e.dateRange));const n=(s=e.search)==null?void 0:s.trim();return n&&t.push(`search="${n}"`),t.join(" · ")||"no filters"}const aF=new Set(["overview","assignments","todos","dependencies","knowledge"]),sj="__unknown_type__";function oj(){const{slug:e,workspace:t}=$t(),n=ln(),s=Dt();mo("project"),Ht({keys:"a",scope:"project",description:"Create assignment",handler:()=>s(`${n}/projects/${e}/create/assignment`)}),Ht({keys:"e",scope:"project",description:"Edit project",handler:()=>s(`${n}/projects/${e}/edit`)});const{data:a,loading:l,error:c,refetch:u}=F0(e),p=Zo(),m=ef(),{data:h}=oc(),[g,y]=hs(),b=g.get("tab"),E=b&&aF.has(b)?b:"overview";function j(re){y(Ae=>{const Qe=new URLSearchParams(Ae);return re==="overview"?Qe.delete("tab"):Qe.set("tab",re),Qe},{replace:!0})}const w=e?`p:${e}`:null,k=cN(w),[C,N]=f.useState(()=>km(k.defaultView)),[T,D]=f.useState(()=>tt(k.filters.status)),[R,$]=f.useState(()=>tt(k.filters.assignee)),[L,K]=f.useState(()=>tt(k.filters.priority)),[B,O]=f.useState(()=>tt(k.filters.type)),[W,se]=f.useState(()=>tt(k.filters.tags)),[z,H]=f.useState(null),[ee,ne]=f.useState(()=>k.grouping),[M,G]=f.useState(()=>k.sortField),[A,F]=f.useState(()=>k.sortDirection),[Z,I]=f.useState(()=>({collapsed:[]})),[de,ge]=f.useState(()=>({hidden:[]})),[V,ae]=f.useState(()=>({hidden:[]})),[me,ve]=f.useState(null),[ke,he]=f.useState(!1),[Je,Ye]=f.useState(!1),{toast:ot,showToast:J,dismissToast:Ie}=ta(),Ne={kind:"project",slug:e??"",workspace:t??null},Oe=g.get("loadView"),{view:Xe,loading:Me,error:nt}=Go(Oe),{view:Ke,loading:gt,error:Rt}=Go(me),at=f.useRef(null);f.useEffect(()=>{me&&!gt&&!Rt&&!Ke&&ve(null)},[Ke,Rt,me,gt]),f.useEffect(()=>{ve(null),at.current=null,H(null)},[e,t]),f.useEffect(()=>{N(km(k.defaultView)),D(tt(k.filters.status)),$(tt(k.filters.assignee)),K(tt(k.filters.priority)),O(tt(k.filters.type)),se(tt(k.filters.tags)),ne(k.grouping),G(k.sortField),F(k.sortDirection)},[e,k.defaultView,k.filters.status,k.filters.assignee,k.filters.priority,k.filters.type,k.filters.tags,k.grouping,k.sortField,k.sortDirection]);const ie=f.useCallback(re=>{w&&fN(w,re).catch(Ae=>{console.warn("Failed to persist project view prefs:",Ae)})},[w]),Y=f.useCallback(re=>{N(re),ie({defaultView:re})},[ie]),pe=f.useCallback(re=>{D(re),ie({filters:{status:re}})},[ie]),Q=f.useCallback(re=>{$(re),ie({filters:{assignee:re}})},[ie]),ye=f.useCallback(re=>{K(re),ie({filters:{priority:re}})},[ie]),Pe=f.useCallback(re=>{O(re),ie({filters:{type:re}})},[ie]),lt=f.useCallback(re=>{se(re),ie({filters:{tags:re}})},[ie]),te=f.useCallback(re=>{ne(re),ie({grouping:re})},[ie]),be=f.useCallback(re=>{G(re),ie({sortField:re})},[ie]),Le=f.useCallback(re=>{F(re),ie({sortDirection:re})},[ie]),it=f.useCallback(()=>({viewMode:C,filters:{status:T,priority:L,type:B,assignee:R,tags:W,project:"all",activity:"all",dateRange:Xl(z)},sortField:M,sortDirection:A,listSectionVisibility:Z,kanbanColumnVisibility:de,tableColumnVisibility:V}),[C,T,L,B,R,W,z,M,A,Z,de,V]),_e=f.useCallback(re=>{xN(re,{setViewMode:Ae=>N(km(Ae)),setStatusFilter:pe,setPriorityFilter:ye,setTypeFilter:Pe,setAssigneeFilter:Q,setTagsFilter:lt,setDateRange:H,setSortField:be,setSortDirection:Le,setListSectionVisibility:I,setKanbanColumnVisibility:ge,setTableColumnVisibility:ae}),ve(re.id)},[pe,ye,Pe,Q,lt,be,Le]),bt=f.useCallback(re=>{_e(re),at.current=re.id,y(Ae=>{const Qe=new URLSearchParams(Ae);return Qe.set("loadView",re.id),Qe},{replace:!0})},[_e,y]),_t=f.useCallback(async re=>{try{const Ae=Jl({name:re,context:{workspace:t??null,projectSlug:e??null},state:it()}),Qe=await Wd(Ae),Ft=Qe.views[Qe.views.length-1];ve((Ft==null?void 0:Ft.id)??null),Ft&&(at.current=Ft.id,y(hn=>{const Ct=new URLSearchParams(hn);return Ct.set("loadView",Ft.id),Ct},{replace:!0})),he(!1),Ye(!1),J(`Saved view "${re}"`,"success")}catch(Ae){throw J(Ae instanceof Error?Ae.message:"Failed to save view","error"),Ae}},[it,y,J,e,t]),Gt=f.useCallback(async()=>{if(!(!me||!Ke))try{const re=tt(Ke.config.filters.project)[0]??null,Ae=Jl({name:Ke.name,context:{workspace:t??null,projectSlug:re},state:it()}),Qe=kx(Ke.config,Ae.config,Ae.config);await Lg(me,{config:Qe}),J("View updated","success")}catch(re){J(re instanceof Error?re.message:"Failed to update view","error")}},[it,Ke,me,J,t]);f.useEffect(()=>{if(!Oe){at.current=null;return}if(at.current!==Oe&&(me&&me!==Oe&&ve(null),!Me)){if(nt){J("Couldn't load saved view — try again","error");return}if(Xe){if(at.current=Oe,!o1(Xe,{kind:"project",slug:e??"",workspace:t??null})){s(bN(Xe),{replace:!0});return}_e(Xe),y(re=>{const Ae=new URLSearchParams(re);return Ae.delete("loadView"),Ae},{replace:!0});return}at.current=Oe,J("Saved view no longer exists","error"),y(re=>{const Ae=new URLSearchParams(re);return Ae.delete("loadView"),Ae},{replace:!0})}},[Oe,Xe,Me,nt,me,_e,y,J,s,e,t]);function ue(re){M===re?Le(A==="asc"?"desc":"asc"):(be(re),Le("asc"))}const Be=f.useMemo(()=>a?Object.fromEntries(a.assignments.flatMap(re=>{const Ae=`${n}/projects/${a.slug}/assignments/${re.slug}`;return[[re.slug,Ae],[re.title,Ae]]})):{},[a]);async function Fe(re){await fetch(`/api/projects/${e}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:re})}),u()}async function Nt(re){try{const Ae=await fetch(`/api/projects/${e}/${re?"archive":"unarchive"}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!Ae.ok){const Qe=await Ae.json().catch(()=>null);J((Qe==null?void 0:Qe.error)||`HTTP ${Ae.status}`,"error");return}u(),J(re?"Project archived":"Project restored","success")}catch(Ae){J(Ae instanceof Error?Ae.message:"Failed to update archive state","error")}}async function $n(re){await fetch(`/api/projects/${e}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:re})}),u()}if(l)return r.jsx(mt,{label:"Loading project workspace…"});if(c||!a)return r.jsx(wt,{error:c||"Project not found."});const Yt=(()=>{const re=new Set;for(const Qe of a.assignments)Qe.assignee&&re.add(Qe.assignee);const Ae=[{value:"__unassigned__",label:"Unassigned"}];for(const Qe of Array.from(re).sort())Ae.push({value:Qe,label:Qe});return Ae})(),sn=Array.from(new Set(a.assignments.flatMap(re=>re.tags??[]))).sort().map(re=>({value:re,label:re})),Wt=a.assignments.filter(re=>Kg(re,{status:T,priority:L,type:B,assignee:R,tags:W,dateRange:Xl(z)})),Gn=uc(Wt,M,A),xt=new Set(m.definitions.map(re=>re.id)),jn=ee==="type"?[...m.definitions.map(re=>({id:re.id,title:ii(m,re.id),description:re.description})),...Wt.some(re=>!re.type||!xt.has(re.type))?[{id:sj,title:"Other",description:"Assignments with no recognized type."}]:[]]:G1(p.order).map(re=>({id:re,title:cc(p,re),description:Zd(re)}));function Pt({field:re,children:Ae}){const Qe=M===re;return r.jsx("th",{className:"pb-3 font-medium",children:r.jsxs("button",{type:"button",onClick:()=>ue(re),className:"inline-flex items-center gap-1 hover:text-foreground",children:[Ae,Qe?A==="asc"?r.jsx(c0,{className:"h-3 w-3"}):r.jsx(br,{className:"h-3 w-3"}):null]})})}return r.jsxs("div",{className:"space-y-5","data-density":k.density,children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(pn,{status:a.status}),a.statusOverride&&r.jsx("button",{type:"button",className:"shell-action border-warning-foreground/40 text-warning-foreground",onClick:()=>Fe(null),title:"Clear manual status override and return to derived status",children:"Clear Override"}),r.jsxs("select",{className:"shell-action appearance-none bg-transparent text-sm",value:"",onChange:re=>{re.target.value&&Fe(re.target.value)},title:"Override project status",children:[r.jsx("option",{value:"",children:"Set Status…"}),p.statuses.map(re=>r.jsx("option",{value:re.id,children:re.label},re.id)),r.jsx("option",{value:"active",children:"Active"})]}),r.jsx("button",{type:"button",className:"shell-action",onClick:()=>Nt(!a.archived),title:a.archived?"Restore this project and its cascade-hidden assignments":"Archive this project (hides it and its assignments from normal views)",children:a.archived?"Restore":"Archive"}),h&&h.workspaces.length>0&&r.jsxs("select",{className:"shell-action appearance-none bg-transparent text-sm",value:"",onChange:re=>{re.target.value==="_ungrouped"?$n(null):re.target.value&&$n(re.target.value)},title:"Move project to a different workspace",children:[r.jsx("option",{value:"",children:"Move to Workspace…"}),h.workspaces.filter(re=>re!==a.workspace).map(re=>r.jsx("option",{value:re,children:re},re)),a.workspace&&r.jsx("option",{value:"_ungrouped",children:"Ungrouped"})]}),r.jsxs(Ee,{className:"shell-action",to:`${n}/projects/${a.slug}/edit`,children:[r.jsx(gv,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Project"})]}),r.jsxs(Ee,{className:"shell-action shell-action--cta",to:`${n}/projects/${a.slug}/create/assignment`,children:[r.jsx(rn,{className:"h-4 w-4"}),r.jsx("span",{children:"New Assignment"})]}),r.jsx(Jg,{externalIds:a.externalIds}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Created ",Dn(a.created),". Last source update ",Lr(a.updated),"."]})]}),r.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:[r.jsx(An,{label:"Assignments",value:a.progress.total}),r.jsx(An,{label:"In Progress",value:a.progress.in_progress??0,tone:"info"}),r.jsx(An,{label:"Review",value:a.progress.review??0,tone:"info"}),r.jsx(An,{label:"Blocked",value:a.progress.blocked??0,tone:"warn"}),r.jsx(An,{label:"Completed",value:a.progress.completed??0,tone:"success"})]}),r.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,1fr)_280px]",children:[r.jsx("div",{className:"space-y-4",children:r.jsx(Qg,{value:E,onValueChange:j,items:[{value:"overview",label:"Overview",content:r.jsx("div",{className:"space-y-5",children:r.jsx(We,{title:"Project Overview",children:r.jsx(fn,{content:a.body,emptyState:"This project does not have overview content yet."})})})},{value:"assignments",label:"Assignments",count:a.assignments.filter(re=>!re.archived).length,content:r.jsx("div",{className:"space-y-5",children:r.jsx(We,{title:"Assignment Queue",description:"Board and table views over the source assignment files.",actions:r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(Pn,{ariaLabel:"Status filter",className:"max-w-[170px]",allLabel:"All statuses",options:p.statuses.map(re=>({value:re.id,label:re.label})),value:T,onChange:pe}),r.jsx(Pn,{ariaLabel:"Assignee filter",className:"max-w-[170px]",allLabel:"All assignees",options:Yt,value:R,onChange:Q}),r.jsx(Pn,{ariaLabel:"Priority filter",className:"max-w-[170px]",allLabel:"All priorities",options:[{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],value:L,onChange:ye}),r.jsx(Pn,{ariaLabel:"Type filter",className:"max-w-[170px]",allLabel:"All types",options:m.definitions.map(re=>({value:re.id,label:ii(m,re.id)})),value:B,onChange:Pe}),r.jsx(Pn,{ariaLabel:"Tags filter",className:"max-w-[170px]",allLabel:"Any tags",options:sn,value:W,onChange:lt}),r.jsx(jx,{className:"max-w-[190px]",value:z,onChange:H}),C==="kanban"&&r.jsxs("select",{value:ee==="type"?"type":"status",onChange:re=>te(re.target.value),className:"editor-input max-w-[170px]",title:"Group kanban by",children:[r.jsx("option",{value:"status",children:"Group: Status"}),r.jsx("option",{value:"type",children:"Group: Type"})]}),r.jsx(nf,{value:C,onChange:re=>Y(re),options:[{value:"kanban",label:"Kanban"},{value:"table",label:"Table"}]}),r.jsx(mN,{scope:Ne,loadedViewId:me,onApply:bt,onOpenSaveDialog:()=>{Ye(!1),he(!0)}}),r.jsx("button",{type:"button",onClick:()=>{Ke?Gt():(Ye(!1),he(!0))},className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:Ke?`Update ${Ke.name}`:"Save current view",children:Ke?`Update '${Ke.name}'`:"Save view"}),Ke?r.jsx("button",{type:"button",onClick:()=>{Ye(!0),he(!0)},className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:"Save as new view",children:"Save as new…"}):null]}),children:Wt.length===0?r.jsx(St,{title:"No assignments match these filters",description:"Clear the current filters or create a new assignment for this project.",actions:r.jsx(Ee,{className:"shell-action shell-action--cta",to:`${n}/projects/${a.slug}/create/assignment`,children:"Create Assignment"})}):C==="kanban"?r.jsx(Qd,{columns:jn,items:Gn,getItemId:re=>re.slug,getColumnId:re=>ee==="type"?re.type&&xt.has(re.type)?re.type:sj:re.status,dragDisabled:!0,renderCard:re=>r.jsx(iF,{projectSlug:a.slug,assignment:re}),emptyMessage:re=>`No ${re.title.toLowerCase()} assignments.`,hiddenColumnIds:de.hidden,onHideColumn:re=>ge(Ae=>({hidden:Ae.hidden.includes(re)?Ae.hidden.filter(Ft=>Ft!==re):[...Ae.hidden,re]}))}):(()=>{const re=new Set(V.hidden),Ae=Qe=>Qe==="title"||!re.has(Qe);return r.jsxs("div",{className:"overflow-x-auto",children:[r.jsx("div",{className:"mb-3 flex items-center justify-end",children:r.jsx(aN,{visibility:V,onChange:ae})}),r.jsxs("table",{className:"w-full min-w-[720px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[Ae("title")?r.jsx(Pt,{field:"title",children:"Assignment"}):null,Ae("status")?r.jsx(Pt,{field:"status",children:"Status"}):null,r.jsx("th",{className:"pb-3 font-medium",children:"Type"}),Ae("priority")?r.jsx(Pt,{field:"priority",children:"Priority"}):null,Ae("assignee")?r.jsx(Pt,{field:"assignee",children:"Assignee"}):null,Ae("dependencies")?r.jsx(Pt,{field:"dependencies",children:"Dependencies"}):null,Ae("created")?r.jsx(Pt,{field:"created",children:"Created"}):null,Ae("updated")?r.jsx(Pt,{field:"updated",children:"Updated"}):null]})}),r.jsx("tbody",{children:Gn.map(Qe=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[Ae("title")?r.jsx("td",{className:"py-4",children:r.jsx(Ee,{to:`${n}/projects/${a.slug}/assignments/${Qe.slug}`,className:"font-semibold text-foreground hover:text-primary",children:Qe.title})}):null,Ae("status")?r.jsx("td",{className:"py-4",children:r.jsx(pn,{status:Qe.status})}):null,r.jsx("td",{className:"py-4",children:r.jsx(ea,{type:Qe.type,compact:!0})}),Ae("priority")?r.jsx("td",{className:"py-4 capitalize text-muted-foreground",children:Qe.priority}):null,Ae("assignee")?r.jsx("td",{className:"py-4 text-muted-foreground",children:Qe.assignee??"—"}):null,Ae("dependencies")?r.jsx("td",{className:"py-4 text-muted-foreground",children:Qe.dependsOn.length}):null,Ae("created")?r.jsx("td",{className:"py-4 text-muted-foreground",children:Dn(Qe.created)}):null,Ae("updated")?r.jsx("td",{className:"py-4 text-muted-foreground",children:Dn(Qe.updated)}):null]},Qe.slug))})]})]})})()})})},{value:"todos",label:"Todos",content:r.jsx(K_,{projectId:a.slug})},{value:"dependencies",label:"Dependencies",content:a.dependencyGraph?r.jsx(We,{title:"Dependency Graph",description:"Rendered from the derived graph when available, with a source-based fallback.",children:r.jsx(sO,{definition:a.dependencyGraph,nodeRoutes:Be})}):r.jsx(St,{title:"No dependency graph yet",description:"Dependencies appear here once assignments declare dependsOn relationships."})},{value:"knowledge",label:"Knowledge",content:r.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[r.jsx(We,{title:"Resources",description:"Shared project references.",actions:r.jsxs(Ee,{className:"shell-action",to:`/resources/new?project=${a.slug}`,children:[r.jsx(rn,{className:"h-4 w-4"}),r.jsx("span",{children:"New Resource"})]}),children:a.resources.length===0?r.jsx(St,{title:"No resources yet",description:"Resources live at the project level and stay available to every assignment."}):r.jsx("div",{className:"space-y-3",children:a.resources.map(re=>r.jsxs(Ee,{to:`/projects/${a.slug}/resources/${re.slug}`,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:re.name}),r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[re.category," · ",re.source]})]},re.slug))})}),r.jsx(We,{title:"Memories",description:"Learnings and patterns captured during the project.",actions:r.jsxs(Ee,{className:"shell-action",to:`/memories/new?project=${a.slug}`,children:[r.jsx(rn,{className:"h-4 w-4"}),r.jsx("span",{children:"New Memory"})]}),children:a.memories.length===0?r.jsx(St,{title:"No memories yet",description:"Memories capture patterns discovered during execution so later assignments can reuse them."}):r.jsx("div",{className:"space-y-3",children:a.memories.map(re=>r.jsxs(Ee,{to:`/projects/${a.slug}/memories/${re.slug}`,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:re.name}),r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[re.scope," · ",re.source]})]},re.slug))})})]})}]})}),r.jsxs("div",{className:"space-y-5",children:[r.jsx(We,{title:"Progress Summary",children:r.jsx(gd,{progress:a.progress,showLegend:!0})}),r.jsx(We,{title:"Attention",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("dt",{className:"text-muted-foreground",children:"Blocked"}),r.jsx("dd",{className:"font-semibold text-foreground",children:a.needsAttention.blockedCount})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("dt",{className:"text-muted-foreground",children:"Failed"}),r.jsx("dd",{className:"font-semibold text-foreground",children:a.needsAttention.failedCount})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("dt",{className:"text-muted-foreground",children:"Unanswered questions"}),r.jsx("dd",{className:"font-semibold text-foreground",children:a.needsAttention.openQuestions})]})]})}),r.jsx(We,{title:"Quick Links",children:r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs(Ee,{className:"flex items-center gap-2 text-primary hover:underline",to:`${n}/projects/${a.slug}/edit`,children:[r.jsx(gv,{className:"h-4 w-4"}),"Edit project source"]}),r.jsxs(Ee,{className:"flex items-center gap-2 text-primary hover:underline",to:`${n}/projects/${a.slug}/create/assignment`,children:[r.jsx(rn,{className:"h-4 w-4"}),"Create assignment"]}),r.jsxs(Ee,{className:"flex items-center gap-2 text-primary hover:underline",to:"/help",children:[r.jsx(QT,{className:"h-4 w-4"}),"Review project rules"]}),r.jsxs("button",{type:"button",onClick:()=>j("dependencies"),className:"flex items-center gap-2 text-primary hover:underline",children:[r.jsx(tg,{className:"h-4 w-4"}),"Jump to dependencies"]})]})}),a.archived?r.jsxs(We,{title:"Archive Metadata",children:[r.jsxs("p",{className:"text-sm leading-6 text-muted-foreground",children:["Archived ",a.archivedAt?Lr(a.archivedAt):"with no timestamp recorded","."]}),a.archivedReason?r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.archivedReason}):null]}):null]})]}),r.jsx(na,{toast:ot,onDismiss:Ie}),r.jsx(pN,{open:ke,onOpenChange:re=>{he(re),re||Ye(!1)},initialName:Je&&Ke?`${Ke.name} (copy)`:"",title:Je?"Save as new view":"Save view",onSubmit:_t})]})}function iF({projectSlug:e,assignment:t}){const n=ln();return r.jsxs(Ee,{to:`${n}/projects/${e}/assignments/${t.slug}`,className:"vp-card block rounded-lg border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:t.title}),r.jsxs("p",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:t.id,children:[t.id.slice(0,8),r.jsx("span",{onClick:s=>{s.preventDefault(),s.stopPropagation()},children:r.jsx($r,{value:t.id})})]}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",Dn(t.updated)]})]}),r.jsx(pn,{status:t.status})]}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.jsx(ea,{type:t.type}),r.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs capitalize text-muted-foreground",children:t.priority}),r.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:t.assignee??"Unassigned"}),r.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[t.dependsOn.length," dependencies"]})]})]})}function wN({sessionId:e,disabled:t=!1,disabledReason:n,onError:s,onNotice:a}){const[l,c]=f.useState(!1),[u,p]=f.useState(!1);async function m(){if(!(t||u)){p(!0);try{const h=await fetch(`/api/launch/command?session=${encodeURIComponent(e)}&mode=resume`);if(!h.ok){const y=await h.json().catch(()=>null);throw new Error((y==null?void 0:y.error)??`HTTP ${h.status}`)}const g=await h.json().catch(()=>null);if(!g||typeof g.command!="string")throw new Error("Malformed response from launch command endpoint");if(!navigator.clipboard||typeof navigator.clipboard.writeText!="function")throw new Error("Clipboard API is unavailable in this context.");await navigator.clipboard.writeText(g.command),c(!0),setTimeout(()=>c(!1),1500),typeof g.fallbackWarning=="string"&&g.fallbackWarning&&(a==null||a(g.fallbackWarning))}catch(h){s==null||s(h instanceof Error?h:new Error(String(h)))}finally{p(!1)}}}return t?r.jsx("button",{type:"button",disabled:!0,"aria-disabled":"true",className:"cursor-not-allowed text-muted-foreground/50",title:n??"Copy launch command unavailable","aria-label":"Copy launch command",children:r.jsx(xv,{className:"h-3 w-3","aria-hidden":"true"})}):r.jsx("button",{type:"button",onClick:m,disabled:u,className:"text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 rounded disabled:cursor-wait",title:l?"Copied!":"Copy launch command (cd + resume)","aria-label":"Copy launch command",children:l?r.jsx(Xr,{className:"h-3 w-3 text-status-completed-foreground","aria-hidden":"true"}):r.jsx(xv,{className:"h-3 w-3","aria-hidden":"true"})})}function jl(e,t,n,s){let a=`syntaur://open?${e.kind}=${encodeURIComponent(e.id)}`;return e.kind==="session"&&t&&(a+=`&mode=${encodeURIComponent(t)}`),n&&(a+=`&terminal=${encodeURIComponent(n)}`),s&&e.kind==="assignment"&&(a+=`&agent=${encodeURIComponent(s)}`),a}function lF(e){return e.kind==="session"?{method:"POST",url:`/api/agent-sessions/${encodeURIComponent(e.id)}/worktree/recreate`}:e.projectSlug&&e.assignmentSlug?{method:"POST",url:`/api/projects/${encodeURIComponent(e.projectSlug)}/assignments/${encodeURIComponent(e.assignmentSlug)}/worktree/recreate`}:{method:"POST",url:`/api/assignments/${encodeURIComponent(e.id)}/worktree/recreate`}}function cF(e){if(!e.trim())return"Branch name is required.";if(/\s/.test(e))return"Branch name cannot contain whitespace.";if(/[\x00-\x1F\x7F~^:?*[\\]/.test(e))return"Branch name cannot contain any of: ~ ^ : ? * [ \\ or control characters.";if(e.startsWith("-"))return'Branch name cannot start with "-".';if(e.startsWith("/")||e.endsWith("/"))return'Branch name cannot start or end with "/".';if(e.endsWith("."))return'Branch name cannot end with ".".';if(e.includes(".."))return'Branch name cannot contain "..".';if(e.includes("@{"))return'Branch name cannot contain "@{".';if(e==="@")return'Branch name cannot be "@".';for(const t of e.split("/")){if(!t)return'Branch name cannot contain empty path segments (e.g. "a//b").';if(t.startsWith("."))return'Branch name segments cannot start with ".".';if(t.endsWith(".lock"))return'Branch name segments cannot end with ".lock".'}return null}async function jN(e,t,n,s){const a=await fetch(`/api/projects/${e}/assignments/${t}/transitions/${n.command}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s?{reason:s}:{})}),l=await a.json().catch(()=>null);if(!a.ok)throw new Error((l==null?void 0:l.error)||`HTTP ${a.status}`);return l.assignment}async function kN(e,t,n){const s=await fetch(`/api/projects/${e}/assignments/${t}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:n})}),a=await s.json().catch(()=>null);if(!s.ok)throw new Error((a==null?void 0:a.error)||`HTTP ${s.status}`);return a.assignment}async function uF(e,t){const n=await fetch(`/api/projects/${e}/assignments/${t}`,{method:"DELETE"}),s=await n.json().catch(()=>null);if(!n.ok)throw new Error((s==null?void 0:s.error)||`HTTP ${n.status}`)}function SN(e){return e.requiresReason||e.command==="block"}async function dF(e){const t=await fetch(`/api/projects/${e.projectSlug}/assignments/${e.assignmentSlug}/title`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e.title})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.assignment}async function fF(e){const t=await fetch(`/api/assignments/${e.id}/title`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e.title})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.assignment}class Sx extends Error{constructor(t,n){super(t),this.stderr=n,this.name="CreateWorktreeError"}}async function Nx(e){const t=await e.json().catch(()=>null);return new Sx((t==null?void 0:t.error)||`HTTP ${e.status}`,t==null?void 0:t.stderr)}async function pF(e){const t=await fetch(`/api/projects/${e}/repository-candidates`),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.candidates}async function mF(e){const t=await fetch(`/api/assignments/${e}/repository-candidates`),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.candidates}async function hF(e,t,n){const s=await fetch(`/api/projects/${e}/assignments/${t}/worktree`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!s.ok)throw await Nx(s);return(await s.json()).assignment}async function gF(e,t){const n=await fetch(`/api/assignments/${e}/worktree`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw await Nx(n);return(await n.json()).assignment}async function xF(e){const{url:t}=lF(e),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!n.ok)throw await Nx(n);return await n.json()}async function cf(e){const t=await e.json().catch(()=>null);if(!e.ok)throw new Error((t==null?void 0:t.error)||`HTTP ${e.status}`);return t}async function yF(e,t,n){const s=await fetch(`/api/projects/${e}/assignments/${t}/repository-branches?repo=${encodeURIComponent(n)}`);return cf(s)}async function bF(e,t){const n=await fetch(`/api/assignments/${e}/repository-branches?repo=${encodeURIComponent(t)}`);return cf(n)}async function vF(e,t){const n=await fetch(`/api/projects/${e}/assignments/${t}/source-assignments`);return(await cf(n)).sourceAssignments}async function wF(e){const t=await fetch(`/api/assignments/${e}/source-assignments`);return(await cf(t)).sourceAssignments}function NN(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),[a,l]=f.useState(null),[c,u]=f.useState(null),[p,m]=f.useState(null),[h,g]=f.useState(null),[y,b]=f.useState(!1),[E,j]=f.useState(null),[w,k]=f.useState(null);async function C(R,$,L){if(!e){t(!0);try{const K=await fetch("/api/launch/preflight",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:{kind:R.kind,id:R.id}})});if(!K.ok){window.location.href=jl(R,$,void 0,L);return}const B=await K.json();if(B.ok){window.location.href=jl(R,$,void 0,L);return}if(B.reason==="workspace-path-invalid"){B.recreate?(m(B.recreate),g({target:R,mode:$,agentId:L})):u(B.message);return}s(B),l({target:R,mode:$,agentId:L})}catch(K){console.warn("preflight failed, firing without override:",K),window.location.href=jl(R,$,void 0,L)}finally{t(!1)}}}function N(){!n||!a||(window.location.href=jl(a.target,a.mode,n.suggestedFallback,a.agentId),s(null),l(null))}async function T(){if(!(!p||!h||y)){b(!0),j(null);try{const R=await xF({kind:p.kind,id:p.id,projectSlug:p.projectSlug,assignmentSlug:p.assignmentSlug}),{target:$,mode:L,agentId:K}=h;m(null),g(null),window.location.href=jl($,L,void 0,K),!R.exact&&!R.alreadyExisted&&k(`Recreated from ${R.baseUsed} — the original branch couldn't be restored exactly, but the directory is back and your agent is opening.`)}catch(R){j(R instanceof Sx&&R.stderr?`${R.message}
|
|
544
|
-
${R.stderr}`:R instanceof Error?R.message:String(R))}finally{b(!1)}}}const D=r.jsxs(r.Fragment,{children:[r.jsx(Ga,{open:n!==null,onOpenChange:R=>!R&&(s(null),l(null)),children:r.jsxs(Bo,{children:[r.jsxs(Ya,{children:[r.jsxs(Uo,{children:[n==null?void 0:n.terminal," is not installed"]}),r.jsxs(Vo,{children:["Open in ",r.jsx("strong",{children:n==null?void 0:n.suggestedFallback})," instead? You can change the default in"," ",r.jsx(Ee,{to:"/settings",className:"underline hover:text-foreground",onClick:()=>{s(null),l(null)},children:"Settings"}),"."]})]}),r.jsxs(Ja,{children:[r.jsx(Ul,{className:"shell-action mt-0",children:"Cancel"}),r.jsxs(oo,{className:"shell-action mt-0 shell-action--cta",onClick:R=>{R.preventDefault(),N()},children:["Open in ",n==null?void 0:n.suggestedFallback]})]})]})}),r.jsx(Ga,{open:c!==null,onOpenChange:R=>!R&&u(null),children:r.jsxs(Bo,{children:[r.jsxs(Ya,{children:[r.jsx(Uo,{children:"Can't open in agent"}),r.jsxs(Vo,{children:[c," Set a valid worktree or repository, then try again."]})]}),r.jsx(Ja,{children:r.jsx(oo,{className:"shell-action mt-0 shell-action--cta",onClick:()=>u(null),children:"OK"})})]})}),r.jsx(Ga,{open:p!==null,onOpenChange:R=>{!R&&!y&&(m(null),g(null),j(null))},children:r.jsxs(Bo,{children:[r.jsxs(Ya,{children:[r.jsx(Uo,{children:"Worktree was deleted"}),r.jsxs(Vo,{children:["The worktree at ",r.jsx("code",{children:p==null?void 0:p.deletedPath})," no longer exists. Recreate it",p!=null&&p.branch?r.jsxs(r.Fragment,{children:[" ","on branch ",r.jsx("code",{children:p.branch})]}):null," ","so this can open?"]})]}),E&&r.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 text-xs text-destructive",children:E}),r.jsxs(Ja,{children:[r.jsx(Ul,{className:"shell-action mt-0",disabled:y,children:"No"}),r.jsx(oo,{className:"shell-action mt-0 shell-action--cta",disabled:y,onClick:R=>{R.preventDefault(),T()},children:y?"Recreating…":"Yes, recreate"})]})]})}),r.jsx(Ga,{open:w!==null,onOpenChange:R=>!R&&k(null),children:r.jsxs(Bo,{children:[r.jsxs(Ya,{children:[r.jsx(Uo,{children:"Worktree recreated"}),r.jsx(Vo,{children:w})]}),r.jsx(Ja,{children:r.jsx(oo,{className:"shell-action mt-0 shell-action--cta",onClick:()=>k(null),children:"OK"})})]})})]});return{open:C,pending:e,dialogs:D}}function CN({session:e,onMarkStopped:t}){const n=NN(),s={kind:"session",id:e.sessionId},a="size-3.5",l=Se("shell-action","inline-flex items-center justify-center px-2 py-1 text-xs","disabled:cursor-not-allowed disabled:opacity-50"),c="inline-flex outline-none focus-visible:ring-1 focus-visible:ring-ring rounded-sm",u=!e.resumeSupported&&!e.forkSupported;return r.jsxs(r.Fragment,{children:[r.jsx(Wo,{delayDuration:200,children:r.jsxs("div",{className:"inline-flex items-center gap-1",children:[u&&r.jsxs(Pr,{children:[r.jsx(Ar,{asChild:!0,children:r.jsx("span",{tabIndex:0,className:c,children:r.jsxs("button",{type:"button",disabled:!0,"aria-disabled":!0,className:l,children:[r.jsx(Za,{className:a}),r.jsx("span",{children:"Reopen"})]})})}),r.jsx(gr,{side:"top",children:"Reopen unavailable — this agent has no resume/fork command configured"})]}),e.resumeSupported&&(e.isLive?r.jsxs(Pr,{children:[r.jsx(Ar,{asChild:!0,children:r.jsx("span",{tabIndex:0,className:c,children:r.jsxs("button",{type:"button",disabled:!0,"aria-disabled":!0,className:l,children:[r.jsx(Za,{className:a}),r.jsx("span",{children:"Resume"})]})})}),r.jsx(gr,{side:"top",children:"Session appears active — fork instead to avoid transcript corruption"})]}):r.jsxs(Pr,{children:[r.jsx(Ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:l,disabled:n.pending,onClick:()=>void n.open(s,"resume"),children:[r.jsx(Za,{className:a}),r.jsx("span",{children:"Resume"})]})}),r.jsx(gr,{side:"top",children:"Continue this session in its agent (same session id, same transcript)"})]})),e.forkSupported&&r.jsxs(Pr,{children:[r.jsx(Ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:l,disabled:n.pending,onClick:()=>void n.open(s,"fork"),children:[r.jsx(fR,{className:a}),r.jsx("span",{children:"Fork"})]})}),r.jsx(gr,{side:"top",children:"Branch a new session from this point — safe even when the original is still running"})]}),e.status==="active"&&r.jsxs(Pr,{children:[r.jsx(Ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:l,onClick:()=>t(e.sessionId),children:[r.jsx(og,{className:a}),r.jsx("span",{children:"Mark stopped"})]})}),r.jsx(gr,{side:"top",children:e.resumeSupported?"Tell the dashboard this session has ended so Resume re-enables":"Tell the dashboard this session has ended"})]})]})}),n.dialogs]})}async function jF(e){await fetch(`/api/agent-sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"stopped"})})}function EN({sessions:e,loading:t,error:n,onError:s,onNotice:a}){return t&&!e?null:n&&!e?r.jsx(We,{title:"Agent Sessions",children:r.jsx(St,{title:"Couldn't load sessions",description:n})}):!e||e.length===0?r.jsx(We,{title:"Agent Sessions",children:r.jsx(St,{title:"No agent sessions yet",description:"Sessions appear here when an agent registers one via /grab-assignment or syntaur track-session."})}):r.jsx(We,{title:"Agent Sessions",children:r.jsx("div",{className:"space-y-2",children:e.map(l=>r.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm",children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Ad,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"font-medium text-foreground",children:l.agent}),r.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground",title:l.sessionId,children:[l.sessionId.slice(0,8),r.jsx($r,{value:l.sessionId}),r.jsx(wN,{sessionId:l.sessionId,disabled:!l.resumeSupported,disabledReason:"Resume not supported for this agent",onError:s,onNotice:a})]})]}),r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(pn,{status:l.status}),r.jsx("span",{className:"text-xs text-muted-foreground",children:Lr(l.started)})]}),r.jsx(CN,{session:l,onMarkStopped:jF})]},l.sessionId))})})}const qm="Cost / Usage";function TN({summary:e,error:t}){return t&&!e?r.jsx(We,{title:qm,children:r.jsx(St,{title:"Couldn't load usage",description:t})}):e?e.lastEventDay===null?r.jsx(We,{title:qm,children:r.jsx(St,{title:"No usage recorded yet",description:"Cost and token totals appear here once the usage collector records activity for this assignment."})}):r.jsx(We,{title:qm,children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx(aj,{label:"Total cost",value:od(e.totalCost)}),r.jsx(aj,{label:"Total tokens",value:sd(e.totalTokens)})]}),e.byModel.length>1?r.jsxs("div",{className:"space-y-1.5 border-t border-border pt-3",children:[r.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"By model"}),r.jsx("div",{className:"space-y-1",children:e.byModel.map(n=>r.jsxs("div",{className:"flex items-center justify-between gap-2 text-sm",children:[r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx(Od,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"truncate font-mono text-xs text-foreground",title:n.model,children:n.model})]}),r.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:[sd(n.totalTokens)," · ",od(n.totalCost)]})]},n.model))})]}):null,r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last usage recorded ",dP(e.lastEventDay)]})]})}):null}function aj({label:e,value:t}){return r.jsxs("div",{className:"space-y-0.5",children:[r.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),r.jsx("p",{className:"text-lg font-semibold tabular-nums text-foreground",children:t})]})}function RN({open:e,action:t,assignmentTitle:n,loading:s=!1,onConfirm:a,onOpenChange:l}){const[c,u]=f.useState("");f.useEffect(()=>{e||u("")},[e,t==null?void 0:t.command]);const p=f.useMemo(()=>t&&t.command==="block"?"Blocked Reason":"Reason",[t]);if(!t)return null;const m=`${t.label} "${n}"`,h=s?"Applying...":t.label,g=c.trim()||void 0;return r.jsx(ar,{open:e,onOpenChange:y=>s?void 0:l(y),children:r.jsx(Kn,{className:"max-w-xl",children:r.jsxs("form",{className:"space-y-5",onSubmit:y=>{y.preventDefault(),a(g)},children:[r.jsxs(Zr,{children:[r.jsx(qn,{children:m}),r.jsx(gs,{children:t.description})]}),t.warning?r.jsx("div",{className:"rounded-lg border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:t.warning}):null,r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:p}),r.jsx("textarea",{value:c,onChange:y=>u(y.target.value),autoFocus:!0,rows:4,disabled:s,placeholder:"Optional context for why this assignment is blocked.",className:"editor-textarea min-h-[120px] bg-background/95 font-sans"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Leave this blank to continue without a written reason."})]}),r.jsxs(Ls,{children:[r.jsx("button",{type:"button",onClick:()=>l(!1),disabled:s,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"submit",disabled:s,className:"shell-action shell-action--cta disabled:cursor-not-allowed disabled:opacity-50",children:h})]})]})})})}function sa({open:e,title:t,description:n,confirmLabel:s,cancelLabel:a="Cancel",loading:l=!1,destructive:c=!1,onConfirm:u,onOpenChange:p}){return r.jsx(Ga,{open:e,onOpenChange:m=>l?void 0:p(m),children:r.jsxs(Bo,{children:[r.jsxs(Ya,{children:[r.jsx(Uo,{children:t}),r.jsx(Vo,{children:n})]}),r.jsxs(Ja,{children:[r.jsx(Ul,{disabled:l,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:a}),r.jsx(oo,{disabled:l,className:`shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50 ${c?"border-destructive/80 bg-destructive text-destructive-foreground hover:bg-destructive/90":"shell-action--cta"}`,onClick:m=>{m.preventDefault(),u()},children:l?"Working...":s})]})]})})}const kF=/^[a-z0-9][a-z0-9_-]*$/,PN=["first","last","none"];class AN extends Error{constructor(n,s){super(n);Qb(this,"fieldErrors");this.name="AgentsConfigError",this.fieldErrors=s}}const Cx={agents:[],custom:!1};let Xa=null,Ka=null,vd=0;const _h=new Set;function DN(e){Xa=e;for(const t of _h)t(e)}function SF(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(typeof t.id!="string"||t.id.length===0||typeof t.label!="string"||typeof t.command!="string")return null;const n={id:t.id,label:t.label,command:t.command};return Array.isArray(t.args)&&t.args.every(s=>typeof s=="string")&&(n.args=t.args),typeof t.promptArgPosition=="string"&&PN.includes(t.promptArgPosition)&&(n.promptArgPosition=t.promptArgPosition),typeof t.resolveFromShellAliases=="boolean"&&(n.resolveFromShellAliases=t.resolveFromShellAliases),typeof t.default=="boolean"&&(n.default=t.default),typeof t.model=="string"&&(n.model=t.model),typeof t.playbook=="string"&&(n.playbook=t.playbook),n}function Ex(e){if(!e||typeof e!="object")return Cx;const t=e,n=Array.isArray(t.agents)?t.agents:[],s=[];for(const a of n){const l=SF(a);l&&s.push(l)}return{agents:s,custom:t.custom===!0}}function NF(){if(Xa)return Promise.resolve(Xa);if(Ka)return Ka;const e=++vd;return Ka=fetch("/api/config/agents").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{Ka=null;const n=Ex(t);return e!==vd?Xa??n:(Xa=n,n)}).catch(()=>(Ka=null,Cx)),Ka}function $N(){const[e,t]=f.useState(()=>Xa??Cx);return f.useEffect(()=>{let n=!1;return NF().then(s=>{n||t(s)}),_h.add(t),()=>{n=!0,_h.delete(t)}},[]),e}async function LN(e){const t=await e.json().catch(()=>null),n=(t==null?void 0:t.error)??`HTTP ${e.status}`;return new AN(n,t==null?void 0:t.fieldErrors)}async function CF(e){++vd;const t=await fetch("/api/config/agents",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:e})});if(!t.ok)throw await LN(t);const n=Ex(await t.json());return DN(n),n}async function EF(){++vd;const e=await fetch("/api/config/agents",{method:"DELETE"});if(!e.ok)throw await LN(e);const t=Ex(await e.json());return DN(t),t}function ON({target:e,worktreePath:t=null,repository:n=null,size:s="default",title:a}){const l=e.kind==="assignment"&&!t&&!n,c=NN(),p=$N().agents,[m,h]=f.useState(null);f.useEffect(()=>{p.length!==0&&h(D=>D&&p.some($=>$.id===D)?D:(p.find($=>$.default)??p[0]).id)},[p]);const g=e.kind==="assignment"&&p.length>1,y=p.find(D=>D.id===m)??null,b=f.useRef(null),[E,j]=f.useState(!1);f.useEffect(()=>{if(!E)return;function D($){b.current&&!b.current.contains($.target)&&j(!1)}function R($){$.key==="Escape"&&j(!1)}return document.addEventListener("mousedown",D),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",D),document.removeEventListener("keydown",R)}},[E]);function w(D){c.open(e,void 0,D)}const k=e.kind==="assignment"?"Open this assignment in your configured terminal + agent":"Resume this session in its agent",C="Set a workspace path first — see the Workspace Before Code playbook",N=Se("shell-action",s==="compact"&&"inline-flex items-center justify-center px-2 py-1 text-xs","disabled:cursor-not-allowed disabled:opacity-50");if(l)return r.jsxs("button",{type:"button",disabled:!0,title:C,className:N,"aria-disabled":!0,children:[r.jsx(Za,{className:"size-3.5"}),r.jsx("span",{children:"Open in agent"})]});const T=e.kind==="session"?"Open":"Open in agent";return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative inline-flex",ref:b,children:[r.jsxs("div",{className:"inline-flex items-stretch",children:[r.jsxs("button",{type:"button",onClick:()=>w(m??void 0),disabled:c.pending,title:(a??k)+(g&&y?` (${y.label})`:""),className:Se(N,g&&"rounded-r-none"),children:[r.jsx(Za,{className:"size-3.5"}),r.jsx("span",{children:T})]}),g&&r.jsx("button",{type:"button",onClick:()=>j(D=>!D),disabled:c.pending,"aria-haspopup":"menu","aria-expanded":E,"aria-label":"Choose which agent to launch",title:"Choose which agent to launch",className:Se(N,"-ml-px rounded-l-none",s==="compact"?"px-1":"px-1.5"),children:r.jsx(br,{className:Se("size-3.5 opacity-70 transition-transform",E&&"rotate-180")})})]}),E&&g&&r.jsxs("div",{role:"menu","aria-label":"Open with agent",className:"absolute right-0 top-full z-30 mt-1 min-w-[180px] overflow-hidden rounded-md border border-border/70 bg-background py-1 shadow-lg",children:[r.jsx("div",{className:"px-2.5 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground/70",children:"Open with agent"}),p.map(D=>r.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":D.id===m,onClick:()=>{h(D.id),j(!1),w(D.id)},className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-accent",children:[r.jsx(Xr,{className:Se("size-3.5 shrink-0",D.id===m?"opacity-100":"opacity-0")}),r.jsx("span",{className:"truncate",children:D.label}),D.default&&r.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground/60",children:"default"})]},D.id))]})]}),c.dialogs]})}const Gm="w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";function IN({projectSlug:e,assignmentSlug:t,assignmentId:n,defaultBranch:s,defaultParentBranch:a="main",onCreated:l}){const c=e&&t?{kind:"project-nested",projectSlug:e,assignmentSlug:t}:{kind:"standalone",assignmentId:n},[u,p]=f.useState(!1),[m,h]=f.useState("new-branch"),[g,y]=f.useState(null),[b,E]=f.useState(null),[j,w]=f.useState(""),[k,C]=f.useState(!1),[N,T]=f.useState(""),[D,R]=f.useState([]),[$,L]=f.useState(!1),[K,B]=f.useState(null),[O,W]=f.useState(""),[se,z]=f.useState(null),[H,ee]=f.useState(null),[ne,M]=f.useState(""),[G,A]=f.useState(s),[F,Z]=f.useState(!1),[I,de]=f.useState(null);f.useEffect(()=>{if(!u)return;let J=!1;return h("new-branch"),y(null),E(null),w(""),C(!1),T(""),R([]),L(!1),B(null),W(""),z(null),ee(null),M(""),A(s),de(null),(c.kind==="project-nested"?pF(c.projectSlug):mF(c.assignmentId)).then(Oe=>{if(!J)if(y(Oe),Oe.length===0)C(!0);else{const Xe=Oe.find(nt=>nt.source==="project"),Me=Oe.find(nt=>nt.source==="sibling");w((Xe==null?void 0:Xe.path)??(Me==null?void 0:Me.path)??Oe[0].path)}}).catch(Oe=>{J||(E(Oe.message),y([]),C(!0))}),(c.kind==="project-nested"?vF(c.projectSlug,c.assignmentSlug):wF(c.assignmentId)).then(Oe=>{J||z(Oe)}).catch(Oe=>{J||(ee(Oe.message),z([]))}),()=>{J=!0}},[u,s,a,e,t,n]);const ge=m==="branch-off"?(se??[]).find(J=>J.id===ne)??null:null,V=m==="branch-off"?(ge==null?void 0:ge.repository)??"":k?N.trim():j;f.useEffect(()=>{if(!u||m!=="new-branch")return;if(!V){R([]),B(null),L(!1),W("");return}let J=!1;return L(!0),B(null),W(""),(c.kind==="project-nested"?yF(c.projectSlug,c.assignmentSlug,V):bF(c.assignmentId,V)).then(Ne=>{if(J)return;R(Ne.branches);const Oe=(Ne.defaultBranch&&Ne.branches.includes(Ne.defaultBranch)?Ne.defaultBranch:Ne.branches.includes(a)?a:Ne.branches[0])??"";W(Oe),L(!1)}).catch(Ne=>{J||(R([]),B(Ne.message),L(!1))}),()=>{J=!0}},[u,m,V,a,e,t,n]);const ae=cF(G.trim()),me=f.useMemo(()=>!V||!G.trim()?"":`${V.replace(/\/+$/,"")}/.worktrees/${G.trim()}`,[V,G]),ve=g!==null&&g.length===0,ke=se!==null&&se.length===0,he=J=>{J!==m&&(h(J),M(""),de(null),J==="branch-off"&&(W(""),R([]),B(null),L(!1)))},Je=J=>{M(J);const Ie=(se??[]).find(Ne=>Ne.id===J);W((Ie==null?void 0:Ie.branch)??"")},Ye=F||ae!==null||!V||!O.trim()||(m==="new-branch"?g===null||$:se===null||!ne),ot=async()=>{Z(!0),de(null);try{const J={repository:V,branch:G.trim(),parentBranch:O.trim()};c.kind==="project-nested"?await hF(c.projectSlug,c.assignmentSlug,J):await gF(c.assignmentId,J),p(!1),l()}catch(J){J instanceof Sx?de({message:J.message,stderr:J.stderr}):J instanceof Error?de({message:J.message}):de({message:String(J)})}finally{Z(!1)}};return r.jsxs(ar,{open:u,onOpenChange:J=>F?void 0:p(J),children:[r.jsxs("button",{type:"button",className:"shell-action inline-flex items-center gap-1.5",onClick:()=>p(!0),children:[r.jsx(dR,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsx("span",{children:"Create worktree"})]}),r.jsxs(Kn,{children:[r.jsxs(Zr,{children:[r.jsx(qn,{children:"Create worktree"}),r.jsxs(gs,{children:["Creates a git worktree at ",r.jsx("code",{children:"<repo>/.worktrees/<branch>"})," and records the workspace fields on this assignment's frontmatter."]})]}),r.jsxs("div",{className:"grid gap-4 text-sm",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-1 rounded-md border border-border/70 p-1",children:[r.jsx("button",{type:"button",disabled:F,onClick:()=>he("new-branch"),className:`rounded px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed ${m==="new-branch"?"bg-foreground text-background":"text-muted-foreground hover:bg-muted"}`,children:"New branch from repo"}),r.jsx("button",{type:"button",disabled:F,onClick:()=>he("branch-off"),className:`rounded px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed ${m==="branch-off"?"bg-foreground text-background":"text-muted-foreground hover:bg-muted"}`,children:"Branch off another assignment"})]}),m==="new-branch"?r.jsxs(r.Fragment,{children:[ve?r.jsxs("div",{className:"rounded-md border border-warning-foreground/30 bg-warning px-3 py-2 text-xs text-warning-foreground",children:["No repositories configured for this project. Enter a repo path below, or add a"," ",r.jsx("code",{children:"repositories:"})," list to ",r.jsx("code",{children:"project.md"}),"."]}):null,b?r.jsxs("div",{className:"rounded-md border border-error-foreground/30 bg-error px-3 py-2 text-xs text-error-foreground",children:["Could not load repository candidates: ",b]}):null,r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Repository"}),r.jsx("select",{className:Gm,value:j,onChange:J=>w(J.target.value),disabled:F||g===null||k,children:(g??[]).map(J=>r.jsxs("option",{value:J.path,children:[J.path,J.source==="project"?" (project)":J.sourceAssignmentSlug?` (sibling — ${J.sourceAssignmentSlug})`:" (sibling)"]},`${J.source}:${J.path}`))}),ve?null:r.jsx("button",{type:"button",className:"justify-self-start text-[11px] text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:F,onClick:()=>C(J=>!J),children:k?"Use a listed repository":"Enter a custom repository path (advanced)"}),k?r.jsx("input",{className:"mt-1 w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",type:"text",placeholder:"/absolute/path/to/repo",value:N,onChange:J=>T(J.target.value),disabled:F}):null]}),r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Parent branch"}),r.jsx("select",{className:Gm,value:O,onChange:J=>W(J.target.value),disabled:F||$||D.length===0,children:$?r.jsx("option",{value:"",children:"Loading branches…"}):D.length===0?r.jsx("option",{value:"",children:K?"Could not load branches":V?"No branches found":"— pick a repository —"}):D.map(J=>r.jsx("option",{value:J,children:J},J))}),K?r.jsxs("span",{className:"text-[11px] text-error-foreground",children:["Could not load branches: ",K]}):null]})]}):r.jsxs(r.Fragment,{children:[H?r.jsxs("div",{className:"rounded-md border border-error-foreground/30 bg-error px-3 py-2 text-xs text-error-foreground",children:["Could not load assignments: ",H]}):null,ke?r.jsx("div",{className:"rounded-md border border-warning-foreground/30 bg-warning px-3 py-2 text-xs text-warning-foreground",children:"No other assignments with a configured workspace to branch off. Create a worktree for one first, or use “New branch from repo”."}):r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Source assignment"}),r.jsxs("select",{className:Gm,value:ne,onChange:J=>Je(J.target.value),disabled:F||se===null,children:[r.jsx("option",{value:"",children:"— select an assignment —"}),(se??[]).map(J=>r.jsxs("option",{value:J.id,children:[J.title," (",J.branch,")"]},J.id))]})]}),ge?r.jsxs("div",{className:"grid gap-2 rounded-md border border-border/70 bg-muted/40 px-3 py-2 text-xs",children:[r.jsxs("div",{className:"grid gap-0.5",children:[r.jsx("span",{className:"font-medium text-muted-foreground",children:"Repository (from source)"}),r.jsx("code",{className:"break-all",children:ge.repository})]}),r.jsxs("div",{className:"grid gap-0.5",children:[r.jsx("span",{className:"font-medium text-muted-foreground",children:"Parent branch (from source)"}),r.jsx("code",{children:ge.branch})]})]}):null]}),r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"New branch name"}),r.jsx("input",{className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",type:"text",value:G,onChange:J=>A(J.target.value),disabled:F}),ae?r.jsx("span",{className:"text-[11px] text-error-foreground",children:ae}):null]}),r.jsxs("div",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Worktree path"}),r.jsx("code",{className:"rounded-md border border-border bg-muted px-2 py-1 text-xs break-all",children:me||r.jsx("span",{className:"opacity-60",children:"— pick a repo & branch —"})})]}),I?r.jsxs("div",{className:"rounded-md border border-error-foreground/30 bg-error px-3 py-2 text-xs text-error-foreground",children:[r.jsx("div",{className:"font-medium",children:I.message}),I.stderr?r.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-[11px] opacity-90",children:I.stderr}):null]}):null]}),r.jsxs(Ls,{children:[r.jsx(O3,{disabled:F,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",disabled:Ye,onClick:()=>void ot(),className:"shell-action mt-0 shell-action--cta disabled:cursor-not-allowed disabled:opacity-50",children:F?"Working…":"Create worktree"})]})]})]})}function TF(e){const t=e.split(`
|
|
545
|
-
`),n=t.findIndex(c=>/^##\s+Acceptance Criteria\s*$/i.test(c.trim()));if(n===-1)return{acceptanceCriteria:[],summaryBody:e};let s=t.length;for(let c=n+1;c<t.length;c+=1)if(/^#{1,2}\s+\S/.test(t[c].trim())){s=c;break}const a=t.slice(n+1,s).map(c=>c.match(/^\s*[-*]\s+\[( |x|X)\]\s+(.*)$/)).filter(c=>!!c).map(c=>({checked:c[1].toLowerCase()==="x",text:c[2].trim()})),l=[...t.slice(0,n),...t.slice(s)].join(`
|
|
546
|
-
`).replace(/\n{3,}/g,`
|
|
547
|
-
|
|
548
|
-
`).trim();return{acceptanceCriteria:a,summaryBody:l}}function RF(e){const t=e.split(`
|
|
549
|
-
`),n=t.findIndex(c=>/^##\s+Todos\s*$/i.test(c.trim()));if(n===-1)return{hasSection:!1,todosMarkdown:"",remaining:e};let s=t.length;for(let c=n+1;c<t.length;c+=1)if(/^#{1,2}\s+\S/.test(t[c].trim())){s=c;break}const a=t.slice(n+1,s).join(`
|
|
550
|
-
`).replace(/<!--[\s\S]*?-->/g,"").replace(/\n{3,}/g,`
|
|
551
|
-
|
|
552
|
-
`).trim(),l=[...t.slice(0,n),...t.slice(s)].join(`
|
|
553
|
-
`).replace(/\n{3,}/g,`
|
|
554
|
-
|
|
555
|
-
`).trim();return{hasSection:!0,todosMarkdown:a,remaining:l}}function PF({projectSlug:e,dependencies:t,blockedReason:n}){const[s,a]=f.useState(!1);if(t.length===0)return null;const l=t.filter(u=>u.status!=="completed"&&u.status!=="review"),c=l.length===0;return c&&!s?r.jsxs("button",{type:"button",onClick:()=>a(!0),className:"flex w-full items-center gap-2 rounded-lg border border-success-foreground/30 bg-success/70 px-4 py-2.5 text-left transition hover:bg-success",children:[r.jsx(Zh,{className:"h-4 w-4 shrink-0 text-success-foreground"}),r.jsxs("span",{className:"text-sm font-medium text-success-foreground",children:["All ",t.length," ",t.length===1?"dependency":"dependencies"," resolved"]}),r.jsx(br,{className:"ml-auto h-4 w-4 text-success-foreground"})]}):r.jsxs("div",{className:"space-y-3",children:[l.length>0&&r.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-warning-foreground/30 bg-warning px-4 py-3",children:[r.jsx(lh,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning-foreground"}),r.jsxs("div",{className:"text-sm text-warning-foreground",children:[r.jsxs("strong",{children:[l.length," ",l.length===1?"dependency is":"dependencies are"," not yet completed."]}),n&&r.jsxs("p",{className:"mt-1 text-warning-foreground/80",children:["Blocked reason: ",n]})]})]}),r.jsx(We,{title:"Dependencies",description:`${t.length-l.length} of ${t.length} resolved`,actions:c?r.jsx("button",{type:"button",onClick:()=>a(!1),className:"text-xs text-muted-foreground hover:text-foreground",children:"Collapse"}):void 0,children:r.jsx("div",{className:"divide-y divide-border/40",children:t.map(u=>r.jsxs(Ee,{to:`/projects/${e}/assignments/${u.slug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[r.jsx(pn,{status:u.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:u.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:u.slug})]}),u.assignee&&r.jsx("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:u.assignee}),r.jsx(nd,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},u.slug))})})]})}function AF({links:e}){const t=ln();if(e.length===0)return null;const n=e.filter(a=>!a.isReverse),s=e.filter(a=>a.isReverse);return r.jsx(We,{title:"Linked Assignments",description:`${e.length} ${e.length===1?"link":"links"}`,children:r.jsxs("div",{className:"divide-y divide-border/40",children:[n.map(a=>r.jsxs(Ee,{to:`${t}/projects/${a.projectSlug}/assignments/${a.assignmentSlug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[r.jsx(a0,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),r.jsx(pn,{status:a.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:a.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.slug})]}),r.jsx(nd,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`fwd-${a.slug}`)),s.map(a=>r.jsxs(Ee,{to:`${t}/projects/${a.projectSlug}/assignments/${a.assignmentSlug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[r.jsx(td,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),r.jsx(pn,{status:a.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:a.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.slug})]}),r.jsx(nd,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`rev-${a.slug}`))]})})}function DF(e){const t=new Map;for(const s of e)t.set(s.id,{entry:s,replies:[]});const n=[];for(const s of e){const a=t.get(s.id);s.replyTo&&t.has(s.replyTo)?t.get(s.replyTo).replies.push(a):n.push(a)}return n}function $F(e,t){return e===null?`/api/assignments/${encodeURIComponent(t)}/comments`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments`}function MN({projectSlug:e,assignmentSlug:t,entries:n}){const[s,a]=f.useState(n);f.useEffect(()=>{a(n)},[n]);const l=f.useMemo(()=>DF(s),[s]),[c,u]=f.useState(""),[p,m]=f.useState("note"),[h,g]=f.useState(!1),[y,b]=f.useState(null);async function E(w){var N;if(w.preventDefault(),!c.trim())return;g(!0),b(null);const k=`tmp-${Date.now()}`,C={id:k,timestamp:new Date().toISOString(),author:"human",type:p,body:c,resolved:p==="question"?!1:void 0};a(T=>[...T,C]);try{const T=await fetch($F(e,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:c,type:p})});if(!T.ok){const $=await T.text();throw new Error($||`HTTP ${T.status}`)}const D=await T.json().catch(()=>null),R=(N=D==null?void 0:D.comment)==null?void 0:N.id;a($=>$.map(L=>L.id===k?{...L,id:R??L.id}:L)),u(""),window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(T){b(T instanceof Error?T.message:String(T)),a(D=>D.filter(R=>R.id!==k))}finally{g(!1)}}async function j(w,k){a(C=>C.map(N=>N.id===w?{...N,resolved:k}:N));try{const C=e===null?`/api/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(w)}/resolved`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(w)}/resolved`,N=await fetch(C,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({resolved:k})});if(!N.ok)throw new Error(`HTTP ${N.status}`);window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(C){b(C instanceof Error?C.message:String(C)),a(N=>N.map(T=>T.id===w?{...T,resolved:!k}:T))}}return r.jsx(We,{title:"Comments",description:"Threaded questions, notes, and feedback. Questions can be resolved once answered.",children:r.jsxs("div",{className:"space-y-4",children:[l.map(w=>r.jsx(_N,{node:w,onToggleResolved:j,depth:0},w.entry.id)),r.jsxs("form",{onSubmit:E,className:"mt-6 space-y-2 border-t border-border pt-4",children:[r.jsx("label",{className:"block text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Add comment"}),r.jsx("textarea",{value:c,onChange:w=>u(w.target.value),className:"w-full rounded border border-border bg-background p-2 text-sm",rows:3,placeholder:"Ask a question, leave a note, or give feedback…"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("select",{value:p,onChange:w=>m(w.target.value),className:"rounded border border-border bg-background px-2 py-1 text-xs",children:[r.jsx("option",{value:"note",children:"note"}),r.jsx("option",{value:"question",children:"question"}),r.jsx("option",{value:"feedback",children:"feedback"})]}),r.jsx("button",{type:"submit",disabled:h||!c.trim(),className:"shell-action",children:h?"Posting…":"Post comment"}),y?r.jsx("span",{className:"text-xs text-error-foreground",children:y}):null]})]})]})})}function _N({node:e,depth:t,onToggleResolved:n}){const{entry:s,replies:a}=e,l=s.type==="question";return r.jsxs("div",{className:Se("space-y-2",t>0&&"ml-4 border-l border-border pl-4"),children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx("span",{className:"font-mono",children:s.id}),r.jsx("span",{children:"·"}),r.jsx("span",{children:s.timestamp}),r.jsx("span",{children:"·"}),r.jsx("span",{className:"font-medium text-foreground",children:s.author}),r.jsx("span",{children:"·"}),r.jsx("span",{className:Se("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase",l&&"bg-warning text-warning-foreground",s.type==="feedback"&&"bg-info text-info-foreground",s.type==="note"&&"bg-muted text-muted-foreground"),children:s.type}),l?r.jsxs("button",{type:"button",onClick:()=>n(s.id,!s.resolved),className:Se("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium",s.resolved?"bg-success text-success-foreground hover:bg-success/80":"bg-muted text-muted-foreground hover:bg-muted/80"),title:s.resolved?"Mark unresolved":"Mark resolved",children:[s.resolved?r.jsx(Zh,{className:"h-3 w-3"}):r.jsx(nR,{className:"h-3 w-3"}),s.resolved?"resolved":"open"]}):null,s.replyTo?r.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[r.jsx(kR,{className:"h-3 w-3"}),s.replyTo]}):null]}),r.jsx(fn,{content:s.body}),a.length>0?r.jsx("div",{className:"space-y-2",children:a.map(c=>r.jsx(_N,{node:c,depth:t+1,onToggleResolved:n},c.entry.id))}):null]})}const LF=["review","complete","shape","plan-ready","implement","unblock","start","block","fail","reopen"];function ij(){var lt,te,be,Le,it,_e,bt,_t,Gt;const{slug:e,aslug:t}=$t(),n=Dt(),s=ln(),[a,l]=hs(),[c,u]=f.useState(null),{toast:p,showToast:m,dismissToast:h}=ta(),[g,y]=f.useState(null),[b,E]=f.useState(null),[j,w]=f.useState(null),[k,C]=f.useState(null),[N,T]=f.useState(!1),[D,R]=f.useState(!1),[$,L]=f.useState(0),K=a.get("tab")??"summary",B=Zo(),{data:O,loading:W,error:se,refetch:z}=jP(e,t),{data:H}=F0(e),{data:ee}=dg(),{data:ne,loading:M,error:G}=SP(e,t),{data:A,loading:F,error:Z}=CP(e,t),I=f.useMemo(()=>{if(!O||!H)return[];const ue=new Map(H.assignments.map(Be=>[Be.slug,Be]));return O.dependsOn.map(Be=>{const Fe=ue.get(Be);return{slug:Be,title:(Fe==null?void 0:Fe.title)??Be,status:(Fe==null?void 0:Fe.status)??"pending",priority:(Fe==null?void 0:Fe.priority)??"medium",assignee:(Fe==null?void 0:Fe.assignee)??null}})},[O,H]),de=I.filter(ue=>ue.status!=="completed"&&ue.status!=="review");mo("assignment");const ge=f.useMemo(()=>((H==null?void 0:H.assignments)??[]).map(ue=>ue.slug),[H]),V=t?ge.indexOf(t):-1,ae=V>0?ge[V-1]:null,me=V>=0&&V<ge.length-1?ge[V+1]:null,ve=`${s}/projects/${e}/assignments/${t}`;Ht({keys:"e",scope:"assignment",description:"Edit assignment",handler:()=>n(`${ve}/edit`)}),Ht({keys:"p",scope:"assignment",description:"Edit plan",handler:()=>n(`${ve}/plan/edit`)}),Ht({keys:"h",scope:"assignment",description:"Append handoff",handler:()=>n(`${ve}/handoff/edit`)}),Ht({keys:"d",scope:"assignment",description:"Append decision record",handler:()=>n(`${ve}/decision-record/edit`)}),Ht({keys:"s",scope:"assignment",description:"Edit scratchpad",handler:()=>n(`${ve}/scratchpad/edit`)}),Ht({keys:"[",scope:"assignment",description:"Previous assignment in project",enabled:!!ae,handler:()=>ae&&n(`${s}/projects/${e}/assignments/${ae}`)}),Ht({keys:"]",scope:"assignment",description:"Next assignment in project",enabled:!!me,handler:()=>me&&n(`${s}/projects/${e}/assignments/${me}`)});const ke=f.useMemo(()=>O?TF(O.body):{acceptanceCriteria:[],summaryBody:""},[O]),he=f.useMemo(()=>RF(ke.summaryBody),[ke.summaryBody]),Je=ke.acceptanceCriteria,Ye=Je.filter(ue=>ue.checked).length,ot=Je.length>0&&Ye===Je.length,J=f.useRef(ot),Ie=f.useRef(!1);if(f.useEffect(()=>{if(O){if(!Ie.current){J.current=ot,Ie.current=!0;return}ot&&!J.current&&L(ue=>ue+1),J.current=ot}},[ot,O]),W)return r.jsx(mt,{label:"Loading assignment workspace…"});if(se||!O||!e||!t)return r.jsx(wt,{error:se||"Assignment not found."});const Ne=e,Oe=t,Xe=Je.length>0?{checked:Ye,total:Je.length}:void 0,Me=O.availableTransitions??[],nt=Me.filter(ue=>!ue.disabled&&ue.targetStatus!==O.status),Ke=LF.map(ue=>nt.find(Be=>Be.command===ue)).find(Boolean)??nt[0]??null,gt=[];if(ee!=null&&ee.sessions)for(const ue of ee.sessions)for(const Be of ue.windows)for(const Fe of Be.panes)((lt=Fe.assignment)==null?void 0:lt.project)===e&&((te=Fe.assignment)==null?void 0:te.slug)===t&>.push({sessionName:ue.name,command:Fe.command,urls:Fe.urls});async function Rt(ue){u(null);try{await kN(Ne,Oe,ue),z()}catch(Be){u(Be.message)}}async function at(ue){u(null);try{const Be=await fetch(`/api/projects/${Ne}/assignments/${Oe}/${ue?"archive":"unarchive"}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!Be.ok){const Fe=await Be.json().catch(()=>null);throw new Error((Fe==null?void 0:Fe.error)||`HTTP ${Be.status}`)}z(),m(ue?"Assignment archived":"Assignment restored","success")}catch(Be){u(Be.message)}}async function ie(){R(!0);try{await uF(Ne,Oe),n(`${s}/projects/${Ne}`)}catch(ue){u(ue.message),R(!1),T(!1)}}async function Y(ue,Be){u(null),y(ue.command);try{return await jN(Ne,Oe,ue,Be),z(),!0}catch(Fe){return u(Fe.message),!1}finally{y(null)}}function pe(ue){if(SN(ue)){E(ue);return}Y(ue)}async function Q(ue,Be){w(null),C(ue);try{const Fe=await fetch(`/api/projects/${Ne}/assignments/${Oe}/acceptance-criteria/${ue}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({checked:Be})}),Nt=await Fe.json();if(!Fe.ok)throw new Error(Nt.error||`HTTP ${Fe.status}`);z()}catch(Fe){w(Fe.message)}finally{C(null)}}const ye=[...nt.filter(ue=>ue!==Ke).map(ue=>({key:`transition-${ue.command}`,label:ue.label,onSelect:()=>pe(ue),disabled:g===ue.command})),...Me.filter(ue=>ue.disabled||ue.targetStatus===O.status).map(ue=>({key:`transition-${ue.command}`,label:ue.label,disabled:!0,disabledReason:ue.targetStatus===O.status?`Already ${O.status.replace(/_/g," ")}`:ue.disabledReason??ue.warning??ue.description})),...B.statuses.map(ue=>({key:`override-${ue.id}`,label:`Override → ${ue.label}`,onSelect:()=>Rt(ue.id),disabled:ue.id===O.status,disabledReason:ue.id===O.status?"Already in this status":void 0})),{key:"edit-assignment",label:"Edit assignment source",icon:uR,href:`${s}/projects/${e}/assignments/${t}/edit`},{key:"edit-plan",label:"Edit plan",icon:NR,href:`${s}/projects/${e}/assignments/${t}/plan/edit`},{key:"edit-scratchpad",label:"Edit scratchpad",icon:um,href:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`},{key:"append-handoff",label:"Append handoff",icon:nd,href:`${s}/projects/${e}/assignments/${t}/handoff/edit`},{key:"append-decision",label:"Append decision",icon:pR,href:`${s}/projects/${e}/assignments/${t}/decision-record/edit`},{key:O.archived?"unarchive":"archive",label:O.archived?"Restore assignment":"Archive assignment",icon:O.archived?ed:Dd,onSelect:()=>at(!O.archived)},{key:"delete",label:"Delete assignment",icon:or,destructive:!0,onSelect:()=>T(!0)}],Pe=(Ke==null?void 0:Ke.command)==="review";return r.jsxs("div",{className:"space-y-5",children:[r.jsx(na,{toast:p,onDismiss:h}),r.jsxs("div",{className:"sticky top-12 z-20 rounded-lg border border-border/60 bg-card/90 p-3 shadow-sm backdrop-blur",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(pn,{status:O.status,progress:Xe}),r.jsx(ea,{type:O.type}),r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:O.title}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Updated ",N0(O.updated)]}),de.length>0&&r.jsxs("span",{className:"text-xs text-warning-foreground",children:["⚠ ",de.length," unmet dep",de.length===1?"":"s"]}),r.jsx(Jg,{externalIds:O.externalIds}),r.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[r.jsx(ON,{target:{kind:"assignment",id:O.id},worktreePath:((be=O.workspace)==null?void 0:be.worktreePath)??null,repository:((Le=O.workspace)==null?void 0:Le.repository)??null}),!((it=O.workspace)!=null&&it.worktreePath)&&e&&t&&r.jsx(IN,{projectSlug:e,assignmentSlug:t,defaultBranch:`syntaur/${e}/${t}`,onCreated:()=>z()}),Ke&&r.jsx("button",{type:"button",title:Ke.warning||Ke.description,disabled:g===Ke.command,onClick:()=>pe(Ke),className:Se("shell-action disabled:cursor-not-allowed disabled:opacity-50",Ke.warning&&"border-warning-foreground/40",Pe&&$>0&&"send-to-review-glow"),children:r.jsx("span",{children:g===Ke.command?"Working…":Ke.label})},Pe?`review-${$}`:Ke.command),r.jsx(Wg,{items:ye,align:"end"})]})]}),c?r.jsx("p",{className:"mt-4 rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:c}):null,O.blockedReason?r.jsxs("div",{className:"mt-4 rounded-md border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:[r.jsx("strong",{children:"Blocked reason:"})," ",O.blockedReason]}):null]}),I.length>0&&r.jsx(PF,{projectSlug:e,dependencies:I,blockedReason:O.blockedReason}),O.enrichedLinks&&O.enrichedLinks.length>0&&r.jsx(AF,{links:O.enrichedLinks}),O.referencedBy&&O.referencedBy.length>0&&r.jsx(We,{title:"Referenced by",description:"Other assignments whose Todos, progress, comments, or handoffs link to this one.",children:r.jsx("ul",{className:"space-y-2",children:O.referencedBy.map(ue=>{const Be=ue.sourceProjectSlug===null?`/assignments/${ue.sourceId}`:`${s}/projects/${ue.sourceProjectSlug}/assignments/${ue.sourceSlug}`;return r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx(Ee,{to:Be,className:"text-foreground hover:text-primary",children:ue.sourceTitle}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",ue.mentions," mention",ue.mentions===1?"":"s",")"]}),ue.sourceProjectSlug===null?r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"}):null]},ue.sourceId)})})}),r.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,1fr)_280px]",children:[r.jsx("div",{className:"space-y-4",children:r.jsx(Qg,{value:K,onValueChange:ue=>l({tab:ue}),items:[{value:"summary",label:"Summary",content:r.jsxs("div",{className:"space-y-5",children:[ke.acceptanceCriteria.length>0?r.jsx(We,{title:"Acceptance Criteria",description:"These checkboxes update the source assignment markdown.",children:r.jsxs("div",{className:"space-y-3",children:[j?r.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:j}):null,ke.acceptanceCriteria.map((ue,Be)=>{const Fe=k!==null;return r.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border/60 bg-background/80 px-3 py-3",children:[r.jsx("input",{type:"checkbox",checked:ue.checked,disabled:Fe,onChange:Nt=>Q(Be,Nt.target.checked),className:"mt-1 h-4 w-4 rounded border-border text-primary"}),r.jsx("span",{className:"criterion-label text-sm leading-6","data-checked":ue.checked,children:ue.text})]},`${Be}-${ue.text}`)})]})}):null,he.hasSection?r.jsx(We,{title:"Todos",description:"Checklist of work items from assignment.md. Links point to plan files.",children:r.jsx(fn,{content:he.todosMarkdown,emptyState:"No todos yet."})}):null,r.jsx(We,{title:"Assignment Summary",children:r.jsx(fn,{content:he.remaining,emptyState:ke.acceptanceCriteria.length>0||he.hasSection?"No additional summary markdown beyond the acceptance criteria and todos.":"This assignment does not have summary markdown yet."})})]})},{value:"plan",label:"Plan",count:O.plan?1:0,content:O.plan?r.jsx("div",{className:"space-y-5",children:r.jsxs(We,{title:"Plan",description:"Shows plan.md only. Versioned plans (plan-v2.md, ...) linked from the Todos section are not yet rendered here — open them from the filesystem.",actions:r.jsxs(Ee,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/plan/edit`,children:[r.jsx(um,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Plan"})]}),children:[r.jsx("div",{className:"mb-4",children:r.jsx(pn,{status:O.plan.status})}),r.jsx(fn,{content:O.plan.body,emptyState:"No plan content yet."})]})}):r.jsx(St,{title:"No plan yet",description:"Plan files are optional and versioned. Run /plan-assignment to create plan.md (or plan-v2.md, ...) and link it from the Todos section."})},{value:"scratchpad",label:"Scratchpad",count:O.scratchpad?1:0,content:O.scratchpad?r.jsx(We,{title:"Scratchpad",actions:r.jsxs(Ee,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`,children:[r.jsx(um,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Scratchpad"})]}),children:r.jsx(fn,{content:O.scratchpad.body,emptyState:"Scratchpad is empty."})}):r.jsx(St,{title:"No scratchpad yet",description:"Scratchpad notes appear here when you use the Edit Scratchpad action."})},{value:"handoff",label:"Handoff",count:((_e=O.handoff)==null?void 0:_e.handoffCount)??0,content:r.jsx("div",{className:"space-y-5",children:O.handoff?r.jsx(We,{children:r.jsx(fn,{content:O.handoff.body,emptyState:"No handoff history yet."})}):r.jsx(St,{title:"No handoff log yet",description:"Handoffs appear here when an agent runs /complete-assignment or you append one manually."})})},{value:"progress",label:"Progress",count:((bt=O.progress)==null?void 0:bt.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:O.progress&&O.progress.entries.length>0?r.jsx(We,{title:"Progress",description:"Reverse-chronological log of work done on this assignment. Agents append entries via progress.md.",children:r.jsx("ol",{className:"space-y-4",children:O.progress.entries.map((ue,Be)=>r.jsxs("li",{className:"border-l-2 border-border pl-3",children:[r.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:ue.timestamp}),r.jsx(fn,{content:ue.body})]},`${ue.timestamp}-${Be}`))})}):r.jsx(St,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((_t=O.comments)==null?void 0:_t.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:O.comments&&O.comments.entries.length>0?r.jsx(MN,{projectSlug:e,assignmentSlug:t,entries:O.comments.entries}):r.jsx(St,{title:"No comments yet",description:"Comments appear here when agents or humans post via `syntaur comment` or the dashboard."})})},{value:"decisions",label:"Decisions",count:((Gt=O.decisionRecord)==null?void 0:Gt.decisionCount)??0,content:r.jsx("div",{className:"space-y-5",children:O.decisionRecord?r.jsx(We,{children:r.jsx(fn,{content:O.decisionRecord.body,emptyState:"No decision history yet."})}):r.jsx(St,{title:"No decision record yet",description:"Decision records appear here when you append one via the Append Decision action."})})}]})}),r.jsxs("div",{className:"min-w-0 space-y-5",children:[r.jsx(We,{title:"Details",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsx(to,{label:"ID",value:O.id,copyable:!0}),r.jsx(to,{label:"Priority",value:O.priority}),O.assignee&&r.jsx(to,{label:"Assignee",value:O.assignee}),r.jsx(to,{label:"Updated",value:`${S0(O.updated)} · Created ${k0(O.created)}`}),O.workspace.repository&&r.jsx(to,{label:"Repository",value:O.workspace.repository,copyable:!0}),O.workspace.worktreePath&&r.jsx(to,{label:"Worktree",value:O.workspace.worktreePath,copyable:!0}),O.workspace.branch&&r.jsx(to,{label:"Branch",value:O.workspace.branch,copyable:!0}),O.workspace.parentBranch&&r.jsx(to,{label:"Parent branch",value:O.workspace.parentBranch,copyable:!0}),O.externalIds.map((ue,Be)=>r.jsx(OF,{entry:ue},`${ue.system}:${ue.id}:${Be}`))]})}),gt.length>0&&r.jsx(We,{title:"Servers",children:r.jsx("div",{className:"space-y-2",children:gt.map((ue,Be)=>r.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-sm",children:[r.jsx("span",{className:"min-w-0 max-w-full truncate rounded bg-muted/60 px-1.5 py-0.5 font-mono text-xs",title:ue.command,children:ue.command}),r.jsx("span",{className:"min-w-0 max-w-full truncate text-xs text-muted-foreground",title:ue.sessionName,children:ue.sessionName}),ue.urls.map(Fe=>r.jsxs("a",{href:Fe,target:"_blank",rel:"noopener noreferrer",title:Fe,className:"inline-flex min-w-0 max-w-full items-center gap-1 rounded border border-primary/30 bg-primary/5 px-1.5 py-0.5 text-xs font-medium text-primary hover:bg-primary/10 dark:border-primary/40 dark:bg-primary/10 dark:hover:bg-primary/20",children:[r.jsx("span",{className:"min-w-0 truncate",children:Fe.replace("http://localhost:",":")}),r.jsx(yi,{className:"h-2.5 w-2.5 shrink-0"})]},Fe))]},Be))})}),r.jsx(EN,{sessions:ne==null?void 0:ne.sessions,loading:M,error:G,onError:ue=>m(ue.message,"error"),onNotice:ue=>m(ue,"success")}),r.jsx(TN,{summary:A==null?void 0:A.summary,loading:F,error:Z})]})]}),r.jsx(RN,{open:b!==null,action:b,assignmentTitle:O.title,loading:g===(b==null?void 0:b.command),onOpenChange:ue=>{ue||E(null)},onConfirm:async ue=>{if(!b)return;await Y(b,ue)&&E(null)}}),r.jsx(sa,{open:N,title:"Delete assignment?",description:`This will permanently delete "${O.title}" and all its files (plan, scratchpad, handoff, decision record). This cannot be undone.`,confirmLabel:"Delete Assignment",destructive:!0,loading:D,onOpenChange:ue=>{ue||T(!1)},onConfirm:ie})]})}function to({label:e,value:t,copyable:n}){return r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("dt",{className:"text-muted-foreground",children:e}),r.jsxs("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:[r.jsx("span",{className:"block min-w-0 truncate",title:t,children:t}),n&&t!=="—"&&r.jsx($r,{value:t})]})]})}function OF({entry:e}){const t=e.url!=null&&e.url.length>0;return r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("dt",{className:"text-muted-foreground",children:e.system}),r.jsx("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:t?r.jsxs("a",{href:e.url??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${e.system}:${e.id} in ${e.system}`,className:"flex items-center gap-1.5 min-w-0 text-primary hover:underline",children:[r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id}),r.jsx(yi,{className:"h-2.5 w-2.5 shrink-0"})]}):r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id})})]})}function IF(){var R,$,L,K,B,O,W,se;const{id:e}=$t(),[t,n]=hs(),s=t.get("tab")??"summary",{data:a,loading:l,error:c,refetch:u}=kP(e),{data:p,loading:m,error:h}=NP(e),{data:g,loading:y,error:b}=EP(a==null?void 0:a.slug),[E,j]=f.useState(!1),[w,k]=f.useState(null),{toast:C,showToast:N,dismissToast:T}=ta();async function D(z){if(e){k(null);try{const H=await fetch(`/api/assignments/${e}/${z?"archive":"unarchive"}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!H.ok){const ee=await H.json().catch(()=>null);throw new Error((ee==null?void 0:ee.error)||`HTTP ${H.status}`)}u(),N(z?"Assignment archived":"Assignment restored","success")}catch(H){k(H instanceof Error?H.message:"Archive failed")}}}return l?r.jsx(mt,{}):c?r.jsx(wt,{error:c}):a?r.jsxs("div",{className:"space-y-6",children:[r.jsx(na,{toast:C,onDismiss:T}),r.jsxs("header",{className:"space-y-2",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(pn,{status:a.status}),r.jsx(ea,{type:a.type}),r.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:a.id}),r.jsx(Jg,{externalIds:a.externalIds}),r.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[r.jsx(ON,{target:{kind:"assignment",id:a.id},worktreePath:((R=a.workspace)==null?void 0:R.worktreePath)??null,repository:(($=a.workspace)==null?void 0:$.repository)??null,size:"compact"}),!((L=a.workspace)!=null&&L.worktreePath)&&r.jsx(IN,{assignmentId:a.id,defaultBranch:`syntaur/${a.slug}`,onCreated:()=>u()}),r.jsxs("button",{type:"button",onClick:()=>j(!0),className:"inline-flex items-center gap-1.5 rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:[r.jsx($d,{className:"h-3 w-3"}),"Move to workspace…"]}),r.jsx(Ee,{to:`/assignments/${a.id}/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit"}),r.jsxs("button",{type:"button",onClick:()=>D(!a.archived),className:"inline-flex items-center gap-1.5 rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",title:a.archived?"Restore this assignment":"Archive this assignment",children:[a.archived?r.jsx(ed,{className:"h-3 w-3"}):r.jsx(Dd,{className:"h-3 w-3"}),a.archived?"Restore":"Archive"]})]})]}),r.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:a.title}),a.blockedReason?r.jsxs("p",{className:"text-sm text-warning-foreground",children:["Blocked: ",a.blockedReason]}):null,w?r.jsx("p",{className:"text-sm text-status-failed-foreground",children:w}):null]}),r.jsx(We,{title:"Details",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsx(no,{label:"ID",value:a.id,copyable:!0}),r.jsx(no,{label:"Priority",value:a.priority}),a.assignee&&r.jsx(no,{label:"Assignee",value:a.assignee}),r.jsx(no,{label:"Updated",value:`${S0(a.updated)} · Created ${k0(a.created)}`}),a.workspace.repository&&r.jsx(no,{label:"Repository",value:a.workspace.repository,copyable:!0}),a.workspace.worktreePath&&r.jsx(no,{label:"Worktree",value:a.workspace.worktreePath,copyable:!0}),a.workspace.branch&&r.jsx(no,{label:"Branch",value:a.workspace.branch,copyable:!0}),a.workspace.parentBranch&&r.jsx(no,{label:"Parent branch",value:a.workspace.parentBranch,copyable:!0}),a.externalIds.map((z,H)=>r.jsx(MF,{entry:z},`${z.system}:${z.id}:${H}`))]})}),a.referencedBy&&a.referencedBy.length>0?r.jsx(We,{title:"Referenced by",description:"Other assignments whose bodies link to this one.",children:r.jsx("ul",{className:"space-y-2",children:a.referencedBy.map(z=>r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx(Ee,{to:z.sourceProjectSlug===null?`/assignments/${z.sourceId}`:`/projects/${z.sourceProjectSlug}/assignments/${z.sourceSlug}`,className:"text-foreground hover:text-primary",children:z.sourceTitle}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",z.mentions," mention",z.mentions===1?"":"s",")"]})]},z.sourceId))})}):null,r.jsx(EN,{sessions:p==null?void 0:p.sessions,loading:m,error:h,onError:z=>N(z.message,"error"),onNotice:z=>N(z,"success")}),r.jsx(TN,{summary:g==null?void 0:g.summary,loading:y,error:b}),r.jsx(Qg,{value:s,onValueChange:z=>n({tab:z}),items:[{value:"summary",label:"Summary",content:r.jsx("div",{className:"space-y-5",children:r.jsx(We,{title:"Assignment",children:r.jsx(fn,{content:a.body,emptyState:"This assignment does not have summary markdown yet."})})})},{value:"progress",label:"Progress",count:((K=a.progress)==null?void 0:K.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:a.progress&&a.progress.entries.length>0?r.jsx(We,{title:"Progress",description:"Reverse-chronological log of work done on this assignment.",children:r.jsx("ol",{className:"space-y-4",children:a.progress.entries.map((z,H)=>r.jsxs("li",{className:"border-l-2 border-border pl-3",children:[r.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:z.timestamp}),r.jsx(fn,{content:z.body})]},`${z.timestamp}-${H}`))})}):r.jsx(St,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((B=a.comments)==null?void 0:B.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:r.jsx(MN,{projectSlug:null,assignmentSlug:a.id,entries:((O=a.comments)==null?void 0:O.entries)??[]})})},{value:"plan",label:"Plan",content:r.jsx("div",{className:"space-y-5",children:a.plan?r.jsxs(We,{children:[r.jsx(fn,{content:a.plan.body,emptyState:"Plan file exists but is empty."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Ee,{to:`/assignments/${a.id}/plan/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit plan"})})]}):r.jsx(St,{title:"No plan file yet",description:"Create one via the CLI or `/plan-assignment`."})})},{value:"scratchpad",label:"Scratchpad",content:r.jsx("div",{className:"space-y-5",children:a.scratchpad?r.jsxs(We,{children:[r.jsx(fn,{content:a.scratchpad.body,emptyState:"Scratchpad is empty."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Ee,{to:`/assignments/${a.id}/scratchpad/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit scratchpad"})})]}):r.jsx(St,{title:"No scratchpad yet",description:"Scratchpad is scaffolded at assignment creation time."})})},{value:"handoff",label:"Handoff",count:((W=a.handoff)==null?void 0:W.handoffCount)??0,content:r.jsx("div",{className:"space-y-5",children:a.handoff?r.jsxs(We,{children:[r.jsx(fn,{content:a.handoff.body,emptyState:"No handoff history yet."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Ee,{to:`/assignments/${a.id}/handoff/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Append handoff"})})]}):r.jsx(St,{title:"No handoff log yet",description:"Handoffs appear here when an agent appends one."})})},{value:"decisions",label:"Decisions",count:((se=a.decisionRecord)==null?void 0:se.decisionCount)??0,content:r.jsx("div",{className:"space-y-5",children:a.decisionRecord?r.jsxs(We,{children:[r.jsx(fn,{content:a.decisionRecord.body,emptyState:"No decision history yet."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Ee,{to:`/assignments/${a.id}/decision-record/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Append decision"})})]}):r.jsx(St,{title:"No decision record yet",description:"Decision records appear here once appended."})})}]}),r.jsx(Yg,{open:E,onOpenChange:j,currentWorkspace:a.projectWorkspace,title:"Move assignment to workspace",description:"Standalone assignments belong to a project-workspace via the workspaceGroup frontmatter field.",onSubmit:async z=>{const H=await fetch(`/api/assignments/${encodeURIComponent(a.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:z})});if(!H.ok){const ee=await H.json().catch(()=>({}));throw new Error(ee.error||"Failed to move assignment")}u()}})]}):r.jsx(wt,{error:"Assignment not found"})}function no({label:e,value:t,copyable:n}){return r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("dt",{className:"text-muted-foreground",children:e}),r.jsxs("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:[r.jsx("span",{className:"truncate",title:t,children:t}),n&&t!=="—"&&r.jsx($r,{value:t})]})]})}function MF({entry:e}){const t=e.url!=null&&e.url.length>0;return r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("dt",{className:"text-muted-foreground",children:e.system}),r.jsx("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:t?r.jsxs("a",{href:e.url??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${e.system}:${e.id} in ${e.system}`,className:"flex items-center gap-1.5 min-w-0 text-primary hover:underline",children:[r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id}),r.jsx(yi,{className:"h-2.5 w-2.5 shrink-0"})]}):r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id})})]})}function _F({currentStatus:e,availableTransitions:t,onSelect:n,disabled:s=!1}){const[a,l]=f.useState(!1),[c,u]=f.useState(null),[p,m]=f.useState(0),h=f.useRef(null),g=f.useRef(null),y=f.useId(),b=hd(e),E=b.icon,j=f.useCallback(T=>{l(!1),T&&requestAnimationFrame(()=>{var D;(D=h.current)==null||D.focus()})},[]),w=f.useCallback(()=>{var D;const T=(D=h.current)==null?void 0:D.getBoundingClientRect();T&&u({top:T.top,left:T.left,width:T.width,bottom:T.bottom})},[]);f.useLayoutEffect(()=>{a&&w()},[a,w]),f.useEffect(()=>{if(!a)return;const T=()=>w();return window.addEventListener("scroll",T,!0),window.addEventListener("resize",T),()=>{window.removeEventListener("scroll",T,!0),window.removeEventListener("resize",T)}},[a,w]),f.useEffect(()=>{if(!a)return;const T=D=>{var $,L;const R=D.target;R&&(($=g.current)!=null&&$.contains(R)||(L=h.current)!=null&&L.contains(R)||j(!1))};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[a,j]),f.useEffect(()=>{a&&m(0)},[a,t.length]);function k(T){(T.key==="Enter"||T.key===" "||T.key==="ArrowDown")&&(T.preventDefault(),l(!0))}function C(T){if(t.length===0){T.key==="Escape"&&(T.preventDefault(),j(!0));return}if(T.key==="ArrowDown")T.preventDefault(),m(D=>(D+1)%t.length);else if(T.key==="ArrowUp")T.preventDefault(),m(D=>(D-1+t.length)%t.length);else if(T.key==="Home")T.preventDefault(),m(0);else if(T.key==="End")T.preventDefault(),m(t.length-1);else if(T.key==="Enter"){T.preventDefault();const D=t[p];D&&(n(D),j(!0))}else T.key==="Escape"&&(T.preventDefault(),j(!0))}function N(T){n(T),j(!1)}return r.jsxs(r.Fragment,{children:[r.jsxs("button",{ref:h,type:"button","data-no-drag":!0,disabled:s,"aria-haspopup":"menu","aria-expanded":a,"aria-controls":a?y:void 0,onClick:()=>{s||l(T=>!T)},onKeyDown:k,title:`Status: ${b.label}. Click to change.`,className:Se(H1(e),"cursor-pointer transition hover:brightness-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",s&&"cursor-not-allowed opacity-60"),children:[r.jsx(E,{className:"h-3.5 w-3.5"}),r.jsx("span",{children:b.label})]}),a&&c&&typeof document<"u"?Rs.createPortal(r.jsx("div",{ref:g,id:y,role:"menu",tabIndex:-1,autoFocus:!0,onKeyDown:C,style:{position:"fixed",top:c.bottom+6,left:c.left,minWidth:Math.max(c.width,180),zIndex:60},className:"rounded-md border border-border/70 bg-popover py-1 text-sm text-popover-foreground shadow-lg",children:t.length===0?r.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No transitions available from this status."}):t.map((T,D)=>{const R=hd(T.targetStatus),$=R.icon,L=D===p;return r.jsxs("button",{type:"button",role:"menuitem","data-no-drag":!0,onMouseEnter:()=>m(D),onClick:()=>N(T),title:T.warning||T.description,className:Se("flex w-full flex-col items-stretch gap-0.5 px-3 py-1.5 text-left text-sm transition",L?"bg-foreground/5":"hover:bg-foreground/5"),children:[r.jsxs("span",{className:"flex items-center justify-between gap-2",children:[r.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r.jsx($,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),r.jsx("span",{className:"truncate",children:T.label})]}),r.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:R.label})]}),T.warning?r.jsx("span",{className:"text-[11px] leading-snug text-warning-foreground",children:T.warning}):null]},`${T.command}:${T.targetStatus}`)})}),document.body):null]})}function FN({title:e,detailHref:t,onSave:n,disabled:s=!1}){const[a,l]=f.useState(!1);return a?r.jsx(FF,{initialTitle:e,disabled:s,onSave:n,onExit:()=>l(!1)}):r.jsxs("div",{className:"group flex items-baseline gap-1.5",children:[r.jsx("button",{type:"button","data-no-drag":!0,disabled:s,onClick:()=>{s||l(!0)},className:Se("text-left text-base font-semibold text-foreground transition hover:text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 rounded-sm",s&&"cursor-not-allowed opacity-60"),title:"Click to rename",children:e}),r.jsx(Ee,{to:t,"data-no-drag":!0,"aria-label":"Open detail page",title:"Open detail page",onClick:c=>c.stopPropagation(),className:"text-muted-foreground opacity-0 transition group-hover:opacity-100 focus:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 rounded-sm",children:r.jsx(yi,{className:"h-3.5 w-3.5"})})]})}function FF({initialTitle:e,disabled:t,onSave:n,onExit:s}){const a=f.useRef(e),[l,c]=f.useState(e),[u,p]=f.useState(!1),[m,h]=f.useState(!1),g=f.useRef(null),y=f.useRef(!1);f.useEffect(()=>{const w=g.current;w&&(w.focus(),w.select())},[]);const b=f.useCallback(()=>{var w;h(!0),window.setTimeout(()=>h(!1),260),(w=g.current)==null||w.focus()},[]),E=f.useCallback(async()=>{if(y.current)return;const w=l.trim();if(w.length===0){b();return}if(w===a.current){s();return}y.current=!0,p(!0);try{await n(w)}catch{}finally{p(!1),s()}},[l,s,n,b]);function j(w){w.key==="Enter"?(w.preventDefault(),E()):w.key==="Escape"&&(w.preventDefault(),y.current=!0,s())}return r.jsx("input",{ref:g,type:"text","data-no-drag":!0,disabled:t||u,value:l,onChange:w=>c(w.target.value),onKeyDown:j,onBlur:()=>void E(),className:Se("w-full rounded-sm border border-border bg-background px-1.5 py-0.5 text-base font-semibold text-foreground outline-none transition focus:border-ring focus:ring-1 focus:ring-ring",m&&"syntaur-input-shake",u&&"opacity-70")})}function zN(e){const t=Dt(),n=f.useRef(null),s=f.useRef(!1),a=f.useCallback(()=>{const c=n.current,u=!!(c!=null&&c.querySelector('[aria-expanded="true"]')),p=!!document.querySelector('[role="menu"]'),m=document.activeElement,h=!!(m&&(c!=null&&c.contains(m))&&(m.tagName==="INPUT"||m.tagName==="TEXTAREA"));s.current=u||p||h},[]),l=f.useCallback(c=>{if(s.current)return;const u=c.target;!u||u.closest(mi)||t(e)},[t,e]);return{containerRef:n,onMouseDown:a,onClick:l}}const lj=Ag;function cj(e){return e==="1"?"stale":e==="0"?"fresh":"all"}function zF(e,t){return e.toString()===t.toString()}function uj(){const{workspace:e}=$t(),t=ln(),n=Dt(),s=f.useRef(null);mo("list:assignments");const{data:a,loading:l,error:c,refetch:u}=Md(),p=Zo(),m=ef(),[h,g]=hs(),y=e?`w:${e}`:null,b=cN(y),E=f.useRef(void 0),j=f.useMemo(()=>G1(p.order),[p]),w=f.useMemo(()=>{const _={};for(const le of j)_[le]=cc(p,le);return _},[j,p]),k=f.useMemo(()=>j.map(_=>({id:_,title:w[_]??_,description:Zd(_)})),[j,w]),C=f.useMemo(()=>m.definitions.map(_=>({id:_.id,title:ii(m,_.id),description:_.description})),[m]),N="__unknown_type__",T=f.useMemo(()=>new Set(["all",...j]),[j]),D=h.get("view"),R=h.get("status"),$=h.get("stale"),L=D&&lj.includes(D)?D:"kanban";function K(_){if(!_)return[];const le=[];for(const xe of _.split(",")){const $e=xe.trim();!$e||$e==="all"||!T.has($e)||le.includes($e)||le.push($e)}return le}const B=f.useCallback(_=>{g(le=>{const xe=new URLSearchParams(le);return _==="kanban"?xe.delete("view"):xe.set("view",_),xe})},[g]),[O,W]=f.useState(""),[se,z]=f.useState(()=>K(R)),[H,ee]=f.useState(()=>tt(b.filters.priority)),[ne,M]=f.useState(()=>tt(b.filters.type)),[G,A]=f.useState(()=>tt(b.filters.assignee)),[F,Z]=f.useState(()=>tt(b.filters.project)),[I,de]=f.useState(()=>tt(b.filters.tags)),[ge,V]=f.useState(null),[ae,me]=f.useState(()=>cj($)),[ve,ke]=f.useState(()=>b.sortField),[he,Je]=f.useState(()=>b.sortDirection),[Ye,ot]=f.useState(()=>({hidden:[]})),[J,Ie]=f.useState(()=>({hidden:[]})),[Ne,Oe]=f.useState(()=>b.grouping),Xe=Ne==="type"?"type":"status",[Me,nt]=f.useState(()=>new Set),[Ke,gt]=f.useState([]),{toast:Rt,showToast:at,dismissToast:ie}=ta(),[Y,pe]=f.useState(null),[Q,ye]=f.useState(null),[Pe,lt]=f.useState(null),[te,be]=f.useState(null),[Le,it]=f.useState(null),[_e,bt]=f.useState(null),[_t,Gt]=f.useState(null),[ue,Be]=f.useState(null),[Fe,Nt]=f.useState(null),[$n,Yt]=f.useState(!1),[sn,Wt]=f.useState(!1),Gn=e?{kind:"workspace",workspace:e}:{kind:"global"},xt=h.get("loadView"),{view:jn,loading:Pt,error:re}=Go(xt),{view:Ae,loading:Qe,error:Ft}=Go(Fe),hn=f.useRef(null);f.useEffect(()=>{gt((a==null?void 0:a.assignments)??[])},[a]),f.useEffect(()=>{Fe&&!Qe&&!Ft&&!Ae&&Nt(null)},[Ae,Ft,Fe,Qe]),f.useEffect(()=>{Nt(null),hn.current=null,V(null),W("")},[e]),f.useEffect(()=>{const _=K(R);MD(_,se)||z(_);const le=cj($);le!==ae&&me(le)},[ae,$,se,R]),f.useEffect(()=>{E.current===y&&g(_=>{const le=new URLSearchParams(_);return se.length===0?le.delete("status"):le.set("status",se.join(",")),ae==="all"?le.delete("stale"):ae==="stale"?le.set("stale","1"):le.set("stale","0"),zF(_,le)?_:le})},[ae,y,g,se]),f.useEffect(()=>{ee(tt(b.filters.priority)),M(tt(b.filters.type)),A(tt(b.filters.assignee)),Z(tt(b.filters.project)),de(tt(b.filters.tags)),ke(b.sortField),Je(b.sortDirection),Oe(b.grouping)},[b.filters.priority,b.filters.type,b.filters.assignee,b.filters.project,b.filters.tags,b.sortField,b.sortDirection,b.grouping]),f.useEffect(()=>{if(E.current===y)return;let _=!1;return wx().then(le=>{if(_||E.current===y)return;const xe=r1(le,y),$e=xe.defaultView,ct=tt(xe.filters.status),pt=xe.filters.activity??"all",yt=new URLSearchParams(window.location.search);let cn=!1;const on=new URLSearchParams(yt);yt.get("view")===null&&$e!=="kanban"&&lj.includes($e)&&(on.set("view",$e),cn=!0),yt.get("status")===null&&ct.length>0&&(on.set("status",ct.join(",")),z(ct),cn=!0),yt.get("stale")===null&&pt!=="all"&&(on.set("stale",pt==="stale"?"1":"0"),me(pt),cn=!0),cn&&g(on,{replace:!0}),queueMicrotask(()=>{E.current=y})}),()=>{_=!0}},[y]);const Ct=f.useCallback(_=>{(y===null?dN(_):fN(y,_)).catch(xe=>{console.warn("Failed to persist view prefs:",xe)})},[y]),jf=f.useCallback(_=>{B(_),Ct({defaultView:_})},[B,Ct]),Ai=f.useCallback(_=>{z(_),Ct({filters:{status:_}})},[Ct]),_r=f.useCallback(_=>{ee(_),Ct({filters:{priority:_}})},[Ct]),oa=f.useCallback(_=>{M(_),Ct({filters:{type:_}})},[Ct]),aa=f.useCallback(_=>{A(_),Ct({filters:{assignee:_}})},[Ct]),Di=f.useCallback(_=>{Z(_),Ct({filters:{project:_}})},[Ct]),ia=f.useCallback(_=>{de(_),Ct({filters:{tags:_}})},[Ct]),la=f.useCallback(_=>{me(_),Ct({filters:{activity:_}})},[Ct]),ca=f.useCallback(_=>{ke(_),Ct({sortField:_})},[Ct]),go=f.useCallback(_=>{Je(_),Ct({sortDirection:_})},[Ct]),kf=f.useCallback(_=>{Oe(_),Ct({grouping:_})},[Ct]),ua=f.useCallback(()=>({viewMode:L,filters:{status:se,priority:H,type:ne,assignee:G,project:F,tags:I,activity:ae,dateRange:Xl(ge),search:O},sortField:ve,sortDirection:he,listSectionVisibility:{collapsed:[...Me]},kanbanColumnVisibility:Ye,tableColumnVisibility:J}),[L,se,H,ne,G,F,I,ae,ge,O,ve,he,Me,Ye,J]),Lt=f.useCallback(_=>{xN(_,{setViewMode:B,setStatusFilter:Ai,setPriorityFilter:_r,setTypeFilter:oa,setAssigneeFilter:aa,setProjectFilter:Di,setTagsFilter:ia,setActivityFilter:la,setDateRange:V,setSearch:W,setSortField:ca,setSortDirection:go,setListSectionVisibility:le=>nt(new Set(le.collapsed)),setKanbanColumnVisibility:ot,setTableColumnVisibility:Ie}),Nt(_.id)},[B,Ai,_r,oa,aa,Di,ia,la,ca,go]),Sf=f.useCallback(_=>{Lt(_),hn.current=_.id,g(le=>{const xe=new URLSearchParams(le);return xe.set("loadView",_.id),xe},{replace:!0})},[Lt,g]),$i=f.useCallback(async _=>{try{const le=Jl({name:_,context:{workspace:e??null,projectSlug:null},state:ua()}),xe=await Wd(le),$e=xe.views[xe.views.length-1];Nt(($e==null?void 0:$e.id)??null),$e&&(hn.current=$e.id,g(ct=>{const pt=new URLSearchParams(ct);return pt.set("loadView",$e.id),pt},{replace:!0})),Yt(!1),Wt(!1),at(`Saved view "${_}"`,"success")}catch(le){throw at(le instanceof Error?le.message:"Failed to save view","error"),le}},[ua,g,at,e]),xc=f.useCallback(async()=>{if(!(!Fe||!Ae))try{const _=Jl({name:Ae.name,context:{workspace:e??null,projectSlug:null},state:ua()}),le=kx(Ae.config,_.config,_.config);await Lg(Fe,{config:le}),at("View updated","success")}catch(_){at(_ instanceof Error?_.message:"Failed to update view","error")}},[ua,Ae,Fe,at,e]);f.useEffect(()=>{if(!xt){hn.current=null;return}if(hn.current!==xt&&(Fe&&Fe!==xt&&Nt(null),!Pt)){if(re){at("Couldn't load saved view — try again","error");return}if(jn){hn.current=xt,Lt(jn),g(_=>{const le=new URLSearchParams(_);return le.delete("loadView"),le},{replace:!0});return}hn.current=xt,at("Saved view no longer exists","error"),g(_=>{const le=new URLSearchParams(_);return le.delete("loadView"),le},{replace:!0})}},[xt,jn,Pt,re,Fe,Lt,g,at]);const Bn=f.useMemo(()=>Ke.filter(_=>e?e==="_ungrouped"?_.projectWorkspace===null:_.projectWorkspace===e:!0),[Ke,e]),Nf=f.useMemo(()=>Array.from(new Set(Bn.map(_=>_.status))).sort(),[Bn]),yc=f.useMemo(()=>Array.from(new Set(Bn.map(_=>_.priority))).sort(),[Bn]),da=f.useMemo(()=>Array.from(new Set(Bn.map(_=>_.assignee??"__unassigned__"))).sort(),[Bn]),vr=f.useMemo(()=>Array.from(new Map(Bn.filter(_=>_.projectSlug!==null).map(_=>[_.projectSlug,_.projectTitle]))).sort(([,_],[,le])=>_.localeCompare(le)),[Bn]),Cf=f.useMemo(()=>Array.from(new Set(Bn.flatMap(_=>_.tags??[]))).sort(),[Bn]),jt=f.useMemo(()=>Ke.filter(_=>Kg(_,{status:se,priority:H,type:ne,assignee:G,project:F,tags:I,activity:ae,dateRange:Xl(ge)},{workspace:e,search:O})),[ae,Ke,O,se,H,ne,G,F,I,ge,e]),xo=f.useMemo(()=>uc(jt,ve,he),[jt,ve,he]),Li=f.useMemo(()=>{if(Ne==="none")return[{id:"__all__",label:"All assignments",items:jt}];if(Ne==="type"){const _=m.definitions.map($e=>({id:$e.id,label:ii(m,$e.id),items:jt.filter(ct=>ct.type===$e.id)})),le=new Set(m.definitions.map($e=>$e.id)),xe=jt.filter($e=>!$e.type||!le.has($e.type));return xe.length>0&&_.push({id:N,label:"Other",items:xe}),_}if(Ne==="priority")return["critical","high","medium","low"].map(le=>({id:le,label:le.charAt(0).toUpperCase()+le.slice(1),items:jt.filter(xe=>xe.priority===le)}));if(Ne==="assignee")return Array.from(new Set(jt.map(le=>le.assignee??"__unassigned__"))).sort().map(le=>({id:le,label:le==="__unassigned__"?"Unassigned":le,items:jt.filter(xe=>(xe.assignee??"__unassigned__")===le)}));if(Ne==="project"){const _=new Map;for(const le of jt){const xe=le.projectSlug??"__standalone__",$e=le.projectTitle??"Standalone";_.has(xe)||_.set(xe,$e)}return Array.from(_.entries()).sort(([,le],[,xe])=>le.localeCompare(xe)).map(([le,xe])=>({id:le,label:xe,items:jt.filter($e=>($e.projectSlug??"__standalone__")===le)}))}return j.map(_=>({id:_,label:w[_]??_,items:jt.filter(le=>le.status===_)}))},[Ne,jt,m,j,w]),Ef=f.useMemo(()=>{const _=new Set(m.definitions.map(xe=>xe.id));return jt.some(xe=>!xe.type||!_.has(xe.type))?[...C,{id:N,title:"Other",description:"Assignments with no recognized type."}]:C},[C,m,jt]),{visibleItems:fa,visibleIndexByKey:yo}=f.useMemo(()=>{let _;if(L==="table")_=xo;else if(L==="kanban"){const xe=new Set(m.definitions.map($e=>$e.id));Xe==="type"?_=[...m.definitions.flatMap($e=>jt.filter(ct=>ct.type===$e.id)),...jt.filter($e=>!$e.type||!xe.has($e.type))]:_=j.flatMap($e=>jt.filter(ct=>ct.status===$e))}else _=Li.flatMap(xe=>xe.items);const le=new Map;return _.forEach((xe,$e)=>le.set(tn(xe),$e)),{visibleItems:_,visibleIndexByKey:le}},[L,xo,Li,Xe,m,jt,j]),{hotkeyRowProps:ys}=ac(fa,{scope:"list:assignments",onOpen:_=>{if(_.projectSlug===null){n(`/assignments/${_.id}`);return}const le=_.projectWorkspace?`/w/${_.projectWorkspace}`:t;n(`${le}/projects/${_.projectSlug}/assignments/${_.slug}`)}});if(Ht({keys:"/",scope:"list:assignments",description:"Focus filter",handler:()=>{var _;return(_=s.current)==null?void 0:_.focus()}}),Ht({keys:"r",scope:"list:assignments",description:"Refresh",handler:()=>u()}),l)return r.jsx(mt,{label:"Loading assignments board…"});if(c||!a)return r.jsx(wt,{error:c||"Assignments board is unavailable."});async function bo({item:_,toColumnId:le,action:xe,reason:$e}){pe(tn(_));const ct=Ke;gt(pt=>pt.map(yt=>tn(yt)===tn(_)?{...yt,status:le,blockedReason:le==="blocked"?$e??yt.blockedReason:null}:yt));try{if(_.projectSlug===null){if(!xe)throw new Error("Standalone assignments require a transition action, not status override.");const yt=await fetch(`/api/assignments/${encodeURIComponent(_.id)}/transitions/${encodeURIComponent(xe.command)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($e?{reason:$e}:{})});if(!yt.ok)throw new Error((await yt.json()).error??`HTTP ${yt.status}`);const on=(await yt.json()).assignment;gt(kn=>kn.map(Un=>tn(Un)===tn(_)?{...Un,status:on.status,blockedReason:on.blockedReason,availableTransitions:on.availableTransitions,updated:on.updated}:Un));return}const pt=xe?await jN(_.projectSlug,_.slug,xe,$e):await kN(_.projectSlug,_.slug,le);return gt(yt=>yt.map(cn=>tn(cn)===tn(_)?{...cn,status:pt.status,blockedReason:pt.blockedReason,availableTransitions:pt.availableTransitions,updated:pt.updated}:cn)),u(),!0}catch(pt){return gt(ct),at(pt.message,"error"),!1}finally{pe(null)}}async function vo({item:_,toColumnId:le,action:xe}){if(_.status===le)return;const $e=xe??kl(_,le);if($e!=null&&$e.disabled){at($e.disabledReason||`Cannot move this assignment to ${le}.`,"error");return}if($e&&SN($e)){be({item:_,toColumnId:le,action:$e});return}await bo({item:_,toColumnId:le,action:$e})}async function Oi(_,le){if(le===_.title)return;const xe=tn(_),$e=Ke;gt(ct=>ct.map(pt=>tn(pt)===xe?{...pt,title:le}:pt)),pe(xe);try{const ct=_.projectSlug===null?await fF({id:_.id,title:le}):await dF({projectSlug:_.projectSlug,assignmentSlug:_.slug,title:le});gt(pt=>pt.map(yt=>tn(yt)===xe?{...yt,title:ct.title,updated:ct.updated}:yt)),u()}catch(ct){throw gt($e),at(ct.message,"error"),ct}finally{pe(null)}}function Ii(_){nt(le=>{const xe=new Set(le);return xe.has(_)?xe.delete(_):xe.add(_),xe})}function bc(_){ve===_?go(he==="asc"?"desc":"asc"):(ca(_),go("asc"))}const Ln=Q?Ke.find(_=>tn(_)===Q)??null:null;function wo(_,le){_.dataTransfer.effectAllowed="move",_.dataTransfer.setData("text/plain",le),ye(le)}function Mi(){ye(null),lt(null)}function _i(_,le){if(!Ln)return;const xe=kl(Ln,le);Ln.status===le||xe!=null&&xe.disabled||(_.preventDefault(),_.dataTransfer.dropEffect="move",lt(le))}function Et(_,le){Pe===le&&!_.currentTarget.contains(_.relatedTarget)&<(null)}function vc(_,le){if(_.preventDefault(),!Ln||Ln.status===le){Mi();return}Mi(),vo({item:Ln,toColumnId:le})}function es({field:_,children:le}){const xe=ve===_;return r.jsx("th",{className:"pb-3 font-medium",children:r.jsxs("button",{type:"button",onClick:()=>bc(_),className:"inline-flex items-center gap-1 hover:text-foreground",children:[le,xe?he==="asc"?r.jsx(c0,{className:"h-3 w-3"}):r.jsx(br,{className:"h-3 w-3"}):null]})})}return r.jsxs("div",{className:"space-y-5","data-density":b.density,children:[r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs(Ee,{to:`${t}/assignments/new`,className:"inline-flex h-9 items-center gap-2 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(rn,{className:"h-4 w-4"}),"New Assignment"]})}),r.jsxs(qg,{children:[r.jsx(tf,{ref:s,value:O,onChange:W,placeholder:"Search assignments or projects"}),r.jsx(Pn,{ariaLabel:"Status filter",className:"max-w-[180px]",allLabel:"All statuses",options:Nf.map(_=>({value:_,label:w[_]??_})),value:se,onChange:Ai}),r.jsx(Pn,{ariaLabel:"Priority filter",className:"max-w-[180px]",allLabel:"All priorities",options:yc.map(_=>({value:_,label:_[0].toUpperCase()+_.slice(1)})),value:H,onChange:_r}),r.jsx(Pn,{ariaLabel:"Type filter",className:"max-w-[180px]",allLabel:"All types",options:m.definitions.map(_=>({value:_.id,label:ii(m,_.id)})),value:ne,onChange:oa}),r.jsx(Pn,{ariaLabel:"Assignee filter",className:"max-w-[180px]",allLabel:"All assignees",options:[{value:"__unassigned__",label:"Unassigned"},...da.filter(_=>_!=="__unassigned__").map(_=>({value:_,label:_}))],value:G,onChange:aa}),r.jsx(Pn,{ariaLabel:"Project filter",className:"max-w-[180px]",allLabel:"All projects",options:[{value:"__standalone__",label:"Standalone"},...vr.map(([_,le])=>({value:_,label:le}))],value:F,onChange:Di}),r.jsx(Pn,{ariaLabel:"Tags filter",className:"max-w-[180px]",allLabel:"Any tags",options:Cf.map(_=>({value:_,label:_})),value:I,onChange:ia}),r.jsx(jx,{className:"max-w-[200px]",value:ge,onChange:V}),r.jsxs("select",{value:ae,onChange:_=>la(_.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All activity"}),r.jsx("option",{value:"stale",children:"Stale only"}),r.jsx("option",{value:"fresh",children:"Fresh only"})]}),r.jsx("select",{value:L==="kanban"?Xe:Ne,onChange:_=>kf(_.target.value),className:"editor-input max-w-[180px]",title:"Group by",children:OD.map(_=>{const le=L==="kanban"&&_!=="status"&&_!=="type",xe=_==="none"?"No grouping":`Group: ${_.charAt(0).toUpperCase()+_.slice(1)}`;return r.jsx("option",{value:_,disabled:le,children:le?`${xe} (list only)`:xe},_)})}),r.jsx(nf,{value:L,onChange:_=>jf(_),options:[{value:"table",label:"Table"},{value:"list",label:"List"},{value:"kanban",label:"Kanban"}]}),L==="table"?r.jsx(aN,{visibility:J,onChange:Ie}):null,r.jsx(mN,{scope:Gn,loadedViewId:Fe,onApply:Sf,onOpenSaveDialog:()=>{Wt(!1),Yt(!0)}}),r.jsx("button",{type:"button",onClick:()=>{Ae?xc():(Wt(!1),Yt(!0))},className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:Ae?`Update ${Ae.name}`:"Save current view",children:Ae?`Update '${Ae.name}'`:"Save view"}),Ae?r.jsx("button",{type:"button",onClick:()=>{Wt(!0),Yt(!0)},className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:"Save as new view",children:"Save as new…"}):null]}),a.assignments.length===0?r.jsx(St,{title:"No assignments yet",description:"Assignments appear here once projects contain concrete work items.",actions:r.jsxs(Ee,{className:"shell-action shell-action--cta",to:`${t}/projects`,children:[r.jsx(eg,{className:"h-4 w-4"}),r.jsx("span",{children:"Browse Projects"})]})}):jt.length===0?r.jsx(St,{title:"No assignments match these filters",description:"Adjust the search term or filters to show assignments across all projects again."}):L==="table"?(()=>{const _=new Set(J.hidden),le=xe=>xe==="title"||!_.has(xe);return r.jsx(We,{title:`${xo.length} assignment${xo.length===1?"":"s"}`,children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[le("title")?r.jsx(es,{field:"title",children:"Assignment"}):null,le("status")?r.jsx(es,{field:"status",children:"Status"}):null,r.jsx("th",{className:"py-2 pr-4 text-xs font-medium uppercase tracking-wider",children:"Type"}),le("priority")?r.jsx(es,{field:"priority",children:"Priority"}):null,le("assignee")?r.jsx(es,{field:"assignee",children:"Assignee"}):null,le("dependencies")?r.jsx(es,{field:"dependencies",children:"Dependencies"}):null,le("created")?r.jsx(es,{field:"created",children:"Created"}):null,le("updated")?r.jsx(es,{field:"updated",children:"Updated"}):null]})}),r.jsx("tbody",{children:xo.map((xe,$e)=>r.jsxs(UF,{detailHref:Kl(xe),className:"cursor-pointer border-b border-border/50 transition hover:bg-muted/40 last:border-0",...ys($e),children:[le("title")?r.jsxs("td",{className:"py-4 pr-4",children:[r.jsx(FN,{title:xe.title,detailHref:Kl(xe),onSave:ct=>Oi(xe,ct),disabled:Y===tn(xe)}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:xe.projectTitle??r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"})}),r.jsxs("p",{className:"mt-0.5 inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:xe.id,children:[xe.id.slice(0,8),r.jsx($r,{value:xe.id})]})]}):null,le("status")?r.jsx("td",{className:"py-4 pr-4",children:r.jsx("select",{value:xe.status,disabled:Y===tn(xe),onChange:ct=>vo({item:xe,toColumnId:ct.target.value}),className:Se("appearance-none rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-wide outline-none","cursor-pointer bg-[length:12px] bg-[right_6px_center] bg-no-repeat pr-6",`bg-[url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E")]`,(md[xe.status]??md.pending).className,Y===tn(xe)&&"animate-pulse opacity-60"),children:j.map(ct=>{const pt=xe.status===ct?void 0:kl(xe,ct),yt=(pt==null?void 0:pt.disabled)??!1;return r.jsx("option",{value:ct,disabled:yt,title:yt?(pt==null?void 0:pt.disabledReason)??void 0:void 0,children:w[ct]},ct)})})}):null,r.jsx("td",{className:"py-4 pr-4",children:r.jsx(ea,{type:xe.type,compact:!0})}),le("priority")?r.jsx("td",{className:"py-4 pr-4 capitalize text-muted-foreground",children:xe.priority}):null,le("assignee")?r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:xe.assignee??"Unassigned"}):null,le("dependencies")?r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:xe.dependsOn.length}):null,le("created")?r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:Dn(xe.created)}):null,le("updated")?r.jsx("td",{className:"py-4 text-muted-foreground",children:Dn(xe.updated)}):null]},tn(xe)))})]})})})})():L==="list"?r.jsx("div",{className:"space-y-3",children:Li.map(({id:_,label:le,items:xe})=>{var on;if(xe.length===0&&!(Ln&&Ne==="status"))return null;const $e=!Me.has(_),ct=Ne==="status",pt=ct&&Ln?Ln.status!==_&&!((on=kl(Ln,_))!=null&&on.disabled):!1,yt=ct&&Ln?Ln.status!==_&&!pt:!1,cn=ct&&Pe===_;return r.jsxs("div",{className:Se("rounded-lg border border-border/60 bg-card/90 transition",cn&&pt&&"ring-2 ring-ring/30",yt&&"border-dashed opacity-65"),onDragOver:ct?kn=>_i(kn,_):void 0,onDragLeave:ct?kn=>Et(kn,_):void 0,onDrop:ct?kn=>vc(kn,_):void 0,children:[r.jsxs("button",{type:"button",onClick:()=>Ii(_),className:"flex w-full items-center gap-2 px-4 py-3 text-left",children:[r.jsx(br,{className:`h-4 w-4 text-muted-foreground transition-transform ${$e?"":"-rotate-90"}`}),r.jsx("span",{className:"font-semibold text-foreground",children:le}),r.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:xe.length})]}),$e&&xe.length>0&&r.jsx("div",{className:"space-y-3 px-4 pb-4",children:xe.map(kn=>{const Un=tn(kn),Fr=Q===Un,wc=yo.get(Un)??-1,jo=ct;return r.jsx("div",{draggable:jo,onDragStart:jo?wr=>wo(wr,Un):void 0,onDragEnd:jo?Mi:void 0,...wc>=0?ys(wc):{},className:Se("transition",jo&&"cursor-grab active:cursor-grabbing",Fr&&"scale-[0.98] opacity-50"),children:r.jsx(dj,{assignment:kn,dragging:Fr,transitioning:Y===Un,onPillSelect:wr=>void vo({item:kn,toColumnId:wr.targetStatus,action:wr}),onRenameTitle:wr=>Oi(kn,wr)})},Un)})})]},_)})}):r.jsx(Qd,{columns:Xe==="type"?Ef:k,items:jt,getItemId:tn,getColumnId:_=>Xe==="type"?_.type&&m.definitions.some(le=>le.id===_.type)?_.type:N:_.status,canDrop:({item:_,fromColumnId:le,toColumnId:xe})=>{if(le===xe)return{allowed:!0};const $e=kl(_,xe);return $e!=null&&$e.disabled?{allowed:!1,reason:$e.disabledReason||$e.description}:{allowed:!0,reason:$e?$e.warning||$e.description:`Move to ${xe} (direct status change).`}},onMove:Xe==="type"?void 0:({item:_,toColumnId:le})=>vo({item:_,toColumnId:le}),dragDisabled:Xe==="type",getExternalDragData:_=>_.projectSlug===null?{type:"standalone-assignment",id:_.id}:{type:"project-assignment",id:_.id},onCardContextMenu:(_,le)=>{le.preventDefault(),it({item:_,anchor:{x:le.clientX,y:le.clientY}})},emptyMessage:_=>`No ${_.title.toLowerCase()} assignments.`,hiddenColumnIds:Ye.hidden,onHideColumn:_=>ot(le=>({hidden:le.hidden.includes(_)?le.hidden.filter($e=>$e!==_):[...le.hidden,_]})),renderCard:(_,{dragging:le})=>{const xe=yo.get(tn(_))??-1;return r.jsx("div",{...xe>=0?ys(xe):{},children:r.jsx(dj,{assignment:_,dragging:le,transitioning:Y===tn(_),onPillSelect:$e=>void vo({item:_,toColumnId:$e.targetStatus,action:$e}),onRenameTitle:$e=>Oi(_,$e)})})}}),r.jsx(na,{toast:Rt,onDismiss:ie}),r.jsx(pN,{open:$n,onOpenChange:_=>{Yt(_),_||Wt(!1)},initialName:sn&&Ae?`${Ae.name} (copy)`:"",title:sn?"Save as new view":"Save view",onSubmit:$i}),r.jsx(RN,{open:te!==null,action:(te==null?void 0:te.action)??null,assignmentTitle:(te==null?void 0:te.item.title)??"Assignment",loading:Y===(te?tn(te.item):null),onOpenChange:_=>{_||be(null)},onConfirm:async _=>{if(!te)return;const le=te;await bo({item:le.item,toColumnId:le.toColumnId,action:le.action,reason:_})&&be(null)}}),r.jsx(Y1,{anchor:(Le==null?void 0:Le.anchor)??null,items:Le?BF(Le.item,{onEdit:()=>{const _=Le.item,le=_.projectSlug===null?`/assignments/${_.id}`:`${_.projectWorkspace?`/w/${_.projectWorkspace}`:t}/projects/${_.projectSlug}/assignments/${_.slug}`;n(le)},onDelete:()=>bt(Le.item),onMove:()=>Be(Le.item)}):[],onClose:()=>it(null)}),r.jsx(sa,{open:_e!==null,title:"Delete assignment?",description:_e?`"${_e.title}" will be permanently removed. This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,loading:_t!==null,onOpenChange:_=>{!_&&_t===null&&bt(null)},onConfirm:async()=>{if(!_e||_e.projectSlug===null){bt(null);return}const _=tn(_e);Gt(_);try{const le=await fetch(`/api/projects/${encodeURIComponent(_e.projectSlug)}/assignments/${encodeURIComponent(_e.slug)}`,{method:"DELETE"});if(!le.ok){const xe=await le.json().catch(()=>({}));throw new Error(xe.error||"Failed to delete assignment")}bt(null),u()}catch(le){alert(le instanceof Error?le.message:"Failed to delete assignment")}finally{Gt(null)}}}),r.jsx(Yg,{open:ue!==null,onOpenChange:_=>{_||Be(null)},currentWorkspace:(ue==null?void 0:ue.projectWorkspace)??null,title:"Move assignment to workspace",description:"Standalone assignments belong to a project-workspace via the workspaceGroup frontmatter field.",onSubmit:async _=>{if(!ue)return;const le=await fetch(`/api/assignments/${encodeURIComponent(ue.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:_})});if(!le.ok){const xe=await le.json().catch(()=>({}));throw new Error(xe.error||"Failed to move assignment")}u()}})]})}function BF(e,t){const n=[{key:"edit",label:"Edit",icon:bi,onSelect:t.onEdit}];return e.projectSlug!==null?n.push({key:"delete",label:"Delete",icon:or,destructive:!0,onSelect:t.onDelete}):n.push({key:"move",label:"Move to workspace…",icon:$d,onSelect:t.onMove}),n}function UF({detailHref:e,children:t,className:n,...s}){const a=zN(e);return r.jsx("tr",{...s,ref:a.containerRef,className:n,onMouseDown:a.onMouseDown,onClick:a.onClick,children:t})}function dj({assignment:e,dragging:t,transitioning:n,onPillSelect:s,onRenameTitle:a}){var p;const l=Kl(e),c=!!(s&&a),u=zN(l);return r.jsxs("div",{ref:c?u.containerRef:void 0,className:Se("vp-card rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",c&&"cursor-pointer"),onMouseDown:c?u.onMouseDown:void 0,onClick:c?u.onClick:void 0,children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[c?r.jsx(FN,{title:e.title,detailHref:l,onSave:a,disabled:n}):r.jsx(Ee,{to:l,className:"text-base font-semibold text-foreground hover:text-primary",children:e.title}),r.jsx("p",{className:"text-sm text-muted-foreground",children:e.projectTitle??r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"})}),r.jsxs("p",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:e.id??"",children:[(p=e.id)==null?void 0:p.slice(0,8),e.id&&r.jsx($r,{value:e.id})]})]}),c?r.jsx(_F,{currentStatus:e.status,availableTransitions:e.availableTransitions,onSelect:s,disabled:n}):r.jsx(pn,{status:e.status})]}),e.blockedReason?r.jsx("p",{className:"mt-3 rounded-md border border-warning-foreground/30 bg-warning px-3 py-2 text-sm text-warning-foreground",children:e.blockedReason}):null,r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.jsx(ea,{type:e.type}),r.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs capitalize text-muted-foreground",children:e.priority}),r.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:e.assignee??"Unassigned"}),r.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.dependsOn.length," dependencies"]})]}),r.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3 text-xs uppercase tracking-[0.08em] text-muted-foreground",children:[r.jsx("span",{children:n?"Updating":t?"Dragging":"Source-first"}),r.jsx("span",{children:Dn(e.updated)})]})]})}function kl(e,t){return e.availableTransitions.find(n=>n.targetStatus===t)}function tn(e){return e.id||e.slug||"unknown"}function Mr(e){const t=e.match(/^---\n([\s\S]*?)\n---\n?/);if(!t)return{order:[],blocks:new Map,body:e};const n=t[1],s=e.slice(t[0].length),a=n.split(`
|
|
556
|
-
`),l=[],c=new Map;let u=null,p=[];const m=()=>{u&&(l.push(u),c.set(u,p))};for(const h of a){const g=h.match(/^([A-Za-z_][A-Za-z0-9_-]*):/);if(g&&!h.startsWith(" ")){m(),u=g[1],p=[h];continue}u&&p.push(h)}return m(),{order:l,blocks:c,body:s}}function Ni(e){return`---
|
|
557
|
-
${e.order.map(n=>e.blocks.get(n)).filter(n=>!!n).flat().join(`
|
|
558
|
-
`)}
|
|
559
|
-
---
|
|
560
|
-
|
|
561
|
-
${e.body.replace(/^\n+/,"")}`}function vn(e,t){const n=e.blocks.get(t);if(!(n!=null&&n[0]))return"";const s=n[0].match(/^[^:]+:\s*(.*)$/);if(!s)return"";const a=s[1].trim();return a==="null"?"":a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")?a.slice(1,-1):a}function VF(e,t){return vn(e,t)==="true"}function Ll(e,t){const n=e.blocks.get(t);return n!=null&&n.length?n[0].trim().endsWith("[]")?[]:n.slice(1).map(s=>s.trim()).filter(s=>s.startsWith("- ")).map(s=>s.slice(2).trim()):[]}function HF(e){return typeof e=="boolean"?e?"true":"false":e===null||e===""?"null":/^\d{4}-\d{2}-\d{2}T/.test(e)?`"${e}"`:/[:#{}[\],&*?|>!%@`]/.test(e)||/^\s|\s$/.test(e)?`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:e}function wn(e,t,n){e.blocks.has(t)||e.order.push(t),e.blocks.set(t,[`${t}: ${HF(n)}`])}function Ol(e,t,n){if(e.blocks.has(t)||e.order.push(t),n.length===0){e.blocks.set(t,[`${t}: []`]);return}e.blocks.set(t,[`${t}:`,...n.map(s=>` - ${s}`)])}function Il(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}function uf(e){const t=Mr(e);return{title:vn(t,"title"),slug:vn(t,"slug"),workspace:vn(t,"workspace"),archived:VF(t,"archived"),archivedAt:vn(t,"archivedAt"),archivedReason:vn(t,"archivedReason"),tags:Ll(t,"tags").join(", "),body:t.body}}function WF(e,t){const n=Mr(e),s={...uf(e),...t};return wn(n,"title",s.title),wn(n,"slug",s.slug),wn(n,"workspace",s.workspace||null),wn(n,"archived",s.archived),wn(n,"archivedAt",s.archivedAt||null),wn(n,"archivedReason",s.archivedReason||null),Ol(n,"tags",Il(s.tags)),n.body=s.body,Ni(n)}function df(e){const t=Mr(e);return{title:vn(t,"title"),slug:vn(t,"slug"),status:vn(t,"status"),priority:vn(t,"priority")||"medium",assignee:vn(t,"assignee"),dependsOn:Ll(t,"dependsOn").join(", "),links:Ll(t,"links").join(", "),blockedReason:vn(t,"blockedReason"),tags:Ll(t,"tags").join(", "),body:t.body}}function KF(e,t){const n=Mr(e),s={...df(e),...t};return wn(n,"title",s.title),wn(n,"slug",s.slug),wn(n,"status",s.status),wn(n,"priority",s.priority),wn(n,"assignee",s.assignee||null),Ol(n,"dependsOn",Il(s.dependsOn)),Ol(n,"links",Il(s.links)),wn(n,"blockedReason",s.blockedReason||null),Ol(n,"tags",Il(s.tags)),n.body=s.body,Ni(n)}function ff(e){const t=Mr(e);return{assignment:vn(t,"assignment"),status:vn(t,"status"),body:t.body}}function qF(e,t){const n=Mr(e),s={...ff(e),...t};return wn(n,"assignment",s.assignment),wn(n,"status",s.status),n.body=s.body,Ni(n)}function pf(e){const t=Mr(e);return{assignment:vn(t,"assignment"),body:t.body}}function GF(e,t){const n=Mr(e),s={...pf(e),...t};return wn(n,"assignment",s.assignment),n.body=s.body,Ni(n)}function mf(e){const t=Mr(e);return{name:vn(t,"name"),slug:vn(t,"slug"),description:vn(t,"description"),whenToUse:vn(t,"when_to_use"),tags:Ll(t,"tags").join(", "),body:t.body}}function YF(e,t){const n=Mr(e),s={...mf(e),...t};return wn(n,"name",s.name),wn(n,"slug",s.slug),wn(n,"description",s.description||null),wn(n,"when_to_use",s.whenToUse||null),Ol(n,"tags",Il(s.tags)),n.body=s.body,Ni(n)}function Tx(e){return{body:Mr(e).body}}function BN(e){return Tx(e)}function UN(e,t){const n=Mr(e);return t.body!==void 0&&(n.body=t.body),Ni(n)}function JF(e,t){return UN(e,t)}function Vt(e,t,n){switch(e){case"project":return WF(t,n);case"assignment":return KF(t,n);case"plan":return qF(t,n);case"scratchpad":return GF(t,n);case"playbook":return YF(t,n);case"memory":return UN(t,n);case"resource":return JF(t,n);default:return t}}function Ci({initialContent:e,documentType:t,mode:n="edit",onSave:s,saving:a,error:l,title:c,description:u,onCancel:p,helpTitle:m,helpBody:h,allowSlugEdit:g=!1}){const[y,b]=f.useState(e),[E,j]=f.useState(!1),[w,k]=f.useState("edit");f.useEffect(()=>{b(e)},[e]);const C=e6(t,y),N=y!==e,T=ZF(t,y),D=N?"Unsaved changes":n==="create"?"Draft":"Saved",R=t!=="memory"&&t!=="resource";return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"rounded-lg border border-border/70 bg-card/90 p-3 shadow-sm",children:[r.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:c}),r.jsx("span",{className:"rounded-full border border-border/70 bg-background/80 px-2.5 py-1 text-xs font-medium text-muted-foreground",children:D})]}),u?r.jsx("p",{className:"max-w-3xl text-sm leading-6 text-muted-foreground",children:u}):null]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("button",{type:"button",onClick:p,className:"shell-action",children:[r.jsx(td,{className:"h-4 w-4"}),r.jsx("span",{children:"Back"})]}),R?r.jsxs("button",{type:"button",onClick:()=>j($=>!$),className:"shell-action",children:[r.jsx(cR,{className:"h-4 w-4"}),r.jsx("span",{children:E?"Structured":"Raw Markdown"})]}):null,r.jsxs("button",{type:"button",onClick:()=>s(y),disabled:a||C.length>0,className:"inline-flex items-center gap-2 rounded-md bg-foreground px-4 py-2 text-sm font-semibold text-background transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:[r.jsx(Id,{className:"h-4 w-4"}),r.jsx("span",{children:a?"Saving…":"Save"})]})]})]}),l?r.jsx("p",{className:"mt-4 rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:l}):null,C.length>0?r.jsx("div",{className:"mt-4 rounded-md border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:r.jsx("ul",{className:"space-y-1",children:C.map($=>r.jsx("li",{children:$},$))})}):null]}),r.jsxs("div",{className:"flex items-center gap-2 md:hidden",children:[r.jsx("button",{type:"button",onClick:()=>k("edit"),className:`shell-action ${w==="edit"?"shell-action--cta":""}`,children:"Edit"}),r.jsxs("button",{type:"button",onClick:()=>k("preview"),className:`shell-action ${w==="preview"?"shell-action--cta":""}`,children:[r.jsx(hv,{className:"h-4 w-4"}),"Preview"]})]}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-[minmax(0,1.2fr)_minmax(320px,0.8fr)]",children:[r.jsx("div",{className:w==="preview"?"hidden md:block":"",children:r.jsx("div",{className:"surface-panel space-y-3",children:E?r.jsx("textarea",{value:y,onChange:$=>b($.target.value),className:"min-h-[720px] w-full rounded-md border border-border/70 bg-background/90 p-4 font-mono text-sm text-foreground outline-none transition focus:border-primary focus:ring-2 focus:ring-ring/30",spellCheck:!1}):r.jsx(XF,{documentType:t,content:y,onChange:b,allowSlugEdit:g})})}),r.jsx("div",{className:w==="edit"?"hidden md:block":"",children:r.jsxs("div",{className:"surface-panel sticky top-16 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(hv,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Preview"})]}),r.jsx(fn,{content:T,emptyState:"Write markdown body content to preview it here."})]})})]})]})}function XF({documentType:e,content:t,onChange:n,allowSlugEdit:s}){if(e==="project"){const l=uf(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(Sl,{children:[r.jsx(At,{label:"Project title",children:r.jsx("input",{value:l.title,onChange:c=>{const u=c.target.value,p={title:u};s&&(l.slug===mr(l.title)||!l.slug.trim())&&(p.slug=mr(u)),n(Vt(e,t,p))},className:"editor-input"})}),r.jsx(At,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(Vt(e,t,{slug:mr(c.target.value)})),className:`editor-input ${s?"":"editor-input-disabled"}`}),r.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:s?"The slug becomes the folder name and URL. It is auto-generated from the title until you change it, and it cannot be renamed after creation.":"The slug is the folder name and URL-safe identifier. It is locked after creation so links and file paths stay stable."})]})}),r.jsx(At,{label:"Tags",children:r.jsx("input",{value:l.tags,onChange:c=>n(Vt(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),r.jsx(QF,{value:l.workspace,onChange:c=>n(Vt(e,t,{workspace:c}))})]}),r.jsx(At,{label:"Project body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Vt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="assignment"){const l=df(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(Sl,{children:[r.jsx(At,{label:"Assignment title",children:r.jsx("input",{value:l.title,onChange:c=>{const u=c.target.value,p={title:u};s&&(l.slug===mr(l.title)||!l.slug.trim())&&(p.slug=mr(u)),n(Vt(e,t,p))},className:"editor-input"})}),r.jsx(At,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(Vt(e,t,{slug:mr(c.target.value)})),className:`editor-input ${s?"":"editor-input-disabled"}`}),r.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:s?"The slug becomes the assignment folder name and URL. It is auto-generated from the title until you change it, and it cannot be renamed after creation.":"The slug is locked after creation because assignment paths and dependency references use it as a stable identifier."})]})}),r.jsx(At,{label:"Status",children:r.jsxs("select",{value:l.status,onChange:c=>n(Vt(e,t,{status:c.target.value})),className:"editor-input",children:[r.jsx("option",{value:"pending",children:"Pending"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"blocked",children:"Blocked"}),r.jsx("option",{value:"review",children:"Review"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"failed",children:"Failed"})]})}),r.jsx(At,{label:"Priority",children:r.jsxs("select",{value:l.priority,onChange:c=>n(Vt(e,t,{priority:c.target.value})),className:"editor-input",children:[r.jsx("option",{value:"low",children:"Low"}),r.jsx("option",{value:"medium",children:"Medium"}),r.jsx("option",{value:"high",children:"High"}),r.jsx("option",{value:"critical",children:"Critical"})]})}),r.jsx(At,{label:"Assignee",children:r.jsx("input",{value:l.assignee,onChange:c=>n(Vt(e,t,{assignee:c.target.value})),placeholder:"Agent name",className:"editor-input"})}),r.jsx(At,{label:"Depends on",className:"md:col-span-2",children:r.jsx("input",{value:l.dependsOn,onChange:c=>n(Vt(e,t,{dependsOn:c.target.value})),placeholder:"Comma-separated assignment slugs",className:"editor-input"})}),r.jsx(At,{label:"Links",className:"md:col-span-2",children:r.jsx("input",{value:l.links,onChange:c=>n(Vt(e,t,{links:c.target.value})),placeholder:"Comma-separated: projectSlug/assignmentSlug",className:"editor-input"})}),r.jsx(At,{label:"Blocked reason",className:"md:col-span-2",children:r.jsx("input",{value:l.blockedReason,onChange:c=>n(Vt(e,t,{blockedReason:c.target.value})),placeholder:"Read-only unless the assignment is actually blocked",className:"editor-input"})}),r.jsx(At,{label:"Tags",className:"md:col-span-2",children:r.jsx("input",{value:l.tags,onChange:c=>n(Vt(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})})]}),r.jsx(At,{label:"Assignment body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Vt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="plan"){const l=ff(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(Sl,{children:[r.jsx(At,{label:"Assignment",children:r.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})}),r.jsx(At,{label:"Plan status",children:r.jsxs("select",{value:l.status,onChange:c=>n(Vt(e,t,{status:c.target.value})),className:"editor-input",children:[r.jsx("option",{value:"draft",children:"Draft"}),r.jsx("option",{value:"approved",children:"Approved"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"completed",children:"Completed"})]})})]}),r.jsx(At,{label:"Plan body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Vt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="scratchpad"){const l=pf(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsx(Sl,{children:r.jsx(At,{label:"Assignment",children:r.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})})}),r.jsx(At,{label:"Scratchpad body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Vt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="memory"||e==="resource"){const l=e==="memory"?Tx(t):BN(t),c=e==="memory"?"Memory body":"Resource body";return r.jsxs("div",{className:"space-y-3",children:[r.jsx(At,{label:c,children:r.jsx("textarea",{value:l.body,onChange:u=>n(Vt(e,t,{body:u.target.value})),className:"editor-textarea",spellCheck:!1})}),r.jsx("p",{className:"text-xs text-muted-foreground/80",children:"Frontmatter (name, scope/category, source, related assignments, tags) is preserved server-side on save."})]})}const a=mf(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(Sl,{children:[r.jsx(At,{label:"Playbook name",children:r.jsx("input",{value:a.name,onChange:l=>{const c=l.target.value,u={name:c};s&&(a.slug===mr(a.name)||!a.slug.trim())&&(u.slug=mr(c)),n(Vt(e,t,u))},className:"editor-input"})}),r.jsx(At,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:a.slug,disabled:!s,onChange:l=>n(Vt(e,t,{slug:mr(l.target.value)})),className:`editor-input ${s?"":"editor-input-disabled"}`}),r.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:s?"The slug becomes the filename. It is auto-generated from the name until you change it.":"The slug is locked after creation because it is the filename."})]})}),r.jsx(At,{label:"Description",className:"md:col-span-2",children:r.jsx("input",{value:a.description,onChange:l=>n(Vt(e,t,{description:l.target.value})),placeholder:"One-line description of what this playbook does",className:"editor-input"})}),r.jsx(At,{label:"Tags",className:"md:col-span-2",children:r.jsx("input",{value:a.tags,onChange:l=>n(Vt(e,t,{tags:l.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),r.jsx(At,{label:"When to use",className:"md:col-span-2",children:r.jsx("input",{value:a.whenToUse,onChange:l=>n(Vt(e,t,{whenToUse:l.target.value})),placeholder:"Describe when agents should apply this playbook",className:"editor-input"})})]}),r.jsx(At,{label:"Playbook rules",children:r.jsx("textarea",{value:a.body,onChange:l=>n(Vt(e,t,{body:l.target.value})),className:"editor-textarea",spellCheck:!1})})]})}function Sl({children:e}){return r.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e})}function At({label:e,children:t,className:n}){return r.jsxs("label",{className:`block space-y-2 ${n??""}`,children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:e}),t]})}function QF({value:e,onChange:t}){const{data:n}=oc(),s=(n==null?void 0:n.workspaces)??[];return r.jsx(At,{label:"Workspace",children:r.jsxs("select",{value:e,onChange:a=>t(a.target.value),className:"editor-input",children:[r.jsx("option",{value:"",children:"Ungrouped"}),s.map(a=>r.jsx("option",{value:a,children:a},a))]})})}function ZF(e,t){switch(e){case"project":return uf(t).body;case"assignment":return df(t).body;case"plan":return ff(t).body;case"scratchpad":return pf(t).body;case"playbook":return mf(t).body;case"memory":return Tx(t).body;case"resource":return BN(t).body}}function e6(e,t){switch(e){case"project":{const n=uf(t);return[n.title.trim()?null:"Project title is required.",n.slug.trim()?null:"Project slug is required.",n.slug.trim()&&!Hu(n.slug)?"Project slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"assignment":{const n=df(t);return[n.title.trim()?null:"Assignment title is required.",n.slug.trim()?null:"Assignment slug is required.",n.slug.trim()&&!Hu(n.slug)?"Assignment slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"plan":return ff(t).assignment.trim()?[]:["Plan assignment is required."];case"scratchpad":return pf(t).assignment.trim()?[]:["Scratchpad assignment is required."];case"playbook":{const n=mf(t);return[n.name.trim()?null:"Playbook name is required.",n.slug.trim()?null:"Playbook slug is required.",n.slug.trim()&&!Hu(n.slug)?"Playbook slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"memory":case"resource":return[]}}function fj(){const e=Dt(),{workspace:t}=$t(),n=ln(),[s,a]=f.useState(null),[l,c]=f.useState(!0),[u,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{fetch("/api/templates/project").then(y=>y.json()).then(y=>{let b=y.content;t&&t!=="_ungrouped"&&(b=b.replace(/^(tags: \[\])$/m,`$1
|
|
562
|
-
workspace: ${t}`)),a(b),c(!1)}).catch(y=>{h(y.message),c(!1)})},[t]);async function g(y){p(!0),h(null);try{const b=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),E=await b.json();if(!b.ok){h(E.error||`HTTP ${b.status}`),p(!1);return}e(`${n}/projects/${E.slug}`)}catch(b){h(b.message),p(!1);return}p(!1)}return l?r.jsx(mt,{label:"Loading project template…"}):m&&!s?r.jsx(wt,{error:m}):r.jsx(Ci,{initialContent:s||"",documentType:"project",mode:"create",onSave:g,saving:u,error:m,title:"Create Project",description:"Projects hold the high-level objective, shared context, and human-authored overview. Put execution details in assignments instead of overloading project.md.",onCancel:()=>e(`${n}/projects`),helpTitle:"Project editing rules",helpBody:"Use this form for project intent, slug, tags, and overview content. If you ever need less common metadata, raw markdown mode still exposes the full file.",allowSlugEdit:!0})}function pj(){const{slug:e}=$t(),t=ln(),n=Dt(),[s,a]=f.useState(null),[l,c]=f.useState(!0),[u,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{fetch("/api/templates/assignment").then(y=>y.json()).then(y=>{a(y.content),c(!1)}).catch(y=>{h(y.message),c(!1)})},[]);async function g(y){if(!e){h("Project slug is required.");return}p(!0),h(null);try{const b=await fetch(`/api/projects/${e}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),E=await b.json();if(!b.ok){h(E.error||`HTTP ${b.status}`),p(!1);return}n(`${t}/projects/${e}/assignments/${E.slug}`)}catch(b){h(b.message),p(!1);return}p(!1)}return l?r.jsx(mt,{label:"Loading assignment template…"}):m&&!s?r.jsx(wt,{error:m}):r.jsx(Ci,{initialContent:s||"",documentType:"assignment",mode:"create",onSave:g,saving:u,error:m,title:"Create Assignment",description:"Assignments are the execution unit. Declare dependencies here, keep status pending until work starts, and use blocked later only for runtime obstacles.",onCancel:()=>n(e?`${t}/projects/${e}`:`${t}/projects`),helpTitle:"Assignment editing rules",helpBody:"Use structured fields for priority, assignee, dependencies, and tags. Status can be changed through lifecycle actions, kanban drag, or the status override.",allowSlugEdit:!0})}function mj(){const{workspace:e}=$t(),t=ln(),n=Dt(),[s,a]=f.useState(null),[l,c]=f.useState(!0),[u,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{const y=new URLSearchParams({standalone:"1"});e&&y.set("workspace",e),fetch(`/api/templates/assignment?${y.toString()}`).then(b=>b.json()).then(b=>{a(b.content),c(!1)}).catch(b=>{h(b.message),c(!1)})},[e]);async function g(y){var b;p(!0),h(null);try{const E=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),j=await E.json();if(!E.ok){h(j.error||`HTTP ${E.status}`),p(!1);return}const w=(b=j==null?void 0:j.assignment)==null?void 0:b.id;if(!w){h("Server did not return the new assignment id."),p(!1);return}n(`/assignments/${w}`)}catch(E){h(E.message),p(!1);return}p(!1)}return l?r.jsx(mt,{label:"Loading assignment template…"}):m&&!s?r.jsx(wt,{error:m}):r.jsx(Ci,{initialContent:s||"",documentType:"assignment",mode:"create",onSave:g,saving:u,error:m,title:"Create Standalone Assignment",description:e?`Standalone assignments live outside any project. This one will be tagged with workspaceGroup: ${e} so it appears in this workspace's views.`:"Standalone assignments live outside any project. Add a workspaceGroup to make them appear in workspace-filtered views.",onCancel:()=>n(`${t}/assignments`),helpTitle:"Standalone assignment editing rules",helpBody:"No project field is needed (it must remain null). Use workspaceGroup to group with other workspace work. Status, priority, and tags work the same as project-nested assignments.",allowSlugEdit:!0})}function Ei({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:a,documentType:l,helpTitle:c,helpBody:u}){const p=Dt(),{data:m,loading:h,error:g}=z0(e),[y,b]=f.useState(!1),[E,j]=f.useState(null);async function w(k){b(!0),j(null);try{const C=await fetch(t,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:k})}),N=await C.json();if(!C.ok){j(N.error||`HTTP ${C.status}`),b(!1);return}p(n)}catch(C){j(C.message),b(!1);return}b(!1)}return h?r.jsx(mt,{label:`Loading ${s.toLowerCase()}…`}):g||!m?r.jsx(wt,{error:g||`${s} is unavailable.`}):r.jsx(Ci,{initialContent:m.content,documentType:l,onSave:w,saving:y,error:E,title:s,description:a,onCancel:()=>p(n),helpTitle:c,helpBody:u})}function hj(){const{slug:e}=$t(),t=ln(),n=e??"";return r.jsx(Ei,{loadUrl:`/api/projects/${n}/edit`,saveUrl:`/api/projects/${n}`,redirectTo:`${t}/projects/${n}`,title:"Edit Project",description:"Project edits change the human-authored source document. The structured form stays focused on title, slug, tags, and overview content.",documentType:"project",helpTitle:"Editable vs derived project fields",helpBody:"Project status remains derived from assignment state. If you need less common frontmatter fields, switch to raw markdown mode instead of expanding the structured form."})}function Ym(){const{slug:e,aslug:t,id:n}=$t(),s=ln(),a=!!n,l=a?`/api/assignments/${n}/edit`:`/api/projects/${e}/assignments/${t}/edit`,c=a?`/api/assignments/${n}`:`/api/projects/${e}/assignments/${t}`,u=a?`/assignments/${n}`:`${s}/projects/${e}/assignments/${t}`;return r.jsx(Ei,{loadUrl:l,saveUrl:c,redirectTo:u,title:"Edit Assignment",description:"Edit assignment fields including status, priority, assignee, dependencies, and body.",documentType:"assignment",helpTitle:"Assignment editing",helpBody:"All fields are editable. Status can also be changed through lifecycle actions or kanban drag."})}function Jm(){const{slug:e,aslug:t,id:n}=$t(),s=ln(),a=!!n,l=a?`/api/assignments/${n}/plan/edit`:`/api/projects/${e}/assignments/${t}/plan/edit`,c=a?`/api/assignments/${n}/plan`:`/api/projects/${e}/assignments/${t}/plan`,u=a?`/assignments/${n}?tab=plan`:`${s}/projects/${e}/assignments/${t}?tab=plan`;return r.jsx(Ei,{loadUrl:l,saveUrl:c,redirectTo:u,title:"Edit Plan",description:"Plans are separate from assignment status, so keep implementation steps here instead of overloading the assignment body.",documentType:"plan",helpTitle:"Plan status is separate",helpBody:"Plan status tracks the plan document itself. It does not replace the assignment lifecycle state."})}function Xm(){const{slug:e,aslug:t,id:n}=$t(),s=ln(),a=!!n,l=a?`/api/assignments/${n}/scratchpad/edit`:`/api/projects/${e}/assignments/${t}/scratchpad/edit`,c=a?`/api/assignments/${n}/scratchpad`:`/api/projects/${e}/assignments/${t}/scratchpad`,u=a?`/assignments/${n}?tab=scratchpad`:`${s}/projects/${e}/assignments/${t}?tab=scratchpad`;return r.jsx(Ei,{loadUrl:l,saveUrl:c,redirectTo:u,title:"Edit Scratchpad",description:"Scratchpad is the assignment’s working memory surface for notes, experiments, and temporary context.",documentType:"scratchpad",helpTitle:"Scratchpad usage",helpBody:"Scratchpad is for transient notes. Keep canonical objective and lifecycle data in assignment.md and any active plan files (plan.md, plan-v2.md, ...)."})}function VN({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:a,helpTitle:l,helpBody:c}){const u=Dt(),{data:p,loading:m,error:h}=z0(e),[g,y]=f.useState(""),[b,E]=f.useState(""),[j,w]=f.useState(!1),[k,C]=f.useState(null);async function N(){w(!0),C(null);try{const T=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:g,body:b})}),D=await T.json();if(!T.ok){C(D.error||`HTTP ${T.status}`),w(!1);return}u(n)}catch(T){C(T.message),w(!1);return}w(!1)}return m?r.jsx(mt,{label:`Loading ${s.toLowerCase()}…`}):h||!p?r.jsx(wt,{error:h||`${s} is unavailable.`}):r.jsxs("div",{className:"space-y-4",children:[r.jsx(We,{title:s,description:a,children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("label",{className:"block space-y-2",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:"Entry title"}),r.jsx("input",{value:g,onChange:T=>y(T.target.value),placeholder:"Optional title",className:"editor-input"})]}),r.jsxs("label",{className:"block space-y-2",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:"Entry body"}),r.jsx("textarea",{value:b,onChange:T=>E(T.target.value),className:"editor-textarea",spellCheck:!1})]}),k?r.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:k}):null,r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{type:"button",onClick:()=>u(n),className:"shell-action",children:"Cancel"}),r.jsx("button",{type:"button",onClick:N,disabled:j||!b.trim(),className:"shell-action shell-action--cta disabled:cursor-not-allowed disabled:opacity-50",children:j?"Appending…":"Append Entry"})]})]})}),r.jsx(We,{title:"Current Document",children:r.jsx(fn,{content:p.content.replace(/^---[\s\S]*?---\n?/,""),emptyState:"No existing content."})})]})}function Qm(){const{slug:e,aslug:t,id:n}=$t(),s=ln(),a=!!n,l=a?`/api/assignments/${n}/handoff/edit`:`/api/projects/${e}/assignments/${t}/handoff/edit`,c=a?`/api/assignments/${n}/handoff/entries`:`/api/projects/${e}/assignments/${t}/handoff/entries`,u=a?`/assignments/${n}?tab=handoff`:`${s}/projects/${e}/assignments/${t}?tab=handoff`;return r.jsx(VN,{loadUrl:l,saveUrl:c,redirectTo:u,title:"Append Handoff Entry",description:"Add a new handoff without rewriting previous history.",helpTitle:"Append-only handoff history",helpBody:"Handoff log entries preserve the baton-passing trail between sessions and agents. Add a new entry instead of editing older ones."})}function Zm(){const{slug:e,aslug:t,id:n}=$t(),s=ln(),a=!!n,l=a?`/api/assignments/${n}/decision-record/edit`:`/api/projects/${e}/assignments/${t}/decision-record/edit`,c=a?`/api/assignments/${n}/decision-record/entries`:`/api/projects/${e}/assignments/${t}/decision-record/entries`,u=a?`/assignments/${n}?tab=decisions`:`${s}/projects/${e}/assignments/${t}?tab=decisions`;return r.jsx(VN,{loadUrl:l,saveUrl:c,redirectTo:u,title:"Append Decision Entry",description:"Record a new decision and rationale without editing prior entries.",helpTitle:"Append-only decision history",helpBody:"Decision records should accumulate over time so the implementation rationale remains auditable and reviewable."})}function gj(){const{workspace:e}=$t(),{data:t}=Jo(),{data:n,loading:s,error:a,refetch:l}=dg(),[c,u]=f.useState(!1),[p,m]=f.useState(""),[h,g]=f.useState(!1),y=Wn();f.useEffect(()=>{const C=y.hash.match(/^#server-(.+)/);if(!C)return;const N=decodeURIComponent(C[1]),T=document.querySelector(`[data-server-name="${window.CSS.escape(N)}"]`);if(!T)return;T.scrollIntoView({block:"nearest"}),T.classList.add("ring-2","ring-primary/60");const D=window.setTimeout(()=>T.classList.remove("ring-2","ring-primary/60"),1500);return()=>window.clearTimeout(D)},[y.hash,n]);const b=(()=>{if(!e||!n)return(n==null?void 0:n.sessions)??[];if(!t)return[];const C=new Set(t.filter(N=>e==="_ungrouped"?N.workspace===null:N.workspace===e).map(N=>N.slug));return n.sessions.filter(N=>N.windows.some(T=>T.panes.some(D=>D.assignment&&D.assignment.project!==null&&C.has(D.assignment.project))))})();async function E(C){if(C.preventDefault(),!!p.trim())try{await fetch("/api/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim()})}),m(""),u(!1),l()}catch{}}async function j(){g(!0);try{await fetch("/api/servers/refresh",{method:"POST"}),l()}finally{g(!1)}}async function w(C){await fetch(`/api/servers/${encodeURIComponent(C)}`,{method:"DELETE"}),l()}async function k(C){await fetch(`/api/servers/${encodeURIComponent(C)}/refresh`,{method:"POST"}),l()}return s?r.jsx(mt,{label:"Loading servers…"}):a?r.jsx(wt,{error:a}):n?n.tmuxAvailable?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c?r.jsxs("form",{onSubmit:E,className:"flex items-center gap-2",children:[r.jsx("input",{type:"text",value:p,onChange:C=>m(C.target.value),placeholder:"tmux session name",className:"editor-input text-sm",autoFocus:!0}),r.jsx("button",{type:"submit",className:"shell-action",children:"Add"}),r.jsx("button",{type:"button",className:"shell-action",onClick:()=>u(!1),children:"Cancel"})]}):r.jsxs("button",{className:"shell-action",onClick:()=>u(!0),children:[r.jsx(rn,{className:"h-3.5 w-3.5"}),"Track Session"]}),r.jsxs("button",{className:"shell-action",onClick:j,disabled:h,children:[r.jsx(h0,{className:`h-3.5 w-3.5 ${h?"animate-spin":""}`}),"Refresh All"]})]}),b.length===0?r.jsx(St,{title:"No sessions tracked",description:"Register a tmux session to start tracking your dev servers."}):r.jsx("div",{className:"mt-4 space-y-4",children:b.map(C=>r.jsx(t6,{session:C,onRefresh:()=>k(C.name),onRemove:()=>w(C.name),onRefetch:l},C.name))})]}):r.jsx(r.Fragment,{children:r.jsxs("div",{className:"surface-panel mt-4 flex flex-col items-center gap-3 py-12 text-center",children:[r.jsx(Za,{className:"h-10 w-10 text-muted-foreground/40"}),r.jsx("p",{className:"text-sm font-medium text-foreground",children:"tmux is not installed"}),r.jsxs("p",{className:"max-w-md text-sm text-muted-foreground",children:["Server tracking requires tmux. Install it with ",r.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"brew install tmux"})," to get started."]})]})}):null}function t6({session:e,onRefresh:t,onRemove:n,onRefetch:s}){return r.jsxs("div",{className:"surface-panel","data-server-name":e.name,children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(sg,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("span",{className:"text-sm font-semibold text-foreground",children:e.name}),r.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${e.alive?"border border-success-foreground/30 bg-success text-success-foreground":"border border-error-foreground/30 bg-error text-error-foreground"}`,children:e.alive?"alive":"dead"}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Last refreshed: ",new Date(e.lastRefreshed).toLocaleString()]})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("button",{className:"shell-action",onClick:t,title:"Refresh",children:r.jsx(h0,{className:"h-3.5 w-3.5"})}),r.jsx("button",{className:"shell-action",onClick:n,title:"Remove",children:r.jsx(or,{className:"h-3.5 w-3.5"})})]})]}),e.alive&&e.windows.length>0&&r.jsx("div",{className:"mt-3 space-y-3",children:e.windows.map(a=>r.jsxs("div",{children:[r.jsxs("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:["Window ",a.index,": ",a.name]}),r.jsx("div",{className:"space-y-1.5",children:a.panes.map(l=>r.jsx(n6,{pane:l,sessionName:e.name,windowIndex:a.index,onRefetch:s},`${a.index}:${l.index}`))})]},a.index))}),!e.alive&&r.jsxs("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx(CR,{className:"h-4 w-4"}),r.jsx("span",{children:e.kind==="process"?"Process no longer running":"Session no longer exists"})]})]})}function n6({pane:e,sessionName:t,windowIndex:n,onRefetch:s}){const a=ln(),l=e.cwd.replace(/^\/Users\/[^/]+/,"~");return r.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-2 text-sm",children:[r.jsxs("span",{className:"shrink-0 font-mono text-xs text-muted-foreground/60",children:[":",e.index]}),r.jsx("span",{className:"shrink-0 rounded bg-muted/60 px-1.5 py-0.5 font-mono text-xs",children:e.command}),r.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx("span",{className:"block min-w-0 truncate",title:e.cwd,children:l}),r.jsx($r,{value:e.cwd})]}),e.branch&&r.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-xs text-muted-foreground",children:[r.jsx(tg,{className:"h-3 w-3"}),e.branch,e.worktree&&r.jsx("span",{className:"rounded bg-status-in-progress px-1 py-0.5 text-[10px] font-medium text-status-in-progress-foreground",children:"worktree"})]}),e.ports.length>0&&r.jsx("div",{className:"flex shrink-0 items-center gap-1.5",children:e.urls.map(c=>r.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/5 px-1.5 py-0.5 text-xs font-medium text-primary hover:bg-primary/10 dark:border-primary/40 dark:bg-primary/10 dark:hover:bg-primary/20",children:[c.replace("http://localhost:",":"),r.jsx(yi,{className:"h-2.5 w-2.5"})]},c))}),r.jsx("div",{className:"ml-auto shrink-0",children:e.assignment?r.jsxs(Ee,{to:e.assignment.project===null?`/assignments/${e.assignment.slug}`:`${a}/projects/${e.assignment.project}/assignments/${e.assignment.slug}`,className:"inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary hover:bg-primary/20",children:[r.jsx(gR,{className:"h-2.5 w-2.5"}),e.assignment.title,e.assignment.project===null?r.jsx("span",{className:"ml-1 rounded bg-muted px-1 py-0.5 text-[9px] uppercase tracking-wide text-muted-foreground",children:"Standalone"}):null]}):r.jsx("span",{className:"text-xs text-muted-foreground/40",children:"unlinked"})})]})}function HN(e){return e<60?`${e}s`:e<3600?`${Math.round(e/60)}m`:e<86400?`${Math.round(e/3600)}h`:`${Math.round(e/86400)}d`}function r6(e,t){const n=Date.parse(e),s=Math.floor((n-t)/1e3);return Number.isNaN(s)?"–":s<=0?"expired":HN(s)}function s6(e){switch(e){case"idle":return"bg-green-500/15 text-green-400 border-green-500/30";case"leased":return"bg-amber-500/15 text-amber-400 border-amber-500/30";case"retired":return"bg-zinc-500/15 text-zinc-400 border-zinc-500/30"}}function o6(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function xj(){const{data:e,loading:t,error:n,refetch:s}=B0(),[a,l]=f.useState(()=>Date.now()),[c,u]=f.useState(null),[p,m]=f.useState(!1);if(f.useEffect(()=>{const g=window.setInterval(()=>l(Date.now()),1e3);return()=>window.clearInterval(g)},[]),t)return r.jsx(mt,{label:"Loading inventories…"});if(n)return r.jsx(wt,{title:"Could not load inventories",error:n,action:r.jsx("button",{type:"button",onClick:s,className:"rounded border px-3 py-1 text-sm",children:"Retry"})});if(!e||e.inventories.length===0)return r.jsx(St,{title:"No inventories yet",description:"Create one with `syntaur lease create-inventory <slug> --kind <kind>`, then add members with `syntaur lease member add <slug> <id>`."});async function h(){if(c){m(!0);try{const g=await fetch(`/api/leases/${encodeURIComponent(c.slug)}/force-release/${encodeURIComponent(c.lease.lease_id)}`,{method:"POST"});if(!g.ok){const y=await g.json().catch(()=>null);throw new Error((y==null?void 0:y.error)??`HTTP ${g.status}`)}s(),u(null)}catch(g){window.alert(g instanceof Error?`Force release failed: ${g.message}`:"Force release failed")}finally{m(!1)}}}return r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"flex items-start justify-between",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-semibold",children:"Inventories"}),r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Claimable shared resources (dev envs, test DBs, named locks, …). Global in v1 — the same set appears on every workspace."})]})}),r.jsx("div",{className:"grid gap-4",children:e.inventories.map(g=>r.jsx(a6,{detail:g,now:a,onForceRelease:y=>u({slug:g.inventory.slug,lease:y})},g.inventory.slug))}),r.jsx(sa,{open:c!==null,title:"Force release this lease?",description:c?`This will revoke lease ${c.lease.lease_id} and (if it's still the current holder) free member ${c.lease.member_id}. Any agent still using this lease will see a stale-lease error on its next CLI call.`:"",confirmLabel:"Force release",destructive:!0,loading:p,onConfirm:h,onOpenChange:g=>{g||u(null)}})]})}function a6({detail:e,now:t,onForceRelease:n}){const{inventory:s,members:a,active_leases:l}=e,c=a.filter(p=>p.status==="idle").length,u=a.filter(p=>p.status==="leased").length;return r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsxs("div",{className:"flex items-start justify-between",children:[r.jsxs("div",{children:[r.jsxs("h2",{className:"text-lg font-semibold",children:[r.jsx(Ld,{className:"mr-2 inline h-4 w-4 text-muted-foreground"}),s.display_name??s.slug]}),r.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[r.jsx("code",{className:"font-mono",children:s.slug})," · kind=",s.kind," · default TTL=",HN(s.default_ttl_s)]})]}),r.jsx("div",{className:"text-right text-xs text-muted-foreground",children:r.jsxs("div",{children:[c," idle · ",u," leased · ",a.length," total"]})})]}),r.jsx("div",{className:"mt-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:a.map(p=>r.jsx(i6,{member:p},p.member_id))}),l.length>0&&r.jsxs("div",{className:"mt-4",children:[r.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Active leases"}),r.jsx("div",{className:"mt-2 space-y-2",children:l.map(p=>r.jsx(l6,{lease:p,now:t,onForceRelease:()=>n(p)},p.lease_id))})]})]})}function i6({member:e}){const t=o6(e.metadata_json);return r.jsxs("div",{className:"rounded-md border bg-muted/40 px-3 py-2 text-sm",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"font-mono",children:e.member_id}),r.jsx("span",{className:`rounded border px-1.5 py-0.5 text-xs ${s6(e.status)}`,children:e.status})]}),t&&r.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:Object.entries(t).map(([n,s])=>r.jsxs("div",{className:"truncate",children:[r.jsx("span",{className:"font-mono",children:n}),"=",r.jsx("span",{className:"font-mono",children:String(s)})]},n))})]})}function l6({lease:e,now:t,onForceRelease:n}){return r.jsxs("div",{className:"flex items-center justify-between rounded border bg-muted/20 px-3 py-2 text-sm",children:[r.jsx("div",{className:"min-w-0 flex-1",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[e.lease_id.slice(0,8),"…"]}),r.jsx("span",{className:"font-mono",children:e.member_id}),e.requested_for&&r.jsxs("span",{className:"text-xs text-muted-foreground",children:["for ",e.requested_for]})]})}),r.jsxs("div",{className:"ml-3 flex items-center gap-3",children:[r.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[r.jsx(sR,{className:"h-3 w-3"}),r6(e.expires_at,t)]}),r.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1 rounded border border-destructive/40 px-2 py-1 text-xs text-destructive hover:bg-destructive/10",children:[r.jsx(TR,{className:"h-3 w-3"}),"Force release"]})]})]})}function c6(){return new Date(Date.now()-720*60*60*1e3).toISOString().slice(0,10)}function u6(){return new Date().toISOString().slice(0,10)}function yj(){const[e,t]=f.useState(c6()),[n,s]=f.useState(u6()),[a,l]=f.useState(""),[c,u]=f.useState("project"),[p,m]=f.useState(null),[h,g]=f.useState(!0),[y,b]=f.useState(null),[E,j]=f.useState([]);return f.useEffect(()=>{const w=new AbortController;g(!0),b(null);const k=new URLSearchParams({since:e,until:n,groupBy:c});return a&&k.set("project",a),fetch(`/api/usage?${k.toString()}`,{signal:w.signal}).then(C=>{if(!C.ok)throw new Error(`HTTP ${C.status}`);return C.json()}).then(C=>{if(m(C),!a){const N=new Set;for(const T of C.daily)T.project_slug&&N.add(T.project_slug);j([...N].sort())}g(!1)}).catch(C=>{C instanceof Error&&C.name==="AbortError"||(b(C instanceof Error?C.message:String(C)),g(!1))}),()=>{w.abort()}},[e,n,a,c]),r.jsxs("div",{className:"p-6 max-w-7xl mx-auto",children:[r.jsxs("header",{className:"flex items-center gap-3 mb-6",children:[r.jsx(Od,{className:"w-6 h-6 text-amber-400"}),r.jsx("h1",{className:"text-2xl font-semibold",children:"Token usage"})]}),r.jsxs("div",{className:"flex flex-wrap gap-4 items-end mb-6 p-4 rounded-lg bg-zinc-900/50 border border-zinc-800",children:[r.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[r.jsx("span",{className:"text-zinc-400",children:"Since"}),r.jsx("input",{type:"date",value:e,onChange:w=>t(w.target.value),className:"bg-zinc-950 border border-zinc-700 rounded px-2 py-1 text-sm"})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[r.jsx("span",{className:"text-zinc-400",children:"Until"}),r.jsx("input",{type:"date",value:n,onChange:w=>s(w.target.value),className:"bg-zinc-950 border border-zinc-700 rounded px-2 py-1 text-sm"})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[r.jsx("span",{className:"text-zinc-400",children:"Project"}),r.jsxs("select",{value:a,onChange:w=>l(w.target.value),className:"bg-zinc-950 border border-zinc-700 rounded px-2 py-1 text-sm",children:[r.jsx("option",{value:"",children:"All"}),E.map(w=>r.jsx("option",{value:w,children:w},w))]})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[r.jsx("span",{className:"text-zinc-400",children:"Group by"}),r.jsxs("select",{value:c,onChange:w=>u(w.target.value),className:"bg-zinc-950 border border-zinc-700 rounded px-2 py-1 text-sm",children:[r.jsx("option",{value:"project",children:"Project"}),r.jsx("option",{value:"assignment",children:"Assignment"})]})]})]}),h&&r.jsx("p",{className:"text-zinc-400",children:"Loading…"}),y&&r.jsxs("p",{className:"text-red-400",children:["Error: ",y]}),p&&!h&&!y&&r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"mb-8",children:[r.jsx("h2",{className:"text-lg font-medium mb-2",children:"Summary"}),p.summary.length===0?r.jsxs("p",{className:"text-zinc-500 text-sm",children:["No usage data in this window. Run"," ",r.jsx("code",{className:"bg-zinc-800 px-1 py-0.5 rounded text-amber-300",children:"syntaur usage"})," ","to ingest the latest ccusage data."]}):r.jsxs("table",{className:"w-full text-sm border border-zinc-800 rounded overflow-hidden",children:[r.jsx("thead",{className:"bg-zinc-900 text-zinc-400",children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left px-3 py-2",children:"Project"}),c==="assignment"&&r.jsx("th",{className:"text-left px-3 py-2",children:"Assignment"}),r.jsx("th",{className:"text-right px-3 py-2",children:"Tokens"}),r.jsx("th",{className:"text-right px-3 py-2",children:"Cost"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Last event"})]})}),r.jsx("tbody",{children:p.summary.map((w,k)=>r.jsxs("tr",{className:"border-t border-zinc-800",children:[r.jsx("td",{className:"px-3 py-2",children:w.projectSlug||"(unattributed)"}),c==="assignment"&&r.jsx("td",{className:"px-3 py-2",children:w.assignmentSlug||"(unattributed)"}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:sd(w.totalTokens)}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:od(w.totalCost)}),r.jsx("td",{className:"px-3 py-2 text-zinc-400",children:w.lastEventDay})]},k))})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-lg font-medium mb-2",children:"Daily breakdown"}),p.daily.length===0?r.jsx("p",{className:"text-zinc-500 text-sm",children:"No daily rows."}):r.jsxs("table",{className:"w-full text-sm border border-zinc-800 rounded overflow-hidden",children:[r.jsx("thead",{className:"bg-zinc-900 text-zinc-400",children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left px-3 py-2",children:"Day"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Tool"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Model"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Project"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Assignment"}),r.jsx("th",{className:"text-right px-3 py-2",children:"Tokens"}),r.jsx("th",{className:"text-right px-3 py-2",children:"Cost"})]})}),r.jsx("tbody",{children:p.daily.map((w,k)=>r.jsxs("tr",{className:"border-t border-zinc-800",children:[r.jsx("td",{className:"px-3 py-2 tabular-nums",children:w.day}),r.jsx("td",{className:"px-3 py-2 text-zinc-400",children:w.tool}),r.jsx("td",{className:"px-3 py-2 text-zinc-400",children:w.model}),r.jsx("td",{className:"px-3 py-2",children:w.project_slug||"–"}),r.jsx("td",{className:"px-3 py-2",children:w.assignment_slug||"–"}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:sd(w.total_tokens)}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:od(w.total_cost)})]},k))})]})]})]})]})}function bj(){const{workspace:e}=$t(),{data:t}=Jo(),{data:n,loading:s,error:a}=U0(),[l,c]=f.useState(""),[u,p]=f.useState(""),[m,h]=f.useState(""),[g,y]=f.useState("started_desc"),[b,E]=f.useState(0),[j,w]=f.useState(new Set),[k,C]=f.useState(!1),[N,T]=f.useState(null),[D,R]=f.useState(null),$=(n==null?void 0:n.sessions.some(z=>z.status==="active"))??!1;f.useEffect(()=>{if(!$)return;const z=window.setInterval(()=>E(H=>H+1),3e4);return()=>window.clearInterval(z)},[$]),f.useEffect(()=>{w(z=>{if(z.size===0)return z;const H=new Set((n==null?void 0:n.sessions.map(ne=>ne.sessionId))??[]),ee=new Set([...z].filter(ne=>H.has(ne)));return ee.size===z.size?z:ee})},[n]);const L=f.useMemo(()=>{if(!n)return[];if(e&&!t)return[];const z=l.trim().toLowerCase();return[...n.sessions.filter(ee=>{var G;if(e&&t){const A=((G=t.find(F=>F.slug===ee.projectSlug))==null?void 0:G.workspace)??null;if(e==="_ungrouped"){if(A!==null)return!1}else if(A!==e)return!1}const ne=f6(ee.started);return u&&(!ne||ne<u)||m&&(!ne||ne>m)?!1:z?[ee.projectSlug??"",ee.assignmentSlug??"",ee.agent,ee.sessionId,ee.path,ee.description??"",ee.transcriptPath??""].join(" ").toLowerCase().includes(z):!0})].sort((ee,ne)=>p6(ee,ne,g))},[n,l,g,u,m,b,e,t]);function K(z){w(H=>{const ee=new Set(H);return ee.has(z)?ee.delete(z):ee.add(z),ee})}function B(){j.size===L.length&&L.length>0?w(new Set):w(new Set(L.map(z=>z.sessionId)))}async function O(z){T(null),C(!0);try{const H=await fetch("/api/agent-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionIds:z})}),ee=await H.json().catch(()=>null);if(!H.ok)throw new Error((ee==null?void 0:ee.error)||`HTTP ${H.status}`);w(ne=>new Set([...ne].filter(M=>!z.includes(M)))),R(null)}catch(H){T(H.message)}finally{C(!1)}}async function W(z){try{const H=await fetch(`/api/agent-sessions/${encodeURIComponent(z)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"stopped"})});if(!H.ok){const ee=await H.json().catch(()=>null);T((ee==null?void 0:ee.error)||`Failed to mark session stopped: HTTP ${H.status}`)}}catch(H){T(H.message)}}if(s)return r.jsx(mt,{label:"Loading agent sessions..."});if(a)return r.jsx(wt,{error:a});if(!n)return null;const se=n.sessions.length>0;return r.jsxs(r.Fragment,{children:[r.jsxs(qg,{children:[r.jsx(tf,{value:l,onChange:c,placeholder:"Search project, assignment, agent, session ID, path, or description"}),r.jsxs("label",{className:"flex min-w-[150px] flex-col gap-1 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:["Started From",r.jsx("input",{type:"date",value:u,onChange:z=>p(z.target.value),className:"editor-input min-w-[150px]"})]}),r.jsxs("label",{className:"flex min-w-[150px] flex-col gap-1 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:["Started To",r.jsx("input",{type:"date",value:m,onChange:z=>h(z.target.value),className:"editor-input min-w-[150px]"})]}),r.jsxs("select",{value:g,onChange:z=>y(z.target.value),className:"editor-input max-w-[200px]",children:[r.jsx("option",{value:"started_desc",children:"Newest first"}),r.jsx("option",{value:"started_asc",children:"Oldest first"}),r.jsx("option",{value:"assignment_asc",children:"Assignment A-Z"}),r.jsx("option",{value:"agent_asc",children:"Agent A-Z"})]})]}),N?r.jsx("div",{className:"mt-4 rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:N}):null,j.size>0&&r.jsxs("div",{className:"mt-4 flex items-center gap-3 rounded border border-border/40 bg-muted/30 px-4 py-2 text-sm",children:[r.jsxs("span",{className:"text-muted-foreground",children:[j.size," session",j.size!==1?"s":""," selected"]}),r.jsxs("button",{className:"shell-action text-destructive",onClick:()=>R({sessionIds:[...j],title:`Delete ${j.size} selected session${j.size===1?"":"s"}?`,description:"This removes the selected agent session records from the dashboard. This cannot be undone.",confirmLabel:j.size===1?"Delete Session":"Delete Sessions"}),disabled:k,children:[r.jsx(or,{className:"mr-1 inline h-3.5 w-3.5"}),"Delete Selected"]}),r.jsx("button",{className:"shell-action",onClick:()=>w(new Set),children:"Clear Selection"})]}),se?L.length===0?r.jsx(St,{title:"No agent sessions match these filters",description:"Adjust the status, search term, date range, or sorting controls to show sessions again."}):r.jsx("div",{className:"surface-panel mt-4 overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[1280px] table-fixed text-sm",children:[r.jsxs("colgroup",{children:[r.jsx("col",{style:{width:"32px"}}),r.jsx("col",{style:{width:"140px"}}),r.jsx("col",{style:{width:"160px"}}),r.jsx("col",{style:{width:"200px"}}),r.jsx("col",{style:{width:"110px"}}),r.jsx("col",{style:{width:"130px"}}),r.jsx("col",{style:{width:"140px"}}),r.jsx("col",{style:{width:"200px"}}),r.jsx("col",{style:{width:"200px"}}),r.jsx("col",{style:{width:"40px"}})]}),r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/40 text-left text-xs uppercase tracking-wider text-muted-foreground",children:[r.jsx("th",{className:"pb-2 pr-3",children:r.jsx("button",{onClick:B,className:"text-muted-foreground hover:text-foreground",children:j.size===L.length&&L.length>0?r.jsx(Dr,{className:"h-4 w-4"}):r.jsx(og,{className:"h-4 w-4"})})}),r.jsx("th",{className:"pb-2 pr-3",children:"Project"}),r.jsx("th",{className:"pb-2 pr-3",children:"Assignment"}),r.jsx("th",{className:"pb-2 pr-3",children:"Description"}),r.jsx("th",{className:"pb-2 pr-3",children:"Agent"}),r.jsx("th",{className:"pb-2 pr-3",children:"Session ID"}),r.jsx("th",{className:"pb-2 pr-3",children:"Started"}),r.jsx("th",{className:"pb-2 pr-3",children:"Path"}),r.jsx("th",{className:"pb-2 pr-3",children:"Transcript"}),r.jsx("th",{className:"pb-2"})]})}),r.jsx("tbody",{children:L.map(z=>r.jsx(d6,{session:z,selected:j.has(z.sessionId),onToggle:()=>K(z.sessionId),onDelete:()=>R({sessionIds:[z.sessionId],title:`Delete session ${z.sessionId.slice(0,8)}...?`,description:`Remove this ${z.agent} session record${z.assignmentSlug?` for ${z.assignmentSlug}`:""}. This cannot be undone.`,confirmLabel:"Delete Session"}),onMarkStopped:W,onCopyError:T},z.sessionId))})]})}):r.jsx(St,{title:"No agent sessions",description:"No agent sessions have been registered yet. Use /grab-assignment or syntaur track-session to register one."}),r.jsx(sa,{open:D!==null,title:(D==null?void 0:D.title)??"Delete session?",description:(D==null?void 0:D.description)??"",confirmLabel:(D==null?void 0:D.confirmLabel)??"Delete",destructive:!0,loading:k,onOpenChange:z=>{z||R(null)},onConfirm:async()=>{D&&await O(D.sessionIds)}})]})}function d6({session:e,selected:t,onToggle:n,onDelete:s,onMarkStopped:a,onCopyError:l}){const c=ln(),u=e.sessionId.length>12?e.sessionId.slice(0,8)+"...":e.sessionId,p=e.path?e.path.replace(/^\/Users\/[^/]+/,"~"):"—",m=e.transcriptPath?e.transcriptPath.replace(/^\/Users\/[^/]+/,"~"):"—";return r.jsxs("tr",{className:"border-b border-border/20 last:border-0",children:[r.jsx("td",{className:"py-2 pr-3",children:r.jsx("button",{onClick:n,className:"text-muted-foreground hover:text-foreground",children:t?r.jsx(Dr,{className:"h-4 w-4"}):r.jsx(og,{className:"h-4 w-4"})})}),r.jsx("td",{className:"py-2 pr-3",children:e.projectSlug?r.jsx(Ee,{to:`${c}/projects/${e.projectSlug}`,className:"block truncate text-primary hover:underline",title:yn(e.projectSlug),children:yn(e.projectSlug)}):e.assignmentSlug?r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wide text-muted-foreground",children:"Standalone"}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("td",{className:"py-2 pr-3",children:e.projectSlug&&e.assignmentSlug?r.jsx(Ee,{to:`${c}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`,className:"block truncate text-primary hover:underline",title:yn(e.assignmentSlug),children:yn(e.assignmentSlug)}):e.assignmentSlug?r.jsx(Ee,{to:`/assignments/${e.assignmentSlug}`,className:"block truncate font-mono text-primary hover:underline",title:e.assignmentSlug,children:e.assignmentSlug}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("td",{className:"py-2 pr-3",children:e.description?r.jsx("div",{className:"truncate text-xs text-muted-foreground",title:e.description,children:e.description}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx(Ad,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"block min-w-0 truncate",children:e.agent})]})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx("span",{className:"block min-w-0 truncate font-mono text-xs text-muted-foreground",title:e.sessionId,children:u}),r.jsx($r,{value:e.sessionId}),r.jsx(wN,{sessionId:e.sessionId,disabled:!e.resumeSupported,disabledReason:"Resume not supported for this agent",onError:h=>l(h.message),onNotice:h=>l(h)})]})}),r.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:r.jsx("span",{className:"truncate block",children:Lr(e.started)})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx("span",{className:"block min-w-0 truncate text-xs text-muted-foreground",title:e.path,children:p}),e.path&&r.jsx($r,{value:e.path})]})}),r.jsx("td",{className:"py-2 pr-3",children:e.transcriptPath?r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx("span",{className:"block min-w-0 truncate font-mono text-xs text-muted-foreground",title:e.transcriptPath,children:m}),r.jsx($r,{value:e.transcriptPath})]}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("td",{className:"py-2",children:r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(CN,{session:e,onMarkStopped:a}),r.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-destructive",title:"Delete session",children:r.jsx(or,{className:"h-3.5 w-3.5"})})]})})]})}function f6(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return null;const n=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0");return`${n}-${s}-${a}`}function Ou(e){const t=Date.parse(e.started),n=e.ended?Date.parse(e.ended):Date.now();return Number.isNaN(t)||Number.isNaN(n)?0:Math.max(0,Math.floor((n-t)/6e4))}function p6(e,t,n){switch(n){case"started_asc":return e.started.localeCompare(t.started);case"started_desc":return t.started.localeCompare(e.started);case"duration_asc":return Ou(e)-Ou(t);case"duration_desc":return Ou(t)-Ou(e);case"assignment_asc":return(e.assignmentSlug??"").localeCompare(t.assignmentSlug??"")||(e.projectSlug??"").localeCompare(t.projectSlug??"");case"agent_asc":return e.agent.localeCompare(t.agent)||(e.assignmentSlug??"").localeCompare(t.assignmentSlug??"");default:return 0}}function m6(){const{data:e,loading:t,error:n,refetch:s}=fg(),[a,l]=f.useState(""),[c,u]=f.useState(null),[p,m]=f.useState(null),[h,g]=f.useState(null),y=f.useMemo(()=>{if(!(e!=null&&e.playbooks))return[];if(!a.trim())return e.playbooks;const j=a.toLowerCase();return e.playbooks.filter(w=>w.name.toLowerCase().includes(j)||w.description.toLowerCase().includes(j)||w.slug.toLowerCase().includes(j)||w.tags.some(k=>k.toLowerCase().includes(j)))},[e,a]);async function b(j,w,k){if(j.preventDefault(),j.stopPropagation(),!c){u(w);try{const C=k?"disable":"enable",N=await fetch(`/api/playbooks/${encodeURIComponent(w)}/${C}`,{method:"POST"});if(!N.ok){const T=await N.json().catch(()=>({}));throw new Error(T.error||`Failed to ${C} playbook`)}s()}catch(C){console.error(C),alert(C instanceof Error?C.message:"Failed to update playbook")}finally{u(null)}}}async function E(){if(p){g(p.slug);try{const j=await fetch(`/api/playbooks/${encodeURIComponent(p.slug)}`,{method:"DELETE"});if(!j.ok){const w=await j.json().catch(()=>({}));throw new Error(w.error||"Failed to delete playbook")}m(null),s()}catch(j){console.error(j),alert(j instanceof Error?j.message:"Failed to delete playbook")}finally{g(null)}}}return t?r.jsx(mt,{label:"Loading playbooks..."}):n?r.jsx(wt,{error:n}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between gap-4",children:[r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(fo,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",placeholder:"Search playbooks...",value:a,onChange:j=>l(j.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs(Ee,{to:"/playbooks/create",className:"inline-flex h-9 items-center gap-2 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(rn,{className:"h-4 w-4"}),"Create Playbook"]})]}),r.jsxs(Ee,{to:"/playbooks/manifest",className:"surface-panel group flex items-center gap-3 p-3 transition hover:border-foreground/20",children:[r.jsx(d0,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"text-sm font-semibold text-foreground group-hover:underline",children:"Playbook Manifest"}),r.jsx("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-[10px] text-muted-foreground",children:"auto-generated"})]}),r.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Index of all playbooks with descriptions. Include ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-[11px]",children:"~/.syntaur/playbooks/manifest.md"})," in your CLAUDE.md for agent context."]})]})]}),y.length===0?r.jsx(St,{title:"No playbooks found",description:(e==null?void 0:e.playbooks.length)===0?"Playbooks define rules and workflows for how agents should operate. Create your first one to get started.":"No playbooks match your search.",actions:(e==null?void 0:e.playbooks.length)===0?r.jsxs(Ee,{to:"/playbooks/create",className:"inline-flex items-center gap-2 rounded-md bg-foreground px-3 py-2 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(rn,{className:"h-4 w-4"}),"Create Playbook"]}):void 0}):r.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:y.map(j=>{const w=c===j.slug,k=[{key:"delete",label:"Delete",icon:or,destructive:!0,onSelect:()=>m({slug:j.slug,name:j.name})}];return r.jsxs("div",{className:`surface-panel relative flex flex-col gap-2 p-4 transition hover:border-foreground/20 ${j.enabled?"":"opacity-75"}`,children:[r.jsx("div",{className:"absolute right-3 top-3 z-10",children:r.jsx(Wg,{items:k})}),r.jsxs(Ee,{to:`/playbooks/${j.slug}`,className:"group flex flex-col gap-2",children:[r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx(i0,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("h3",{className:"text-sm font-semibold text-foreground group-hover:underline",children:j.name}),j.description?r.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground line-clamp-2",children:j.description}):null]})]}),r.jsx("div",{className:"flex items-center gap-2 pt-1 pr-20",children:r.jsxs("div",{className:"flex flex-wrap gap-1",children:[j.tags.slice(0,3).map(C=>r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-[10px] text-muted-foreground",children:[r.jsx(g0,{className:"h-2.5 w-2.5"}),C]},C)),j.tags.length>3?r.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["+",j.tags.length-3]}):null]})})]}),r.jsx("button",{type:"button",role:"switch","aria-checked":j.enabled,"aria-label":j.enabled?"Disable playbook":"Enable playbook",onClick:C=>b(C,j.slug,j.enabled),disabled:w,className:`absolute bottom-3 right-3 z-10 inline-flex h-5 w-9 items-center rounded-full border opacity-100 transition disabled:opacity-50 ${j.enabled?"border-status-completed-foreground/60 bg-status-completed-foreground/80":"border-foreground/40 bg-foreground/15"}`,children:r.jsx("span",{className:`block h-4 w-4 rounded-full shadow-sm transition-transform ${j.enabled?"translate-x-[18px] bg-background":"translate-x-[2px] bg-foreground/70"}`})})]},j.slug)})}),r.jsx(sa,{open:p!==null,title:"Delete playbook?",description:p?`"${p.name}" will be removed from disk and the playbook manifest will be regenerated. This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,loading:h!==null,onConfirm:E,onOpenChange:j=>{j||m(null)}})]})}function h6(){const{slug:e}=$t(),t=Dt(),{data:n,loading:s,error:a,refetch:l}=TP(e),[c,u]=f.useState(!1),[p,m]=f.useState(!1),[h,g]=f.useState(!1),[y,b]=f.useState(!1),[E,j]=f.useState(""),[w,k]=f.useState(!1),[C,N]=f.useState(null),T=e==="manifest";f.useEffect(()=>{y&&(j(e??""),N(null))},[y,e]);const D=mr(E),R=D.length>0&&Hu(D)&&D!=="manifest",$=D!==e;async function L(){if(!(!e||!R||!$)){k(!0),N(null);try{const O=await fetch(`/api/playbooks/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({newSlug:D})});if(!O.ok){const W=await O.json().catch(()=>({}));throw new Error(W.error||"Failed to rename playbook")}b(!1),t(`/playbooks/${D}`)}catch(O){N(O instanceof Error?O.message:"Failed to rename playbook")}finally{k(!1)}}}async function K(){if(e){m(!0);try{(await fetch(`/api/playbooks/${e}`,{method:"DELETE"})).ok&&t("/playbooks")}finally{m(!1)}}}async function B(){if(!(!e||!n)){g(!0);try{const O=n.enabled?"disable":"enable",W=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${O}`,{method:"POST"});if(!W.ok){const se=await W.json().catch(()=>({}));throw new Error(se.error||`Failed to ${O} playbook`)}l()}catch(O){console.error(O),alert(O instanceof Error?O.message:"Failed to update playbook")}finally{g(!1)}}}return s?r.jsx(mt,{label:"Loading playbook..."}):a?r.jsx(wt,{error:a}):n?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:T?"Playbook Manifest":n.name}),T?r.jsx("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground",children:"auto-generated"}):null]}),!T&&n.description?r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:n.description}):null,T?r.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["This file is rebuilt automatically when playbooks are added or removed. Include"," ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"~/.syntaur/playbooks/manifest.md"})," ","in your CLAUDE.md for agent context."]}):null,!T&&n.whenToUse?r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground italic",children:["When to use: ",n.whenToUse]}):null,r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[r.jsxs("span",{children:["Created ",Lr(n.created)]}),r.jsxs("span",{children:["Updated ",Lr(n.updated)]})]}),n.tags.length>0?r.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:n.tags.map(O=>r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground",children:[r.jsx(g0,{className:"h-3 w-3"}),O]},O))}):null]}),T?null:r.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n.enabled?"Enabled":"Disabled"}),r.jsx("button",{type:"button",role:"switch","aria-checked":n.enabled,"aria-label":n.enabled?"Disable playbook":"Enable playbook",onClick:B,disabled:h,className:`inline-flex h-5 w-9 items-center rounded-full border transition disabled:opacity-50 ${n.enabled?"border-status-completed-foreground/60 bg-status-completed-foreground/80":"border-foreground/40 bg-foreground/15"}`,children:r.jsx("span",{className:`block h-4 w-4 rounded-full shadow-sm transition-transform ${n.enabled?"translate-x-[18px] bg-background":"translate-x-[2px] bg-foreground/70"}`})})]}),r.jsxs(Ee,{to:`/playbooks/${e}/edit`,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:[r.jsx(bi,{className:"h-3 w-3"}),"Edit"]}),r.jsxs("button",{type:"button",onClick:()=>b(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:[r.jsx(PR,{className:"h-3 w-3"}),"Rename"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:K,disabled:p,className:"inline-flex h-8 items-center gap-1.5 rounded-md bg-destructive px-3 text-xs font-medium text-destructive-foreground transition hover:bg-destructive/90 disabled:opacity-50",children:p?"Deleting...":"Confirm"}),r.jsx("button",{type:"button",onClick:()=>u(!1),className:"inline-flex h-8 items-center rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]}):r.jsxs("button",{type:"button",onClick:()=>u(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-destructive transition hover:bg-destructive/10",children:[r.jsx(or,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(fn,{content:n.body})}),r.jsx(ar,{open:y,onOpenChange:O=>w?void 0:b(O),children:r.jsxs(Kn,{children:[r.jsxs(Zr,{children:[r.jsx(qn,{children:"Rename playbook"}),r.jsx(gs,{children:"The slug changes both the file name and the canonical slug stored in frontmatter. The URL will update on save."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{htmlFor:"rename-slug-input",className:"block text-xs font-medium text-muted-foreground",children:"New slug"}),r.jsx("input",{id:"rename-slug-input",type:"text",autoFocus:!0,value:E,onChange:O=>j(O.target.value),disabled:w,className:"h-9 w-full rounded-md border border-border/70 bg-background px-3 text-sm text-foreground focus:border-foreground/40 focus:outline-none",placeholder:"my-new-slug"}),E&&D!==E?r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Will be normalized to ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:D||"—"})]}):null,E&&!R?r.jsx("p",{className:"text-xs text-destructive",children:'Slugs must be lowercase, hyphen-separated, with no special characters, and cannot be "manifest".'}):null]}),C?r.jsx("p",{className:"text-sm text-destructive",role:"alert",children:C}):null,r.jsxs(Ls,{children:[r.jsx("button",{type:"button",onClick:()=>b(!1),disabled:w,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",onClick:L,disabled:w||!R||!$,className:"shell-action mt-0 shell-action--cta disabled:cursor-not-allowed disabled:opacity-50",children:w?"Renaming…":"Rename"})]})]})})]}):null}function g6(){const e=Dt(),[t,n]=f.useState(null),[s,a]=f.useState(!0),[l,c]=f.useState(!1),[u,p]=f.useState(null);f.useEffect(()=>{fetch("/api/playbooks/template/new").then(h=>h.json()).then(h=>{n(h.content),a(!1)}).catch(h=>{p(h.message),a(!1)})},[]);async function m(h){c(!0),p(null);try{const g=await fetch("/api/playbooks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:h})}),y=await g.json();if(!g.ok){p(y.error||`HTTP ${g.status}`),c(!1);return}e(`/playbooks/${y.slug}`)}catch(g){p(g.message),c(!1);return}c(!1)}return s?r.jsx(mt,{label:"Loading playbook template..."}):u&&!t?r.jsx(wt,{error:u}):r.jsx(Ci,{initialContent:t||"",documentType:"playbook",mode:"create",onSave:m,saving:l,error:u,title:"Create Playbook",description:"Playbooks define rules and workflows for how agents should operate. Keep them short, imperative, and focused on a single concern.",onCancel:()=>e("/playbooks"),allowSlugEdit:!0})}function x6(){const{slug:e}=$t(),t=Dt(),[n,s]=f.useState(null),[a,l]=f.useState(!0),[c,u]=f.useState(!1),[p,m]=f.useState(null);f.useEffect(()=>{e&&fetch(`/api/playbooks/${e}/edit`).then(g=>g.json()).then(g=>{s(g.content),l(!1)}).catch(g=>{m(g.message),l(!1)})},[e]);async function h(g){if(e){u(!0),m(null);try{const y=await fetch(`/api/playbooks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:g})}),b=await y.json();if(!y.ok){m(b.error||`HTTP ${y.status}`),u(!1);return}t(`/playbooks/${e}`)}catch(y){m(y.message),u(!1);return}u(!1)}}return a?r.jsx(mt,{label:"Loading playbook..."}):p&&!n?r.jsx(wt,{error:p}):r.jsx(Ci,{initialContent:n||"",documentType:"playbook",mode:"edit",onSave:h,saving:c,error:p,title:"Edit Playbook",onCancel:()=>t(`/playbooks/${e}`)})}function y6(){const{data:e,loading:t,error:n}=RP(),[s,a]=f.useState(""),[l,c]=f.useState("all"),[u,p]=f.useState("all"),[m,h]=f.useState("all"),g=(e==null?void 0:e.memories)??[],y=f.useMemo(()=>Array.from(new Set(g.map(w=>w.projectSlug))).sort(),[g]),b=f.useMemo(()=>Array.from(new Set(g.map(w=>w.scope).filter(Boolean))).sort(),[g]),E=f.useMemo(()=>Array.from(new Set(g.map(w=>w.source).filter(Boolean))).sort(),[g]),j=f.useMemo(()=>g.filter(w=>{if(l!=="all"&&w.projectSlug!==l||u!=="all"&&w.scope!==u||m!=="all"&&w.source!==m)return!1;if(s.trim()){const k=s.toLowerCase();if(!w.name.toLowerCase().includes(k)&&!w.slug.toLowerCase().includes(k)&&!w.projectTitle.toLowerCase().includes(k))return!1}return!0}),[g,s,l,u,m]);return t?r.jsx(mt,{label:"Loading memories…"}):n?r.jsx(wt,{error:n}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("div",{className:"relative",children:[r.jsx(fo,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",placeholder:"Search memories…",value:s,onChange:w=>a(w.target.value),className:"h-9 w-64 rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs("select",{value:l,onChange:w=>c(w.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All projects"}),y.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:u,onChange:w=>p(w.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All scopes"}),b.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:m,onChange:w=>h(w.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All sources"}),E.map(w=>r.jsx("option",{value:w,children:w},w))]})]}),r.jsxs(Ee,{to:"/memories/new",className:"inline-flex h-9 items-center gap-2 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(rn,{className:"h-4 w-4"}),"New Memory"]})]}),j.length===0?r.jsx(St,{title:g.length===0?"No memories yet":"No memories match these filters",description:g.length===0?"Memories capture patterns and learnings discovered while working in a project. Agents create them via /create-memory or you can add one manually.":"Clear the current filters or create a new memory.",actions:g.length===0?r.jsxs(Ee,{to:"/memories/new",className:"inline-flex items-center gap-2 rounded-md bg-foreground px-3 py-2 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(rn,{className:"h-4 w-4"}),"New Memory"]}):void 0}):r.jsx("div",{className:"surface-panel overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[820px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Name"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Project"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Scope"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Source"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"# Related"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Updated"})]})}),r.jsx("tbody",{children:j.map(w=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[r.jsx("td",{className:"px-3 py-3",children:r.jsx(Ee,{to:`/projects/${w.projectSlug}/memories/${w.slug}`,className:"font-semibold text-foreground hover:text-primary",children:w.name||w.slug})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:r.jsx(Ee,{to:`/projects/${w.projectSlug}`,className:"hover:text-foreground hover:underline",children:w.projectTitle})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.scope||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.source||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.relatedAssignments.length}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:Dn(w.updated)})]},`${w.projectSlug}/${w.slug}`))})]})})]})}function b6(){const{slug:e,itemSlug:t}=$t(),n=Dt(),{data:s,loading:a,error:l}=PP(e,t),[c,u]=f.useState(!1),[p,m]=f.useState(!1);async function h(){if(!(!e||!t)){m(!0);try{(await fetch(`/api/projects/${e}/memories/${t}`,{method:"DELETE"})).ok&&n("/memories")}finally{m(!1)}}}return a?r.jsx(mt,{label:"Loading memory…"}):l?r.jsx(wt,{error:l}):s?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s.name||s.slug}),r.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(Ee,{to:`/projects/${s.projectSlug}`,className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 hover:text-foreground",children:s.projectTitle}),s.scope?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Scope: ",s.scope]}):null,s.source?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Source: ",s.source]}):null,s.sourceAssignment?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["From: ",s.sourceAssignment]}):null,r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:[s.relatedAssignments.length," related"]})]}),r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[r.jsxs("span",{children:["Created ",Lr(s.created)]}),r.jsxs("span",{children:["Updated ",Lr(s.updated)]})]}),s.tags&&s.tags.length>0?r.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:s.tags.map(g=>r.jsx("span",{className:"inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground",children:g},g))}):null]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsxs(Ee,{to:`/projects/${e}/memories/${t}/edit`,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:[r.jsx(bi,{className:"h-3 w-3"}),"Edit"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:h,disabled:p,className:"inline-flex h-8 items-center gap-1.5 rounded-md bg-destructive px-3 text-xs font-medium text-destructive-foreground transition hover:bg-destructive/90 disabled:opacity-50",children:p?"Deleting…":"Confirm"}),r.jsx("button",{type:"button",onClick:()=>u(!1),className:"inline-flex h-8 items-center rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]}):r.jsxs("button",{type:"button",onClick:()=>u(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-destructive transition hover:bg-destructive/10",children:[r.jsx(or,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(fn,{content:s.body})})]}):null}function v6(){const e=Dt(),[t]=hs(),n=t.get("project"),{data:s,loading:a,error:l}=Jo(),[c,u]=f.useState(n??""),[p,m]=f.useState(""),[h,g]=f.useState(""),[y,b]=f.useState(!1),[E,j]=f.useState(null);f.useEffect(()=>{!c&&s&&s.length>0&&u(n??s[0].slug)},[s,n,c]);async function w(k){if(k.preventDefault(),!(!c||!p.trim())){b(!0),j(null);try{const C=await fetch(`/api/projects/${c}/memories`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),body:h||void 0})}),N=await C.json();if(!C.ok){j(N.error||`HTTP ${C.status}`),b(!1);return}e(`/projects/${N.projectSlug}/memories/${N.slug}`)}catch(C){j(C.message),b(!1)}}}return a?r.jsx(mt,{label:"Loading projects…"}):l?r.jsx(wt,{error:l}):!s||s.length===0?r.jsx(wt,{error:"You need at least one project before you can create a memory. Create a project from the sidebar."}):r.jsxs("form",{onSubmit:w,className:"space-y-5",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"New Memory"}),r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Memories capture patterns and learnings discovered during work in a project. They are available to every assignment in that project."})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"project",className:"block text-sm font-medium text-foreground",children:"Project"}),r.jsx("select",{id:"project",value:c,onChange:k=>u(k.target.value),className:"editor-input",required:!0,children:s.map(k=>r.jsx("option",{value:k.slug,children:k.title},k.slug))})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-foreground",children:"Name"}),r.jsx("input",{id:"name",type:"text",value:p,onChange:k=>m(k.target.value),placeholder:"e.g. PostgreSQL connection pooling",className:"editor-input",required:!0,autoFocus:!0}),r.jsx("p",{className:"text-xs text-muted-foreground/80",children:"The slug is auto-derived from the name. Letters, digits, and hyphens."})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"body",className:"block text-sm font-medium text-foreground",children:"Body"}),r.jsx("textarea",{id:"body",value:h,onChange:k=>g(k.target.value),rows:14,placeholder:"Write the memory body in markdown. Leave blank to start from a template.",className:"editor-input font-mono text-sm"})]}),E?r.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:E}):null,r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"submit",disabled:y||!p.trim()||!c,className:"inline-flex h-9 items-center rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-50",children:y?"Creating…":"Create Memory"}),r.jsx("button",{type:"button",onClick:()=>e("/memories"),className:"inline-flex h-9 items-center rounded-md border border-border/70 bg-background px-3 text-sm font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]})]})}function w6(){const{slug:e,itemSlug:t}=$t();return r.jsx(Ei,{loadUrl:`/api/projects/${e}/memories/${t}/edit`,saveUrl:`/api/projects/${e}/memories/${t}`,redirectTo:`/projects/${e}/memories/${t}`,title:"Edit Memory",description:"Edit the body. The frontmatter (name, scope, source, related assignments) is preserved unchanged on save.",documentType:"memory",helpTitle:"Memory editing",helpBody:"Memory edits are body-only. Frontmatter changes from the editor are ignored server-side; the file's existing frontmatter is preserved and `updated` is bumped automatically."})}function j6(){const{data:e,loading:t,error:n}=AP(),[s,a]=f.useState(""),[l,c]=f.useState("all"),[u,p]=f.useState("all"),[m,h]=f.useState("all"),g=(e==null?void 0:e.resources)??[],y=f.useMemo(()=>Array.from(new Set(g.map(w=>w.projectSlug))).sort(),[g]),b=f.useMemo(()=>Array.from(new Set(g.map(w=>w.category).filter(Boolean))).sort(),[g]),E=f.useMemo(()=>Array.from(new Set(g.map(w=>w.source).filter(Boolean))).sort(),[g]),j=f.useMemo(()=>g.filter(w=>{if(l!=="all"&&w.projectSlug!==l||u!=="all"&&w.category!==u||m!=="all"&&w.source!==m)return!1;if(s.trim()){const k=s.toLowerCase();if(!w.name.toLowerCase().includes(k)&&!w.slug.toLowerCase().includes(k)&&!w.projectTitle.toLowerCase().includes(k))return!1}return!0}),[g,s,l,u,m]);return t?r.jsx(mt,{label:"Loading resources…"}):n?r.jsx(wt,{error:n}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("div",{className:"relative",children:[r.jsx(fo,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",placeholder:"Search resources…",value:s,onChange:w=>a(w.target.value),className:"h-9 w-64 rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs("select",{value:l,onChange:w=>c(w.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All projects"}),y.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:u,onChange:w=>p(w.target.value),className:"editor-input max-w-[160px]",children:[r.jsx("option",{value:"all",children:"All categories"}),b.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:m,onChange:w=>h(w.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All sources"}),E.map(w=>r.jsx("option",{value:w,children:w},w))]})]}),r.jsxs(Ee,{to:"/resources/new",className:"inline-flex h-9 items-center gap-2 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(rn,{className:"h-4 w-4"}),"New Resource"]})]}),j.length===0?r.jsx(St,{title:g.length===0?"No resources yet":"No resources match these filters",description:g.length===0?"Resources are reference materials shared across a project — specs, requirements, links, or any reference content.":"Clear the current filters or create a new resource.",actions:g.length===0?r.jsxs(Ee,{to:"/resources/new",className:"inline-flex items-center gap-2 rounded-md bg-foreground px-3 py-2 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(rn,{className:"h-4 w-4"}),"New Resource"]}):void 0}):r.jsx("div",{className:"surface-panel overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[820px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Name"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Project"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Category"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Source"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"# Related"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Updated"})]})}),r.jsx("tbody",{children:j.map(w=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[r.jsx("td",{className:"px-3 py-3",children:r.jsx(Ee,{to:`/projects/${w.projectSlug}/resources/${w.slug}`,className:"font-semibold text-foreground hover:text-primary",children:w.name||w.slug})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:r.jsx(Ee,{to:`/projects/${w.projectSlug}`,className:"hover:text-foreground hover:underline",children:w.projectTitle})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.category||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.source||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.relatedAssignments.length}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:Dn(w.updated)})]},`${w.projectSlug}/${w.slug}`))})]})})]})}function k6(){const{slug:e,itemSlug:t}=$t(),n=Dt(),{data:s,loading:a,error:l}=DP(e,t),[c,u]=f.useState(!1),[p,m]=f.useState(!1);async function h(){if(!(!e||!t)){m(!0);try{(await fetch(`/api/projects/${e}/resources/${t}`,{method:"DELETE"})).ok&&n("/resources")}finally{m(!1)}}}return a?r.jsx(mt,{label:"Loading resource…"}):l?r.jsx(wt,{error:l}):s?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s.name||s.slug}),r.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(Ee,{to:`/projects/${s.projectSlug}`,className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 hover:text-foreground",children:s.projectTitle}),s.category?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Category: ",s.category]}):null,s.source?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Source: ",s.source]}):null,r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:[s.relatedAssignments.length," related"]})]}),r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[r.jsxs("span",{children:["Created ",Lr(s.created)]}),r.jsxs("span",{children:["Updated ",Lr(s.updated)]})]})]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsxs(Ee,{to:`/projects/${e}/resources/${t}/edit`,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:[r.jsx(bi,{className:"h-3 w-3"}),"Edit"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:h,disabled:p,className:"inline-flex h-8 items-center gap-1.5 rounded-md bg-destructive px-3 text-xs font-medium text-destructive-foreground transition hover:bg-destructive/90 disabled:opacity-50",children:p?"Deleting…":"Confirm"}),r.jsx("button",{type:"button",onClick:()=>u(!1),className:"inline-flex h-8 items-center rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]}):r.jsxs("button",{type:"button",onClick:()=>u(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-destructive transition hover:bg-destructive/10",children:[r.jsx(or,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(fn,{content:s.body})})]}):null}function S6(){const e=Dt(),[t]=hs(),n=t.get("project"),{data:s,loading:a,error:l}=Jo(),[c,u]=f.useState(n??""),[p,m]=f.useState(""),[h,g]=f.useState(""),[y,b]=f.useState(!1),[E,j]=f.useState(null);f.useEffect(()=>{!c&&s&&s.length>0&&u(n??s[0].slug)},[s,n,c]);async function w(k){if(k.preventDefault(),!(!c||!p.trim())){b(!0),j(null);try{const C=await fetch(`/api/projects/${c}/resources`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),body:h||void 0})}),N=await C.json();if(!C.ok){j(N.error||`HTTP ${C.status}`),b(!1);return}e(`/projects/${N.projectSlug}/resources/${N.slug}`)}catch(C){j(C.message),b(!1)}}}return a?r.jsx(mt,{label:"Loading projects…"}):l?r.jsx(wt,{error:l}):!s||s.length===0?r.jsx(wt,{error:"You need at least one project before you can create a resource. Create a project from the sidebar."}):r.jsxs("form",{onSubmit:w,className:"space-y-5",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"New Resource"}),r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Resources are reference material — specs, requirements, links — shared across every assignment in a project."})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"project",className:"block text-sm font-medium text-foreground",children:"Project"}),r.jsx("select",{id:"project",value:c,onChange:k=>u(k.target.value),className:"editor-input",required:!0,children:s.map(k=>r.jsx("option",{value:k.slug,children:k.title},k.slug))})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-foreground",children:"Name"}),r.jsx("input",{id:"name",type:"text",value:p,onChange:k=>m(k.target.value),placeholder:"e.g. Auth Requirements",className:"editor-input",required:!0,autoFocus:!0}),r.jsx("p",{className:"text-xs text-muted-foreground/80",children:"The slug is auto-derived from the name. Letters, digits, and hyphens."})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"body",className:"block text-sm font-medium text-foreground",children:"Body"}),r.jsx("textarea",{id:"body",value:h,onChange:k=>g(k.target.value),rows:14,placeholder:"Write the resource body in markdown. Leave blank to start from a template.",className:"editor-input font-mono text-sm"})]}),E?r.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:E}):null,r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"submit",disabled:y||!p.trim()||!c,className:"inline-flex h-9 items-center rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-50",children:y?"Creating…":"Create Resource"}),r.jsx("button",{type:"button",onClick:()=>e("/resources"),className:"inline-flex h-9 items-center rounded-md border border-border/70 bg-background px-3 text-sm font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]})]})}function N6(){const{slug:e,itemSlug:t}=$t();return r.jsx(Ei,{loadUrl:`/api/projects/${e}/resources/${t}/edit`,saveUrl:`/api/projects/${e}/resources/${t}`,redirectTo:`/projects/${e}/resources/${t}`,title:"Edit Resource",description:"Edit the body. The frontmatter (name, category, source, related assignments) is preserved unchanged on save.",documentType:"resource",helpTitle:"Resource editing",helpBody:"Resource edits are body-only. Frontmatter changes from the editor are ignored server-side; the file's existing frontmatter is preserved and `updated` is bumped automatically."})}function C6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>s=>{t.forEach(a=>a(s))},t)}const hf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ti(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Rx(e){return"nodeType"in e}function lr(e){var t,n;return e?Ti(e)?e:Rx(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Px(e){const{Document:t}=lr(e);return e instanceof t}function mc(e){return Ti(e)?!1:e instanceof lr(e).HTMLElement}function WN(e){return e instanceof lr(e).SVGElement}function Ri(e){return e?Ti(e)?e.document:Rx(e)?Px(e)?e:mc(e)||WN(e)?e.ownerDocument:document:document:document}const ms=hf?f.useLayoutEffect:f.useEffect;function Ax(e){const t=f.useRef(e);return ms(()=>{t.current=e}),f.useCallback(function(){for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];return t.current==null?void 0:t.current(...s)},[])}function E6(){const e=f.useRef(null),t=f.useCallback((s,a)=>{e.current=setInterval(s,a)},[]),n=f.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ql(e,t){t===void 0&&(t=[e]);const n=f.useRef(e);return ms(()=>{n.current!==e&&(n.current=e)},t),n}function hc(e,t){const n=f.useRef();return f.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function wd(e){const t=Ax(e),n=f.useRef(null),s=f.useCallback(a=>{a!==n.current&&(t==null||t(a,n.current)),n.current=a},[]);return[n,s]}function Fh(e){const t=f.useRef();return f.useEffect(()=>{t.current=e},[e]),t.current}let eh={};function gc(e,t){return f.useMemo(()=>{if(t)return t;const n=eh[e]==null?0:eh[e]+1;return eh[e]=n,e+"-"+n},[e,t])}function KN(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return s.reduce((l,c)=>{const u=Object.entries(c);for(const[p,m]of u){const h=l[p];h!=null&&(l[p]=h+e*m)}return l},{...t})}}const di=KN(1),Zl=KN(-1);function T6(e){return"clientX"in e&&"clientY"in e}function Dx(e){if(!e)return!1;const{KeyboardEvent:t}=lr(e.target);return t&&e instanceof t}function R6(e){if(!e)return!1;const{TouchEvent:t}=lr(e.target);return t&&e instanceof t}function zh(e){if(R6(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return T6(e)?{x:e.clientX,y:e.clientY}:null}const hi=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[hi.Translate.toString(e),hi.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),vj="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function P6(e){return e.matches(vj)?e:e.querySelector(vj)}const A6={display:"none"};function D6(e){let{id:t,value:n}=e;return nn.createElement("div",{id:t,style:A6},n)}function $6(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return nn.createElement("div",{id:t,style:a,role:"status","aria-live":s,"aria-atomic":!0},n)}function L6(){const[e,t]=f.useState("");return{announce:f.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const qN=f.createContext(null);function O6(e){const t=f.useContext(qN);f.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function I6(){const[e]=f.useState(()=>new Set),t=f.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[f.useCallback(s=>{let{type:a,event:l}=s;e.forEach(c=>{var u;return(u=c[a])==null?void 0:u.call(c,l)})},[e]),t]}const M6={draggable:`
|
|
563
|
-
To pick up a draggable item, press the space bar.
|
|
564
|
-
While dragging, use the arrow keys to move the item.
|
|
565
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
566
|
-
`},_6={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function F6(e){let{announcements:t=_6,container:n,hiddenTextDescribedById:s,screenReaderInstructions:a=M6}=e;const{announce:l,announcement:c}=L6(),u=gc("DndLiveRegion"),[p,m]=f.useState(!1);if(f.useEffect(()=>{m(!0)},[]),O6(f.useMemo(()=>({onDragStart(g){let{active:y}=g;l(t.onDragStart({active:y}))},onDragMove(g){let{active:y,over:b}=g;t.onDragMove&&l(t.onDragMove({active:y,over:b}))},onDragOver(g){let{active:y,over:b}=g;l(t.onDragOver({active:y,over:b}))},onDragEnd(g){let{active:y,over:b}=g;l(t.onDragEnd({active:y,over:b}))},onDragCancel(g){let{active:y,over:b}=g;l(t.onDragCancel({active:y,over:b}))}}),[l,t])),!p)return null;const h=nn.createElement(nn.Fragment,null,nn.createElement(D6,{id:s,value:a.draggable}),nn.createElement($6,{id:u,announcement:c}));return n?Rs.createPortal(h,n):h}var bn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(bn||(bn={}));function jd(){}function kd(e,t){return f.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function GN(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const Yr=Object.freeze({x:0,y:0});function YN(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function JN(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return n-s}function z6(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function wj(e){let{left:t,top:n,height:s,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+s},{x:t+a,y:n+s}]}function XN(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function jj(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const QN=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const a=jj(t,t.left,t.top),l=[];for(const c of s){const{id:u}=c,p=n.get(u);if(p){const m=YN(jj(p),a);l.push({id:u,data:{droppableContainer:c,value:m}})}}return l.sort(JN)},B6=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const a=wj(t),l=[];for(const c of s){const{id:u}=c,p=n.get(u);if(p){const m=wj(p),h=a.reduce((y,b,E)=>y+YN(m[E],b),0),g=Number((h/4).toFixed(4));l.push({id:u,data:{droppableContainer:c,value:g}})}}return l.sort(JN)};function U6(e,t){const n=Math.max(t.top,e.top),s=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),c=a-s,u=l-n;if(s<a&&n<l){const p=t.width*t.height,m=e.width*e.height,h=c*u,g=h/(p+m-h);return Number(g.toFixed(4))}return 0}const V6=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const a=[];for(const l of s){const{id:c}=l,u=n.get(c);if(u){const p=U6(u,t);p>0&&a.push({id:c,data:{droppableContainer:l,value:p}})}}return a.sort(z6)};function H6(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function ZN(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Yr}function W6(e){return function(n){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return a.reduce((c,u)=>({...c,top:c.top+e*u.y,bottom:c.bottom+e*u.y,left:c.left+e*u.x,right:c.right+e*u.x}),{...n})}}const K6=W6(1);function q6(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function G6(e,t,n){const s=q6(t);if(!s)return e;const{scaleX:a,scaleY:l,x:c,y:u}=s,p=e.left-c-(1-a)*parseFloat(n),m=e.top-u-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),h=a?e.width/a:e.width,g=l?e.height/l:e.height;return{width:h,height:g,top:m,right:p+h,bottom:m+g,left:p}}const Y6={ignoreTransform:!1};function Pi(e,t){t===void 0&&(t=Y6);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:h}=lr(e).getComputedStyle(e);m&&(n=G6(n,m,h))}const{top:s,left:a,width:l,height:c,bottom:u,right:p}=n;return{top:s,left:a,width:l,height:c,bottom:u,right:p}}function kj(e){return Pi(e,{ignoreTransform:!0})}function J6(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function X6(e,t){return t===void 0&&(t=lr(e).getComputedStyle(e)),t.position==="fixed"}function Q6(e,t){t===void 0&&(t=lr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const l=t[a];return typeof l=="string"?n.test(l):!1})}function gf(e,t){const n=[];function s(a){if(t!=null&&n.length>=t||!a)return n;if(Px(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!mc(a)||WN(a)||n.includes(a))return n;const l=lr(e).getComputedStyle(a);return a!==e&&Q6(a,l)&&n.push(a),X6(a,l)?n:s(a.parentNode)}return e?s(e):n}function eC(e){const[t]=gf(e,1);return t??null}function th(e){return!hf||!e?null:Ti(e)?e:Rx(e)?Px(e)||e===Ri(e).scrollingElement?window:mc(e)?e:null:null}function tC(e){return Ti(e)?e.scrollX:e.scrollLeft}function nC(e){return Ti(e)?e.scrollY:e.scrollTop}function Bh(e){return{x:tC(e),y:nC(e)}}var En;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(En||(En={}));function rC(e){return!hf||!e?!1:e===document.scrollingElement}function sC(e){const t={x:0,y:0},n=rC(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},a=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,c=e.scrollTop>=s.y,u=e.scrollLeft>=s.x;return{isTop:a,isLeft:l,isBottom:c,isRight:u,maxScroll:s,minScroll:t}}const Z6={x:.2,y:.2};function ez(e,t,n,s,a){let{top:l,left:c,right:u,bottom:p}=n;s===void 0&&(s=10),a===void 0&&(a=Z6);const{isTop:m,isBottom:h,isLeft:g,isRight:y}=sC(e),b={x:0,y:0},E={x:0,y:0},j={height:t.height*a.y,width:t.width*a.x};return!m&&l<=t.top+j.height?(b.y=En.Backward,E.y=s*Math.abs((t.top+j.height-l)/j.height)):!h&&p>=t.bottom-j.height&&(b.y=En.Forward,E.y=s*Math.abs((t.bottom-j.height-p)/j.height)),!y&&u>=t.right-j.width?(b.x=En.Forward,E.x=s*Math.abs((t.right-j.width-u)/j.width)):!g&&c<=t.left+j.width&&(b.x=En.Backward,E.x=s*Math.abs((t.left+j.width-c)/j.width)),{direction:b,speed:E}}function tz(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:c}=window;return{top:0,left:0,right:l,bottom:c,width:l,height:c}}const{top:t,left:n,right:s,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:a,width:e.clientWidth,height:e.clientHeight}}function oC(e){return e.reduce((t,n)=>di(t,Bh(n)),Yr)}function nz(e){return e.reduce((t,n)=>t+tC(n),0)}function rz(e){return e.reduce((t,n)=>t+nC(n),0)}function sz(e,t){if(t===void 0&&(t=Pi),!e)return;const{top:n,left:s,bottom:a,right:l}=t(e);eC(e)&&(a<=0||l<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const oz=[["x",["left","right"],nz],["y",["top","bottom"],rz]];class $x{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const s=gf(n),a=oC(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,u]of oz)for(const p of c)Object.defineProperty(this,p,{get:()=>{const m=u(s),h=a[l]-m;return this.rect[p]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ml{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...n)})},this.target=t}add(t,n,s){var a;(a=this.target)==null||a.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function az(e){const{EventTarget:t}=lr(e);return e instanceof t?e:Ri(e)}function nh(e,t){const n=Math.abs(e.x),s=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+s**2)>t:"x"in t&&"y"in t?n>t.x&&s>t.y:"x"in t?n>t.x:"y"in t?s>t.y:!1}var Tr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Tr||(Tr={}));function Sj(e){e.preventDefault()}function iz(e){e.stopPropagation()}var ht;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(ht||(ht={}));const aC={start:[ht.Space,ht.Enter],cancel:[ht.Esc],end:[ht.Space,ht.Enter,ht.Tab]},lz=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ht.Right:return{...n,x:n.x+25};case ht.Left:return{...n,x:n.x-25};case ht.Down:return{...n,y:n.y+25};case ht.Up:return{...n,y:n.y-25}}};class xf{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ml(Ri(n)),this.windowListeners=new Ml(lr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Tr.Resize,this.handleCancel),this.windowListeners.add(Tr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Tr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&sz(s),n(Yr)}handleKeyDown(t){if(Dx(t)){const{active:n,context:s,options:a}=this.props,{keyboardCodes:l=aC,coordinateGetter:c=lz,scrollBehavior:u="smooth"}=a,{code:p}=t;if(l.end.includes(p)){this.handleEnd(t);return}if(l.cancel.includes(p)){this.handleCancel(t);return}const{collisionRect:m}=s.current,h=m?{x:m.left,y:m.top}:Yr;this.referenceCoordinates||(this.referenceCoordinates=h);const g=c(t,{active:n,context:s.current,currentCoordinates:h});if(g){const y=Zl(g,h),b={x:0,y:0},{scrollableAncestors:E}=s.current;for(const j of E){const w=t.code,{isTop:k,isRight:C,isLeft:N,isBottom:T,maxScroll:D,minScroll:R}=sC(j),$=tz(j),L={x:Math.min(w===ht.Right?$.right-$.width/2:$.right,Math.max(w===ht.Right?$.left:$.left+$.width/2,g.x)),y:Math.min(w===ht.Down?$.bottom-$.height/2:$.bottom,Math.max(w===ht.Down?$.top:$.top+$.height/2,g.y))},K=w===ht.Right&&!C||w===ht.Left&&!N,B=w===ht.Down&&!T||w===ht.Up&&!k;if(K&&L.x!==g.x){const O=j.scrollLeft+y.x,W=w===ht.Right&&O<=D.x||w===ht.Left&&O>=R.x;if(W&&!y.y){j.scrollTo({left:O,behavior:u});return}W?b.x=j.scrollLeft-O:b.x=w===ht.Right?j.scrollLeft-D.x:j.scrollLeft-R.x,b.x&&j.scrollBy({left:-b.x,behavior:u});break}else if(B&&L.y!==g.y){const O=j.scrollTop+y.y,W=w===ht.Down&&O<=D.y||w===ht.Up&&O>=R.y;if(W&&!y.x){j.scrollTo({top:O,behavior:u});return}W?b.y=j.scrollTop-O:b.y=w===ht.Down?j.scrollTop-D.y:j.scrollTop-R.y,b.y&&j.scrollBy({top:-b.y,behavior:u});break}}this.handleMove(t,di(Zl(g,this.referenceCoordinates),b))}}}handleMove(t,n){const{onMove:s}=this.props;t.preventDefault(),s(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}xf.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=aC,onActivation:a}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(s.start.includes(c)){const u=l.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function Nj(e){return!!(e&&"distance"in e)}function Cj(e){return!!(e&&"delay"in e)}class Lx{constructor(t,n,s){var a;s===void 0&&(s=az(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:c}=l;this.props=t,this.events=n,this.document=Ri(c),this.documentListeners=new Ml(this.document),this.listeners=new Ml(s),this.windowListeners=new Ml(lr(c)),this.initialCoordinates=(a=zh(l))!=null?a:Yr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:s}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Tr.Resize,this.handleCancel),this.windowListeners.add(Tr.DragStart,Sj),this.windowListeners.add(Tr.VisibilityChange,this.handleCancel),this.windowListeners.add(Tr.ContextMenu,Sj),this.documentListeners.add(Tr.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Cj(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Nj(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:s,onPending:a}=this.props;a(s,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Tr.Click,iz,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Tr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:a,props:l}=this,{onMove:c,options:{activationConstraint:u}}=l;if(!a)return;const p=(n=zh(t))!=null?n:Yr,m=Zl(a,p);if(!s&&u){if(Nj(u)){if(u.tolerance!=null&&nh(m,u.tolerance))return this.handleCancel();if(nh(m,u.distance))return this.handleStart()}if(Cj(u)&&nh(m,u.tolerance))return this.handleCancel();this.handlePending(u,m);return}t.cancelable&&t.preventDefault(),c(p)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===ht.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const cz={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class yf extends Lx{constructor(t){const{event:n}=t,s=Ri(n.target);super(t,cz,s)}}yf.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return!n.isPrimary||n.button!==0?!1:(s==null||s({event:n}),!0)}}];const uz={move:{name:"mousemove"},end:{name:"mouseup"}};var Uh;(function(e){e[e.RightClick=2]="RightClick"})(Uh||(Uh={}));class dz extends Lx{constructor(t){super(t,uz,Ri(t.event.target))}}dz.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===Uh.RightClick?!1:(s==null||s({event:n}),!0)}}];const rh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class fz extends Lx{constructor(t){super(t,rh)}static setup(){return window.addEventListener(rh.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(rh.move.name,t)};function t(){}}}fz.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;const{touches:a}=n;return a.length>1?!1:(s==null||s({event:n}),!0)}}];var _l;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(_l||(_l={}));var Sd;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Sd||(Sd={}));function pz(e){let{acceleration:t,activator:n=_l.Pointer,canScroll:s,draggingRect:a,enabled:l,interval:c=5,order:u=Sd.TreeOrder,pointerCoordinates:p,scrollableAncestors:m,scrollableAncestorRects:h,delta:g,threshold:y}=e;const b=hz({delta:g,disabled:!l}),[E,j]=E6(),w=f.useRef({x:0,y:0}),k=f.useRef({x:0,y:0}),C=f.useMemo(()=>{switch(n){case _l.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case _l.DraggableRect:return a}},[n,a,p]),N=f.useRef(null),T=f.useCallback(()=>{const R=N.current;if(!R)return;const $=w.current.x*k.current.x,L=w.current.y*k.current.y;R.scrollBy($,L)},[]),D=f.useMemo(()=>u===Sd.TreeOrder?[...m].reverse():m,[u,m]);f.useEffect(()=>{if(!l||!m.length||!C){j();return}for(const R of D){if((s==null?void 0:s(R))===!1)continue;const $=m.indexOf(R),L=h[$];if(!L)continue;const{direction:K,speed:B}=ez(R,L,C,t,y);for(const O of["x","y"])b[O][K[O]]||(B[O]=0,K[O]=0);if(B.x>0||B.y>0){j(),N.current=R,E(T,c),w.current=B,k.current=K;return}}w.current={x:0,y:0},k.current={x:0,y:0},j()},[t,T,s,j,l,c,JSON.stringify(C),JSON.stringify(b),E,m,D,h,JSON.stringify(y)])}const mz={x:{[En.Backward]:!1,[En.Forward]:!1},y:{[En.Backward]:!1,[En.Forward]:!1}};function hz(e){let{delta:t,disabled:n}=e;const s=Fh(t);return hc(a=>{if(n||!s||!a)return mz;const l={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[En.Backward]:a.x[En.Backward]||l.x===-1,[En.Forward]:a.x[En.Forward]||l.x===1},y:{[En.Backward]:a.y[En.Backward]||l.y===-1,[En.Forward]:a.y[En.Forward]||l.y===1}}},[n,t,s])}function gz(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return hc(a=>{var l;return t==null?null:(l=s??a)!=null?l:null},[s,t])}function xz(e,t){return f.useMemo(()=>e.reduce((n,s)=>{const{sensor:a}=s,l=a.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,s)}));return[...n,...l]},[]),[e,t])}var ec;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ec||(ec={}));var Vh;(function(e){e.Optimized="optimized"})(Vh||(Vh={}));const Ej=new Map;function yz(e,t){let{dragging:n,dependencies:s,config:a}=t;const[l,c]=f.useState(null),{frequency:u,measure:p,strategy:m}=a,h=f.useRef(e),g=w(),y=Ql(g),b=f.useCallback(function(k){k===void 0&&(k=[]),!y.current&&c(C=>C===null?k:C.concat(k.filter(N=>!C.includes(N))))},[y]),E=f.useRef(null),j=hc(k=>{if(g&&!n)return Ej;if(!k||k===Ej||h.current!==e||l!=null){const C=new Map;for(let N of e){if(!N)continue;if(l&&l.length>0&&!l.includes(N.id)&&N.rect.current){C.set(N.id,N.rect.current);continue}const T=N.node.current,D=T?new $x(p(T),T):null;N.rect.current=D,D&&C.set(N.id,D)}return C}return k},[e,l,n,g,p]);return f.useEffect(()=>{h.current=e},[e]),f.useEffect(()=>{g||b()},[n,g]),f.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),f.useEffect(()=>{g||typeof u!="number"||E.current!==null||(E.current=setTimeout(()=>{b(),E.current=null},u))},[u,g,b,...s]),{droppableRects:j,measureDroppableContainers:b,measuringScheduled:l!=null};function w(){switch(m){case ec.Always:return!1;case ec.BeforeDragging:return n;default:return!n}}}function iC(e,t){return hc(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function bz(e,t){return iC(e,t)}function vz(e){let{callback:t,disabled:n}=e;const s=Ax(t),a=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(s)},[s,n]);return f.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function bf(e){let{callback:t,disabled:n}=e;const s=Ax(t),a=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(s)},[n]);return f.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function wz(e){return new $x(Pi(e),e)}function Tj(e,t,n){t===void 0&&(t=wz);const[s,a]=f.useState(null);function l(){a(p=>{if(!e)return null;if(e.isConnected===!1){var m;return(m=p??n)!=null?m:null}const h=t(e);return JSON.stringify(p)===JSON.stringify(h)?p:h})}const c=vz({callback(p){if(e)for(const m of p){const{type:h,target:g}=m;if(h==="childList"&&g instanceof HTMLElement&&g.contains(e)){l();break}}}}),u=bf({callback:l});return ms(()=>{l(),e?(u==null||u.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),c==null||c.disconnect())},[e]),s}function jz(e){const t=iC(e);return ZN(e,t)}const Rj=[];function kz(e){const t=f.useRef(e),n=hc(s=>e?s&&s!==Rj&&e&&t.current&&e.parentNode===t.current.parentNode?s:gf(e):Rj,[e]);return f.useEffect(()=>{t.current=e},[e]),n}function Sz(e){const[t,n]=f.useState(null),s=f.useRef(e),a=f.useCallback(l=>{const c=th(l.target);c&&n(u=>u?(u.set(c,Bh(c)),new Map(u)):null)},[]);return f.useEffect(()=>{const l=s.current;if(e!==l){c(l);const u=e.map(p=>{const m=th(p);return m?(m.addEventListener("scroll",a,{passive:!0}),[m,Bh(m)]):null}).filter(p=>p!=null);n(u.length?new Map(u):null),s.current=e}return()=>{c(e),c(l)};function c(u){u.forEach(p=>{const m=th(p);m==null||m.removeEventListener("scroll",a)})}},[a,e]),f.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>di(l,c),Yr):oC(e):Yr,[e,t])}function Pj(e,t){t===void 0&&(t=[]);const n=f.useRef(null);return f.useEffect(()=>{n.current=null},t),f.useEffect(()=>{const s=e!==Yr;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?Zl(e,n.current):Yr}function Nz(e){f.useEffect(()=>{if(!hf)return;const t=e.map(n=>{let{sensor:s}=n;return s.setup==null?void 0:s.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Cz(e,t){return f.useMemo(()=>e.reduce((n,s)=>{let{eventName:a,handler:l}=s;return n[a]=c=>{l(c,t)},n},{}),[e,t])}function lC(e){return f.useMemo(()=>e?J6(e):null,[e])}const Aj=[];function Ez(e,t){t===void 0&&(t=Pi);const[n]=e,s=lC(n?lr(n):null),[a,l]=f.useState(Aj);function c(){l(()=>e.length?e.map(p=>rC(p)?s:new $x(t(p),p)):Aj)}const u=bf({callback:c});return ms(()=>{u==null||u.disconnect(),c(),e.forEach(p=>u==null?void 0:u.observe(p))},[e]),a}function Tz(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return mc(t)?t:e}function Rz(e){let{measure:t}=e;const[n,s]=f.useState(null),a=f.useCallback(m=>{for(const{target:h}of m)if(mc(h)){s(g=>{const y=t(h);return g?{...g,width:y.width,height:y.height}:y});break}},[t]),l=bf({callback:a}),c=f.useCallback(m=>{const h=Tz(m);l==null||l.disconnect(),h&&(l==null||l.observe(h)),s(h?t(h):null)},[t,l]),[u,p]=wd(c);return f.useMemo(()=>({nodeRef:u,rect:n,setRef:p}),[n,u,p])}const Pz=[{sensor:yf,options:{}},{sensor:xf,options:{}}],Az={current:{}},Qu={draggable:{measure:kj},droppable:{measure:kj,strategy:ec.WhileDragging,frequency:Vh.Optimized},dragOverlay:{measure:Pi}};class Fl extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,s;return(n=(s=this.get(t))==null?void 0:s.node.current)!=null?n:void 0}}const Dz={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Fl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:jd},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Qu,measureDroppableContainers:jd,windowRect:null,measuringScheduled:!1},$z={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:jd,draggableNodes:new Map,over:null,measureDroppableContainers:jd},vf=f.createContext($z),cC=f.createContext(Dz);function Lz(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Fl}}}function Oz(e,t){switch(t.type){case bn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case bn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case bn.DragEnd:case bn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case bn.RegisterDroppable:{const{element:n}=t,{id:s}=n,a=new Fl(e.droppable.containers);return a.set(s,n),{...e,droppable:{...e.droppable,containers:a}}}case bn.SetDroppableDisabled:{const{id:n,key:s,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||s!==l.key)return e;const c=new Fl(e.droppable.containers);return c.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:c}}}case bn.UnregisterDroppable:{const{id:n,key:s}=t,a=e.droppable.containers.get(n);if(!a||s!==a.key)return e;const l=new Fl(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Iz(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:a}=f.useContext(vf),l=Fh(s),c=Fh(n==null?void 0:n.id);return f.useEffect(()=>{if(!t&&!s&&l&&c!=null){if(!Dx(l)||document.activeElement===l.target)return;const u=a.get(c);if(!u)return;const{activatorNode:p,node:m}=u;if(!p.current&&!m.current)return;requestAnimationFrame(()=>{for(const h of[p.current,m.current]){if(!h)continue;const g=P6(h);if(g){g.focus();break}}})}},[s,t,a,c,l]),null}function Mz(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...s}),n):n}function _z(e){return f.useMemo(()=>({draggable:{...Qu.draggable,...e==null?void 0:e.draggable},droppable:{...Qu.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Qu.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Fz(e){let{activeNode:t,measure:n,initialRect:s,config:a=!0}=e;const l=f.useRef(!1),{x:c,y:u}=typeof a=="boolean"?{x:a,y:a}:a;ms(()=>{if(!c&&!u||!t){l.current=!1;return}if(l.current||!s)return;const m=t==null?void 0:t.node.current;if(!m||m.isConnected===!1)return;const h=n(m),g=ZN(h,s);if(c||(g.x=0),u||(g.y=0),l.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const y=eC(m);y&&y.scrollBy({top:g.y,left:g.x})}},[t,c,u,s,n])}const uC=f.createContext({...Yr,scaleX:1,scaleY:1});var so;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(so||(so={}));const dC=f.memo(function(t){var n,s,a,l;let{id:c,accessibility:u,autoScroll:p=!0,children:m,sensors:h=Pz,collisionDetection:g=V6,measuring:y,modifiers:b,...E}=t;const j=f.useReducer(Oz,void 0,Lz),[w,k]=j,[C,N]=I6(),[T,D]=f.useState(so.Uninitialized),R=T===so.Initialized,{draggable:{active:$,nodes:L,translate:K},droppable:{containers:B}}=w,O=$!=null?L.get($):null,W=f.useRef({initial:null,translated:null}),se=f.useMemo(()=>{var Be;return $!=null?{id:$,data:(Be=O==null?void 0:O.data)!=null?Be:Az,rect:W}:null},[$,O]),z=f.useRef(null),[H,ee]=f.useState(null),[ne,M]=f.useState(null),G=Ql(E,Object.values(E)),A=gc("DndDescribedBy",c),F=f.useMemo(()=>B.getEnabled(),[B]),Z=_z(y),{droppableRects:I,measureDroppableContainers:de,measuringScheduled:ge}=yz(F,{dragging:R,dependencies:[K.x,K.y],config:Z.droppable}),V=gz(L,$),ae=f.useMemo(()=>ne?zh(ne):null,[ne]),me=ue(),ve=bz(V,Z.draggable.measure);Fz({activeNode:$!=null?L.get($):null,config:me.layoutShiftCompensation,initialRect:ve,measure:Z.draggable.measure});const ke=Tj(V,Z.draggable.measure,ve),he=Tj(V?V.parentElement:null),Je=f.useRef({activatorEvent:null,active:null,activeNode:V,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ye=B.getNodeFor((n=Je.current.over)==null?void 0:n.id),ot=Rz({measure:Z.dragOverlay.measure}),J=(s=ot.nodeRef.current)!=null?s:V,Ie=R?(a=ot.rect)!=null?a:ke:null,Ne=!!(ot.nodeRef.current&&ot.rect),Oe=jz(Ne?null:ke),Xe=lC(J?lr(J):null),Me=kz(R?Ye??V:null),nt=Ez(Me),Ke=Mz(b,{transform:{x:K.x-Oe.x,y:K.y-Oe.y,scaleX:1,scaleY:1},activatorEvent:ne,active:se,activeNodeRect:ke,containerNodeRect:he,draggingNodeRect:Ie,over:Je.current.over,overlayNodeRect:ot.rect,scrollableAncestors:Me,scrollableAncestorRects:nt,windowRect:Xe}),gt=ae?di(ae,K):null,Rt=Sz(Me),at=Pj(Rt),ie=Pj(Rt,[ke]),Y=di(Ke,at),pe=Ie?K6(Ie,Ke):null,Q=se&&pe?g({active:se,collisionRect:pe,droppableRects:I,droppableContainers:F,pointerCoordinates:gt}):null,ye=XN(Q,"id"),[Pe,lt]=f.useState(null),te=Ne?Ke:di(Ke,ie),be=H6(te,(l=Pe==null?void 0:Pe.rect)!=null?l:null,ke),Le=f.useRef(null),it=f.useCallback((Be,Fe)=>{let{sensor:Nt,options:$n}=Fe;if(z.current==null)return;const Yt=L.get(z.current);if(!Yt)return;const sn=Be.nativeEvent,Wt=new Nt({active:z.current,activeNode:Yt,event:sn,options:$n,context:Je,onAbort(xt){if(!L.get(xt))return;const{onDragAbort:Pt}=G.current,re={id:xt};Pt==null||Pt(re),C({type:"onDragAbort",event:re})},onPending(xt,jn,Pt,re){if(!L.get(xt))return;const{onDragPending:Qe}=G.current,Ft={id:xt,constraint:jn,initialCoordinates:Pt,offset:re};Qe==null||Qe(Ft),C({type:"onDragPending",event:Ft})},onStart(xt){const jn=z.current;if(jn==null)return;const Pt=L.get(jn);if(!Pt)return;const{onDragStart:re}=G.current,Ae={activatorEvent:sn,active:{id:jn,data:Pt.data,rect:W}};Rs.unstable_batchedUpdates(()=>{re==null||re(Ae),D(so.Initializing),k({type:bn.DragStart,initialCoordinates:xt,active:jn}),C({type:"onDragStart",event:Ae}),ee(Le.current),M(sn)})},onMove(xt){k({type:bn.DragMove,coordinates:xt})},onEnd:Gn(bn.DragEnd),onCancel:Gn(bn.DragCancel)});Le.current=Wt;function Gn(xt){return async function(){const{active:Pt,collisions:re,over:Ae,scrollAdjustedTranslate:Qe}=Je.current;let Ft=null;if(Pt&&Qe){const{cancelDrop:hn}=G.current;Ft={activatorEvent:sn,active:Pt,collisions:re,delta:Qe,over:Ae},xt===bn.DragEnd&&typeof hn=="function"&&await Promise.resolve(hn(Ft))&&(xt=bn.DragCancel)}z.current=null,Rs.unstable_batchedUpdates(()=>{k({type:xt}),D(so.Uninitialized),lt(null),ee(null),M(null),Le.current=null;const hn=xt===bn.DragEnd?"onDragEnd":"onDragCancel";if(Ft){const Ct=G.current[hn];Ct==null||Ct(Ft),C({type:hn,event:Ft})}})}}},[L]),_e=f.useCallback((Be,Fe)=>(Nt,$n)=>{const Yt=Nt.nativeEvent,sn=L.get($n);if(z.current!==null||!sn||Yt.dndKit||Yt.defaultPrevented)return;const Wt={active:sn};Be(Nt,Fe.options,Wt)===!0&&(Yt.dndKit={capturedBy:Fe.sensor},z.current=$n,it(Nt,Fe))},[L,it]),bt=xz(h,_e);Nz(h),ms(()=>{ke&&T===so.Initializing&&D(so.Initialized)},[ke,T]),f.useEffect(()=>{const{onDragMove:Be}=G.current,{active:Fe,activatorEvent:Nt,collisions:$n,over:Yt}=Je.current;if(!Fe||!Nt)return;const sn={active:Fe,activatorEvent:Nt,collisions:$n,delta:{x:Y.x,y:Y.y},over:Yt};Rs.unstable_batchedUpdates(()=>{Be==null||Be(sn),C({type:"onDragMove",event:sn})})},[Y.x,Y.y]),f.useEffect(()=>{const{active:Be,activatorEvent:Fe,collisions:Nt,droppableContainers:$n,scrollAdjustedTranslate:Yt}=Je.current;if(!Be||z.current==null||!Fe||!Yt)return;const{onDragOver:sn}=G.current,Wt=$n.get(ye),Gn=Wt&&Wt.rect.current?{id:Wt.id,rect:Wt.rect.current,data:Wt.data,disabled:Wt.disabled}:null,xt={active:Be,activatorEvent:Fe,collisions:Nt,delta:{x:Yt.x,y:Yt.y},over:Gn};Rs.unstable_batchedUpdates(()=>{lt(Gn),sn==null||sn(xt),C({type:"onDragOver",event:xt})})},[ye]),ms(()=>{Je.current={activatorEvent:ne,active:se,activeNode:V,collisionRect:pe,collisions:Q,droppableRects:I,draggableNodes:L,draggingNode:J,draggingNodeRect:Ie,droppableContainers:B,over:Pe,scrollableAncestors:Me,scrollAdjustedTranslate:Y},W.current={initial:Ie,translated:pe}},[se,V,Q,pe,L,J,Ie,I,B,Pe,Me,Y]),pz({...me,delta:K,draggingRect:pe,pointerCoordinates:gt,scrollableAncestors:Me,scrollableAncestorRects:nt});const _t=f.useMemo(()=>({active:se,activeNode:V,activeNodeRect:ke,activatorEvent:ne,collisions:Q,containerNodeRect:he,dragOverlay:ot,draggableNodes:L,droppableContainers:B,droppableRects:I,over:Pe,measureDroppableContainers:de,scrollableAncestors:Me,scrollableAncestorRects:nt,measuringConfiguration:Z,measuringScheduled:ge,windowRect:Xe}),[se,V,ke,ne,Q,he,ot,L,B,I,Pe,de,Me,nt,Z,ge,Xe]),Gt=f.useMemo(()=>({activatorEvent:ne,activators:bt,active:se,activeNodeRect:ke,ariaDescribedById:{draggable:A},dispatch:k,draggableNodes:L,over:Pe,measureDroppableContainers:de}),[ne,bt,se,ke,k,A,L,Pe,de]);return nn.createElement(qN.Provider,{value:N},nn.createElement(vf.Provider,{value:Gt},nn.createElement(cC.Provider,{value:_t},nn.createElement(uC.Provider,{value:be},m)),nn.createElement(Iz,{disabled:(u==null?void 0:u.restoreFocus)===!1})),nn.createElement(F6,{...u,hiddenTextDescribedById:A}));function ue(){const Be=(H==null?void 0:H.autoScrollEnabled)===!1,Fe=typeof p=="object"?p.enabled===!1:p===!1,Nt=R&&!Be&&!Fe;return typeof p=="object"?{...p,enabled:Nt}:{enabled:Nt}}}),zz=f.createContext(null),Dj="button",Bz="Draggable";function Uz(e){let{id:t,data:n,disabled:s=!1,attributes:a}=e;const l=gc(Bz),{activators:c,activatorEvent:u,active:p,activeNodeRect:m,ariaDescribedById:h,draggableNodes:g,over:y}=f.useContext(vf),{role:b=Dj,roleDescription:E="draggable",tabIndex:j=0}=a??{},w=(p==null?void 0:p.id)===t,k=f.useContext(w?uC:zz),[C,N]=wd(),[T,D]=wd(),R=Cz(c,t),$=Ql(n);ms(()=>(g.set(t,{id:t,key:l,node:C,activatorNode:T,data:$}),()=>{const K=g.get(t);K&&K.key===l&&g.delete(t)}),[g,t]);const L=f.useMemo(()=>({role:b,tabIndex:j,"aria-disabled":s,"aria-pressed":w&&b===Dj?!0:void 0,"aria-roledescription":E,"aria-describedby":h.draggable}),[s,b,j,w,E,h.draggable]);return{active:p,activatorEvent:u,activeNodeRect:m,attributes:L,isDragging:w,listeners:s?void 0:R,node:C,over:y,setNodeRef:N,setActivatorNodeRef:D,transform:k}}function Vz(){return f.useContext(cC)}const Hz="Droppable",Wz={timeout:25};function Kz(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:a}=e;const l=gc(Hz),{active:c,dispatch:u,over:p,measureDroppableContainers:m}=f.useContext(vf),h=f.useRef({disabled:n}),g=f.useRef(!1),y=f.useRef(null),b=f.useRef(null),{disabled:E,updateMeasurementsFor:j,timeout:w}={...Wz,...a},k=Ql(j??s),C=f.useCallback(()=>{if(!g.current){g.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{m(Array.isArray(k.current)?k.current:[k.current]),b.current=null},w)},[w]),N=bf({callback:C,disabled:E||!c}),T=f.useCallback((L,K)=>{N&&(K&&(N.unobserve(K),g.current=!1),L&&N.observe(L))},[N]),[D,R]=wd(T),$=Ql(t);return f.useEffect(()=>{!N||!D.current||(N.disconnect(),g.current=!1,N.observe(D.current))},[D,N]),f.useEffect(()=>(u({type:bn.RegisterDroppable,element:{id:s,key:l,disabled:n,node:D,rect:y,data:$}}),()=>u({type:bn.UnregisterDroppable,key:l,id:s})),[s]),f.useEffect(()=>{n!==h.current.disabled&&(u({type:bn.SetDroppableDisabled,id:s,key:l,disabled:n}),h.current.disabled=n)},[s,l,n,u]),{active:c,rect:y,isOver:(p==null?void 0:p.id)===s,node:D,over:p,setNodeRef:R}}function wf(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function qz(e,t){return e.reduce((n,s,a)=>{const l=t.get(s);return l&&(n[a]=l),n},Array(e.length))}function Iu(e){return e!==null&&e>=0}function Gz(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Yz(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const fC=e=>{let{rects:t,activeIndex:n,overIndex:s,index:a}=e;const l=wf(t,s,n),c=t[a],u=l[a];return!u||!c?null:{x:u.left-c.left,y:u.top-c.top,scaleX:u.width/c.width,scaleY:u.height/c.height}},Mu={scaleX:1,scaleY:1},pC=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:a,rects:l,overIndex:c}=e;const u=(t=l[n])!=null?t:s;if(!u)return null;if(a===n){const m=l[c];return m?{x:0,y:n<c?m.top+m.height-(u.top+u.height):m.top-u.top,...Mu}:null}const p=Jz(l,a,n);return a>n&&a<=c?{x:0,y:-u.height-p,...Mu}:a<n&&a>=c?{x:0,y:u.height+p,...Mu}:{x:0,y:0,...Mu}};function Jz(e,t,n){const s=e[t],a=e[t-1],l=e[t+1];return s?n<t?a?s.top-(a.top+a.height):l?l.top-(s.top+s.height):0:l?l.top-(s.top+s.height):a?s.top-(a.top+a.height):0:0}const mC="Sortable",hC=nn.createContext({activeIndex:-1,containerId:mC,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:fC,disabled:{draggable:!1,droppable:!1}});function gC(e){let{children:t,id:n,items:s,strategy:a=fC,disabled:l=!1}=e;const{active:c,dragOverlay:u,droppableRects:p,over:m,measureDroppableContainers:h}=Vz(),g=gc(mC,n),y=u.rect!==null,b=f.useMemo(()=>s.map(R=>typeof R=="object"&&"id"in R?R.id:R),[s]),E=c!=null,j=c?b.indexOf(c.id):-1,w=m?b.indexOf(m.id):-1,k=f.useRef(b),C=!Gz(b,k.current),N=w!==-1&&j===-1||C,T=Yz(l);ms(()=>{C&&E&&h(b)},[C,b,E,h]),f.useEffect(()=>{k.current=b},[b]);const D=f.useMemo(()=>({activeIndex:j,containerId:g,disabled:T,disableTransforms:N,items:b,overIndex:w,useDragOverlay:y,sortedRects:qz(b,p),strategy:a}),[j,g,T.draggable,T.droppable,N,b,w,p,y,a]);return nn.createElement(hC.Provider,{value:D},t)}const Xz=e=>{let{id:t,items:n,activeIndex:s,overIndex:a}=e;return wf(n,s,a).indexOf(t)},Qz=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:a,items:l,newIndex:c,previousItems:u,previousContainerId:p,transition:m}=e;return!m||!s||u!==l&&a===c?!1:n?!0:c!==a&&t===p},Zz={duration:200,easing:"ease"},xC="transform",eB=hi.Transition.toString({property:xC,duration:0,easing:"linear"}),tB={roleDescription:"sortable"};function nB(e){let{disabled:t,index:n,node:s,rect:a}=e;const[l,c]=f.useState(null),u=f.useRef(n);return ms(()=>{if(!t&&n!==u.current&&s.current){const p=a.current;if(p){const m=Pi(s.current,{ignoreTransform:!0}),h={x:p.left-m.left,y:p.top-m.top,scaleX:p.width/m.width,scaleY:p.height/m.height};(h.x||h.y)&&c(h)}}n!==u.current&&(u.current=n)},[t,n,s,a]),f.useEffect(()=>{l&&c(null)},[l]),l}function yC(e){let{animateLayoutChanges:t=Qz,attributes:n,disabled:s,data:a,getNewIndex:l=Xz,id:c,strategy:u,resizeObserverConfig:p,transition:m=Zz}=e;const{items:h,containerId:g,activeIndex:y,disabled:b,disableTransforms:E,sortedRects:j,overIndex:w,useDragOverlay:k,strategy:C}=f.useContext(hC),N=rB(s,b),T=h.indexOf(c),D=f.useMemo(()=>({sortable:{containerId:g,index:T,items:h},...a}),[g,a,T,h]),R=f.useMemo(()=>h.slice(h.indexOf(c)),[h,c]),{rect:$,node:L,isOver:K,setNodeRef:B}=Kz({id:c,data:D,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:R,...p}}),{active:O,activatorEvent:W,activeNodeRect:se,attributes:z,setNodeRef:H,listeners:ee,isDragging:ne,over:M,setActivatorNodeRef:G,transform:A}=Uz({id:c,data:D,attributes:{...tB,...n},disabled:N.draggable}),F=C6(B,H),Z=!!O,I=Z&&!E&&Iu(y)&&Iu(w),de=!k&&ne,ge=de&&I?A:null,ae=I?ge??(u??C)({rects:j,activeNodeRect:se,activeIndex:y,overIndex:w,index:T}):null,me=Iu(y)&&Iu(w)?l({id:c,items:h,activeIndex:y,overIndex:w}):T,ve=O==null?void 0:O.id,ke=f.useRef({activeId:ve,items:h,newIndex:me,containerId:g}),he=h!==ke.current.items,Je=t({active:O,containerId:g,isDragging:ne,isSorting:Z,id:c,index:T,items:h,newIndex:ke.current.newIndex,previousItems:ke.current.items,previousContainerId:ke.current.containerId,transition:m,wasDragging:ke.current.activeId!=null}),Ye=nB({disabled:!Je,index:T,node:L,rect:$});return f.useEffect(()=>{Z&&ke.current.newIndex!==me&&(ke.current.newIndex=me),g!==ke.current.containerId&&(ke.current.containerId=g),h!==ke.current.items&&(ke.current.items=h)},[Z,me,g,h]),f.useEffect(()=>{if(ve===ke.current.activeId)return;if(ve!=null&&ke.current.activeId==null){ke.current.activeId=ve;return}const J=setTimeout(()=>{ke.current.activeId=ve},50);return()=>clearTimeout(J)},[ve]),{active:O,activeIndex:y,attributes:z,data:D,rect:$,index:T,newIndex:me,items:h,isOver:K,isSorting:Z,isDragging:ne,listeners:ee,node:L,overIndex:w,over:M,setNodeRef:F,setActivatorNodeRef:G,setDroppableNodeRef:B,setDraggableNodeRef:H,transform:Ye??ae,transition:ot()};function ot(){if(Ye||he&&ke.current.newIndex===T)return eB;if(!(de&&!Dx(W)||!m)&&(Z||Je))return hi.Transition.toString({...m,property:xC})}}function rB(e,t){var n,s;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(s=e==null?void 0:e.droppable)!=null?s:t.droppable}}function Nd(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const sB=[ht.Down,ht.Right,ht.Up,ht.Left],oB=(e,t)=>{let{context:{active:n,collisionRect:s,droppableRects:a,droppableContainers:l,over:c,scrollableAncestors:u}}=t;if(sB.includes(e.code)){if(e.preventDefault(),!n||!s)return;const p=[];l.getEnabled().forEach(g=>{if(!g||g!=null&&g.disabled)return;const y=a.get(g.id);if(y)switch(e.code){case ht.Down:s.top<y.top&&p.push(g);break;case ht.Up:s.top>y.top&&p.push(g);break;case ht.Left:s.left>y.left&&p.push(g);break;case ht.Right:s.left<y.left&&p.push(g);break}});const m=B6({collisionRect:s,droppableRects:a,droppableContainers:p});let h=XN(m,"id");if(h===(c==null?void 0:c.id)&&m.length>1&&(h=m[1].id),h!=null){const g=l.get(n.id),y=l.get(h),b=y?a.get(y.id):null,E=y==null?void 0:y.node.current;if(E&&b&&g&&y){const w=gf(E).some((R,$)=>u[$]!==R),k=bC(g,y),C=aB(g,y),N=w||!k?{x:0,y:0}:{x:C?s.width-b.width:0,y:C?s.height-b.height:0},T={x:b.left,y:b.top};return N.x&&N.y?T:Zl(T,N)}}}};function bC(e,t){return!Nd(e)||!Nd(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function aB(e,t){return!Nd(e)||!Nd(t)||!bC(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function iB({value:e,onChange:t,ariaLabel:n}){const s=n??"Pick a color",a=n?`${n} (hex)`:"Color hex value";return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"color",value:e||"#64748b",onChange:l=>t(l.target.value),className:"h-7 w-7 shrink-0 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5",title:"Pick a color","aria-label":s}),r.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value),placeholder:"#64748b",className:"editor-input w-[5.5rem] font-mono text-xs","aria-label":a})]})}const Hh=["projects","playbooks","todos","servers","config"];function lB(e){const t=new Set;for(const n of e.split(",").map(s=>s.trim()))Hh.includes(n)&&t.add(n);return t}function $j(e){if(!e)return"never";try{return new Date(e).toLocaleString()}catch{return e}}function cB(){const[e,t]=f.useState(!0),[n,s]=f.useState(null),[a,l]=f.useState(""),[c,u]=f.useState(new Set(Hh)),[p,m]=f.useState(!1),[h,g]=f.useState(!1),[y,b]=f.useState(null),[E,j]=f.useState(null),w=f.useCallback(async()=>{try{const R=await fetch("/api/backup");if(!R.ok)throw new Error(`HTTP ${R.status}`);const $=await R.json();s($),l($.repo??""),u(lB($.categories)),m(!1)}catch(R){j({type:"error",message:`Failed to load backup config: ${R instanceof Error?R.message:String(R)}`})}finally{t(!1)}},[]);f.useEffect(()=>{w()},[w]);function k(R){u($=>{const L=new Set($);return L.has(R)?L.delete(R):L.add(R),L}),m(!0)}async function C(){g(!0),j(null);try{const R=Array.from(c),$=await fetch("/api/backup/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:a.trim()||null,categories:R})}),L=await $.json();if(!$.ok)throw new Error(L.error||`HTTP ${$.status}`);s(L),m(!1),j({type:"success",message:"Backup configuration saved."})}catch(R){j({type:"error",message:`Save failed: ${R instanceof Error?R.message:String(R)}`})}finally{g(!1)}}async function N(){b("push"),j(null);try{const R=await fetch("/api/backup/push",{method:"POST"}),$=await R.json();if(!R.ok||$.success===!1)throw new Error($.error||$.message||`HTTP ${R.status}`);j({type:"success",message:$.message||"Backup complete."}),await w()}catch(R){j({type:"error",message:`Backup failed: ${R instanceof Error?R.message:String(R)}`})}finally{b(null)}}async function T(){if(window.confirm("Restore will overwrite local files for the selected categories with the contents of the GitHub repo. This cannot be undone. Continue?")){b("pull"),j(null);try{const $=await fetch("/api/backup/pull",{method:"POST"}),L=await $.json();if(!$.ok||L.success===!1)throw new Error(L.error||L.message||`HTTP ${$.status}`);j({type:"success",message:L.message||"Restore complete."}),await w()}catch($){j({type:"error",message:`Restore failed: ${$ instanceof Error?$.message:String($)}`})}finally{b(null)}}}if(e)return r.jsx(We,{title:"GitHub Backup",description:"Back up Syntaur files to a GitHub repository",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})});const D=!!a.trim()&&c.size>0&&!y&&!p;return r.jsx(We,{title:"GitHub Backup",description:"Back up Syntaur files to a GitHub repository and restore from it",children:r.jsxs("div",{className:"space-y-4",children:[E&&r.jsx("div",{className:`rounded-lg border px-4 py-2 text-sm ${E.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:E.message}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Repository URL"}),r.jsx("input",{type:"text",value:a,onChange:R=>{l(R.target.value),m(!0)},placeholder:"git@github.com:you/syntaur-backup.git",className:"editor-input w-full text-sm"}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["SSH or HTTPS URL. Requires ",r.jsx("code",{className:"rounded bg-muted px-1",children:"git"})," installed and credentials configured locally."]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Categories to back up"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:Hh.map(R=>{const $=c.has(R);return r.jsxs("button",{type:"button",onClick:()=>k(R),className:`shell-action text-xs ${$?"bg-primary/10 text-primary hover:bg-primary/20":"bg-muted/30 text-muted-foreground hover:bg-muted/60"}`,children:[r.jsx("span",{className:`mr-1 inline-block h-2 w-2 rounded-full ${$?"bg-primary":"bg-muted-foreground/40"}`}),R]},R)})})]}),r.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs text-muted-foreground sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-foreground",children:"Last backup: "}),$j((n==null?void 0:n.lastBackup)??null)]}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-foreground",children:"Last restore: "}),$j((n==null?void 0:n.lastRestore)??null)]}),(n==null?void 0:n.locked)&&r.jsx("div",{className:"sm:col-span-2 text-warning-foreground",children:"⚠ A backup operation is in progress or the lock file is stale."})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[r.jsxs("button",{className:"shell-action bg-primary/10 text-primary hover:bg-primary/20",onClick:C,disabled:h||!p,children:[r.jsx(Id,{className:"h-3.5 w-3.5"}),h?"Saving...":"Save Config"]}),r.jsxs("button",{className:"shell-action",onClick:N,disabled:!D,title:D?"Back up now":p?"Save config first":"Set repo and pick categories",children:[r.jsx(AR,{className:"h-3.5 w-3.5"}),y==="push"?"Backing up...":"Back Up Now"]}),r.jsxs("button",{className:"shell-action",onClick:T,disabled:!D,title:D?"Restore from backup":p?"Save config first":"Set repo and pick categories",children:[r.jsx(iR,{className:"h-3.5 w-3.5"}),y==="pull"?"Restoring...":"Restore"]}),p&&r.jsx("span",{className:"text-xs text-muted-foreground",children:"Unsaved changes"})]}),r.jsxs("p",{className:"flex items-start gap-2 rounded-md border border-border/40 bg-muted/20 p-3 text-xs text-muted-foreground",children:[r.jsx(oR,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),r.jsxs("span",{children:["Restore never overwrites ",r.jsx("code",{className:"rounded bg-muted px-1",children:"config.md"})," (would clobber backup settings). The agent sessions database is not backed up — only markdown files."]})]})]})})}function uB({open:e,affected:t,remaining:n,onResolve:s,onCancel:a}){var j;const[l,c]=f.useState(n.length>0?"remap":"delete"),[u,p]=f.useState(((j=n[0])==null?void 0:j.id)??""),[m,h]=f.useState(!1);f.useEffect(()=>{var w;e&&(c(n.length>0?"remap":"delete"),p(((w=n[0])==null?void 0:w.id)??""),h(!1))},[e,n]);const g=l==="remap"&&n.length>0&&u!==""&&u!==t.id||l==="delete"&&m;function y(){g&&s(l==="remap"?{id:t.id,mode:"remap",target:u}:{id:t.id,mode:"delete"})}const b=t.assignments.slice(0,10),E=t.count-b.length;return r.jsx(ar,{open:e,onOpenChange:w=>w?void 0:a(),children:r.jsxs(Kn,{className:"max-w-xl",children:[r.jsxs(Zr,{children:[r.jsxs(qn,{children:['Delete status "',t.label,'" — ',t.count," assignment",t.count===1?"":"s"," reference it"]}),r.jsx(gs,{children:"Choose how to resolve the affected assignments before this status is removed from the workflow."})]}),r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:r.jsxs("ul",{className:"space-y-1 text-sm",children:[b.map(w=>r.jsx("li",{children:r.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:w.display})},`${w.projectSlug??"standalone"}/${w.assignmentSlug}`)),E>0&&r.jsxs("li",{className:"text-xs italic text-muted-foreground",children:["+",E," more not shown"]})]})}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"status-delete-mode",checked:l==="remap",onChange:()=>c("remap"),disabled:n.length===0,className:"mt-1"}),r.jsxs("span",{className:"flex-1",children:[r.jsx("span",{className:"block text-sm font-medium",children:"Remap to another status"}),r.jsxs("select",{value:u,onChange:w=>p(w.target.value),onClick:()=>c("remap"),disabled:l!=="remap"||n.length===0,className:"mt-2 block w-full rounded-md border border-border/60 bg-background px-2 py-1 text-sm",children:[n.length===0&&r.jsx("option",{value:"",children:"(no other statuses)"}),n.map(w=>r.jsxs("option",{value:w.id,children:[w.label," (",w.id,")"]},w.id))]}),n.length===0&&r.jsx("span",{className:"block text-xs text-muted-foreground mt-1",children:"No other saved statuses to remap to. Add another status first, or use Delete."})]})]}),r.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"status-delete-mode",checked:l==="delete",onChange:()=>c("delete"),className:"mt-1"}),r.jsxs("span",{className:"flex-1",children:[r.jsx("span",{className:"block text-sm font-medium text-error-foreground",children:"Delete these assignments"}),r.jsxs("span",{className:"block text-xs text-muted-foreground mt-1",children:["Permanently removes ",t.count," assignment",t.count===1?"":"s"," from disk. This cannot be undone."]}),l==="delete"&&r.jsxs("label",{className:"mt-2 flex items-center gap-2 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:m,onChange:w=>h(w.target.checked)}),r.jsxs("span",{className:"text-xs",children:["I understand this will permanently delete ",t.count," assignment",t.count===1?"":"s","."]})]})]})]})]}),r.jsxs(Ls,{children:[r.jsx("button",{type:"button",onClick:a,className:"shell-action",children:"Cancel"}),r.jsx("button",{type:"button",onClick:y,disabled:!g,className:`shell-action ${l==="delete"?"bg-error text-error-foreground hover:opacity-90":"shell-action--cta"} disabled:cursor-not-allowed disabled:opacity-50`,children:l==="remap"?`Remap ${t.count} → ${u||"..."}`:`Delete ${t.count}`})]})]})})}function dB(e){const t=Array.from(e.pendingResolutions.values());return{body:{statuses:e.statuses.map(s=>({id:s.id,label:s.label,...s.description?{description:s.description}:{},...s.color?{color:s.color}:{},...s.terminal?{terminal:!0}:{}})),order:e.order,transitions:[],resolutions:t},resolutions:t}}function fB(e,t){const n=new Map;t.forEach((a,l)=>{n.has(a)||n.set(a,l)});const s=t.length;return e.map((a,l)=>({s:a,originalIndex:l,r:n.get(a.id)??s})).sort((a,l)=>a.r-l.r||a.originalIndex-l.originalIndex).map(a=>a.s)}function Lj(e,t){const n=new Map;for(const[s,a]of e.entries())t.has(a.id)||a.mode==="remap"&&!t.has(a.target)||n.set(s,a);return n}function pB(){const{customBindings:e,userBindings:t,actionEntries:n,findConflict:s,bindAction:a,unbindAction:l}=po(),[c,u]=f.useState(null),[p,m]=f.useState(null),[h,g]=f.useState(!1),y=Object.values(t).some(N=>typeof N=="string"&&N.length>0);function b(N,T){m({type:N,message:T}),setTimeout(()=>m(null),2500)}function E(N){u({kind:N,combo:null,conflict:null,saving:!1,error:null})}function j(N){if(!c||N.key==="Escape")return;if(N.key==="Enter"&&c.combo){N.preventDefault(),w();return}if(N.key==="Enter")return;N.preventDefault(),N.stopPropagation();const T=V0(N.nativeEvent);if(!T)return;const D=s(T,c.kind);u({...c,combo:T,conflict:D,error:null})}async function w(){var N;if(c!=null&&c.combo){if((N=c.conflict)!=null&&N.description){u({...c,error:`Reserved: ${c.conflict.description}`});return}u({...c,saving:!0,error:null});try{await a(c.kind,c.combo),u(null),b("success",`Bound ${xl[c.kind]}`)}catch(T){u({...c,saving:!1,error:T instanceof Error?T.message:"Failed to save"})}}}async function k(N){try{await l(N),b("success",`Cleared ${xl[N]} binding`)}catch(T){b("error",T instanceof Error?T.message:"Failed to clear binding")}}async function C(){if(!h){g(!0);try{await X3(),b("success","All hotkey bindings cleared")}catch(N){b("error",N instanceof Error?N.message:"Failed to reset bindings")}finally{g(!1)}}}return r.jsxs(We,{title:"Hotkey Bindings",description:"Each canonical create action ships with a default hotkey that fires the action without opening the palette. Override any of them below — Clear restores the default.",actions:y?r.jsxs("button",{className:"shell-action text-xs",onClick:()=>void C(),disabled:h,children:[r.jsx(io,{className:"h-3 w-3"}),"Restore defaults"]}):void 0,children:[p?r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${p.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:p.message}):null,r.jsx("ul",{className:"space-y-2",children:_d.map(N=>{var L,K;const T=n.find(B=>B.bindableKind===N),D=e[N],R=typeof t[N]=="string"&&!!t[N],$=(c==null?void 0:c.kind)===N;return r.jsxs("li",{className:"flex flex-wrap items-center gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-2",children:[r.jsx(uh,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"text-sm text-foreground",children:(T==null?void 0:T.title)??xl[N]}),T!=null&&T.subtitle?r.jsx("div",{className:"text-xs text-muted-foreground",children:T.subtitle}):null]}),D?r.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[r.jsx("kbd",{className:"rounded border border-border/70 bg-muted px-2 py-0.5 font-mono text-xs text-foreground",children:ds(D)}),r.jsx("span",{className:`text-[10px] uppercase tracking-wide ${R?"text-primary":"text-muted-foreground"}`,children:R?"custom":"default"})]}):r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"unbound"}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("button",{type:"button",className:"shell-action text-xs",onClick:()=>E(N),children:D?"Rebind":"Bind"}),R?r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:()=>void k(N),"aria-label":`Restore default ${xl[N]} binding`,children:[r.jsx(ig,{className:"h-3 w-3"}),"Restore default"]}):null]}),$?r.jsx("div",{className:"mt-2 w-full rounded-md border border-primary/40 bg-primary/5 px-3 py-3 text-center outline-none",tabIndex:0,autoFocus:!0,onKeyDown:j,onBlur:()=>{(c==null?void 0:c.kind)===N&&!c.saving&&u(null)},children:c!=null&&c.combo?r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"text-base font-semibold tracking-wide text-foreground",children:ds(c.combo)}),(L=c.conflict)!=null&&L.description?r.jsxs("div",{className:"text-xs text-destructive",children:["Reserved: ",c.conflict.description]}):(K=c.conflict)!=null&&K.kind?r.jsxs("div",{className:"text-xs text-amber-500 dark:text-amber-400",children:['Already bound to "',xl[c.conflict.kind],'". Press Enter to overwrite.']}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"Press Enter to save, Esc to cancel, any other key to retry."}),c.error?r.jsx("div",{className:"text-xs text-destructive",children:c.error}):null]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"Press the key combination you want to bind…"})}):null]},N)})})]})}const mB={kanban:"Kanban",list:"List",table:"Table"},hB={comfortable:"Comfortable",compact:"Compact"},gB={title:"Title",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",created:"Created",updated:"Updated"},xB={asc:"Ascending",desc:"Descending"};function yB(){const e=J_(),t=e.global,[n,s]=f.useState(!1),[a,l]=f.useState(null);function c(m,h){l({type:m,message:h}),setTimeout(()=>l(null),2e3)}async function u(m,h){if(t[m]!==h){s(!0);try{await dN({[m]:h}),c("success","Saved")}catch(g){c("error",g instanceof Error?g.message:"Failed to save")}finally{s(!1)}}}async function p(){if(e.custom){s(!0);try{await X_(),c("success","Reset to defaults")}catch(m){c("error",m instanceof Error?m.message:"Failed to reset")}finally{s(!1)}}}return r.jsxs(We,{title:"View defaults",description:"Defaults for the assignments board, list, and table views. Per-project overrides are saved automatically as you use them.",actions:e.custom?r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:p,disabled:n,children:[r.jsx(io,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[a&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${a.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:a.message}),r.jsxs("dl",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Default view"}),r.jsx("dd",{className:"mt-1.5 inline-flex rounded-md border border-border/60 p-0.5",children:Ag.map(m=>r.jsx("button",{type:"button",onClick:()=>u("defaultView",m),disabled:n,"aria-pressed":t.defaultView===m,className:`px-3 py-1 text-xs ${t.defaultView===m?"rounded bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,children:mB[m]},m))})]}),r.jsxs("div",{children:[r.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Density"}),r.jsx("dd",{className:"mt-1.5 inline-flex rounded-md border border-border/60 p-0.5",children:LD.map(m=>r.jsx("button",{type:"button",onClick:()=>u("density",m),disabled:n,"aria-pressed":t.density===m,className:`px-3 py-1 text-xs ${t.density===m?"rounded bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,children:hB[m]},m))})]}),r.jsxs("div",{children:[r.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Sort by"}),r.jsx("dd",{className:"mt-1.5",children:r.jsx("select",{value:t.sortField,onChange:m=>u("sortField",m.target.value),disabled:n,className:"editor-input max-w-[220px]",children:n1.map(m=>r.jsx("option",{value:m,children:gB[m]},m))})})]}),r.jsxs("div",{children:[r.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Direction"}),r.jsx("dd",{className:"mt-1.5 inline-flex rounded-md border border-border/60 p-0.5",children:$D.map(m=>r.jsx("button",{type:"button",onClick:()=>u("sortDirection",m),disabled:n,"aria-pressed":t.sortDirection===m,className:`px-3 py-1 text-xs ${t.sortDirection===m?"rounded bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,children:xB[m]},m))})]})]})]})}const bB={first:"first",last:"last",none:"none"};function vC(){return`row_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function Nl(e){return e.map(t=>({rowKey:vC(),id:t.id,originalId:t.id,isNew:!1,idEditable:!1,autoSlugFromLabel:!1,label:t.label,command:t.command,argsText:t.args?t.args.join(" "):"",promptArgPosition:t.promptArgPosition??"first",resolveFromShellAliases:t.resolveFromShellAliases??!1,default:t.default??!1,model:t.model??"",playbook:t.playbook??"",fieldErrors:{}}))}function vB(e){return e.map(t=>{const n={id:t.id,label:t.label,command:t.command},s=t.argsText.split(/[,\s]+/).filter(Boolean);return s.length>0&&(n.args=s),t.promptArgPosition!=="first"&&(n.promptArgPosition=t.promptArgPosition),t.resolveFromShellAliases&&(n.resolveFromShellAliases=!0),t.default&&(n.default=!0),t.model.trim()&&(n.model=t.model.trim()),t.playbook.trim()&&(n.playbook=t.playbook.trim()),n})}function wB(e){if(e.length===0)return e;let t=-1;for(let n=0;n<e.length;n++)if(e[n].default){t=n;break}return e.map((n,s)=>({...n,default:t===-1?s===0:s===t}))}function jB(e,t){return!t||t.length===0?e:e.map((n,s)=>{const a={};for(const l of t){if(l.index!==void 0){l.index===s&&(a[l.field]=l.message);continue}if(l.id!==void 0){l.id===n.id&&(a[l.field]=l.message);continue}a[l.field]=l.message}return{...n,fieldErrors:a}})}function kB(e){return e.map(t=>Object.keys(t.fieldErrors).length===0?t:{...t,fieldErrors:{}})}function SB(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const s=e[n],a=t[n];if(s.id!==a.id||s.label!==a.label||s.command!==a.command||s.argsText!==a.argsText||s.promptArgPosition!==a.promptArgPosition||s.resolveFromShellAliases!==a.resolveFromShellAliases||s.default!==a.default||s.model!==a.model||s.playbook!==a.playbook)return!1}return!0}function NB({row:e,index:t,canRemove:n,playbooks:s,onPatch:a,onSetDefault:l,onRemove:c}){const{attributes:u,listeners:p,setNodeRef:m,setActivatorNodeRef:h,transform:g,transition:y,isDragging:b}=yC({id:e.rowKey}),E={transform:hi.Transform.toString(g),transition:y,zIndex:b?50:void 0,position:b?"relative":void 0};function j(C){const N={label:C};if(e.autoSlugFromLabel){const T=mr(C);T&&kF.test(T)?N.id=T:N.id=`agent-${t+1}`}a(N)}function w(C){a({id:C,autoSlugFromLabel:!1})}const k=C=>e.fieldErrors[C]?"border-error-foreground/60":"";return r.jsxs("div",{ref:m,style:E,className:`surface-panel space-y-2 px-3 py-2 ${b?"opacity-60 shadow-lg":""}`,children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{ref:h,...u,...p,type:"button","aria-label":"Drag to reorder",className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",children:r.jsx(f0,{className:"h-4 w-4"})}),r.jsxs("label",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx("input",{type:"radio",name:"agents-default",checked:e.default,onChange:l,className:"h-3 w-3 cursor-pointer accent-foreground"}),"Default"]}),r.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wide text-muted-foreground/70",children:"id"}),e.idEditable?r.jsx("input",{type:"text",value:e.id,onChange:C=>w(C.target.value),className:`editor-input w-32 font-mono text-xs ${k("id")}`,"aria-label":"Agent id"}):r.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:e.id}),r.jsx("button",{type:"button",onClick:c,disabled:!n,"aria-label":"Remove agent",className:"rounded p-1 text-muted-foreground/60 transition hover:bg-foreground/[0.04] hover:text-foreground disabled:cursor-not-allowed disabled:opacity-30",children:r.jsx(or,{className:"h-3.5 w-3.5"})})]})]}),e.fieldErrors.id&&r.jsx("p",{className:"ml-7 text-[11px] text-error-foreground",children:e.fieldErrors.id}),r.jsxs("div",{className:"ml-7 grid grid-cols-1 gap-2 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Label"}),r.jsx("input",{type:"text",value:e.label,onChange:C=>j(C.target.value),className:`editor-input mt-0.5 w-full ${k("label")}`}),e.fieldErrors.label&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.label})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Command"}),r.jsx("input",{type:"text",value:e.command,placeholder:"claude or /usr/local/bin/claude",onChange:C=>a({command:C.target.value}),className:`editor-input mt-0.5 w-full font-mono ${k("command")}`}),e.fieldErrors.command&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.command})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Args (comma- or space-separated)"}),r.jsx("input",{type:"text",value:e.argsText,placeholder:"--dangerously-skip-permissions",onChange:C=>a({argsText:C.target.value}),className:`editor-input mt-0.5 w-full font-mono ${k("args")}`}),e.fieldErrors.args&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.args})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Prompt arg position"}),r.jsx("select",{value:e.promptArgPosition,onChange:C=>a({promptArgPosition:C.target.value}),className:`editor-input mt-0.5 w-full ${k("promptArgPosition")}`,children:PN.map(C=>r.jsx("option",{value:C,children:bB[C]},C))}),e.fieldErrors.promptArgPosition&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.promptArgPosition})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Model"}),r.jsx("input",{type:"text",value:e.model,placeholder:"opus (optional)",onChange:C=>a({model:C.target.value}),className:`editor-input mt-0.5 w-full font-mono ${k("model")}`}),e.fieldErrors.model&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.model})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Playbook"}),r.jsxs("select",{value:e.playbook,onChange:C=>a({playbook:C.target.value}),className:`editor-input mt-0.5 w-full ${k("playbook")}`,children:[r.jsx("option",{value:"",children:"— none —"}),s.map(C=>r.jsx("option",{value:C.slug,children:C.name},C.slug)),e.playbook&&!s.some(C=>C.slug===e.playbook)&&r.jsxs("option",{value:e.playbook,children:[e.playbook," (unavailable)"]})]}),e.fieldErrors.playbook&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.playbook})]}),r.jsxs("label",{className:"col-span-full inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx("input",{type:"checkbox",checked:e.resolveFromShellAliases,onChange:C=>a({resolveFromShellAliases:C.target.checked}),className:"h-3.5 w-3.5 cursor-pointer accent-foreground"}),"Resolve from shell aliases (look up ",r.jsx("code",{className:"font-mono",children:"command"})," in your interactive shell before launching)"]})]})]})}function CB(){const e=$N(),t=fg(),n=f.useMemo(()=>{var L;return(((L=t.data)==null?void 0:L.playbooks)??[]).filter(K=>K.enabled).map(K=>({slug:K.slug,name:K.name}))},[t.data]),[s,a]=f.useState(()=>Nl(e.agents)),[l,c]=f.useState(()=>Nl(e.agents)),[u,p]=f.useState(!1),[m,h]=f.useState(null),[g,y]=f.useState(null);f.useEffect(()=>{const L=Nl(e.agents);a(L),c(L),h(null)},[e.agents]);const b=f.useMemo(()=>!SB(s,l),[s,l]),E=GN(kd(yf,{activationConstraint:{distance:8}}),kd(xf));function j(L,K){y({type:L,message:K}),setTimeout(()=>y(null),2500)}function w(L,K){a(B=>B.map(O=>O.rowKey===L?{...O,...K,fieldErrors:EB(O.fieldErrors,K)}:O))}function k(L){a(K=>K.map(B=>({...B,default:B.rowKey===L})))}function C(){a(L=>{const K=new Set(L.map(H=>H.id)),B="new-agent";let O=B,W=1;for(;K.has(O);)W+=1,O=`${B}-${W}`;const se=W===1?"New Agent":`New Agent ${W}`,z={rowKey:vC(),id:O,originalId:null,isNew:!0,idEditable:!0,autoSlugFromLabel:!0,label:se,command:"",argsText:"",promptArgPosition:"first",resolveFromShellAliases:!0,default:!1,model:"",playbook:"",fieldErrors:{}};return[...L,z]})}function N(L){a(K=>K.filter(B=>B.rowKey!==L))}async function T(){p(!0),h(null);try{const L=wB(s),K=vB(L),B=await CF(K),O=Nl(B.agents);a(O),c(O),j("success","Agents saved")}catch(L){if(L instanceof AN)h(L.message),a(K=>jB(kB(K),L.fieldErrors)),j("error",L.message);else{const K=L instanceof Error?L.message:"Failed to save";h(K),j("error",K)}}finally{p(!1)}}function D(){a(l),h(null)}async function R(){if(e.custom&&window.confirm("Reset agents to built-in defaults? Any custom agents will be deleted from your config.")){p(!0),h(null);try{const L=await EF(),K=Nl(L.agents);a(K),c(K),j("success","Reset to defaults")}catch(L){const K=L instanceof Error?L.message:"Failed to reset";h(K),j("error",K)}finally{p(!1)}}}function $(L){const{active:K,over:B}=L;!B||K.id===B.id||a(O=>{const W=O.findIndex(z=>z.rowKey===K.id),se=O.findIndex(z=>z.rowKey===B.id);return W===-1||se===-1?O:wf(O,W,se)})}return r.jsxs(We,{title:"Agents",description:"Configure which agents the dashboard and 'Open in agent' actions can launch. The default agent is used when no other one is specified.",actions:e.custom?r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:R,disabled:u,children:[r.jsx(io,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[!e.custom&&r.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border/60 bg-foreground/[0.02] px-3 py-2 text-xs text-muted-foreground",children:[r.jsx(ng,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),r.jsxs("span",{children:["Using built-in defaults — first save will write your own list to"," ",r.jsx("code",{className:"font-mono",children:"~/.syntaur/config.md"}),"."]})]}),g&&r.jsx("div",{className:`rounded-md border px-3 py-1.5 text-xs ${g.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:g.message}),m&&(!g||g.type!=="error")&&r.jsx("div",{className:"rounded-md border border-error-foreground/30 bg-error px-3 py-1.5 text-xs text-error-foreground",children:m}),r.jsx(dC,{sensors:E,collisionDetection:QN,onDragEnd:$,children:r.jsx(gC,{items:s.map(L=>L.rowKey),strategy:pC,children:r.jsx("div",{className:"space-y-2",children:s.map((L,K)=>r.jsx(NB,{row:L,index:K,canRemove:s.length>1,playbooks:n,onPatch:B=>w(L.rowKey,B),onSetDefault:()=>k(L.rowKey),onRemove:()=>N(L.rowKey)},L.rowKey))})})}),r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[r.jsxs("button",{type:"button",onClick:C,disabled:u,className:"shell-action text-xs",children:[r.jsx(rn,{className:"h-3 w-3"}),"Add agent"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:D,disabled:!b||u,className:"shell-action text-xs",children:"Discard"}),r.jsxs("button",{type:"button",onClick:T,disabled:!b||u,className:"shell-action text-xs",children:[r.jsx(Id,{className:"h-3 w-3"}),"Save"]})]})]})]})}function EB(e,t){if(Object.keys(e).length===0)return e;const n={...e};return"id"in t&&delete n.id,"label"in t&&delete n.label,"command"in t&&delete n.command,"argsText"in t&&delete n.args,"promptArgPosition"in t&&delete n.promptArgPosition,"resolveFromShellAliases"in t&&delete n.resolveFromShellAliases,"default"in t&&delete n.default,"model"in t&&delete n.model,"playbook"in t&&delete n.playbook,n}const wC=["terminal-app","iterm","ghostty","alacritty","warp","kitty","cmux"],Cd={terminal:"terminal-app",custom:!1};let Qa=null,qa=null,Ed=0;const Wh=new Set;function jC(e){Qa=e;for(const t of Wh)t(e)}function Ox(e){if(!e||typeof e!="object")return Cd;const t=e;return{terminal:typeof t.terminal=="string"&&wC.includes(t.terminal)?t.terminal:Cd.terminal,custom:t.custom===!0}}function TB(){if(Qa)return Promise.resolve(Qa);if(qa)return qa;const e=++Ed;return qa=fetch("/api/config/terminal").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{qa=null;const n=Ox(t);return e!==Ed?Qa??n:(Qa=n,n)}).catch(()=>(qa=null,Cd)),qa}function RB(){const[e,t]=f.useState(()=>Qa??Cd);return f.useEffect(()=>{let n=!1;return TB().then(s=>{n||t(s)}),Wh.add(t),()=>{n=!0,Wh.delete(t)}},[]),e}async function PB(e){++Ed;const t=await fetch("/api/config/terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({terminal:e})});if(!t.ok){const s=await t.json().catch(()=>null);throw new Error((s==null?void 0:s.error)??`HTTP ${t.status}`)}const n=Ox(await t.json());return jC(n),n}async function AB(){++Ed;const e=await fetch("/api/config/terminal",{method:"DELETE"});if(!e.ok){const n=await e.json().catch(()=>null);throw new Error((n==null?void 0:n.error)??`HTTP ${e.status}`)}const t=Ox(await e.json());return jC(t),t}const _u={"terminal-app":"Terminal (macOS built-in)",iterm:"iTerm2",ghostty:"Ghostty",alacritty:"Alacritty",warp:"Warp",kitty:"kitty",cmux:"cmux"};function DB(){const{terminal:e,custom:t}=RB(),[n,s]=f.useState(!1),[a,l]=f.useState(null);function c(m){l(m),setTimeout(()=>l(null),2500)}async function u(m){if(!(m===e&&t)){s(!0);try{await PB(m),c({type:"success",message:`Terminal set to ${_u[m]}.`})}catch(h){c({type:"error",message:h instanceof Error?h.message:"Save failed."})}finally{s(!1)}}}async function p(){s(!0);try{const m=await AB();c({type:"success",message:`Reset to OS default (${_u[m.terminal]}).`})}catch(m){c({type:"error",message:m instanceof Error?m.message:"Reset failed."})}finally{s(!1)}}return r.jsxs(We,{title:"Terminal",description:`Which terminal "Open in agent" launches. Defaults to the OS choice (currently ${_u[e]}) when unset.`,actions:t?r.jsxs("button",{className:"shell-action text-xs",onClick:p,disabled:n,type:"button",children:[r.jsx(io,{className:"h-3 w-3"}),"Reset to OS default"]}):void 0,children:[a&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${a.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:a.message}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:"Launch in"}),r.jsx("select",{value:e,onChange:m=>u(m.target.value),disabled:n,className:"w-full max-w-sm rounded-md border border-border/60 bg-background px-3 py-1.5 text-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30 disabled:opacity-60",children:wC.map(m=>r.jsx("option",{value:m,children:_u[m]},m))})]})]})}function Cl(e){return e===ld?"Ungrouped":e}function $B(){const{data:e,loading:t,error:n,refetch:s}=oc(),{hidden:a,custom:l,loading:c,error:u,reload:p}=Ik(),[m,h]=f.useState(!1),[g,y]=f.useState(null);function b(k){y(k),setTimeout(()=>y(null),2500)}const E=e?[...e.workspaces,...e.hasUngrouped?[ld]:[]]:[];async function j(k,C){const N=C?a.filter(T=>T!==k):[...a,k];h(!0);try{await iD(N),b({type:"success",message:C?`Showing "${Cl(k)}" in the left nav.`:`Hiding "${Cl(k)}" from the left nav.`})}catch(T){b({type:"error",message:T instanceof Error?T.message:"Save failed."})}finally{h(!1)}}async function w(){h(!0);try{await lD(),b({type:"success",message:"All workspaces shown in the left nav."})}catch(k){b({type:"error",message:k instanceof Error?k.message:"Reset failed."})}finally{h(!1)}}return r.jsxs(We,{title:"Workspace visibility",description:"Choose which workspaces appear in the left nav. Hidden workspaces stay fully reachable by direct URL — this only controls the sidebar.",actions:l?r.jsxs("button",{className:"shell-action text-xs",onClick:w,disabled:m,type:"button",children:[r.jsx(io,{className:"h-3 w-3"}),"Show all"]}):void 0,children:[g&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${g.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:g.message}),t||c?r.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading workspaces…"}):n||u?r.jsxs("div",{className:"flex items-center gap-3 text-sm text-error-foreground",children:[r.jsx("span",{children:n?"Failed to load workspaces.":"Failed to load the visibility preference."}),r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:()=>{n&&s(),u&&p()},children:[r.jsx(io,{className:"h-3 w-3"}),"Retry"]})]}):E.length===0?r.jsx("div",{className:"text-sm text-muted-foreground",children:"No workspaces yet."}):r.jsx("ul",{className:"flex flex-col divide-y divide-border/40",children:E.map(k=>{const C=!sD(k,a);return r.jsxs("li",{className:"flex items-center justify-between gap-3 py-2",children:[r.jsxs("span",{className:"truncate text-sm",title:Cl(k),children:[Cl(k),k===ld&&r.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:"(standalone, ungrouped)"})]}),r.jsx("button",{type:"button",role:"switch","aria-checked":C,"aria-label":`Show "${Cl(k)}" in the left nav`,onClick:()=>j(k,!C),disabled:m,className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-60 ${C?"bg-primary":"bg-muted"}`,children:r.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-background shadow-sm ring-0 transition-transform ${C?"translate-x-4":"translate-x-0"}`})})]},k)})})]})}function kC(){return`row_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function sh(e){const t=e.statuses.map(n=>({rowKey:kC(),id:n.id,label:n.label,description:n.description??"",color:n.color??"",terminal:n.terminal??!1}));return fB(t,e.order)}function LB({row:e,isSaved:t,onUpdate:n,onRemove:s}){const{attributes:a,listeners:l,setNodeRef:c,setActivatorNodeRef:u,transform:p,transition:m,isDragging:h}=yC({id:e.rowKey}),g={transform:hi.Transform.toString(p),transition:m,zIndex:h?50:void 0,position:h?"relative":void 0};return r.jsxs("div",{ref:c,style:g,className:`surface-panel flex flex-wrap items-center gap-3 px-3 py-2 ${h?"opacity-60 shadow-lg":""}`,children:[r.jsx("button",{ref:u,...a,...l,type:"button","aria-label":"Drag to reorder",className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",children:r.jsx(f0,{className:"h-4 w-4"})}),r.jsx("div",{className:"min-w-[8rem] flex-1",children:t?r.jsxs(Pr,{children:[r.jsx(Ar,{asChild:!0,children:r.jsx("input",{type:"text",value:e.id,readOnly:!0,"aria-label":"Status ID",className:"editor-input w-full text-sm cursor-not-allowed opacity-60"})}),r.jsx(gr,{className:"max-w-xs text-xs font-normal normal-case tracking-normal",children:"To rename a saved status, delete the row and create a new one (this triggers the orphan-resolution flow if assignments still reference it)."})]}):r.jsx("input",{type:"text",value:e.id,onChange:y=>n("id",y.target.value),"aria-label":"Status ID",className:"editor-input w-full text-sm"})}),r.jsx("div",{className:"min-w-[8rem] flex-1",children:r.jsx("input",{type:"text",value:e.label,onChange:y=>n("label",y.target.value),"aria-label":"Status label",className:"editor-input w-full text-sm"})}),r.jsx(iB,{value:e.color,onChange:y=>n("color",y),ariaLabel:`Color for ${e.label||e.id}`}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(Pr,{children:[r.jsx(Ar,{asChild:!0,children:r.jsx("span",{className:"cursor-help text-xs text-muted-foreground underline decoration-dotted underline-offset-4",children:"Done"})}),r.jsx(gr,{className:"max-w-xs text-xs font-normal normal-case tracking-normal",children:'When enabled, assignments in this status count as finished — they fill the "done" portion of progress bars and satisfy dependency requirements.'})]}),r.jsx("button",{type:"button",role:"switch","aria-checked":e.terminal,"aria-label":`Done state for ${e.label||e.id}`,onClick:()=>n("terminal",!e.terminal),className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background ${e.terminal?"bg-primary":"bg-muted"}`,children:r.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-background shadow-sm ring-0 transition-transform ${e.terminal?"translate-x-4":"translate-x-0"}`})})]}),r.jsx("button",{type:"button",className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",onClick:s,title:"Remove status","aria-label":`Remove status ${e.id}`,children:r.jsx(or,{className:"h-3.5 w-3.5"})})]})}function OB(){var ge;const[e,t]=f.useState(!0),[n,s]=f.useState(null),[a,l]=f.useState(!1),[c,u]=f.useState([]),[p,m]=f.useState(!1),[h,g]=f.useState(null),[y,b]=f.useState(!1),[E,j]=f.useState(new Set),[w,k]=f.useState(new Map),[C,N]=f.useState({open:!1}),T=GN(kd(yf,{activationConstraint:{distance:8}}),kd(xf,{coordinateGetter:oB})),{preset:D,setPreset:R,resetPreset:$}=ug(),[L,K]=f.useState(!1),[B,O]=f.useState(null);async function W(V){if(!(V===D||L)){K(!0),O(null);try{await R(V),O({type:"success",message:"Theme updated"}),setTimeout(()=>O(null),2e3)}catch(ae){O({type:"error",message:ae instanceof Error?ae.message:"Failed to save theme"})}finally{K(!1)}}}async function se(){K(!0),O(null);try{await $(),O({type:"success",message:"Theme reset to default"}),setTimeout(()=>O(null),2e3)}catch(V){O({type:"error",message:V instanceof Error?V.message:"Failed to reset theme"})}finally{K(!1)}}const z=f.useCallback(async()=>{try{const V=await fetch("/api/config/statuses");if(!V.ok)throw new Error(`HTTP ${V.status}`);const ae=await V.json(),me=sh(ae);u(me),l(ae.custom),j(new Set(me.map(ve=>ve.id))),k(new Map),b(!1),s(null)}catch(V){s(V instanceof Error?V.message:"Failed to load config")}finally{t(!1)}},[]);f.useEffect(()=>{z()},[z]);function H(){setTimeout(()=>g(null),3e3)}async function ee(){m(!0),g(null);try{const{body:V}=dB({statuses:c,order:c.map(he=>he.id),pendingResolutions:w}),ae=await fetch("/api/config/statuses",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)});if(!ae.ok){const he=await ae.json().catch(()=>null);if(ae.status===409&&(he==null?void 0:he.error)==="unresolved-orphans"){const Je=Array.isArray(he.unresolved)?he.unresolved.map(Ye=>Ye.id).join(", "):"";throw new Error(`Cannot save — these statuses have assignments that need a resolution: ${Je}. Click the trash icon on each row to choose remap or delete.`)}if(ae.status===409&&(he==null?void 0:he.error)==="concurrent-edit"){const Je=he.applied?` (${he.applied.remapped} remapped, ${he.applied.deleted} deleted before the conflict)`:"";g({type:"error",message:`Concurrent edit detected${Je}: ${he.cause??"an assignment moved to a still-dropped status during save"}. Refreshing — please re-resolve.`}),await z();return}if(ae.status===500&&(he==null?void 0:he.error)==="config-write-failed"&&(he!=null&&he.applied)){const{remapped:Je,deleted:Ye}=he.applied,ot=he.message?`: ${he.message}`:"";g({type:"error",message:`Resolutions applied (${Je} remapped, ${Ye} deleted) but the status config write failed${ot}. Click Save again to retry.`}),await z();return}throw(he==null?void 0:he.error)==="invalid-remap-target"?new Error(`Invalid remap target (${he.reason}): ${he.id} → ${he.target}.`):(he==null?void 0:he.error)==="duplicate-resolution-ids"?new Error(`Duplicate resolution ids: ${(he.ids??[]).join(", ")}`):(he==null?void 0:he.error)==="stale-resolution"?new Error(`Stale resolution for id "${he.id??"?"}".`):(he==null?void 0:he.error)==="malformed-resolutions"?new Error(`Malformed resolutions: ${he.message??"unknown"}`):(he==null?void 0:he.error)==="remap-write-failed"||(he==null?void 0:he.error)==="delete-failed"||(he==null?void 0:he.error)==="scan-failed"?new Error(`${he.error}: ${he.cause??"unknown"}`):new Error((he==null?void 0:he.error)??`Save failed (HTTP ${ae.status})`)}const me=await ae.json(),ve=sh(me);u(ve),l(me.custom),j(new Set(ve.map(he=>he.id))),k(new Map),b(!1),tw();const ke=me.applied?` (${me.applied.remapped} remapped, ${me.applied.deleted} deleted)`:"";g({type:"success",message:`Status config saved${ke}`}),H()}catch(V){g({type:"error",message:V instanceof Error?V.message:"Save failed"})}finally{m(!1)}}async function ne(){m(!0),g(null);try{const V=await fetch("/api/config/statuses",{method:"DELETE"});if(!V.ok)throw new Error("Reset failed");const ae=await V.json(),me=sh(ae);u(me),l(ae.custom),j(new Set(me.map(ve=>ve.id))),k(new Map),b(!1),tw(),g({type:"success",message:"Reset to defaults"}),H()}catch(V){g({type:"error",message:V instanceof Error?V.message:"Reset failed"})}finally{m(!1)}}function M(V,ae,me){u(ve=>{const ke=[...ve];return ke[V]={...ke[V],[ae]:me},ke}),b(!0)}function G(){const V=`status_${c.length+1}`;u(ae=>[...ae,{rowKey:kC(),id:V,label:"New Status",description:"",color:"",terminal:!1}]),b(!0)}function A(V){u(ae=>{const me=ae.filter(ke=>ke.id!==V),ve=new Set(me.map(ke=>ke.id));return k(ke=>Lj(ke,ve)),me}),b(!0)}async function F(V){const ae=c[V].id;if(!E.has(ae)){A(ae);return}try{const me=await fetch(`/api/config/statuses/affected/${encodeURIComponent(ae)}`);if(!me.ok)throw new Error(`HTTP ${me.status}`);const ve=await me.json();if(ve.count===0){A(ae);return}N({open:!0,affected:ve,pendingId:ae})}catch(me){g({type:"error",message:`Could not check affected assignments for "${ae}": ${me instanceof Error?me.message:String(me)}`})}}function Z(V){if(!C.open)return;const{pendingId:ae}=C;if(ae!==V.id){N({open:!1});return}if(!c.some(me=>me.id===ae)){g({type:"error",message:`Row for "${ae}" was already removed — modal action ignored.`}),N({open:!1});return}u(me=>{const ve=me.filter(he=>he.id!==ae),ke=new Set(ve.map(he=>he.id));return k(he=>{const Je=Lj(he,ke),Ye=new Map(Je);return Ye.set(ae,V),Ye}),ve}),b(!0),N({open:!1})}function I(){N({open:!1})}function de(V){const{active:ae,over:me}=V;!me||ae.id===me.id||(u(ve=>{const ke=ve.findIndex(Je=>Je.rowKey===ae.id),he=ve.findIndex(Je=>Je.rowKey===me.id);return ke===-1||he===-1?ve:wf(ve,ke,he)}),b(!0))}return e?r.jsx(mt,{label:"Loading settings..."}):n?r.jsx(wt,{error:n}):r.jsx(Wo,{children:r.jsxs("div",{className:"space-y-6",children:[r.jsxs(We,{title:"Theme",description:"Pick a color theme for the dashboard. The default is the Syntaur brand.",actions:D!=="default"?r.jsxs("button",{className:"shell-action text-xs",onClick:se,disabled:L,children:[r.jsx(io,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[B&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${B.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:B.message}),r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:R0.map(V=>{const ae=V.slug===D;return r.jsxs("button",{type:"button",onClick:()=>W(V.slug),disabled:L,"aria-pressed":ae,className:`group relative flex flex-col gap-2 rounded-lg border bg-card/95 p-3 text-left transition disabled:opacity-60 ${ae?"border-primary ring-2 ring-primary/40":"border-border/60 hover:border-primary/40"}`,children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:V.swatches.primary}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:V.swatches.secondary}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:V.swatches.coral}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:V.swatches.teal}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:V.swatches.amber}}),ae&&r.jsx("span",{className:"ml-auto inline-flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:r.jsx(Xr,{className:"h-3 w-3"})})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-medium text-foreground",children:V.label}),r.jsx("div",{className:"text-xs text-muted-foreground",children:V.description})]})]},V.slug)})})]}),r.jsx(pB,{}),r.jsx(DB,{}),r.jsx($B,{}),r.jsx(CB,{}),r.jsx(yB,{}),r.jsxs("div",{className:`flex items-center justify-between rounded-lg border px-4 py-3 text-sm ${a?"border-primary/30 bg-primary/5 text-primary":"border-border/60 bg-muted/30 text-muted-foreground"}`,children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ng,{className:"h-4 w-4"}),a?"Using custom status configuration from ~/.syntaur/config.md":"Using default status configuration"]}),r.jsxs("button",{className:"shell-action text-xs",onClick:ne,disabled:p||!a&&!y,children:[r.jsx(io,{className:"h-3 w-3"}),"Reset to Defaults"]})]}),h&&r.jsx("div",{className:`rounded-lg border px-4 py-2 text-sm ${h.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:h.message}),r.jsx(We,{title:"Status Definitions",description:"Define the statuses assignments can have. Drag rows to set the display order used by Kanban columns, progress bars, and dropdowns.",actions:r.jsxs("button",{className:"shell-action text-xs",onClick:G,children:[r.jsx(rn,{className:"h-3 w-3"}),"Add Status"]}),children:r.jsx(dC,{sensors:T,collisionDetection:QN,onDragEnd:de,children:r.jsx(gC,{items:c.map(V=>V.rowKey),strategy:pC,children:r.jsx("div",{className:"space-y-2",children:c.map((V,ae)=>r.jsx(LB,{row:V,isSaved:E.has(V.id),onUpdate:(me,ve)=>M(ae,me,ve),onRemove:()=>F(ae)},V.rowKey))})})})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("button",{className:"shell-action bg-primary/10 text-primary hover:bg-primary/20",onClick:ee,disabled:p||!y,children:[r.jsx(Id,{className:"h-3.5 w-3.5"}),p?"Saving...":"Save Configuration"]}),y&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"shell-action text-xs",onClick:()=>{t(!0),z()},disabled:p,children:"Discard Changes"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Unsaved changes"})]})]}),r.jsx(cB,{}),C.open&&r.jsx(uB,{open:C.open,affected:{...C.affected,label:((ge=c.find(V=>V.id===C.affected.id))==null?void 0:ge.label)??C.affected.id},remaining:c.filter(V=>V.id!==C.affected.id&&E.has(V.id)).map(V=>({id:V.id,label:V.label})),onResolve:Z,onCancel:I})]})})}const Ts=e=>`${e.workspace}::${e.id}`;function Oj(e){if(e.includes("/")){const[t,n]=e.split("/");return`/projects/${t}/assignments/${n}`}return`/assignments/${e}`}function IB(){var lt;const{data:e,loading:t,error:n,refetch:s}=H0(),a=Dt(),[l,c]=f.useState(""),u=f.useRef(null);mo("list:todos");const[p,m]=f.useState(""),[h,g]=f.useState(""),[y,b]=f.useState(""),[E,j]=f.useState("_global"),[w,k]=f.useState(null),[C,N]=f.useState(null),[T,D]=f.useState(new Set),[R,$]=f.useState(!1),L=f.useRef(null),[K,B]=f.useState(null),O=gx("all"),[W,se]=f.useState(null),[z,H]=f.useState(null),ee=f.useRef(null);f.useEffect(()=>{let te=!1;return(async()=>{try{const be=await fetch("/api/projects");if(!be.ok)return;const Le=await be.json();te||B(Le.filter(it=>!it.archived))}catch{}})(),()=>{te=!0}},[]);function ne(te,be){te.stopPropagation(),navigator.clipboard.writeText(be),k(be),setTimeout(()=>k(Le=>Le===be?null:Le),1500)}const M=f.useMemo(()=>{if(!(e!=null&&e.workspaces))return[];const te=[];for(const be of e.workspaces)for(const Le of be.items)te.push({...Le,workspace:be.workspace});return te},[e]),G=f.useMemo(()=>{const te=new Set;for(const be of M)for(const Le of be.tags)te.add(Le);return Array.from(te).sort()},[M]),A=f.useMemo(()=>{let te=M;if(l.trim()){const be=l.toLowerCase();te=te.filter(Le=>Le.description.toLowerCase().includes(be)||Le.tags.some(it=>it.toLowerCase().includes(be))||Le.id.includes(be))}return p&&(te=te.filter(be=>be.status===p)),h&&(te=te.filter(be=>be.tags.includes(h))),te},[M,l,p,h]);f.useEffect(()=>{D(new Set),L.current=null},[l,p,h]);const F=f.useMemo(()=>A.filter(te=>T.has(Ts(te))),[A,T]),Z=A.length>0&&F.length===A.length,I=F.length>0&&!Z,de=f.useMemo(()=>{if(F.length===0)return null;const te=new Set(F.map(be=>be.workspace));return te.size===1?[...te][0]:null},[F]),ge=f.useMemo(()=>{if(!de||!K)return;const te=K.filter(be=>be.workspace===de);return te.length===1?te[0].slug:void 0},[de,K]),V=((lt=F[0])==null?void 0:lt.description)??"",ae=f.useMemo(()=>{if(de)return null;const te=new Map;for(const be of F)te.has(be.workspace)||te.set(be.workspace,[]),te.get(be.workspace).push(be.id);return Array.from(te,([be,Le])=>({workspace:be,todoIds:Le}))},[F,de]),me=de?{kind:"workspace",workspace:de}:{kind:"aggregate",groups:ae??[]};function ve(te,be,Le){const it=Ts(te),_e=!!(Le&&"shiftKey"in Le&&Le.shiftKey),bt=L.current?nt.findIndex(_t=>Ts(_t)===L.current):-1;if(_e&&bt!==-1){const _t=Math.min(bt,be),Gt=Math.max(bt,be);D(ue=>{const Be=new Set(ue);for(let Fe=_t;Fe<=Gt;Fe++){const Nt=nt[Fe];Nt&&Be.add(Ts(Nt))}return Be})}else D(_t=>{const Gt=new Set(_t);return Gt.has(it)?Gt.delete(it):Gt.add(it),Gt});L.current=it}function ke(){D(te=>{const be=new Set(te);if(Z)for(const Le of A)be.delete(Ts(Le));else for(const Le of A)be.add(Ts(Le));return be})}function he(){D(new Set),L.current=null}function Je(te){he(),s(),te!=null&&te.assignmentRef&&a(Oj(te.assignmentRef))}const Ye=f.useMemo(()=>{if(!(e!=null&&e.workspaces))return{open:0,in_progress:0,completed:0,blocked:0,total:0};const te={open:0,in_progress:0,completed:0,blocked:0,total:0};for(const be of e.workspaces)te.open+=be.counts.open,te.in_progress+=be.counts.in_progress,te.completed+=be.counts.completed,te.blocked+=be.counts.blocked,te.total+=be.counts.total;return te},[e]);async function ot(){y.trim()&&(await pg(E,y.trim()),b(""),s())}async function J(te,be,Le){switch(Le){case"open":await G0(te,be);break;case"in_progress":await q0(te,be);break;case"completed":await W0(te,be);break;case"blocked":await K0(te,be);break}s()}async function Ie(te,be){await Y0(te,be),s()}async function Ne(te,be,Le){await J0(te,be,Le),s()}async function Oe(te,be,Le){await X0(te,be,Le),s()}async function Xe(te,be,Le){await Q0(te,be,Le),s()}const Me=hx(A),nt=Me.filter(te=>!O.isCollapsed(te.config.id)).flatMap(te=>te.items),{hotkeyRowProps:Ke}=ac(nt,{scope:"list:todos",bindO:!1,onOpen:te=>N(Ts(te))});Ht({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var te;return(te=u.current)==null?void 0:te.focus()}}),Ht({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>s()});const[gt,Rt]=hs(),at=gt.get("focus");f.useEffect(()=>{if(!at)return;const te=M.find(Le=>Le.id===at);if(!te)return;const be=lf(te.status);O.isCollapsed(be)&&O.toggle(be)},[at,M]),f.useEffect(()=>{if(!at)return;const te=document.querySelector(`[data-todo-id="${CSS.escape(at)}"]`);if(!te)return;te.scrollIntoView({block:"nearest"}),te.classList.add("ring-2","ring-primary/60");const be=window.setTimeout(()=>{te.classList.remove("ring-2","ring-primary/60"),Rt(Le=>{const it=new URLSearchParams(Le);return it.delete("focus"),it})},1500);return()=>window.clearTimeout(be)},[at,nt.length,Rt]);const ie=W?A.find(te=>Ts(te)===W)??null:null;function Y(te,be){const Le=ee.current;if(Le!=null&&Le.closest(mi)){te.preventDefault();return}te.dataTransfer.effectAllowed="move",te.dataTransfer.setData("text/plain",be),se(be)}function pe(){se(null),H(null)}function Q(te,be){!ie||be.statuses.includes(ie.status)||(te.preventDefault(),te.dataTransfer.dropEffect="move",H(be.id))}function ye(te,be){z===be.id&&!te.currentTarget.contains(te.relatedTarget)&&H(null)}function Pe(te,be){te.preventDefault();const Le=ie;pe(),!(!Le||be.statuses.includes(Le.status))&&J(Le.workspace,Le.id,be.dropStatus)}return t?r.jsx(mt,{label:"Loading todos..."}):n?r.jsx(wt,{error:n}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[r.jsx(An,{label:"Open",value:Ye.open,icon:Dr}),r.jsx(An,{label:"In Progress",value:Ye.in_progress,icon:rg,tone:"info"}),r.jsx(An,{label:"Blocked",value:Ye.blocked,icon:ag,tone:"warn"}),r.jsx(An,{label:"Completed",value:Ye.completed,icon:Dr,tone:"default"})]}),r.jsx("div",{className:"surface-panel p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("select",{value:E,onChange:te=>j(te.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"_global",children:"Global"}),e==null?void 0:e.workspaces.filter(te=>te.workspace!=="_global").map(te=>r.jsx("option",{value:te.workspace,children:te.workspace},te.workspace))]}),r.jsx("input",{type:"text",placeholder:"Add a todo...",value:y,onChange:te=>b(te.target.value),onKeyDown:te=>te.key==="Enter"&&ot(),className:"h-9 flex-1 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),r.jsxs("button",{onClick:ot,disabled:!y.trim(),className:"inline-flex h-9 items-center gap-1.5 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-40",children:[r.jsx(rn,{className:"h-4 w-4"}),"Add"]})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(fo,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:u,type:"text",placeholder:"Search todos...",value:l,onChange:te=>c(te.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs("select",{value:p,onChange:te=>m(te.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All statuses"}),r.jsx("option",{value:"open",children:"Open"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"blocked",children:"Blocked"})]}),G.length>0&&r.jsxs("select",{value:h,onChange:te=>g(te.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All tags"}),G.map(te=>r.jsxs("option",{value:te,children:["#",te]},te))]})]}),F.length>0?r.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[r.jsxs("span",{className:"text-sm font-medium",children:[F.length," selected",de?r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(from ",r.jsx("strong",{children:de}),")"]}):r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["across ",new Set(F.map(te=>te.workspace)).size," workspaces"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>$(!0),className:"shell-action shell-action--cta",children:"Promote to assignment"}),r.jsx("button",{type:"button",onClick:he,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,A.length>0&&r.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:Z,ref:te=>{te&&(te.indeterminate=I)},onChange:ke,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",A.length,")"]}),r.jsx("span",{className:"text-muted-foreground/60",children:"— shift-click for range select"})]}),r.jsx("div",{className:"space-y-3",children:(()=>{let te=-1;return Me.map(({config:be,items:Le})=>{const it=!O.isCollapsed(be.id);return r.jsx(mx,{label:be.label,count:Le.length,expanded:it,onToggle:()=>O.toggle(be.id),isDropTarget:z===be.id,onDragOver:_e=>Q(_e,be),onDragLeave:_e=>ye(_e,be),onDrop:_e=>Pe(_e,be),children:it&&Le.map(_e=>{te+=1;const bt=te,_t=Ts(_e),Gt=T.has(_t);return r.jsxs("div",{draggable:!0,"data-todo-id":_e.id,...Ke(bt),onMouseDown:ue=>{ee.current=ue.target},onDragStart:ue=>Y(ue,_t),onDragEnd:pe,className:`surface-panel flex items-start gap-3 px-3 py-2 group cursor-grab active:cursor-grabbing hover:bg-foreground/[0.03] transition ${Gt?"ring-1 ring-foreground/20":""} ${W===_t?"opacity-50 shadow-lg":""}`,children:[r.jsx("input",{type:"checkbox","data-no-drag":!0,"aria-label":`Select todo ${_e.id}`,title:"Select",checked:Gt,onChange:()=>{},onClick:ue=>{ue.stopPropagation(),ve(_e,bt,ue)},className:"mt-1 h-4 w-4 shrink-0 cursor-pointer accent-foreground"}),r.jsx("span",{className:"mt-0.5 self-stretch w-px bg-border/60","aria-hidden":"true"}),r.jsx("div",{className:"mt-0.5 shrink-0",children:r.jsx(QS,{status:_e.status,onChange:ue=>J(_e.workspace,_e.id,ue)})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-baseline flex-wrap gap-x-2",children:[r.jsx(eN,{description:_e.description,status:_e.status,editing:C===_t,onBeginEdit:()=>N(_t),onEndEdit:()=>N(null),onSave:ue=>Ne(_e.workspace,_e.id,ue)}),_e.tags.length>0&&r.jsx("span",{className:"text-xs text-muted-foreground",children:_e.tags.map(ue=>`#${ue}`).join(" ")}),_e.linkedAssignmentRef?r.jsxs(Ee,{to:Oj(_e.linkedAssignmentRef),"data-no-drag":!0,className:"inline-flex items-center gap-0.5 rounded-full border border-status-completed-foreground/40 bg-status-completed/30 px-1.5 py-0.5 text-[10px] font-mono text-status-completed-foreground hover:bg-status-completed/50",onClick:ue=>ue.stopPropagation(),children:[r.jsx(a0,{className:"h-2.5 w-2.5"}),_e.linkedAssignmentRef.includes("/")?_e.linkedAssignmentRef:`oneoff:${_e.linkedAssignmentRef.slice(0,8)}`]}):null]}),r.jsx(tN,{item:_e,attachmentUrl:(ue,Be)=>mg(_e.workspace,ue,Be),onAdd:ue=>Oe(_e.workspace,_e.id,ue),onDelete:ue=>Xe(_e.workspace,_e.id,ue)})]}),r.jsx("span",{className:"text-xs text-muted-foreground/60 font-mono",children:_e.workspace!=="_global"&&r.jsx(Ee,{to:`/w/${_e.workspace}/todos`,className:"hover:text-foreground transition mr-2",onClick:ue=>ue.stopPropagation(),children:_e.workspace})}),w===_e.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(Xr,{className:"h-3 w-3"})," Copied to clipboard"]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{className:"text-xs text-muted-foreground/60 font-mono hover:text-foreground transition",onClick:ue=>ne(ue,_e.id),children:["t:",_e.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:ue=>ne(ue,_e.id),children:r.jsx(rd,{className:"h-3 w-3"})})]}),r.jsx("button",{onClick:ue=>{ue.stopPropagation(),Ie(_e.workspace,_e.id)},className:"text-xs text-muted-foreground/40 hover:text-destructive transition opacity-0 group-hover:opacity-100",children:"delete"})]},`${_e.workspace}-${_e.id}`)})},be.id)})})()}),r.jsx(px,{open:R,selectedIds:F.map(te=>te.id),scope:me,onOpenChange:$,onDone:Je,defaultProject:ge,defaultTitle:V,allowOneOff:!0})]})}const MB={open:{icon:"○",cls:"text-muted-foreground",label:"Open"},in_progress:{icon:"◉",cls:"text-status-in-progress-foreground",label:"In progress"},blocked:{icon:"✕",cls:"text-status-blocked-foreground",label:"Blocked"},completed:{icon:"✓",cls:"text-status-completed-foreground",label:"Completed"},mixed:{icon:"◐",cls:"text-muted-foreground",label:"Mixed"}};function _B({bundle:e}){const t=MB[e.derivedStatus.status],{counts:n}=e.derivedStatus;return r.jsxs("div",{className:"border rounded-md p-3 mb-2 bg-card",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:`text-lg leading-none ${t.cls}`,title:t.label,children:t.icon}),r.jsxs("span",{className:"font-mono text-sm text-muted-foreground",children:["b:",e.id]}),e.slug&&r.jsx("span",{className:"font-medium",children:e.slug}),r.jsxs("span",{className:"ml-auto text-sm text-muted-foreground",children:[n.completed,"/",n.total," done"]})]}),r.jsxs("div",{className:"mt-2 grid gap-1 text-sm",children:[e.branch&&r.jsxs("div",{className:"text-muted-foreground",children:[r.jsx("span",{className:"font-medium",children:"Branch:"})," ",r.jsx("code",{className:"font-mono",children:e.branch})]}),e.worktreePath&&r.jsxs("div",{className:"text-muted-foreground truncate",children:[r.jsx("span",{className:"font-medium",children:"Worktree:"})," ",r.jsx("code",{className:"font-mono",children:e.worktreePath})]}),e.planDir&&r.jsxs("div",{className:"text-muted-foreground truncate",children:[r.jsx("span",{className:"font-medium",children:"Plan:"})," ",r.jsx("code",{className:"font-mono",children:e.planDir})]})]}),r.jsx("ul",{className:"mt-2 ml-6 text-sm list-disc",children:e.members.map(s=>r.jsxs("li",{className:s.status==="completed"?"line-through text-muted-foreground":"",children:[r.jsxs("span",{className:"font-mono text-xs text-muted-foreground mr-2",children:["t:",s.id]}),s.description]},s.id))})]})}function FB({bundles:e,title:t="Bundles"}){return e.length===0?null:r.jsxs("section",{className:"mb-6",children:[r.jsxs("h3",{className:"text-sm font-medium text-muted-foreground mb-2",children:[t," (",e.length,")"]}),e.map(n=>r.jsx(_B,{bundle:n},n.id))]})}function zB(e){const[t,n]=f.useState(null),[s,a]=f.useState(!0),[l,c]=f.useState(null),u=f.useCallback(async()=>{try{const p=await fetch(`/api/bundles/${encodeURIComponent(e)}`);if(!p.ok)throw new Error(`HTTP ${p.status}`);n(await p.json()),c(null)}catch(p){c(p instanceof Error?p.message:"Failed to fetch bundles")}finally{a(!1)}},[e]);return f.useEffect(()=>{u()},[u]),sc(p=>{p.type==="todos-updated"&&!p.projectSlug&&u()}),{data:t,loading:s,error:l,refetch:u}}function BB(){const{workspace:e}=$t(),t=e||"_global",{data:n,loading:s,error:a,refetch:l}=zP(t),{data:c}=zB(t),[u,p]=f.useState(""),[m,h]=f.useState(""),[g,y]=f.useState(""),[b,E]=f.useState(""),[j,w]=f.useState(null),[k,C]=f.useState(null),[N,T]=f.useState(new Set),[D,R]=f.useState(!1),[$,L]=f.useState(!1),[K,B]=f.useState(null),O=f.useRef(null);mo("list:todos");const W=gx("workspace:"+t),[se,z]=f.useState(null),[H,ee]=f.useState(null),ne=f.useRef(null);function M(Q,ye){Q.stopPropagation(),navigator.clipboard.writeText(ye),w(ye),setTimeout(()=>w(Pe=>Pe===ye?null:Pe),1500)}const G=f.useMemo(()=>{if(!(n!=null&&n.items))return[];const Q=new Set;for(const ye of n.items)for(const Pe of ye.tags)Q.add(Pe);return Array.from(Q).sort()},[n]),A=f.useMemo(()=>{if(!(n!=null&&n.items))return[];let Q=n.items;if(u.trim()){const ye=u.toLowerCase();Q=Q.filter(Pe=>Pe.description.toLowerCase().includes(ye)||Pe.tags.some(lt=>lt.toLowerCase().includes(ye))||Pe.id.includes(ye))}return m&&(Q=Q.filter(ye=>ye.status===m)),g&&(Q=Q.filter(ye=>ye.tags.includes(g))),Q},[n,u,m,g]);f.useEffect(()=>{T(new Set)},[u,m,g,t]);const F=f.useMemo(()=>A.filter(Q=>N.has(Q.id)).length,[A,N]),Z=A.length>0&&F===A.length,I=F>0&&!Z;function de(Q){T(ye=>{const Pe=new Set(ye);return Pe.has(Q)?Pe.delete(Q):Pe.add(Q),Pe})}function ge(){T(Q=>{const ye=new Set(Q);if(Z)for(const Pe of A)ye.delete(Pe.id);else for(const Pe of A)ye.add(Pe.id);return ye})}function V(){T(new Set)}const ae=K?[K]:Array.from(N);function me(){T(new Set),B(null),l()}function ve(){T(new Set),l()}async function ke(){b.trim()&&(await pg(t,b.trim()),E(""),l())}async function he(Q,ye,Pe){Q.stopPropagation(),window.confirm(`Delete "${Pe}"? This can't be undone.`)&&(await Y0(t,ye),l())}async function Je(Q,ye){switch(ye){case"open":await G0(t,Q);break;case"in_progress":await q0(t,Q);break;case"completed":await W0(t,Q);break;case"blocked":await K0(t,Q);break}l()}async function Ye(Q,ye){await J0(t,Q,ye),l()}async function ot(Q,ye){await X0(t,Q,ye),l()}async function J(Q,ye){await Q0(t,Q,ye),l()}const Ie=hx(A),Ne=Ie.filter(Q=>!W.isCollapsed(Q.config.id)).flatMap(Q=>Q.items),{hotkeyRowProps:Oe}=ac(Ne,{scope:"list:todos",bindO:!1,onOpen:Q=>C(Q.id)});Ht({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var Q;return(Q=O.current)==null?void 0:Q.focus()}}),Ht({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>l()});const[Xe,Me]=hs(),nt=Xe.get("focus");f.useEffect(()=>{if(!nt||!(n!=null&&n.items))return;const Q=n.items.find(Pe=>Pe.id===nt);if(!Q)return;const ye=lf(Q.status);W.isCollapsed(ye)&&W.toggle(ye)},[nt,n==null?void 0:n.items]),f.useEffect(()=>{if(!nt)return;const Q=document.querySelector(`[data-todo-id="${window.CSS.escape(nt)}"]`);if(!Q)return;Q.scrollIntoView({block:"nearest"}),Q.classList.add("ring-2","ring-primary/60");const ye=window.setTimeout(()=>{Q.classList.remove("ring-2","ring-primary/60"),Me(Pe=>{const lt=new URLSearchParams(Pe);return lt.delete("focus"),lt})},1500);return()=>window.clearTimeout(ye)},[nt,Ne.length,Me]);const Ke=se?(n==null?void 0:n.items.find(Q=>Q.id===se))??null:null;function gt(Q,ye){const Pe=ne.current;if(Pe!=null&&Pe.closest(mi)){Q.preventDefault();return}Q.dataTransfer.effectAllowed="move",Q.dataTransfer.setData("text/plain",ye),z(ye)}function Rt(){z(null),ee(null)}function at(Q,ye){!Ke||ye.statuses.includes(Ke.status)||(Q.preventDefault(),Q.dataTransfer.dropEffect="move",ee(ye.id))}function ie(Q,ye){H===ye.id&&!Q.currentTarget.contains(Q.relatedTarget)&&ee(null)}function Y(Q,ye){Q.preventDefault();const Pe=Ke;Rt(),!(!Pe||ye.statuses.includes(Pe.status))&&Je(Pe.id,ye.dropStatus)}if(s)return r.jsx(mt,{label:"Loading todos..."});if(a)return r.jsx(wt,{error:a});const pe=(n==null?void 0:n.counts)||{open:0,in_progress:0,blocked:0,total:0};return r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[r.jsx(An,{label:"Open",value:pe.open,icon:Dr}),r.jsx(An,{label:"In Progress",value:pe.in_progress,icon:Dr,tone:"info"}),r.jsx(An,{label:"Blocked",value:pe.blocked,icon:ag,tone:"warn"}),r.jsx(An,{label:"Total",value:pe.total,icon:Dr})]}),c&&r.jsx(FB,{bundles:c.bundles}),r.jsx("div",{className:"surface-panel p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{type:"text",placeholder:"Add a todo...",value:b,onChange:Q=>E(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&ke(),className:"h-9 flex-1 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),r.jsxs("button",{onClick:ke,disabled:!b.trim(),className:"inline-flex h-9 items-center gap-1.5 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-40",children:[r.jsx(rn,{className:"h-4 w-4"}),"Add"]})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(fo,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:O,type:"text",placeholder:"Search...",value:u,onChange:Q=>p(Q.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs("select",{value:m,onChange:Q=>h(Q.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All statuses"}),r.jsx("option",{value:"open",children:"Open"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"blocked",children:"Blocked"})]}),G.length>0&&r.jsxs("select",{value:g,onChange:Q=>y(Q.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All tags"}),G.map(Q=>r.jsxs("option",{value:Q,children:["#",Q]},Q))]})]}),N.size>0?r.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[r.jsxs("span",{className:"text-sm font-medium",children:[N.size," selected"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>R(!0),className:"shell-action shell-action--cta",children:"Promote selected"}),r.jsx("button",{type:"button",onClick:()=>{B(null),L(!0)},className:"shell-action",children:"Move to…"}),r.jsx("button",{type:"button",onClick:V,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,A.length>0&&r.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:Z,ref:Q=>{Q&&(Q.indeterminate=I)},onChange:ge,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",A.length,")"]})]}),r.jsx("div",{className:"space-y-3",children:(()=>{let Q=-1;return Ie.map(({config:ye,items:Pe})=>{const lt=!W.isCollapsed(ye.id);return r.jsx(mx,{label:ye.label,count:Pe.length,expanded:lt,onToggle:()=>W.toggle(ye.id),isDropTarget:H===ye.id,onDragOver:te=>at(te,ye),onDragLeave:te=>ie(te,ye),onDrop:te=>Y(te,ye),children:lt&&Pe.map(te=>(Q+=1,r.jsx(ZS,{item:te,copiedId:j,selected:N.has(te.id),editing:k===te.id,onBeginEdit:be=>C(be),onEndEdit:()=>C(null),onPatchDescription:Ye,onAddAttachments:ot,onDeleteAttachment:J,attachmentUrl:(be,Le)=>mg(t,be,Le),onToggleSelected:be=>de(be),onMoveOne:(be,Le)=>{Le.stopPropagation(),B(be),L(!0)},onStatusChange:Je,onCopyId:M,onDelete:he,hotkeyRowProps:Oe(Q),onDragOrigin:be=>{ne.current=be.target},onDragStart:gt,onDragEnd:Rt,isDragging:se===te.id},te.id)))},ye.id)})})()}),r.jsx(px,{open:D,selectedIds:Array.from(N),scope:{kind:"workspace",workspace:t},onOpenChange:R,onDone:ve}),r.jsx(rN,{open:$,selectedIds:ae,scope:{kind:"workspace",workspace:t},onOpenChange:Q=>{L(Q),Q||B(null)},onDone:me})]})}function SC(){const{views:e}=Vd();async function t(a,l,c){const u=e.find(h=>h.id===a.id)??a,p=hN(c,u.workspace).config,m=kx(u.config,p,u.config);await Lg(a.id,{name:l,config:m})}async function n(a){await Wd({name:`${a.name} (copy)`,workspace:a.workspace,config:a.config})}async function s(a){await KD(a.id)}return{submitEdit:t,duplicate:n,remove:s}}const Ij=80,UB={kanban:"Kanban",list:"List",table:"Table"},VB={title:"Title",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",created:"Created",updated:"Updated"};function NC({open:e,onOpenChange:t,workspace:n,initialView:s,onSubmit:a}){const l=!!s,c=Zo(),u=ef(),{data:p}=Jo(),{data:m}=Md(),[h,g]=f.useState(""),[y,b]=f.useState(Wa.viewMode),[E,j]=f.useState([]),[w,k]=f.useState([]),[C,N]=f.useState([]),[T,D]=f.useState([]),[R,$]=f.useState([]),[L,K]=f.useState([]),[B,O]=f.useState("all"),[W,se]=f.useState(null),[z,H]=f.useState(""),[ee,ne]=f.useState(Wa.sortField),[M,G]=f.useState(Wa.sortDirection),[A,F]=f.useState(!1),[Z,I]=f.useState(null);function de(){b(Wa.viewMode),j([]),k([]),N([]),D([]),$([]),K([]),O("all"),se(null),H(""),ne(Wa.sortField),G(Wa.sortDirection)}f.useEffect(()=>{if(e)if(I(null),F(!1),s){const J=s.config.filters;g(s.name),b(s.config.viewMode),j(tt(J.status)),k(tt(J.priority)),N(tt(J.type)),D(tt(J.project)),$(tt(J.assignee)),K(tt(J.tags)),O(J.activity??"all"),se(gN(J.dateRange)),H(J.search??""),ne(s.config.sortField),G(s.config.sortDirection)}else g(""),de()},[e,s]);const ge=J=>Ie=>J?J==="_ungrouped"?Ie.projectWorkspace===null:Ie.projectWorkspace===J:!0,V=f.useMemo(()=>{const J=Ne=>n?n==="_ungrouped"?Ne.workspace===null:Ne.workspace===n:!0,Ie=(p??[]).filter(J);return[{value:"__standalone__",label:"No project"},...Ie.map(Ne=>({value:Ne.slug,label:Ne.title}))]},[p,n]),ae=f.useMemo(()=>{const J=new Set,Ie=ge(n);for(const Oe of(m==null?void 0:m.assignments)??[])Ie(Oe)&&Oe.assignee&&J.add(Oe.assignee);const Ne=[{value:"__unassigned__",label:"Unassigned"}];for(const Oe of Array.from(J).sort())Ne.push({value:Oe,label:Oe});return Ne},[m,n]),me=f.useMemo(()=>{const J=new Set,Ie=ge(n);for(const Ne of(m==null?void 0:m.assignments)??[])if(Ie(Ne))for(const Oe of Ne.tags??[])J.add(Oe);return Array.from(J).sort().map(Ne=>({value:Ne,label:Ne}))},[m,n]),ve=f.useMemo(()=>c.order.map(J=>({value:J,label:cc(c,J)})),[c]),ke=f.useMemo(()=>rF.map(J=>({value:J,label:J[0].toUpperCase()+J.slice(1)})),[]),he=f.useMemo(()=>u.definitions.map(J=>({value:J.id,label:ii(u,J.id)})),[u]),Je=Ag.map(J=>({value:J,label:UB[J]})),Ye=h.trim(),ot=Ye.length>0&&Ye.length<=Ij;return r.jsx(ar,{open:e,onOpenChange:t,children:r.jsx(Kn,{className:"max-w-lg",children:r.jsxs("form",{className:"space-y-4",onSubmit:async J=>{if(J.preventDefault(),!ot||A)return;F(!0),I(null);const Ie={viewMode:y,filters:{status:E,priority:w,type:C,project:T,assignee:R,tags:L,activity:B,dateRange:Xl(W),search:z},sortField:ee,sortDirection:M};try{await a(Ye,Ie)}catch(Ne){I(Ne instanceof Error?Ne.message:String(Ne)),F(!1)}},children:[r.jsx(Zr,{children:r.jsx(qn,{children:l?"Edit view":"Create view"})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"block text-xs font-medium text-muted-foreground",htmlFor:"create-view-name",children:"Name"}),r.jsx("input",{id:"create-view-name",type:"text",value:h,autoFocus:!0,required:!0,maxLength:Ij,onChange:J=>g(J.target.value),placeholder:"View name",className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("span",{className:"block text-xs font-medium text-muted-foreground",children:"View mode"}),r.jsx(nf,{value:y,onChange:J=>b(J),options:Je})]}),r.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[r.jsx(os,{label:"Status",children:r.jsx(Pn,{ariaLabel:"Status filter",className:"w-full",allLabel:"All statuses",options:ve,value:E,onChange:j})}),r.jsx(os,{label:"Priority",children:r.jsx(Pn,{ariaLabel:"Priority filter",className:"w-full",allLabel:"All priorities",options:ke,value:w,onChange:k})}),r.jsx(os,{label:"Type",children:r.jsx(Pn,{ariaLabel:"Type filter",className:"w-full",allLabel:"All types",options:he,value:C,onChange:N})}),r.jsx(os,{label:"Project",children:r.jsx(Pn,{ariaLabel:"Project filter",className:"w-full",allLabel:"All projects",options:V,value:T,onChange:D})}),r.jsx(os,{label:"Assignee",children:r.jsx(Pn,{ariaLabel:"Assignee filter",className:"w-full",allLabel:"All assignees",options:ae,value:R,onChange:$})}),r.jsx(os,{label:"Tags",children:r.jsx(Pn,{ariaLabel:"Tags filter",className:"w-full",allLabel:"Any tags",options:me,value:L,onChange:K})}),r.jsx(os,{label:"Activity",children:r.jsxs("select",{value:B,onChange:J=>O(J.target.value),className:"editor-input w-full",children:[r.jsx("option",{value:"all",children:"All activity"}),r.jsx("option",{value:"stale",children:"Stale only"}),r.jsx("option",{value:"fresh",children:"Fresh only"})]})}),r.jsx(os,{label:"Date range",children:r.jsx(jx,{className:"w-full",value:W,onChange:se})}),r.jsx(os,{label:"Search",className:"sm:col-span-2",children:r.jsx("input",{type:"text",value:z,onChange:J=>H(J.target.value),placeholder:"Title / slug / project contains…",className:"editor-input w-full"})}),r.jsx(os,{label:"Sort by",className:"sm:col-span-2",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx("select",{value:ee,onChange:J=>ne(J.target.value),className:"editor-input w-full",children:n1.map(J=>r.jsx("option",{value:J,children:VB[J]},J))}),r.jsx("button",{type:"button",onClick:()=>G(J=>J==="asc"?"desc":"asc"),className:"shell-action shrink-0",title:M==="asc"?"Ascending":"Descending",children:M==="asc"?"Asc":"Desc"})]})})]}),Z?r.jsx("p",{className:"text-xs text-error-foreground",role:"alert",children:Z}):null,r.jsxs(Ls,{className:"sm:justify-between",children:[r.jsx("button",{type:"button",onClick:de,className:"shell-action",disabled:A,children:"Clear all"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>t(!1),className:"shell-action",disabled:A,children:"Cancel"}),r.jsx("button",{type:"submit",disabled:!ot||A,className:"shell-action shell-action--cta disabled:opacity-50",children:A?"Saving…":l?"Save changes":"Create view"})]})]})]})})})}function os({label:e,className:t,children:n}){return r.jsxs("label",{className:`space-y-1 ${t??""}`,children:[r.jsx("span",{className:"block text-xs font-medium text-muted-foreground",children:e}),n]})}const HB={kanban:"Kanban",list:"List",table:"Table"};function Mj(){const{workspace:e}=$t(),{views:t,loading:n}=Vd(),{submitEdit:s,duplicate:a,remove:l}=SC(),{toast:c,showToast:u,dismissToast:p}=ta(),[m,h]=f.useState(null),[g,y]=f.useState(!1),[b,E]=f.useState(!1),[j,w]=f.useState(null);async function k(R,$){const{workspace:L,config:K}=hN($,e??null);try{await Wd({name:R,workspace:L,config:K}),E(!1),u(`Created view "${R}"`)}catch(B){throw u(B instanceof Error?B.message:"Failed to create saved view"),B}}async function C(R,$,L){try{await s(R,$,L),w(null),u(`Updated view "${$}"`)}catch(K){throw u(K instanceof Error?K.message:"Failed to update saved view"),K}}async function N(R){try{await a(R),u(`Duplicated "${R.name}"`)}catch($){u($ instanceof Error?$.message:"Failed to duplicate saved view")}}async function T(){if(m){y(!0);try{await l(m),h(null)}catch(R){u(R instanceof Error?R.message:"Failed to delete saved view")}finally{y(!1)}}}const D=r.jsxs("button",{type:"button",onClick:()=>E(!0),className:"shell-action inline-flex items-center gap-1.5 shell-action--cta",children:[r.jsx(rn,{className:"h-4 w-4"}),"Create view"]});return r.jsxs("div",{className:"space-y-4",children:[r.jsx(xd,{title:"Saved Views",description:"Create a view here, or open, edit, and reuse views captured from any board.",actions:D}),n?r.jsx(mt,{label:"Loading saved views…"}):t.length===0?r.jsx(St,{title:"No saved views yet",description:"Create your first view here, or capture one from any assignments board.",actions:D}):r.jsx(We,{children:r.jsx("ul",{className:"divide-y divide-border/60",children:t.map(R=>r.jsx(WB,{view:R,onRequestDelete:()=>h(R),onRequestEdit:()=>w(R),onRequestDuplicate:()=>void N(R)},R.id))})}),r.jsx(NC,{open:b||j!==null,onOpenChange:R=>{R||(E(!1),w(null))},workspace:j?j.workspace:e??null,initialView:j,onSubmit:j?(R,$)=>C(j,R,$):k}),r.jsx(sa,{open:m!==null,title:"Delete saved view?",description:m?`Delete '${m.name}'? Any Overview widgets referencing this view will become empty.`:"",confirmLabel:"Delete",loading:g,destructive:!0,onConfirm:T,onOpenChange:R=>{!R&&!g&&h(null)}}),r.jsx(na,{toast:c,onDismiss:p})]})}function WB({view:e,onRequestDelete:t,onRequestEdit:n,onRequestDuplicate:s}){const a=Dt(),l=()=>a(yN(e)),c=vN(e.config.filters),u=e.workspace?yn(e.workspace):null;return r.jsxs("li",{className:"flex flex-wrap items-center gap-3 py-3",children:[r.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:l,className:"truncate text-left text-sm font-semibold text-foreground hover:text-primary",title:"Open view",children:e.name}),r.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full border border-border/70 bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:HB[e.config.viewMode]}),u?r.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full border border-border/70 bg-muted/60 px-2 py-0.5 text-xs text-muted-foreground",children:u}):null]}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:c})]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsx("button",{type:"button",onClick:l,className:"shell-action",children:"Open"}),r.jsx("button",{type:"button",onClick:n,className:"shell-action",children:"Edit"}),r.jsx("button",{type:"button",onClick:s,className:"shell-action",children:"Duplicate"}),r.jsx("button",{type:"button",onClick:t,className:"shell-action border-destructive/40 text-destructive hover:bg-destructive/10",children:"Delete"})]})]})}const KB={kanban:"Kanban",list:"List",table:"Table"};function _j(){const{id:e,workspace:t}=$t(),n=Dt(),{view:s,ready:a,error:l,refetch:c}=Go(e),{submitEdit:u,duplicate:p,remove:m}=SC(),{toast:h,showToast:g,dismissToast:y}=ta(),[b,E]=f.useState(!1),[j,w]=f.useState(!1),[k,C]=f.useState(!1);if(f.useEffect(()=>{!a||!s||(t??null)!==(s.workspace??null)&&n(yN(s),{replace:!0})},[a,s,t,n]),!a)return r.jsx(mt,{label:"Loading view…"});if(l)return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-6 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load view"}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:l.message}),r.jsx("button",{type:"button",onClick:()=>c(),className:"shell-action mt-3",children:"Retry"})]});if(!s)return r.jsxs("div",{className:"space-y-3",children:[r.jsx(xd,{title:"View not found",description:"This saved view no longer exists."}),r.jsxs(Ee,{to:Xu(t??null),className:"shell-action inline-flex items-center gap-1.5",children:[r.jsx(td,{className:"h-4 w-4"})," Back to Saved Views"]})]});const N=s.workspace?yn(s.workspace):null;async function T($,L){const K=s;try{await u(K,$,L),E(!1),g(`Updated view "${$}"`)}catch(B){throw g(B instanceof Error?B.message:"Failed to update saved view"),B}}async function D(){const $=s;try{await p($),g(`Duplicated "${$.name}"`)}catch(L){g(L instanceof Error?L.message:"Failed to duplicate saved view")}}async function R(){const $=s;C(!0);try{await m($),w(!1),n(Xu($.workspace))}catch(L){g(L instanceof Error?L.message:"Failed to delete saved view")}finally{C(!1)}}return r.jsxs("div",{className:"space-y-4",children:[r.jsxs(Ee,{to:Xu(s.workspace),className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[r.jsx(td,{className:"h-4 w-4"})," Saved Views"]}),r.jsx(xd,{title:s.name,description:vN(s.config.filters),actions:r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full border border-border/70 bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:KB[s.config.viewMode]}),N?r.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full border border-border/70 bg-muted/60 px-2 py-0.5 text-xs text-muted-foreground",children:N}):null,r.jsx("button",{type:"button",onClick:()=>E(!0),className:"shell-action",children:"Edit"}),r.jsx("button",{type:"button",onClick:()=>void D(),className:"shell-action",children:"Duplicate"}),r.jsx("button",{type:"button",onClick:()=>n(bN(s)),className:"shell-action",children:"Open on board"}),r.jsx("button",{type:"button",onClick:()=>w(!0),className:"shell-action border-destructive/40 text-destructive hover:bg-destructive/10",children:"Delete"})]})}),r.jsx(K1,{view:s}),b?r.jsx(NC,{open:b,onOpenChange:E,workspace:s.workspace,initialView:s,onSubmit:T}):null,r.jsx(sa,{open:j,title:"Delete saved view?",description:`Delete '${s.name}'? Any Overview widgets referencing this view will become empty.`,confirmLabel:"Delete",loading:k,destructive:!0,onConfirm:R,onOpenChange:$=>{!$&&!k&&w(!1)}}),r.jsx(na,{toast:h,onDismiss:y})]})}function qB(){return r.jsx(_T,{children:r.jsx(Z3,{children:r.jsx(pT,{children:r.jsxs(He,{element:r.jsx(TD,{}),children:[r.jsx(He,{path:"/",element:r.jsx(gL,{})}),r.jsx(He,{path:"/projects",element:r.jsx(sw,{})}),r.jsx(He,{path:"/archive",element:r.jsx(DL,{})}),r.jsx(He,{path:"/assignments",element:r.jsx(uj,{})}),r.jsx(He,{path:"/assignments/new",element:r.jsx(mj,{})}),r.jsx(He,{path:"/assignments/:id",element:r.jsx(IF,{})}),r.jsx(He,{path:"/assignments/:id/edit",element:r.jsx(Ym,{})}),r.jsx(He,{path:"/assignments/:id/plan/edit",element:r.jsx(Jm,{})}),r.jsx(He,{path:"/assignments/:id/scratchpad/edit",element:r.jsx(Xm,{})}),r.jsx(He,{path:"/assignments/:id/handoff/edit",element:r.jsx(Qm,{})}),r.jsx(He,{path:"/assignments/:id/decision-record/edit",element:r.jsx(Zm,{})}),r.jsx(He,{path:"/servers",element:r.jsx(gj,{})}),r.jsx(He,{path:"/inventories",element:r.jsx(xj,{})}),r.jsx(He,{path:"/usage",element:r.jsx(yj,{})}),r.jsx(He,{path:"/agent-sessions",element:r.jsx(bj,{})}),r.jsx(He,{path:"/playbooks",element:r.jsx(m6,{})}),r.jsx(He,{path:"/playbooks/create",element:r.jsx(g6,{})}),r.jsx(He,{path:"/playbooks/:slug",element:r.jsx(h6,{})}),r.jsx(He,{path:"/playbooks/:slug/edit",element:r.jsx(x6,{})}),r.jsx(He,{path:"/memories",element:r.jsx(y6,{})}),r.jsx(He,{path:"/memories/new",element:r.jsx(v6,{})}),r.jsx(He,{path:"/projects/:slug/memories/:itemSlug",element:r.jsx(b6,{})}),r.jsx(He,{path:"/projects/:slug/memories/:itemSlug/edit",element:r.jsx(w6,{})}),r.jsx(He,{path:"/resources",element:r.jsx(j6,{})}),r.jsx(He,{path:"/resources/new",element:r.jsx(S6,{})}),r.jsx(He,{path:"/projects/:slug/resources/:itemSlug",element:r.jsx(k6,{})}),r.jsx(He,{path:"/projects/:slug/resources/:itemSlug/edit",element:r.jsx(N6,{})}),r.jsx(He,{path:"/todos",element:r.jsx(IB,{})}),r.jsx(He,{path:"/views",element:r.jsx(Mj,{})}),r.jsx(He,{path:"/views/:id",element:r.jsx(_j,{})}),r.jsx(He,{path:"/help",element:r.jsx(yL,{})}),r.jsx(He,{path:"/settings",element:r.jsx(OB,{})}),r.jsx(He,{path:"/create/project",element:r.jsx(fj,{})}),r.jsx(He,{path:"/projects/:slug",element:r.jsx(oj,{})}),r.jsx(He,{path:"/projects/:slug/edit",element:r.jsx(hj,{})}),r.jsx(He,{path:"/projects/:slug/create/assignment",element:r.jsx(pj,{})}),r.jsx(He,{path:"/projects/:slug/assignments/:aslug",element:r.jsx(ij,{})}),r.jsx(He,{path:"/projects/:slug/assignments/:aslug/edit",element:r.jsx(Ym,{})}),r.jsx(He,{path:"/projects/:slug/assignments/:aslug/plan/edit",element:r.jsx(Jm,{})}),r.jsx(He,{path:"/projects/:slug/assignments/:aslug/scratchpad/edit",element:r.jsx(Xm,{})}),r.jsx(He,{path:"/projects/:slug/assignments/:aslug/handoff/edit",element:r.jsx(Qm,{})}),r.jsx(He,{path:"/projects/:slug/assignments/:aslug/decision-record/edit",element:r.jsx(Zm,{})}),r.jsx(He,{path:"/w/:workspace/projects",element:r.jsx(sw,{})}),r.jsx(He,{path:"/w/:workspace/assignments",element:r.jsx(uj,{})}),r.jsx(He,{path:"/w/:workspace/assignments/new",element:r.jsx(mj,{})}),r.jsx(He,{path:"/w/:workspace/servers",element:r.jsx(gj,{})}),r.jsx(He,{path:"/w/:workspace/inventories",element:r.jsx(xj,{})}),r.jsx(He,{path:"/w/:workspace/usage",element:r.jsx(yj,{})}),r.jsx(He,{path:"/w/:workspace/agent-sessions",element:r.jsx(bj,{})}),r.jsx(He,{path:"/w/:workspace/todos",element:r.jsx(BB,{})}),r.jsx(He,{path:"/w/:workspace/views",element:r.jsx(Mj,{})}),r.jsx(He,{path:"/w/:workspace/views/:id",element:r.jsx(_j,{})}),r.jsx(He,{path:"/w/:workspace/create/project",element:r.jsx(fj,{})}),r.jsx(He,{path:"/w/:workspace/projects/:slug",element:r.jsx(oj,{})}),r.jsx(He,{path:"/w/:workspace/projects/:slug/edit",element:r.jsx(hj,{})}),r.jsx(He,{path:"/w/:workspace/projects/:slug/create/assignment",element:r.jsx(pj,{})}),r.jsx(He,{path:"/w/:workspace/projects/:slug/assignments/:aslug",element:r.jsx(ij,{})}),r.jsx(He,{path:"/w/:workspace/projects/:slug/assignments/:aslug/edit",element:r.jsx(Ym,{})}),r.jsx(He,{path:"/w/:workspace/projects/:slug/assignments/:aslug/plan/edit",element:r.jsx(Jm,{})}),r.jsx(He,{path:"/w/:workspace/projects/:slug/assignments/:aslug/scratchpad/edit",element:r.jsx(Xm,{})}),r.jsx(He,{path:"/w/:workspace/projects/:slug/assignments/:aslug/handoff/edit",element:r.jsx(Qm,{})}),r.jsx(He,{path:"/w/:workspace/projects/:slug/assignments/:aslug/decision-record/edit",element:r.jsx(Zm,{})})]})})})})}xP();p2.createRoot(document.getElementById("root")).render(r.jsx(f.StrictMode,{children:r.jsx(yP,{children:r.jsx(qB,{})})}));export{rO as _,YB as a,Td as g};
|