syntaur 0.16.0 → 0.16.2

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.
Files changed (65) hide show
  1. package/dashboard/dist/assets/{_basePickBy-B1S22H85.js → _basePickBy-DTuHiZCP.js} +1 -1
  2. package/dashboard/dist/assets/{_baseUniq-CJIRCCsh.js → _baseUniq-BjbISCNN.js} +1 -1
  3. package/dashboard/dist/assets/{arc-CdlNYTcd.js → arc-D9mCa8If.js} +1 -1
  4. package/dashboard/dist/assets/{architectureDiagram-2XIMDMQ5-KVI0HWOy.js → architectureDiagram-2XIMDMQ5-CLWheiZu.js} +1 -1
  5. package/dashboard/dist/assets/{blockDiagram-WCTKOSBZ-ClnG7gaq.js → blockDiagram-WCTKOSBZ-BBxrVTWB.js} +1 -1
  6. package/dashboard/dist/assets/{c4Diagram-IC4MRINW-BD9lkttL.js → c4Diagram-IC4MRINW-DnhDZ2W3.js} +1 -1
  7. package/dashboard/dist/assets/channel-CN5VmjNa.js +1 -0
  8. package/dashboard/dist/assets/{chunk-4BX2VUAB-BM3DXZMG.js → chunk-4BX2VUAB-DeAfVeDa.js} +1 -1
  9. package/dashboard/dist/assets/{chunk-55IACEB6-DUIbFJ3r.js → chunk-55IACEB6-cKEeGDNI.js} +1 -1
  10. package/dashboard/dist/assets/{chunk-FMBD7UC4-B_cxCRkA.js → chunk-FMBD7UC4-7RuZ6HEq.js} +1 -1
  11. package/dashboard/dist/assets/{chunk-JSJVCQXG-2mLf1WoM.js → chunk-JSJVCQXG-B5dwG0bv.js} +1 -1
  12. package/dashboard/dist/assets/{chunk-KX2RTZJC-BMz3ND2R.js → chunk-KX2RTZJC-DeyQYDVj.js} +1 -1
  13. package/dashboard/dist/assets/{chunk-NQ4KR5QH-DiCxpw3L.js → chunk-NQ4KR5QH-NYo4hSqA.js} +1 -1
  14. package/dashboard/dist/assets/{chunk-QZHKN3VN-BcaWPzd5.js → chunk-QZHKN3VN-CtJFICF8.js} +1 -1
  15. package/dashboard/dist/assets/{chunk-WL4C6EOR-BbsfhS6J.js → chunk-WL4C6EOR-DZ3WYdab.js} +1 -1
  16. package/dashboard/dist/assets/classDiagram-VBA2DB6C-CqLb9GuU.js +1 -0
  17. package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-CqLb9GuU.js +1 -0
  18. package/dashboard/dist/assets/clone-DwvrjCQs.js +1 -0
  19. package/dashboard/dist/assets/{cose-bilkent-S5V4N54A-iuQzyyrA.js → cose-bilkent-S5V4N54A-DaYOsf-M.js} +1 -1
  20. package/dashboard/dist/assets/{dagre-KLK3FWXG-C0TB1zg5.js → dagre-KLK3FWXG-DzLc7ykF.js} +1 -1
  21. package/dashboard/dist/assets/{diagram-E7M64L7V-Ck8tvxP2.js → diagram-E7M64L7V-kpjEdOqb.js} +1 -1
  22. package/dashboard/dist/assets/{diagram-IFDJBPK2-rQKIi-sc.js → diagram-IFDJBPK2-D3EHoh6j.js} +1 -1
  23. package/dashboard/dist/assets/{diagram-P4PSJMXO-DS1RGSgx.js → diagram-P4PSJMXO-Cp6Un2ys.js} +1 -1
  24. package/dashboard/dist/assets/{erDiagram-INFDFZHY-BqWCybWW.js → erDiagram-INFDFZHY-DDjOUPWk.js} +1 -1
  25. package/dashboard/dist/assets/{flowDiagram-PKNHOUZH-BCoQtyQ5.js → flowDiagram-PKNHOUZH-CfO51xge.js} +1 -1
  26. package/dashboard/dist/assets/{ganttDiagram-A5KZAMGK-CD1BmicP.js → ganttDiagram-A5KZAMGK-BDzAtkcp.js} +1 -1
  27. package/dashboard/dist/assets/{gitGraphDiagram-K3NZZRJ6-tGDYOZuO.js → gitGraphDiagram-K3NZZRJ6-JPMFN2zF.js} +1 -1
  28. package/dashboard/dist/assets/{graph-BT0s-094.js → graph-DXDryilu.js} +1 -1
  29. package/dashboard/dist/assets/index-D7UtkCYM.js +515 -0
  30. package/dashboard/dist/assets/{index-D2Yoi6DJ.css → index-DTXSWSzH.css} +1 -1
  31. package/dashboard/dist/assets/{infoDiagram-LFFYTUFH-E4dVb8BD.js → infoDiagram-LFFYTUFH-CYi5kkvz.js} +1 -1
  32. package/dashboard/dist/assets/{ishikawaDiagram-PHBUUO56-CubuM_ev.js → ishikawaDiagram-PHBUUO56-DQl_IUe8.js} +1 -1
  33. package/dashboard/dist/assets/{journeyDiagram-4ABVD52K-DfyJbgMF.js → journeyDiagram-4ABVD52K-BXXGPcrS.js} +1 -1
  34. package/dashboard/dist/assets/{kanban-definition-K7BYSVSG-BXamajyZ.js → kanban-definition-K7BYSVSG-BqJestUY.js} +1 -1
  35. package/dashboard/dist/assets/{layout-6b_SlWD_.js → layout-D5VdYmWn.js} +1 -1
  36. package/dashboard/dist/assets/{linear-BE0O-66A.js → linear-dZA_O_GN.js} +1 -1
  37. package/dashboard/dist/assets/{mermaid.core-DM3qWr07.js → mermaid.core-B0Ixd1yP.js} +4 -4
  38. package/dashboard/dist/assets/{mindmap-definition-YRQLILUH-puOtERrG.js → mindmap-definition-YRQLILUH-CSJYdSMG.js} +1 -1
  39. package/dashboard/dist/assets/{pieDiagram-SKSYHLDU-cE6l8UBX.js → pieDiagram-SKSYHLDU-DmYrRZHN.js} +1 -1
  40. package/dashboard/dist/assets/{quadrantDiagram-337W2JSQ-CgDAyZQP.js → quadrantDiagram-337W2JSQ-La3ce5kE.js} +1 -1
  41. package/dashboard/dist/assets/{requirementDiagram-Z7DCOOCP-CJrai_8U.js → requirementDiagram-Z7DCOOCP-DPitIZQl.js} +1 -1
  42. package/dashboard/dist/assets/{sankeyDiagram-WA2Y5GQK-Bf72l7UW.js → sankeyDiagram-WA2Y5GQK-CAmCqGkr.js} +1 -1
  43. package/dashboard/dist/assets/{sequenceDiagram-2WXFIKYE-0D8RN7ds.js → sequenceDiagram-2WXFIKYE-6lEzNTWG.js} +1 -1
  44. package/dashboard/dist/assets/{stateDiagram-RAJIS63D-B8LucUIt.js → stateDiagram-RAJIS63D-DyGKCS2C.js} +1 -1
  45. package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-BOmRICoY.js +1 -0
  46. package/dashboard/dist/assets/{timeline-definition-YZTLITO2-DL3Hq8ii.js → timeline-definition-YZTLITO2-D9RxQE3j.js} +1 -1
  47. package/dashboard/dist/assets/{treemap-KZPCXAKY-wF1X4_uI.js → treemap-KZPCXAKY-TuXbGNN4.js} +1 -1
  48. package/dashboard/dist/assets/{vennDiagram-LZ73GAT5-DDAjoGTZ.js → vennDiagram-LZ73GAT5-Bly5knr-.js} +1 -1
  49. package/dashboard/dist/assets/{xychartDiagram-JWTSCODW-T-YmzRW8.js → xychartDiagram-JWTSCODW-CA-5z7-4.js} +1 -1
  50. package/dashboard/dist/index.html +2 -2
  51. package/dist/dashboard/server.js +820 -166
  52. package/dist/dashboard/server.js.map +1 -1
  53. package/dist/index.js +1244 -774
  54. package/dist/index.js.map +1 -1
  55. package/dist/launch/index.d.ts +20 -2
  56. package/dist/launch/index.js +67 -20
  57. package/dist/launch/index.js.map +1 -1
  58. package/package.json +1 -1
  59. package/scripts/install-macos-url-handler.mjs +40 -7
  60. package/dashboard/dist/assets/channel-Cm_FzKJq.js +0 -1
  61. package/dashboard/dist/assets/classDiagram-VBA2DB6C-Bdan2Dp5.js +0 -1
  62. package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-Bdan2Dp5.js +0 -1
  63. package/dashboard/dist/assets/clone-9PoPEM_s.js +0 -1
  64. package/dashboard/dist/assets/index-BdSkANCC.js +0 -510
  65. package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-D0dc7wxQ.js +0 -1
@@ -1,510 +0,0 @@
1
- var NN=Object.defineProperty;var CN=(e,t,n)=>t in e?NN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var jy=(e,t,n)=>CN(e,typeof t!="symbol"?t+"":t,n);function EN(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 mu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function q5(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 Cf={exports:{}},fa={},Ef={exports:{}},Xe={};/**
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 ky;function TN(){if(ky)return Xe;ky=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"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),x=Symbol.iterator;function y($){return $===null||typeof $!="object"?null:($=x&&$[x]||$["@@iterator"],typeof $=="function"?$:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,k={};function w($,Z,L){this.props=$,this.context=Z,this.refs=k,this.updater=L||v}w.prototype.isReactComponent={},w.prototype.setState=function($,Z){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,Z,"setState")},w.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function S(){}S.prototype=w.prototype;function T($,Z,L){this.props=$,this.context=Z,this.refs=k,this.updater=L||v}var N=T.prototype=new S;N.constructor=T,E(N,w.prototype),N.isPureReactComponent=!0;var A=Array.isArray,M=Object.prototype.hasOwnProperty,R={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function O($,Z,L){var ae,ce={},Q=null,ge=null;if(Z!=null)for(ae in Z.ref!==void 0&&(ge=Z.ref),Z.key!==void 0&&(Q=""+Z.key),Z)M.call(Z,ae)&&!I.hasOwnProperty(ae)&&(ce[ae]=Z[ae]);var je=arguments.length-2;if(je===1)ce.children=L;else if(1<je){for(var Ne=Array(je),ke=0;ke<je;ke++)Ne[ke]=arguments[ke+2];ce.children=Ne}if($&&$.defaultProps)for(ae in je=$.defaultProps,je)ce[ae]===void 0&&(ce[ae]=je[ae]);return{$$typeof:e,type:$,key:Q,ref:ge,props:ce,_owner:R.current}}function Y($,Z){return{$$typeof:e,type:$.type,key:Z,ref:$.ref,props:$.props,_owner:$._owner}}function J($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function _($){var Z={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(L){return Z[L]})}var U=/\/+/g;function X($,Z){return typeof $=="object"&&$!==null&&$.key!=null?_(""+$.key):Z.toString(36)}function q($,Z,L,ae,ce){var Q=typeof $;(Q==="undefined"||Q==="boolean")&&($=null);var ge=!1;if($===null)ge=!0;else switch(Q){case"string":case"number":ge=!0;break;case"object":switch($.$$typeof){case e:case t:ge=!0}}if(ge)return ge=$,ce=ce(ge),$=ae===""?"."+X(ge,0):ae,A(ce)?(L="",$!=null&&(L=$.replace(U,"$&/")+"/"),q(ce,Z,L,"",function(ke){return ke})):ce!=null&&(J(ce)&&(ce=Y(ce,L+(!ce.key||ge&&ge.key===ce.key?"":(""+ce.key).replace(U,"$&/")+"/")+$)),Z.push(ce)),1;if(ge=0,ae=ae===""?".":ae+":",A($))for(var je=0;je<$.length;je++){Q=$[je];var Ne=ae+X(Q,je);ge+=q(Q,Z,L,Ne,ce)}else if(Ne=y($),typeof Ne=="function")for($=Ne.call($),je=0;!(Q=$.next()).done;)Q=Q.value,Ne=ae+X(Q,je++),ge+=q(Q,Z,L,Ne,ce);else if(Q==="object")throw Z=String($),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.");return ge}function G($,Z,L){if($==null)return $;var ae=[],ce=0;return q($,ae,"","",function(Q){return Z.call(L,Q,ce++)}),ae}function B($){if($._status===-1){var Z=$._result;Z=Z(),Z.then(function(L){($._status===0||$._status===-1)&&($._status=1,$._result=L)},function(L){($._status===0||$._status===-1)&&($._status=2,$._result=L)}),$._status===-1&&($._status=0,$._result=Z)}if($._status===1)return $._result.default;throw $._result}var W={current:null},D={transition:null},ee={ReactCurrentDispatcher:W,ReactCurrentBatchConfig:D,ReactCurrentOwner:R};function C(){throw Error("act(...) is not supported in production builds of React.")}return Xe.Children={map:G,forEach:function($,Z,L){G($,function(){Z.apply(this,arguments)},L)},count:function($){var Z=0;return G($,function(){Z++}),Z},toArray:function($){return G($,function(Z){return Z})||[]},only:function($){if(!J($))throw Error("React.Children.only expected to receive a single React element child.");return $}},Xe.Component=w,Xe.Fragment=n,Xe.Profiler=a,Xe.PureComponent=T,Xe.StrictMode=s,Xe.Suspense=f,Xe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,Xe.act=C,Xe.cloneElement=function($,Z,L){if($==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+$+".");var ae=E({},$.props),ce=$.key,Q=$.ref,ge=$._owner;if(Z!=null){if(Z.ref!==void 0&&(Q=Z.ref,ge=R.current),Z.key!==void 0&&(ce=""+Z.key),$.type&&$.type.defaultProps)var je=$.type.defaultProps;for(Ne in Z)M.call(Z,Ne)&&!I.hasOwnProperty(Ne)&&(ae[Ne]=Z[Ne]===void 0&&je!==void 0?je[Ne]:Z[Ne])}var Ne=arguments.length-2;if(Ne===1)ae.children=L;else if(1<Ne){je=Array(Ne);for(var ke=0;ke<Ne;ke++)je[ke]=arguments[ke+2];ae.children=je}return{$$typeof:e,type:$.type,key:ce,ref:Q,props:ae,_owner:ge}},Xe.createContext=function($){return $={$$typeof:c,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},$.Provider={$$typeof:l,_context:$},$.Consumer=$},Xe.createElement=O,Xe.createFactory=function($){var Z=O.bind(null,$);return Z.type=$,Z},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function($){return{$$typeof:d,render:$}},Xe.isValidElement=J,Xe.lazy=function($){return{$$typeof:g,_payload:{_status:-1,_result:$},_init:B}},Xe.memo=function($,Z){return{$$typeof:m,type:$,compare:Z===void 0?null:Z}},Xe.startTransition=function($){var Z=D.transition;D.transition={};try{$()}finally{D.transition=Z}},Xe.unstable_act=C,Xe.useCallback=function($,Z){return W.current.useCallback($,Z)},Xe.useContext=function($){return W.current.useContext($)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function($){return W.current.useDeferredValue($)},Xe.useEffect=function($,Z){return W.current.useEffect($,Z)},Xe.useId=function(){return W.current.useId()},Xe.useImperativeHandle=function($,Z,L){return W.current.useImperativeHandle($,Z,L)},Xe.useInsertionEffect=function($,Z){return W.current.useInsertionEffect($,Z)},Xe.useLayoutEffect=function($,Z){return W.current.useLayoutEffect($,Z)},Xe.useMemo=function($,Z){return W.current.useMemo($,Z)},Xe.useReducer=function($,Z,L){return W.current.useReducer($,Z,L)},Xe.useRef=function($){return W.current.useRef($)},Xe.useState=function($){return W.current.useState($)},Xe.useSyncExternalStore=function($,Z,L){return W.current.useSyncExternalStore($,Z,L)},Xe.useTransition=function(){return W.current.useTransition()},Xe.version="18.3.1",Xe}var Sy;function om(){return Sy||(Sy=1,Ef.exports=TN()),Ef.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 Ny;function PN(){if(Ny)return fa;Ny=1;var e=om(),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(d,f,m){var g,x={},y=null,v=null;m!==void 0&&(y=""+m),f.key!==void 0&&(y=""+f.key),f.ref!==void 0&&(v=f.ref);for(g in f)s.call(f,g)&&!l.hasOwnProperty(g)&&(x[g]=f[g]);if(d&&d.defaultProps)for(g in f=d.defaultProps,f)x[g]===void 0&&(x[g]=f[g]);return{$$typeof:t,type:d,key:y,ref:v,props:x,_owner:a.current}}return fa.Fragment=n,fa.jsx=c,fa.jsxs=c,fa}var Cy;function RN(){return Cy||(Cy=1,Cf.exports=PN()),Cf.exports}var r=RN(),p=om();const Lt=mu(p),Xb=EN({__proto__:null,default:Lt},[p]);var vc={},Tf={exports:{}},Ln={},Pf={exports:{}},Rf={};/**
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 Ey;function AN(){return Ey||(Ey=1,(function(e){function t(D,ee){var C=D.length;D.push(ee);e:for(;0<C;){var $=C-1>>>1,Z=D[$];if(0<a(Z,ee))D[$]=ee,D[C]=Z,C=$;else break e}}function n(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var ee=D[0],C=D.pop();if(C!==ee){D[0]=C;e:for(var $=0,Z=D.length,L=Z>>>1;$<L;){var ae=2*($+1)-1,ce=D[ae],Q=ae+1,ge=D[Q];if(0>a(ce,C))Q<Z&&0>a(ge,ce)?(D[$]=ge,D[Q]=C,$=Q):(D[$]=ce,D[ae]=C,$=ae);else if(Q<Z&&0>a(ge,C))D[$]=ge,D[Q]=C,$=Q;else break e}}return ee}function a(D,ee){var C=D.sortIndex-ee.sortIndex;return C!==0?C:D.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],m=[],g=1,x=null,y=3,v=!1,E=!1,k=!1,w=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,T=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(D){for(var ee=n(m);ee!==null;){if(ee.callback===null)s(m);else if(ee.startTime<=D)s(m),ee.sortIndex=ee.expirationTime,t(f,ee);else break;ee=n(m)}}function A(D){if(k=!1,N(D),!E)if(n(f)!==null)E=!0,B(M);else{var ee=n(m);ee!==null&&W(A,ee.startTime-D)}}function M(D,ee){E=!1,k&&(k=!1,S(O),O=-1),v=!0;var C=y;try{for(N(ee),x=n(f);x!==null&&(!(x.expirationTime>ee)||D&&!_());){var $=x.callback;if(typeof $=="function"){x.callback=null,y=x.priorityLevel;var Z=$(x.expirationTime<=ee);ee=e.unstable_now(),typeof Z=="function"?x.callback=Z:x===n(f)&&s(f),N(ee)}else s(f);x=n(f)}if(x!==null)var L=!0;else{var ae=n(m);ae!==null&&W(A,ae.startTime-ee),L=!1}return L}finally{x=null,y=C,v=!1}}var R=!1,I=null,O=-1,Y=5,J=-1;function _(){return!(e.unstable_now()-J<Y)}function U(){if(I!==null){var D=e.unstable_now();J=D;var ee=!0;try{ee=I(!0,D)}finally{ee?X():(R=!1,I=null)}}else R=!1}var X;if(typeof T=="function")X=function(){T(U)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,G=q.port2;q.port1.onmessage=U,X=function(){G.postMessage(null)}}else X=function(){w(U,0)};function B(D){I=D,R||(R=!0,X())}function W(D,ee){O=w(function(){D(e.unstable_now())},ee)}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(D){D.callback=null},e.unstable_continueExecution=function(){E||v||(E=!0,B(M))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(D){switch(y){case 1:case 2:case 3:var ee=3;break;default:ee=y}var C=y;y=ee;try{return D()}finally{y=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,ee){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var C=y;y=D;try{return ee()}finally{y=C}},e.unstable_scheduleCallback=function(D,ee,C){var $=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?$+C:$):C=$,D){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=C+Z,D={id:g++,callback:ee,priorityLevel:D,startTime:C,expirationTime:Z,sortIndex:-1},C>$?(D.sortIndex=C,t(m,D),n(f)===null&&D===n(m)&&(k?(S(O),O=-1):k=!0,W(A,C-$))):(D.sortIndex=Z,t(f,D),E||v||(E=!0,B(M))),D},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(D){var ee=y;return function(){var C=y;y=ee;try{return D.apply(this,arguments)}finally{y=C}}}})(Rf)),Rf}var Ty;function DN(){return Ty||(Ty=1,Pf.exports=AN()),Pf.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 Py;function IN(){if(Py)return Ln;Py=1;var e=om(),t=DN();function n(o){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+o,u=1;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u]);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 d=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=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]*$/,g={},x={};function y(o){return f.call(x,o)?!0:f.call(g,o)?!1:m.test(o)?x[o]=!0:(g[o]=!0,!1)}function v(o,i,u,h){if(u!==null&&u.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return h?!1:u!==null?!u.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function E(o,i,u,h){if(i===null||typeof i>"u"||v(o,i,u,h))return!0;if(h)return!1;if(u!==null)switch(u.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 k(o,i,u,h,b,j,P){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=h,this.attributeNamespace=b,this.mustUseProperty=u,this.propertyName=o,this.type=i,this.sanitizeURL=j,this.removeEmptyString=P}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new k(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 k(i,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new k(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new k(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 k(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new k(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new k(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new k(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new k(o,5,!1,o.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function T(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(S,T);w[i]=new k(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(S,T);w[i]=new k(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(S,T);w[i]=new k(i,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new k(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new k(o,1,!1,o.toLowerCase(),null,!0,!0)});function N(o,i,u,h){var b=w.hasOwnProperty(i)?w[i]:null;(b!==null?b.type!==0:h||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(E(i,u,b,h)&&(u=null),h||b===null?y(i)&&(u===null?o.removeAttribute(i):o.setAttribute(i,""+u)):b.mustUseProperty?o[b.propertyName]=u===null?b.type===3?!1:"":u:(i=b.attributeName,h=b.attributeNamespace,u===null?o.removeAttribute(i):(b=b.type,u=b===3||b===4&&u===!0?"":""+u,h?o.setAttributeNS(h,i,u):o.setAttribute(i,u))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,M=Symbol.for("react.element"),R=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),J=Symbol.for("react.provider"),_=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),D=Symbol.iterator;function ee(o){return o===null||typeof o!="object"?null:(o=D&&o[D]||o["@@iterator"],typeof o=="function"?o:null)}var C=Object.assign,$;function Z(o){if($===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);$=i&&i[1]||""}return`
34
- `+$+o}var L=!1;function ae(o,i){if(!o||L)return"";L=!0;var u=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(oe){var h=oe}Reflect.construct(o,[],i)}else{try{i.call()}catch(oe){h=oe}o.call(i.prototype)}else{try{throw Error()}catch(oe){h=oe}o()}}catch(oe){if(oe&&h&&typeof oe.stack=="string"){for(var b=oe.stack.split(`
35
- `),j=h.stack.split(`
36
- `),P=b.length-1,F=j.length-1;1<=P&&0<=F&&b[P]!==j[F];)F--;for(;1<=P&&0<=F;P--,F--)if(b[P]!==j[F]){if(P!==1||F!==1)do if(P--,F--,0>F||b[P]!==j[F]){var V=`
37
- `+b[P].replace(" at new "," at ");return o.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",o.displayName)),V}while(1<=P&&0<=F);break}}}finally{L=!1,Error.prepareStackTrace=u}return(o=o?o.displayName||o.name:"")?Z(o):""}function ce(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=ae(o.type,!1),o;case 11:return o=ae(o.type.render,!1),o;case 1:return o=ae(o.type,!0),o;default:return""}}function Q(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 I:return"Fragment";case R:return"Portal";case Y:return"Profiler";case O:return"StrictMode";case X:return"Suspense";case q:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case _:return(o.displayName||"Context")+".Consumer";case J:return(o._context.displayName||"Context")+".Provider";case U:var i=o.render;return o=o.displayName,o||(o=i.displayName||i.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case G:return i=o.displayName||null,i!==null?i:Q(o.type)||"Memo";case B:i=o._payload,o=o._init;try{return Q(o(i))}catch{}}return null}function ge(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 Q(i);case 8:return i===O?"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 je(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ne(o){var i=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ke(o){var i=Ne(o)?"checked":"value",u=Object.getOwnPropertyDescriptor(o.constructor.prototype,i),h=""+o[i];if(!o.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var b=u.get,j=u.set;return Object.defineProperty(o,i,{configurable:!0,get:function(){return b.call(this)},set:function(P){h=""+P,j.call(this,P)}}),Object.defineProperty(o,i,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(P){h=""+P},stopTracking:function(){o._valueTracker=null,delete o[i]}}}}function Ve(o){o._valueTracker||(o._valueTracker=ke(o))}function Ye(o){if(!o)return!1;var i=o._valueTracker;if(!i)return!0;var u=i.getValue(),h="";return o&&(h=Ne(o)?o.checked?"true":"false":o.value),o=h,o!==u?(i.setValue(o),!0):!1}function ie(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 ne(o,i){var u=i.checked;return C({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??o._wrapperState.initialChecked})}function le(o,i){var u=i.defaultValue==null?"":i.defaultValue,h=i.checked!=null?i.checked:i.defaultChecked;u=je(i.value!=null?i.value:u),o._wrapperState={initialChecked:h,initialValue:u,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function H(o,i){i=i.checked,i!=null&&N(o,"checked",i,!1)}function fe(o,i){H(o,i);var u=je(i.value),h=i.type;if(u!=null)h==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+u):o.value!==""+u&&(o.value=""+u);else if(h==="submit"||h==="reset"){o.removeAttribute("value");return}i.hasOwnProperty("value")?_e(o,i.type,u):i.hasOwnProperty("defaultValue")&&_e(o,i.type,je(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(o.defaultChecked=!!i.defaultChecked)}function ve(o,i,u){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var h=i.type;if(!(h!=="submit"&&h!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+o._wrapperState.initialValue,u||i===o.value||(o.value=i),o.defaultValue=i}u=o.name,u!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,u!==""&&(o.name=u)}function _e(o,i,u){(i!=="number"||ie(o.ownerDocument)!==o)&&(u==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+u&&(o.defaultValue=""+u))}var Ie=Array.isArray;function st(o,i,u,h){if(o=o.options,i){i={};for(var b=0;b<u.length;b++)i["$"+u[b]]=!0;for(u=0;u<o.length;u++)b=i.hasOwnProperty("$"+o[u].value),o[u].selected!==b&&(o[u].selected=b),b&&h&&(o[u].defaultSelected=!0)}else{for(u=""+je(u),i=null,b=0;b<o.length;b++){if(o[b].value===u){o[b].selected=!0,h&&(o[b].defaultSelected=!0);return}i!==null||o[b].disabled||(i=o[b])}i!==null&&(i.selected=!0)}}function lt(o,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return C({},i,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function _t(o,i){var u=i.value;if(u==null){if(u=i.children,i=i.defaultValue,u!=null){if(i!=null)throw Error(n(92));if(Ie(u)){if(1<u.length)throw Error(n(93));u=u[0]}i=u}i==null&&(i=""),u=i}o._wrapperState={initialValue:je(u)}}function kt(o,i){var u=je(i.value),h=je(i.defaultValue);u!=null&&(u=""+u,u!==o.value&&(o.value=u),i.defaultValue==null&&o.defaultValue!==u&&(o.defaultValue=u)),h!=null&&(o.defaultValue=""+h)}function St(o){var i=o.textContent;i===o._wrapperState.initialValue&&i!==""&&i!==null&&(o.value=i)}function se(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 pe(o,i){return o==null||o==="http://www.w3.org/1999/xhtml"?se(i):o==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Pe,Fe=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,u,h,b){MSApp.execUnsafeLocalFunction(function(){return o(i,u,h,b)})}: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 qe(o,i){if(i){var u=o.firstChild;if(u&&u===o.lastChild&&u.nodeType===3){u.nodeValue=i;return}}o.textContent=i}var tt={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},me=["Webkit","ms","Moz","O"];Object.keys(tt).forEach(function(o){me.forEach(function(i){i=i+o.charAt(0).toUpperCase()+o.substring(1),tt[i]=tt[o]})});function We(o,i,u){return i==null||typeof i=="boolean"||i===""?"":u||typeof i!="number"||i===0||tt.hasOwnProperty(o)&&tt[o]?(""+i).trim():i+"px"}function He(o,i){o=o.style;for(var u in i)if(i.hasOwnProperty(u)){var h=u.indexOf("--")===0,b=We(u,i[u],h);u==="float"&&(u="cssFloat"),h?o.setProperty(u,b):o[u]=b}}var cn=C({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(cn[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 Tn(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 Qt=null;function Hn(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var fr=null,Rr=null,mt=null;function Ft(o){if(o=Ji(o)){if(typeof fr!="function")throw Error(n(280));var i=o.stateNode;i&&(i=Ol(i),fr(o.stateNode,o.type,i))}}function qt(o){Rr?mt?mt.push(o):mt=[o]:Rr=o}function kn(){if(Rr){var o=Rr,i=mt;if(mt=Rr=null,Ft(o),i)for(o=0;o<i.length;o++)Ft(i[o])}}function un(o,i){return o(i)}function Zt(){}var ct=!1;function pr(o,i,u){if(ct)return o(i,u);ct=!0;try{return un(o,i,u)}finally{ct=!1,(Rr!==null||mt!==null)&&(Zt(),kn())}}function ut(o,i){var u=o.stateNode;if(u===null)return null;var h=Ol(u);if(h===null)return null;u=h[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":(h=!h.disabled)||(o=o.type,h=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!h;break e;default:o=!1}if(o)return null;if(u&&typeof u!="function")throw Error(n(231,i,typeof u));return u}var Pn=!1;if(d)try{var en={};Object.defineProperty(en,"passive",{get:function(){Pn=!0}}),window.addEventListener("test",en,en),window.removeEventListener("test",en,en)}catch{Pn=!1}function Wn(o,i,u,h,b,j,P,F,V){var oe=Array.prototype.slice.call(arguments,3);try{i.apply(u,oe)}catch(he){this.onError(he)}}var tn=!1,z=null,ue=!1,Se=null,Je={onError:function(o){tn=!0,z=o}};function er(o,i,u,h,b,j,P,F,V){tn=!1,z=null,Wn.apply(Je,arguments)}function hn(o,i,u,h,b,j,P,F,V){if(er.apply(this,arguments),tn){if(tn){var oe=z;tn=!1,z=null}else throw Error(n(198));ue||(ue=!0,Se=oe)}}function dt(o){var i=o,u=o;if(o.alternate)for(;i.return;)i=i.return;else{o=i;do i=o,(i.flags&4098)!==0&&(u=i.return),o=i.return;while(o)}return i.tag===3?u:null}function Pt(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 nn(o){if(dt(o)!==o)throw Error(n(188))}function ko(o){var i=o.alternate;if(!i){if(i=dt(o),i===null)throw Error(n(188));return i!==o?null:o}for(var u=o,h=i;;){var b=u.return;if(b===null)break;var j=b.alternate;if(j===null){if(h=b.return,h!==null){u=h;continue}break}if(b.child===j.child){for(j=b.child;j;){if(j===u)return nn(b),o;if(j===h)return nn(b),i;j=j.sibling}throw Error(n(188))}if(u.return!==h.return)u=b,h=j;else{for(var P=!1,F=b.child;F;){if(F===u){P=!0,u=b,h=j;break}if(F===h){P=!0,h=b,u=j;break}F=F.sibling}if(!P){for(F=j.child;F;){if(F===u){P=!0,u=j,h=b;break}if(F===h){P=!0,h=j,u=b;break}F=F.sibling}if(!P)throw Error(n(189))}}if(u.alternate!==h)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?o:i}function es(o){return o=ko(o),o!==null?pl(o):null}function pl(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var i=pl(o);if(i!==null)return i;o=o.sibling}return null}var Yh=t.unstable_scheduleCallback,Xh=t.unstable_cancelCallback,$1=t.unstable_shouldYield,M1=t.unstable_requestPaint,$t=t.unstable_now,_1=t.unstable_getCurrentPriorityLevel,Vu=t.unstable_ImmediatePriority,Jh=t.unstable_UserBlockingPriority,ml=t.unstable_NormalPriority,F1=t.unstable_LowPriority,Qh=t.unstable_IdlePriority,hl=null,Ar=null;function z1(o){if(Ar&&typeof Ar.onCommitFiberRoot=="function")try{Ar.onCommitFiberRoot(hl,o,void 0,(o.current.flags&128)===128)}catch{}}var mr=Math.clz32?Math.clz32:H1,B1=Math.log,U1=Math.LN2;function H1(o){return o>>>=0,o===0?32:31-(B1(o)/U1|0)|0}var gl=64,xl=4194304;function Ii(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 yl(o,i){var u=o.pendingLanes;if(u===0)return 0;var h=0,b=o.suspendedLanes,j=o.pingedLanes,P=u&268435455;if(P!==0){var F=P&~b;F!==0?h=Ii(F):(j&=P,j!==0&&(h=Ii(j)))}else P=u&~b,P!==0?h=Ii(P):j!==0&&(h=Ii(j));if(h===0)return 0;if(i!==0&&i!==h&&(i&b)===0&&(b=h&-h,j=i&-i,b>=j||b===16&&(j&4194240)!==0))return i;if((h&4)!==0&&(h|=u&16),i=o.entangledLanes,i!==0)for(o=o.entanglements,i&=h;0<i;)u=31-mr(i),b=1<<u,h|=o[u],i&=~b;return h}function W1(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 V1(o,i){for(var u=o.suspendedLanes,h=o.pingedLanes,b=o.expirationTimes,j=o.pendingLanes;0<j;){var P=31-mr(j),F=1<<P,V=b[P];V===-1?((F&u)===0||(F&h)!==0)&&(b[P]=W1(F,i)):V<=i&&(o.expiredLanes|=F),j&=~F}}function qu(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Zh(){var o=gl;return gl<<=1,(gl&4194240)===0&&(gl=64),o}function Ku(o){for(var i=[],u=0;31>u;u++)i.push(o);return i}function Oi(o,i,u){o.pendingLanes|=i,i!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,i=31-mr(i),o[i]=u}function q1(o,i){var u=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 h=o.eventTimes;for(o=o.expirationTimes;0<u;){var b=31-mr(u),j=1<<b;i[b]=0,h[b]=-1,o[b]=-1,u&=~j}}function Gu(o,i){var u=o.entangledLanes|=i;for(o=o.entanglements;u;){var h=31-mr(u),b=1<<h;b&i|o[h]&i&&(o[h]|=i),u&=~b}}var it=0;function eg(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var tg,Yu,ng,rg,sg,Xu=!1,vl=[],gs=null,xs=null,ys=null,Li=new Map,$i=new Map,vs=[],K1="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 og(o,i){switch(o){case"focusin":case"focusout":gs=null;break;case"dragenter":case"dragleave":xs=null;break;case"mouseover":case"mouseout":ys=null;break;case"pointerover":case"pointerout":Li.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":$i.delete(i.pointerId)}}function Mi(o,i,u,h,b,j){return o===null||o.nativeEvent!==j?(o={blockedOn:i,domEventName:u,eventSystemFlags:h,nativeEvent:j,targetContainers:[b]},i!==null&&(i=Ji(i),i!==null&&Yu(i)),o):(o.eventSystemFlags|=h,i=o.targetContainers,b!==null&&i.indexOf(b)===-1&&i.push(b),o)}function G1(o,i,u,h,b){switch(i){case"focusin":return gs=Mi(gs,o,i,u,h,b),!0;case"dragenter":return xs=Mi(xs,o,i,u,h,b),!0;case"mouseover":return ys=Mi(ys,o,i,u,h,b),!0;case"pointerover":var j=b.pointerId;return Li.set(j,Mi(Li.get(j)||null,o,i,u,h,b)),!0;case"gotpointercapture":return j=b.pointerId,$i.set(j,Mi($i.get(j)||null,o,i,u,h,b)),!0}return!1}function ig(o){var i=Xs(o.target);if(i!==null){var u=dt(i);if(u!==null){if(i=u.tag,i===13){if(i=Pt(u),i!==null){o.blockedOn=i,sg(o.priority,function(){ng(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){o.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}o.blockedOn=null}function bl(o){if(o.blockedOn!==null)return!1;for(var i=o.targetContainers;0<i.length;){var u=Qu(o.domEventName,o.eventSystemFlags,i[0],o.nativeEvent);if(u===null){u=o.nativeEvent;var h=new u.constructor(u.type,u);Qt=h,u.target.dispatchEvent(h),Qt=null}else return i=Ji(u),i!==null&&Yu(i),o.blockedOn=u,!1;i.shift()}return!0}function ag(o,i,u){bl(o)&&u.delete(i)}function Y1(){Xu=!1,gs!==null&&bl(gs)&&(gs=null),xs!==null&&bl(xs)&&(xs=null),ys!==null&&bl(ys)&&(ys=null),Li.forEach(ag),$i.forEach(ag)}function _i(o,i){o.blockedOn===i&&(o.blockedOn=null,Xu||(Xu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Y1)))}function Fi(o){function i(b){return _i(b,o)}if(0<vl.length){_i(vl[0],o);for(var u=1;u<vl.length;u++){var h=vl[u];h.blockedOn===o&&(h.blockedOn=null)}}for(gs!==null&&_i(gs,o),xs!==null&&_i(xs,o),ys!==null&&_i(ys,o),Li.forEach(i),$i.forEach(i),u=0;u<vs.length;u++)h=vs[u],h.blockedOn===o&&(h.blockedOn=null);for(;0<vs.length&&(u=vs[0],u.blockedOn===null);)ig(u),u.blockedOn===null&&vs.shift()}var So=A.ReactCurrentBatchConfig,wl=!0;function X1(o,i,u,h){var b=it,j=So.transition;So.transition=null;try{it=1,Ju(o,i,u,h)}finally{it=b,So.transition=j}}function J1(o,i,u,h){var b=it,j=So.transition;So.transition=null;try{it=4,Ju(o,i,u,h)}finally{it=b,So.transition=j}}function Ju(o,i,u,h){if(wl){var b=Qu(o,i,u,h);if(b===null)hd(o,i,h,jl,u),og(o,h);else if(G1(b,o,i,u,h))h.stopPropagation();else if(og(o,h),i&4&&-1<K1.indexOf(o)){for(;b!==null;){var j=Ji(b);if(j!==null&&tg(j),j=Qu(o,i,u,h),j===null&&hd(o,i,h,jl,u),j===b)break;b=j}b!==null&&h.stopPropagation()}else hd(o,i,h,null,u)}}var jl=null;function Qu(o,i,u,h){if(jl=null,o=Hn(h),o=Xs(o),o!==null)if(i=dt(o),i===null)o=null;else if(u=i.tag,u===13){if(o=Pt(i),o!==null)return o;o=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;o=null}else i!==o&&(o=null);return jl=o,null}function lg(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(_1()){case Vu:return 1;case Jh:return 4;case ml:case F1:return 16;case Qh:return 536870912;default:return 16}default:return 16}}var bs=null,Zu=null,kl=null;function cg(){if(kl)return kl;var o,i=Zu,u=i.length,h,b="value"in bs?bs.value:bs.textContent,j=b.length;for(o=0;o<u&&i[o]===b[o];o++);var P=u-o;for(h=1;h<=P&&i[u-h]===b[j-h];h++);return kl=b.slice(o,1<h?1-h:void 0)}function Sl(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 Nl(){return!0}function ug(){return!1}function Vn(o){function i(u,h,b,j,P){this._reactName=u,this._targetInst=b,this.type=h,this.nativeEvent=j,this.target=P,this.currentTarget=null;for(var F in o)o.hasOwnProperty(F)&&(u=o[F],this[F]=u?u(j):j[F]);return this.isDefaultPrevented=(j.defaultPrevented!=null?j.defaultPrevented:j.returnValue===!1)?Nl:ug,this.isPropagationStopped=ug,this}return C(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Nl)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Nl)},persist:function(){},isPersistent:Nl}),i}var No={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ed=Vn(No),zi=C({},No,{view:0,detail:0}),Q1=Vn(zi),td,nd,Bi,Cl=C({},zi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sd,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!==Bi&&(Bi&&o.type==="mousemove"?(td=o.screenX-Bi.screenX,nd=o.screenY-Bi.screenY):nd=td=0,Bi=o),td)},movementY:function(o){return"movementY"in o?o.movementY:nd}}),dg=Vn(Cl),Z1=C({},Cl,{dataTransfer:0}),eS=Vn(Z1),tS=C({},zi,{relatedTarget:0}),rd=Vn(tS),nS=C({},No,{animationName:0,elapsedTime:0,pseudoElement:0}),rS=Vn(nS),sS=C({},No,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),oS=Vn(sS),iS=C({},No,{data:0}),fg=Vn(iS),aS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lS={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"},cS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uS(o){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(o):(o=cS[o])?!!i[o]:!1}function sd(){return uS}var dS=C({},zi,{key:function(o){if(o.key){var i=aS[o.key]||o.key;if(i!=="Unidentified")return i}return o.type==="keypress"?(o=Sl(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?lS[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sd,charCode:function(o){return o.type==="keypress"?Sl(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Sl(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),fS=Vn(dS),pS=C({},Cl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pg=Vn(pS),mS=C({},zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sd}),hS=Vn(mS),gS=C({},No,{propertyName:0,elapsedTime:0,pseudoElement:0}),xS=Vn(gS),yS=C({},Cl,{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}),vS=Vn(yS),bS=[9,13,27,32],od=d&&"CompositionEvent"in window,Ui=null;d&&"documentMode"in document&&(Ui=document.documentMode);var wS=d&&"TextEvent"in window&&!Ui,mg=d&&(!od||Ui&&8<Ui&&11>=Ui),hg=" ",gg=!1;function xg(o,i){switch(o){case"keyup":return bS.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yg(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Co=!1;function jS(o,i){switch(o){case"compositionend":return yg(i);case"keypress":return i.which!==32?null:(gg=!0,hg);case"textInput":return o=i.data,o===hg&&gg?null:o;default:return null}}function kS(o,i){if(Co)return o==="compositionend"||!od&&xg(o,i)?(o=cg(),kl=Zu=bs=null,Co=!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 mg&&i.locale!=="ko"?null:i.data;default:return null}}var SS={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 vg(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i==="input"?!!SS[o.type]:i==="textarea"}function bg(o,i,u,h){qt(h),i=Al(i,"onChange"),0<i.length&&(u=new ed("onChange","change",null,u,h),o.push({event:u,listeners:i}))}var Hi=null,Wi=null;function NS(o){_g(o,0)}function El(o){var i=Ao(o);if(Ye(i))return o}function CS(o,i){if(o==="change")return i}var wg=!1;if(d){var id;if(d){var ad="oninput"in document;if(!ad){var jg=document.createElement("div");jg.setAttribute("oninput","return;"),ad=typeof jg.oninput=="function"}id=ad}else id=!1;wg=id&&(!document.documentMode||9<document.documentMode)}function kg(){Hi&&(Hi.detachEvent("onpropertychange",Sg),Wi=Hi=null)}function Sg(o){if(o.propertyName==="value"&&El(Wi)){var i=[];bg(i,Wi,o,Hn(o)),pr(NS,i)}}function ES(o,i,u){o==="focusin"?(kg(),Hi=i,Wi=u,Hi.attachEvent("onpropertychange",Sg)):o==="focusout"&&kg()}function TS(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return El(Wi)}function PS(o,i){if(o==="click")return El(i)}function RS(o,i){if(o==="input"||o==="change")return El(i)}function AS(o,i){return o===i&&(o!==0||1/o===1/i)||o!==o&&i!==i}var hr=typeof Object.is=="function"?Object.is:AS;function Vi(o,i){if(hr(o,i))return!0;if(typeof o!="object"||o===null||typeof i!="object"||i===null)return!1;var u=Object.keys(o),h=Object.keys(i);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var b=u[h];if(!f.call(i,b)||!hr(o[b],i[b]))return!1}return!0}function Ng(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Cg(o,i){var u=Ng(o);o=0;for(var h;u;){if(u.nodeType===3){if(h=o+u.textContent.length,o<=i&&h>=i)return{node:u,offset:i-o};o=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Ng(u)}}function Eg(o,i){return o&&i?o===i?!0:o&&o.nodeType===3?!1:i&&i.nodeType===3?Eg(o,i.parentNode):"contains"in o?o.contains(i):o.compareDocumentPosition?!!(o.compareDocumentPosition(i)&16):!1:!1}function Tg(){for(var o=window,i=ie();i instanceof o.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)o=i.contentWindow;else break;i=ie(o.document)}return i}function ld(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 DS(o){var i=Tg(),u=o.focusedElem,h=o.selectionRange;if(i!==u&&u&&u.ownerDocument&&Eg(u.ownerDocument.documentElement,u)){if(h!==null&&ld(u)){if(i=h.start,o=h.end,o===void 0&&(o=i),"selectionStart"in u)u.selectionStart=i,u.selectionEnd=Math.min(o,u.value.length);else if(o=(i=u.ownerDocument||document)&&i.defaultView||window,o.getSelection){o=o.getSelection();var b=u.textContent.length,j=Math.min(h.start,b);h=h.end===void 0?j:Math.min(h.end,b),!o.extend&&j>h&&(b=h,h=j,j=b),b=Cg(u,j);var P=Cg(u,h);b&&P&&(o.rangeCount!==1||o.anchorNode!==b.node||o.anchorOffset!==b.offset||o.focusNode!==P.node||o.focusOffset!==P.offset)&&(i=i.createRange(),i.setStart(b.node,b.offset),o.removeAllRanges(),j>h?(o.addRange(i),o.extend(P.node,P.offset)):(i.setEnd(P.node,P.offset),o.addRange(i)))}}for(i=[],o=u;o=o.parentNode;)o.nodeType===1&&i.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<i.length;u++)o=i[u],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var IS=d&&"documentMode"in document&&11>=document.documentMode,Eo=null,cd=null,qi=null,ud=!1;function Pg(o,i,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;ud||Eo==null||Eo!==ie(h)||(h=Eo,"selectionStart"in h&&ld(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),qi&&Vi(qi,h)||(qi=h,h=Al(cd,"onSelect"),0<h.length&&(i=new ed("onSelect","select",null,i,u),o.push({event:i,listeners:h}),i.target=Eo)))}function Tl(o,i){var u={};return u[o.toLowerCase()]=i.toLowerCase(),u["Webkit"+o]="webkit"+i,u["Moz"+o]="moz"+i,u}var To={animationend:Tl("Animation","AnimationEnd"),animationiteration:Tl("Animation","AnimationIteration"),animationstart:Tl("Animation","AnimationStart"),transitionend:Tl("Transition","TransitionEnd")},dd={},Rg={};d&&(Rg=document.createElement("div").style,"AnimationEvent"in window||(delete To.animationend.animation,delete To.animationiteration.animation,delete To.animationstart.animation),"TransitionEvent"in window||delete To.transitionend.transition);function Pl(o){if(dd[o])return dd[o];if(!To[o])return o;var i=To[o],u;for(u in i)if(i.hasOwnProperty(u)&&u in Rg)return dd[o]=i[u];return o}var Ag=Pl("animationend"),Dg=Pl("animationiteration"),Ig=Pl("animationstart"),Og=Pl("transitionend"),Lg=new Map,$g="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 ws(o,i){Lg.set(o,i),l(i,[o])}for(var fd=0;fd<$g.length;fd++){var pd=$g[fd],OS=pd.toLowerCase(),LS=pd[0].toUpperCase()+pd.slice(1);ws(OS,"on"+LS)}ws(Ag,"onAnimationEnd"),ws(Dg,"onAnimationIteration"),ws(Ig,"onAnimationStart"),ws("dblclick","onDoubleClick"),ws("focusin","onFocus"),ws("focusout","onBlur"),ws(Og,"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 Ki="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(" "),$S=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ki));function Mg(o,i,u){var h=o.type||"unknown-event";o.currentTarget=u,hn(h,i,void 0,o),o.currentTarget=null}function _g(o,i){i=(i&4)!==0;for(var u=0;u<o.length;u++){var h=o[u],b=h.event;h=h.listeners;e:{var j=void 0;if(i)for(var P=h.length-1;0<=P;P--){var F=h[P],V=F.instance,oe=F.currentTarget;if(F=F.listener,V!==j&&b.isPropagationStopped())break e;Mg(b,F,oe),j=V}else for(P=0;P<h.length;P++){if(F=h[P],V=F.instance,oe=F.currentTarget,F=F.listener,V!==j&&b.isPropagationStopped())break e;Mg(b,F,oe),j=V}}}if(ue)throw o=Se,ue=!1,Se=null,o}function yt(o,i){var u=i[wd];u===void 0&&(u=i[wd]=new Set);var h=o+"__bubble";u.has(h)||(Fg(i,o,2,!1),u.add(h))}function md(o,i,u){var h=0;i&&(h|=4),Fg(u,o,h,i)}var Rl="_reactListening"+Math.random().toString(36).slice(2);function Gi(o){if(!o[Rl]){o[Rl]=!0,s.forEach(function(u){u!=="selectionchange"&&($S.has(u)||md(u,!1,o),md(u,!0,o))});var i=o.nodeType===9?o:o.ownerDocument;i===null||i[Rl]||(i[Rl]=!0,md("selectionchange",!1,i))}}function Fg(o,i,u,h){switch(lg(i)){case 1:var b=X1;break;case 4:b=J1;break;default:b=Ju}u=b.bind(null,i,u,o),b=void 0,!Pn||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(b=!0),h?b!==void 0?o.addEventListener(i,u,{capture:!0,passive:b}):o.addEventListener(i,u,!0):b!==void 0?o.addEventListener(i,u,{passive:b}):o.addEventListener(i,u,!1)}function hd(o,i,u,h,b){var j=h;if((i&1)===0&&(i&2)===0&&h!==null)e:for(;;){if(h===null)return;var P=h.tag;if(P===3||P===4){var F=h.stateNode.containerInfo;if(F===b||F.nodeType===8&&F.parentNode===b)break;if(P===4)for(P=h.return;P!==null;){var V=P.tag;if((V===3||V===4)&&(V=P.stateNode.containerInfo,V===b||V.nodeType===8&&V.parentNode===b))return;P=P.return}for(;F!==null;){if(P=Xs(F),P===null)return;if(V=P.tag,V===5||V===6){h=j=P;continue e}F=F.parentNode}}h=h.return}pr(function(){var oe=j,he=Hn(u),xe=[];e:{var de=Lg.get(o);if(de!==void 0){var Ce=ed,Re=o;switch(o){case"keypress":if(Sl(u)===0)break e;case"keydown":case"keyup":Ce=fS;break;case"focusin":Re="focus",Ce=rd;break;case"focusout":Re="blur",Ce=rd;break;case"beforeblur":case"afterblur":Ce=rd;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ce=dg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ce=eS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ce=hS;break;case Ag:case Dg:case Ig:Ce=rS;break;case Og:Ce=xS;break;case"scroll":Ce=Q1;break;case"wheel":Ce=vS;break;case"copy":case"cut":case"paste":Ce=oS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ce=pg}var Ae=(i&4)!==0,Mt=!Ae&&o==="scroll",te=Ae?de!==null?de+"Capture":null:de;Ae=[];for(var K=oe,re;K!==null;){re=K;var be=re.stateNode;if(re.tag===5&&be!==null&&(re=be,te!==null&&(be=ut(K,te),be!=null&&Ae.push(Yi(K,be,re)))),Mt)break;K=K.return}0<Ae.length&&(de=new Ce(de,Re,null,u,he),xe.push({event:de,listeners:Ae}))}}if((i&7)===0){e:{if(de=o==="mouseover"||o==="pointerover",Ce=o==="mouseout"||o==="pointerout",de&&u!==Qt&&(Re=u.relatedTarget||u.fromElement)&&(Xs(Re)||Re[ts]))break e;if((Ce||de)&&(de=he.window===he?he:(de=he.ownerDocument)?de.defaultView||de.parentWindow:window,Ce?(Re=u.relatedTarget||u.toElement,Ce=oe,Re=Re?Xs(Re):null,Re!==null&&(Mt=dt(Re),Re!==Mt||Re.tag!==5&&Re.tag!==6)&&(Re=null)):(Ce=null,Re=oe),Ce!==Re)){if(Ae=dg,be="onMouseLeave",te="onMouseEnter",K="mouse",(o==="pointerout"||o==="pointerover")&&(Ae=pg,be="onPointerLeave",te="onPointerEnter",K="pointer"),Mt=Ce==null?de:Ao(Ce),re=Re==null?de:Ao(Re),de=new Ae(be,K+"leave",Ce,u,he),de.target=Mt,de.relatedTarget=re,be=null,Xs(he)===oe&&(Ae=new Ae(te,K+"enter",Re,u,he),Ae.target=re,Ae.relatedTarget=Mt,be=Ae),Mt=be,Ce&&Re)t:{for(Ae=Ce,te=Re,K=0,re=Ae;re;re=Po(re))K++;for(re=0,be=te;be;be=Po(be))re++;for(;0<K-re;)Ae=Po(Ae),K--;for(;0<re-K;)te=Po(te),re--;for(;K--;){if(Ae===te||te!==null&&Ae===te.alternate)break t;Ae=Po(Ae),te=Po(te)}Ae=null}else Ae=null;Ce!==null&&zg(xe,de,Ce,Ae,!1),Re!==null&&Mt!==null&&zg(xe,Mt,Re,Ae,!0)}}e:{if(de=oe?Ao(oe):window,Ce=de.nodeName&&de.nodeName.toLowerCase(),Ce==="select"||Ce==="input"&&de.type==="file")var De=CS;else if(vg(de))if(wg)De=RS;else{De=TS;var $e=ES}else(Ce=de.nodeName)&&Ce.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(De=PS);if(De&&(De=De(o,oe))){bg(xe,De,u,he);break e}$e&&$e(o,de,oe),o==="focusout"&&($e=de._wrapperState)&&$e.controlled&&de.type==="number"&&_e(de,"number",de.value)}switch($e=oe?Ao(oe):window,o){case"focusin":(vg($e)||$e.contentEditable==="true")&&(Eo=$e,cd=oe,qi=null);break;case"focusout":qi=cd=Eo=null;break;case"mousedown":ud=!0;break;case"contextmenu":case"mouseup":case"dragend":ud=!1,Pg(xe,u,he);break;case"selectionchange":if(IS)break;case"keydown":case"keyup":Pg(xe,u,he)}var Me;if(od)e:{switch(o){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else Co?xg(o,u)&&(Be="onCompositionEnd"):o==="keydown"&&u.keyCode===229&&(Be="onCompositionStart");Be&&(mg&&u.locale!=="ko"&&(Co||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&Co&&(Me=cg()):(bs=he,Zu="value"in bs?bs.value:bs.textContent,Co=!0)),$e=Al(oe,Be),0<$e.length&&(Be=new fg(Be,o,null,u,he),xe.push({event:Be,listeners:$e}),Me?Be.data=Me:(Me=yg(u),Me!==null&&(Be.data=Me)))),(Me=wS?jS(o,u):kS(o,u))&&(oe=Al(oe,"onBeforeInput"),0<oe.length&&(he=new fg("onBeforeInput","beforeinput",null,u,he),xe.push({event:he,listeners:oe}),he.data=Me))}_g(xe,i)})}function Yi(o,i,u){return{instance:o,listener:i,currentTarget:u}}function Al(o,i){for(var u=i+"Capture",h=[];o!==null;){var b=o,j=b.stateNode;b.tag===5&&j!==null&&(b=j,j=ut(o,u),j!=null&&h.unshift(Yi(o,j,b)),j=ut(o,i),j!=null&&h.push(Yi(o,j,b))),o=o.return}return h}function Po(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function zg(o,i,u,h,b){for(var j=i._reactName,P=[];u!==null&&u!==h;){var F=u,V=F.alternate,oe=F.stateNode;if(V!==null&&V===h)break;F.tag===5&&oe!==null&&(F=oe,b?(V=ut(u,j),V!=null&&P.unshift(Yi(u,V,F))):b||(V=ut(u,j),V!=null&&P.push(Yi(u,V,F)))),u=u.return}P.length!==0&&o.push({event:i,listeners:P})}var MS=/\r\n?/g,_S=/\u0000|\uFFFD/g;function Bg(o){return(typeof o=="string"?o:""+o).replace(MS,`
38
- `).replace(_S,"")}function Dl(o,i,u){if(i=Bg(i),Bg(o)!==i&&u)throw Error(n(425))}function Il(){}var gd=null,xd=null;function yd(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 vd=typeof setTimeout=="function"?setTimeout:void 0,FS=typeof clearTimeout=="function"?clearTimeout:void 0,Ug=typeof Promise=="function"?Promise:void 0,zS=typeof queueMicrotask=="function"?queueMicrotask:typeof Ug<"u"?function(o){return Ug.resolve(null).then(o).catch(BS)}:vd;function BS(o){setTimeout(function(){throw o})}function bd(o,i){var u=i,h=0;do{var b=u.nextSibling;if(o.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"){if(h===0){o.removeChild(b),Fi(i);return}h--}else u!=="$"&&u!=="$?"&&u!=="$!"||h++;u=b}while(u);Fi(i)}function js(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 Hg(o){o=o.previousSibling;for(var i=0;o;){if(o.nodeType===8){var u=o.data;if(u==="$"||u==="$!"||u==="$?"){if(i===0)return o;i--}else u==="/$"&&i++}o=o.previousSibling}return null}var Ro=Math.random().toString(36).slice(2),Dr="__reactFiber$"+Ro,Xi="__reactProps$"+Ro,ts="__reactContainer$"+Ro,wd="__reactEvents$"+Ro,US="__reactListeners$"+Ro,HS="__reactHandles$"+Ro;function Xs(o){var i=o[Dr];if(i)return i;for(var u=o.parentNode;u;){if(i=u[ts]||u[Dr]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(o=Hg(o);o!==null;){if(u=o[Dr])return u;o=Hg(o)}return i}o=u,u=o.parentNode}return null}function Ji(o){return o=o[Dr]||o[ts],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Ao(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function Ol(o){return o[Xi]||null}var jd=[],Do=-1;function ks(o){return{current:o}}function vt(o){0>Do||(o.current=jd[Do],jd[Do]=null,Do--)}function ht(o,i){Do++,jd[Do]=o.current,o.current=i}var Ss={},gn=ks(Ss),Rn=ks(!1),Js=Ss;function Io(o,i){var u=o.type.contextTypes;if(!u)return Ss;var h=o.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===i)return h.__reactInternalMemoizedMaskedChildContext;var b={},j;for(j in u)b[j]=i[j];return h&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=i,o.__reactInternalMemoizedMaskedChildContext=b),b}function An(o){return o=o.childContextTypes,o!=null}function Ll(){vt(Rn),vt(gn)}function Wg(o,i,u){if(gn.current!==Ss)throw Error(n(168));ht(gn,i),ht(Rn,u)}function Vg(o,i,u){var h=o.stateNode;if(i=i.childContextTypes,typeof h.getChildContext!="function")return u;h=h.getChildContext();for(var b in h)if(!(b in i))throw Error(n(108,ge(o)||"Unknown",b));return C({},u,h)}function $l(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Ss,Js=gn.current,ht(gn,o),ht(Rn,Rn.current),!0}function qg(o,i,u){var h=o.stateNode;if(!h)throw Error(n(169));u?(o=Vg(o,i,Js),h.__reactInternalMemoizedMergedChildContext=o,vt(Rn),vt(gn),ht(gn,o)):vt(Rn),ht(Rn,u)}var ns=null,Ml=!1,kd=!1;function Kg(o){ns===null?ns=[o]:ns.push(o)}function WS(o){Ml=!0,Kg(o)}function Ns(){if(!kd&&ns!==null){kd=!0;var o=0,i=it;try{var u=ns;for(it=1;o<u.length;o++){var h=u[o];do h=h(!0);while(h!==null)}ns=null,Ml=!1}catch(b){throw ns!==null&&(ns=ns.slice(o+1)),Yh(Vu,Ns),b}finally{it=i,kd=!1}}return null}var Oo=[],Lo=0,_l=null,Fl=0,tr=[],nr=0,Qs=null,rs=1,ss="";function Zs(o,i){Oo[Lo++]=Fl,Oo[Lo++]=_l,_l=o,Fl=i}function Gg(o,i,u){tr[nr++]=rs,tr[nr++]=ss,tr[nr++]=Qs,Qs=o;var h=rs;o=ss;var b=32-mr(h)-1;h&=~(1<<b),u+=1;var j=32-mr(i)+b;if(30<j){var P=b-b%5;j=(h&(1<<P)-1).toString(32),h>>=P,b-=P,rs=1<<32-mr(i)+b|u<<b|h,ss=j+o}else rs=1<<j|u<<b|h,ss=o}function Sd(o){o.return!==null&&(Zs(o,1),Gg(o,1,0))}function Nd(o){for(;o===_l;)_l=Oo[--Lo],Oo[Lo]=null,Fl=Oo[--Lo],Oo[Lo]=null;for(;o===Qs;)Qs=tr[--nr],tr[nr]=null,ss=tr[--nr],tr[nr]=null,rs=tr[--nr],tr[nr]=null}var qn=null,Kn=null,Nt=!1,gr=null;function Yg(o,i){var u=ir(5,null,null,0);u.elementType="DELETED",u.stateNode=i,u.return=o,i=o.deletions,i===null?(o.deletions=[u],o.flags|=16):i.push(u)}function Xg(o,i){switch(o.tag){case 5:var u=o.type;return i=i.nodeType!==1||u.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(o.stateNode=i,qn=o,Kn=js(i.firstChild),!0):!1;case 6:return i=o.pendingProps===""||i.nodeType!==3?null:i,i!==null?(o.stateNode=i,qn=o,Kn=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(u=Qs!==null?{id:rs,overflow:ss}:null,o.memoizedState={dehydrated:i,treeContext:u,retryLane:1073741824},u=ir(18,null,null,0),u.stateNode=i,u.return=o,o.child=u,qn=o,Kn=null,!0):!1;default:return!1}}function Cd(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Ed(o){if(Nt){var i=Kn;if(i){var u=i;if(!Xg(o,i)){if(Cd(o))throw Error(n(418));i=js(u.nextSibling);var h=qn;i&&Xg(o,i)?Yg(h,u):(o.flags=o.flags&-4097|2,Nt=!1,qn=o)}}else{if(Cd(o))throw Error(n(418));o.flags=o.flags&-4097|2,Nt=!1,qn=o}}}function Jg(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;qn=o}function zl(o){if(o!==qn)return!1;if(!Nt)return Jg(o),Nt=!0,!1;var i;if((i=o.tag!==3)&&!(i=o.tag!==5)&&(i=o.type,i=i!=="head"&&i!=="body"&&!yd(o.type,o.memoizedProps)),i&&(i=Kn)){if(Cd(o))throw Qg(),Error(n(418));for(;i;)Yg(o,i),i=js(i.nextSibling)}if(Jg(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 u=o.data;if(u==="/$"){if(i===0){Kn=js(o.nextSibling);break e}i--}else u!=="$"&&u!=="$!"&&u!=="$?"||i++}o=o.nextSibling}Kn=null}}else Kn=qn?js(o.stateNode.nextSibling):null;return!0}function Qg(){for(var o=Kn;o;)o=js(o.nextSibling)}function $o(){Kn=qn=null,Nt=!1}function Td(o){gr===null?gr=[o]:gr.push(o)}var VS=A.ReactCurrentBatchConfig;function Qi(o,i,u){if(o=u.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var h=u.stateNode}if(!h)throw Error(n(147,o));var b=h,j=""+o;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===j?i.ref:(i=function(P){var F=b.refs;P===null?delete F[j]:F[j]=P},i._stringRef=j,i)}if(typeof o!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,o))}return o}function Bl(o,i){throw o=Object.prototype.toString.call(i),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":o))}function Zg(o){var i=o._init;return i(o._payload)}function ex(o){function i(te,K){if(o){var re=te.deletions;re===null?(te.deletions=[K],te.flags|=16):re.push(K)}}function u(te,K){if(!o)return null;for(;K!==null;)i(te,K),K=K.sibling;return null}function h(te,K){for(te=new Map;K!==null;)K.key!==null?te.set(K.key,K):te.set(K.index,K),K=K.sibling;return te}function b(te,K){return te=Is(te,K),te.index=0,te.sibling=null,te}function j(te,K,re){return te.index=re,o?(re=te.alternate,re!==null?(re=re.index,re<K?(te.flags|=2,K):re):(te.flags|=2,K)):(te.flags|=1048576,K)}function P(te){return o&&te.alternate===null&&(te.flags|=2),te}function F(te,K,re,be){return K===null||K.tag!==6?(K=bf(re,te.mode,be),K.return=te,K):(K=b(K,re),K.return=te,K)}function V(te,K,re,be){var De=re.type;return De===I?he(te,K,re.props.children,be,re.key):K!==null&&(K.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===B&&Zg(De)===K.type)?(be=b(K,re.props),be.ref=Qi(te,K,re),be.return=te,be):(be=dc(re.type,re.key,re.props,null,te.mode,be),be.ref=Qi(te,K,re),be.return=te,be)}function oe(te,K,re,be){return K===null||K.tag!==4||K.stateNode.containerInfo!==re.containerInfo||K.stateNode.implementation!==re.implementation?(K=wf(re,te.mode,be),K.return=te,K):(K=b(K,re.children||[]),K.return=te,K)}function he(te,K,re,be,De){return K===null||K.tag!==7?(K=ao(re,te.mode,be,De),K.return=te,K):(K=b(K,re),K.return=te,K)}function xe(te,K,re){if(typeof K=="string"&&K!==""||typeof K=="number")return K=bf(""+K,te.mode,re),K.return=te,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case M:return re=dc(K.type,K.key,K.props,null,te.mode,re),re.ref=Qi(te,null,K),re.return=te,re;case R:return K=wf(K,te.mode,re),K.return=te,K;case B:var be=K._init;return xe(te,be(K._payload),re)}if(Ie(K)||ee(K))return K=ao(K,te.mode,re,null),K.return=te,K;Bl(te,K)}return null}function de(te,K,re,be){var De=K!==null?K.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return De!==null?null:F(te,K,""+re,be);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case M:return re.key===De?V(te,K,re,be):null;case R:return re.key===De?oe(te,K,re,be):null;case B:return De=re._init,de(te,K,De(re._payload),be)}if(Ie(re)||ee(re))return De!==null?null:he(te,K,re,be,null);Bl(te,re)}return null}function Ce(te,K,re,be,De){if(typeof be=="string"&&be!==""||typeof be=="number")return te=te.get(re)||null,F(K,te,""+be,De);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case M:return te=te.get(be.key===null?re:be.key)||null,V(K,te,be,De);case R:return te=te.get(be.key===null?re:be.key)||null,oe(K,te,be,De);case B:var $e=be._init;return Ce(te,K,re,$e(be._payload),De)}if(Ie(be)||ee(be))return te=te.get(re)||null,he(K,te,be,De,null);Bl(K,be)}return null}function Re(te,K,re,be){for(var De=null,$e=null,Me=K,Be=K=0,on=null;Me!==null&&Be<re.length;Be++){Me.index>Be?(on=Me,Me=null):on=Me.sibling;var Ze=de(te,Me,re[Be],be);if(Ze===null){Me===null&&(Me=on);break}o&&Me&&Ze.alternate===null&&i(te,Me),K=j(Ze,K,Be),$e===null?De=Ze:$e.sibling=Ze,$e=Ze,Me=on}if(Be===re.length)return u(te,Me),Nt&&Zs(te,Be),De;if(Me===null){for(;Be<re.length;Be++)Me=xe(te,re[Be],be),Me!==null&&(K=j(Me,K,Be),$e===null?De=Me:$e.sibling=Me,$e=Me);return Nt&&Zs(te,Be),De}for(Me=h(te,Me);Be<re.length;Be++)on=Ce(Me,te,Be,re[Be],be),on!==null&&(o&&on.alternate!==null&&Me.delete(on.key===null?Be:on.key),K=j(on,K,Be),$e===null?De=on:$e.sibling=on,$e=on);return o&&Me.forEach(function(Os){return i(te,Os)}),Nt&&Zs(te,Be),De}function Ae(te,K,re,be){var De=ee(re);if(typeof De!="function")throw Error(n(150));if(re=De.call(re),re==null)throw Error(n(151));for(var $e=De=null,Me=K,Be=K=0,on=null,Ze=re.next();Me!==null&&!Ze.done;Be++,Ze=re.next()){Me.index>Be?(on=Me,Me=null):on=Me.sibling;var Os=de(te,Me,Ze.value,be);if(Os===null){Me===null&&(Me=on);break}o&&Me&&Os.alternate===null&&i(te,Me),K=j(Os,K,Be),$e===null?De=Os:$e.sibling=Os,$e=Os,Me=on}if(Ze.done)return u(te,Me),Nt&&Zs(te,Be),De;if(Me===null){for(;!Ze.done;Be++,Ze=re.next())Ze=xe(te,Ze.value,be),Ze!==null&&(K=j(Ze,K,Be),$e===null?De=Ze:$e.sibling=Ze,$e=Ze);return Nt&&Zs(te,Be),De}for(Me=h(te,Me);!Ze.done;Be++,Ze=re.next())Ze=Ce(Me,te,Be,Ze.value,be),Ze!==null&&(o&&Ze.alternate!==null&&Me.delete(Ze.key===null?Be:Ze.key),K=j(Ze,K,Be),$e===null?De=Ze:$e.sibling=Ze,$e=Ze);return o&&Me.forEach(function(SN){return i(te,SN)}),Nt&&Zs(te,Be),De}function Mt(te,K,re,be){if(typeof re=="object"&&re!==null&&re.type===I&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case M:e:{for(var De=re.key,$e=K;$e!==null;){if($e.key===De){if(De=re.type,De===I){if($e.tag===7){u(te,$e.sibling),K=b($e,re.props.children),K.return=te,te=K;break e}}else if($e.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===B&&Zg(De)===$e.type){u(te,$e.sibling),K=b($e,re.props),K.ref=Qi(te,$e,re),K.return=te,te=K;break e}u(te,$e);break}else i(te,$e);$e=$e.sibling}re.type===I?(K=ao(re.props.children,te.mode,be,re.key),K.return=te,te=K):(be=dc(re.type,re.key,re.props,null,te.mode,be),be.ref=Qi(te,K,re),be.return=te,te=be)}return P(te);case R:e:{for($e=re.key;K!==null;){if(K.key===$e)if(K.tag===4&&K.stateNode.containerInfo===re.containerInfo&&K.stateNode.implementation===re.implementation){u(te,K.sibling),K=b(K,re.children||[]),K.return=te,te=K;break e}else{u(te,K);break}else i(te,K);K=K.sibling}K=wf(re,te.mode,be),K.return=te,te=K}return P(te);case B:return $e=re._init,Mt(te,K,$e(re._payload),be)}if(Ie(re))return Re(te,K,re,be);if(ee(re))return Ae(te,K,re,be);Bl(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,K!==null&&K.tag===6?(u(te,K.sibling),K=b(K,re),K.return=te,te=K):(u(te,K),K=bf(re,te.mode,be),K.return=te,te=K),P(te)):u(te,K)}return Mt}var Mo=ex(!0),tx=ex(!1),Ul=ks(null),Hl=null,_o=null,Pd=null;function Rd(){Pd=_o=Hl=null}function Ad(o){var i=Ul.current;vt(Ul),o._currentValue=i}function Dd(o,i,u){for(;o!==null;){var h=o.alternate;if((o.childLanes&i)!==i?(o.childLanes|=i,h!==null&&(h.childLanes|=i)):h!==null&&(h.childLanes&i)!==i&&(h.childLanes|=i),o===u)break;o=o.return}}function Fo(o,i){Hl=o,Pd=_o=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&i)!==0&&(Dn=!0),o.firstContext=null)}function rr(o){var i=o._currentValue;if(Pd!==o)if(o={context:o,memoizedValue:i,next:null},_o===null){if(Hl===null)throw Error(n(308));_o=o,Hl.dependencies={lanes:0,firstContext:o}}else _o=_o.next=o;return i}var eo=null;function Id(o){eo===null?eo=[o]:eo.push(o)}function nx(o,i,u,h){var b=i.interleaved;return b===null?(u.next=u,Id(i)):(u.next=b.next,b.next=u),i.interleaved=u,os(o,h)}function os(o,i){o.lanes|=i;var u=o.alternate;for(u!==null&&(u.lanes|=i),u=o,o=o.return;o!==null;)o.childLanes|=i,u=o.alternate,u!==null&&(u.childLanes|=i),u=o,o=o.return;return u.tag===3?u.stateNode:null}var Cs=!1;function Od(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function rx(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 is(o,i){return{eventTime:o,lane:i,tag:0,payload:null,callback:null,next:null}}function Es(o,i,u){var h=o.updateQueue;if(h===null)return null;if(h=h.shared,(Qe&2)!==0){var b=h.pending;return b===null?i.next=i:(i.next=b.next,b.next=i),h.pending=i,os(o,u)}return b=h.interleaved,b===null?(i.next=i,Id(h)):(i.next=b.next,b.next=i),h.interleaved=i,os(o,u)}function Wl(o,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194240)!==0)){var h=i.lanes;h&=o.pendingLanes,u|=h,i.lanes=u,Gu(o,u)}}function sx(o,i){var u=o.updateQueue,h=o.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var b=null,j=null;if(u=u.firstBaseUpdate,u!==null){do{var P={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};j===null?b=j=P:j=j.next=P,u=u.next}while(u!==null);j===null?b=j=i:j=j.next=i}else b=j=i;u={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:j,shared:h.shared,effects:h.effects},o.updateQueue=u;return}o=u.lastBaseUpdate,o===null?u.firstBaseUpdate=i:o.next=i,u.lastBaseUpdate=i}function Vl(o,i,u,h){var b=o.updateQueue;Cs=!1;var j=b.firstBaseUpdate,P=b.lastBaseUpdate,F=b.shared.pending;if(F!==null){b.shared.pending=null;var V=F,oe=V.next;V.next=null,P===null?j=oe:P.next=oe,P=V;var he=o.alternate;he!==null&&(he=he.updateQueue,F=he.lastBaseUpdate,F!==P&&(F===null?he.firstBaseUpdate=oe:F.next=oe,he.lastBaseUpdate=V))}if(j!==null){var xe=b.baseState;P=0,he=oe=V=null,F=j;do{var de=F.lane,Ce=F.eventTime;if((h&de)===de){he!==null&&(he=he.next={eventTime:Ce,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var Re=o,Ae=F;switch(de=i,Ce=u,Ae.tag){case 1:if(Re=Ae.payload,typeof Re=="function"){xe=Re.call(Ce,xe,de);break e}xe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ae.payload,de=typeof Re=="function"?Re.call(Ce,xe,de):Re,de==null)break e;xe=C({},xe,de);break e;case 2:Cs=!0}}F.callback!==null&&F.lane!==0&&(o.flags|=64,de=b.effects,de===null?b.effects=[F]:de.push(F))}else Ce={eventTime:Ce,lane:de,tag:F.tag,payload:F.payload,callback:F.callback,next:null},he===null?(oe=he=Ce,V=xe):he=he.next=Ce,P|=de;if(F=F.next,F===null){if(F=b.shared.pending,F===null)break;de=F,F=de.next,de.next=null,b.lastBaseUpdate=de,b.shared.pending=null}}while(!0);if(he===null&&(V=xe),b.baseState=V,b.firstBaseUpdate=oe,b.lastBaseUpdate=he,i=b.shared.interleaved,i!==null){b=i;do P|=b.lane,b=b.next;while(b!==i)}else j===null&&(b.shared.lanes=0);ro|=P,o.lanes=P,o.memoizedState=xe}}function ox(o,i,u){if(o=i.effects,i.effects=null,o!==null)for(i=0;i<o.length;i++){var h=o[i],b=h.callback;if(b!==null){if(h.callback=null,h=u,typeof b!="function")throw Error(n(191,b));b.call(h)}}}var Zi={},Ir=ks(Zi),ea=ks(Zi),ta=ks(Zi);function to(o){if(o===Zi)throw Error(n(174));return o}function Ld(o,i){switch(ht(ta,i),ht(ea,o),ht(Ir,Zi),o=i.nodeType,o){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:pe(null,"");break;default:o=o===8?i.parentNode:i,i=o.namespaceURI||null,o=o.tagName,i=pe(i,o)}vt(Ir),ht(Ir,i)}function zo(){vt(Ir),vt(ea),vt(ta)}function ix(o){to(ta.current);var i=to(Ir.current),u=pe(i,o.type);i!==u&&(ht(ea,o),ht(Ir,u))}function $d(o){ea.current===o&&(vt(Ir),vt(ea))}var Rt=ks(0);function ql(o){for(var i=o;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.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 Md=[];function _d(){for(var o=0;o<Md.length;o++)Md[o]._workInProgressVersionPrimary=null;Md.length=0}var Kl=A.ReactCurrentDispatcher,Fd=A.ReactCurrentBatchConfig,no=0,At=null,Kt=null,rn=null,Gl=!1,na=!1,ra=0,qS=0;function xn(){throw Error(n(321))}function zd(o,i){if(i===null)return!1;for(var u=0;u<i.length&&u<o.length;u++)if(!hr(o[u],i[u]))return!1;return!0}function Bd(o,i,u,h,b,j){if(no=j,At=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Kl.current=o===null||o.memoizedState===null?XS:JS,o=u(h,b),na){j=0;do{if(na=!1,ra=0,25<=j)throw Error(n(301));j+=1,rn=Kt=null,i.updateQueue=null,Kl.current=QS,o=u(h,b)}while(na)}if(Kl.current=Jl,i=Kt!==null&&Kt.next!==null,no=0,rn=Kt=At=null,Gl=!1,i)throw Error(n(300));return o}function Ud(){var o=ra!==0;return ra=0,o}function Or(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?At.memoizedState=rn=o:rn=rn.next=o,rn}function sr(){if(Kt===null){var o=At.alternate;o=o!==null?o.memoizedState:null}else o=Kt.next;var i=rn===null?At.memoizedState:rn.next;if(i!==null)rn=i,Kt=o;else{if(o===null)throw Error(n(310));Kt=o,o={memoizedState:Kt.memoizedState,baseState:Kt.baseState,baseQueue:Kt.baseQueue,queue:Kt.queue,next:null},rn===null?At.memoizedState=rn=o:rn=rn.next=o}return rn}function sa(o,i){return typeof i=="function"?i(o):i}function Hd(o){var i=sr(),u=i.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var h=Kt,b=h.baseQueue,j=u.pending;if(j!==null){if(b!==null){var P=b.next;b.next=j.next,j.next=P}h.baseQueue=b=j,u.pending=null}if(b!==null){j=b.next,h=h.baseState;var F=P=null,V=null,oe=j;do{var he=oe.lane;if((no&he)===he)V!==null&&(V=V.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),h=oe.hasEagerState?oe.eagerState:o(h,oe.action);else{var xe={lane:he,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};V===null?(F=V=xe,P=h):V=V.next=xe,At.lanes|=he,ro|=he}oe=oe.next}while(oe!==null&&oe!==j);V===null?P=h:V.next=F,hr(h,i.memoizedState)||(Dn=!0),i.memoizedState=h,i.baseState=P,i.baseQueue=V,u.lastRenderedState=h}if(o=u.interleaved,o!==null){b=o;do j=b.lane,At.lanes|=j,ro|=j,b=b.next;while(b!==o)}else b===null&&(u.lanes=0);return[i.memoizedState,u.dispatch]}function Wd(o){var i=sr(),u=i.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var h=u.dispatch,b=u.pending,j=i.memoizedState;if(b!==null){u.pending=null;var P=b=b.next;do j=o(j,P.action),P=P.next;while(P!==b);hr(j,i.memoizedState)||(Dn=!0),i.memoizedState=j,i.baseQueue===null&&(i.baseState=j),u.lastRenderedState=j}return[j,h]}function ax(){}function lx(o,i){var u=At,h=sr(),b=i(),j=!hr(h.memoizedState,b);if(j&&(h.memoizedState=b,Dn=!0),h=h.queue,Vd(dx.bind(null,u,h,o),[o]),h.getSnapshot!==i||j||rn!==null&&rn.memoizedState.tag&1){if(u.flags|=2048,oa(9,ux.bind(null,u,h,b,i),void 0,null),sn===null)throw Error(n(349));(no&30)!==0||cx(u,i,b)}return b}function cx(o,i,u){o.flags|=16384,o={getSnapshot:i,value:u},i=At.updateQueue,i===null?(i={lastEffect:null,stores:null},At.updateQueue=i,i.stores=[o]):(u=i.stores,u===null?i.stores=[o]:u.push(o))}function ux(o,i,u,h){i.value=u,i.getSnapshot=h,fx(i)&&px(o)}function dx(o,i,u){return u(function(){fx(i)&&px(o)})}function fx(o){var i=o.getSnapshot;o=o.value;try{var u=i();return!hr(o,u)}catch{return!0}}function px(o){var i=os(o,1);i!==null&&br(i,o,1,-1)}function mx(o){var i=Or();return typeof o=="function"&&(o=o()),i.memoizedState=i.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:o},i.queue=o,o=o.dispatch=YS.bind(null,At,o),[i.memoizedState,o]}function oa(o,i,u,h){return o={tag:o,create:i,destroy:u,deps:h,next:null},i=At.updateQueue,i===null?(i={lastEffect:null,stores:null},At.updateQueue=i,i.lastEffect=o.next=o):(u=i.lastEffect,u===null?i.lastEffect=o.next=o:(h=u.next,u.next=o,o.next=h,i.lastEffect=o)),o}function hx(){return sr().memoizedState}function Yl(o,i,u,h){var b=Or();At.flags|=o,b.memoizedState=oa(1|i,u,void 0,h===void 0?null:h)}function Xl(o,i,u,h){var b=sr();h=h===void 0?null:h;var j=void 0;if(Kt!==null){var P=Kt.memoizedState;if(j=P.destroy,h!==null&&zd(h,P.deps)){b.memoizedState=oa(i,u,j,h);return}}At.flags|=o,b.memoizedState=oa(1|i,u,j,h)}function gx(o,i){return Yl(8390656,8,o,i)}function Vd(o,i){return Xl(2048,8,o,i)}function xx(o,i){return Xl(4,2,o,i)}function yx(o,i){return Xl(4,4,o,i)}function vx(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 bx(o,i,u){return u=u!=null?u.concat([o]):null,Xl(4,4,vx.bind(null,i,o),u)}function qd(){}function wx(o,i){var u=sr();i=i===void 0?null:i;var h=u.memoizedState;return h!==null&&i!==null&&zd(i,h[1])?h[0]:(u.memoizedState=[o,i],o)}function jx(o,i){var u=sr();i=i===void 0?null:i;var h=u.memoizedState;return h!==null&&i!==null&&zd(i,h[1])?h[0]:(o=o(),u.memoizedState=[o,i],o)}function kx(o,i,u){return(no&21)===0?(o.baseState&&(o.baseState=!1,Dn=!0),o.memoizedState=u):(hr(u,i)||(u=Zh(),At.lanes|=u,ro|=u,o.baseState=!0),i)}function KS(o,i){var u=it;it=u!==0&&4>u?u:4,o(!0);var h=Fd.transition;Fd.transition={};try{o(!1),i()}finally{it=u,Fd.transition=h}}function Sx(){return sr().memoizedState}function GS(o,i,u){var h=As(o);if(u={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null},Nx(o))Cx(i,u);else if(u=nx(o,i,u,h),u!==null){var b=Nn();br(u,o,h,b),Ex(u,i,h)}}function YS(o,i,u){var h=As(o),b={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null};if(Nx(o))Cx(i,b);else{var j=o.alternate;if(o.lanes===0&&(j===null||j.lanes===0)&&(j=i.lastRenderedReducer,j!==null))try{var P=i.lastRenderedState,F=j(P,u);if(b.hasEagerState=!0,b.eagerState=F,hr(F,P)){var V=i.interleaved;V===null?(b.next=b,Id(i)):(b.next=V.next,V.next=b),i.interleaved=b;return}}catch{}finally{}u=nx(o,i,b,h),u!==null&&(b=Nn(),br(u,o,h,b),Ex(u,i,h))}}function Nx(o){var i=o.alternate;return o===At||i!==null&&i===At}function Cx(o,i){na=Gl=!0;var u=o.pending;u===null?i.next=i:(i.next=u.next,u.next=i),o.pending=i}function Ex(o,i,u){if((u&4194240)!==0){var h=i.lanes;h&=o.pendingLanes,u|=h,i.lanes=u,Gu(o,u)}}var Jl={readContext:rr,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useInsertionEffect:xn,useLayoutEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useMutableSource:xn,useSyncExternalStore:xn,useId:xn,unstable_isNewReconciler:!1},XS={readContext:rr,useCallback:function(o,i){return Or().memoizedState=[o,i===void 0?null:i],o},useContext:rr,useEffect:gx,useImperativeHandle:function(o,i,u){return u=u!=null?u.concat([o]):null,Yl(4194308,4,vx.bind(null,i,o),u)},useLayoutEffect:function(o,i){return Yl(4194308,4,o,i)},useInsertionEffect:function(o,i){return Yl(4,2,o,i)},useMemo:function(o,i){var u=Or();return i=i===void 0?null:i,o=o(),u.memoizedState=[o,i],o},useReducer:function(o,i,u){var h=Or();return i=u!==void 0?u(i):i,h.memoizedState=h.baseState=i,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:i},h.queue=o,o=o.dispatch=GS.bind(null,At,o),[h.memoizedState,o]},useRef:function(o){var i=Or();return o={current:o},i.memoizedState=o},useState:mx,useDebugValue:qd,useDeferredValue:function(o){return Or().memoizedState=o},useTransition:function(){var o=mx(!1),i=o[0];return o=KS.bind(null,o[1]),Or().memoizedState=o,[i,o]},useMutableSource:function(){},useSyncExternalStore:function(o,i,u){var h=At,b=Or();if(Nt){if(u===void 0)throw Error(n(407));u=u()}else{if(u=i(),sn===null)throw Error(n(349));(no&30)!==0||cx(h,i,u)}b.memoizedState=u;var j={value:u,getSnapshot:i};return b.queue=j,gx(dx.bind(null,h,j,o),[o]),h.flags|=2048,oa(9,ux.bind(null,h,j,u,i),void 0,null),u},useId:function(){var o=Or(),i=sn.identifierPrefix;if(Nt){var u=ss,h=rs;u=(h&~(1<<32-mr(h)-1)).toString(32)+u,i=":"+i+"R"+u,u=ra++,0<u&&(i+="H"+u.toString(32)),i+=":"}else u=qS++,i=":"+i+"r"+u.toString(32)+":";return o.memoizedState=i},unstable_isNewReconciler:!1},JS={readContext:rr,useCallback:wx,useContext:rr,useEffect:Vd,useImperativeHandle:bx,useInsertionEffect:xx,useLayoutEffect:yx,useMemo:jx,useReducer:Hd,useRef:hx,useState:function(){return Hd(sa)},useDebugValue:qd,useDeferredValue:function(o){var i=sr();return kx(i,Kt.memoizedState,o)},useTransition:function(){var o=Hd(sa)[0],i=sr().memoizedState;return[o,i]},useMutableSource:ax,useSyncExternalStore:lx,useId:Sx,unstable_isNewReconciler:!1},QS={readContext:rr,useCallback:wx,useContext:rr,useEffect:Vd,useImperativeHandle:bx,useInsertionEffect:xx,useLayoutEffect:yx,useMemo:jx,useReducer:Wd,useRef:hx,useState:function(){return Wd(sa)},useDebugValue:qd,useDeferredValue:function(o){var i=sr();return Kt===null?i.memoizedState=o:kx(i,Kt.memoizedState,o)},useTransition:function(){var o=Wd(sa)[0],i=sr().memoizedState;return[o,i]},useMutableSource:ax,useSyncExternalStore:lx,useId:Sx,unstable_isNewReconciler:!1};function xr(o,i){if(o&&o.defaultProps){i=C({},i),o=o.defaultProps;for(var u in o)i[u]===void 0&&(i[u]=o[u]);return i}return i}function Kd(o,i,u,h){i=o.memoizedState,u=u(h,i),u=u==null?i:C({},i,u),o.memoizedState=u,o.lanes===0&&(o.updateQueue.baseState=u)}var Ql={isMounted:function(o){return(o=o._reactInternals)?dt(o)===o:!1},enqueueSetState:function(o,i,u){o=o._reactInternals;var h=Nn(),b=As(o),j=is(h,b);j.payload=i,u!=null&&(j.callback=u),i=Es(o,j,b),i!==null&&(br(i,o,b,h),Wl(i,o,b))},enqueueReplaceState:function(o,i,u){o=o._reactInternals;var h=Nn(),b=As(o),j=is(h,b);j.tag=1,j.payload=i,u!=null&&(j.callback=u),i=Es(o,j,b),i!==null&&(br(i,o,b,h),Wl(i,o,b))},enqueueForceUpdate:function(o,i){o=o._reactInternals;var u=Nn(),h=As(o),b=is(u,h);b.tag=2,i!=null&&(b.callback=i),i=Es(o,b,h),i!==null&&(br(i,o,h,u),Wl(i,o,h))}};function Tx(o,i,u,h,b,j,P){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(h,j,P):i.prototype&&i.prototype.isPureReactComponent?!Vi(u,h)||!Vi(b,j):!0}function Px(o,i,u){var h=!1,b=Ss,j=i.contextType;return typeof j=="object"&&j!==null?j=rr(j):(b=An(i)?Js:gn.current,h=i.contextTypes,j=(h=h!=null)?Io(o,b):Ss),i=new i(u,j),o.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Ql,o.stateNode=i,i._reactInternals=o,h&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=b,o.__reactInternalMemoizedMaskedChildContext=j),i}function Rx(o,i,u,h){o=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,h),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,h),i.state!==o&&Ql.enqueueReplaceState(i,i.state,null)}function Gd(o,i,u,h){var b=o.stateNode;b.props=u,b.state=o.memoizedState,b.refs={},Od(o);var j=i.contextType;typeof j=="object"&&j!==null?b.context=rr(j):(j=An(i)?Js:gn.current,b.context=Io(o,j)),b.state=o.memoizedState,j=i.getDerivedStateFromProps,typeof j=="function"&&(Kd(o,i,j,u),b.state=o.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(i=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),i!==b.state&&Ql.enqueueReplaceState(b,b.state,null),Vl(o,u,b,h),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function Bo(o,i){try{var u="",h=i;do u+=ce(h),h=h.return;while(h);var b=u}catch(j){b=`
39
- Error generating stack: `+j.message+`
40
- `+j.stack}return{value:o,source:i,stack:b,digest:null}}function Yd(o,i,u){return{value:o,source:null,stack:u??null,digest:i??null}}function Xd(o,i){try{console.error(i.value)}catch(u){setTimeout(function(){throw u})}}var ZS=typeof WeakMap=="function"?WeakMap:Map;function Ax(o,i,u){u=is(-1,u),u.tag=3,u.payload={element:null};var h=i.value;return u.callback=function(){oc||(oc=!0,ff=h),Xd(o,i)},u}function Dx(o,i,u){u=is(-1,u),u.tag=3;var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var b=i.value;u.payload=function(){return h(b)},u.callback=function(){Xd(o,i)}}var j=o.stateNode;return j!==null&&typeof j.componentDidCatch=="function"&&(u.callback=function(){Xd(o,i),typeof h!="function"&&(Ps===null?Ps=new Set([this]):Ps.add(this));var P=i.stack;this.componentDidCatch(i.value,{componentStack:P!==null?P:""})}),u}function Ix(o,i,u){var h=o.pingCache;if(h===null){h=o.pingCache=new ZS;var b=new Set;h.set(i,b)}else b=h.get(i),b===void 0&&(b=new Set,h.set(i,b));b.has(u)||(b.add(u),o=pN.bind(null,o,i,u),i.then(o,o))}function Ox(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 Lx(o,i,u,h,b){return(o.mode&1)===0?(o===i?o.flags|=65536:(o.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(i=is(-1,1),i.tag=2,Es(u,i,1))),u.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var eN=A.ReactCurrentOwner,Dn=!1;function Sn(o,i,u,h){i.child=o===null?tx(i,null,u,h):Mo(i,o.child,u,h)}function $x(o,i,u,h,b){u=u.render;var j=i.ref;return Fo(i,b),h=Bd(o,i,u,h,j,b),u=Ud(),o!==null&&!Dn?(i.updateQueue=o.updateQueue,i.flags&=-2053,o.lanes&=~b,as(o,i,b)):(Nt&&u&&Sd(i),i.flags|=1,Sn(o,i,h,b),i.child)}function Mx(o,i,u,h,b){if(o===null){var j=u.type;return typeof j=="function"&&!vf(j)&&j.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(i.tag=15,i.type=j,_x(o,i,j,h,b)):(o=dc(u.type,null,h,i,i.mode,b),o.ref=i.ref,o.return=i,i.child=o)}if(j=o.child,(o.lanes&b)===0){var P=j.memoizedProps;if(u=u.compare,u=u!==null?u:Vi,u(P,h)&&o.ref===i.ref)return as(o,i,b)}return i.flags|=1,o=Is(j,h),o.ref=i.ref,o.return=i,i.child=o}function _x(o,i,u,h,b){if(o!==null){var j=o.memoizedProps;if(Vi(j,h)&&o.ref===i.ref)if(Dn=!1,i.pendingProps=h=j,(o.lanes&b)!==0)(o.flags&131072)!==0&&(Dn=!0);else return i.lanes=o.lanes,as(o,i,b)}return Jd(o,i,u,h,b)}function Fx(o,i,u){var h=i.pendingProps,b=h.children,j=o!==null?o.memoizedState:null;if(h.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},ht(Ho,Gn),Gn|=u;else{if((u&1073741824)===0)return o=j!==null?j.baseLanes|u:u,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:o,cachePool:null,transitions:null},i.updateQueue=null,ht(Ho,Gn),Gn|=o,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=j!==null?j.baseLanes:u,ht(Ho,Gn),Gn|=h}else j!==null?(h=j.baseLanes|u,i.memoizedState=null):h=u,ht(Ho,Gn),Gn|=h;return Sn(o,i,b,u),i.child}function zx(o,i){var u=i.ref;(o===null&&u!==null||o!==null&&o.ref!==u)&&(i.flags|=512,i.flags|=2097152)}function Jd(o,i,u,h,b){var j=An(u)?Js:gn.current;return j=Io(i,j),Fo(i,b),u=Bd(o,i,u,h,j,b),h=Ud(),o!==null&&!Dn?(i.updateQueue=o.updateQueue,i.flags&=-2053,o.lanes&=~b,as(o,i,b)):(Nt&&h&&Sd(i),i.flags|=1,Sn(o,i,u,b),i.child)}function Bx(o,i,u,h,b){if(An(u)){var j=!0;$l(i)}else j=!1;if(Fo(i,b),i.stateNode===null)ec(o,i),Px(i,u,h),Gd(i,u,h,b),h=!0;else if(o===null){var P=i.stateNode,F=i.memoizedProps;P.props=F;var V=P.context,oe=u.contextType;typeof oe=="object"&&oe!==null?oe=rr(oe):(oe=An(u)?Js:gn.current,oe=Io(i,oe));var he=u.getDerivedStateFromProps,xe=typeof he=="function"||typeof P.getSnapshotBeforeUpdate=="function";xe||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(F!==h||V!==oe)&&Rx(i,P,h,oe),Cs=!1;var de=i.memoizedState;P.state=de,Vl(i,h,P,b),V=i.memoizedState,F!==h||de!==V||Rn.current||Cs?(typeof he=="function"&&(Kd(i,u,he,h),V=i.memoizedState),(F=Cs||Tx(i,u,F,h,de,V,oe))?(xe||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=h,i.memoizedState=V),P.props=h,P.state=V,P.context=oe,h=F):(typeof P.componentDidMount=="function"&&(i.flags|=4194308),h=!1)}else{P=i.stateNode,rx(o,i),F=i.memoizedProps,oe=i.type===i.elementType?F:xr(i.type,F),P.props=oe,xe=i.pendingProps,de=P.context,V=u.contextType,typeof V=="object"&&V!==null?V=rr(V):(V=An(u)?Js:gn.current,V=Io(i,V));var Ce=u.getDerivedStateFromProps;(he=typeof Ce=="function"||typeof P.getSnapshotBeforeUpdate=="function")||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(F!==xe||de!==V)&&Rx(i,P,h,V),Cs=!1,de=i.memoizedState,P.state=de,Vl(i,h,P,b);var Re=i.memoizedState;F!==xe||de!==Re||Rn.current||Cs?(typeof Ce=="function"&&(Kd(i,u,Ce,h),Re=i.memoizedState),(oe=Cs||Tx(i,u,oe,h,de,Re,V)||!1)?(he||typeof P.UNSAFE_componentWillUpdate!="function"&&typeof P.componentWillUpdate!="function"||(typeof P.componentWillUpdate=="function"&&P.componentWillUpdate(h,Re,V),typeof P.UNSAFE_componentWillUpdate=="function"&&P.UNSAFE_componentWillUpdate(h,Re,V)),typeof P.componentDidUpdate=="function"&&(i.flags|=4),typeof P.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof P.componentDidUpdate!="function"||F===o.memoizedProps&&de===o.memoizedState||(i.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||F===o.memoizedProps&&de===o.memoizedState||(i.flags|=1024),i.memoizedProps=h,i.memoizedState=Re),P.props=h,P.state=Re,P.context=V,h=oe):(typeof P.componentDidUpdate!="function"||F===o.memoizedProps&&de===o.memoizedState||(i.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||F===o.memoizedProps&&de===o.memoizedState||(i.flags|=1024),h=!1)}return Qd(o,i,u,h,j,b)}function Qd(o,i,u,h,b,j){zx(o,i);var P=(i.flags&128)!==0;if(!h&&!P)return b&&qg(i,u,!1),as(o,i,j);h=i.stateNode,eN.current=i;var F=P&&typeof u.getDerivedStateFromError!="function"?null:h.render();return i.flags|=1,o!==null&&P?(i.child=Mo(i,o.child,null,j),i.child=Mo(i,null,F,j)):Sn(o,i,F,j),i.memoizedState=h.state,b&&qg(i,u,!0),i.child}function Ux(o){var i=o.stateNode;i.pendingContext?Wg(o,i.pendingContext,i.pendingContext!==i.context):i.context&&Wg(o,i.context,!1),Ld(o,i.containerInfo)}function Hx(o,i,u,h,b){return $o(),Td(b),i.flags|=256,Sn(o,i,u,h),i.child}var Zd={dehydrated:null,treeContext:null,retryLane:0};function ef(o){return{baseLanes:o,cachePool:null,transitions:null}}function Wx(o,i,u){var h=i.pendingProps,b=Rt.current,j=!1,P=(i.flags&128)!==0,F;if((F=P)||(F=o!==null&&o.memoizedState===null?!1:(b&2)!==0),F?(j=!0,i.flags&=-129):(o===null||o.memoizedState!==null)&&(b|=1),ht(Rt,b&1),o===null)return Ed(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=h.children,o=h.fallback,j?(h=i.mode,j=i.child,P={mode:"hidden",children:P},(h&1)===0&&j!==null?(j.childLanes=0,j.pendingProps=P):j=fc(P,h,0,null),o=ao(o,h,u,null),j.return=i,o.return=i,j.sibling=o,i.child=j,i.child.memoizedState=ef(u),i.memoizedState=Zd,o):tf(i,P));if(b=o.memoizedState,b!==null&&(F=b.dehydrated,F!==null))return tN(o,i,P,h,F,b,u);if(j){j=h.fallback,P=i.mode,b=o.child,F=b.sibling;var V={mode:"hidden",children:h.children};return(P&1)===0&&i.child!==b?(h=i.child,h.childLanes=0,h.pendingProps=V,i.deletions=null):(h=Is(b,V),h.subtreeFlags=b.subtreeFlags&14680064),F!==null?j=Is(F,j):(j=ao(j,P,u,null),j.flags|=2),j.return=i,h.return=i,h.sibling=j,i.child=h,h=j,j=i.child,P=o.child.memoizedState,P=P===null?ef(u):{baseLanes:P.baseLanes|u,cachePool:null,transitions:P.transitions},j.memoizedState=P,j.childLanes=o.childLanes&~u,i.memoizedState=Zd,h}return j=o.child,o=j.sibling,h=Is(j,{mode:"visible",children:h.children}),(i.mode&1)===0&&(h.lanes=u),h.return=i,h.sibling=null,o!==null&&(u=i.deletions,u===null?(i.deletions=[o],i.flags|=16):u.push(o)),i.child=h,i.memoizedState=null,h}function tf(o,i){return i=fc({mode:"visible",children:i},o.mode,0,null),i.return=o,o.child=i}function Zl(o,i,u,h){return h!==null&&Td(h),Mo(i,o.child,null,u),o=tf(i,i.pendingProps.children),o.flags|=2,i.memoizedState=null,o}function tN(o,i,u,h,b,j,P){if(u)return i.flags&256?(i.flags&=-257,h=Yd(Error(n(422))),Zl(o,i,P,h)):i.memoizedState!==null?(i.child=o.child,i.flags|=128,null):(j=h.fallback,b=i.mode,h=fc({mode:"visible",children:h.children},b,0,null),j=ao(j,b,P,null),j.flags|=2,h.return=i,j.return=i,h.sibling=j,i.child=h,(i.mode&1)!==0&&Mo(i,o.child,null,P),i.child.memoizedState=ef(P),i.memoizedState=Zd,j);if((i.mode&1)===0)return Zl(o,i,P,null);if(b.data==="$!"){if(h=b.nextSibling&&b.nextSibling.dataset,h)var F=h.dgst;return h=F,j=Error(n(419)),h=Yd(j,h,void 0),Zl(o,i,P,h)}if(F=(P&o.childLanes)!==0,Dn||F){if(h=sn,h!==null){switch(P&-P){case 4:b=2;break;case 16:b=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:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(h.suspendedLanes|P))!==0?0:b,b!==0&&b!==j.retryLane&&(j.retryLane=b,os(o,b),br(h,o,b,-1))}return yf(),h=Yd(Error(n(421))),Zl(o,i,P,h)}return b.data==="$?"?(i.flags|=128,i.child=o.child,i=mN.bind(null,o),b._reactRetry=i,null):(o=j.treeContext,Kn=js(b.nextSibling),qn=i,Nt=!0,gr=null,o!==null&&(tr[nr++]=rs,tr[nr++]=ss,tr[nr++]=Qs,rs=o.id,ss=o.overflow,Qs=i),i=tf(i,h.children),i.flags|=4096,i)}function Vx(o,i,u){o.lanes|=i;var h=o.alternate;h!==null&&(h.lanes|=i),Dd(o.return,i,u)}function nf(o,i,u,h,b){var j=o.memoizedState;j===null?o.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:b}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=h,j.tail=u,j.tailMode=b)}function qx(o,i,u){var h=i.pendingProps,b=h.revealOrder,j=h.tail;if(Sn(o,i,h.children,u),h=Rt.current,(h&2)!==0)h=h&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&&Vx(o,u,i);else if(o.tag===19)Vx(o,u,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}h&=1}if(ht(Rt,h),(i.mode&1)===0)i.memoizedState=null;else switch(b){case"forwards":for(u=i.child,b=null;u!==null;)o=u.alternate,o!==null&&ql(o)===null&&(b=u),u=u.sibling;u=b,u===null?(b=i.child,i.child=null):(b=u.sibling,u.sibling=null),nf(i,!1,b,u,j);break;case"backwards":for(u=null,b=i.child,i.child=null;b!==null;){if(o=b.alternate,o!==null&&ql(o)===null){i.child=b;break}o=b.sibling,b.sibling=u,u=b,b=o}nf(i,!0,u,null,j);break;case"together":nf(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function ec(o,i){(i.mode&1)===0&&o!==null&&(o.alternate=null,i.alternate=null,i.flags|=2)}function as(o,i,u){if(o!==null&&(i.dependencies=o.dependencies),ro|=i.lanes,(u&i.childLanes)===0)return null;if(o!==null&&i.child!==o.child)throw Error(n(153));if(i.child!==null){for(o=i.child,u=Is(o,o.pendingProps),i.child=u,u.return=i;o.sibling!==null;)o=o.sibling,u=u.sibling=Is(o,o.pendingProps),u.return=i;u.sibling=null}return i.child}function nN(o,i,u){switch(i.tag){case 3:Ux(i),$o();break;case 5:ix(i);break;case 1:An(i.type)&&$l(i);break;case 4:Ld(i,i.stateNode.containerInfo);break;case 10:var h=i.type._context,b=i.memoizedProps.value;ht(Ul,h._currentValue),h._currentValue=b;break;case 13:if(h=i.memoizedState,h!==null)return h.dehydrated!==null?(ht(Rt,Rt.current&1),i.flags|=128,null):(u&i.child.childLanes)!==0?Wx(o,i,u):(ht(Rt,Rt.current&1),o=as(o,i,u),o!==null?o.sibling:null);ht(Rt,Rt.current&1);break;case 19:if(h=(u&i.childLanes)!==0,(o.flags&128)!==0){if(h)return qx(o,i,u);i.flags|=128}if(b=i.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),ht(Rt,Rt.current),h)break;return null;case 22:case 23:return i.lanes=0,Fx(o,i,u)}return as(o,i,u)}var Kx,rf,Gx,Yx;Kx=function(o,i){for(var u=i.child;u!==null;){if(u.tag===5||u.tag===6)o.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===i)break;for(;u.sibling===null;){if(u.return===null||u.return===i)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},rf=function(){},Gx=function(o,i,u,h){var b=o.memoizedProps;if(b!==h){o=i.stateNode,to(Ir.current);var j=null;switch(u){case"input":b=ne(o,b),h=ne(o,h),j=[];break;case"select":b=C({},b,{value:void 0}),h=C({},h,{value:void 0}),j=[];break;case"textarea":b=lt(o,b),h=lt(o,h),j=[];break;default:typeof b.onClick!="function"&&typeof h.onClick=="function"&&(o.onclick=Il)}It(u,h);var P;u=null;for(oe in b)if(!h.hasOwnProperty(oe)&&b.hasOwnProperty(oe)&&b[oe]!=null)if(oe==="style"){var F=b[oe];for(P in F)F.hasOwnProperty(P)&&(u||(u={}),u[P]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(a.hasOwnProperty(oe)?j||(j=[]):(j=j||[]).push(oe,null));for(oe in h){var V=h[oe];if(F=b!=null?b[oe]:void 0,h.hasOwnProperty(oe)&&V!==F&&(V!=null||F!=null))if(oe==="style")if(F){for(P in F)!F.hasOwnProperty(P)||V&&V.hasOwnProperty(P)||(u||(u={}),u[P]="");for(P in V)V.hasOwnProperty(P)&&F[P]!==V[P]&&(u||(u={}),u[P]=V[P])}else u||(j||(j=[]),j.push(oe,u)),u=V;else oe==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,F=F?F.__html:void 0,V!=null&&F!==V&&(j=j||[]).push(oe,V)):oe==="children"?typeof V!="string"&&typeof V!="number"||(j=j||[]).push(oe,""+V):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(a.hasOwnProperty(oe)?(V!=null&&oe==="onScroll"&&yt("scroll",o),j||F===V||(j=[])):(j=j||[]).push(oe,V))}u&&(j=j||[]).push("style",u);var oe=j;(i.updateQueue=oe)&&(i.flags|=4)}},Yx=function(o,i,u,h){u!==h&&(i.flags|=4)};function ia(o,i){if(!Nt)switch(o.tailMode){case"hidden":i=o.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?o.tail=null:u.sibling=null;break;case"collapsed":u=o.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?i||o.tail===null?o.tail=null:o.tail.sibling=null:h.sibling=null}}function yn(o){var i=o.alternate!==null&&o.alternate.child===o.child,u=0,h=0;if(i)for(var b=o.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags&14680064,h|=b.flags&14680064,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=h,o.childLanes=u,i}function rN(o,i,u){var h=i.pendingProps;switch(Nd(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yn(i),null;case 1:return An(i.type)&&Ll(),yn(i),null;case 3:return h=i.stateNode,zo(),vt(Rn),vt(gn),_d(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(zl(i)?i.flags|=4:o===null||o.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,gr!==null&&(hf(gr),gr=null))),rf(o,i),yn(i),null;case 5:$d(i);var b=to(ta.current);if(u=i.type,o!==null&&i.stateNode!=null)Gx(o,i,u,h,b),o.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!h){if(i.stateNode===null)throw Error(n(166));return yn(i),null}if(o=to(Ir.current),zl(i)){h=i.stateNode,u=i.type;var j=i.memoizedProps;switch(h[Dr]=i,h[Xi]=j,o=(i.mode&1)!==0,u){case"dialog":yt("cancel",h),yt("close",h);break;case"iframe":case"object":case"embed":yt("load",h);break;case"video":case"audio":for(b=0;b<Ki.length;b++)yt(Ki[b],h);break;case"source":yt("error",h);break;case"img":case"image":case"link":yt("error",h),yt("load",h);break;case"details":yt("toggle",h);break;case"input":le(h,j),yt("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!j.multiple},yt("invalid",h);break;case"textarea":_t(h,j),yt("invalid",h)}It(u,j),b=null;for(var P in j)if(j.hasOwnProperty(P)){var F=j[P];P==="children"?typeof F=="string"?h.textContent!==F&&(j.suppressHydrationWarning!==!0&&Dl(h.textContent,F,o),b=["children",F]):typeof F=="number"&&h.textContent!==""+F&&(j.suppressHydrationWarning!==!0&&Dl(h.textContent,F,o),b=["children",""+F]):a.hasOwnProperty(P)&&F!=null&&P==="onScroll"&&yt("scroll",h)}switch(u){case"input":Ve(h),ve(h,j,!0);break;case"textarea":Ve(h),St(h);break;case"select":case"option":break;default:typeof j.onClick=="function"&&(h.onclick=Il)}h=b,i.updateQueue=h,h!==null&&(i.flags|=4)}else{P=b.nodeType===9?b:b.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=se(u)),o==="http://www.w3.org/1999/xhtml"?u==="script"?(o=P.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof h.is=="string"?o=P.createElement(u,{is:h.is}):(o=P.createElement(u),u==="select"&&(P=o,h.multiple?P.multiple=!0:h.size&&(P.size=h.size))):o=P.createElementNS(o,u),o[Dr]=i,o[Xi]=h,Kx(o,i,!1,!1),i.stateNode=o;e:{switch(P=Tn(u,h),u){case"dialog":yt("cancel",o),yt("close",o),b=h;break;case"iframe":case"object":case"embed":yt("load",o),b=h;break;case"video":case"audio":for(b=0;b<Ki.length;b++)yt(Ki[b],o);b=h;break;case"source":yt("error",o),b=h;break;case"img":case"image":case"link":yt("error",o),yt("load",o),b=h;break;case"details":yt("toggle",o),b=h;break;case"input":le(o,h),b=ne(o,h),yt("invalid",o);break;case"option":b=h;break;case"select":o._wrapperState={wasMultiple:!!h.multiple},b=C({},h,{value:void 0}),yt("invalid",o);break;case"textarea":_t(o,h),b=lt(o,h),yt("invalid",o);break;default:b=h}It(u,b),F=b;for(j in F)if(F.hasOwnProperty(j)){var V=F[j];j==="style"?He(o,V):j==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,V!=null&&Fe(o,V)):j==="children"?typeof V=="string"?(u!=="textarea"||V!=="")&&qe(o,V):typeof V=="number"&&qe(o,""+V):j!=="suppressContentEditableWarning"&&j!=="suppressHydrationWarning"&&j!=="autoFocus"&&(a.hasOwnProperty(j)?V!=null&&j==="onScroll"&&yt("scroll",o):V!=null&&N(o,j,V,P))}switch(u){case"input":Ve(o),ve(o,h,!1);break;case"textarea":Ve(o),St(o);break;case"option":h.value!=null&&o.setAttribute("value",""+je(h.value));break;case"select":o.multiple=!!h.multiple,j=h.value,j!=null?st(o,!!h.multiple,j,!1):h.defaultValue!=null&&st(o,!!h.multiple,h.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=Il)}switch(u){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return yn(i),null;case 6:if(o&&i.stateNode!=null)Yx(o,i,o.memoizedProps,h);else{if(typeof h!="string"&&i.stateNode===null)throw Error(n(166));if(u=to(ta.current),to(Ir.current),zl(i)){if(h=i.stateNode,u=i.memoizedProps,h[Dr]=i,(j=h.nodeValue!==u)&&(o=qn,o!==null))switch(o.tag){case 3:Dl(h.nodeValue,u,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&Dl(h.nodeValue,u,(o.mode&1)!==0)}j&&(i.flags|=4)}else h=(u.nodeType===9?u:u.ownerDocument).createTextNode(h),h[Dr]=i,i.stateNode=h}return yn(i),null;case 13:if(vt(Rt),h=i.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Nt&&Kn!==null&&(i.mode&1)!==0&&(i.flags&128)===0)Qg(),$o(),i.flags|=98560,j=!1;else if(j=zl(i),h!==null&&h.dehydrated!==null){if(o===null){if(!j)throw Error(n(318));if(j=i.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(n(317));j[Dr]=i}else $o(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;yn(i),j=!1}else gr!==null&&(hf(gr),gr=null),j=!0;if(!j)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=u,i):(h=h!==null,h!==(o!==null&&o.memoizedState!==null)&&h&&(i.child.flags|=8192,(i.mode&1)!==0&&(o===null||(Rt.current&1)!==0?Gt===0&&(Gt=3):yf())),i.updateQueue!==null&&(i.flags|=4),yn(i),null);case 4:return zo(),rf(o,i),o===null&&Gi(i.stateNode.containerInfo),yn(i),null;case 10:return Ad(i.type._context),yn(i),null;case 17:return An(i.type)&&Ll(),yn(i),null;case 19:if(vt(Rt),j=i.memoizedState,j===null)return yn(i),null;if(h=(i.flags&128)!==0,P=j.rendering,P===null)if(h)ia(j,!1);else{if(Gt!==0||o!==null&&(o.flags&128)!==0)for(o=i.child;o!==null;){if(P=ql(o),P!==null){for(i.flags|=128,ia(j,!1),h=P.updateQueue,h!==null&&(i.updateQueue=h,i.flags|=4),i.subtreeFlags=0,h=u,u=i.child;u!==null;)j=u,o=h,j.flags&=14680066,P=j.alternate,P===null?(j.childLanes=0,j.lanes=o,j.child=null,j.subtreeFlags=0,j.memoizedProps=null,j.memoizedState=null,j.updateQueue=null,j.dependencies=null,j.stateNode=null):(j.childLanes=P.childLanes,j.lanes=P.lanes,j.child=P.child,j.subtreeFlags=0,j.deletions=null,j.memoizedProps=P.memoizedProps,j.memoizedState=P.memoizedState,j.updateQueue=P.updateQueue,j.type=P.type,o=P.dependencies,j.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),u=u.sibling;return ht(Rt,Rt.current&1|2),i.child}o=o.sibling}j.tail!==null&&$t()>Wo&&(i.flags|=128,h=!0,ia(j,!1),i.lanes=4194304)}else{if(!h)if(o=ql(P),o!==null){if(i.flags|=128,h=!0,u=o.updateQueue,u!==null&&(i.updateQueue=u,i.flags|=4),ia(j,!0),j.tail===null&&j.tailMode==="hidden"&&!P.alternate&&!Nt)return yn(i),null}else 2*$t()-j.renderingStartTime>Wo&&u!==1073741824&&(i.flags|=128,h=!0,ia(j,!1),i.lanes=4194304);j.isBackwards?(P.sibling=i.child,i.child=P):(u=j.last,u!==null?u.sibling=P:i.child=P,j.last=P)}return j.tail!==null?(i=j.tail,j.rendering=i,j.tail=i.sibling,j.renderingStartTime=$t(),i.sibling=null,u=Rt.current,ht(Rt,h?u&1|2:u&1),i):(yn(i),null);case 22:case 23:return xf(),h=i.memoizedState!==null,o!==null&&o.memoizedState!==null!==h&&(i.flags|=8192),h&&(i.mode&1)!==0?(Gn&1073741824)!==0&&(yn(i),i.subtreeFlags&6&&(i.flags|=8192)):yn(i),null;case 24:return null;case 25:return null}throw Error(n(156,i.tag))}function sN(o,i){switch(Nd(i),i.tag){case 1:return An(i.type)&&Ll(),o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 3:return zo(),vt(Rn),vt(gn),_d(),o=i.flags,(o&65536)!==0&&(o&128)===0?(i.flags=o&-65537|128,i):null;case 5:return $d(i),null;case 13:if(vt(Rt),o=i.memoizedState,o!==null&&o.dehydrated!==null){if(i.alternate===null)throw Error(n(340));$o()}return o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 19:return vt(Rt),null;case 4:return zo(),null;case 10:return Ad(i.type._context),null;case 22:case 23:return xf(),null;case 24:return null;default:return null}}var tc=!1,vn=!1,oN=typeof WeakSet=="function"?WeakSet:Set,Te=null;function Uo(o,i){var u=o.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(h){Ot(o,i,h)}else u.current=null}function sf(o,i,u){try{u()}catch(h){Ot(o,i,h)}}var Xx=!1;function iN(o,i){if(gd=wl,o=Tg(),ld(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var b=h.anchorOffset,j=h.focusNode;h=h.focusOffset;try{u.nodeType,j.nodeType}catch{u=null;break e}var P=0,F=-1,V=-1,oe=0,he=0,xe=o,de=null;t:for(;;){for(var Ce;xe!==u||b!==0&&xe.nodeType!==3||(F=P+b),xe!==j||h!==0&&xe.nodeType!==3||(V=P+h),xe.nodeType===3&&(P+=xe.nodeValue.length),(Ce=xe.firstChild)!==null;)de=xe,xe=Ce;for(;;){if(xe===o)break t;if(de===u&&++oe===b&&(F=P),de===j&&++he===h&&(V=P),(Ce=xe.nextSibling)!==null)break;xe=de,de=xe.parentNode}xe=Ce}u=F===-1||V===-1?null:{start:F,end:V}}else u=null}u=u||{start:0,end:0}}else u=null;for(xd={focusedElem:o,selectionRange:u},wl=!1,Te=i;Te!==null;)if(i=Te,o=i.child,(i.subtreeFlags&1028)!==0&&o!==null)o.return=i,Te=o;else for(;Te!==null;){i=Te;try{var Re=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(Re!==null){var Ae=Re.memoizedProps,Mt=Re.memoizedState,te=i.stateNode,K=te.getSnapshotBeforeUpdate(i.elementType===i.type?Ae:xr(i.type,Ae),Mt);te.__reactInternalSnapshotBeforeUpdate=K}break;case 3:var re=i.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(be){Ot(i,i.return,be)}if(o=i.sibling,o!==null){o.return=i.return,Te=o;break}Te=i.return}return Re=Xx,Xx=!1,Re}function aa(o,i,u){var h=i.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var b=h=h.next;do{if((b.tag&o)===o){var j=b.destroy;b.destroy=void 0,j!==void 0&&sf(i,u,j)}b=b.next}while(b!==h)}}function nc(o,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&o)===o){var h=u.create;u.destroy=h()}u=u.next}while(u!==i)}}function of(o){var i=o.ref;if(i!==null){var u=o.stateNode;switch(o.tag){case 5:o=u;break;default:o=u}typeof i=="function"?i(o):i.current=o}}function Jx(o){var i=o.alternate;i!==null&&(o.alternate=null,Jx(i)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(i=o.stateNode,i!==null&&(delete i[Dr],delete i[Xi],delete i[wd],delete i[US],delete i[HS])),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 Qx(o){return o.tag===5||o.tag===3||o.tag===4}function Zx(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Qx(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 af(o,i,u){var h=o.tag;if(h===5||h===6)o=o.stateNode,i?u.nodeType===8?u.parentNode.insertBefore(o,i):u.insertBefore(o,i):(u.nodeType===8?(i=u.parentNode,i.insertBefore(o,u)):(i=u,i.appendChild(o)),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Il));else if(h!==4&&(o=o.child,o!==null))for(af(o,i,u),o=o.sibling;o!==null;)af(o,i,u),o=o.sibling}function lf(o,i,u){var h=o.tag;if(h===5||h===6)o=o.stateNode,i?u.insertBefore(o,i):u.appendChild(o);else if(h!==4&&(o=o.child,o!==null))for(lf(o,i,u),o=o.sibling;o!==null;)lf(o,i,u),o=o.sibling}var dn=null,yr=!1;function Ts(o,i,u){for(u=u.child;u!==null;)ey(o,i,u),u=u.sibling}function ey(o,i,u){if(Ar&&typeof Ar.onCommitFiberUnmount=="function")try{Ar.onCommitFiberUnmount(hl,u)}catch{}switch(u.tag){case 5:vn||Uo(u,i);case 6:var h=dn,b=yr;dn=null,Ts(o,i,u),dn=h,yr=b,dn!==null&&(yr?(o=dn,u=u.stateNode,o.nodeType===8?o.parentNode.removeChild(u):o.removeChild(u)):dn.removeChild(u.stateNode));break;case 18:dn!==null&&(yr?(o=dn,u=u.stateNode,o.nodeType===8?bd(o.parentNode,u):o.nodeType===1&&bd(o,u),Fi(o)):bd(dn,u.stateNode));break;case 4:h=dn,b=yr,dn=u.stateNode.containerInfo,yr=!0,Ts(o,i,u),dn=h,yr=b;break;case 0:case 11:case 14:case 15:if(!vn&&(h=u.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){b=h=h.next;do{var j=b,P=j.destroy;j=j.tag,P!==void 0&&((j&2)!==0||(j&4)!==0)&&sf(u,i,P),b=b.next}while(b!==h)}Ts(o,i,u);break;case 1:if(!vn&&(Uo(u,i),h=u.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=u.memoizedProps,h.state=u.memoizedState,h.componentWillUnmount()}catch(F){Ot(u,i,F)}Ts(o,i,u);break;case 21:Ts(o,i,u);break;case 22:u.mode&1?(vn=(h=vn)||u.memoizedState!==null,Ts(o,i,u),vn=h):Ts(o,i,u);break;default:Ts(o,i,u)}}function ty(o){var i=o.updateQueue;if(i!==null){o.updateQueue=null;var u=o.stateNode;u===null&&(u=o.stateNode=new oN),i.forEach(function(h){var b=hN.bind(null,o,h);u.has(h)||(u.add(h),h.then(b,b))})}}function vr(o,i){var u=i.deletions;if(u!==null)for(var h=0;h<u.length;h++){var b=u[h];try{var j=o,P=i,F=P;e:for(;F!==null;){switch(F.tag){case 5:dn=F.stateNode,yr=!1;break e;case 3:dn=F.stateNode.containerInfo,yr=!0;break e;case 4:dn=F.stateNode.containerInfo,yr=!0;break e}F=F.return}if(dn===null)throw Error(n(160));ey(j,P,b),dn=null,yr=!1;var V=b.alternate;V!==null&&(V.return=null),b.return=null}catch(oe){Ot(b,i,oe)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)ny(i,o),i=i.sibling}function ny(o,i){var u=o.alternate,h=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(vr(i,o),Lr(o),h&4){try{aa(3,o,o.return),nc(3,o)}catch(Ae){Ot(o,o.return,Ae)}try{aa(5,o,o.return)}catch(Ae){Ot(o,o.return,Ae)}}break;case 1:vr(i,o),Lr(o),h&512&&u!==null&&Uo(u,u.return);break;case 5:if(vr(i,o),Lr(o),h&512&&u!==null&&Uo(u,u.return),o.flags&32){var b=o.stateNode;try{qe(b,"")}catch(Ae){Ot(o,o.return,Ae)}}if(h&4&&(b=o.stateNode,b!=null)){var j=o.memoizedProps,P=u!==null?u.memoizedProps:j,F=o.type,V=o.updateQueue;if(o.updateQueue=null,V!==null)try{F==="input"&&j.type==="radio"&&j.name!=null&&H(b,j),Tn(F,P);var oe=Tn(F,j);for(P=0;P<V.length;P+=2){var he=V[P],xe=V[P+1];he==="style"?He(b,xe):he==="dangerouslySetInnerHTML"?Fe(b,xe):he==="children"?qe(b,xe):N(b,he,xe,oe)}switch(F){case"input":fe(b,j);break;case"textarea":kt(b,j);break;case"select":var de=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!j.multiple;var Ce=j.value;Ce!=null?st(b,!!j.multiple,Ce,!1):de!==!!j.multiple&&(j.defaultValue!=null?st(b,!!j.multiple,j.defaultValue,!0):st(b,!!j.multiple,j.multiple?[]:"",!1))}b[Xi]=j}catch(Ae){Ot(o,o.return,Ae)}}break;case 6:if(vr(i,o),Lr(o),h&4){if(o.stateNode===null)throw Error(n(162));b=o.stateNode,j=o.memoizedProps;try{b.nodeValue=j}catch(Ae){Ot(o,o.return,Ae)}}break;case 3:if(vr(i,o),Lr(o),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Fi(i.containerInfo)}catch(Ae){Ot(o,o.return,Ae)}break;case 4:vr(i,o),Lr(o);break;case 13:vr(i,o),Lr(o),b=o.child,b.flags&8192&&(j=b.memoizedState!==null,b.stateNode.isHidden=j,!j||b.alternate!==null&&b.alternate.memoizedState!==null||(df=$t())),h&4&&ty(o);break;case 22:if(he=u!==null&&u.memoizedState!==null,o.mode&1?(vn=(oe=vn)||he,vr(i,o),vn=oe):vr(i,o),Lr(o),h&8192){if(oe=o.memoizedState!==null,(o.stateNode.isHidden=oe)&&!he&&(o.mode&1)!==0)for(Te=o,he=o.child;he!==null;){for(xe=Te=he;Te!==null;){switch(de=Te,Ce=de.child,de.tag){case 0:case 11:case 14:case 15:aa(4,de,de.return);break;case 1:Uo(de,de.return);var Re=de.stateNode;if(typeof Re.componentWillUnmount=="function"){h=de,u=de.return;try{i=h,Re.props=i.memoizedProps,Re.state=i.memoizedState,Re.componentWillUnmount()}catch(Ae){Ot(h,u,Ae)}}break;case 5:Uo(de,de.return);break;case 22:if(de.memoizedState!==null){oy(xe);continue}}Ce!==null?(Ce.return=de,Te=Ce):oy(xe)}he=he.sibling}e:for(he=null,xe=o;;){if(xe.tag===5){if(he===null){he=xe;try{b=xe.stateNode,oe?(j=b.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none"):(F=xe.stateNode,V=xe.memoizedProps.style,P=V!=null&&V.hasOwnProperty("display")?V.display:null,F.style.display=We("display",P))}catch(Ae){Ot(o,o.return,Ae)}}}else if(xe.tag===6){if(he===null)try{xe.stateNode.nodeValue=oe?"":xe.memoizedProps}catch(Ae){Ot(o,o.return,Ae)}}else if((xe.tag!==22&&xe.tag!==23||xe.memoizedState===null||xe===o)&&xe.child!==null){xe.child.return=xe,xe=xe.child;continue}if(xe===o)break e;for(;xe.sibling===null;){if(xe.return===null||xe.return===o)break e;he===xe&&(he=null),xe=xe.return}he===xe&&(he=null),xe.sibling.return=xe.return,xe=xe.sibling}}break;case 19:vr(i,o),Lr(o),h&4&&ty(o);break;case 21:break;default:vr(i,o),Lr(o)}}function Lr(o){var i=o.flags;if(i&2){try{e:{for(var u=o.return;u!==null;){if(Qx(u)){var h=u;break e}u=u.return}throw Error(n(160))}switch(h.tag){case 5:var b=h.stateNode;h.flags&32&&(qe(b,""),h.flags&=-33);var j=Zx(o);lf(o,j,b);break;case 3:case 4:var P=h.stateNode.containerInfo,F=Zx(o);af(o,F,P);break;default:throw Error(n(161))}}catch(V){Ot(o,o.return,V)}o.flags&=-3}i&4096&&(o.flags&=-4097)}function aN(o,i,u){Te=o,ry(o)}function ry(o,i,u){for(var h=(o.mode&1)!==0;Te!==null;){var b=Te,j=b.child;if(b.tag===22&&h){var P=b.memoizedState!==null||tc;if(!P){var F=b.alternate,V=F!==null&&F.memoizedState!==null||vn;F=tc;var oe=vn;if(tc=P,(vn=V)&&!oe)for(Te=b;Te!==null;)P=Te,V=P.child,P.tag===22&&P.memoizedState!==null?iy(b):V!==null?(V.return=P,Te=V):iy(b);for(;j!==null;)Te=j,ry(j),j=j.sibling;Te=b,tc=F,vn=oe}sy(o)}else(b.subtreeFlags&8772)!==0&&j!==null?(j.return=b,Te=j):sy(o)}}function sy(o){for(;Te!==null;){var i=Te;if((i.flags&8772)!==0){var u=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:vn||nc(5,i);break;case 1:var h=i.stateNode;if(i.flags&4&&!vn)if(u===null)h.componentDidMount();else{var b=i.elementType===i.type?u.memoizedProps:xr(i.type,u.memoizedProps);h.componentDidUpdate(b,u.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var j=i.updateQueue;j!==null&&ox(i,j,h);break;case 3:var P=i.updateQueue;if(P!==null){if(u=null,i.child!==null)switch(i.child.tag){case 5:u=i.child.stateNode;break;case 1:u=i.child.stateNode}ox(i,P,u)}break;case 5:var F=i.stateNode;if(u===null&&i.flags&4){u=F;var V=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":V.autoFocus&&u.focus();break;case"img":V.src&&(u.src=V.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var oe=i.alternate;if(oe!==null){var he=oe.memoizedState;if(he!==null){var xe=he.dehydrated;xe!==null&&Fi(xe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}vn||i.flags&512&&of(i)}catch(de){Ot(i,i.return,de)}}if(i===o){Te=null;break}if(u=i.sibling,u!==null){u.return=i.return,Te=u;break}Te=i.return}}function oy(o){for(;Te!==null;){var i=Te;if(i===o){Te=null;break}var u=i.sibling;if(u!==null){u.return=i.return,Te=u;break}Te=i.return}}function iy(o){for(;Te!==null;){var i=Te;try{switch(i.tag){case 0:case 11:case 15:var u=i.return;try{nc(4,i)}catch(V){Ot(i,u,V)}break;case 1:var h=i.stateNode;if(typeof h.componentDidMount=="function"){var b=i.return;try{h.componentDidMount()}catch(V){Ot(i,b,V)}}var j=i.return;try{of(i)}catch(V){Ot(i,j,V)}break;case 5:var P=i.return;try{of(i)}catch(V){Ot(i,P,V)}}}catch(V){Ot(i,i.return,V)}if(i===o){Te=null;break}var F=i.sibling;if(F!==null){F.return=i.return,Te=F;break}Te=i.return}}var lN=Math.ceil,rc=A.ReactCurrentDispatcher,cf=A.ReactCurrentOwner,or=A.ReactCurrentBatchConfig,Qe=0,sn=null,zt=null,fn=0,Gn=0,Ho=ks(0),Gt=0,la=null,ro=0,sc=0,uf=0,ca=null,In=null,df=0,Wo=1/0,ls=null,oc=!1,ff=null,Ps=null,ic=!1,Rs=null,ac=0,ua=0,pf=null,lc=-1,cc=0;function Nn(){return(Qe&6)!==0?$t():lc!==-1?lc:lc=$t()}function As(o){return(o.mode&1)===0?1:(Qe&2)!==0&&fn!==0?fn&-fn:VS.transition!==null?(cc===0&&(cc=Zh()),cc):(o=it,o!==0||(o=window.event,o=o===void 0?16:lg(o.type)),o)}function br(o,i,u,h){if(50<ua)throw ua=0,pf=null,Error(n(185));Oi(o,u,h),((Qe&2)===0||o!==sn)&&(o===sn&&((Qe&2)===0&&(sc|=u),Gt===4&&Ds(o,fn)),On(o,h),u===1&&Qe===0&&(i.mode&1)===0&&(Wo=$t()+500,Ml&&Ns()))}function On(o,i){var u=o.callbackNode;V1(o,i);var h=yl(o,o===sn?fn:0);if(h===0)u!==null&&Xh(u),o.callbackNode=null,o.callbackPriority=0;else if(i=h&-h,o.callbackPriority!==i){if(u!=null&&Xh(u),i===1)o.tag===0?WS(ly.bind(null,o)):Kg(ly.bind(null,o)),zS(function(){(Qe&6)===0&&Ns()}),u=null;else{switch(eg(h)){case 1:u=Vu;break;case 4:u=Jh;break;case 16:u=ml;break;case 536870912:u=Qh;break;default:u=ml}u=gy(u,ay.bind(null,o))}o.callbackPriority=i,o.callbackNode=u}}function ay(o,i){if(lc=-1,cc=0,(Qe&6)!==0)throw Error(n(327));var u=o.callbackNode;if(Vo()&&o.callbackNode!==u)return null;var h=yl(o,o===sn?fn:0);if(h===0)return null;if((h&30)!==0||(h&o.expiredLanes)!==0||i)i=uc(o,h);else{i=h;var b=Qe;Qe|=2;var j=uy();(sn!==o||fn!==i)&&(ls=null,Wo=$t()+500,oo(o,i));do try{dN();break}catch(F){cy(o,F)}while(!0);Rd(),rc.current=j,Qe=b,zt!==null?i=0:(sn=null,fn=0,i=Gt)}if(i!==0){if(i===2&&(b=qu(o),b!==0&&(h=b,i=mf(o,b))),i===1)throw u=la,oo(o,0),Ds(o,h),On(o,$t()),u;if(i===6)Ds(o,h);else{if(b=o.current.alternate,(h&30)===0&&!cN(b)&&(i=uc(o,h),i===2&&(j=qu(o),j!==0&&(h=j,i=mf(o,j))),i===1))throw u=la,oo(o,0),Ds(o,h),On(o,$t()),u;switch(o.finishedWork=b,o.finishedLanes=h,i){case 0:case 1:throw Error(n(345));case 2:io(o,In,ls);break;case 3:if(Ds(o,h),(h&130023424)===h&&(i=df+500-$t(),10<i)){if(yl(o,0)!==0)break;if(b=o.suspendedLanes,(b&h)!==h){Nn(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=vd(io.bind(null,o,In,ls),i);break}io(o,In,ls);break;case 4:if(Ds(o,h),(h&4194240)===h)break;for(i=o.eventTimes,b=-1;0<h;){var P=31-mr(h);j=1<<P,P=i[P],P>b&&(b=P),h&=~j}if(h=b,h=$t()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*lN(h/1960))-h,10<h){o.timeoutHandle=vd(io.bind(null,o,In,ls),h);break}io(o,In,ls);break;case 5:io(o,In,ls);break;default:throw Error(n(329))}}}return On(o,$t()),o.callbackNode===u?ay.bind(null,o):null}function mf(o,i){var u=ca;return o.current.memoizedState.isDehydrated&&(oo(o,i).flags|=256),o=uc(o,i),o!==2&&(i=In,In=u,i!==null&&hf(i)),o}function hf(o){In===null?In=o:In.push.apply(In,o)}function cN(o){for(var i=o;;){if(i.flags&16384){var u=i.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var h=0;h<u.length;h++){var b=u[h],j=b.getSnapshot;b=b.value;try{if(!hr(j(),b))return!1}catch{return!1}}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;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 Ds(o,i){for(i&=~uf,i&=~sc,o.suspendedLanes|=i,o.pingedLanes&=~i,o=o.expirationTimes;0<i;){var u=31-mr(i),h=1<<u;o[u]=-1,i&=~h}}function ly(o){if((Qe&6)!==0)throw Error(n(327));Vo();var i=yl(o,0);if((i&1)===0)return On(o,$t()),null;var u=uc(o,i);if(o.tag!==0&&u===2){var h=qu(o);h!==0&&(i=h,u=mf(o,h))}if(u===1)throw u=la,oo(o,0),Ds(o,i),On(o,$t()),u;if(u===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=i,io(o,In,ls),On(o,$t()),null}function gf(o,i){var u=Qe;Qe|=1;try{return o(i)}finally{Qe=u,Qe===0&&(Wo=$t()+500,Ml&&Ns())}}function so(o){Rs!==null&&Rs.tag===0&&(Qe&6)===0&&Vo();var i=Qe;Qe|=1;var u=or.transition,h=it;try{if(or.transition=null,it=1,o)return o()}finally{it=h,or.transition=u,Qe=i,(Qe&6)===0&&Ns()}}function xf(){Gn=Ho.current,vt(Ho)}function oo(o,i){o.finishedWork=null,o.finishedLanes=0;var u=o.timeoutHandle;if(u!==-1&&(o.timeoutHandle=-1,FS(u)),zt!==null)for(u=zt.return;u!==null;){var h=u;switch(Nd(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&Ll();break;case 3:zo(),vt(Rn),vt(gn),_d();break;case 5:$d(h);break;case 4:zo();break;case 13:vt(Rt);break;case 19:vt(Rt);break;case 10:Ad(h.type._context);break;case 22:case 23:xf()}u=u.return}if(sn=o,zt=o=Is(o.current,null),fn=Gn=i,Gt=0,la=null,uf=sc=ro=0,In=ca=null,eo!==null){for(i=0;i<eo.length;i++)if(u=eo[i],h=u.interleaved,h!==null){u.interleaved=null;var b=h.next,j=u.pending;if(j!==null){var P=j.next;j.next=b,h.next=P}u.pending=h}eo=null}return o}function cy(o,i){do{var u=zt;try{if(Rd(),Kl.current=Jl,Gl){for(var h=At.memoizedState;h!==null;){var b=h.queue;b!==null&&(b.pending=null),h=h.next}Gl=!1}if(no=0,rn=Kt=At=null,na=!1,ra=0,cf.current=null,u===null||u.return===null){Gt=1,la=i,zt=null;break}e:{var j=o,P=u.return,F=u,V=i;if(i=fn,F.flags|=32768,V!==null&&typeof V=="object"&&typeof V.then=="function"){var oe=V,he=F,xe=he.tag;if((he.mode&1)===0&&(xe===0||xe===11||xe===15)){var de=he.alternate;de?(he.updateQueue=de.updateQueue,he.memoizedState=de.memoizedState,he.lanes=de.lanes):(he.updateQueue=null,he.memoizedState=null)}var Ce=Ox(P);if(Ce!==null){Ce.flags&=-257,Lx(Ce,P,F,j,i),Ce.mode&1&&Ix(j,oe,i),i=Ce,V=oe;var Re=i.updateQueue;if(Re===null){var Ae=new Set;Ae.add(V),i.updateQueue=Ae}else Re.add(V);break e}else{if((i&1)===0){Ix(j,oe,i),yf();break e}V=Error(n(426))}}else if(Nt&&F.mode&1){var Mt=Ox(P);if(Mt!==null){(Mt.flags&65536)===0&&(Mt.flags|=256),Lx(Mt,P,F,j,i),Td(Bo(V,F));break e}}j=V=Bo(V,F),Gt!==4&&(Gt=2),ca===null?ca=[j]:ca.push(j),j=P;do{switch(j.tag){case 3:j.flags|=65536,i&=-i,j.lanes|=i;var te=Ax(j,V,i);sx(j,te);break e;case 1:F=V;var K=j.type,re=j.stateNode;if((j.flags&128)===0&&(typeof K.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(Ps===null||!Ps.has(re)))){j.flags|=65536,i&=-i,j.lanes|=i;var be=Dx(j,F,i);sx(j,be);break e}}j=j.return}while(j!==null)}fy(u)}catch(De){i=De,zt===u&&u!==null&&(zt=u=u.return);continue}break}while(!0)}function uy(){var o=rc.current;return rc.current=Jl,o===null?Jl:o}function yf(){(Gt===0||Gt===3||Gt===2)&&(Gt=4),sn===null||(ro&268435455)===0&&(sc&268435455)===0||Ds(sn,fn)}function uc(o,i){var u=Qe;Qe|=2;var h=uy();(sn!==o||fn!==i)&&(ls=null,oo(o,i));do try{uN();break}catch(b){cy(o,b)}while(!0);if(Rd(),Qe=u,rc.current=h,zt!==null)throw Error(n(261));return sn=null,fn=0,Gt}function uN(){for(;zt!==null;)dy(zt)}function dN(){for(;zt!==null&&!$1();)dy(zt)}function dy(o){var i=hy(o.alternate,o,Gn);o.memoizedProps=o.pendingProps,i===null?fy(o):zt=i,cf.current=null}function fy(o){var i=o;do{var u=i.alternate;if(o=i.return,(i.flags&32768)===0){if(u=rN(u,i,Gn),u!==null){zt=u;return}}else{if(u=sN(u,i),u!==null){u.flags&=32767,zt=u;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{Gt=6,zt=null;return}}if(i=i.sibling,i!==null){zt=i;return}zt=i=o}while(i!==null);Gt===0&&(Gt=5)}function io(o,i,u){var h=it,b=or.transition;try{or.transition=null,it=1,fN(o,i,u,h)}finally{or.transition=b,it=h}return null}function fN(o,i,u,h){do Vo();while(Rs!==null);if((Qe&6)!==0)throw Error(n(327));u=o.finishedWork;var b=o.finishedLanes;if(u===null)return null;if(o.finishedWork=null,o.finishedLanes=0,u===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var j=u.lanes|u.childLanes;if(q1(o,j),o===sn&&(zt=sn=null,fn=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||ic||(ic=!0,gy(ml,function(){return Vo(),null})),j=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||j){j=or.transition,or.transition=null;var P=it;it=1;var F=Qe;Qe|=4,cf.current=null,iN(o,u),ny(u,o),DS(xd),wl=!!gd,xd=gd=null,o.current=u,aN(u),M1(),Qe=F,it=P,or.transition=j}else o.current=u;if(ic&&(ic=!1,Rs=o,ac=b),j=o.pendingLanes,j===0&&(Ps=null),z1(u.stateNode),On(o,$t()),i!==null)for(h=o.onRecoverableError,u=0;u<i.length;u++)b=i[u],h(b.value,{componentStack:b.stack,digest:b.digest});if(oc)throw oc=!1,o=ff,ff=null,o;return(ac&1)!==0&&o.tag!==0&&Vo(),j=o.pendingLanes,(j&1)!==0?o===pf?ua++:(ua=0,pf=o):ua=0,Ns(),null}function Vo(){if(Rs!==null){var o=eg(ac),i=or.transition,u=it;try{if(or.transition=null,it=16>o?16:o,Rs===null)var h=!1;else{if(o=Rs,Rs=null,ac=0,(Qe&6)!==0)throw Error(n(331));var b=Qe;for(Qe|=4,Te=o.current;Te!==null;){var j=Te,P=j.child;if((Te.flags&16)!==0){var F=j.deletions;if(F!==null){for(var V=0;V<F.length;V++){var oe=F[V];for(Te=oe;Te!==null;){var he=Te;switch(he.tag){case 0:case 11:case 15:aa(8,he,j)}var xe=he.child;if(xe!==null)xe.return=he,Te=xe;else for(;Te!==null;){he=Te;var de=he.sibling,Ce=he.return;if(Jx(he),he===oe){Te=null;break}if(de!==null){de.return=Ce,Te=de;break}Te=Ce}}}var Re=j.alternate;if(Re!==null){var Ae=Re.child;if(Ae!==null){Re.child=null;do{var Mt=Ae.sibling;Ae.sibling=null,Ae=Mt}while(Ae!==null)}}Te=j}}if((j.subtreeFlags&2064)!==0&&P!==null)P.return=j,Te=P;else e:for(;Te!==null;){if(j=Te,(j.flags&2048)!==0)switch(j.tag){case 0:case 11:case 15:aa(9,j,j.return)}var te=j.sibling;if(te!==null){te.return=j.return,Te=te;break e}Te=j.return}}var K=o.current;for(Te=K;Te!==null;){P=Te;var re=P.child;if((P.subtreeFlags&2064)!==0&&re!==null)re.return=P,Te=re;else e:for(P=K;Te!==null;){if(F=Te,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:nc(9,F)}}catch(De){Ot(F,F.return,De)}if(F===P){Te=null;break e}var be=F.sibling;if(be!==null){be.return=F.return,Te=be;break e}Te=F.return}}if(Qe=b,Ns(),Ar&&typeof Ar.onPostCommitFiberRoot=="function")try{Ar.onPostCommitFiberRoot(hl,o)}catch{}h=!0}return h}finally{it=u,or.transition=i}}return!1}function py(o,i,u){i=Bo(u,i),i=Ax(o,i,1),o=Es(o,i,1),i=Nn(),o!==null&&(Oi(o,1,i),On(o,i))}function Ot(o,i,u){if(o.tag===3)py(o,o,u);else for(;i!==null;){if(i.tag===3){py(i,o,u);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ps===null||!Ps.has(h))){o=Bo(u,o),o=Dx(i,o,1),i=Es(i,o,1),o=Nn(),i!==null&&(Oi(i,1,o),On(i,o));break}}i=i.return}}function pN(o,i,u){var h=o.pingCache;h!==null&&h.delete(i),i=Nn(),o.pingedLanes|=o.suspendedLanes&u,sn===o&&(fn&u)===u&&(Gt===4||Gt===3&&(fn&130023424)===fn&&500>$t()-df?oo(o,0):uf|=u),On(o,i)}function my(o,i){i===0&&((o.mode&1)===0?i=1:(i=xl,xl<<=1,(xl&130023424)===0&&(xl=4194304)));var u=Nn();o=os(o,i),o!==null&&(Oi(o,i,u),On(o,u))}function mN(o){var i=o.memoizedState,u=0;i!==null&&(u=i.retryLane),my(o,u)}function hN(o,i){var u=0;switch(o.tag){case 13:var h=o.stateNode,b=o.memoizedState;b!==null&&(u=b.retryLane);break;case 19:h=o.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(i),my(o,u)}var hy;hy=function(o,i,u){if(o!==null)if(o.memoizedProps!==i.pendingProps||Rn.current)Dn=!0;else{if((o.lanes&u)===0&&(i.flags&128)===0)return Dn=!1,nN(o,i,u);Dn=(o.flags&131072)!==0}else Dn=!1,Nt&&(i.flags&1048576)!==0&&Gg(i,Fl,i.index);switch(i.lanes=0,i.tag){case 2:var h=i.type;ec(o,i),o=i.pendingProps;var b=Io(i,gn.current);Fo(i,u),b=Bd(null,i,h,o,b,u);var j=Ud();return i.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,An(h)?(j=!0,$l(i)):j=!1,i.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Od(i),b.updater=Ql,i.stateNode=b,b._reactInternals=i,Gd(i,h,o,u),i=Qd(null,i,h,!0,j,u)):(i.tag=0,Nt&&j&&Sd(i),Sn(null,i,b,u),i=i.child),i;case 16:h=i.elementType;e:{switch(ec(o,i),o=i.pendingProps,b=h._init,h=b(h._payload),i.type=h,b=i.tag=xN(h),o=xr(h,o),b){case 0:i=Jd(null,i,h,o,u);break e;case 1:i=Bx(null,i,h,o,u);break e;case 11:i=$x(null,i,h,o,u);break e;case 14:i=Mx(null,i,h,xr(h.type,o),u);break e}throw Error(n(306,h,""))}return i;case 0:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:xr(h,b),Jd(o,i,h,b,u);case 1:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:xr(h,b),Bx(o,i,h,b,u);case 3:e:{if(Ux(i),o===null)throw Error(n(387));h=i.pendingProps,j=i.memoizedState,b=j.element,rx(o,i),Vl(i,h,null,u);var P=i.memoizedState;if(h=P.element,j.isDehydrated)if(j={element:h,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},i.updateQueue.baseState=j,i.memoizedState=j,i.flags&256){b=Bo(Error(n(423)),i),i=Hx(o,i,h,u,b);break e}else if(h!==b){b=Bo(Error(n(424)),i),i=Hx(o,i,h,u,b);break e}else for(Kn=js(i.stateNode.containerInfo.firstChild),qn=i,Nt=!0,gr=null,u=tx(i,null,h,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if($o(),h===b){i=as(o,i,u);break e}Sn(o,i,h,u)}i=i.child}return i;case 5:return ix(i),o===null&&Ed(i),h=i.type,b=i.pendingProps,j=o!==null?o.memoizedProps:null,P=b.children,yd(h,b)?P=null:j!==null&&yd(h,j)&&(i.flags|=32),zx(o,i),Sn(o,i,P,u),i.child;case 6:return o===null&&Ed(i),null;case 13:return Wx(o,i,u);case 4:return Ld(i,i.stateNode.containerInfo),h=i.pendingProps,o===null?i.child=Mo(i,null,h,u):Sn(o,i,h,u),i.child;case 11:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:xr(h,b),$x(o,i,h,b,u);case 7:return Sn(o,i,i.pendingProps,u),i.child;case 8:return Sn(o,i,i.pendingProps.children,u),i.child;case 12:return Sn(o,i,i.pendingProps.children,u),i.child;case 10:e:{if(h=i.type._context,b=i.pendingProps,j=i.memoizedProps,P=b.value,ht(Ul,h._currentValue),h._currentValue=P,j!==null)if(hr(j.value,P)){if(j.children===b.children&&!Rn.current){i=as(o,i,u);break e}}else for(j=i.child,j!==null&&(j.return=i);j!==null;){var F=j.dependencies;if(F!==null){P=j.child;for(var V=F.firstContext;V!==null;){if(V.context===h){if(j.tag===1){V=is(-1,u&-u),V.tag=2;var oe=j.updateQueue;if(oe!==null){oe=oe.shared;var he=oe.pending;he===null?V.next=V:(V.next=he.next,he.next=V),oe.pending=V}}j.lanes|=u,V=j.alternate,V!==null&&(V.lanes|=u),Dd(j.return,u,i),F.lanes|=u;break}V=V.next}}else if(j.tag===10)P=j.type===i.type?null:j.child;else if(j.tag===18){if(P=j.return,P===null)throw Error(n(341));P.lanes|=u,F=P.alternate,F!==null&&(F.lanes|=u),Dd(P,u,i),P=j.sibling}else P=j.child;if(P!==null)P.return=j;else for(P=j;P!==null;){if(P===i){P=null;break}if(j=P.sibling,j!==null){j.return=P.return,P=j;break}P=P.return}j=P}Sn(o,i,b.children,u),i=i.child}return i;case 9:return b=i.type,h=i.pendingProps.children,Fo(i,u),b=rr(b),h=h(b),i.flags|=1,Sn(o,i,h,u),i.child;case 14:return h=i.type,b=xr(h,i.pendingProps),b=xr(h.type,b),Mx(o,i,h,b,u);case 15:return _x(o,i,i.type,i.pendingProps,u);case 17:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:xr(h,b),ec(o,i),i.tag=1,An(h)?(o=!0,$l(i)):o=!1,Fo(i,u),Px(i,h,b),Gd(i,h,b,u),Qd(null,i,h,!0,o,u);case 19:return qx(o,i,u);case 22:return Fx(o,i,u)}throw Error(n(156,i.tag))};function gy(o,i){return Yh(o,i)}function gN(o,i,u,h){this.tag=o,this.key=u,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=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ir(o,i,u,h){return new gN(o,i,u,h)}function vf(o){return o=o.prototype,!(!o||!o.isReactComponent)}function xN(o){if(typeof o=="function")return vf(o)?1:0;if(o!=null){if(o=o.$$typeof,o===U)return 11;if(o===G)return 14}return 2}function Is(o,i){var u=o.alternate;return u===null?(u=ir(o.tag,i,o.key,o.mode),u.elementType=o.elementType,u.type=o.type,u.stateNode=o.stateNode,u.alternate=o,o.alternate=u):(u.pendingProps=i,u.type=o.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=o.flags&14680064,u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,i=o.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=o.sibling,u.index=o.index,u.ref=o.ref,u}function dc(o,i,u,h,b,j){var P=2;if(h=o,typeof o=="function")vf(o)&&(P=1);else if(typeof o=="string")P=5;else e:switch(o){case I:return ao(u.children,b,j,i);case O:P=8,b|=8;break;case Y:return o=ir(12,u,i,b|2),o.elementType=Y,o.lanes=j,o;case X:return o=ir(13,u,i,b),o.elementType=X,o.lanes=j,o;case q:return o=ir(19,u,i,b),o.elementType=q,o.lanes=j,o;case W:return fc(u,b,j,i);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case J:P=10;break e;case _:P=9;break e;case U:P=11;break e;case G:P=14;break e;case B:P=16,h=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return i=ir(P,u,i,b),i.elementType=o,i.type=h,i.lanes=j,i}function ao(o,i,u,h){return o=ir(7,o,h,i),o.lanes=u,o}function fc(o,i,u,h){return o=ir(22,o,h,i),o.elementType=W,o.lanes=u,o.stateNode={isHidden:!1},o}function bf(o,i,u){return o=ir(6,o,null,i),o.lanes=u,o}function wf(o,i,u){return i=ir(4,o.children!==null?o.children:[],o.key,i),i.lanes=u,i.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},i}function yN(o,i,u,h,b){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=Ku(0),this.expirationTimes=Ku(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ku(0),this.identifierPrefix=h,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function jf(o,i,u,h,b,j,P,F,V){return o=new yN(o,i,u,F,V),i===1?(i=1,j===!0&&(i|=8)):i=0,j=ir(3,null,null,i),o.current=j,j.stateNode=o,j.memoizedState={element:h,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Od(j),o}function vN(o,i,u){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:h==null?null:""+h,children:o,containerInfo:i,implementation:u}}function xy(o){if(!o)return Ss;o=o._reactInternals;e:{if(dt(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(An(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(n(171))}if(o.tag===1){var u=o.type;if(An(u))return Vg(o,u,i)}return i}function yy(o,i,u,h,b,j,P,F,V){return o=jf(u,h,!0,o,b,j,P,F,V),o.context=xy(null),u=o.current,h=Nn(),b=As(u),j=is(h,b),j.callback=i??null,Es(u,j,b),o.current.lanes=b,Oi(o,b,h),On(o,h),o}function pc(o,i,u,h){var b=i.current,j=Nn(),P=As(b);return u=xy(u),i.context===null?i.context=u:i.pendingContext=u,i=is(j,P),i.payload={element:o},h=h===void 0?null:h,h!==null&&(i.callback=h),o=Es(b,i,P),o!==null&&(br(o,b,P,j),Wl(o,b,P)),P}function mc(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 vy(o,i){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var u=o.retryLane;o.retryLane=u!==0&&u<i?u:i}}function kf(o,i){vy(o,i),(o=o.alternate)&&vy(o,i)}function bN(){return null}var by=typeof reportError=="function"?reportError:function(o){console.error(o)};function Sf(o){this._internalRoot=o}hc.prototype.render=Sf.prototype.render=function(o){var i=this._internalRoot;if(i===null)throw Error(n(409));pc(o,i,null,null)},hc.prototype.unmount=Sf.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var i=o.containerInfo;so(function(){pc(null,o,null,null)}),i[ts]=null}};function hc(o){this._internalRoot=o}hc.prototype.unstable_scheduleHydration=function(o){if(o){var i=rg();o={blockedOn:null,target:o,priority:i};for(var u=0;u<vs.length&&i!==0&&i<vs[u].priority;u++);vs.splice(u,0,o),u===0&&ig(o)}};function Nf(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function gc(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function wy(){}function wN(o,i,u,h,b){if(b){if(typeof h=="function"){var j=h;h=function(){var oe=mc(P);j.call(oe)}}var P=yy(i,h,o,0,null,!1,!1,"",wy);return o._reactRootContainer=P,o[ts]=P.current,Gi(o.nodeType===8?o.parentNode:o),so(),P}for(;b=o.lastChild;)o.removeChild(b);if(typeof h=="function"){var F=h;h=function(){var oe=mc(V);F.call(oe)}}var V=jf(o,0,!1,null,null,!1,!1,"",wy);return o._reactRootContainer=V,o[ts]=V.current,Gi(o.nodeType===8?o.parentNode:o),so(function(){pc(i,V,u,h)}),V}function xc(o,i,u,h,b){var j=u._reactRootContainer;if(j){var P=j;if(typeof b=="function"){var F=b;b=function(){var V=mc(P);F.call(V)}}pc(i,P,o,b)}else P=wN(u,i,o,b,h);return mc(P)}tg=function(o){switch(o.tag){case 3:var i=o.stateNode;if(i.current.memoizedState.isDehydrated){var u=Ii(i.pendingLanes);u!==0&&(Gu(i,u|1),On(i,$t()),(Qe&6)===0&&(Wo=$t()+500,Ns()))}break;case 13:so(function(){var h=os(o,1);if(h!==null){var b=Nn();br(h,o,1,b)}}),kf(o,1)}},Yu=function(o){if(o.tag===13){var i=os(o,134217728);if(i!==null){var u=Nn();br(i,o,134217728,u)}kf(o,134217728)}},ng=function(o){if(o.tag===13){var i=As(o),u=os(o,i);if(u!==null){var h=Nn();br(u,o,i,h)}kf(o,i)}},rg=function(){return it},sg=function(o,i){var u=it;try{return it=o,i()}finally{it=u}},fr=function(o,i,u){switch(i){case"input":if(fe(o,u),i=u.name,u.type==="radio"&&i!=null){for(u=o;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<u.length;i++){var h=u[i];if(h!==o&&h.form===o.form){var b=Ol(h);if(!b)throw Error(n(90));Ye(h),fe(h,b)}}}break;case"textarea":kt(o,u);break;case"select":i=u.value,i!=null&&st(o,!!u.multiple,i,!1)}},un=gf,Zt=so;var jN={usingClientEntryPoint:!1,Events:[Ji,Ao,Ol,qt,kn,gf]},da={findFiberByHostInstance:Xs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},kN={bundleType:da.bundleType,version:da.version,rendererPackageName:da.rendererPackageName,rendererConfig:da.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=es(o),o===null?null:o.stateNode},findFiberByHostInstance:da.findFiberByHostInstance||bN,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 yc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yc.isDisabled&&yc.supportsFiber)try{hl=yc.inject(kN),Ar=yc}catch{}}return Ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jN,Ln.createPortal=function(o,i){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Nf(i))throw Error(n(200));return vN(o,i,null,u)},Ln.createRoot=function(o,i){if(!Nf(o))throw Error(n(299));var u=!1,h="",b=by;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),i=jf(o,1,!1,null,null,u,!1,h,b),o[ts]=i.current,Gi(o.nodeType===8?o.parentNode:o),new Sf(i)},Ln.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=es(i),o=o===null?null:o.stateNode,o},Ln.flushSync=function(o){return so(o)},Ln.hydrate=function(o,i,u){if(!gc(i))throw Error(n(200));return xc(null,o,i,!0,u)},Ln.hydrateRoot=function(o,i,u){if(!Nf(o))throw Error(n(405));var h=u!=null&&u.hydratedSources||null,b=!1,j="",P=by;if(u!=null&&(u.unstable_strictMode===!0&&(b=!0),u.identifierPrefix!==void 0&&(j=u.identifierPrefix),u.onRecoverableError!==void 0&&(P=u.onRecoverableError)),i=yy(i,null,o,1,u??null,b,!1,j,P),o[ts]=i.current,Gi(o),h)for(o=0;o<h.length;o++)u=h[o],b=u._getVersion,b=b(u._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[u,b]:i.mutableSourceEagerHydrationData.push(u,b);return new hc(i)},Ln.render=function(o,i,u){if(!gc(i))throw Error(n(200));return xc(null,o,i,!1,u)},Ln.unmountComponentAtNode=function(o){if(!gc(o))throw Error(n(40));return o._reactRootContainer?(so(function(){xc(null,null,o,!1,function(){o._reactRootContainer=null,o[ts]=null})}),!0):!1},Ln.unstable_batchedUpdates=gf,Ln.unstable_renderSubtreeIntoContainer=function(o,i,u,h){if(!gc(u))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return xc(o,i,u,!1,h)},Ln.version="18.3.1-next-f1338f8080-20240426",Ln}var Ry;function Jb(){if(Ry)return Tf.exports;Ry=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(),Tf.exports=IN(),Tf.exports}var Ay;function ON(){if(Ay)return vc;Ay=1;var e=Jb();return vc.createRoot=e.createRoot,vc.hydrateRoot=e.hydrateRoot,vc}var LN=ON();/**
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 Dy="popstate";function Iy(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function $N(e={}){function t(s,a){var m;let l=(m=a.state)==null?void 0:m.masked,{pathname:c,search:d,hash:f}=l||s.location;return jp("",{pathname:c,search:d,hash:f},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:Ma(a)}return _N(t,n,null,e)}function Dt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function jr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function MN(){return Math.random().toString(36).substring(2,10)}function Oy(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 jp(e,t,n=null,s,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?xi(t):t,state:n,key:t&&t.key||s||MN(),unstable_mask:a}}function Ma({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 xi(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 _N(e,t,n,s={}){let{window:a=document.defaultView,v5Compat:l=!1}=s,c=a.history,d="POP",f=null,m=g();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function g(){return(c.state||{idx:null}).idx}function x(){d="POP";let w=g(),S=w==null?null:w-m;m=w,f&&f({action:d,location:k.location,delta:S})}function y(w,S){d="PUSH";let T=Iy(w)?w:jp(k.location,w,S);m=g()+1;let N=Oy(T,m),A=k.createHref(T.unstable_mask||T);try{c.pushState(N,"",A)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;a.location.assign(A)}l&&f&&f({action:d,location:k.location,delta:1})}function v(w,S){d="REPLACE";let T=Iy(w)?w:jp(k.location,w,S);m=g();let N=Oy(T,m),A=k.createHref(T.unstable_mask||T);c.replaceState(N,"",A),l&&f&&f({action:d,location:k.location,delta:0})}function E(w){return FN(w)}let k={get action(){return d},get location(){return e(a,c)},listen(w){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(Dy,x),f=w,()=>{a.removeEventListener(Dy,x),f=null}},createHref(w){return t(a,w)},createURL:E,encodeLocation(w){let S=E(w);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:v,go(w){return c.go(w)}};return k}function FN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Dt(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Ma(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function Qb(e,t,n="/"){return zN(e,t,n,!1)}function zN(e,t,n,s){let a=typeof t=="string"?xi(t):t,l=us(a.pathname||"/",n);if(l==null)return null;let c=Zb(e);BN(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let m=QN(l);d=XN(c[f],m,s)}return d}function Zb(e,t=[],n=[],s="",a=!1){let l=(c,d,f=a,m)=>{let g={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(s)&&f)return;Dt(g.relativePath.startsWith(s),`Absolute route path "${g.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(s.length)}let x=Ur([s,g.relativePath]),y=n.concat(g);c.children&&c.children.length>0&&(Dt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Zb(c.children,t,y,x,f)),!(c.path==null&&!c.index)&&t.push({path:x,score:GN(x,c.index),routesMeta:y})};return e.forEach((c,d)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))l(c,d);else for(let m of ew(c.path))l(c,d,!0,m)}),t}function ew(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=ew(s.join("/")),d=[];return d.push(...c.map(f=>f===""?l:[l,f].join("/"))),a&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function BN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:YN(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var UN=/^:[\w-]+$/,HN=3,WN=2,VN=1,qN=10,KN=-2,Ly=e=>e==="*";function GN(e,t){let n=e.split("/"),s=n.length;return n.some(Ly)&&(s+=KN),t&&(s+=WN),n.filter(a=>!Ly(a)).reduce((a,l)=>a+(UN.test(l)?HN:l===""?VN:qN),s)}function YN(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 XN(e,t,n=!1){let{routesMeta:s}=e,a={},l="/",c=[];for(let d=0;d<s.length;++d){let f=s[d],m=d===s.length-1,g=l==="/"?t:t.slice(l.length)||"/",x=Gc({path:f.relativePath,caseSensitive:f.caseSensitive,end:m},g),y=f.route;if(!x&&m&&n&&!s[s.length-1].route.index&&(x=Gc({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!x)return null;Object.assign(a,x.params),c.push({params:a,pathname:Ur([l,x.pathname]),pathnameBase:nC(Ur([l,x.pathnameBase])),route:y}),x.pathnameBase!=="/"&&(l=Ur([l,x.pathnameBase]))}return c}function Gc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=JN(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let l=a[0],c=l.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:s.reduce((m,{paramName:g,isOptional:x},y)=>{if(g==="*"){let E=d[y]||"";c=l.slice(0,l.length-E.length).replace(/(.)\/+$/,"$1")}const v=d[y];return x&&!v?m[g]=void 0:m[g]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function JN(e,t=!1,n=!0){jr(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,d,f,m,g)=>{if(s.push({paramName:d,isOptional:f!=null}),f){let x=g.charAt(m+c.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 QN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return jr(!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 us(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 ZN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function eC(e,t="/"){let{pathname:n,search:s="",hash:a=""}=typeof e=="string"?xi(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=$y(n.substring(1),"/"):l=$y(n,t)):l=t,{pathname:l,search:rC(s),hash:sC(a)}}function $y(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 Af(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 tC(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function tw(e){let t=tC(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function im(e,t,n,s=!1){let a;typeof e=="string"?a=xi(e):(a={...e},Dt(!a.pathname||!a.pathname.includes("?"),Af("?","pathname","search",a)),Dt(!a.pathname||!a.pathname.includes("#"),Af("#","pathname","hash",a)),Dt(!a.search||!a.search.includes("#"),Af("#","search","hash",a)));let l=e===""||a.pathname==="",c=l?"/":a.pathname,d;if(c==null)d=n;else{let x=t.length-1;if(!s&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),x-=1;a.pathname=y.join("/")}d=x>=0?t[x]:"/"}let f=eC(a,d),m=c&&c!=="/"&&c.endsWith("/"),g=(l||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(m||g)&&(f.pathname+="/"),f}var Ur=e=>e.join("/").replace(/\/\/+/g,"/"),nC=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),rC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,sC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,oC=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 iC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function aC(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var nw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function rw(e,t){let n=e;if(typeof n!="string"||!ZN.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,a=!1;if(nw)try{let l=new URL(window.location.href),c=n.startsWith("//")?new URL(l.protocol+n):new URL(n),d=us(c.pathname,t);c.origin===l.origin&&d!=null?n=d+c.search+c.hash:a=!0}catch{jr(!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 sw=["POST","PUT","PATCH","DELETE"];new Set(sw);var lC=["GET",...sw];new Set(lC);var yi=p.createContext(null);yi.displayName="DataRouter";var hu=p.createContext(null);hu.displayName="DataRouterState";var cC=p.createContext(!1),ow=p.createContext({isTransitioning:!1});ow.displayName="ViewTransition";var uC=p.createContext(new Map);uC.displayName="Fetchers";var dC=p.createContext(null);dC.displayName="Await";var ur=p.createContext(null);ur.displayName="Navigation";var Xa=p.createContext(null);Xa.displayName="Location";var Cr=p.createContext({outlet:null,matches:[],isDataRoute:!1});Cr.displayName="Route";var am=p.createContext(null);am.displayName="RouteError";var iw="REACT_ROUTER_ERROR",fC="REDIRECT",pC="ROUTE_ERROR_RESPONSE";function mC(e){if(e.startsWith(`${iw}:${fC}:{`))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 hC(e){if(e.startsWith(`${iw}:${pC}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new oC(t.status,t.statusText,t.data)}catch{}}function gC(e,{relative:t}={}){Dt(Ja(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=p.useContext(ur),{hash:a,pathname:l,search:c}=Qa(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:Ur([n,l])),s.createHref({pathname:d,search:c,hash:a})}function Ja(){return p.useContext(Xa)!=null}function En(){return Dt(Ja(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Xa).location}var aw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function lw(e){p.useContext(ur).static||p.useLayoutEffect(e)}function Et(){let{isDataRoute:e}=p.useContext(Cr);return e?AC():xC()}function xC(){Dt(Ja(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(yi),{basename:t,navigator:n}=p.useContext(ur),{matches:s}=p.useContext(Cr),{pathname:a}=En(),l=JSON.stringify(tw(s)),c=p.useRef(!1);return lw(()=>{c.current=!0}),p.useCallback((f,m={})=>{if(jr(c.current,aw),!c.current)return;if(typeof f=="number"){n.go(f);return}let g=im(f,JSON.parse(l),a,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Ur([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,l,a,e])}var yC=p.createContext(null);function vC(e){let t=p.useContext(Cr).outlet;return p.useMemo(()=>t&&p.createElement(yC.Provider,{value:e},t),[t,e])}function jt(){let{matches:e}=p.useContext(Cr),t=e[e.length-1];return t?t.params:{}}function Qa(e,{relative:t}={}){let{matches:n}=p.useContext(Cr),{pathname:s}=En(),a=JSON.stringify(tw(n));return p.useMemo(()=>im(e,JSON.parse(a),s,t==="path"),[e,a,s,t])}function bC(e,t){return cw(e,t)}function cw(e,t,n){var w;Dt(Ja(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=p.useContext(ur),{matches:a}=p.useContext(Cr),l=a[a.length-1],c=l?l.params:{},d=l?l.pathname:"/",f=l?l.pathnameBase:"/",m=l&&l.route;{let S=m&&m.path||"";dw(d,!m||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${S}">) 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="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let g=En(),x;if(t){let S=typeof t=="string"?xi(t):t;Dt(f==="/"||((w=S.pathname)==null?void 0:w.startsWith(f)),`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 "${f}" but pathname "${S.pathname}" was given in the \`location\` prop.`),x=S}else x=g;let y=x.pathname||"/",v=y;if(f!=="/"){let S=f.replace(/^\//,"").split("/");v="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let E=Qb(e,{pathname:v});jr(m||E!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),jr(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 "${x.pathname}${x.search}${x.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 k=NC(E&&E.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:Ur([f,s.encodeLocation?s.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?f:Ur([f,s.encodeLocation?s.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),a,n);return t&&k?p.createElement(Xa.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...x},navigationType:"POP"}},k):k}function wC(){let e=RC(),t=iC(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=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:l},"ErrorBoundary")," or"," ",p.createElement("code",{style:l},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:a},n):null,c)}var jC=p.createElement(wC,null),uw=class extends p.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=hC(e.digest);n&&(e=n)}let t=e!==void 0?p.createElement(Cr.Provider,{value:this.props.routeContext},p.createElement(am.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?p.createElement(kC,{error:e},t):t}};uw.contextType=cC;var Df=new WeakMap;function kC({children:e,error:t}){let{basename:n}=p.useContext(ur);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=mC(t.digest);if(s){let a=Df.get(t);if(a)throw a;let l=rw(s.location,n);if(nw&&!Df.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 Df.set(t,c),c}return p.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function SC({routeContext:e,match:t,children:n}){let s=p.useContext(yi);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement(Cr.Provider,{value:e},n)}function NC(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 g=a.findIndex(x=>x.route.id&&(l==null?void 0:l[x.route.id])!==void 0);Dt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,g+1))}let c=!1,d=-1;if(n&&s){c=s.renderFallback;for(let g=0;g<a.length;g++){let x=a[g];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(d=g),x.route.id){let{loaderData:y,errors:v}=s,E=x.route.loader&&!y.hasOwnProperty(x.route.id)&&(!v||v[x.route.id]===void 0);if(x.route.lazy||E){n.isStatic&&(c=!0),d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,m=s&&f?(g,x)=>{var y,v;f(g,{location:s.location,params:((v=(y=s.matches)==null?void 0:y[0])==null?void 0:v.params)??{},unstable_pattern:aC(s.matches),errorInfo:x})}:void 0;return a.reduceRight((g,x,y)=>{let v,E=!1,k=null,w=null;s&&(v=l&&x.route.id?l[x.route.id]:void 0,k=x.route.errorElement||jC,c&&(d<0&&y===0?(dw("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,w=null):d===y&&(E=!0,w=x.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,y+1)),T=()=>{let N;return v?N=k:E?N=w:x.route.Component?N=p.createElement(x.route.Component,null):x.route.element?N=x.route.element:N=g,p.createElement(SC,{match:x,routeContext:{outlet:g,matches:S,isDataRoute:s!=null},children:N})};return s&&(x.route.ErrorBoundary||x.route.errorElement||y===0)?p.createElement(uw,{location:s.location,revalidation:s.revalidation,component:k,error:v,children:T(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:m}):T()},null)}function lm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function CC(e){let t=p.useContext(yi);return Dt(t,lm(e)),t}function EC(e){let t=p.useContext(hu);return Dt(t,lm(e)),t}function TC(e){let t=p.useContext(Cr);return Dt(t,lm(e)),t}function cm(e){let t=TC(e),n=t.matches[t.matches.length-1];return Dt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function PC(){return cm("useRouteId")}function RC(){var s;let e=p.useContext(am),t=EC("useRouteError"),n=cm("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[n]}function AC(){let{router:e}=CC("useNavigate"),t=cm("useNavigate"),n=p.useRef(!1);return lw(()=>{n.current=!0}),p.useCallback(async(a,l={})=>{jr(n.current,aw),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...l}))},[e,t])}var My={};function dw(e,t,n){!t&&!My[e]&&(My[e]=!0,jr(!1,n))}p.memo(DC);function DC({routes:e,future:t,state:n,isStatic:s,onError:a}){return cw(e,void 0,{state:n,isStatic:s,onError:a})}function IC(e){return vC(e.context)}function Oe(e){Dt(!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 OC({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:a,static:l=!1,unstable_useTransitions:c}){Dt(!Ja(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),f=p.useMemo(()=>({basename:d,navigator:a,static:l,unstable_useTransitions:c,future:{}}),[d,a,l,c]);typeof n=="string"&&(n=xi(n));let{pathname:m="/",search:g="",hash:x="",state:y=null,key:v="default",unstable_mask:E}=n,k=p.useMemo(()=>{let w=us(m,d);return w==null?null:{location:{pathname:w,search:g,hash:x,state:y,key:v,unstable_mask:E},navigationType:s}},[d,m,g,x,y,v,s,E]);return jr(k!=null,`<Router basename="${d}"> is not able to match the URL "${m}${g}${x}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:p.createElement(ur.Provider,{value:f},p.createElement(Xa.Provider,{children:t,value:k}))}function LC({children:e,location:t}){return bC(kp(e),t)}function kp(e,t=[]){let n=[];return p.Children.forEach(e,(s,a)=>{if(!p.isValidElement(s))return;let l=[...t,a];if(s.type===p.Fragment){n.push.apply(n,kp(s.props.children,l));return}Dt(s.type===Oe,`[${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>`),Dt(!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=kp(s.props.children,l)),n.push(c)}),n}var Lc="get",$c="application/x-www-form-urlencoded";function gu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function $C(e){return gu(e)&&e.tagName.toLowerCase()==="button"}function MC(e){return gu(e)&&e.tagName.toLowerCase()==="form"}function _C(e){return gu(e)&&e.tagName.toLowerCase()==="input"}function FC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zC(e,t){return e.button===0&&(!t||t==="_self")&&!FC(e)}function Sp(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 BC(e,t){let n=Sp(e);return t&&t.forEach((s,a)=>{n.has(a)||t.getAll(a).forEach(l=>{n.append(a,l)})}),n}var bc=null;function UC(){if(bc===null)try{new FormData(document.createElement("form"),0),bc=!1}catch{bc=!0}return bc}var HC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function If(e){return e!=null&&!HC.has(e)?(jr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$c}"`),null):e}function WC(e,t){let n,s,a,l,c;if(MC(e)){let d=e.getAttribute("action");s=d?us(d,t):null,n=e.getAttribute("method")||Lc,a=If(e.getAttribute("enctype"))||$c,l=new FormData(e)}else if($C(e)||_C(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(s=f?us(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Lc,a=If(e.getAttribute("formenctype"))||If(d.getAttribute("enctype"))||$c,l=new FormData(d,e),!UC()){let{name:m,type:g,value:x}=e;if(g==="image"){let y=m?`${m}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else m&&l.append(m,x)}}else{if(gu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Lc,s=null,a=$c,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 um(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function VC(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&&us(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${s}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${s}`,a}async function qC(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 KC(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 GC(e,t,n){let s=await Promise.all(e.map(async a=>{let l=t.routes[a.route.id];if(l){let c=await qC(l,n);return c.links?c.links():[]}return[]}));return QC(s.flat(1).filter(KC).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function _y(e,t,n,s,a,l){let c=(f,m)=>n[m]?f.route.id!==n[m].route.id:!0,d=(f,m)=>{var g;return n[m].pathname!==f.pathname||((g=n[m].route.path)==null?void 0:g.endsWith("*"))&&n[m].params["*"]!==f.params["*"]};return l==="assets"?t.filter((f,m)=>c(f,m)||d(f,m)):l==="data"?t.filter((f,m)=>{var x;let g=s.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(c(f,m)||d(f,m))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((x=n[0])==null?void 0:x.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function YC(e,t,{includeHydrateFallback:n}={}){return XC(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 XC(e){return[...new Set(e)]}function JC(e){let t={},n=Object.keys(e).sort();for(let s of n)t[s]=e[s];return t}function QC(e,t){let n=new Set;return new Set(t),e.reduce((s,a)=>{let l=JSON.stringify(JC(a));return n.has(l)||(n.add(l),s.push({key:l,link:a})),s},[])}function fw(){let e=p.useContext(yi);return um(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ZC(){let e=p.useContext(hu);return um(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var dm=p.createContext(void 0);dm.displayName="FrameworkContext";function pw(){let e=p.useContext(dm);return um(e,"You must render this element inside a <HydratedRouter> element"),e}function eE(e,t){let n=p.useContext(dm),[s,a]=p.useState(!1),[l,c]=p.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:m,onMouseLeave:g,onTouchStart:x}=t,y=p.useRef(null);p.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let k=S=>{S.forEach(T=>{c(T.isIntersecting)})},w=new IntersectionObserver(k,{threshold:.5});return y.current&&w.observe(y.current),()=>{w.disconnect()}}},[e]),p.useEffect(()=>{if(s){let k=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(k)}}},[s]);let v=()=>{a(!0)},E=()=>{a(!1),c(!1)};return n?e!=="intent"?[l,y,{}]:[l,y,{onFocus:pa(d,v),onBlur:pa(f,E),onMouseEnter:pa(m,v),onMouseLeave:pa(g,E),onTouchStart:pa(x,v)}]:[!1,y,{}]}function pa(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function tE({page:e,...t}){let{router:n}=fw(),s=p.useMemo(()=>Qb(n.routes,e,n.basename),[n.routes,e,n.basename]);return s?p.createElement(rE,{page:e,matches:s,...t}):null}function nE(e){let{manifest:t,routeModules:n}=pw(),[s,a]=p.useState([]);return p.useEffect(()=>{let l=!1;return GC(e,t,n).then(c=>{l||a(c)}),()=>{l=!0}},[e,t,n]),s}function rE({page:e,matches:t,...n}){let s=En(),{future:a,manifest:l,routeModules:c}=pw(),{basename:d}=fw(),{loaderData:f,matches:m}=ZC(),g=p.useMemo(()=>_y(e,t,m,l,s,"data"),[e,t,m,l,s]),x=p.useMemo(()=>_y(e,t,m,l,s,"assets"),[e,t,m,l,s]),y=p.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let k=new Set,w=!1;if(t.forEach(T=>{var A;let N=l.routes[T.route.id];!N||!N.hasLoader||(!g.some(M=>M.route.id===T.route.id)&&T.route.id in f&&((A=c[T.route.id])!=null&&A.shouldRevalidate)||N.hasClientLoader?w=!0:k.add(T.route.id))}),k.size===0)return[];let S=VC(e,d,a.unstable_trailingSlashAwareDataRequests,"data");return w&&k.size>0&&S.searchParams.set("_routes",t.filter(T=>k.has(T.route.id)).map(T=>T.route.id).join(",")),[S.pathname+S.search]},[d,a.unstable_trailingSlashAwareDataRequests,f,s,l,g,t,e,c]),v=p.useMemo(()=>YC(x,l),[x,l]),E=nE(x);return p.createElement(p.Fragment,null,y.map(k=>p.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...n})),v.map(k=>p.createElement("link",{key:k,rel:"modulepreload",href:k,...n})),E.map(({key:k,link:w})=>p.createElement("link",{key:k,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function sE(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var oE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{oE&&(window.__reactRouterVersion="7.13.1")}catch{}function iE({basename:e,children:t,unstable_useTransitions:n,window:s}){let a=p.useRef();a.current==null&&(a.current=$N({window:s,v5Compat:!0}));let l=a.current,[c,d]=p.useState({action:l.action,location:l.location}),f=p.useCallback(m=>{n===!1?d(m):p.startTransition(()=>d(m))},[n]);return p.useLayoutEffect(()=>l.listen(f),[l,f]),p.createElement(OC,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:l,unstable_useTransitions:n})}var mw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,we=p.forwardRef(function({onClick:t,discover:n="render",prefetch:s="none",relative:a,reloadDocument:l,replace:c,unstable_mask:d,state:f,target:m,to:g,preventScrollReset:x,viewTransition:y,unstable_defaultShouldRevalidate:v,...E},k){let{basename:w,navigator:S,unstable_useTransitions:T}=p.useContext(ur),N=typeof g=="string"&&mw.test(g),A=rw(g,w);g=A.to;let M=gC(g,{relative:a}),R=En(),I=null;if(d){let G=im(d,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);w!=="/"&&(G.pathname=G.pathname==="/"?w:Ur([w,G.pathname])),I=S.createHref(G)}let[O,Y,J]=eE(s,E),_=uE(g,{replace:c,unstable_mask:d,state:f,target:m,preventScrollReset:x,relative:a,viewTransition:y,unstable_defaultShouldRevalidate:v,unstable_useTransitions:T});function U(G){t&&t(G),G.defaultPrevented||_(G)}let X=!(A.isExternal||l),q=p.createElement("a",{...E,...J,href:(X?I:void 0)||A.absoluteURL||M,onClick:X?U:t,ref:sE(k,Y),target:m,"data-discover":!N&&n==="render"?"true":void 0});return O&&!N?p.createElement(p.Fragment,null,q,p.createElement(tE,{page:M})):q});we.displayName="Link";var aE=p.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:s="",end:a=!1,style:l,to:c,viewTransition:d,children:f,...m},g){let x=Qa(c,{relative:m.relative}),y=En(),v=p.useContext(hu),{navigator:E,basename:k}=p.useContext(ur),w=v!=null&&hE(x)&&d===!0,S=E.encodeLocation?E.encodeLocation(x).pathname:x.pathname,T=y.pathname,N=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(T=T.toLowerCase(),N=N?N.toLowerCase():null,S=S.toLowerCase()),N&&k&&(N=us(N,k)||N);const A=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let M=T===S||!a&&T.startsWith(S)&&T.charAt(A)==="/",R=N!=null&&(N===S||!a&&N.startsWith(S)&&N.charAt(S.length)==="/"),I={isActive:M,isPending:R,isTransitioning:w},O=M?t:void 0,Y;typeof s=="function"?Y=s(I):Y=[s,M?"active":null,R?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let J=typeof l=="function"?l(I):l;return p.createElement(we,{...m,"aria-current":O,className:Y,ref:g,style:J,to:c,viewTransition:d},typeof f=="function"?f(I):f)});aE.displayName="NavLink";var lE=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:s,replace:a,state:l,method:c=Lc,action:d,onSubmit:f,relative:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:y,...v},E)=>{let{unstable_useTransitions:k}=p.useContext(ur),w=pE(),S=mE(d,{relative:m}),T=c.toLowerCase()==="get"?"get":"post",N=typeof d=="string"&&mw.test(d),A=M=>{if(f&&f(M),M.defaultPrevented)return;M.preventDefault();let R=M.nativeEvent.submitter,I=(R==null?void 0:R.getAttribute("formmethod"))||c,O=()=>w(R||M.currentTarget,{fetcherKey:t,method:I,navigate:n,replace:a,state:l,relative:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:y});k&&n!==!1?p.startTransition(()=>O()):O()};return p.createElement("form",{ref:E,method:T,action:S,onSubmit:s?f:A,...v,"data-discover":!N&&e==="render"?"true":void 0})});lE.displayName="Form";function cE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hw(e){let t=p.useContext(yi);return Dt(t,cE(e)),t}function uE(e,{target:t,replace:n,unstable_mask:s,state:a,preventScrollReset:l,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:m}={}){let g=Et(),x=En(),y=Qa(e,{relative:c});return p.useCallback(v=>{if(zC(v,t)){v.preventDefault();let E=n!==void 0?n:Ma(x)===Ma(y),k=()=>g(e,{replace:E,unstable_mask:s,state:a,preventScrollReset:l,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:f});m?p.startTransition(()=>k()):k()}},[x,g,y,n,s,a,t,e,l,c,d,f,m])}function Xr(e){jr(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=p.useRef(Sp(e)),n=p.useRef(!1),s=En(),a=p.useMemo(()=>BC(s.search,n.current?null:t.current),[s.search]),l=Et(),c=p.useCallback((d,f)=>{const m=Sp(typeof d=="function"?d(new URLSearchParams(a)):d);n.current=!0,l("?"+m,f)},[l,a]);return[a,c]}var dE=0,fE=()=>`__${String(++dE)}__`;function pE(){let{router:e}=hw("useSubmit"),{basename:t}=p.useContext(ur),n=PC(),s=e.fetch,a=e.navigate;return p.useCallback(async(l,c={})=>{let{action:d,method:f,encType:m,formData:g,body:x}=WC(l,t);if(c.navigate===!1){let y=c.fetcherKey||fE();await s(y,n,c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:x,formMethod:c.method||f,formEncType:c.encType||m,flushSync:c.flushSync})}else await a(c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:x,formMethod:c.method||f,formEncType:c.encType||m,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[s,a,t,n])}function mE(e,{relative:t}={}){let{basename:n}=p.useContext(ur),s=p.useContext(Cr);Dt(s,"useFormAction must be used inside a RouteContext");let[a]=s.matches.slice(-1),l={...Qa(e||".",{relative:t})},c=En();if(e==null){l.search=c.search;let d=new URLSearchParams(l.search),f=d.getAll("index");if(f.some(g=>g==="")){d.delete("index"),f.filter(x=>x).forEach(x=>d.append("index",x));let g=d.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&a.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Ur([n,l.pathname])),Ma(l)}function hE(e,{relative:t}={}){let n=p.useContext(ow);Dt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=hw("useViewTransitionState"),a=Qa(e,{relative:t});if(!n.isTransitioning)return!1;let l=us(n.currentLocation.pathname,s)||n.currentLocation.pathname,c=us(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Gc(a.pathname,c)!=null||Gc(a.pathname,l)!=null}var Us=Jb();const gE=mu(Us);/**
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 xE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),gw=(...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 yE={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 vE=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:a="",children:l,iconNode:c,...d},f)=>p.createElement("svg",{ref:f,...yE,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:gw("lucide",a),...d},[...c.map(([m,g])=>p.createElement(m,g)),...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 Ee=(e,t)=>{const n=p.forwardRef(({className:s,...a},l)=>p.createElement(vE,{ref:l,iconNode:t,className:gw(`lucide-${xE(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 fm=Ee("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 xw=Ee("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
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 Za=Ee("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"}]]);/**
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 yw=Ee("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
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 Yc=Ee("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
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 bE=Ee("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"}]]);/**
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 vw=Ee("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"}]]);/**
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 pm=Ee("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"}]]);/**
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 wE=Ee("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"}]]);/**
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 vi=Ee("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
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 _a=Ee("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
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 jE=Ee("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
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 bw=Ee("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
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 Np=Ee("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"}]]);/**
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 mm=Ee("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 Cp=Ee("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
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 kE=Ee("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
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 SE=Ee("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
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 NE=Ee("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
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 CE=Ee("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
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 EE=Ee("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
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 ww=Ee("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"}]]);/**
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 Fa=Ee("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"}]]);/**
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 TE=Ee("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"}]]);/**
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 PE=Ee("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"}]]);/**
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 hm=Ee("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"}]]);/**
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 Fy=Ee("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"}]]);/**
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 RE=Ee("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"}]]);/**
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 AE=Ee("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"}]]);/**
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 jw=Ee("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"}]]);/**
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 kw=Ee("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"}]]);/**
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 gm=Ee("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"}]]);/**
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 DE=Ee("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"}]]);/**
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 xm=Ee("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"}]]);/**
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 IE=Ee("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"}]]);/**
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 ym=Ee("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
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 Ep=Ee("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"}]]);/**
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 OE=Ee("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"}]]);/**
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 LE=Ee("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"}]]);/**
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 $E=Ee("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"}]]);/**
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 ME=Ee("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"}]]);/**
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 vm=Ee("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 _E=Ee("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"}]]);/**
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 bm=Ee("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"}]]);/**
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 FE=Ee("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"}]]);/**
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 Of=Ee("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"}]]);/**
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 bi=Ee("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"}]]);/**
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 zE=Ee("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
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 Ht=Ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 Sw=Ee("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"}]]);/**
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 BE=Ee("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
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 za=Ee("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"}]]);/**
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 xu=Ee("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"}]]);/**
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 UE=Ee("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"}]]);/**
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 qs=Ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 HE=Ee("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"}]]);/**
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 WE=Ee("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"}]]);/**
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 VE=Ee("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"}]]);/**
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 qE=Ee("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"}]]);/**
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 cr=Ee("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"}]]);/**
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 zy=Ee("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"}]]);/**
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 wm=Ee("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
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 KE=Ee("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"}]]);/**
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 Nw=Ee("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"}]]);/**
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 Ba=Ee("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
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 zn=Ee("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"}]]);/**
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 jm=Ee("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"}]]);/**
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 GE=Ee("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"}]]);/**
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 YE=Ee("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"}]]);/**
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 km=Ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Cw(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=Cw(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function XE(){for(var e,t,n=0,s="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Cw(e))&&(s&&(s+=" "),s+=t);return s}const Sm="-",JE=e=>{const t=ZE(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const d=c.split(Sm);return d[0]===""&&d.length!==1&&d.shift(),Ew(d,t)||QE(c)},getConflictingClassGroupIds:(c,d)=>{const f=n[c]||[];return d&&s[c]?[...f,...s[c]]:f}}},Ew=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),a=s?Ew(e.slice(1),s):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join(Sm);return(c=t.validators.find(({validator:d})=>d(l)))==null?void 0:c.classGroupId},By=/^\[(.+)\]$/,QE=e=>{if(By.test(e)){const t=By.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ZE=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return t2(Object.entries(e.classGroups),n).forEach(([l,c])=>{Tp(c,s,l,t)}),s},Tp=(e,t,n,s)=>{e.forEach(a=>{if(typeof a=="string"){const l=a===""?t:Uy(t,a);l.classGroupId=n;return}if(typeof a=="function"){if(e2(a)){Tp(a(s),t,n,s);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([l,c])=>{Tp(c,Uy(t,l),n,s)})})},Uy=(e,t)=>{let n=e;return t.split(Sm).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},e2=e=>e.isThemeGetter,t2=(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,d])=>[t+c,d])):l);return[n,a]}):e,n2=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)}}},Tw="!",r2=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,a=t[0],l=t.length,c=d=>{const f=[];let m=0,g=0,x;for(let w=0;w<d.length;w++){let S=d[w];if(m===0){if(S===a&&(s||d.slice(w,w+l)===t)){f.push(d.slice(g,w)),g=w+l;continue}if(S==="/"){x=w;continue}}S==="["?m++:S==="]"&&m--}const y=f.length===0?d:d.substring(g),v=y.startsWith(Tw),E=v?y.substring(1):y,k=x&&x>g?x-g:void 0;return{modifiers:f,hasImportantModifier:v,baseClassName:E,maybePostfixModifierPosition:k}};return n?d=>n({className:d,parseClassName:c}):c},s2=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},o2=e=>({cache:n2(e.cacheSize),parseClassName:r2(e),...JE(e)}),i2=/\s+/,a2=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:a}=t,l=[],c=e.trim().split(i2);let d="";for(let f=c.length-1;f>=0;f-=1){const m=c[f],{modifiers:g,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:v}=n(m);let E=!!v,k=s(E?y.substring(0,v):y);if(!k){if(!E){d=m+(d.length>0?" "+d:d);continue}if(k=s(y),!k){d=m+(d.length>0?" "+d:d);continue}E=!1}const w=s2(g).join(":"),S=x?w+Tw:w,T=S+k;if(l.includes(T))continue;l.push(T);const N=a(k,E);for(let A=0;A<N.length;++A){const M=N[A];l.push(S+M)}d=m+(d.length>0?" "+d:d)}return d};function l2(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Pw(t))&&(s&&(s+=" "),s+=n);return s}const Pw=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=Pw(e[s]))&&(n&&(n+=" "),n+=t);return n};function c2(e,...t){let n,s,a,l=c;function c(f){const m=t.reduce((g,x)=>x(g),e());return n=o2(m),s=n.cache.get,a=n.cache.set,l=d,d(f)}function d(f){const m=s(f);if(m)return m;const g=a2(f,n);return a(f,g),g}return function(){return l(l2.apply(null,arguments))}}const bt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Rw=/^\[(?:([a-z-]+):)?(.+)\]$/i,u2=/^\d+\/\d+$/,d2=new Set(["px","full","screen"]),f2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p2=/\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$/,m2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,h2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,g2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cs=e=>si(e)||d2.has(e)||u2.test(e),Ls=e=>wi(e,"length",S2),si=e=>!!e&&!Number.isNaN(Number(e)),Lf=e=>wi(e,"number",si),ma=e=>!!e&&Number.isInteger(Number(e)),x2=e=>e.endsWith("%")&&si(e.slice(0,-1)),Ke=e=>Rw.test(e),$s=e=>f2.test(e),y2=new Set(["length","size","percentage"]),v2=e=>wi(e,y2,Aw),b2=e=>wi(e,"position",Aw),w2=new Set(["image","url"]),j2=e=>wi(e,w2,C2),k2=e=>wi(e,"",N2),ha=()=>!0,wi=(e,t,n)=>{const s=Rw.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},S2=e=>p2.test(e)&&!m2.test(e),Aw=()=>!1,N2=e=>h2.test(e),C2=e=>g2.test(e),E2=()=>{const e=bt("colors"),t=bt("spacing"),n=bt("blur"),s=bt("brightness"),a=bt("borderColor"),l=bt("borderRadius"),c=bt("borderSpacing"),d=bt("borderWidth"),f=bt("contrast"),m=bt("grayscale"),g=bt("hueRotate"),x=bt("invert"),y=bt("gap"),v=bt("gradientColorStops"),E=bt("gradientColorStopPositions"),k=bt("inset"),w=bt("margin"),S=bt("opacity"),T=bt("padding"),N=bt("saturate"),A=bt("scale"),M=bt("sepia"),R=bt("skew"),I=bt("space"),O=bt("translate"),Y=()=>["auto","contain","none"],J=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",Ke,t],U=()=>[Ke,t],X=()=>["",cs,Ls],q=()=>["auto",si,Ke],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",Ke],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[si,Ke];return{cacheSize:500,separator:":",theme:{colors:[ha],spacing:[cs,Ls],blur:["none","",$s,Ke],brightness:$(),borderColor:[e],borderRadius:["none","","full",$s,Ke],borderSpacing:U(),borderWidth:X(),contrast:$(),grayscale:ee(),hueRotate:$(),invert:ee(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[x2,Ls],inset:_(),margin:_(),opacity:$(),padding:U(),saturate:$(),scale:$(),sepia:ee(),skew:$(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",Ke]}],container:["container"],columns:[{columns:[$s]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:[...G(),Ke]}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ma,Ke]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ke]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",ma,Ke]}],"grid-cols":[{"grid-cols":[ha]}],"col-start-end":[{col:["auto",{span:["full",ma,Ke]},Ke]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[ha]}],"row-start-end":[{row:["auto",{span:[ma,Ke]},Ke]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ke]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ke]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],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":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ke,t]}],"min-w":[{"min-w":[Ke,t,"min","max","fit"]}],"max-w":[{"max-w":[Ke,t,"none","full","min","max","fit","prose",{screen:[$s]},$s]}],h:[{h:[Ke,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ke,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ke,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ke,t,"auto","min","max","fit"]}],"font-size":[{text:["base",$s,Ls]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Lf]}],"font-family":[{font:[ha]}],"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",Ke]}],"line-clamp":[{"line-clamp":["none",si,Lf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",cs,Ke]}],"list-image":[{"list-image":["none",Ke]}],"list-style-type":[{list:["none","disc","decimal",Ke]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",cs,Ls]}],"underline-offset":[{"underline-offset":["auto",cs,Ke]}],"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:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ke]}],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",Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),b2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",v2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},j2]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],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:[d]}],"border-w-x":[{"border-x":[d]}],"border-w-y":[{"border-y":[d]}],"border-w-s":[{"border-s":[d]}],"border-w-e":[{"border-e":[d]}],"border-w-t":[{"border-t":[d]}],"border-w-r":[{"border-r":[d]}],"border-w-b":[{"border-b":[d]}],"border-w-l":[{"border-l":[d]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[d]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[d]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:B()}],"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:["",...B()]}],"outline-offset":[{"outline-offset":[cs,Ke]}],"outline-w":[{outline:[cs,Ls]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[cs,Ls]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$s,k2]}],"shadow-color":[{shadow:[ha]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",$s,Ke]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[x]}],saturate:[{saturate:[N]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"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",Ke]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",Ke]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ke]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[ma,Ke]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"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",Ke]}],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",Ke]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",Ke]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[cs,Ls,Lf]}],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"]}}},T2=c2(E2);function ze(...e){return T2(XE(e))}function qr(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 Kr(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 P2(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function R2(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 Nm(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 pn(e){return e.split(/[_\s-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Dw(e){return!e||e==="/"?"/":e.endsWith("/")?e.slice(0,-1):e}function A2(e){let t=Dw(e);const n=t.match(/^\/w\/[^/]+(\/.*)?$/);return n&&(t=n[1]||"/"),t==="/"?"/":t.startsWith("/projects")?/^\/projects\/[^/]+\/assignments\//.test(t)?"/assignments":"/projects":t.startsWith("/assignments")?"/assignments":t.startsWith("/servers")?"/servers":t.startsWith("/inventories")?"/inventories":t.startsWith("/agent-sessions")?"/agent-sessions":t.startsWith("/playbooks")?"/playbooks":t.startsWith("/memories")?"/memories":t.startsWith("/resources")?"/resources":t.startsWith("/todos")?"/todos":t.startsWith("/help")?"/help":t.startsWith("/settings")?"/settings":null}function Iw(e,t){return A2(e)===t}function Ow(e){let n=Dw(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:pn(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:pn(n[1]),path:`${c}/projects/${n[1]}`}),a=pn(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:pn(n[3]),path:`${c}/projects/${n[1]}/assignments/${n[3]}`}),a=pn(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 d=n[2]==="memories"?"Memories":"Resources",f=n[2]==="memories"?"/memories":"/resources";s.push({label:d,path:f}),s.push({label:pn(n[3]),path:`${c}/projects/${n[1]}/${n[2]}/${n[3]}`}),a=pn(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]==="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]==="playbooks"?(s.push({label:"Playbooks",path:"/playbooks"}),a="Playbooks",n[1]==="create"?a="Create Playbook":n[1]&&n[2]==="edit"?(s.push({label:pn(n[1]),path:`/playbooks/${n[1]}`}),a="Edit Playbook"):n[1]&&(s.push({label:pn(n[1]),path:`/playbooks/${n[1]}`}),a=pn(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]==="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 Hy({items:e,onNavigate:t}){const n=En();return r.jsx("nav",{className:"space-y-1",children:e.map(s=>{const a=s.icon,l=Iw(n.pathname,s.to)&&!n.pathname.startsWith("/w/");return r.jsxs(we,{to:s.to,onClick:t,className:ze("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 Lw=[{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)"}}],D2=Lw.map(e=>e.slug),Xc="default";function $w(e){return typeof e=="string"&&D2.includes(e)}const Mw={preset:Xc,custom:!1};let Na=null,qo=null;function Cm(e){if(!e||typeof e!="object")return Mw;const t=e;return{preset:$w(t.preset)?t.preset:Xc,custom:t.custom===!0}}function I2(){return Na?Promise.resolve(Na):qo||(qo=fetch("/api/config/theme").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=Cm(e);return Na=t,qo=null,t}).catch(()=>(qo=null,Mw)),qo)}async function O2(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=Cm(await t.json());return Na=n,n}async function L2(){const e=await fetch("/api/config/theme",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=Cm(await e.json());return Na=t,t}const Pp="syntaur-theme",Mc="syntaur-preset",_w=p.createContext(null);function Rp(){try{const e=window.localStorage.getItem(Pp);return e==="light"||e==="dark"?e:null}catch{return null}}function Fw(){try{const e=window.localStorage.getItem(Mc);return $w(e)?e:Xc}catch{return Xc}}function zw(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Bw(e){document.documentElement.classList.toggle("dark",e==="dark")}function Uw(e){document.documentElement.dataset.theme=e}function $2(){typeof document>"u"||(Bw(Rp()??zw()),Uw(Fw()))}function M2({children:e}){const[t,n]=p.useState(()=>Rp()),[s,a]=p.useState(()=>Rp()??zw()),[l,c]=p.useState(()=>Fw());p.useEffect(()=>{Bw(s)},[s]),p.useEffect(()=>{Uw(l)},[l]),p.useEffect(()=>{let g=!1;return I2().then(x=>{if(!g&&x.preset!==l){c(x.preset);try{window.localStorage.setItem(Mc,x.preset)}catch{}}}),()=>{g=!0}},[]),p.useEffect(()=>{if(!window.matchMedia)return;const g=window.matchMedia("(prefers-color-scheme: dark)"),x=()=>{t||a(g.matches?"dark":"light")};return x(),g.addEventListener("change",x),()=>{g.removeEventListener("change",x)}},[t]);async function d(g){c(g);try{window.localStorage.setItem(Mc,g)}catch{}await O2(g)}async function f(){const g=await L2();c(g.preset);try{window.localStorage.setItem(Mc,g.preset)}catch{}}const m={resolvedTheme:s,explicitTheme:t,setTheme:g=>{window.localStorage.setItem(Pp,g),n(g),a(g)},toggleTheme:()=>{const g=s==="dark"?"light":"dark";window.localStorage.setItem(Pp,g),n(g),a(g)},preset:l,setPreset:d,resetPreset:f};return r.jsx(_w.Provider,{value:m,children:e})}function Em(){const e=p.useContext(_w);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const _c=new Set;let Mn=null,oi=null;function _2(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Hw(){Mn&&(Mn.readyState===WebSocket.OPEN||Mn.readyState===WebSocket.CONNECTING)||(Mn=new WebSocket(_2()),Mn.onmessage=e=>{try{const t=JSON.parse(e.data);for(const n of _c)n(t)}catch{}},Mn.onclose=()=>{Mn=null,oi&&clearTimeout(oi),oi=setTimeout(Hw,2e3)},Mn.onerror=()=>{Mn==null||Mn.close()})}function yu(e){const t=p.useRef(e);t.current=e,p.useEffect(()=>{const n=s=>t.current(s);return _c.add(n),Hw(),()=>{_c.delete(n),_c.size===0&&Mn&&(oi&&clearTimeout(oi),oi=null,Mn.close(),Mn=null)}},[])}function Wt(e,t){const[n,s]=p.useState(null),[a,l]=p.useState(!0),[c,d]=p.useState(null),[f,m]=p.useState(0),g=p.useCallback(()=>{m(x=>x+1)},[]);return p.useEffect(()=>{if(!e){l(!1),s(null);return}let x=!1;return l(!0),d(null),fetch(e).then(async y=>{if(!y.ok){const v=await y.json().catch(()=>null);throw new Error((v==null?void 0:v.error)||`HTTP ${y.status}`)}return y.json()}).then(y=>{x||(s(y),l(!1))}).catch(y=>{x||(d(y.message),l(!1))}),()=>{x=!0}},[e,f]),yu(x=>{t&&((x.type==="project-updated"||x.type==="assignment-updated")&&g(),x.type==="servers-updated"&&t==="servers"&&g(),x.type==="agent-sessions-updated"&&(t==="agent-sessions"||t==="overview")&&g(),x.type==="playbooks-updated"&&t==="playbooks"&&g(),x.type==="leases-updated"&&t==="inventories"&&g())}),{data:n,loading:a,error:c,refetch:g}}function ji(){return Wt("/api/projects","projects")}function vu(){return Wt("/api/workspaces","projects")}function Tt(){const{workspace:e}=jt();return e?`/w/${e}`:""}function F2(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 Wt(s,"overview")}function Ww(){return Wt("/api/assignments","assignments")}function Vw(){return Wt("/api/help")}function qw(e){const t=e?`/api/projects/${e}`:null;return Wt(t,"project")}function z2(e,t){const n=e&&t?`/api/projects/${e}/assignments/${t}`:null;return Wt(n,"assignment")}function B2(e){const t=e?`/api/assignments/${e}`:null;return Wt(t,"assignment")}function Kw(e){return Wt(e)}function Tm(){return Wt("/api/servers","servers")}function U2(){return Wt("/api/leases","inventories")}function H2(){return Wt("/api/agent-sessions","agent-sessions")}function W2(e,t){const n=e&&t?`/api/agent-sessions/${e}?assignment=${t}`:null;return Wt(n,"agent-sessions")}function V2(e){const t=e?`/api/assignments/${e}/sessions`:null;return Wt(t,"agent-sessions")}function Gw(){return Wt("/api/playbooks","playbooks")}function q2(e){const t=e?`/api/playbooks/${e}`:null;return Wt(t,"playbooks")}function K2(){return Wt("/api/memories","project")}function G2(e,t){const n=e&&t?`/api/projects/${e}/memories/${t}`:null;return Wt(n,"project")}function Y2(){return Wt("/api/resources","project")}function X2(e,t){const n=e&&t?`/api/projects/${e}/resources/${t}`:null;return Wt(n,"project")}const bu=["new-workspace","new-project","new-todo","new-assignment"];function J2(e){return typeof e=="string"&&bu.includes(e)}const Q2=["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","[","]"],Z2=["mod","ctrl","alt","shift"];function _n(e){if(typeof e!="string")return"";const t=e.trim();if(!t)return"";if(/\s/.test(t)&&!t.includes("+"))return t.split(/\s+/).map(_n).filter(d=>d.length>0).join(" ");const n=t.split("+").map(d=>d.trim()).filter(d=>d.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(d=>d.toLowerCase()),l=new Set,c=[];for(const d of Z2)a.includes(d)&&!l.has(d)&&(c.push(d),l.add(d));for(const d of a)l.has(d)||(c.push(d),l.add(d));return[...c,s].join("+")}function eT(e){const t=_n(e);return t?Q2.includes(t):!1}const tT={"new-workspace":_n("Mod+Shift+Alt+w"),"new-project":_n("Mod+Shift+Alt+p"),"new-todo":_n("Mod+Shift+Alt+t"),"new-assignment":_n("Mod+Shift+Alt+a")};function nT(e){const t={...tT};for(const n of bu){const s=e[n];typeof s=="string"&&s.length>0&&(t[n]=s)}return t}function fo(){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 rT(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 wc(e,t){const n=rT(t);if(e.key.toLowerCase()!==n.key)return!1;const a=fo()?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 Yw(e){const t=[],n=fo()?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 _n(c)}function Hr(e){return e.split("+").map(n=>{const s=n.toLowerCase();return s==="mod"?fo()?"⌘":"Ctrl":s==="shift"?fo()?"⇧":"Shift":s==="alt"?fo()?"⌥":"Alt":s==="ctrl"?fo()?"⌃":"Ctrl":s==="enter"?"↵":s==="escape"?"Esc":s==="arrowup"?"↑":s==="arrowdown"?"↓":n.length===1?n.toUpperCase():n}).join(fo()?"":"+")}function sT(e){const[t,n]=p.useState(null),[s,a]=p.useState(!0),[l,c]=p.useState(null),d=p.useCallback(async()=>{try{const f=await fetch(`/api/todos/${encodeURIComponent(e)}`);if(!f.ok)throw new Error(`HTTP ${f.status}`);n(await f.json()),c(null)}catch(f){c(f instanceof Error?f.message:"Failed to fetch todos")}finally{a(!1)}},[e]);return p.useEffect(()=>{d()},[d]),yu(f=>{f.type==="todos-updated"&&!f.projectSlug&&d()}),{data:t,loading:s,error:l,refetch:d}}function Xw(){const[e,t]=p.useState(null),[n,s]=p.useState(!0),[a,l]=p.useState(null),c=p.useCallback(async()=>{try{const d=await fetch("/api/todos");if(!d.ok)throw new Error(`HTTP ${d.status}`);t(await d.json()),l(null)}catch(d){l(d instanceof Error?d.message:"Failed to fetch todos")}finally{s(!1)}},[]);return p.useEffect(()=>{c()},[c]),yu(d=>{d.type==="todos-updated"&&!d.projectSlug&&c()}),{data:e,loading:n,error:a,refetch:c}}async function Pm(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 Jw(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 Qw(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 Zw(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 e0(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function oT(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function t0(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}`,{method:"DELETE"})}async function Rm(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 iT(e,t){return await Rm(`/api/todos/${encodeURIComponent(e)}/promote`,t)}async function aT(e){return await Rm("/api/todos/promote-bulk",e)}async function lT(e,t,n){await Rm(`/api/todos/${encodeURIComponent(e)}/${t}/move`,{to:n})}const cT=new Set(["/projects","/assignments","/servers","/todos"]);function Fc(e,t){return cT.has(e)?`${t}${e}`:e}const uT=[{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 dT(e){const t=[];for(const n of uT)t.push({type:"page",id:n.id,title:n.title,keywords:[...n.keywords],route:Fc(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:`${Fc("/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=Fc("/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 Xn(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function zc(e){return/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e)}async function fT(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 $f(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 Wy(){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 Vy(){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 Mf(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 lo(e,t,n){const s=e.match(/^(---\n)([\s\S]*?)(\n---)/);if(!s)return`---
422
- ${t}: ${JSON.stringify(n)}
423
- ---
424
- ${e}`;const a=s[1],l=s[2],c=s[3],d=e.slice(s[0].length),f=JSON.stringify(n),m=new RegExp(`^${t}:\\s*.*$`,"m");let g;return m.test(l)?g=l.replace(m,`${t}: ${f}`):g=`${l}
425
- ${t}: ${f}`,`${a}${g}${c}${d}`}const pT=/^[a-z0-9][a-z0-9-]*$/;function mT(e){const{playbooks:t,projectSlug:n,currentProjectTitle:s,currentProjectWorkspace:a,wsPrefix:l,refetchPlaybooks:c,navigate:d,toggleTheme:f}=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:pT,message:"Use lowercase letters, digits, and hyphens (e.g. acme-app). Must start with a letter or digit."}}],submit:async(g,x)=>{const y=(g.name??"").trim();if(!y)throw new Error("Name is required");const v=await fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:y})});if(!v.ok){const E=await v.json().catch(()=>({}));throw new Error(E.error||`Failed to create workspace (HTTP ${v.status})`)}x.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:g,hasUngrouped:x}=await Wy(),y=[{value:"_ungrouped",label:"Ungrouped",hint:"no workspace"}];for(const v of g)y.push({value:v,label:v,hint:"workspace"});return y}},{kind:"text",id:"title",label:"Project title",placeholder:"e.g. Marketing site rebuild",required:!0}],submit:async(g,x)=>{const y=(g.workspace??"").trim(),v=(g.title??"").trim();if(!v)throw new Error("Title is required");const E=Xn(v);if(!E)throw new Error("Title must contain at least one alphanumeric character");let k=await Mf("/api/templates/project");k=lo(k,"slug",E),k=lo(k,"title",v),y&&y!=="_ungrouped"&&(k=lo(k,"workspace",y));const w=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:k})}),S=await w.json().catch(()=>({}));if(!w.ok)throw new Error(S.error||`Failed to create project (HTTP ${w.status})`);const T=y&&y!=="_ungrouped"?`/w/${y}/projects/${S.slug??E}`:`/projects/${S.slug??E}`;x.navigate(T)}}}),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:g},x]=await Promise.all([Wy(),Vy()]),y=[{value:"_ungrouped",label:"Global",hint:"no workspace"}];for(const v of g)y.push({value:v,label:v,hint:"workspace"});for(const v of x){const E=v.workspace??"_ungrouped";y.push({value:E,label:`${v.title}`,hint:`project · ${v.workspace??"ungrouped"}`})}return y}},{kind:"text",id:"description",label:"Description",placeholder:"Describe the todo…",required:!0}],submit:async g=>{const x=(g.scope??"_ungrouped").trim()||"_ungrouped",y=(g.description??"").trim();if(!y)throw new Error("Description is required");await Pm(x,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 g=await Vy(),x=[{value:"_standalone",label:"Standalone",hint:"one-off / not in a project"}];for(const y of g)x.push({value:y.slug,label:y.title,hint:y.workspace?`workspace · ${y.workspace}`:"ungrouped"});return x}},{kind:"text",id:"title",label:"Assignment title",placeholder:"What needs to get done?",required:!0}],submit:async(g,x)=>{var N;const y=(g.project??"_standalone").trim()||"_standalone",v=(g.title??"").trim();if(!v)throw new Error("Title is required");const E=Xn(v);if(!E)throw new Error("Title must contain at least one alphanumeric character");if(y==="_standalone"){let A=await Mf("/api/templates/assignment?standalone=1");A=lo(A,"slug",E),A=lo(A,"title",v);const M=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:A})}),R=await M.json().catch(()=>({}));if(!M.ok)throw new Error(R.error||`Failed to create assignment (HTTP ${M.status})`);const I=((N=R==null?void 0:R.assignment)==null?void 0:N.id)??(R==null?void 0:R.id);I?x.navigate(`/assignments/${I}`):x.navigate("/assignments");return}let k=await Mf("/api/templates/assignment");k=lo(k,"slug",E),k=lo(k,"title",v);const w=await fetch(`/api/projects/${encodeURIComponent(y)}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:k})}),S=await w.json().catch(()=>({}));if(!w.ok)throw new Error(S.error||`Failed to create assignment (HTTP ${w.status})`);const T=S.slug??E;x.navigate(`/projects/${y}/assignments/${T}`)}}}),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:()=>d(`${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:()=>d(`${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:()=>d(`${l}/projects/${n}/create/assignment`)}),m.push({id:"create-playbook",title:"New Playbook",group:"Create",keywords:["new","create","playbook"],run:()=>d("/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 g=>{const x=g.trim();x&&await $f("_ungrouped",x)}}}),l){const g=l.replace(/^\/w\//,"");m.push({id:`create-todo-workspace-${g}`,title:`New Todo in workspace ${g}`,subtitle:g,group:"Create",keywords:["new","create","todo","workspace",g],requiresInput:{placeholder:`Describe the todo for workspace ${g}…`,runWithInput:async x=>{const y=x.trim();y&&await $f(g,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 g=>{const x=g.trim();x&&await $f(a,x)}}});for(const g of t)m.push({id:`toggle-playbook-${g.slug}`,title:`Toggle Playbook: ${g.name}`,subtitle:g.enabled?"enabled":"disabled",group:"Toggle",keywords:["toggle","playbook",g.slug,...g.tags??[]],run:()=>fT(g.slug,g.enabled,c)});return m.push({id:"toggle-theme",title:"Toggle theme",subtitle:"Light / dark",group:"Theme",keywords:["theme","toggle","light","dark","appearance"],run:()=>f()}),m}function Ct(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 qy(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wu(...e){return t=>{let n=!1;const s=e.map(a=>{const l=qy(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():qy(e[a],null)}}}}function bn(...e){return p.useCallback(wu(...e),e)}function hT(e,t){const n=p.createContext(t),s=l=>{const{children:c,...d}=l,f=p.useMemo(()=>d,Object.values(d));return r.jsx(n.Provider,{value:f,children:c})};s.displayName=e+"Provider";function a(l){const c=p.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 yo(e,t=[]){let n=[];function s(l,c){const d=p.createContext(c),f=n.length;n=[...n,c];const m=x=>{var S;const{scope:y,children:v,...E}=x,k=((S=y==null?void 0:y[e])==null?void 0:S[f])||d,w=p.useMemo(()=>E,Object.values(E));return r.jsx(k.Provider,{value:w,children:v})};m.displayName=l+"Provider";function g(x,y){var k;const v=((k=y==null?void 0:y[e])==null?void 0:k[f])||d,E=p.useContext(v);if(E)return E;if(c!==void 0)return c;throw new Error(`\`${x}\` must be used within \`${l}\``)}return[m,g]}const a=()=>{const l=n.map(c=>p.createContext(c));return function(d){const f=(d==null?void 0:d[e])||l;return p.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])}};return a.scopeName=e,[s,gT(a,...t)]}function gT(...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((d,{useScope:f,scopeName:m})=>{const x=f(l)[`__scope${m}`];return{...d,...x}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Hs=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},xT=Xb[" useId ".trim().toString()]||(()=>{}),yT=0;function ii(e){const[t,n]=p.useState(xT());return Hs(()=>{n(s=>s??String(yT++))},[e]),e||(t?`radix-${t}`:"")}var vT=Xb[" useInsertionEffect ".trim().toString()]||Hs;function ju({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[a,l,c]=bT({defaultProp:t,onChange:n}),d=e!==void 0,f=d?e:a;{const g=p.useRef(e!==void 0);p.useEffect(()=>{const x=g.current;x!==d&&console.warn(`${s} is changing from ${x?"controlled":"uncontrolled"} to ${d?"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.`),g.current=d},[d,s])}const m=p.useCallback(g=>{var x;if(d){const y=wT(g)?g(e):g;y!==e&&((x=c.current)==null||x.call(c,y))}else l(g)},[d,e,l,c]);return[f,m]}function bT({defaultProp:e,onChange:t}){const[n,s]=p.useState(e),a=p.useRef(n),l=p.useRef(t);return vT(()=>{l.current=t},[t]),p.useEffect(()=>{var c;a.current!==n&&((c=l.current)==null||c.call(l,n),a.current=n)},[n,a]),[n,s,l]}function wT(e){return typeof e=="function"}function jT(e){const t=kT(e),n=p.forwardRef((s,a)=>{const{children:l,...c}=s,d=p.Children.toArray(l),f=d.find(NT);if(f){const m=f.props.children,g=d.map(x=>x===f?p.Children.count(m)>1?p.Children.only(null):p.isValidElement(m)?m.props.children:null:x);return r.jsx(t,{...c,ref:a,children:p.isValidElement(m)?p.cloneElement(m,void 0,g):null})}return r.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function kT(e){const t=p.forwardRef((n,s)=>{const{children:a,...l}=n;if(p.isValidElement(a)){const c=ET(a),d=CT(l,a.props);return a.type!==p.Fragment&&(d.ref=s?wu(s,c):c),p.cloneElement(a,d)}return p.Children.count(a)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ST=Symbol("radix.slottable");function NT(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ST}function CT(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]=(...d)=>{const f=l(...d);return a(...d),f}:a&&(n[s]=a):s==="style"?n[s]={...a,...l}:s==="className"&&(n[s]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function ET(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 TT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vt=TT.reduce((e,t)=>{const n=jT(`Primitive.${t}`),s=p.forwardRef((a,l)=>{const{asChild:c,...d}=a,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(f,{...d,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function PT(e,t){e&&Us.flushSync(()=>e.dispatchEvent(t))}function mo(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function RT(e,t=globalThis==null?void 0:globalThis.document){const n=mo(e);p.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 AT="DismissableLayer",Ap="dismissableLayer.update",DT="dismissableLayer.pointerDownOutside",IT="dismissableLayer.focusOutside",Ky,n0=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Am=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...f}=e,m=p.useContext(n0),[g,x]=p.useState(null),y=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=p.useState({}),E=bn(t,I=>x(I)),k=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),S=k.indexOf(w),T=g?k.indexOf(g):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,A=T>=S,M=$T(I=>{const O=I.target,Y=[...m.branches].some(J=>J.contains(O));!A||Y||(a==null||a(I),c==null||c(I),I.defaultPrevented||d==null||d())},y),R=MT(I=>{const O=I.target;[...m.branches].some(J=>J.contains(O))||(l==null||l(I),c==null||c(I),I.defaultPrevented||d==null||d())},y);return RT(I=>{T===m.layers.size-1&&(s==null||s(I),!I.defaultPrevented&&d&&(I.preventDefault(),d()))},y),p.useEffect(()=>{if(g)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Ky=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),Gy(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=Ky)}},[g,y,n,m]),p.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),Gy())},[g,m]),p.useEffect(()=>{const I=()=>v({});return document.addEventListener(Ap,I),()=>document.removeEventListener(Ap,I)},[]),r.jsx(Vt.div,{...f,ref:E,style:{pointerEvents:N?A?"auto":"none":void 0,...e.style},onFocusCapture:Ct(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Ct(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Ct(e.onPointerDownCapture,M.onPointerDownCapture)})});Am.displayName=AT;var OT="DismissableLayerBranch",LT=p.forwardRef((e,t)=>{const n=p.useContext(n0),s=p.useRef(null),a=bn(t,s);return p.useEffect(()=>{const l=s.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),r.jsx(Vt.div,{...e,ref:a})});LT.displayName=OT;function $T(e,t=globalThis==null?void 0:globalThis.document){const n=mo(e),s=p.useRef(!1),a=p.useRef(()=>{});return p.useEffect(()=>{const l=d=>{if(d.target&&!s.current){let f=function(){r0(DT,n,m,{discrete:!0})};const m={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=f,t.addEventListener("click",a.current,{once:!0})):f()}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 MT(e,t=globalThis==null?void 0:globalThis.document){const n=mo(e),s=p.useRef(!1);return p.useEffect(()=>{const a=l=>{l.target&&!s.current&&r0(IT,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 Gy(){const e=new CustomEvent(Ap);document.dispatchEvent(e)}function r0(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?PT(a,l):a.dispatchEvent(l)}var _f="focusScope.autoFocusOnMount",Ff="focusScope.autoFocusOnUnmount",Yy={bubbles:!1,cancelable:!0},_T="FocusScope",s0=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:l,...c}=e,[d,f]=p.useState(null),m=mo(a),g=mo(l),x=p.useRef(null),y=bn(t,k=>f(k)),v=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(s){let k=function(N){if(v.paused||!d)return;const A=N.target;d.contains(A)?x.current=A:zs(x.current,{select:!0})},w=function(N){if(v.paused||!d)return;const A=N.relatedTarget;A!==null&&(d.contains(A)||zs(x.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const M of N)M.removedNodes.length>0&&zs(d)};document.addEventListener("focusin",k),document.addEventListener("focusout",w);const T=new MutationObserver(S);return d&&T.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",w),T.disconnect()}}},[s,d,v.paused]),p.useEffect(()=>{if(d){Jy.add(v);const k=document.activeElement;if(!d.contains(k)){const S=new CustomEvent(_f,Yy);d.addEventListener(_f,m),d.dispatchEvent(S),S.defaultPrevented||(FT(WT(o0(d)),{select:!0}),document.activeElement===k&&zs(d))}return()=>{d.removeEventListener(_f,m),setTimeout(()=>{const S=new CustomEvent(Ff,Yy);d.addEventListener(Ff,g),d.dispatchEvent(S),S.defaultPrevented||zs(k??document.body,{select:!0}),d.removeEventListener(Ff,g),Jy.remove(v)},0)}}},[d,m,g,v]);const E=p.useCallback(k=>{if(!n&&!s||v.paused)return;const w=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,S=document.activeElement;if(w&&S){const T=k.currentTarget,[N,A]=zT(T);N&&A?!k.shiftKey&&S===A?(k.preventDefault(),n&&zs(N,{select:!0})):k.shiftKey&&S===N&&(k.preventDefault(),n&&zs(A,{select:!0})):S===T&&k.preventDefault()}},[n,s,v.paused]);return r.jsx(Vt.div,{tabIndex:-1,...c,ref:y,onKeyDown:E})});s0.displayName=_T;function FT(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(zs(s,{select:t}),document.activeElement!==n)return}function zT(e){const t=o0(e),n=Xy(t,e),s=Xy(t.reverse(),e);return[n,s]}function o0(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 Xy(e,t){for(const n of e)if(!BT(n,{upTo:t}))return n}function BT(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 UT(e){return e instanceof HTMLInputElement&&"select"in e}function zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&UT(e)&&t&&e.select()}}var Jy=HT();function HT(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Qy(e,t),e.unshift(t)},remove(t){var n;e=Qy(e,t),(n=e[0])==null||n.resume()}}}function Qy(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function WT(e){return e.filter(t=>t.tagName!=="A")}var VT="Portal",Dm=p.forwardRef((e,t)=>{var d;const{container:n,...s}=e,[a,l]=p.useState(!1);Hs(()=>l(!0),[]);const c=n||a&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?gE.createPortal(r.jsx(Vt.div,{...s,ref:t}),c):null});Dm.displayName=VT;function qT(e,t){return p.useReducer((n,s)=>t[n][s]??n,e)}var vo=e=>{const{present:t,children:n}=e,s=KT(t),a=typeof n=="function"?n({present:s.isPresent}):p.Children.only(n),l=bn(s.ref,GT(a));return typeof n=="function"||s.isPresent?p.cloneElement(a,{ref:l}):null};vo.displayName="Presence";function KT(e){const[t,n]=p.useState(),s=p.useRef(null),a=p.useRef(e),l=p.useRef("none"),c=e?"mounted":"unmounted",[d,f]=qT(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const m=jc(s.current);l.current=d==="mounted"?m:"none"},[d]),Hs(()=>{const m=s.current,g=a.current;if(g!==e){const y=l.current,v=jc(m);e?f("MOUNT"):v==="none"||(m==null?void 0:m.display)==="none"?f("UNMOUNT"):f(g&&y!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),Hs(()=>{if(t){let m;const g=t.ownerDocument.defaultView??window,x=v=>{const k=jc(s.current).includes(CSS.escape(v.animationName));if(v.target===t&&k&&(f("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",m=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},y=v=>{v.target===t&&(l.current=jc(s.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",x),t.addEventListener("animationend",x),()=>{g.clearTimeout(m),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",x),t.removeEventListener("animationend",x)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:p.useCallback(m=>{s.current=m?getComputedStyle(m):null,n(m)},[])}}function jc(e){return(e==null?void 0:e.animationName)||"none"}function GT(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 zf=0;function YT(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Zy()),document.body.insertAdjacentElement("beforeend",e[1]??Zy()),zf++,()=>{zf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),zf--}},[])}function Zy(){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 Mr=function(){return Mr=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},Mr.apply(this,arguments)};function i0(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 XT(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 Bc="right-scroll-bar-position",Uc="width-before-scroll-bar",JT="with-scroll-bars-hidden",QT="--removed-body-scroll-bar-size";function Bf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ZT(e,t){var n=p.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 eP=typeof window<"u"?p.useLayoutEffect:p.useEffect,ev=new WeakMap;function tP(e,t){var n=ZT(null,function(s){return e.forEach(function(a){return Bf(a,s)})});return eP(function(){var s=ev.get(n);if(s){var a=new Set(s),l=new Set(e),c=n.current;a.forEach(function(d){l.has(d)||Bf(d,null)}),l.forEach(function(d){a.has(d)||Bf(d,c)})}ev.set(n,e)},[e]),n}function nP(e){return e}function rP(e,t){t===void 0&&(t=nP);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(d){return d!==c})}},assignSyncMedium:function(l){for(s=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){s=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(l),c=n}var f=function(){var g=c;c=[],g.forEach(l)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(g){c.push(g),m()},filter:function(g){return c=c.filter(g),n}}}};return a}function sP(e){e===void 0&&(e={});var t=rP(null);return t.options=Mr({async:!0,ssr:!1},e),t}var a0=function(e){var t=e.sideCar,n=i0(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 p.createElement(s,Mr({},n))};a0.isSideCarExport=!0;function oP(e,t){return e.useMedium(t),a0}var l0=sP(),Uf=function(){},ku=p.forwardRef(function(e,t){var n=p.useRef(null),s=p.useState({onScrollCapture:Uf,onWheelCapture:Uf,onTouchMoveCapture:Uf}),a=s[0],l=s[1],c=e.forwardProps,d=e.children,f=e.className,m=e.removeScrollBar,g=e.enabled,x=e.shards,y=e.sideCar,v=e.noRelative,E=e.noIsolation,k=e.inert,w=e.allowPinchZoom,S=e.as,T=S===void 0?"div":S,N=e.gapMode,A=i0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=y,R=tP([n,t]),I=Mr(Mr({},A),a);return p.createElement(p.Fragment,null,g&&p.createElement(M,{sideCar:l0,removeScrollBar:m,shards:x,noRelative:v,noIsolation:E,inert:k,setCallbacks:l,allowPinchZoom:!!w,lockRef:n,gapMode:N}),c?p.cloneElement(p.Children.only(d),Mr(Mr({},I),{ref:R})):p.createElement(T,Mr({},I,{className:f,ref:R}),d))});ku.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ku.classNames={fullWidth:Uc,zeroRight:Bc};var iP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function aP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=iP();return t&&e.setAttribute("nonce",t),e}function lP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var uP=function(){var e=0,t=null;return{add:function(n){e==0&&(t=aP())&&(lP(t,n),cP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},dP=function(){var e=uP();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},c0=function(){var e=dP(),t=function(n){var s=n.styles,a=n.dynamic;return e(s,a),null};return t},fP={left:0,top:0,right:0,gap:0},Hf=function(e){return parseInt(e||"",10)||0},pP=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[Hf(n),Hf(s),Hf(a)]},mP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return fP;var t=pP(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])}},hP=c0(),ai="data-scroll-locked",gP=function(e,t,n,s){var a=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
426
- .`.concat(JT,` {
427
- overflow: hidden `).concat(s,`;
428
- padding-right: `).concat(d,"px ").concat(s,`;
429
- }
430
- body[`).concat(ai,`] {
431
- overflow: hidden `).concat(s,`;
432
- overscroll-behavior: contain;
433
- `).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
434
- padding-left: `.concat(a,`px;
435
- padding-top: `).concat(l,`px;
436
- padding-right: `).concat(c,`px;
437
- margin-left:0;
438
- margin-top:0;
439
- margin-right: `).concat(d,"px ").concat(s,`;
440
- `),n==="padding"&&"padding-right: ".concat(d,"px ").concat(s,";")].filter(Boolean).join(""),`
441
- }
442
-
443
- .`).concat(Bc,` {
444
- right: `).concat(d,"px ").concat(s,`;
445
- }
446
-
447
- .`).concat(Uc,` {
448
- margin-right: `).concat(d,"px ").concat(s,`;
449
- }
450
-
451
- .`).concat(Bc," .").concat(Bc,` {
452
- right: 0 `).concat(s,`;
453
- }
454
-
455
- .`).concat(Uc," .").concat(Uc,` {
456
- margin-right: 0 `).concat(s,`;
457
- }
458
-
459
- body[`).concat(ai,`] {
460
- `).concat(QT,": ").concat(d,`px;
461
- }
462
- `)},tv=function(){var e=parseInt(document.body.getAttribute(ai)||"0",10);return isFinite(e)?e:0},xP=function(){p.useEffect(function(){return document.body.setAttribute(ai,(tv()+1).toString()),function(){var e=tv()-1;e<=0?document.body.removeAttribute(ai):document.body.setAttribute(ai,e.toString())}},[])},yP=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,a=s===void 0?"margin":s;xP();var l=p.useMemo(function(){return mP(a)},[a]);return p.createElement(hP,{styles:gP(l,!t,a,n?"":"!important")})},Dp=!1;if(typeof window<"u")try{var kc=Object.defineProperty({},"passive",{get:function(){return Dp=!0,!0}});window.addEventListener("test",kc,kc),window.removeEventListener("test",kc,kc)}catch{Dp=!1}var Ko=Dp?{passive:!1}:!1,vP=function(e){return e.tagName==="TEXTAREA"},u0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!vP(e)&&n[t]==="visible")},bP=function(e){return u0(e,"overflowY")},wP=function(e){return u0(e,"overflowX")},nv=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var a=d0(e,s);if(a){var l=f0(e,s),c=l[1],d=l[2];if(c>d)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},jP=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},kP=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},d0=function(e,t){return e==="v"?bP(t):wP(t)},f0=function(e,t){return e==="v"?jP(t):kP(t)},SP=function(e,t){return e==="h"&&t==="rtl"?-1:1},NP=function(e,t,n,s,a){var l=SP(e,window.getComputedStyle(t).direction),c=l*s,d=n.target,f=t.contains(d),m=!1,g=c>0,x=0,y=0;do{if(!d)break;var v=f0(e,d),E=v[0],k=v[1],w=v[2],S=k-w-l*E;(E||S)&&d0(e,d)&&(x+=S,y+=E);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(g&&Math.abs(x)<1||!g&&Math.abs(y)<1)&&(m=!0),m},Sc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rv=function(e){return[e.deltaX,e.deltaY]},sv=function(e){return e&&"current"in e?e.current:e},CP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},EP=function(e){return`
463
- .block-interactivity-`.concat(e,` {pointer-events: none;}
464
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
465
- `)},TP=0,Go=[];function PP(e){var t=p.useRef([]),n=p.useRef([0,0]),s=p.useRef(),a=p.useState(TP++)[0],l=p.useState(c0)[0],c=p.useRef(e);p.useEffect(function(){c.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var k=XT([e.lockRef.current],(e.shards||[]).map(sv),!0).filter(Boolean);return k.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),k.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var d=p.useCallback(function(k,w){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!c.current.allowPinchZoom;var S=Sc(k),T=n.current,N="deltaX"in k?k.deltaX:T[0]-S[0],A="deltaY"in k?k.deltaY:T[1]-S[1],M,R=k.target,I=Math.abs(N)>Math.abs(A)?"h":"v";if("touches"in k&&I==="h"&&R.type==="range")return!1;var O=window.getSelection(),Y=O&&O.anchorNode,J=Y?Y===R||Y.contains(R):!1;if(J)return!1;var _=nv(I,R);if(!_)return!0;if(_?M=I:(M=I==="v"?"h":"v",_=nv(I,R)),!_)return!1;if(!s.current&&"changedTouches"in k&&(N||A)&&(s.current=M),!M)return!0;var U=s.current||M;return NP(U,w,k,U==="h"?N:A)},[]),f=p.useCallback(function(k){var w=k;if(!(!Go.length||Go[Go.length-1]!==l)){var S="deltaY"in w?rv(w):Sc(w),T=t.current.filter(function(M){return M.name===w.type&&(M.target===w.target||w.target===M.shadowParent)&&CP(M.delta,S)})[0];if(T&&T.should){w.cancelable&&w.preventDefault();return}if(!T){var N=(c.current.shards||[]).map(sv).filter(Boolean).filter(function(M){return M.contains(w.target)}),A=N.length>0?d(w,N[0]):!c.current.noIsolation;A&&w.cancelable&&w.preventDefault()}}},[]),m=p.useCallback(function(k,w,S,T){var N={name:k,delta:w,target:S,should:T,shadowParent:RP(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(A){return A!==N})},1)},[]),g=p.useCallback(function(k){n.current=Sc(k),s.current=void 0},[]),x=p.useCallback(function(k){m(k.type,rv(k),k.target,d(k,e.lockRef.current))},[]),y=p.useCallback(function(k){m(k.type,Sc(k),k.target,d(k,e.lockRef.current))},[]);p.useEffect(function(){return Go.push(l),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:y}),document.addEventListener("wheel",f,Ko),document.addEventListener("touchmove",f,Ko),document.addEventListener("touchstart",g,Ko),function(){Go=Go.filter(function(k){return k!==l}),document.removeEventListener("wheel",f,Ko),document.removeEventListener("touchmove",f,Ko),document.removeEventListener("touchstart",g,Ko)}},[]);var v=e.removeScrollBar,E=e.inert;return p.createElement(p.Fragment,null,E?p.createElement(l,{styles:EP(a)}):null,v?p.createElement(yP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function RP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const AP=oP(l0,PP);var p0=p.forwardRef(function(e,t){return p.createElement(ku,Mr({},e,{ref:t,sideCar:AP}))});p0.classNames=ku.classNames;var DP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Yo=new WeakMap,Nc=new WeakMap,Cc={},Wf=0,m0=function(e){return e&&(e.host||m0(e.parentNode))},IP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=m0(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})},OP=function(e,t,n,s){var a=IP(t,Array.isArray(e)?e:[e]);Cc[n]||(Cc[n]=new WeakMap);var l=Cc[n],c=[],d=new Set,f=new Set(a),m=function(x){!x||d.has(x)||(d.add(x),m(x.parentNode))};a.forEach(m);var g=function(x){!x||f.has(x)||Array.prototype.forEach.call(x.children,function(y){if(d.has(y))g(y);else try{var v=y.getAttribute(s),E=v!==null&&v!=="false",k=(Yo.get(y)||0)+1,w=(l.get(y)||0)+1;Yo.set(y,k),l.set(y,w),c.push(y),k===1&&E&&Nc.set(y,!0),w===1&&y.setAttribute(n,"true"),E||y.setAttribute(s,"true")}catch(S){console.error("aria-hidden: cannot operate on ",y,S)}})};return g(t),d.clear(),Wf++,function(){c.forEach(function(x){var y=Yo.get(x)-1,v=l.get(x)-1;Yo.set(x,y),l.set(x,v),y||(Nc.has(x)||x.removeAttribute(s),Nc.delete(x)),v||x.removeAttribute(n)}),Wf--,Wf||(Yo=new WeakMap,Yo=new WeakMap,Nc=new WeakMap,Cc={})}},LP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),a=DP(e);return a?(s.push.apply(s,Array.from(a.querySelectorAll("[aria-live], script"))),OP(s,a,n,"aria-hidden")):function(){return null}};function $P(e){const t=MP(e),n=p.forwardRef((s,a)=>{const{children:l,...c}=s,d=p.Children.toArray(l),f=d.find(FP);if(f){const m=f.props.children,g=d.map(x=>x===f?p.Children.count(m)>1?p.Children.only(null):p.isValidElement(m)?m.props.children:null:x);return r.jsx(t,{...c,ref:a,children:p.isValidElement(m)?p.cloneElement(m,void 0,g):null})}return r.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function MP(e){const t=p.forwardRef((n,s)=>{const{children:a,...l}=n;if(p.isValidElement(a)){const c=BP(a),d=zP(l,a.props);return a.type!==p.Fragment&&(d.ref=s?wu(s,c):c),p.cloneElement(a,d)}return p.Children.count(a)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _P=Symbol("radix.slottable");function FP(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_P}function zP(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]=(...d)=>{const f=l(...d);return a(...d),f}:a&&(n[s]=a):s==="style"?n[s]={...a,...l}:s==="className"&&(n[s]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function BP(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 Su="Dialog",[h0,g0]=yo(Su),[UP,Er]=h0(Su),x0=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,d=p.useRef(null),f=p.useRef(null),[m,g]=ju({prop:s,defaultProp:a??!1,onChange:l,caller:Su});return r.jsx(UP,{scope:t,triggerRef:d,contentRef:f,contentId:ii(),titleId:ii(),descriptionId:ii(),open:m,onOpenChange:g,onOpenToggle:p.useCallback(()=>g(x=>!x),[g]),modal:c,children:n})};x0.displayName=Su;var y0="DialogTrigger",v0=p.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Er(y0,n),l=bn(t,a.triggerRef);return r.jsx(Vt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Lm(a.open),...s,ref:l,onClick:Ct(e.onClick,a.onOpenToggle)})});v0.displayName=y0;var Im="DialogPortal",[HP,b0]=h0(Im,{forceMount:void 0}),w0=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:a}=e,l=Er(Im,t);return r.jsx(HP,{scope:t,forceMount:n,children:p.Children.map(s,c=>r.jsx(vo,{present:n||l.open,children:r.jsx(Dm,{asChild:!0,container:a,children:c})}))})};w0.displayName=Im;var Jc="DialogOverlay",j0=p.forwardRef((e,t)=>{const n=b0(Jc,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,l=Er(Jc,e.__scopeDialog);return l.modal?r.jsx(vo,{present:s||l.open,children:r.jsx(VP,{...a,ref:t})}):null});j0.displayName=Jc;var WP=$P("DialogOverlay.RemoveScroll"),VP=p.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Er(Jc,n);return r.jsx(p0,{as:WP,allowPinchZoom:!0,shards:[a.contentRef],children:r.jsx(Vt.div,{"data-state":Lm(a.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),ho="DialogContent",k0=p.forwardRef((e,t)=>{const n=b0(ho,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,l=Er(ho,e.__scopeDialog);return r.jsx(vo,{present:s||l.open,children:l.modal?r.jsx(qP,{...a,ref:t}):r.jsx(KP,{...a,ref:t})})});k0.displayName=ho;var qP=p.forwardRef((e,t)=>{const n=Er(ho,e.__scopeDialog),s=p.useRef(null),a=bn(t,n.contentRef,s);return p.useEffect(()=>{const l=s.current;if(l)return LP(l)},[]),r.jsx(S0,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ct(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ct(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:Ct(e.onFocusOutside,l=>l.preventDefault())})}),KP=p.forwardRef((e,t)=>{const n=Er(ho,e.__scopeDialog),s=p.useRef(!1),a=p.useRef(!1);return r.jsx(S0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(s.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:l=>{var f,m;(f=e.onInteractOutside)==null||f.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()}})}),S0=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,...c}=e,d=Er(ho,n),f=p.useRef(null),m=bn(t,f);return YT(),r.jsxs(r.Fragment,{children:[r.jsx(s0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:l,children:r.jsx(Am,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Lm(d.open),...c,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(YP,{titleId:d.titleId}),r.jsx(JP,{contentRef:f,descriptionId:d.descriptionId})]})]})}),Om="DialogTitle",N0=p.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Er(Om,n);return r.jsx(Vt.h2,{id:a.titleId,...s,ref:t})});N0.displayName=Om;var C0="DialogDescription",E0=p.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Er(C0,n);return r.jsx(Vt.p,{id:a.descriptionId,...s,ref:t})});E0.displayName=C0;var T0="DialogClose",P0=p.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Er(T0,n);return r.jsx(Vt.button,{type:"button",...s,ref:t,onClick:Ct(e.onClick,()=>a.onOpenChange(!1))})});P0.displayName=T0;function Lm(e){return e?"open":"closed"}var R0="DialogTitleWarning",[GP,A0]=hT(R0,{contentName:ho,titleName:Om,docsSlug:"dialog"}),YP=({titleId:e})=>{const t=A0(R0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
466
-
467
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
468
-
469
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},XP="DialogDescriptionWarning",JP=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${A0(XP).contentName}}.`;return p.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},D0=x0,QP=v0,I0=w0,$m=j0,Mm=k0,_m=N0,Fm=E0,O0=P0;const Jr=D0,ZP=I0,L0=p.forwardRef(({className:e,...t},n)=>r.jsx($m,{ref:n,className:ze("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));L0.displayName=$m.displayName;const Tr=p.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(ZP,{children:[r.jsx(L0,{}),r.jsx(Mm,{ref:s,className:ze("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})]}));Tr.displayName=Mm.displayName;function bo({className:e,...t}){return r.jsx("div",{className:ze("flex flex-col space-y-2 text-left",e),...t})}function wo({className:e,...t}){return r.jsx("div",{className:ze("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const Pr=p.forwardRef(({className:e,...t},n)=>r.jsx(_m,{ref:n,className:ze("text-lg font-semibold tracking-tight text-foreground",e),...t}));Pr.displayName=_m.displayName;const ps=p.forwardRef(({className:e,...t},n)=>r.jsx(Fm,{ref:n,className:ze("text-sm leading-6 text-muted-foreground",e),...t}));ps.displayName=Fm.displayName;const eR=-1,tR=-40;function Vf(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 d=e[c];let f=!1;for(;s<t.length;)if(t[s]===d){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(tR,l*eR)),a=s,l=0,s++,f=!0;break}else l++,s++;if(!f)return-1/0}return n}const ov={page:0,project:1,assignment:2,playbook:3,server:4,todo:5};function zm(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 x;const d=Vf(s,c.title.toLowerCase())*1,f=c.subtitle?Vf(s,c.subtitle.toLowerCase())*.5:-1/0,m=(x=c.keywords)!=null&&x.length?Vf(s,c.keywords.join(" ").toLowerCase())*.3:-1/0,g=Math.max(d,f,m);return{...c,score:g}}).filter(c=>c.score>-1/0);return l.sort((c,d)=>d.score!==c.score?d.score-c.score:c.title.length!==d.title.length?c.title.length-d.title.length:c.title!==d.title?c.title<d.title?-1:1:(ov[c.type]??99)-(ov[d.type]??99)),l.slice(0,n)}const nR={page:"Page",project:"Project",assignment:"Assignment",playbook:"Playbook",server:"Server",todo:"Todo"};function rR({entries:e}){const{paletteOpen:t,closePalette:n}=Ks(),s=Et(),[a,l]=p.useState(""),[c,d]=p.useState(0),f=p.useRef(null),m=p.useMemo(()=>zm(a,e,50),[a,e]);p.useEffect(()=>{d(0)},[a,t]),p.useEffect(()=>{t||l("")},[t]),p.useEffect(()=>{var v;const y=(v=f.current)==null?void 0:v.querySelector(`[data-palette-idx="${c}"]`);y==null||y.scrollIntoView({block:"nearest"})},[c]);function g(y){s(y.route),n()}function x(y){if(y.key==="ArrowDown")y.preventDefault(),d(v=>Math.min(m.length-1,v+1));else if(y.key==="ArrowUp")y.preventDefault(),d(v=>Math.max(0,v-1));else if(y.key==="Enter"){y.preventDefault();const v=m[c];v&&g(v)}}return r.jsx(Jr,{open:t,onOpenChange:y=>y?null:n(),children:r.jsxs(Tr,{className:"max-w-xl p-0 gap-0",children:[r.jsx(Pr,{className:"sr-only",children:"Command palette"}),r.jsx("input",{autoFocus:!0,type:"text",value:a,onChange:y=>l(y.target.value),onKeyDown:x,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:f,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,v)=>{const E=v===c;return r.jsxs("button",{type:"button","data-palette-idx":v,onClick:()=>g(y),onMouseEnter:()=>d(v),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:nR[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 sR({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(jE,{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 oR({step:e,initialValue:t,disabled:n,onSubmit:s}){const[a,l]=p.useState(t??""),[c,d]=p.useState(!1),f=p.useRef(null);p.useEffect(()=>{var E;(E=f.current)==null||E.focus()},[]);const m=a.trim(),g=e.required!==!1,x=e.pattern&&m.length>0&&!e.pattern.regex.test(m),y=!n&&(!g||m.length>0)&&!x;function v(E){if(E.key==="Enter"){if(E.preventDefault(),!y){d(!0);return}s(m)}}return r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:f,type:"text",value:a,onChange:E=>{l(E.target.value),d(!1)},onKeyDown:v,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&&x?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 iR({step:e,disabled:t,onSubmit:n}){const[s,a]=p.useState({phase:"loading"}),[l,c]=p.useState(""),[d,f]=p.useState(0),[m,g]=p.useState(0),x=p.useRef(null),y=p.useRef(null);p.useEffect(()=>{var k;(k=x.current)==null||k.focus()},[]),p.useEffect(()=>{let k=!1;return a({phase:"loading"}),Promise.resolve().then(()=>e.loadOptions()).then(w=>{k||a({phase:"loaded",options:w})}).catch(w=>{if(k)return;const S=w instanceof Error?w.message:"Failed to load options";a({phase:"error",message:S})}),()=>{k=!0}},[e,m]);const v=p.useMemo(()=>{if(s.phase!=="loaded")return[];const k=s.options.map(w=>({type:"option",title:w.label,subtitle:w.hint,keywords:[w.value],option:w}));return zm(l,k,100)},[s,l]);p.useEffect(()=>{f(0)},[v.length]),p.useEffect(()=>{var w;const k=(w=y.current)==null?void 0:w.querySelector(`[data-picker-idx="${d}"]`);k==null||k.scrollIntoView({block:"nearest"})},[d]);function E(k){if(s.phase==="loaded"){if(k.key==="ArrowDown")k.preventDefault(),f(w=>Math.min(v.length-1,w+1));else if(k.key==="ArrowUp")k.preventDefault(),f(w=>Math.max(0,w-1));else if(k.key==="Enter"){k.preventDefault();const w=v[d];w&&n(w.option.value)}}}return r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:x,type:"text",value:l,onChange:k=>c(k.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:()=>g(k=>k+1),className:"rounded border border-border/70 bg-background/60 px-2 py-1 text-xs text-foreground hover:bg-accent/40",children:"Retry"})]}):v.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"}):v.map((k,w)=>{const S=w===d;return r.jsxs("button",{type:"button","data-picker-idx":w,onClick:()=>n(k.option.value),onMouseEnter:()=>f(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 ${S?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[r.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.option.label}),k.option.hint?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:k.option.hint}):null]},k.option.value)})})]})}function aR({entries:e}){var ae,ce;const t=Et(),{actionsPaletteOpen:n,closeActionsPalette:s,customBindings:a,bindAction:l,findConflict:c,pendingActionKind:d,consumePendingActionKind:f}=Ks(),[m,g]=p.useState(""),[x,y]=p.useState(0),[v,E]=p.useState(null),[k,w]=p.useState(""),[S,T]=p.useState(null),[N,A]=p.useState(null),[M,R]=p.useState(!1),[I,O]=p.useState(null),Y=p.useRef(null),J=p.useMemo(()=>e.map(Q=>({type:Q.group.toLowerCase(),title:Q.title,subtitle:Q.subtitle,keywords:Q.keywords,action:Q})),[e]),_=p.useMemo(()=>zm(m,J,50),[m,J]);p.useEffect(()=>{y(0)},[m,n]),p.useEffect(()=>{n||(g(""),E(null),w(""),T(null),A(null),R(!1),O(null))},[n]),p.useEffect(()=>{if(!n||!d)return;const Q=f();if(!Q)return;const ge=e.find(je=>je.bindableKind===Q);ge&&U(ge)},[n,d]),p.useEffect(()=>{var ge;const Q=(ge=Y.current)==null?void 0:ge.querySelector(`[data-palette-idx="${x}"]`);Q==null||Q.scrollIntoView({block:"nearest"})},[x]);async function U(Q){if(!M){if(Q.flow&&Q.flow.steps.length>0){T({action:Q,stepIndex:0,values:{}}),O(null);return}if(Q.requiresInput){E(Q),w(""),O(null);return}if(Q.run){R(!0),O(null);try{await Q.run(),s()}catch(ge){O(ge instanceof Error?ge.message:"Action failed")}finally{R(!1)}}}}async function X(Q){if(!S)return;const ge=S.action.flow.steps[S.stepIndex],je={...S.values,[ge.id]:Q};if(S.stepIndex+1<S.action.flow.steps.length){T({action:S.action,stepIndex:S.stepIndex+1,values:je});return}R(!0),O(null);try{await S.action.flow.submit(je,{navigate:t}),s()}catch(Ne){O(Ne instanceof Error?Ne.message:"Action failed")}finally{R(!1)}}function q(){if(S&&!M){if(S.stepIndex===0){T(null),O(null);return}T({action:S.action,stepIndex:S.stepIndex-1,values:S.values}),O(null)}}async function G(){if(M||!(v!=null&&v.requiresInput))return;const Q=k.trim();if(Q){R(!0),O(null);try{await v.requiresInput.runWithInput(Q),s()}catch(ge){O(ge instanceof Error?ge.message:"Action failed")}finally{R(!1)}}}function B(Q){if(Q.key==="ArrowDown")Q.preventDefault(),y(ge=>Math.min(_.length-1,ge+1));else if(Q.key==="ArrowUp")Q.preventDefault(),y(ge=>Math.max(0,ge-1));else if(Q.key==="Enter"&&(Q.metaKey||Q.ctrlKey)){Q.preventDefault();const ge=_[x];ge!=null&&ge.action.bindableKind&&A({action:ge.action,combo:null,conflict:null,saving:!1,error:null})}else if(Q.key==="Enter"){Q.preventDefault();const ge=_[x];ge&&U(ge.action)}}function W(Q){Q.key==="Enter"?(Q.preventDefault(),G()):Q.key==="Escape"&&(Q.preventDefault(),E(null),w(""))}function D(Q){if(!N||Q.key==="Escape"||Q.key==="Enter"&&!N.combo)return;Q.preventDefault(),Q.stopPropagation();const ge=Yw(Q.nativeEvent);if(!ge)return;const je=c(ge,N.action.bindableKind);A({...N,combo:ge,conflict:je,error:null})}async function ee(){var Q;if(!(!N||!N.combo||!N.action.bindableKind)){if((Q=N.conflict)!=null&&Q.description){A({...N,error:`Reserved: ${N.conflict.description}`});return}A({...N,saving:!0,error:null});try{await l(N.action.bindableKind,N.combo),A(null)}catch(ge){A({...N,saving:!1,error:ge instanceof Error?ge.message:"Failed to save binding"})}}}const C=v!==null,$=S!==null,Z=N!==null,L=S?S.action.flow.steps[S.stepIndex]:null;return r.jsx(Jr,{open:n,onOpenChange:Q=>Q?null:s(),children:r.jsxs(Tr,{className:"max-w-xl p-0 gap-0",onEscapeKeyDown:Q=>{if(!M){if(Z){Q.preventDefault(),A(null);return}if($){Q.preventDefault(),q();return}C&&(Q.preventDefault(),E(null),w(""),O(null))}},children:[r.jsx(Pr,{className:"sr-only",children:"Actions palette"}),Z&&N?r.jsxs("div",{onKeyDown:D,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(Ep,{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:Hr(N.combo)}),(ae=N.conflict)!=null&&ae.description?r.jsxs("div",{className:"text-sm text-destructive",children:["Reserved: ",N.conflict.description," (cannot bind)"]}):(ce=N.conflict)!=null&&ce.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 ee(),"data-bind-confirm":!0}),r.jsx("input",{type:"hidden",onKeyDown:Q=>{Q.key==="Enter"&&ee()}})]}):$&&L&&S?r.jsxs(r.Fragment,{children:[r.jsx(sR,{label:`${S.action.title} · ${L.label}`,onBack:q,disabled:M,stepCounter:{current:S.stepIndex+1,total:S.action.flow.steps.length}}),L.kind==="text"?r.jsx(oR,{step:L,initialValue:S.values[L.id],disabled:M,onSubmit:X}):r.jsx(iR,{step:L,disabled:M,onSubmit:X}),I?r.jsx("div",{className:"border-t border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:I}):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:M?"Running…":""})]})]}):C?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:v.group}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:v.title})]}),r.jsx("input",{autoFocus:!0,type:"text",value:k,onChange:Q=>w(Q.target.value),onKeyDown:W,placeholder:v.requiresInput.placeholder,disabled:M,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"}),I?r.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:I}):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:M?"Running…":""})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("input",{autoFocus:!0,type:"text",value:m,onChange:Q=>g(Q.target.value),onKeyDown:B,placeholder:"Run an action: new project, new todo, toggle…",disabled:M,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"}),I?r.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:I}):null,r.jsx("div",{ref:Y,className:"max-h-[60vh] overflow-y-auto p-1",children:_.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"}):_.map((Q,ge)=>{const je=ge===x,Ne=Q.action.bindableKind,ke=Ne?a[Ne]:void 0;return r.jsxs("button",{type:"button","data-palette-idx":ge,onClick:()=>U(Q.action),onMouseEnter:()=>y(ge),disabled:M,className:`group flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors disabled:opacity-60 ${je?"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:Q.action.group}),r.jsx("span",{className:"min-w-0 flex-1 truncate",children:Q.action.title}),Q.action.subtitle?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:Q.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:Hr(ke)}):null,Ne?r.jsx("span",{role:"button",tabIndex:-1,"aria-label":"Bind hotkey",onClick:Ve=>{Ve.preventDefault(),Ve.stopPropagation(),A({action:Q.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 ${je?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:r.jsx(Ep,{className:"h-3.5 w-3.5","aria-hidden":"true"})}):null]},Q.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:M?"Running…":`${_.length} action${_.length===1?"":"s"}`})]})]})]})})}const lR=[{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 cR(e){const t=_n(e);return t?lR.find(n=>n.combo===t)??null:null}const ga={"new-workspace":"New Workspace","new-project":"New Project","new-todo":"New Todo","new-assignment":"New Assignment"},uR={global:"Global","list:overview":"Overview","list:projects":"Projects list","list:assignments":"Assignments list","list:todos":"Todos list",assignment:"Assignment detail",project:"Project detail"},dR=["global","list:overview","list:projects","list:assignments","list:todos","project","assignment"];function iv(e){if(e.includes(" ")){const[t,n]=e.split(" ");return`${Hr(t)} then ${Hr(n)}`}return Hr(e)}function fR(){const{cheatsheetOpen:e,closeCheatsheet:t,listBindings:n,customBindings:s,actionEntries:a}=Ks(),l=p.useMemo(()=>{const f=new Set;for(const m of Object.values(s))typeof m=="string"&&m&&f.add(_n(m));return f},[s]),c=p.useMemo(()=>{if(!e)return new Map;const f=n(),m=new Map;for(const g of f){if(l.has(_n(g.keys)))continue;const x=m.get(g.scope)??[];x.push({keys:g.keys,description:g.description}),m.set(g.scope,x)}return m},[e,n,l]),d=p.useMemo(()=>{const f=[];for(const[m,g]of Object.entries(s)){if(!g)continue;const x=a.find(y=>y.bindableKind===m);f.push({kind:m,combo:g,title:x?x.title:m})}return f},[s,a]);return r.jsx(Jr,{open:e,onOpenChange:f=>f?null:t(),children:r.jsxs(Tr,{className:"max-w-2xl",children:[r.jsx(Pr,{children:"Keyboard shortcuts"}),r.jsxs(ps,{children:["Press Esc to close. ",Hr("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:[dR.map(f=>{const m=c.get(f);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:uR[f]}),r.jsx("ul",{className:"space-y-1",children:m.map((g,x)=>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:g.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:iv(g.keys)})]},`${f}-${g.keys}-${x}`))})]},f)}),d.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:d.map(f=>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:f.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:iv(f.combo)})]},`custom-${f.kind}`))})]}):null]})]})})}const Bm={bindings:{},custom:!1};let Ca=null,Xo=null;const Ip=new Set;function $0(e){Ca=e;for(const t of Ip)t(e)}function Um(e){if(!e||typeof e!="object")return Bm;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(!J2(s)||typeof a!="string"||a.trim()==="")continue;const l=_n(a);l&&(n[s]=l)}return{bindings:n,custom:t.custom===!0}}function pR(){return Ca?Promise.resolve(Ca):Xo||(Xo=fetch("/api/config/hotkeys").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=Um(e);return Ca=t,Xo=null,t}).catch(()=>(Xo=null,Bm)),Xo)}function mR(){const[e,t]=p.useState(()=>Ca??Bm);return p.useEffect(()=>{let n=!1;return pR().then(s=>{n||t(s)}),Ip.add(t),()=>{n=!0,Ip.delete(t)}},[]),e}async function av(e){const t={};for(const a of bu){const l=e[a];if(typeof l!="string")continue;const c=_n(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=Um(await n.json());return $0(s),s}async function hR(){const e=await fetch("/api/config/hotkeys",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=Um(await e.json());return $0(t),t}const lv=1500;function gR(e){const t=e.match(/^\/w\/([^/]+)(?:\/|$)/);return t?`/w/${t[1]}`:""}const M0=p.createContext(null);function xR({children:e}){const{toggleTheme:t}=Em(),n=En(),s=Et(),a=gR(n.pathname),l=ji(),c=Ww(),d=Gw(),f=Tm(),m=Xw(),g=p.useMemo(()=>{var _e,Ie,st,lt;const ie=l.data??[],ne=((_e=c.data)==null?void 0:_e.assignments)??[],le=((Ie=d.data)==null?void 0:Ie.playbooks)??[],H=((st=f.data)==null?void 0:st.sessions)??[],ve=(((lt=m.data)==null?void 0:lt.workspaces)??[]).flatMap(_t=>_t.items.map(kt=>({...kt,workspace:_t.workspace})));return dT({projects:ie,assignments:ne,playbooks:le,servers:H,todos:ve,wsPrefix:a})},[l.data,c.data,d.data,f.data,m.data,a]),y=p.useMemo(()=>Ow(n.pathname),[n.pathname]).projectSlug,v=p.useMemo(()=>{var ie;return y?((ie=l.data)==null?void 0:ie.find(ne=>ne.slug===y))??null:null},[l.data,y]),E=(v==null?void 0:v.title)??null,k=(v==null?void 0:v.workspace)??null,w=p.useMemo(()=>{var ie;return mT({playbooks:((ie=d.data)==null?void 0:ie.playbooks)??[],projectSlug:y,currentProjectTitle:E,currentProjectWorkspace:k,wsPrefix:a,refetchPlaybooks:d.refetch,navigate:s,toggleTheme:t})},[d.data,d.refetch,y,E,k,a,s,t]),S=p.useRef(new Map),T=p.useRef(["global"]),N=p.useRef({phase:"idle"}),A=p.useRef(null),M=p.useRef(1),[R,I]=p.useState(!1),[O,Y]=p.useState(!1),[J,_]=p.useState(!1),[U,X]=p.useState(null),{bindings:q}=mR(),G=p.useMemo(()=>nT(q),[q]),B=p.useCallback(ie=>{const ne=M.current++;return S.current.set(ne,{...ie,id:ne}),ne},[]),W=p.useCallback(ie=>{S.current.delete(ie)},[]),D=p.useCallback(ie=>{T.current.push(ie)},[]),ee=p.useCallback(ie=>{const ne=T.current;for(let le=ne.length-1;le>=0;le--)if(ne[le]===ie){ne.splice(le,1);return}},[]),C=p.useCallback(()=>I(!0),[]),$=p.useCallback(()=>I(!1),[]),Z=p.useCallback(()=>Y(!0),[]),L=p.useCallback(()=>Y(!1),[]),ae=p.useCallback(()=>_(!0),[]),ce=p.useCallback(()=>{_(!1),X(null)},[]),Q=p.useCallback(()=>Array.from(S.current.values()),[]),ge=p.useCallback(()=>{let ie=null;return X(ne=>(ie=ne,null)),ie},[]),je=p.useCallback(ie=>{X(ie),_(!0)},[]),Ne=p.useCallback((ie,ne)=>{const le=_n(ie);if(!le)return null;if(eT(le)){const H=cR(le);return{description:(H==null?void 0:H.description)??"Reserved built-in shortcut"}}for(const[H,fe]of Object.entries(G))if(!(ne&&H===ne)&&fe===le)return{kind:H};return null},[G]),ke=p.useCallback(async(ie,ne)=>{const le=_n(ne);if(!le)throw new Error("Empty combo");const H=Ne(le,ie);if(H){const ve=H.description?`Reserved: ${H.description}`:`Already bound to "${H.kind}"`;throw new Error(ve)}const fe={...q,[ie]:le};return await av(fe),le},[q,Ne]),Ve=p.useCallback(async ie=>{if(!q[ie])return;const ne={...q};delete ne[ie],await av(ne)},[q]);p.useEffect(()=>{N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[n.pathname]),p.useEffect(()=>{function ie(ve){if(!(ve instanceof HTMLElement))return!1;const _e=ve.tagName;return!!(_e==="INPUT"||_e==="TEXTAREA"||_e==="SELECT"||ve.isContentEditable||ve.closest('[role="combobox"], [role="textbox"]'))}function ne(){return!!(document.querySelector('[role="dialog"][data-state="open"]')||document.querySelector('[role="alertdialog"][data-state="open"]'))}function le(){const ve=T.current;return ve[ve.length-1]??"global"}function H(ve){return ve.scope==="global"?!0:ve.scope===le()}function fe(ve){const _e=wc(ve,"Mod+k"),Ie=wc(ve,"Mod+Shift+k"),st=ve.key==="Escape",lt=_e||Ie||st;if(ne()&&!lt||ie(ve.target)&&!lt)return;const _t=N.current;if(_t.phase==="awaiting-second")if(Date.now()-_t.startedAt>lv)N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null);else{const se=Array.from(S.current.values());for(const pe of se){if(!H(pe))continue;const Pe=pe.keys.split(" ");if(!(Pe.length!==2||Pe[0]!=="g")&&wc(ve,Pe[1])&&!(pe.when&&!pe.when())){ve.preventDefault(),N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null),pe.handler(ve);return}}N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null)}const kt=Array.from(S.current.values());for(const St of kt){if(!H(St))continue;const se=St.keys.split(" ");if(se.length===1&&wc(ve,se[0])&&!(St.when&&!St.when())){ve.preventDefault(),St.handler(ve);return}}ve.key==="g"&&!ve.metaKey&&!ve.ctrlKey&&!ve.altKey&&!ve.shiftKey&&Array.from(S.current.values()).some(se=>H(se)&&se.keys.startsWith("g "))&&(ve.preventDefault(),N.current={phase:"awaiting-second",startedAt:Date.now()},A.current!==null&&window.clearTimeout(A.current),A.current=window.setTimeout(()=>{N.current={phase:"idle"},A.current=null},lv))}return window.addEventListener("keydown",fe),()=>{window.removeEventListener("keydown",fe),A.current!==null&&(window.clearTimeout(A.current),A.current=null)}},[]),p.useEffect(()=>{const ie=B({keys:"Shift+t",handler:()=>t(),scope:"global",description:"Toggle light/dark theme"});return()=>W(ie)},[B,W,t]),p.useEffect(()=>{const ie=B({keys:"?",scope:"global",description:"Show keyboard shortcuts",handler:()=>Z()});return()=>W(ie)},[B,W,Z]),p.useEffect(()=>{const ie=B({keys:"Mod+k",scope:"global",description:"Open command palette",handler:()=>{if(R){$();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||C()}});return()=>W(ie)},[B,W,C,$,R]),p.useEffect(()=>{const ie=B({keys:"Mod+Shift+k",scope:"global",description:"Open actions palette",handler:()=>{if(J){ce();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||ae()}});return()=>W(ie)},[B,W,ae,ce,J]),p.useEffect(()=>{const ne=[{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(le=>B({keys:`g ${le.suffix}`,scope:"global",description:le.desc,handler:()=>s(Fc(le.basePath,a))}));return()=>ne.forEach(W)},[B,W,s,a]),p.useEffect(()=>{const ie=[];for(const[ne,le]of Object.entries(G)){if(!le)continue;const H=w.find(ve=>ve.bindableKind===ne),fe=H?`Custom: ${H.title}`:`Custom: ${ne}`;ie.push(B({keys:le,scope:"global",description:fe,handler:()=>{X(ne),_(!0)}}))}return()=>ie.forEach(W)},[B,W,G,w]);const Ye=p.useMemo(()=>({register:B,unregister:W,pushScope:D,popScope:ee,openPalette:C,closePalette:$,paletteOpen:R,openCheatsheet:Z,closeCheatsheet:L,cheatsheetOpen:O,openActionsPalette:ae,closeActionsPalette:ce,actionsPaletteOpen:J,listBindings:Q,wsPrefix:a,paletteEntries:g,actionEntries:w,userBindings:q,customBindings:G,bindAction:ke,unbindAction:Ve,findConflict:Ne,openActionsPaletteWithAction:je,pendingActionKind:U,consumePendingActionKind:ge}),[B,W,D,ee,C,$,R,Z,L,O,ae,ce,J,Q,a,g,w,q,G,ke,Ve,Ne,je,U,ge]);return r.jsxs(M0.Provider,{value:Ye,children:[e,r.jsx(rR,{entries:g}),r.jsx(aR,{entries:w}),r.jsx(fR,{})]})}function Ks(){const e=p.useContext(M0);if(!e)throw new Error("useHotkeyContext must be used within HotkeyProvider");return e}function pt({keys:e,handler:t,scope:n="global",description:s,when:a,enabled:l=!0}){const{register:c,unregister:d}=Ks(),f=p.useRef(t),m=p.useRef(a);p.useEffect(()=>{f.current=t,m.current=a},[t,a]),p.useEffect(()=>{if(!l)return;const g=c({keys:e,handler:x=>f.current(x),scope:n,description:s,when:m.current?()=>m.current():void 0});return()=>d(g)},[c,d,e,n,s,l])}function Gs(e){const{pushScope:t,popScope:n}=Ks();p.useEffect(()=>(t(e),()=>n(e)),[t,n,e])}function el(e,t){const[n,s]=p.useState(e.length===0?-1:0),a=En();p.useEffect(()=>{s(e.length===0?-1:0)},[a.pathname]),p.useEffect(()=>{s(c=>e.length===0?-1:Math.min(Math.max(0,c),e.length-1))},[e.length]),p.useEffect(()=>{if(document.querySelectorAll("[data-hotkey-row-index]").forEach(d=>{const f=Number(d.getAttribute("data-hotkey-row-index"));d.setAttribute("data-hotkey-selected",f===n?"true":"false")}),n>=0){const d=document.querySelector(`[data-hotkey-row-index="${n}"]`);d==null||d.scrollIntoView({block:"nearest"})}},[n,e.length]),pt({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))}),pt({keys:"k",scope:t.scope,description:"Select previous row",handler:()=>s(c=>e.length===0?-1:Math.max(0,c<0?0:c-1))}),pt({keys:"Enter",scope:t.scope,description:"Open selected row",handler:()=>{n>=0&&n<e.length&&t.onOpen(e[n],n)}}),pt({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=p.useCallback(c=>({"data-hotkey-row-index":c,"data-hotkey-selected":c===n?"true":"false"}),[n]);return{selectedIndex:n,hotkeyRowProps:l}}function yR({title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:s}){const a=Tt(),{resolvedTheme:l,toggleTheme:c}=Em(),{openPalette:d}=Ks();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(_E,{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((f,m)=>r.jsxs("span",{className:"flex items-center gap-1.5",children:[m>0?r.jsx("span",{children:"/"}):null,r.jsx(we,{to:f.path,className:"hover:text-foreground",children:f.label})]},f.path)),r.jsx("span",{children:"/"})]}):null,r.jsx("h1",{className:"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:d,className:"shell-action","aria-label":"Open command palette",children:[r.jsx(qs,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline font-mono text-xs",children:Hr("Mod+k")})]}),r.jsx(we,{className:"shell-action",to:"/help",children:"Help"}),r.jsxs(we,{className:"shell-action",to:`${a}/create/project`,children:[r.jsx(Ht,{className:"h-4 w-4"}),r.jsx("span",{children:"New Project"})]}),n?r.jsxs(we,{className:"shell-action",to:`${a}/projects/${n}/create/assignment`,children:[r.jsx(Ht,{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(KE,{className:"h-4 w-4"}):r.jsx(FE,{className:"h-4 w-4"}),r.jsx("span",{children:l==="dark"?"Light":"Dark"})]})]})]})})}var vR=Symbol("radix.slottable");function bR(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=vR,t}var _0="AlertDialog",[wR]=yo(_0,[g0]),ms=g0(),F0=e=>{const{__scopeAlertDialog:t,...n}=e,s=ms(t);return r.jsx(D0,{...s,...n,modal:!0})};F0.displayName=_0;var jR="AlertDialogTrigger",kR=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=ms(n);return r.jsx(QP,{...a,...s,ref:t})});kR.displayName=jR;var SR="AlertDialogPortal",z0=e=>{const{__scopeAlertDialog:t,...n}=e,s=ms(t);return r.jsx(I0,{...s,...n})};z0.displayName=SR;var NR="AlertDialogOverlay",B0=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=ms(n);return r.jsx($m,{...a,...s,ref:t})});B0.displayName=NR;var li="AlertDialogContent",[CR,ER]=wR(li),TR=bR("AlertDialogContent"),U0=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:s,...a}=e,l=ms(n),c=p.useRef(null),d=bn(t,c),f=p.useRef(null);return r.jsx(GP,{contentName:li,titleName:H0,docsSlug:"alert-dialog",children:r.jsx(CR,{scope:n,cancelRef:f,children:r.jsxs(Mm,{role:"alertdialog",...l,...a,ref:d,onOpenAutoFocus:Ct(a.onOpenAutoFocus,m=>{var g;m.preventDefault(),(g=f.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[r.jsx(TR,{children:s}),r.jsx(RR,{contentRef:c})]})})})});U0.displayName=li;var H0="AlertDialogTitle",W0=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=ms(n);return r.jsx(_m,{...a,...s,ref:t})});W0.displayName=H0;var V0="AlertDialogDescription",q0=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=ms(n);return r.jsx(Fm,{...a,...s,ref:t})});q0.displayName=V0;var PR="AlertDialogAction",K0=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=ms(n);return r.jsx(O0,{...a,...s,ref:t})});K0.displayName=PR;var G0="AlertDialogCancel",Y0=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:a}=ER(G0,n),l=ms(n),c=bn(t,a);return r.jsx(O0,{...l,...s,ref:c})});Y0.displayName=G0;var RR=({contentRef:e})=>{const t=`\`${li}\` requires a description for the component to be accessible for screen reader users.
470
-
471
- You can add a description to the \`${li}\` by passing a \`${V0}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
472
-
473
- 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 \`${li}\`. 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.
474
-
475
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},AR=F0,DR=z0,X0=B0,J0=U0,Q0=K0,Z0=Y0,ej=W0,tj=q0;const nj=AR,IR=DR,rj=p.forwardRef(({className:e,...t},n)=>r.jsx(X0,{ref:n,className:ze("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));rj.displayName=X0.displayName;const Hm=p.forwardRef(({className:e,...t},n)=>r.jsxs(IR,{children:[r.jsx(rj,{}),r.jsx(J0,{ref:n,className:ze("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})]}));Hm.displayName=J0.displayName;function sj({className:e,...t}){return r.jsx("div",{className:ze("flex flex-col space-y-2 text-left",e),...t})}function oj({className:e,...t}){return r.jsx("div",{className:ze("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const Wm=p.forwardRef(({className:e,...t},n)=>r.jsx(ej,{ref:n,className:ze("text-lg font-semibold tracking-tight text-foreground",e),...t}));Wm.displayName=ej.displayName;const Vm=p.forwardRef(({className:e,...t},n)=>r.jsx(tj,{ref:n,className:ze("text-sm leading-6 text-muted-foreground",e),...t}));Vm.displayName=tj.displayName;const Qc=p.forwardRef(({className:e,...t},n)=>r.jsx(Q0,{ref:n,className:ze(e),...t}));Qc.displayName=Q0.displayName;const qm=p.forwardRef(({className:e,...t},n)=>r.jsx(Z0,{ref:n,className:ze(e),...t}));qm.displayName=Z0.displayName;const OR=[{to:"/",label:"Overview",icon:ww},{to:"/playbooks",label:"Playbooks",icon:vw},{to:"/memories",label:"Memories",icon:wE},{to:"/resources",label:"Resources",icon:OE},{to:"/inventories",label:"Inventories",icon:pm},{to:"/todos",label:"Todos",icon:cr}],LR=[{suffix:"/projects",label:"Projects",icon:kw},{suffix:"/assignments",label:"Assignments",icon:ME},{suffix:"/servers",label:"Servers",icon:bm},{suffix:"/inventories",label:"Inventories",icon:pm},{suffix:"/agent-sessions",label:"Agent Sessions",icon:fm},{suffix:"/todos",label:"Todos",icon:cr}],$R=[{to:"/help",label:"Help",icon:LE},{to:"/settings",label:"Settings",icon:VE}],cv="syntaur.dashboard.sourceFirstNoticeDismissed";function MR({title:e,breadcrumbs:t,projectSlug:n,workspace:s,children:a}){const[l,c]=p.useState(!1);pt({keys:"Escape",scope:"global",description:"Close mobile navigation",enabled:l,handler:()=>c(!1)});const[d,f]=p.useState(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(cv)==="1"}catch{return!1}});function m(){if(f(!0),!(typeof window>"u"))try{window.localStorage.setItem(cv,"1")}catch{}}return 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(uv,{sourceNoticeDismissed:d,onDismissSourceNotice:m,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(we,{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(km,{className:"h-4 w-4"})})]}),r.jsx(uv,{sourceNoticeDismissed:d,onDismissSourceNotice:m,activeWorkspace:s,onNavigate:()=>c(!1)})]})}):null,r.jsxs("div",{className:"min-w-0",children:[r.jsx(yR,{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 uv({sourceNoticeDismissed:e,onDismissSourceNotice:t,activeWorkspace:n,onNavigate:s}){const{data:a}=vu(),l=(a==null?void 0:a.workspaces)??[],c=(a==null?void 0:a.hasUngrouped)??!1,d=En(),[f,m]=p.useState(new Set),[g,x]=p.useState(!1),[y,v]=p.useState(""),[E,k]=p.useState(null),[w,S]=p.useState(null),[T,N]=p.useState(null),[A,M]=p.useState(!1),R=Et();function I(_){m(U=>{const X=new Set(U);return X.has(_)?X.delete(_):X.add(_),X})}const O=[...l,...c?["_ungrouped"]:[]];async function Y(_){if(w){M(!0);try{const U=`/api/workspaces/${encodeURIComponent(w)}${_?"?cascade=true":""}`,X=await fetch(U,{method:"DELETE"});if(X.status===409){const q=await X.json().catch(()=>({}));N((q==null?void 0:q.blockedBy)??{projects:[],standalones:[]});return}if(!X.ok){const q=await X.json().catch(()=>({}));throw new Error(q.error||"Failed to delete workspace")}S(null),N(null)}catch(U){console.error(U),alert(U instanceof Error?U.message:"Failed to delete workspace")}finally{M(!1)}}}async function J(_,U){try{if(_.type==="project"){const X=await fetch(`/api/projects/${encodeURIComponent(_.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:U})});if(!X.ok){const q=await X.json().catch(()=>({}));throw new Error(q.error||"Failed to move project")}return}if(_.type==="standalone-assignment"){const X=await fetch(`/api/assignments/${encodeURIComponent(_.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:U})});if(!X.ok){const q=await X.json().catch(()=>({}));throw new Error(q.error||"Failed to move assignment")}return}if(_.type==="project-assignment"){alert("Assignments inherit workspace from their project — drag the project (or move it) to change workspaces.");return}}catch(X){console.error(X),alert(X instanceof Error?X.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(we,{to:"/",className:"inline-flex items-center gap-3",onClick:s,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(Hy,{items:OR,onNavigate:s}),r.jsx("div",{className:"border-t border-border/40"}),r.jsxs("div",{className:"flex-1 space-y-1 overflow-y-auto",children:[O.length===0&&!g&&r.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground/60",children:"No workspaces yet"}),O.map(_=>{const U=_==="_ungrouped",X=U?"Ungrouped":pn(_),q=U?"/w/_ungrouped":`/w/${_}`,G=f.has(_),B=n===_||n===null&&U&&d.pathname.startsWith("/w/_ungrouped"),W=E===_;return r.jsxs("div",{className:`rounded-md transition ${W?"bg-accent/40 ring-1 ring-ring/40":""}`,onDragOver:D=>{D.dataTransfer.types.includes("application/json")&&(D.preventDefault(),D.dataTransfer.dropEffect="move",k(_))},onDragLeave:D=>{D.currentTarget.contains(D.relatedTarget)||k(ee=>ee===_?null:ee)},onDrop:async D=>{try{const ee=D.dataTransfer.getData("application/json");if(!ee)return;D.preventDefault();let C;try{C=JSON.parse(ee)}catch{return}if(!(C!=null&&C.type)||!(C!=null&&C.id))return;await J(C,U?null:_)}finally{k(null)}},children:[r.jsxs("div",{className:"group flex items-center",children:[r.jsxs("button",{type:"button",onClick:()=>I(_),className:`flex flex-1 items-center gap-2 rounded-md px-3 py-1.5 text-xs font-semibold uppercase tracking-wider transition ${B?"text-foreground":"text-muted-foreground/70 hover:text-muted-foreground"}`,children:[r.jsx(_a,{className:`h-3 w-3 transition-transform ${G?"-rotate-90":""}`}),X]}),U?null:r.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),S(_),N(null)},title:`Delete workspace "${_}"`,"aria-label":`Delete workspace "${_}"`,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(zn,{className:"h-3 w-3"})})]}),!G&&r.jsx("nav",{className:"ml-2 space-y-0.5",children:LR.map(D=>{const ee=`${q}${D.suffix}`,C=Iw(d.pathname,D.suffix)&&d.pathname.startsWith(q),$=D.icon;return r.jsxs(we,{to:ee,onClick:s,className:`flex items-center gap-3 rounded-md px-3 py-1.5 text-sm font-medium transition ${C?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-background/80 hover:text-foreground"}`,children:[r.jsx($,{className:"h-4 w-4"}),r.jsx("span",{children:D.label})]},ee)})})]},_)}),g?r.jsx("form",{className:"px-3 py-1.5",onSubmit:_=>{_.preventDefault();const U=y.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");U&&(x(!1),v(""),fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:U})}).then(()=>{s==null||s(),R(`/w/${U}/projects`)}))},children:r.jsx("input",{autoFocus:!0,type:"text",value:y,onChange:_=>v(_.target.value),onKeyDown:_=>{_.key==="Escape"&&(x(!1),v(""))},onBlur:()=>{y.trim()||(x(!1),v(""))},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:()=>x(!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(Ht,{className:"h-3 w-3"}),"New Workspace"]})]}),r.jsx("div",{className:"border-t border-border/40"}),r.jsx(Hy,{items:$R,onNavigate:s}),e?null:r.jsx("div",{className:"chrome-card",children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Source-first dashboard"}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:"Project and assignment markdown files stay authoritative. Derived files are read-only projections."})]}),r.jsx("button",{type:"button",onClick:t,className:"inline-flex h-7 w-7 items-center justify-center rounded-md border border-border/70 bg-background/80 text-muted-foreground transition hover:text-foreground","aria-label":"Dismiss source-first dashboard notice",children:r.jsx(km,{className:"h-4 w-4"})})]})}),r.jsx(nj,{open:w!==null,onOpenChange:_=>{A||_||(S(null),N(null))},children:r.jsxs(Hm,{children:[r.jsxs(sj,{children:[r.jsx(Wm,{children:T?"Workspace has references":"Delete workspace?"}),r.jsx(Vm,{children:T?r.jsxs(r.Fragment,{children:["The workspace ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:w})," 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:w})," from the registry. This does not affect projects or standalones unless you choose to cascade."]})})]}),T?r.jsxs("div",{className:"space-y-2 text-sm",children:[T.projects.length>0?r.jsxs("div",{children:[r.jsxs("p",{className:"font-medium text-foreground",children:["Projects (",T.projects.length,")"]}),r.jsx("ul",{className:"mt-1 list-disc pl-5 text-muted-foreground",children:T.projects.map(_=>r.jsx("li",{children:r.jsx(we,{to:`/projects/${_}`,className:"hover:underline",children:_})},_))})]}):null,T.standalones.length>0?r.jsxs("div",{children:[r.jsxs("p",{className:"font-medium text-foreground",children:["Standalones (",T.standalones.length,")"]}),r.jsx("ul",{className:"mt-1 list-disc pl-5 text-muted-foreground",children:T.standalones.map(_=>r.jsx("li",{children:r.jsx(we,{to:`/assignments/${_}`,className:"hover:underline",children:_})},_))})]}):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(oj,{children:[r.jsx(qm,{disabled:A,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),T?r.jsx(Qc,{disabled:A,onClick:_=>{_.preventDefault(),Y(!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:A?"Working…":"Clear references and delete"}):r.jsx(Qc,{disabled:A,onClick:_=>{_.preventDefault(),Y(!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:A?"Working…":"Delete"})]})]})})]})}function _R(){const e=En(),{workspace:t}=jt(),{title:n,breadcrumbs:s,projectSlug:a}=Ow(e.pathname);return r.jsx(MR,{title:n,breadcrumbs:s,projectSlug:a,workspace:t??null,children:r.jsx(IC,{})})}function at({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 et({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 Hc({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 Le({title:e,description:t,children:n,className:s,actions:a}){return r.jsxs("section",{className:ze("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 FR({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(Le,{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(we,{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(Hc,{command:s.command.command,example:s.command.example}):null]})]})},s.title))})})}const qf={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."},zR={readyForReview:"No assignments waiting for your review.",readyToImplement:"No plans queued for implementation.",readyForPlanning:"No assignments waiting to be planned.",inProgress:"Nothing actively in progress.",drafts:"No drafts — ideas captured here will live until they’re shaped.",blocked:"Nothing is blocked. Good.",newestCreated:"No assignments created recently.",stale:"No stale work — everything is fresh."},Wc={readyForReview:"Ready for Review",readyToImplement:"Ready to Implement",readyForPlanning:"Ready for Planning",inProgress:"In Progress",drafts:"Drafts",blocked:"Blocked",newestCreated:"Newest Created",stale:"Stale"},Cn={claimAsTitle:"Claim assignments as",claimAsHint:"Used when you claim an assignment from this dashboard. You can change it later.",claimAsSubmit:"Save",quickCommentTitle:"Add a quick note",quickCommentPlaceholder:"Note…",quickCommentSubmit:"Post",bulkArchiveLabel:"Archive selected",bulkClearLabel:"Clear",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 BR(e,t){return e.replace(/\{(\w+)\}/g,(n,s)=>String(t[s]??`{${s}}`))}function UR({hero:e,itemsById:t}){const n=Tt();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:Cn.emptyStateCleanTitle}),r.jsx("h2",{id:"overview-hero-title",className:"mt-2 text-2xl font-semibold tracking-tight text-foreground",children:qf.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(we,{to:`${n}/projects`,className:"shell-action bg-foreground text-background hover:opacity-90",children:Cn.emptyStateCleanCTA})})]});const s=e.itemId?t[e.itemId]:void 0,a=(s==null?void 0:s.assignmentTitle)??"",l=qf[e.copyKey]??qf[e.kind],c=BR(l,{total:e.total,title:a}),d=s?HR(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(we,{to:d,className:"shell-action bg-foreground text-background hover:opacity-90",children:["Open ",a||"assignment"]})})]})}function HR(e,t){return e.projectSlug?`${t}${e.href}`:e.href}const Sa="border-status-pending-foreground/30 bg-status-pending text-status-pending-foreground",Kf="border-status-in-progress-foreground/30 bg-status-in-progress text-status-in-progress-foreground",WR="border-status-blocked-foreground/30 bg-status-blocked text-status-blocked-foreground",VR="border-status-review-foreground/30 bg-status-review text-status-review-foreground",qR="border-status-completed-foreground/30 bg-status-completed text-status-completed-foreground",KR="border-status-failed-foreground/30 bg-status-failed text-status-failed-foreground",GR="border-status-archived-foreground/30 bg-status-archived text-status-archived-foreground",Zc={draft:{label:"Draft",description:"Just-created stub; not yet shaped.",className:Sa,icon:bi},pending:{label:"Pending",description:"Waiting to start or waiting on dependencies.",className:Sa,icon:NE},ready_for_planning:{label:"Ready for Planning",description:"Objective and acceptance criteria written; awaiting a plan.",className:Sa,icon:ww},ready_to_implement:{label:"Ready to Implement",description:"Plan written and approved; ready to start coding.",className:Kf,icon:zE},in_progress:{label:"In Progress",description:"Actively being worked on.",className:Kf,icon:vm},blocked:{label:"Blocked",description:"Blocked by an explicit obstacle that needs intervention.",className:WR,icon:Np},review:{label:"Review",description:"Ready for inspection or approval.",className:VR,icon:UE},completed:{label:"Completed",description:"Finished successfully.",className:qR,icon:mm},failed:{label:"Failed",description:"Could not be completed as planned.",className:KR,icon:Np},active:{label:"Active",description:"The project has active or review work in flight.",className:Kf,icon:Cp},stopped:{label:"Stopped",description:"Session ended without completing.",className:Sa,icon:kE},archived:{label:"Archived",description:"Archived by a human override.",className:GR,icon:Cp}};function wn({status:e,className:t,showIcon:n=!0,progress:s}){const a=Zc[e]??{label:e.replace(/_/g," ").replace(/\b\w/g,g=>g.toUpperCase()),description:`Status: ${e}`,className:Sa,icon:Cp},l=a.icon,c=s&&s.total>0,d=c?Math.min(1,Math.max(0,s.checked/s.total)):0,f=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-d)})]}),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:f,className:ze("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)]",a.className,t),children:[m,r.jsx("span",{children:a.label})]})}function ij(e){var t;return((t=Zc[e])==null?void 0:t.description)??`Status: ${e}`}const YR=["top","right","bottom","left"],Ws=Math.min,Jn=Math.max,eu=Math.round,Ec=Math.floor,Wr=e=>({x:e,y:e}),XR={left:"right",right:"left",bottom:"top",top:"bottom"};function Op(e,t,n){return Jn(e,Ws(t,n))}function ds(e,t){return typeof e=="function"?e(t):e}function fs(e){return e.split("-")[0]}function ki(e){return e.split("-")[1]}function Km(e){return e==="x"?"y":"x"}function Gm(e){return e==="y"?"height":"width"}function Fr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ym(e){return Km(Fr(e))}function JR(e,t,n){n===void 0&&(n=!1);const s=ki(e),a=Ym(e),l=Gm(a);let c=a==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=tu(c)),[c,tu(c)]}function QR(e){const t=tu(e);return[Lp(e),t,Lp(t)]}function Lp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const dv=["left","right"],fv=["right","left"],ZR=["top","bottom"],eA=["bottom","top"];function tA(e,t,n){switch(e){case"top":case"bottom":return n?t?fv:dv:t?dv:fv;case"left":case"right":return t?ZR:eA;default:return[]}}function nA(e,t,n,s){const a=ki(e);let l=tA(fs(e),n==="start",s);return a&&(l=l.map(c=>c+"-"+a),t&&(l=l.concat(l.map(Lp)))),l}function tu(e){const t=fs(e);return XR[t]+e.slice(t.length)}function rA(e){return{top:0,right:0,bottom:0,left:0,...e}}function aj(e){return typeof e!="number"?rA(e):{top:e,right:e,bottom:e,left:e}}function nu(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 pv(e,t,n){let{reference:s,floating:a}=e;const l=Fr(t),c=Ym(t),d=Gm(c),f=fs(t),m=l==="y",g=s.x+s.width/2-a.width/2,x=s.y+s.height/2-a.height/2,y=s[d]/2-a[d]/2;let v;switch(f){case"top":v={x:g,y:s.y-a.height};break;case"bottom":v={x:g,y:s.y+s.height};break;case"right":v={x:s.x+s.width,y:x};break;case"left":v={x:s.x-a.width,y:x};break;default:v={x:s.x,y:s.y}}switch(ki(t)){case"start":v[c]-=y*(n&&m?-1:1);break;case"end":v[c]+=y*(n&&m?-1:1);break}return v}async function sA(e,t){var n;t===void 0&&(t={});const{x:s,y:a,platform:l,rects:c,elements:d,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:x="floating",altBoundary:y=!1,padding:v=0}=ds(t,e),E=aj(v),w=d[y?x==="floating"?"reference":"floating":x],S=nu(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(d.floating)),boundary:m,rootBoundary:g,strategy:f})),T=x==="floating"?{x:s,y:a,width:c.floating.width,height:c.floating.height}:c.reference,N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),A=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},M=nu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:N,strategy:f}):T);return{top:(S.top-M.top+E.top)/A.y,bottom:(M.bottom-S.bottom+E.bottom)/A.y,left:(S.left-M.left+E.left)/A.x,right:(M.right-S.right+E.right)/A.x}}const oA=50,iA=async(e,t,n)=>{const{placement:s="bottom",strategy:a="absolute",middleware:l=[],platform:c}=n,d=c.detectOverflow?c:{...c,detectOverflow:sA},f=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:g,y:x}=pv(m,s,f),y=s,v=0;const E={};for(let k=0;k<l.length;k++){const w=l[k];if(!w)continue;const{name:S,fn:T}=w,{x:N,y:A,data:M,reset:R}=await T({x:g,y:x,initialPlacement:s,placement:y,strategy:a,middlewareData:E,rects:m,platform:d,elements:{reference:e,floating:t}});g=N??g,x=A??x,E[S]={...E[S],...M},R&&v<oA&&(v++,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:g,y:x}=pv(m,y,f)),k=-1)}return{x:g,y:x,placement:y,strategy:a,middlewareData:E}},aA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:a,rects:l,platform:c,elements:d,middlewareData:f}=t,{element:m,padding:g=0}=ds(e,t)||{};if(m==null)return{};const x=aj(g),y={x:n,y:s},v=Ym(a),E=Gm(v),k=await c.getDimensions(m),w=v==="y",S=w?"top":"left",T=w?"bottom":"right",N=w?"clientHeight":"clientWidth",A=l.reference[E]+l.reference[v]-y[v]-l.floating[E],M=y[v]-l.reference[v],R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let I=R?R[N]:0;(!I||!await(c.isElement==null?void 0:c.isElement(R)))&&(I=d.floating[N]||l.floating[E]);const O=A/2-M/2,Y=I/2-k[E]/2-1,J=Ws(x[S],Y),_=Ws(x[T],Y),U=J,X=I-k[E]-_,q=I/2-k[E]/2+O,G=Op(U,q,X),B=!f.arrow&&ki(a)!=null&&q!==G&&l.reference[E]/2-(q<U?J:_)-k[E]/2<0,W=B?q<U?q-U:q-X:0;return{[v]:y[v]+W,data:{[v]:G,centerOffset:q-G-W,...B&&{alignmentOffset:W}},reset:B}}}),lA=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:d,platform:f,elements:m}=t,{mainAxis:g=!0,crossAxis:x=!0,fallbackPlacements:y,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:k=!0,...w}=ds(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const S=fs(a),T=Fr(d),N=fs(d)===d,A=await(f.isRTL==null?void 0:f.isRTL(m.floating)),M=y||(N||!k?[tu(d)]:QR(d)),R=E!=="none";!y&&R&&M.push(...nA(d,k,E,A));const I=[d,...M],O=await f.detectOverflow(t,w),Y=[];let J=((s=l.flip)==null?void 0:s.overflows)||[];if(g&&Y.push(O[S]),x){const q=JR(a,c,A);Y.push(O[q[0]],O[q[1]])}if(J=[...J,{placement:a,overflows:Y}],!Y.every(q=>q<=0)){var _,U;const q=(((_=l.flip)==null?void 0:_.index)||0)+1,G=I[q];if(G&&(!(x==="alignment"?T!==Fr(G):!1)||J.every(D=>Fr(D.placement)===T?D.overflows[0]>0:!0)))return{data:{index:q,overflows:J},reset:{placement:G}};let B=(U=J.filter(W=>W.overflows[0]<=0).sort((W,D)=>W.overflows[1]-D.overflows[1])[0])==null?void 0:U.placement;if(!B)switch(v){case"bestFit":{var X;const W=(X=J.filter(D=>{if(R){const ee=Fr(D.placement);return ee===T||ee==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(ee=>ee>0).reduce((ee,C)=>ee+C,0)]).sort((D,ee)=>D[1]-ee[1])[0])==null?void 0:X[0];W&&(B=W);break}case"initialPlacement":B=d;break}if(a!==B)return{reset:{placement:B}}}return{}}}};function mv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hv(e){return YR.some(t=>e[t]>=0)}const cA=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"}),d=mv(c,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:hv(d)}}}case"escaped":{const c=await s.detectOverflow(t,{...l,altBoundary:!0}),d=mv(c,n.floating);return{data:{escapedOffsets:d,escaped:hv(d)}}}default:return{}}}}},lj=new Set(["left","top"]);async function uA(e,t){const{placement:n,platform:s,elements:a}=e,l=await(s.isRTL==null?void 0:s.isRTL(a.floating)),c=fs(n),d=ki(n),f=Fr(n)==="y",m=lj.has(c)?-1:1,g=l&&f?-1:1,x=ds(t,e);let{mainAxis:y,crossAxis:v,alignmentAxis:E}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return d&&typeof E=="number"&&(v=d==="end"?E*-1:E),f?{x:v*g,y:y*m}:{x:y*m,y:v*g}}const dA=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:d}=t,f=await uA(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:a+f.x,y:l+f.y,data:{...f,placement:c}}}}},fA=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:d=!1,limiter:f={fn:S=>{let{x:T,y:N}=S;return{x:T,y:N}}},...m}=ds(e,t),g={x:n,y:s},x=await l.detectOverflow(t,m),y=Fr(fs(a)),v=Km(y);let E=g[v],k=g[y];if(c){const S=v==="y"?"top":"left",T=v==="y"?"bottom":"right",N=E+x[S],A=E-x[T];E=Op(N,E,A)}if(d){const S=y==="y"?"top":"left",T=y==="y"?"bottom":"right",N=k+x[S],A=k-x[T];k=Op(N,k,A)}const w=f.fn({...t,[v]:E,[y]:k});return{...w,data:{x:w.x-n,y:w.y-s,enabled:{[v]:c,[y]:d}}}}}},pA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:a,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:m=!0}=ds(e,t),g={x:n,y:s},x=Fr(a),y=Km(x);let v=g[y],E=g[x];const k=ds(d,t),w=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:0,crossAxis:0,...k};if(f){const N=y==="y"?"height":"width",A=l.reference[y]-l.floating[N]+w.mainAxis,M=l.reference[y]+l.reference[N]-w.mainAxis;v<A?v=A:v>M&&(v=M)}if(m){var S,T;const N=y==="y"?"width":"height",A=lj.has(fs(a)),M=l.reference[x]-l.floating[N]+(A&&((S=c.offset)==null?void 0:S[x])||0)+(A?0:w.crossAxis),R=l.reference[x]+l.reference[N]+(A?0:((T=c.offset)==null?void 0:T[x])||0)-(A?w.crossAxis:0);E<M?E=M:E>R&&(E=R)}return{[y]:v,[x]:E}}}},mA=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:d}=t,{apply:f=()=>{},...m}=ds(e,t),g=await c.detectOverflow(t,m),x=fs(a),y=ki(a),v=Fr(a)==="y",{width:E,height:k}=l.floating;let w,S;x==="top"||x==="bottom"?(w=x,S=y===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(S=x,w=y==="end"?"top":"bottom");const T=k-g.top-g.bottom,N=E-g.left-g.right,A=Ws(k-g[w],T),M=Ws(E-g[S],N),R=!t.middlewareData.shift;let I=A,O=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(I=T),R&&!y){const J=Jn(g.left,0),_=Jn(g.right,0),U=Jn(g.top,0),X=Jn(g.bottom,0);v?O=E-2*(J!==0||_!==0?J+_:Jn(g.left,g.right)):I=k-2*(U!==0||X!==0?U+X:Jn(g.top,g.bottom))}await f({...t,availableWidth:O,availableHeight:I});const Y=await c.getDimensions(d.floating);return E!==Y.width||k!==Y.height?{reset:{rects:!0}}:{}}}};function Nu(){return typeof window<"u"}function Si(e){return cj(e)?(e.nodeName||"").toLowerCase():"#document"}function Zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qr(e){var t;return(t=(cj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function cj(e){return Nu()?e instanceof Node||e instanceof Zn(e).Node:!1}function kr(e){return Nu()?e instanceof Element||e instanceof Zn(e).Element:!1}function hs(e){return Nu()?e instanceof HTMLElement||e instanceof Zn(e).HTMLElement:!1}function gv(e){return!Nu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zn(e).ShadowRoot}function tl(e){const{overflow:t,overflowX:n,overflowY:s,display:a}=Sr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&a!=="inline"&&a!=="contents"}function hA(e){return/^(table|td|th)$/.test(Si(e))}function Cu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const gA=/transform|translate|scale|rotate|perspective|filter/,xA=/paint|layout|strict|content/,co=e=>!!e&&e!=="none";let Gf;function Xm(e){const t=kr(e)?Sr(e):e;return co(t.transform)||co(t.translate)||co(t.scale)||co(t.rotate)||co(t.perspective)||!Jm()&&(co(t.backdropFilter)||co(t.filter))||gA.test(t.willChange||"")||xA.test(t.contain||"")}function yA(e){let t=Vs(e);for(;hs(t)&&!mi(t);){if(Xm(t))return t;if(Cu(t))return null;t=Vs(t)}return null}function Jm(){return Gf==null&&(Gf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Gf}function mi(e){return/^(html|body|#document)$/.test(Si(e))}function Sr(e){return Zn(e).getComputedStyle(e)}function Eu(e){return kr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vs(e){if(Si(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gv(e)&&e.host||Qr(e);return gv(t)?t.host:t}function uj(e){const t=Vs(e);return mi(t)?e.ownerDocument?e.ownerDocument.body:e.body:hs(t)&&tl(t)?t:uj(t)}function Ua(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=uj(e),l=a===((s=e.ownerDocument)==null?void 0:s.body),c=Zn(a);if(l){const d=$p(c);return t.concat(c,c.visualViewport||[],tl(a)?a:[],d&&n?Ua(d):[])}else return t.concat(a,Ua(a,[],n))}function $p(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dj(e){const t=Sr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const a=hs(e),l=a?e.offsetWidth:n,c=a?e.offsetHeight:s,d=eu(n)!==l||eu(s)!==c;return d&&(n=l,s=c),{width:n,height:s,$:d}}function Qm(e){return kr(e)?e:e.contextElement}function ci(e){const t=Qm(e);if(!hs(t))return Wr(1);const n=t.getBoundingClientRect(),{width:s,height:a,$:l}=dj(t);let c=(l?eu(n.width):n.width)/s,d=(l?eu(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const vA=Wr(0);function fj(e){const t=Zn(e);return!Jm()||!t.visualViewport?vA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bA(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zn(e)?!1:t}function go(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),l=Qm(e);let c=Wr(1);t&&(s?kr(s)&&(c=ci(s)):c=ci(e));const d=bA(l,n,s)?fj(l):Wr(0);let f=(a.left+d.x)/c.x,m=(a.top+d.y)/c.y,g=a.width/c.x,x=a.height/c.y;if(l){const y=Zn(l),v=s&&kr(s)?Zn(s):s;let E=y,k=$p(E);for(;k&&s&&v!==E;){const w=ci(k),S=k.getBoundingClientRect(),T=Sr(k),N=S.left+(k.clientLeft+parseFloat(T.paddingLeft))*w.x,A=S.top+(k.clientTop+parseFloat(T.paddingTop))*w.y;f*=w.x,m*=w.y,g*=w.x,x*=w.y,f+=N,m+=A,E=Zn(k),k=$p(E)}}return nu({width:g,height:x,x:f,y:m})}function Tu(e,t){const n=Eu(e).scrollLeft;return t?t.left+n:go(Qr(e)).left+n}function pj(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-Tu(e,n),a=n.top+t.scrollTop;return{x:s,y:a}}function wA(e){let{elements:t,rect:n,offsetParent:s,strategy:a}=e;const l=a==="fixed",c=Qr(s),d=t?Cu(t.floating):!1;if(s===c||d&&l)return n;let f={scrollLeft:0,scrollTop:0},m=Wr(1);const g=Wr(0),x=hs(s);if((x||!x&&!l)&&((Si(s)!=="body"||tl(c))&&(f=Eu(s)),x)){const v=go(s);m=ci(s),g.x=v.x+s.clientLeft,g.y=v.y+s.clientTop}const y=c&&!x&&!l?pj(c,f):Wr(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+g.x+y.x,y:n.y*m.y-f.scrollTop*m.y+g.y+y.y}}function jA(e){return Array.from(e.getClientRects())}function kA(e){const t=Qr(e),n=Eu(e),s=e.ownerDocument.body,a=Jn(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),l=Jn(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let c=-n.scrollLeft+Tu(e);const d=-n.scrollTop;return Sr(s).direction==="rtl"&&(c+=Jn(t.clientWidth,s.clientWidth)-a),{width:a,height:l,x:c,y:d}}const xv=25;function SA(e,t){const n=Zn(e),s=Qr(e),a=n.visualViewport;let l=s.clientWidth,c=s.clientHeight,d=0,f=0;if(a){l=a.width,c=a.height;const g=Jm();(!g||g&&t==="fixed")&&(d=a.offsetLeft,f=a.offsetTop)}const m=Tu(s);if(m<=0){const g=s.ownerDocument,x=g.body,y=getComputedStyle(x),v=g.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,E=Math.abs(s.clientWidth-x.clientWidth-v);E<=xv&&(l-=E)}else m<=xv&&(l+=m);return{width:l,height:c,x:d,y:f}}function NA(e,t){const n=go(e,!0,t==="fixed"),s=n.top+e.clientTop,a=n.left+e.clientLeft,l=hs(e)?ci(e):Wr(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,f=a*l.x,m=s*l.y;return{width:c,height:d,x:f,y:m}}function yv(e,t,n){let s;if(t==="viewport")s=SA(e,n);else if(t==="document")s=kA(Qr(e));else if(kr(t))s=NA(t,n);else{const a=fj(e);s={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return nu(s)}function mj(e,t){const n=Vs(e);return n===t||!kr(n)||mi(n)?!1:Sr(n).position==="fixed"||mj(n,t)}function CA(e,t){const n=t.get(e);if(n)return n;let s=Ua(e,[],!1).filter(d=>kr(d)&&Si(d)!=="body"),a=null;const l=Sr(e).position==="fixed";let c=l?Vs(e):e;for(;kr(c)&&!mi(c);){const d=Sr(c),f=Xm(c);!f&&d.position==="fixed"&&(a=null),(l?!f&&!a:!f&&d.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||tl(c)&&!f&&mj(e,c))?s=s.filter(g=>g!==c):a=d,c=Vs(c)}return t.set(e,s),s}function EA(e){let{element:t,boundary:n,rootBoundary:s,strategy:a}=e;const c=[...n==="clippingAncestors"?Cu(t)?[]:CA(t,this._c):[].concat(n),s],d=yv(t,c[0],a);let f=d.top,m=d.right,g=d.bottom,x=d.left;for(let y=1;y<c.length;y++){const v=yv(t,c[y],a);f=Jn(v.top,f),m=Ws(v.right,m),g=Ws(v.bottom,g),x=Jn(v.left,x)}return{width:m-x,height:g-f,x,y:f}}function TA(e){const{width:t,height:n}=dj(e);return{width:t,height:n}}function PA(e,t,n){const s=hs(t),a=Qr(t),l=n==="fixed",c=go(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=Wr(0);function m(){f.x=Tu(a)}if(s||!s&&!l)if((Si(t)!=="body"||tl(a))&&(d=Eu(t)),s){const v=go(t,!0,l,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else a&&m();l&&!s&&a&&m();const g=a&&!s&&!l?pj(a,d):Wr(0),x=c.left+d.scrollLeft-f.x-g.x,y=c.top+d.scrollTop-f.y-g.y;return{x,y,width:c.width,height:c.height}}function Yf(e){return Sr(e).position==="static"}function vv(e,t){if(!hs(e)||Sr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qr(e)===n&&(n=n.ownerDocument.body),n}function hj(e,t){const n=Zn(e);if(Cu(e))return n;if(!hs(e)){let a=Vs(e);for(;a&&!mi(a);){if(kr(a)&&!Yf(a))return a;a=Vs(a)}return n}let s=vv(e,t);for(;s&&hA(s)&&Yf(s);)s=vv(s,t);return s&&mi(s)&&Yf(s)&&!Xm(s)?n:s||yA(e)||n}const RA=async function(e){const t=this.getOffsetParent||hj,n=this.getDimensions,s=await n(e.floating);return{reference:PA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function AA(e){return Sr(e).direction==="rtl"}const DA={convertOffsetParentRelativeRectToViewportRelativeRect:wA,getDocumentElement:Qr,getClippingRect:EA,getOffsetParent:hj,getElementRects:RA,getClientRects:jA,getDimensions:TA,getScale:ci,isElement:kr,isRTL:AA};function gj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function IA(e,t){let n=null,s;const a=Qr(e);function l(){var d;clearTimeout(s),(d=n)==null||d.disconnect(),n=null}function c(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),l();const m=e.getBoundingClientRect(),{left:g,top:x,width:y,height:v}=m;if(d||t(),!y||!v)return;const E=Ec(x),k=Ec(a.clientWidth-(g+y)),w=Ec(a.clientHeight-(x+v)),S=Ec(g),N={rootMargin:-E+"px "+-k+"px "+-w+"px "+-S+"px",threshold:Jn(0,Ws(1,f))||1};let A=!0;function M(R){const I=R[0].intersectionRatio;if(I!==f){if(!A)return c();I?c(!1,I):s=setTimeout(()=>{c(!1,1e-7)},1e3)}I===1&&!gj(m,e.getBoundingClientRect())&&c(),A=!1}try{n=new IntersectionObserver(M,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(M,N)}n.observe(e)}return c(!0),l}function OA(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=s,m=Qm(e),g=a||l?[...m?Ua(m):[],...t?Ua(t):[]]:[];g.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),l&&S.addEventListener("resize",n)});const x=m&&d?IA(m,n):null;let y=-1,v=null;c&&(v=new ResizeObserver(S=>{let[T]=S;T&&T.target===m&&v&&t&&(v.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var N;(N=v)==null||N.observe(t)})),n()}),m&&!f&&v.observe(m),t&&v.observe(t));let E,k=f?go(e):null;f&&w();function w(){const S=go(e);k&&!gj(k,S)&&n(),k=S,E=requestAnimationFrame(w)}return n(),()=>{var S;g.forEach(T=>{a&&T.removeEventListener("scroll",n),l&&T.removeEventListener("resize",n)}),x==null||x(),(S=v)==null||S.disconnect(),v=null,f&&cancelAnimationFrame(E)}}const LA=dA,$A=fA,MA=lA,_A=mA,FA=cA,bv=aA,zA=pA,BA=(e,t,n)=>{const s=new Map,a={platform:DA,...n},l={...a.platform,_c:s};return iA(e,t,{...a,platform:l})};var UA=typeof document<"u",HA=function(){},Vc=UA?p.useLayoutEffect:HA;function ru(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(!ru(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)&&!ru(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function xj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wv(e,t){const n=xj(e);return Math.round(t*n)/n}function Xf(e){const t=p.useRef(e);return Vc(()=>{t.current=e}),t}function WA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:a,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:f,open:m}=e,[g,x]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,v]=p.useState(s);ru(y,s)||v(s);const[E,k]=p.useState(null),[w,S]=p.useState(null),T=p.useCallback(D=>{D!==R.current&&(R.current=D,k(D))},[]),N=p.useCallback(D=>{D!==I.current&&(I.current=D,S(D))},[]),A=l||E,M=c||w,R=p.useRef(null),I=p.useRef(null),O=p.useRef(g),Y=f!=null,J=Xf(f),_=Xf(a),U=Xf(m),X=p.useCallback(()=>{if(!R.current||!I.current)return;const D={placement:t,strategy:n,middleware:y};_.current&&(D.platform=_.current),BA(R.current,I.current,D).then(ee=>{const C={...ee,isPositioned:U.current!==!1};q.current&&!ru(O.current,C)&&(O.current=C,Us.flushSync(()=>{x(C)}))})},[y,t,n,_,U]);Vc(()=>{m===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,x(D=>({...D,isPositioned:!1})))},[m]);const q=p.useRef(!1);Vc(()=>(q.current=!0,()=>{q.current=!1}),[]),Vc(()=>{if(A&&(R.current=A),M&&(I.current=M),A&&M){if(J.current)return J.current(A,M,X);X()}},[A,M,X,J,Y]);const G=p.useMemo(()=>({reference:R,floating:I,setReference:T,setFloating:N}),[T,N]),B=p.useMemo(()=>({reference:A,floating:M}),[A,M]),W=p.useMemo(()=>{const D={position:n,left:0,top:0};if(!B.floating)return D;const ee=wv(B.floating,g.x),C=wv(B.floating,g.y);return d?{...D,transform:"translate("+ee+"px, "+C+"px)",...xj(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:C}},[n,d,B.floating,g.x,g.y]);return p.useMemo(()=>({...g,update:X,refs:G,elements:B,floatingStyles:W}),[g,X,G,B,W])}const VA=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?bv({element:s.current,padding:a}).fn(n):{}:s?bv({element:s,padding:a}).fn(n):{}}}},qA=(e,t)=>{const n=LA(e);return{name:n.name,fn:n.fn,options:[e,t]}},KA=(e,t)=>{const n=$A(e);return{name:n.name,fn:n.fn,options:[e,t]}},GA=(e,t)=>({fn:zA(e).fn,options:[e,t]}),YA=(e,t)=>{const n=MA(e);return{name:n.name,fn:n.fn,options:[e,t]}},XA=(e,t)=>{const n=_A(e);return{name:n.name,fn:n.fn,options:[e,t]}},JA=(e,t)=>{const n=FA(e);return{name:n.name,fn:n.fn,options:[e,t]}},QA=(e,t)=>{const n=VA(e);return{name:n.name,fn:n.fn,options:[e,t]}};var ZA="Arrow",yj=p.forwardRef((e,t)=>{const{children:n,width:s=10,height:a=5,...l}=e;return r.jsx(Vt.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"})})});yj.displayName=ZA;var e3=yj;function t3(e){const[t,n]=p.useState(void 0);return Hs(()=>{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,d;if("borderBoxSize"in l){const f=l.borderBoxSize,m=Array.isArray(f)?f[0]:f;c=m.inlineSize,d=m.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var Zm="Popper",[vj,bj]=yo(Zm),[n3,wj]=vj(Zm),jj=e=>{const{__scopePopper:t,children:n}=e,[s,a]=p.useState(null);return r.jsx(n3,{scope:t,anchor:s,onAnchorChange:a,children:n})};jj.displayName=Zm;var kj="PopperAnchor",Sj=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...a}=e,l=wj(kj,n),c=p.useRef(null),d=bn(t,c),f=p.useRef(null);return p.useEffect(()=>{const m=f.current;f.current=(s==null?void 0:s.current)||c.current,m!==f.current&&l.onAnchorChange(f.current)}),s?null:r.jsx(Vt.div,{...a,ref:d})});Sj.displayName=kj;var eh="PopperContent",[r3,s3]=vj(eh),Nj=p.forwardRef((e,t)=>{var ge,je,Ne,ke,Ve,Ye;const{__scopePopper:n,side:s="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:x="partial",hideWhenDetached:y=!1,updatePositionStrategy:v="optimized",onPlaced:E,...k}=e,w=wj(eh,n),[S,T]=p.useState(null),N=bn(t,ie=>T(ie)),[A,M]=p.useState(null),R=t3(A),I=(R==null?void 0:R.width)??0,O=(R==null?void 0:R.height)??0,Y=s+(l!=="center"?"-"+l:""),J=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},_=Array.isArray(m)?m:[m],U=_.length>0,X={padding:J,boundary:_.filter(i3),altBoundary:U},{refs:q,floatingStyles:G,placement:B,isPositioned:W,middlewareData:D}=WA({strategy:"fixed",placement:Y,whileElementsMounted:(...ie)=>OA(...ie,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[qA({mainAxis:a+O,alignmentAxis:c}),f&&KA({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?GA():void 0,...X}),f&&YA({...X}),XA({...X,apply:({elements:ie,rects:ne,availableWidth:le,availableHeight:H})=>{const{width:fe,height:ve}=ne.reference,_e=ie.floating.style;_e.setProperty("--radix-popper-available-width",`${le}px`),_e.setProperty("--radix-popper-available-height",`${H}px`),_e.setProperty("--radix-popper-anchor-width",`${fe}px`),_e.setProperty("--radix-popper-anchor-height",`${ve}px`)}}),A&&QA({element:A,padding:d}),a3({arrowWidth:I,arrowHeight:O}),y&&JA({strategy:"referenceHidden",...X})]}),[ee,C]=Tj(B),$=mo(E);Hs(()=>{W&&($==null||$())},[W,$]);const Z=(ge=D.arrow)==null?void 0:ge.x,L=(je=D.arrow)==null?void 0:je.y,ae=((Ne=D.arrow)==null?void 0:Ne.centerOffset)!==0,[ce,Q]=p.useState();return Hs(()=>{S&&Q(window.getComputedStyle(S).zIndex)},[S]),r.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:W?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(ke=D.transformOrigin)==null?void 0:ke.x,(Ve=D.transformOrigin)==null?void 0:Ve.y].join(" "),...((Ye=D.hide)==null?void 0:Ye.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:r.jsx(r3,{scope:n,placedSide:ee,onArrowChange:M,arrowX:Z,arrowY:L,shouldHideArrow:ae,children:r.jsx(Vt.div,{"data-side":ee,"data-align":C,...k,ref:N,style:{...k.style,animation:W?void 0:"none"}})})})});Nj.displayName=eh;var Cj="PopperArrow",o3={top:"bottom",right:"left",bottom:"top",left:"right"},Ej=p.forwardRef(function(t,n){const{__scopePopper:s,...a}=t,l=s3(Cj,s),c=o3[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(e3,{...a,ref:n,style:{...a.style,display:"block"}})})});Ej.displayName=Cj;function i3(e){return e!==null}var a3=e=>({name:"transformOrigin",options:e,fn(t){var w,S,T;const{placement:n,rects:s,middlewareData:a}=t,c=((w=a.arrow)==null?void 0:w.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[m,g]=Tj(n),x={start:"0%",center:"50%",end:"100%"}[g],y=(((S=a.arrow)==null?void 0:S.x)??0)+d/2,v=(((T=a.arrow)==null?void 0:T.y)??0)+f/2;let E="",k="";return m==="bottom"?(E=c?x:`${y}px`,k=`${-f}px`):m==="top"?(E=c?x:`${y}px`,k=`${s.floating.height+f}px`):m==="right"?(E=`${-f}px`,k=c?x:`${v}px`):m==="left"&&(E=`${s.floating.width+f}px`,k=c?x:`${v}px`),{data:{x:E,y:k}}}});function Tj(e){const[t,n="center"]=e.split("-");return[t,n]}var l3=jj,c3=Sj,u3=Nj,d3=Ej,f3=Symbol("radix.slottable");function p3(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=f3,t}var m3=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"}),h3="VisuallyHidden",Pj=p.forwardRef((e,t)=>r.jsx(Vt.span,{...e,ref:t,style:{...m3,...e.style}}));Pj.displayName=h3;var g3=Pj,[Pu]=yo("Tooltip",[bj]),Ru=bj(),Rj="TooltipProvider",x3=700,Mp="tooltip.open",[y3,th]=Pu(Rj),Aj=e=>{const{__scopeTooltip:t,delayDuration:n=x3,skipDelayDuration:s=300,disableHoverableContent:a=!1,children:l}=e,c=p.useRef(!0),d=p.useRef(!1),f=p.useRef(0);return p.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),r.jsx(y3,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,s)},[s]),isPointerInTransitRef:d,onPointerInTransitChange:p.useCallback(m=>{d.current=m},[]),disableHoverableContent:a,children:l})};Aj.displayName=Rj;var Ha="Tooltip",[v3,nl]=Pu(Ha),Dj=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:a,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,f=th(Ha,e.__scopeTooltip),m=Ru(t),[g,x]=p.useState(null),y=ii(),v=p.useRef(0),E=c??f.disableHoverableContent,k=d??f.delayDuration,w=p.useRef(!1),[S,T]=ju({prop:s,defaultProp:a??!1,onChange:I=>{I?(f.onOpen(),document.dispatchEvent(new CustomEvent(Mp))):f.onClose(),l==null||l(I)},caller:Ha}),N=p.useMemo(()=>S?w.current?"delayed-open":"instant-open":"closed",[S]),A=p.useCallback(()=>{window.clearTimeout(v.current),v.current=0,w.current=!1,T(!0)},[T]),M=p.useCallback(()=>{window.clearTimeout(v.current),v.current=0,T(!1)},[T]),R=p.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{w.current=!0,T(!0),v.current=0},k)},[k,T]);return p.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),r.jsx(l3,{...m,children:r.jsx(v3,{scope:t,contentId:y,open:S,stateAttribute:N,trigger:g,onTriggerChange:x,onTriggerEnter:p.useCallback(()=>{f.isOpenDelayedRef.current?R():A()},[f.isOpenDelayedRef,R,A]),onTriggerLeave:p.useCallback(()=>{E?M():(window.clearTimeout(v.current),v.current=0)},[M,E]),onOpen:A,onClose:M,disableHoverableContent:E,children:n})})};Dj.displayName=Ha;var _p="TooltipTrigger",Ij=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,a=nl(_p,n),l=th(_p,n),c=Ru(n),d=p.useRef(null),f=bn(t,d,a.onTriggerChange),m=p.useRef(!1),g=p.useRef(!1),x=p.useCallback(()=>m.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),r.jsx(c3,{asChild:!0,...c,children:r.jsx(Vt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...s,ref:f,onPointerMove:Ct(e.onPointerMove,y=>{y.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(a.onTriggerEnter(),g.current=!0)}),onPointerLeave:Ct(e.onPointerLeave,()=>{a.onTriggerLeave(),g.current=!1}),onPointerDown:Ct(e.onPointerDown,()=>{a.open&&a.onClose(),m.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Ct(e.onFocus,()=>{m.current||a.onOpen()}),onBlur:Ct(e.onBlur,a.onClose),onClick:Ct(e.onClick,a.onClose)})})});Ij.displayName=_p;var nh="TooltipPortal",[b3,w3]=Pu(nh,{forceMount:void 0}),Oj=e=>{const{__scopeTooltip:t,forceMount:n,children:s,container:a}=e,l=nl(nh,t);return r.jsx(b3,{scope:t,forceMount:n,children:r.jsx(vo,{present:n||l.open,children:r.jsx(Dm,{asChild:!0,container:a,children:s})})})};Oj.displayName=nh;var hi="TooltipContent",Lj=p.forwardRef((e,t)=>{const n=w3(hi,e.__scopeTooltip),{forceMount:s=n.forceMount,side:a="top",...l}=e,c=nl(hi,e.__scopeTooltip);return r.jsx(vo,{present:s||c.open,children:c.disableHoverableContent?r.jsx($j,{side:a,...l,ref:t}):r.jsx(j3,{side:a,...l,ref:t})})}),j3=p.forwardRef((e,t)=>{const n=nl(hi,e.__scopeTooltip),s=th(hi,e.__scopeTooltip),a=p.useRef(null),l=bn(t,a),[c,d]=p.useState(null),{trigger:f,onClose:m}=n,g=a.current,{onPointerInTransitChange:x}=s,y=p.useCallback(()=>{d(null),x(!1)},[x]),v=p.useCallback((E,k)=>{const w=E.currentTarget,S={x:E.clientX,y:E.clientY},T=E3(S,w.getBoundingClientRect()),N=T3(S,T),A=P3(k.getBoundingClientRect()),M=A3([...N,...A]);d(M),x(!0)},[x]);return p.useEffect(()=>()=>y(),[y]),p.useEffect(()=>{if(f&&g){const E=w=>v(w,g),k=w=>v(w,f);return f.addEventListener("pointerleave",E),g.addEventListener("pointerleave",k),()=>{f.removeEventListener("pointerleave",E),g.removeEventListener("pointerleave",k)}}},[f,g,v,y]),p.useEffect(()=>{if(c){const E=k=>{const w=k.target,S={x:k.clientX,y:k.clientY},T=(f==null?void 0:f.contains(w))||(g==null?void 0:g.contains(w)),N=!R3(S,c);T?y():N&&(y(),m())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[f,g,c,m,y]),r.jsx($j,{...e,ref:l})}),[k3,S3]=Pu(Ha,{isInside:!1}),N3=p3("TooltipContent"),$j=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":a,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,f=nl(hi,n),m=Ru(n),{onClose:g}=f;return p.useEffect(()=>(document.addEventListener(Mp,g),()=>document.removeEventListener(Mp,g)),[g]),p.useEffect(()=>{if(f.trigger){const x=y=>{const v=y.target;v!=null&&v.contains(f.trigger)&&g()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[f.trigger,g]),r.jsx(Am,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:g,children:r.jsxs(u3,{"data-state":f.stateAttribute,...m,...d,ref:t,style:{...d.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(N3,{children:s}),r.jsx(k3,{scope:n,isInside:!0,children:r.jsx(g3,{id:f.contentId,role:"tooltip",children:a||s})})]})})});Lj.displayName=hi;var Mj="TooltipArrow",C3=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,a=Ru(n);return S3(Mj,n).isInside?null:r.jsx(d3,{...a,...s,ref:t})});C3.displayName=Mj;function E3(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 T3(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 P3(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 R3(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 d=t[l],f=t[c],m=d.x,g=d.y,x=f.x,y=f.y;g>s!=y>s&&n<(x-m)*(s-g)/(y-g)+m&&(a=!a)}return a}function A3(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),D3(t)}function D3(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 I3=Aj,O3=Dj,L3=Ij,$3=Oj,_j=Lj;const po=I3,zr=O3,Br=L3,wr=p.forwardRef(({className:e,sideOffset:t=4,...n},s)=>r.jsx($3,{children:r.jsx(_j,{ref:s,sideOffset:t,className:ze("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})}));wr.displayName=_j.displayName;function rh({items:e,align:t="end"}){const[n,s]=p.useState(!1),a=p.useRef(null);return p.useEffect(()=>{if(!n)return;function l(d){a.current&&!a.current.contains(d.target)&&s(!1)}function c(d){d.key==="Escape"&&s(!1)}return document.addEventListener("mousedown",l),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",c)}},[n]),e.length===0?null:r.jsxs("div",{className:"relative",ref:a,children:[r.jsx("button",{type:"button",onClick:()=>s(l=>!l),className:"shell-action",title:"More actions","aria-haspopup":"true","aria-expanded":n,children:r.jsx(PE,{className:"h-4 w-4"})}),n&&r.jsx("div",{className:ze("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(po,{delayDuration:200,children:e.map(l=>{const c=l.icon,d=ze("flex w-full items-center gap-2 px-3 py-1.5 text-sm text-left transition",l.disabled?"opacity-50 cursor-not-allowed":l.destructive?"text-destructive hover:bg-destructive/10":"hover:bg-foreground/5"),f=r.jsxs(r.Fragment,{children:[c?r.jsx(c,{className:"h-4 w-4 shrink-0"}):null,r.jsx("span",{className:"truncate",children:l.label})]});if(l.disabled){const m=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:d,children:f})});return l.disabledReason?r.jsxs(zr,{children:[r.jsx(Br,{asChild:!0,children:m}),r.jsx(wr,{side:"left",children:l.disabledReason})]},l.key):r.jsx("div",{children:m},l.key)}return l.href?r.jsx(we,{to:l.href,className:d,onClick:()=>s(!1),children:f},l.key):r.jsx("button",{type:"button",className:d,onClick:()=>{var m;(m=l.onSelect)==null||m.call(l),s(!1)},children:f},l.key)})})})]})}function Ms({id:e,items:t,total:n,filterText:s="",selectable:a=!1,selectedIds:l,onToggleSelect:c,onClaim:d,onAdvance:f,onComment:m,headerCTA:g,footer:x}){const y=Tt(),v=s.trim().toLowerCase(),E=v?t.filter(k=>k.assignmentTitle.toLowerCase().includes(v)||k.assignmentSlug.toLowerCase().includes(v)):t;return r.jsxs("section",{role:"region","aria-labelledby":`overview-seg-${e}`,className:"rounded-xl border border-border/60 bg-background/60 shadow-sm",children:[r.jsxs("header",{className:"flex items-center justify-between gap-3 border-b border-border/40 px-4 py-3",children:[r.jsxs("div",{className:"flex items-baseline gap-2",children:[r.jsx("h3",{id:`overview-seg-${e}`,className:"text-sm font-semibold text-foreground",children:Wc[e]}),n>0?r.jsx("span",{className:"text-xs text-muted-foreground",children:n>t.length?`${n} (showing ${t.length})`:n}):null]}),g?r.jsx(we,{to:g.href,className:"text-sm font-medium text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:g.label}):null]}),r.jsx("div",{className:"divide-y divide-border/40",children:E.length===0?r.jsx("p",{className:"px-4 py-6 text-sm text-muted-foreground",children:v?"No matches.":zR[e]}):E.map(k=>r.jsx(_3,{item:k,prefix:y,selectable:a,selected:(l==null?void 0:l.has(k.id))??!1,onToggleSelect:c,onClaim:d,onAdvance:f,onComment:m},k.id))}),x]})}const M3=["complete","review","implement","plan-ready","shape","start","unblock","reopen"];function _3({item:e,prefix:t,selectable:n,selected:s,onToggleSelect:a,onClaim:l,onAdvance:c,onComment:d}){const f=e.projectSlug?`${t}${e.href}`:e.href,m=F3(e);return r.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[n?r.jsx("input",{type:"checkbox",checked:s,onChange:()=>a==null?void 0:a(e.id),className:"mt-1 h-4 w-4 cursor-pointer accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Select ${e.assignmentTitle}`}):null,r.jsxs(we,{to:f,className:"min-w-0 flex-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:[r.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("p",{className:"truncate text-sm font-semibold text-foreground",children:e.assignmentTitle}),r.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:[e.projectTitle??"Standalone",e.assignee?r.jsxs(r.Fragment,{children:[" · ",r.jsx("span",{className:"text-foreground/80",children:e.assignee})]}):null]})]}),r.jsx(wn,{status:e.status})]}),r.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:e.reason}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground/80",children:Nm(e.updated)})]}),r.jsx(rh,{items:[{key:"claim",label:"Claim",onSelect:()=>l==null?void 0:l(e),disabled:!l},{key:"advance",label:m?`Advance → ${m.label}`:"Advance",onSelect:m?()=>c==null?void 0:c(e):void 0,disabled:!m,disabledReason:m?void 0:"No transition available"},{key:"comment",label:"Comment",onSelect:()=>d==null?void 0:d(e),disabled:!d},{key:"open",label:"Open",href:f}]})]})}function F3(e){const t=e.availableTransitions.filter(n=>!n.disabled);for(const n of M3){const s=t.find(a=>a.command===n);if(s)return s}return t[0]??null}const z3={readyForReview:"/assignments?status=review",readyToImplement:"/assignments?status=ready_to_implement",readyForPlanning:"/assignments?status=ready_for_planning",inProgress:"/assignments?status=in_progress",drafts:"/assignments?status=draft",blocked:"/assignments?status=blocked",newestCreated:"/assignments",stale:"/assignments?stale=1"};function B3({segments:e}){const t=Tt(),n=[["readyForReview",e.readyForReview.total],["readyToImplement",e.readyToImplement.total],["readyForPlanning",e.readyForPlanning.total],["inProgress",e.inProgress.total],["drafts",e.drafts.total],["blocked",e.blocked.total],["stale",e.stale.total],["newestCreated",e.newestCreated.total]],s=n.filter(([,l])=>l>0),a=n.filter(([,l])=>l===0);return s.length===0?null:r.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-md border border-border/40 bg-background/40 px-3 py-2 text-xs",children:[s.map(([l,c])=>r.jsxs(we,{to:`${t}${z3[l]??"/assignments"}`,className:"rounded-md border border-border/60 bg-background px-2 py-1 hover:border-primary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`${Wc[l]}: ${c}`,children:[r.jsx("span",{className:"font-medium text-foreground",children:c})," ",r.jsx("span",{className:"text-muted-foreground",children:Wc[l]})]},l)),a.length>0?r.jsxs("span",{className:"rounded-md border border-dashed border-border/50 bg-background/40 px-2 py-1 text-muted-foreground",title:`Clean: ${a.map(([l])=>Wc[l]).join(", ")}`,children:["+",a.length," clean"]}):null]})}function U3({count:e,loading:t=!1,partialFailureBanner:n,onArchive:s,onClear:a}){return e===0?null:r.jsx("div",{role:"region","aria-label":"Bulk actions",className:"fixed inset-x-0 bottom-0 z-30 flex justify-center pb-3 pointer-events-none",children:r.jsxs("div",{className:"pointer-events-auto flex max-w-3xl flex-col items-stretch gap-1 rounded-lg border border-border/70 bg-background shadow-lg",children:[n?r.jsx("p",{"aria-live":"polite",className:"rounded-t-lg bg-destructive/10 px-4 py-2 text-xs text-destructive",children:n}):null,r.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[e," selected"]}),r.jsx("button",{type:"button",disabled:t,onClick:s,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:opacity-50",children:t?"Archiving…":`${Cn.bulkArchiveLabel} (${e})`}),r.jsx("button",{type:"button",disabled:t,onClick:a,className:"shell-action",children:Cn.bulkClearLabel})]})]})})}function Vr({value:e,label:t,disabled:n=!1,disabledReason:s,onError:a}){const[l,c]=p.useState(!1);async function d(){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(f){a==null||a(f instanceof Error?f:new Error(String(f)))}}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(Fa,{className:"h-3 w-3","aria-hidden":"true"})}):r.jsx("button",{type:"button",onClick:d,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(vi,{className:"h-3 w-3 text-status-completed-foreground","aria-hidden":"true"}):r.jsx(Fa,{className:"h-3 w-3","aria-hidden":"true"})})}function H3({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:Cn.recentSessionsEmptyTitle}),r.jsx("p",{className:"mt-1 text-muted-foreground",children:Cn.recentSessionsEmptyHint})]}):r.jsx("ul",{className:"divide-y divide-border/40",children:e.map(t=>r.jsx("li",{children:r.jsx(W3,{session:t})},t.sessionId))})]})}function W3({session:e}){const t=Tt(),[n,s]=p.useState(!1),a=V3(e,t),l=q3(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(we,{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," · ",Nm(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:Cn.recentSessionsCopyFallbackHint})]}):null]}),r.jsx(Vr,{value:e.path,label:Cn.recentSessionsCopyPathLabel,disabled:c,disabledReason:Cn.recentSessionsCopyPathDisabled,onError:()=>s(!0)})]})}function V3(e,t){return e.projectSlug&&e.assignmentSlug?`${t}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`:(!e.projectSlug&&e.assignmentSlug,"/agent-sessions")}function q3(e){return e.assignmentSlug&&e.projectSlug?`${e.projectSlug}/${e.assignmentSlug}`:e.assignmentSlug?`standalone/${e.assignmentSlug}`:"standalone"}const K3=p.forwardRef(function({value:t,onChange:n,onClear:s},a){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{ref:a,type:"text",value:t,placeholder:"Filter (press / to focus)","aria-label":"Filter Overview rows",onChange:l=>n(l.target.value),onKeyDown:l=>{l.key==="Escape"&&(s(),l.target.blur())},className:"w-full max-w-sm rounded-md border border-border/60 bg-background px-3 py-1.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),t?r.jsx("button",{type:"button",onClick:s,className:"text-xs text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:"Clear"}):null]})});async function sh(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 Fj(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 G3(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 zj(e){return e.requiresReason||e.command==="block"}async function Y3(e,t,n){const s=await fetch(`/api/assignments/${e}/transitions/${t.command}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),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 X3(e,t){const n=await fetch("/api/assignments/bulk-status-override",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:e,reason:t})}),s=await n.json().catch(()=>null);if(!n.ok)throw new Error((s==null?void 0:s.error)||`HTTP ${n.status}`);return s}async function J3(e){const t=await fetch(`/api/projects/${e.projectSlug}/assignments/${e.assignmentSlug}/assignee`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({assignee:e.assignee})}),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 Q3(e){const t=await fetch(`/api/assignments/${e.id}/assignee`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({assignee:e.assignee})}),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 Z3(e){let t;if(e.projectSlug&&e.assignmentSlug)t=`/api/projects/${e.projectSlug}/assignments/${e.assignmentSlug}/comments`;else if(e.id)t=`/api/assignments/${e.id}/comments`;else throw new Error("postQuickComment requires either (projectSlug + assignmentSlug) or id");const n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:e.body,type:e.type??"note",author:e.author})}),s=await n.json().catch(()=>null);if(!n.ok)throw new Error((s==null?void 0:s.error)||`HTTP ${n.status}`)}const su="syntaur:dashboard:claimAs",eD="human";function ou(){try{const e=window.localStorage.getItem(su);if(e&&e.trim().length>0)return e.trim()}catch{}return eD}function tD(e){try{e===null||e.trim().length===0?window.localStorage.removeItem(su):window.localStorage.setItem(su,e.trim())}catch{}}function nD(){try{const e=window.localStorage.getItem(su);return!!(e&&e.trim().length>0)}catch{return!1}}function rD({open:e,onOpenChange:t,onSubmit:n}){const[s,a]=p.useState(ou());return p.useEffect(()=>{e&&a(ou())},[e]),r.jsx(Jr,{open:e,onOpenChange:t,children:r.jsx(Tr,{className:"max-w-md",children:r.jsxs("form",{className:"space-y-4",onSubmit:l=>{l.preventDefault();const c=s.trim();c&&(tD(c),n(c),t(!1))},children:[r.jsxs(bo,{children:[r.jsx(Pr,{children:Cn.claimAsTitle}),r.jsx(ps,{children:Cn.claimAsHint})]}),r.jsx("input",{type:"text",value:s,autoFocus:!0,onChange:l=>a(l.target.value),placeholder:"human, claude, codex…",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(wo,{children:[r.jsx("button",{type:"button",onClick:()=>t(!1),className:"shell-action",children:"Cancel"}),r.jsx("button",{type:"submit",disabled:s.trim().length===0,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:opacity-50",children:Cn.claimAsSubmit})]})]})})})}function sD({open:e,assignmentTitle:t,loading:n=!1,onSubmit:s,onOpenChange:a}){const[l,c]=p.useState(""),[d,f]=p.useState("note");return p.useEffect(()=>{e||(c(""),f("note"))},[e]),r.jsx(Jr,{open:e,onOpenChange:m=>n?void 0:a(m),children:r.jsx(Tr,{className:"max-w-xl",children:r.jsxs("form",{className:"space-y-4",onSubmit:async m=>{m.preventDefault();const g=l.trim();g&&await s(g,d)},children:[r.jsxs(bo,{children:[r.jsx(Pr,{children:Cn.quickCommentTitle}),r.jsxs(ps,{children:["On “",t,"”"]})]}),r.jsx("textarea",{value:l,autoFocus:!0,rows:5,disabled:n,onChange:m=>c(m.target.value),placeholder:Cn.quickCommentPlaceholder,className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm leading-6 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),r.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r.jsxs("label",{className:"flex items-center gap-1",children:[r.jsx("input",{type:"radio",name:"comment-type",value:"note",checked:d==="note",onChange:()=>f("note")}),"note"]}),r.jsxs("label",{className:"flex items-center gap-1",children:[r.jsx("input",{type:"radio",name:"comment-type",value:"question",checked:d==="question",onChange:()=>f("question")}),"question"]}),r.jsxs("label",{className:"flex items-center gap-1",children:[r.jsx("input",{type:"radio",name:"comment-type",value:"feedback",checked:d==="feedback",onChange:()=>f("feedback")}),"feedback"]})]}),r.jsxs(wo,{children:[r.jsx("button",{type:"button",onClick:()=>a(!1),className:"shell-action",disabled:n,children:"Cancel"}),r.jsx("button",{type:"submit",disabled:n||l.trim().length===0,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:opacity-50",children:n?"Posting…":Cn.quickCommentSubmit})]})]})})})}const jv=50,oD="archived";function iD(){const[e,t]=p.useState(0),{data:n,loading:s,error:a,refetch:l}=F2({staleLimit:jv,staleOffset:e}),{data:c}=Vw(),[d,f]=p.useState(""),m=p.useRef(null),[g,x]=p.useState(new Set),[y,v]=p.useState(!1),[E,k]=p.useState(null),[w,S]=p.useState(!1),T=p.useRef(null),[N,A]=p.useState(null),[M,R]=p.useState(!1);Gs("list:overview"),pt({keys:"/",description:"Focus filter",scope:"list:overview",handler:B=>{var W,D;B.preventDefault(),(W=m.current)==null||W.focus(),(D=m.current)==null||D.select()}}),pt({keys:"r",description:"Refresh",scope:"list:overview",handler:()=>{l()}}),pt({keys:"Escape",description:"Clear selection / filter",scope:"list:overview",handler:()=>{x(new Set),f("")}});const I=p.useMemo(()=>aD(n==null?void 0:n.segments),[n==null?void 0:n.segments]),O=p.useCallback(async B=>B||!nD()?new Promise(W=>{T.current=D=>{W(D)},S(!0)}):ou(),[]),Y=p.useCallback(async(B,W=!1)=>{const D=await O(W);if(D)try{B.projectSlug?await J3({projectSlug:B.projectSlug,assignmentSlug:B.assignmentSlug,assignee:D}):await Q3({id:B.id.split(":")[1]??B.id,assignee:D}),await l()}catch(ee){console.error("Claim failed:",ee)}},[O,l]),J=p.useCallback(async B=>{const W=B.availableTransitions.filter(ee=>!ee.disabled);if(W.length===0)return;const D=W[0];try{if(B.projectSlug)await sh(B.projectSlug,B.assignmentSlug,D);else{const ee=B.id.split(":")[1]??B.id;await Y3(ee,D)}await l()}catch(ee){console.error("Advance failed:",ee)}},[l]),_=p.useCallback(async(B,W)=>{if(N){R(!0);try{await Z3({projectSlug:N.projectSlug,assignmentSlug:N.projectSlug?N.assignmentSlug:void 0,id:N.projectSlug?void 0:N.id.split(":")[1]??N.id,body:B,type:W}),A(null)}catch(D){console.error("Comment failed:",D)}finally{R(!1)}}},[N]),U=p.useCallback(async()=>{if(!(g.size===0||!n)){v(!0),k(null);try{const B=n.segments.stale.items.filter(D=>g.has(D.id)).map(D=>({projectSlug:D.projectSlug,assignmentSlug:D.projectSlug?D.assignmentSlug:void 0,id:D.projectSlug?void 0:D.id.split(":")[1]??D.id,status:oD})),W=await X3(B,"Bulk archive from Overview");W.failed>0&&k(`${W.failed} of ${B.length} items failed. The list has been refreshed.`),x(new Set),t(0),await l()}catch(B){console.error("Bulk archive failed:",B),k(B.message)}finally{v(!1)}}},[n,g,l]),X=p.useCallback(B=>{x(W=>{const D=new Set(W);return D.has(B)?D.delete(B):D.add(B),D})},[]);if(s&&!n)return r.jsx(at,{label:"Loading overview…"});if(a||!n)return r.jsx(et,{error:a||"Overview data is unavailable."});const q=n.segments.drafts.items[0]?{label:"Shape →",href:(n.segments.drafts.items[0].projectSlug,n.segments.drafts.items[0].href)}:void 0,G=n.segments.stale.hasMore?r.jsx("div",{className:"flex justify-center px-4 py-3",children:r.jsxs("button",{type:"button",onClick:()=>t(B=>B+jv),className:"shell-action",children:["Load more (",n.segments.stale.total-n.segments.stale.offset-n.segments.stale.items.length," remaining)"]})}):null;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"})]}),r.jsx(K3,{ref:m,value:d,onChange:f,onClear:()=>f("")}),r.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1.1fr)_minmax(360px,0.9fr)]",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsx(UR,{hero:n.hero,itemsById:I}),r.jsx(Ms,{id:"readyForReview",items:n.segments.readyForReview.items,total:n.segments.readyForReview.total,filterText:d,onClaim:B=>Y(B),onAdvance:J,onComment:B=>A(B)}),r.jsx(Ms,{id:"readyToImplement",items:n.segments.readyToImplement.items,total:n.segments.readyToImplement.total,filterText:d,onClaim:B=>Y(B),onAdvance:J,onComment:B=>A(B)}),r.jsx(Ms,{id:"readyForPlanning",items:n.segments.readyForPlanning.items,total:n.segments.readyForPlanning.total,filterText:d,onClaim:B=>Y(B),onAdvance:J,onComment:B=>A(B)}),r.jsx(Ms,{id:"inProgress",items:n.segments.inProgress.items,total:n.segments.inProgress.total,filterText:d,onClaim:B=>Y(B),onAdvance:J,onComment:B=>A(B)}),r.jsx(Ms,{id:"blocked",items:n.segments.blocked.items,total:n.segments.blocked.total,filterText:d,onClaim:B=>Y(B),onAdvance:J,onComment:B=>A(B)}),r.jsx(Ms,{id:"drafts",items:n.segments.drafts.items,total:n.segments.drafts.total,filterText:d,headerCTA:q,onClaim:B=>Y(B),onAdvance:J,onComment:B=>A(B)}),r.jsx(Ms,{id:"stale",items:n.segments.stale.items,total:n.segments.stale.total,filterText:d,selectable:!0,selectedIds:g,onToggleSelect:X,onClaim:B=>Y(B),onAdvance:J,onComment:B=>A(B),footer:G}),r.jsx(Ms,{id:"newestCreated",items:n.segments.newestCreated.items,total:n.segments.newestCreated.total,filterText:d,onClaim:B=>Y(B),onAdvance:J,onComment:B=>A(B)}),r.jsx(B3,{segments:n.segments}),n.serverStats?r.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(bm,{className:"h-3 w-3","aria-hidden":"true"}),r.jsxs("span",{children:["● ",n.serverStats.totalPorts," ports ·"," ",n.serverStats.deadSessions>0?`${n.serverStats.deadSessions} dead`:"all healthy"]})]}):null]}),r.jsxs("div",{className:"space-y-4",children:[r.jsx(H3,{sessions:n.recentSessions}),n.firstRun?r.jsx(FR,{help:c}):null]})]}),r.jsx(U3,{count:g.size,loading:y,partialFailureBanner:E,onArchive:U,onClear:()=>x(new Set)}),r.jsx(rD,{open:w,onOpenChange:B=>{!B&&T.current&&(T.current(ou()),T.current=null),S(B)},onSubmit:B=>{T.current&&(T.current(B),T.current=null)}}),r.jsx(sD,{open:N!==null,assignmentTitle:(N==null?void 0:N.assignmentTitle)??"",loading:M,onSubmit:_,onOpenChange:B=>{B||A(null)}})]})}function aD(e){if(!e)return{};const t={};for(const n of Object.keys(e)){const s=e[n];for(const a of s.items)t[a.id]=a}return t}function lD({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 cD(){const{data:e,loading:t,error:n}=Vw(),{openCheatsheet:s}=Ks();return t?r.jsx(at,{label:"Loading help…"}):n||!e?r.jsx(et,{error:n||"Help content is unavailable."}):r.jsxs("div",{className:"space-y-5",children:[r.jsx(Le,{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. ",Hr("Mod+k")," opens the command palette."]})]})}),r.jsx(Le,{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(Le,{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(Hc,{command:a.command.command,description:a.command.description,example:a.command.example}):null,a.href?r.jsx(we,{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(Le,{title:"Core Concepts",children:[r.jsx("div",{className:"flex flex-wrap gap-2",children:e.coreConcepts.map(a=>r.jsx(lD,{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(Le,{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(wn,{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(Le,{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(Le,{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(we,{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(Le,{title:"CLI Quick Reference",children:r.jsx("div",{className:"grid gap-3 xl:grid-cols-2",children:e.commands.map(a=>r.jsx(Hc,{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(Le,{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(Le,{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(Hc,{command:a.command.command,example:a.command.example}):null,a.href?r.jsx(we,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open the related surface"}):null]})]})},a.title))})})]})]})}function ot({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]})})}function oh({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 Au=p.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(qs,{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"})]}));Au.displayName="SearchInput";function ih({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",onClick:()=>n(s.value),className:ze("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))})}function Bj({columns:e,items:t,getItemId:n,getColumnId:s,renderCard:a,canDrop:l,onMove:c,getExternalDragData:d,onCardContextMenu:f,emptyMessage:m="No cards in this column."}){const[g,x]=p.useState(null),[y,v]=p.useState(null),E=p.useRef(null),k=p.useMemo(()=>new Map(t.map(I=>[n(I),I])),[n,t]),w=p.useMemo(()=>e.map(I=>({column:I,items:t.filter(O=>s(O)===I.id)})),[e,s,t]),S=g?k.get(g)??null:null;function T(I){if(!S)return{allowed:!1};const O=s(S);return(l==null?void 0:l({item:S,fromColumnId:O,toColumnId:I}))??{allowed:!0}}function N(){x(null),v(null)}function A(I,O,Y){const J=(d==null?void 0:d(O))??null;!c&&!J||(I.dataTransfer.effectAllowed="move",I.dataTransfer.setData("text/plain",Y),J&&I.dataTransfer.setData("application/json",JSON.stringify(J)),c&&x(Y))}function M(I,O,Y){!c||!S||!T(O).allowed||(I.preventDefault(),I.dataTransfer.dropEffect="move",v(_=>(_==null?void 0:_.columnId)===O&&_.index===Y?_:{columnId:O,index:Y}))}async function R(I,O,Y){var q;if(I.preventDefault(),!c||!S){N();return}const J=s(S),U=(((q=w.find(G=>G.column.id===J))==null?void 0:q.items)??[]).findIndex(G=>n(G)===n(S));if(!T(O).allowed||U<0){N();return}if(J===O&&(Y===U||Y===U+1)){N();return}try{await c({item:S,fromColumnId:J,toColumnId:O,fromIndex:U,toIndex:Y})}finally{N()}}return r.jsx("div",{className:"relative overflow-x-auto pb-2",style:{scrollbarColor:"oklch(var(--border)) transparent",scrollbarWidth:"thin"},children:r.jsx("div",{className:"grid min-w-max auto-cols-[minmax(260px,320px)] grid-flow-col gap-4",children:w.map(({column:I,items:O})=>{const Y=T(I.id),J=(y==null?void 0:y.columnId)===I.id;return r.jsxs("section",{className:ze("flex min-h-[320px] flex-col rounded-lg border border-border/60 bg-card/85 p-3 shadow-sm",S&&!Y.allowed?"border-dashed opacity-65":"",S&&Y.allowed?"border-primary/30 bg-accent/30":"",J?"ring-2 ring-ring/30":""),title:S&&!Y.allowed?Y.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:"text-sm font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:I.title}),I.description?r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:I.description}):null]}),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:O.length})]}),r.jsxs("div",{className:"flex flex-1 flex-col gap-3",onDragOver:_=>M(_,I.id,O.length),onDrop:_=>R(_,I.id,O.length),children:[O.length===0?r.jsx(uD,{active:(y==null?void 0:y.columnId)===I.id&&y.index===0,disabled:!!S&&!Y.allowed,children:typeof m=="function"?m(I):m}):null,O.map((_,U)=>{const X=n(_),q=g===X;return r.jsxs(p.Fragment,{children:[r.jsx("div",{className:ze("h-2 rounded-full transition",(y==null?void 0:y.columnId)===I.id&&y.index===U?"bg-primary/70":"bg-transparent"),onDragOver:G=>M(G,I.id,U),onDrop:G=>R(G,I.id,U)}),r.jsx("div",{draggable:!!(c||d),onMouseDown:G=>{E.current=G.target},onDragStart:G=>{const B=E.current;if(B!=null&&B.closest("a, button")){G.preventDefault();return}A(G,_,X)},onDragEnd:N,onContextMenu:G=>{if(!f)return;const B=G.target;B!=null&&B.closest('a, button, [role="button"]')||f(_,G)},className:ze("transition",c||d?"cursor-grab active:cursor-grabbing":"",q?"scale-[0.98] opacity-50":""),children:a(_,{dragging:q})})]},X)}),O.length>0?r.jsx("div",{className:ze("mt-1 rounded-md border border-dashed px-3 py-2 text-center text-xs text-muted-foreground transition",(y==null?void 0:y.columnId)===I.id&&y.index===O.length?"border-primary/50 bg-primary/10 text-foreground":"border-border/60",S&&!Y.allowed?"opacity-40":""),children:"Drop here to place at the end"}):null]})]},I.id)})})})}function uD({active:e,disabled:t,children:n}){return r.jsx("div",{className:ze("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 Uj={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 Ea=null,uo=null;function dD(){return Ea?Promise.resolve(Ea):uo||(uo=fetch("/api/config/statuses").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>(Ea=e,uo=null,e)).catch(()=>(uo=null,Uj)),uo)}function Du(){const[e,t]=p.useState(()=>Ea??Uj);return p.useEffect(()=>{dD().then(t)},[]),e}function kv(){Ea=null,uo=null}function fD(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 pD={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"},Sv=["bg-primary","bg-secondary","bg-accent-coral","bg-accent-teal","bg-accent-amber"];function iu({progress:e,className:t,showLegend:n=!1}){const s=Du(),a=p.useMemo(()=>{let c=0;return(s.order.length>0?s.order:Object.keys(e).filter(f=>f!=="total")).map(f=>({key:f,className:pD[f]??Sv[c++%Sv.length]}))},[s.order,e]),l=a.filter(c=>(e[c.key]??0)>0);return r.jsxs("div",{className:ze("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:`${pn(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:ze("h-2 w-2 rounded-full",c.className)}),r.jsx("span",{children:pn(c.key)}),r.jsx("span",{className:"font-medium text-foreground",children:e[c.key]??0})]},c.key))}):null]})}const mD=["pending","active","blocked","failed","completed","archived"],ah=mD,hD=["draft","pending","ready_for_planning","ready_to_implement","in_progress","blocked","review","completed","failed"];function gD(e){return e&&e.length>0?e:[...hD]}function xD(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 yD=220,Tc=8;function Hj({anchor:e,items:t,onClose:n}){const s=p.useRef(null),[a,l]=p.useState(null);return p.useLayoutEffect(()=>{if(!e){l(null);return}const c=s.current,d=(c==null?void 0:c.offsetWidth)??yD,f=(c==null?void 0:c.offsetHeight)??0,m=Math.max(Tc,window.innerWidth-d-Tc),g=Math.max(Tc,window.innerHeight-f-Tc);l({left:Math.min(e.x,m),top:Math.min(e.y,g)})},[e]),p.useEffect(()=>{if(!e)return;function c(m){s.current&&!s.current.contains(m.target)&&n()}function d(m){m.key==="Escape"&&n()}function f(){n()}return document.addEventListener("mousedown",c),document.addEventListener("keydown",d),document.addEventListener("contextmenu",c),window.addEventListener("scroll",f,!0),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",d),document.removeEventListener("contextmenu",c),window.removeEventListener("scroll",f,!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(po,{delayDuration:200,children:t.map(c=>{const d=c.icon,f=ze("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:[d?r.jsx(d,{className:"h-4 w-4 shrink-0"}):null,r.jsx("span",{className:"truncate",children:c.label})]});if(c.disabled){const g=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:f,children:m})});return c.disabledReason?r.jsxs(zr,{children:[r.jsx(Br,{asChild:!0,children:g}),r.jsx(wr,{side:"left",children:c.disabledReason})]},c.key):r.jsx("div",{children:g},c.key)}return c.href?r.jsx(we,{to:c.href,className:f,onClick:()=>n(),children:m},c.key):r.jsx("button",{type:"button",className:f,onClick:()=>{var g;(g=c.onSelect)==null||g.call(c),n()},children:m},c.key)})})})}const vD="__ungrouped__";function lh({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:d}=vu(),[f,m]=p.useState(n),[g,x]=p.useState(!1),[y,v]=p.useState(null);p.useEffect(()=>{e&&(m(n),v(null))},[e,n]);const E=p.useMemo(()=>[...((c==null?void 0:c.workspaces)??[]).map(T=>({key:T,label:T,value:T})),{key:vD,label:"Ungrouped",value:null}],[c]),k=!g&&f!==n;async function w(){if(k){x(!0),v(null);try{await s(f),t(!1)}catch(S){v(S instanceof Error?S.message:"Failed to move item")}finally{x(!1)}}}return r.jsx(Jr,{open:e,onOpenChange:S=>g?void 0:t(S),children:r.jsxs(Tr,{children:[r.jsxs(bo,{children:[r.jsx(Pr,{children:a}),r.jsx(ps,{children:l})]}),r.jsx("div",{className:"my-2 max-h-[320px] overflow-y-auto rounded-md border border-border/60",children:d&&E.length===0?r.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 text-sm text-muted-foreground",children:[r.jsx(vm,{className:"h-4 w-4 animate-spin"})," Loading workspaces…"]}):E.map(S=>{const T=S.value===n,N=S.value===f;return r.jsxs("button",{type:"button",disabled:T||g,onClick:()=>m(S.value),className:ze("flex w-full items-center justify-between px-3 py-2 text-left text-sm transition",T?"cursor-not-allowed bg-foreground/5 text-muted-foreground":N?"bg-accent/40 text-foreground":"hover:bg-foreground/5"),children:[r.jsxs("span",{className:ze("truncate",S.value===null?"italic text-muted-foreground":""),children:[S.label,T?r.jsx("span",{className:"ml-2 text-xs",children:"(current)"}):null]}),N?r.jsx(vi,{className:"h-4 w-4 text-foreground"}):null]},S.key)})}),y?r.jsx("p",{className:"text-sm text-destructive",role:"alert",children:y}):null,r.jsxs(wo,{children:[r.jsx("button",{type:"button",onClick:()=>t(!1),disabled:g,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",onClick:w,disabled:!k,className:"shell-action mt-0 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:g?"Moving…":"Move"})]})]})})}function Nv(){const{workspace:e}=jt(),t=Tt(),n=Et(),{data:s,loading:a,error:l,refetch:c}=ji(),d=p.useRef(null);Gs("list:projects");const[f,m]=p.useState(""),[g,x]=p.useState("all"),[y,v]=p.useState("active"),[E,k]=p.useState("all"),[w,S]=p.useState("updated"),[T,N]=Xr(),A=T.get("view"),M=A==="table"||A==="kanban"?A:"cards",R=C=>{N($=>{const Z=new URLSearchParams($);return C==="cards"?Z.delete("view"):Z.set("view",C),Z})},[I,O]=p.useState({}),[Y,J]=p.useState(null),[_,U]=p.useState(null),X=p.useMemo(()=>s?s.filter(C=>{if(e){if(e==="_ungrouped"){if(C.workspace!==null)return!1}else if(C.workspace!==e)return!1}return y==="active"&&C.archived||y==="archived"&&!C.archived||g!=="all"&&C.status!==g||E!=="all"&&!C.tags.includes(E)?!1:f.trim()?`${C.title} ${C.tags.join(" ")} ${C.slug}`.toLowerCase().includes(f.toLowerCase()):!0}).sort((C,$)=>jD(C,$,w)):[],[s,f,g,y,E,w,e]),q=X.map(C=>`${C.slug}:${C.status}`).join("|");p.useEffect(()=>{O(kD(X))},[q,w]);const G=p.useMemo(()=>{const C=new Map(X.map($=>[$.slug,$]));return ah.flatMap($=>(I[$]??X.filter(L=>L.status===$).map(L=>L.slug)).map(L=>C.get(L)).filter(L=>!!L))},[X,I]),{visibleItems:B,visibleIndexByKey:W}=p.useMemo(()=>{const C=M==="kanban"?G:X,$=new Map;return C.forEach((Z,L)=>$.set(Z.slug,L)),{visibleItems:C,visibleIndexByKey:$}},[M,X,G]),{hotkeyRowProps:D}=el(B,{scope:"list:projects",onOpen:C=>n(`${t}/projects/${C.slug}`)});if(pt({keys:"/",scope:"list:projects",description:"Focus filter",handler:()=>{var C;return(C=d.current)==null?void 0:C.focus()}}),pt({keys:"r",scope:"list:projects",description:"Refresh",handler:()=>c()}),a)return r.jsx(at,{label:"Loading projects…"});if(l||!s)return r.jsx(et,{error:l||"Project list is unavailable."});const ee=Array.from(new Set(s.flatMap(C=>C.tags))).sort();return r.jsxs("div",{className:"space-y-5",children:[r.jsxs(oh,{children:[r.jsx(Au,{ref:d,value:f,onChange:m,placeholder:"Search by project title or tag"}),r.jsxs("select",{value:g,onChange:C=>x(C.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.jsx("option",{value:"archived",children:"Archived"})]}),r.jsxs("select",{value:y,onChange:C=>v(C.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"active",children:"Hide archived"}),r.jsx("option",{value:"all",children:"All projects"}),r.jsx("option",{value:"archived",children:"Archived only"})]}),r.jsxs("select",{value:E,onChange:C=>k(C.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All tags"}),ee.map(C=>r.jsx("option",{value:C,children:C},C))]}),r.jsxs("select",{value:w,onChange:C=>S(C.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(ih,{value:M,onChange:C=>R(C),options:[{value:"cards",label:"Cards"},{value:"table",label:"Table"},{value:"kanban",label:"Kanban"}]})]}),X.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(we,{className:"shell-action shell-action--solid",to:`${t}/create/project`,children:"Create your first project"}),r.jsx(we,{className:"shell-action",to:"/help",children:"Read the spec"})]})]}):r.jsx(ot,{title:"No projects match these filters",description:"Adjust the current search and filters or create a new project.",actions:r.jsx(we,{className:"shell-action shell-action--solid",to:`${t}/create/project`,children:"Create Project"})}):M==="cards"?r.jsx("div",{className:"grid gap-3 lg:grid-cols-2 2xl:grid-cols-3",children:X.map((C,$)=>r.jsxs(we,{to:`${t}/projects/${C.slug}`,className:"block rounded-lg border border-border/60 bg-card/90 p-3 shadow-sm transition hover:border-primary/40 hover:shadow-md",...D($),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:C.title}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",qr(C.updated)]})]}),r.jsx(wn,{status:C.status})]}),r.jsxs("div",{className:"mt-4 space-y-3",children:[r.jsx(iu,{progress:C.progress,showLegend:!0}),r.jsx("div",{className:"flex flex-wrap gap-2",children:C.tags.map(Z=>r.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs text-foreground",children:Z},Z))}),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:C.needsAttention.blockedCount+C.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:C.progress.total})]})]})]})]},C.slug))}):M==="table"?r.jsx(Le,{title:`${X.length} project${X.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:X.map((C,$)=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",...D($),children:[r.jsxs("td",{className:"py-4 pr-4",children:[r.jsx(we,{to:`${t}/projects/${C.slug}`,className:"font-semibold text-foreground hover:text-primary",children:C.title}),r.jsx("div",{className:"mt-1 flex flex-wrap gap-2",children:C.tags.map(Z=>r.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:Z},Z))})]}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx(wn,{status:C.status})}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx("div",{className:"min-w-[220px]",children:r.jsx(iu,{progress:C.progress})})}),r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:C.needsAttention.blockedCount+C.needsAttention.failedCount}),r.jsx("td",{className:"py-4 text-muted-foreground",children:qr(C.updated)})]},C.slug))})]})})}):r.jsx(Bj,{columns:wD,items:G,getItemId:C=>C.slug,getColumnId:C=>C.status,canDrop:({fromColumnId:C,toColumnId:$})=>({allowed:!0,reason:C===$?void 0:"This will set a manual status override on the project."}),onMove:({item:C,fromColumnId:$,toColumnId:Z,fromIndex:L,toIndex:ae})=>{if($===Z){const ce=I[$]??X.filter(Q=>Q.status===$).map(Q=>Q.slug);O(Q=>({...Q,[$]:xD(ce,L,ae)}));return}fetch(`/api/projects/${C.slug}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:Z})}).then(()=>{window.location.reload()})},getExternalDragData:C=>({type:"project",id:C.slug}),onCardContextMenu:(C,$)=>{$.preventDefault(),J({project:C,anchor:{x:$.clientX,y:$.clientY}})},emptyMessage:C=>`No ${C.title.toLowerCase()} projects.`,renderCard:(C,{dragging:$})=>{const Z=W.get(C.slug)??-1;return r.jsx("div",{...Z>=0?D(Z):{},children:r.jsx(SD,{project:C,dragging:$})})}}),r.jsx(Hj,{anchor:(Y==null?void 0:Y.anchor)??null,items:Y?[{key:"edit",label:"Edit",icon:bi,onSelect:()=>n(`${t}/projects/${Y.project.slug}`)},{key:"move",label:"Move to workspace…",icon:Za,onSelect:()=>U(Y.project)}]:[],onClose:()=>J(null)}),r.jsx(lh,{open:_!==null,onOpenChange:C=>{C||U(null)},currentWorkspace:(_==null?void 0:_.workspace)??null,title:"Move project to workspace",onSubmit:async C=>{if(!_)return;const $=await fetch(`/api/projects/${encodeURIComponent(_.slug)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:C})});if(!$.ok){const Z=await $.json().catch(()=>({}));throw new Error(Z.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(ym,{className:"mt-0.5 h-4 w-4"}),r.jsxs("p",{children:["Project status is derived from assignment state by default.",M==="kanban"?" Drag projects between columns or use":" Use"," the status override on the project detail page to set a manual status."]})]})})]})}const bD={pending:"Pending",active:"Active",blocked:"Blocked",failed:"Failed",completed:"Completed",archived:"Archived"},wD=ah.map(e=>({id:e,title:bD[e],description:ij(e)}));function jD(e,t,n){switch(n){case"created":return t.created.localeCompare(e.created);case"title":return e.title.localeCompare(t.title);case"attention":return Cv(t)-Cv(e);case"updated":default:return t.updated.localeCompare(e.updated)}}function Cv(e){return e.needsAttention.failedCount*10+e.needsAttention.blockedCount*5+e.needsAttention.openQuestions}function kD(e){return Object.fromEntries(ah.map(t=>[t,e.filter(n=>n.status===t).map(n=>n.slug)]))}function SD({project:e,dragging:t}){const n=Tt();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(we,{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 ",qr(e.updated)]})]}),r.jsx(wn,{status:e.status})]}),r.jsx("div",{className:"mt-4",children:r.jsx(iu,{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"})]})}const Ev="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",Tv="truncate";function ch({externalIds:e,className:t}){return e.length===0?null:r.jsx("span",{className:ze("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:ze(Ev,"transition-colors hover:text-foreground hover:border-foreground/40"),title:`Open ${a} in ${n.system}`,children:[r.jsx("span",{className:Tv,children:a}),r.jsx(hm,{className:"h-2.5 w-2.5 shrink-0"})]},l):r.jsx("span",{className:Ev,title:a,children:r.jsx("span",{className:Tv,children:a})},l)})})}const ND={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 mn({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]}),d=ze(ND[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(we,{to:l,className:d,children:c}):r.jsx("article",{className:d,children:c})}function Pv(e){const t=CD(e),n=p.forwardRef((s,a)=>{const{children:l,...c}=s,d=p.Children.toArray(l),f=d.find(TD);if(f){const m=f.props.children,g=d.map(x=>x===f?p.Children.count(m)>1?p.Children.only(null):p.isValidElement(m)?m.props.children:null:x);return r.jsx(t,{...c,ref:a,children:p.isValidElement(m)?p.cloneElement(m,void 0,g):null})}return r.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function CD(e){const t=p.forwardRef((n,s)=>{const{children:a,...l}=n;if(p.isValidElement(a)){const c=RD(a),d=PD(l,a.props);return a.type!==p.Fragment&&(d.ref=s?wu(s,c):c),p.cloneElement(a,d)}return p.Children.count(a)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ED=Symbol("radix.slottable");function TD(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ED}function PD(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]=(...d)=>{const f=l(...d);return a(...d),f}:a&&(n[s]=a):s==="style"?n[s]={...a,...l}:s==="className"&&(n[s]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function RD(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 AD(e){const t=e+"CollectionProvider",[n,s]=yo(t),[a,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=k=>{const{scope:w,children:S}=k,T=Lt.useRef(null),N=Lt.useRef(new Map).current;return r.jsx(a,{scope:w,itemMap:N,collectionRef:T,children:S})};c.displayName=t;const d=e+"CollectionSlot",f=Pv(d),m=Lt.forwardRef((k,w)=>{const{scope:S,children:T}=k,N=l(d,S),A=bn(w,N.collectionRef);return r.jsx(f,{ref:A,children:T})});m.displayName=d;const g=e+"CollectionItemSlot",x="data-radix-collection-item",y=Pv(g),v=Lt.forwardRef((k,w)=>{const{scope:S,children:T,...N}=k,A=Lt.useRef(null),M=bn(w,A),R=l(g,S);return Lt.useEffect(()=>(R.itemMap.set(A,{ref:A,...N}),()=>void R.itemMap.delete(A))),r.jsx(y,{[x]:"",ref:M,children:T})});v.displayName=g;function E(k){const w=l(e+"CollectionConsumer",k);return Lt.useCallback(()=>{const T=w.collectionRef.current;if(!T)return[];const N=Array.from(T.querySelectorAll(`[${x}]`));return Array.from(w.itemMap.values()).sort((R,I)=>N.indexOf(R.ref.current)-N.indexOf(I.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},E,s]}var DD=p.createContext(void 0);function Wj(e){const t=p.useContext(DD);return e||t||"ltr"}var Jf="rovingFocusGroup.onEntryFocus",ID={bubbles:!1,cancelable:!0},rl="RovingFocusGroup",[Fp,Vj,OD]=AD(rl),[LD,qj]=yo(rl,[OD]),[$D,MD]=LD(rl),Kj=p.forwardRef((e,t)=>r.jsx(Fp.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(Fp.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(_D,{...e,ref:t})})}));Kj.displayName=rl;var _D=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:a=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:g=!1,...x}=e,y=p.useRef(null),v=bn(t,y),E=Wj(l),[k,w]=ju({prop:c,defaultProp:d??null,onChange:f,caller:rl}),[S,T]=p.useState(!1),N=mo(m),A=Vj(n),M=p.useRef(!1),[R,I]=p.useState(0);return p.useEffect(()=>{const O=y.current;if(O)return O.addEventListener(Jf,N),()=>O.removeEventListener(Jf,N)},[N]),r.jsx($D,{scope:n,orientation:s,dir:E,loop:a,currentTabStopId:k,onItemFocus:p.useCallback(O=>w(O),[w]),onItemShiftTab:p.useCallback(()=>T(!0),[]),onFocusableItemAdd:p.useCallback(()=>I(O=>O+1),[]),onFocusableItemRemove:p.useCallback(()=>I(O=>O-1),[]),children:r.jsx(Vt.div,{tabIndex:S||R===0?-1:0,"data-orientation":s,...x,ref:v,style:{outline:"none",...e.style},onMouseDown:Ct(e.onMouseDown,()=>{M.current=!0}),onFocus:Ct(e.onFocus,O=>{const Y=!M.current;if(O.target===O.currentTarget&&Y&&!S){const J=new CustomEvent(Jf,ID);if(O.currentTarget.dispatchEvent(J),!J.defaultPrevented){const _=A().filter(B=>B.focusable),U=_.find(B=>B.active),X=_.find(B=>B.id===k),G=[U,X,..._].filter(Boolean).map(B=>B.ref.current);Xj(G,g)}}M.current=!1}),onBlur:Ct(e.onBlur,()=>T(!1))})})}),Gj="RovingFocusGroupItem",Yj=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:a=!1,tabStopId:l,children:c,...d}=e,f=ii(),m=l||f,g=MD(Gj,n),x=g.currentTabStopId===m,y=Vj(n),{onFocusableItemAdd:v,onFocusableItemRemove:E,currentTabStopId:k}=g;return p.useEffect(()=>{if(s)return v(),()=>E()},[s,v,E]),r.jsx(Fp.ItemSlot,{scope:n,id:m,focusable:s,active:a,children:r.jsx(Vt.span,{tabIndex:x?0:-1,"data-orientation":g.orientation,...d,ref:t,onMouseDown:Ct(e.onMouseDown,w=>{s?g.onItemFocus(m):w.preventDefault()}),onFocus:Ct(e.onFocus,()=>g.onItemFocus(m)),onKeyDown:Ct(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){g.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const S=BD(w,g.orientation,g.dir);if(S!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let N=y().filter(A=>A.focusable).map(A=>A.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const A=N.indexOf(w.currentTarget);N=g.loop?UD(N,A+1):N.slice(A+1)}setTimeout(()=>Xj(N))}}),children:typeof c=="function"?c({isCurrentTabStop:x,hasTabStop:k!=null}):c})})});Yj.displayName=Gj;var FD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zD(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function BD(e,t,n){const s=zD(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return FD[s]}function Xj(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}function UD(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var HD=Kj,WD=Yj,Iu="Tabs",[VD]=yo(Iu,[qj]),Jj=qj(),[qD,uh]=VD(Iu),Qj=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:a,defaultValue:l,orientation:c="horizontal",dir:d,activationMode:f="automatic",...m}=e,g=Wj(d),[x,y]=ju({prop:s,onChange:a,defaultProp:l??"",caller:Iu});return r.jsx(qD,{scope:n,baseId:ii(),value:x,onValueChange:y,orientation:c,dir:g,activationMode:f,children:r.jsx(Vt.div,{dir:g,"data-orientation":c,...m,ref:t})})});Qj.displayName=Iu;var Zj="TabsList",ek=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...a}=e,l=uh(Zj,n),c=Jj(n);return r.jsx(HD,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:s,children:r.jsx(Vt.div,{role:"tablist","aria-orientation":l.orientation,...a,ref:t})})});ek.displayName=Zj;var tk="TabsTrigger",nk=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:a=!1,...l}=e,c=uh(tk,n),d=Jj(n),f=ok(c.baseId,s),m=ik(c.baseId,s),g=s===c.value;return r.jsx(WD,{asChild:!0,...d,focusable:!a,active:g,children:r.jsx(Vt.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":m,"data-state":g?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:f,...l,ref:t,onMouseDown:Ct(e.onMouseDown,x=>{!a&&x.button===0&&x.ctrlKey===!1?c.onValueChange(s):x.preventDefault()}),onKeyDown:Ct(e.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&c.onValueChange(s)}),onFocus:Ct(e.onFocus,()=>{const x=c.activationMode!=="manual";!g&&!a&&x&&c.onValueChange(s)})})})});nk.displayName=tk;var rk="TabsContent",sk=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:a,children:l,...c}=e,d=uh(rk,n),f=ok(d.baseId,s),m=ik(d.baseId,s),g=s===d.value,x=p.useRef(g);return p.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),r.jsx(vo,{present:a||g,children:({present:y})=>r.jsx(Vt.div,{"data-state":g?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":f,hidden:!y,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:x.current?"0s":void 0},children:y&&l})})});sk.displayName=rk;function ok(e,t){return`${e}-trigger-${t}`}function ik(e,t){return`${e}-content-${t}`}var ak=Qj,lk=ek,zp=nk,Bp=sk;function dh({value:e,onValueChange:t,items:n,className:s}){return r.jsxs(ak,{value:e,onValueChange:t,className:s,children:[r.jsx(lk,{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(zp,{value:a.value,className:ze("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(Bp,{value:a.value,className:"pt-3",children:a.content},a.value))]})}const KD="modulepreload",GD=function(e){return"/"+e},Rv={},YD=function(t,n,s){let a=Promise.resolve();if(n&&n.length>0){let c=function(m){return Promise.all(m.map(g=>Promise.resolve(g).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=c(n.map(m=>{if(m=GD(m),m in Rv)return;Rv[m]=!0;const g=m.endsWith(".css"),x=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${x}`))return;const y=document.createElement("link");if(y.rel=g?"stylesheet":KD,g||(y.as="script"),y.crossOrigin="",y.href=m,f&&y.setAttribute("nonce",f),document.head.appendChild(y),g)return new Promise((v,E)=>{y.addEventListener("load",v),y.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return a.then(c=>{for(const d of c||[])d.status==="rejected"&&l(d.reason);return t().catch(l)})};function XD({definition:e,className:t,nodeRoutes:n={}}){const s=p.useRef(null),[a,l]=p.useState(null),[c,d]=p.useState(!0),f=Et(),m=document.documentElement.classList.contains("dark")?"dark":"default";return p.useEffect(()=>{let g=!1;async function x(){if(s.current)try{const y=(await YD(async()=>{const{default:k}=await import("./mermaid.core-DM3qWr07.js").then(w=>w.bF);return{default:k}},[])).default;if(y.initialize({startOnLoad:!1,theme:"base",themeVariables:JD(m==="dark")}),g)return;const v=`mermaid-${Date.now()}`,{svg:E}=await y.render(v,e);if(g||!s.current)return;s.current.innerHTML=E,QD(s.current,n,f),d(!1)}catch(y){g||(l(y instanceof Error?y.message:"Failed to render graph"),d(!1))}}return d(!0),l(null),x(),()=>{g=!0}},[e,f,n,m]),a?r.jsxs("div",{className:ze("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:ze("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 JD(e){const t=document.documentElement,n=x=>{const y=getComputedStyle(t).getPropertyValue(x).trim();return y?`oklch(${y})`:""},s=n("--card"),a=n("--card-foreground"),l=n("--border"),c=n("--primary"),d=n("--primary-foreground"),f=n("--muted"),m=n("--muted-foreground"),g=n("--secondary");return{background:s,primaryColor:s,primaryTextColor:a,primaryBorderColor:l,secondaryColor:f,secondaryTextColor:a,secondaryBorderColor:l,tertiaryColor:f,tertiaryTextColor:m,tertiaryBorderColor:l,lineColor:e?m:l,textColor:a,mainBkg:s,nodeBkg:s,nodeTextColor:a,nodeBorder:l,clusterBkg:f,clusterBorder:l,edgeLabelBackground:s,titleColor:a,activeTaskBkgColor:c,activeTaskBorderColor:c,altBackground:f,labelColor:a,errorBkgColor:g,errorTextColor:d}}function QD(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 d=()=>n(c);a.addEventListener("click",d),a.addEventListener("keydown",f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),d())})}}function ZD(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const e4=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,t4=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,n4={};function Av(e,t){return(n4.jsx?t4:e4).test(e)}const r4=/[ \t\n\f\r]/g;function s4(e){return typeof e=="object"?e.type==="text"?Dv(e.value):!1:Dv(e)}function Dv(e){return e.replace(r4,"")===""}class sl{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}sl.prototype.normal={};sl.prototype.property={};sl.prototype.space=void 0;function ck(e,t){const n={},s={};for(const a of e)Object.assign(n,a.property),Object.assign(s,a.normal);return new sl(n,s,t)}function Up(e){return e.toLowerCase()}class Bn{constructor(t,n){this.attribute=n,this.property=t}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let o4=0;const Ge=jo(),Bt=jo(),Hp=jo(),ye=jo(),gt=jo(),ui=jo(),Yn=jo();function jo(){return 2**++o4}const Wp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ge,booleanish:Bt,commaOrSpaceSeparated:Yn,commaSeparated:ui,number:ye,overloadedBoolean:Hp,spaceSeparated:gt},Symbol.toStringTag,{value:"Module"})),Qf=Object.keys(Wp);class fh extends Bn{constructor(t,n,s,a){let l=-1;if(super(t,n),Iv(this,"space",a),typeof s=="number")for(;++l<Qf.length;){const c=Qf[l];Iv(this,Qf[l],(s&Wp[c])===Wp[c])}}}fh.prototype.defined=!0;function Iv(e,t,n){n&&(e[t]=n)}function Ni(e){const t={},n={};for(const[s,a]of Object.entries(e.properties)){const l=new fh(s,e.transform(e.attributes||{},s),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(l.mustUseProperty=!0),t[s]=l,n[Up(s)]=s,n[Up(l.attribute)]=s}return new sl(t,n,e.space)}const uk=Ni({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:gt,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:ye,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:gt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:Bt,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function dk(e,t){return t in e?e[t]:t}function fk(e,t){return dk(e,t.toLowerCase())}const i4=Ni({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ui,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:Ge,allowPaymentRequest:Ge,allowUserMedia:Ge,alt:null,as:null,async:Ge,autoCapitalize:null,autoComplete:gt,autoFocus:Ge,autoPlay:Ge,blocking:gt,capture:null,charSet:null,checked:Ge,cite:null,className:gt,cols:ye,colSpan:null,content:null,contentEditable:Bt,controls:Ge,controlsList:gt,coords:ye|ui,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ge,defer:Ge,dir:null,dirName:null,disabled:Ge,download:Hp,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ge,formTarget:null,headers:gt,height:ye,hidden:Hp,high:ye,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:Ge,inputMode:null,integrity:null,is:null,isMap:Ge,itemId:null,itemProp:gt,itemRef:gt,itemScope:Ge,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ge,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:Ge,muted:Ge,name:null,nonce:null,noModule:Ge,noValidate:Ge,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:Ge,optimum:ye,pattern:null,ping:gt,placeholder:null,playsInline:Ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ge,referrerPolicy:null,rel:gt,required:Ge,reversed:Ge,rows:ye,rowSpan:ye,sandbox:gt,scope:null,scoped:Ge,seamless:Ge,selected:Ge,shadowRootClonable:Ge,shadowRootDelegatesFocus:Ge,shadowRootMode:null,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:Ge,useMap:null,value:Bt,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ge,declare:Ge,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:Ge,noHref:Ge,noShade:Ge,noWrap:Ge,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ge,disableRemotePlayback:Ge,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:fk}),a4=Ni({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:Yn,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:gt,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:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:Ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,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:ui,g2:ui,glyphName:ui,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:Yn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,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:ye,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:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yn,rev:Yn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yn,requiredFeatures:Yn,requiredFonts:Yn,requiredFormats:Yn,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:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:Yn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yn,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:dk}),pk=Ni({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()}}),mk=Ni({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fk}),hk=Ni({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),l4={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"},c4=/[A-Z]/g,Ov=/-[a-z]/g,u4=/^data[-\w.:]+$/i;function d4(e,t){const n=Up(t);let s=t,a=Bn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&u4.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Ov,p4);s="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Ov.test(l)){let c=l.replace(c4,f4);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}a=fh}return new a(s,t)}function f4(e){return"-"+e.toLowerCase()}function p4(e){return e.charAt(1).toUpperCase()}const m4=ck([uk,i4,pk,mk,hk],"html"),ph=ck([uk,a4,pk,mk,hk],"svg");function h4(e){return e.join(" ").trim()}var Jo={},Zf,Lv;function g4(){if(Lv)return Zf;Lv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,f=`
476
- `,m="/",g="*",x="",y="comment",v="declaration";function E(w,S){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];S=S||{};var T=1,N=1;function A(q){var G=q.match(t);G&&(T+=G.length);var B=q.lastIndexOf(f);N=~B?q.length-B:N+q.length}function M(){var q={line:T,column:N};return function(G){return G.position=new R(q),Y(),G}}function R(q){this.start=q,this.end={line:T,column:N},this.source=S.source}R.prototype.content=w;function I(q){var G=new Error(S.source+":"+T+":"+N+": "+q);if(G.reason=q,G.filename=S.source,G.line=T,G.column=N,G.source=w,!S.silent)throw G}function O(q){var G=q.exec(w);if(G){var B=G[0];return A(B),w=w.slice(B.length),G}}function Y(){O(n)}function J(q){var G;for(q=q||[];G=_();)G!==!1&&q.push(G);return q}function _(){var q=M();if(!(m!=w.charAt(0)||g!=w.charAt(1))){for(var G=2;x!=w.charAt(G)&&(g!=w.charAt(G)||m!=w.charAt(G+1));)++G;if(G+=2,x===w.charAt(G-1))return I("End of comment missing");var B=w.slice(2,G-2);return N+=2,A(B),w=w.slice(G),N+=2,q({type:y,comment:B})}}function U(){var q=M(),G=O(s);if(G){if(_(),!O(a))return I("property missing ':'");var B=O(l),W=q({type:v,property:k(G[0].replace(e,x)),value:B?k(B[0].replace(e,x)):x});return O(c),W}}function X(){var q=[];J(q);for(var G;G=U();)G!==!1&&(q.push(G),J(q));return q}return Y(),X()}function k(w){return w?w.replace(d,x):x}return Zf=E,Zf}var $v;function x4(){if($v)return Jo;$v=1;var e=Jo&&Jo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=n;const t=e(g4());function n(s,a){let l=null;if(!s||typeof s!="string")return l;const c=(0,t.default)(s),d=typeof a=="function";return c.forEach(f=>{if(f.type!=="declaration")return;const{property:m,value:g}=f;d?a(m,g,f):g&&(l=l||{},l[m]=g)}),l}return Jo}var xa={},Mv;function y4(){if(Mv)return xa;Mv=1,Object.defineProperty(xa,"__esModule",{value:!0}),xa.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,g){return g.toUpperCase()},d=function(m,g){return"".concat(g,"-")},f=function(m,g){return g===void 0&&(g={}),l(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(a,d):m=m.replace(s,d),m.replace(t,c))};return xa.camelCase=f,xa}var ya,_v;function v4(){if(_v)return ya;_v=1;var e=ya&&ya.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(x4()),n=y4();function s(a,l){var c={};return!a||typeof a!="string"||(0,t.default)(a,function(d,f){d&&f&&(c[(0,n.camelCase)(d,l)]=f)}),c}return s.default=s,ya=s,ya}var b4=v4();const w4=mu(b4),gk=xk("end"),mh=xk("start");function xk(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 j4(e){const t=mh(e),n=gk(e);if(t&&n)return{start:t,end:n}}function Ta(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Fv(e.position):"start"in e||"end"in e?Fv(e):"line"in e||"column"in e?Vp(e):""}function Vp(e){return zv(e&&e.line)+":"+zv(e&&e.column)}function Fv(e){return Vp(e&&e.start)+"-"+Vp(e&&e.end)}function zv(e){return e&&typeof e=="number"?e:1}class jn 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 f=s.indexOf(":");f===-1?l.ruleId=s:(l.source=s.slice(0,f),l.ruleId=s.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const d=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=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=d?d.line:void 0,this.name=Ta(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}}jn.prototype.file="";jn.prototype.name="";jn.prototype.reason="";jn.prototype.message="";jn.prototype.stack="";jn.prototype.column=void 0;jn.prototype.line=void 0;jn.prototype.ancestors=void 0;jn.prototype.cause=void 0;jn.prototype.fatal=void 0;jn.prototype.place=void 0;jn.prototype.ruleId=void 0;jn.prototype.source=void 0;const hh={}.hasOwnProperty,k4=new Map,S4=/[A-Z]/g,N4=new Set(["table","tbody","thead","tfoot","tr"]),C4=new Set(["td","th"]),yk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function E4(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=L4(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=O4(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"?ph:m4,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=vk(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function vk(e,t,n){if(t.type==="element")return T4(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return P4(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return A4(e,t,n);if(t.type==="mdxjsEsm")return R4(e,t);if(t.type==="root")return D4(e,t,n);if(t.type==="text")return I4(e,t)}function T4(e,t,n){const s=e.schema;let a=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(a=ph,e.schema=a),e.ancestors.push(t);const l=wk(e,t.tagName,!1),c=$4(e,t);let d=xh(e,t);return N4.has(t.tagName)&&(d=d.filter(function(f){return typeof f=="string"?!s4(f):!0})),bk(e,c,l,t),gh(c,d),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function P4(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)}Wa(e,t.position)}function R4(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Wa(e,t.position)}function A4(e,t,n){const s=e.schema;let a=s;t.name==="svg"&&s.space==="html"&&(a=ph,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:wk(e,t.name,!0),c=M4(e,t),d=xh(e,t);return bk(e,c,l,t),gh(c,d),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function D4(e,t,n){const s={};return gh(s,xh(e,t)),e.create(t,e.Fragment,s,n)}function I4(e,t){return t.value}function bk(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function gh(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function O4(e,t,n){return s;function s(a,l,c,d){const m=Array.isArray(c.children)?n:t;return d?m(l,c,d):m(l,c)}}function L4(e,t){return n;function n(s,a,l,c){const d=Array.isArray(l.children),f=mh(s);return t(a,l,c,d,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function $4(e,t){const n={};let s,a;for(a in t.properties)if(a!=="children"&&hh.call(t.properties,a)){const l=_4(e,a,t.properties[a]);if(l){const[c,d]=l;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&C4.has(t.tagName)?s=d:n[c]=d}}if(s){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function M4(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 d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else Wa(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 d=s.value.data.estree.body[0];d.type,l=e.evaluater.evaluateExpression(d.expression)}else Wa(e,t.position);else l=s.value===null?!0:s.value;n[a]=l}return n}function xh(e,t){const n=[];let s=-1;const a=e.passKeys?new Map:k4;for(;++s<t.children.length;){const l=t.children[s];let c;if(e.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const m=a.get(f)||0;c=f+"-"+m,a.set(f,m+1)}}const d=vk(e,l,c);d!==void 0&&n.push(d)}return n}function _4(e,t,n){const s=d4(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?ZD(n):h4(n)),s.property==="style"){let a=typeof n=="object"?n:F4(e,String(n));return e.stylePropertyNameCase==="css"&&(a=z4(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&s.space?l4[s.property]||s.property:s.attribute,n]}}function F4(e,t){try{return w4(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,a=new jn("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=yk+"#cannot-parse-style-attribute",a}}function wk(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 d=Av(a[l])?{type:"Identifier",name:a[l]}:{type:"Literal",value:a[l]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(l&&d.type==="Literal"),optional:!1}:d}s=c}else s=Av(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const a=s.value;return hh.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(s);Wa(e)}function Wa(e,t){const n=new jn("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=yk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function z4(e){const t={};let n;for(n in e)hh.call(e,n)&&(t[B4(n)]=e[n]);return t}function B4(e){let t=e.replace(S4,U4);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function U4(e){return"-"+e.toLowerCase()}const ep={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"]},H4={};function W4(e,t){const n=H4,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return jk(e,s,a)}function jk(e,t,n){if(V4(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 Bv(e.children,t,n)}return Array.isArray(e)?Bv(e,t,n):""}function Bv(e,t,n){const s=[];let a=-1;for(;++a<e.length;)s[a]=jk(e[a],t,n);return s.join("")}function V4(e){return!!(e&&typeof e=="object")}const Uv=document.createElement("i");function yh(e){const t="&"+e+";";Uv.innerHTML=t;const n=Uv.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Gr(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 lr(e,t){return e.length>0?(Gr(e,e.length,0,t),e):t}const Hv={}.hasOwnProperty;function q4(e){const t={};let n=-1;for(;++n<e.length;)K4(t,e[n]);return t}function K4(e,t){let n;for(n in t){const a=(Hv.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let c;if(l)for(c in l){Hv.call(a,c)||(a[c]=[]);const d=l[c];G4(a[c],Array.isArray(d)?d:d?[d]:[])}}}function G4(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);Gr(e,0,0,s)}function kk(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 di(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _r=Ys(/[A-Za-z]/),Qn=Ys(/[\dA-Za-z]/),Y4=Ys(/[#-'*+\--9=?A-Z^-~]/);function qp(e){return e!==null&&(e<32||e===127)}const Kp=Ys(/\d/),X4=Ys(/[\dA-Fa-f]/),J4=Ys(/[!-/:-@[-`{-~]/);function Ue(e){return e!==null&&e<-2}function Fn(e){return e!==null&&(e<0||e===32)}function rt(e){return e===-2||e===-1||e===32}const Q4=Ys(new RegExp("\\p{P}|\\p{S}","u")),Z4=Ys(/\s/);function Ys(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ci(e){const t=[];let n=-1,s=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let c="";if(l===37&&Qn(e.charCodeAt(n+1))&&Qn(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 d=e.charCodeAt(n+1);l<56320&&d>56319&&d<57344?(c=String.fromCharCode(l,d),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 xt(e,t,n,s){const a=s?s-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(f){return rt(f)?(e.enter(n),d(f)):t(f)}function d(f){return rt(f)&&l++<a?(e.consume(f),d):(e.exit(n),t(f))}}const eI={tokenize:tI};function tI(e){const t=e.attempt(this.parser.constructs.contentInitial,s,a);let n;return t;function s(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),xt(e,t,"linePrefix")}function a(d){return e.enter("paragraph"),l(d)}function l(d){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Ue(d)?(e.consume(d),e.exit("chunkText"),l):(e.consume(d),c)}}const nI={tokenize:rI},Wv={tokenize:sI};function rI(e){const t=this,n=[];let s=0,a,l,c;return d;function d(N){if(s<n.length){const A=n[s];return t.containerState=A[1],e.attempt(A[0].continuation,f,m)(N)}return m(N)}function f(N){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&T();const A=t.events.length;let M=A,R;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){R=t.events[M][1].end;break}S(s);let I=A;for(;I<t.events.length;)t.events[I][1].end={...R},I++;return Gr(t.events,M+1,0,t.events.slice(A)),t.events.length=I,m(N)}return d(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(Wv,g,x)(N)}function g(N){return a&&T(),S(s),y(N)}function x(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(Wv,v,E)(N)}function v(N){return s++,n.push([t.currentConstruct,t.containerState]),y(N)}function E(N){if(N===null){a&&T(),S(0),e.consume(N);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),k(N)}function k(N){if(N===null){w(e.exit("chunkFlow"),!0),S(0),e.consume(N);return}return Ue(N)?(e.consume(N),w(e.exit("chunkFlow")),s=0,t.interrupt=void 0,d):(e.consume(N),k)}function w(N,A){const M=t.sliceStream(N);if(A&&M.push(null),N.previous=l,l&&(l.next=N),l=N,a.defineSkip(N.start),a.write(M),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 I=t.events.length;let O=I,Y,J;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(Y){J=t.events[O][1].end;break}Y=!0}for(S(s),R=I;R<t.events.length;)t.events[R][1].end={...J},R++;Gr(t.events,O+1,0,t.events.slice(I)),t.events.length=R}}function S(N){let A=n.length;for(;A-- >N;){const M=n[A];t.containerState=M[1],M[0].exit.call(t,e)}n.length=N}function T(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function sI(e,t,n){return xt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vv(e){if(e===null||Fn(e)||Z4(e))return 1;if(Q4(e))return 2}function vh(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 Gp={name:"attention",resolveAll:oI,tokenize:iI};function oI(e,t){let n=-1,s,a,l,c,d,f,m,g;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;f=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 x={...e[s][1].end},y={...e[n][1].start};qv(x,-f),qv(y,f),c={type:f>1?"strongSequence":"emphasisSequence",start:x,end:{...e[s][1].end}},d={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:f>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[s][1].end={...c.start},e[n][1].start={...d.end},m=[],e[s][1].end.offset-e[s][1].start.offset&&(m=lr(m,[["enter",e[s][1],t],["exit",e[s][1],t]])),m=lr(m,[["enter",a,t],["enter",c,t],["exit",c,t],["enter",l,t]]),m=lr(m,vh(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),m=lr(m,[["exit",l,t],["enter",d,t],["exit",d,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=lr(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Gr(e,s-1,n-s+3,m),n=s+m.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function iI(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,a=Vv(s);let l;return c;function c(f){return l=f,e.enter("attentionSequence"),d(f)}function d(f){if(f===l)return e.consume(f),d;const m=e.exit("attentionSequence"),g=Vv(f),x=!g||g===2&&a||n.includes(f),y=!a||a===2&&g||n.includes(s);return m._open=!!(l===42?x:x&&(a||!y)),m._close=!!(l===42?y:y&&(g||!x)),t(f)}}function qv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const aI={name:"autolink",tokenize:lI};function lI(e,t,n){let s=0;return a;function a(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(v){return _r(v)?(e.consume(v),c):v===64?n(v):m(v)}function c(v){return v===43||v===45||v===46||Qn(v)?(s=1,d(v)):m(v)}function d(v){return v===58?(e.consume(v),s=0,f):(v===43||v===45||v===46||Qn(v))&&s++<32?(e.consume(v),d):(s=0,m(v))}function f(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||qp(v)?n(v):(e.consume(v),f)}function m(v){return v===64?(e.consume(v),g):Y4(v)?(e.consume(v),m):n(v)}function g(v){return Qn(v)?x(v):n(v)}function x(v){return v===46?(e.consume(v),s=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||Qn(v))&&s++<63){const E=v===45?y:x;return e.consume(v),E}return n(v)}}const Ou={partial:!0,tokenize:cI};function cI(e,t,n){return s;function s(l){return rt(l)?xt(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||Ue(l)?t(l):n(l)}}const Sk={continuation:{tokenize:dI},exit:fI,name:"blockQuote",tokenize:uI};function uI(e,t,n){const s=this;return a;function a(c){if(c===62){const d=s.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),l}return n(c)}function l(c){return rt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function dI(e,t,n){const s=this;return a;function a(c){return rt(c)?xt(e,l,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return e.attempt(Sk,t,n)(c)}}function fI(e){e.exit("blockQuote")}const Nk={name:"characterEscape",tokenize:pI};function pI(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 J4(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const Ck={name:"characterReference",tokenize:mI};function mI(e,t,n){const s=this;let a=0,l,c;return d;function d(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),f}function f(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),l=31,c=Qn,g(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,c=X4,g):(e.enter("characterReferenceValue"),l=7,c=Kp,g(x))}function g(x){if(x===59&&a){const y=e.exit("characterReferenceValue");return c===Qn&&!yh(s.sliceSerialize(y))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(x)&&a++<l?(e.consume(x),g):n(x)}}const Kv={partial:!0,tokenize:gI},Gv={concrete:!0,name:"codeFenced",tokenize:hI};function hI(e,t,n){const s=this,a={partial:!0,tokenize:M};let l=0,c=0,d;return f;function f(R){return m(R)}function m(R){const I=s.events[s.events.length-1];return l=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,d=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===d?(c++,e.consume(R),g):c<3?n(R):(e.exit("codeFencedFenceSequence"),rt(R)?xt(e,x,"whitespace")(R):x(R))}function x(R){return R===null||Ue(R)?(e.exit("codeFencedFence"),s.interrupt?t(R):e.check(Kv,k,A)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(R))}function y(R){return R===null||Ue(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(R)):rt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xt(e,v,"whitespace")(R)):R===96&&R===d?n(R):(e.consume(R),y)}function v(R){return R===null||Ue(R)?x(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(R))}function E(R){return R===null||Ue(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(R)):R===96&&R===d?n(R):(e.consume(R),E)}function k(R){return e.attempt(a,A,w)(R)}function w(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),S}function S(R){return l>0&&rt(R)?xt(e,T,"linePrefix",l+1)(R):T(R)}function T(R){return R===null||Ue(R)?e.check(Kv,k,A)(R):(e.enter("codeFlowValue"),N(R))}function N(R){return R===null||Ue(R)?(e.exit("codeFlowValue"),T(R)):(e.consume(R),N)}function A(R){return e.exit("codeFenced"),t(R)}function M(R,I,O){let Y=0;return J;function J(G){return R.enter("lineEnding"),R.consume(G),R.exit("lineEnding"),_}function _(G){return R.enter("codeFencedFence"),rt(G)?xt(R,U,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):U(G)}function U(G){return G===d?(R.enter("codeFencedFenceSequence"),X(G)):O(G)}function X(G){return G===d?(Y++,R.consume(G),X):Y>=c?(R.exit("codeFencedFenceSequence"),rt(G)?xt(R,q,"whitespace")(G):q(G)):O(G)}function q(G){return G===null||Ue(G)?(R.exit("codeFencedFence"),I(G)):O(G)}}}function gI(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 tp={name:"codeIndented",tokenize:yI},xI={partial:!0,tokenize:vI};function yI(e,t,n){const s=this;return a;function a(m){return e.enter("codeIndented"),xt(e,l,"linePrefix",5)(m)}function l(m){const g=s.events[s.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(m):n(m)}function c(m){return m===null?f(m):Ue(m)?e.attempt(xI,c,f)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||Ue(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),d)}function f(m){return e.exit("codeIndented"),t(m)}}function vI(e,t,n){const s=this;return a;function a(c){return s.parser.lazy[s.now().line]?n(c):Ue(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):xt(e,l,"linePrefix",5)(c)}function l(c){const d=s.events[s.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):Ue(c)?a(c):n(c)}}const bI={name:"codeText",previous:jI,resolve:wI,tokenize:kI};function wI(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 jI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function kI(e,t,n){let s=0,a,l;return c;function c(x){return e.enter("codeText"),e.enter("codeTextSequence"),d(x)}function d(x){return x===96?(e.consume(x),s++,d):(e.exit("codeTextSequence"),f(x))}function f(x){return x===null?n(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),f):x===96?(l=e.enter("codeTextSequence"),a=0,g(x)):Ue(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),f):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Ue(x)?(e.exit("codeTextData"),f(x)):(e.consume(x),m)}function g(x){return x===96?(e.consume(x),a++,g):a===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(l.type="codeTextData",m(x))}}class SI{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&&va(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),va(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),va(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);va(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);va(this.left,n.reverse())}}}function va(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 Ek(e){const t={};let n=-1,s,a,l,c,d,f,m;const g=new SI(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(s=g.get(n),n&&s[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(f=s[1]._tokenizer.events,l=0,l<f.length&&f[l][1].type==="lineEndingBlank"&&(l+=2),l<f.length&&f[l][1].type==="content"))for(;++l<f.length&&f[l][1].type!=="content";)f[l][1].type==="chunkText"&&(f[l][1]._isInFirstContentOfListItem=!0,l++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,NI(g,n)),n=t[n],m=!0);else if(s[1]._container){for(l=n,a=void 0;l--;)if(c=g.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(a&&(g.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={...g.get(a)[1].start},d=g.slice(a,n),d.unshift(s),g.splice(a,n-a+1,d))}}return Gr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function NI(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 d=c.events,f=[],m={};let g,x,y=-1,v=n,E=0,k=0;const w=[k];for(;v;){for(;e.get(++a)[1]!==v;);l.push(a),v._tokenizer||(g=s.sliceStream(v),v.next||g.push(null),x&&c.defineSkip(v.start),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(g),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),x=v,v=v.next}for(v=n;++y<d.length;)d[y][0]==="exit"&&d[y-1][0]==="enter"&&d[y][1].type===d[y-1][1].type&&d[y][1].start.line!==d[y][1].end.line&&(k=y+1,w.push(k),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(c.events=[],v?(v._tokenizer=void 0,v.previous=void 0):w.pop(),y=w.length;y--;){const S=d.slice(w[y],w[y+1]),T=l.pop();f.push([T,T+S.length-1]),e.splice(T,2,S)}for(f.reverse(),y=-1;++y<f.length;)m[E+f[y][0]]=E+f[y][1],E+=f[y][1]-f[y][0]-1;return m}const CI={resolve:TI,tokenize:PI},EI={partial:!0,tokenize:RI};function TI(e){return Ek(e),e}function PI(e,t){let n;return s;function s(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(d)}function a(d){return d===null?l(d):Ue(d)?e.check(EI,c,l)(d):(e.consume(d),a)}function l(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function RI(e,t,n){const s=this;return a;function a(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),xt(e,l,"linePrefix")}function l(c){if(c===null||Ue(c))return n(c);const d=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(s.parser.constructs.flow,n,t)(c)}}function Tk(e,t,n,s,a,l,c,d,f){const m=f||Number.POSITIVE_INFINITY;let g=0;return x;function x(S){return S===60?(e.enter(s),e.enter(a),e.enter(l),e.consume(S),e.exit(l),y):S===null||S===32||S===41||qp(S)?n(S):(e.enter(s),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),k(S))}function y(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(a),e.exit(s),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===62?(e.exit("chunkString"),e.exit(d),y(S)):S===null||S===60||Ue(S)?n(S):(e.consume(S),S===92?E:v)}function E(S){return S===60||S===62||S===92?(e.consume(S),v):v(S)}function k(S){return!g&&(S===null||S===41||Fn(S))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(s),t(S)):g<m&&S===40?(e.consume(S),g++,k):S===41?(e.consume(S),g--,k):S===null||S===32||S===40||qp(S)?n(S):(e.consume(S),S===92?w:k)}function w(S){return S===40||S===41||S===92?(e.consume(S),k):k(S)}}function Pk(e,t,n,s,a,l){const c=this;let d=0,f;return m;function m(v){return e.enter(s),e.enter(a),e.consume(v),e.exit(a),e.enter(l),g}function g(v){return d>999||v===null||v===91||v===93&&!f||v===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(v):v===93?(e.exit(l),e.enter(a),e.consume(v),e.exit(a),e.exit(s),t):Ue(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),x(v))}function x(v){return v===null||v===91||v===93||Ue(v)||d++>999?(e.exit("chunkString"),g(v)):(e.consume(v),f||(f=!rt(v)),v===92?y:x)}function y(v){return v===91||v===92||v===93?(e.consume(v),d++,x):x(v)}}function Rk(e,t,n,s,a,l){let c;return d;function d(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,f):n(y)}function f(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),f(c)):y===null?n(y):Ue(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),xt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===c||y===null||Ue(y)?(e.exit("chunkString"),m(y)):(e.consume(y),y===92?x:g)}function x(y){return y===c||y===92?(e.consume(y),g):g(y)}}function Pa(e,t){let n;return s;function s(a){return Ue(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,s):rt(a)?xt(e,s,n?"linePrefix":"lineSuffix")(a):t(a)}}const AI={name:"definition",tokenize:II},DI={partial:!0,tokenize:OI};function II(e,t,n){const s=this;let a;return l;function l(v){return e.enter("definition"),c(v)}function c(v){return Pk.call(s,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function d(v){return a=di(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),f):n(v)}function f(v){return Fn(v)?Pa(e,m)(v):m(v)}function m(v){return Tk(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(DI,x,x)(v)}function x(v){return rt(v)?xt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Ue(v)?(e.exit("definition"),s.parser.defined.push(a),t(v)):n(v)}}function OI(e,t,n){return s;function s(d){return Fn(d)?Pa(e,a)(d):n(d)}function a(d){return Rk(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function l(d){return rt(d)?xt(e,c,"whitespace")(d):c(d)}function c(d){return d===null||Ue(d)?t(d):n(d)}}const LI={name:"hardBreakEscape",tokenize:$I};function $I(e,t,n){return s;function s(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Ue(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const MI={name:"headingAtx",resolve:_I,tokenize:FI};function _I(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"},Gr(e,s,n-s+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function FI(e,t,n){let s=0;return a;function a(g){return e.enter("atxHeading"),l(g)}function l(g){return e.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&s++<6?(e.consume(g),c):g===null||Fn(g)?(e.exit("atxHeadingSequence"),d(g)):n(g)}function d(g){return g===35?(e.enter("atxHeadingSequence"),f(g)):g===null||Ue(g)?(e.exit("atxHeading"),t(g)):rt(g)?xt(e,d,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function f(g){return g===35?(e.consume(g),f):(e.exit("atxHeadingSequence"),d(g))}function m(g){return g===null||g===35||Fn(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),m)}}const zI=["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"],Yv=["pre","script","style","textarea"],BI={concrete:!0,name:"htmlFlow",resolveTo:WI,tokenize:VI},UI={partial:!0,tokenize:KI},HI={partial:!0,tokenize:qI};function WI(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 VI(e,t,n){const s=this;let a,l,c,d,f;return m;function m(L){return g(L)}function g(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),x}function x(L){return L===33?(e.consume(L),y):L===47?(e.consume(L),l=!0,k):L===63?(e.consume(L),a=3,s.interrupt?t:C):_r(L)?(e.consume(L),c=String.fromCharCode(L),w):n(L)}function y(L){return L===45?(e.consume(L),a=2,v):L===91?(e.consume(L),a=5,d=0,E):_r(L)?(e.consume(L),a=4,s.interrupt?t:C):n(L)}function v(L){return L===45?(e.consume(L),s.interrupt?t:C):n(L)}function E(L){const ae="CDATA[";return L===ae.charCodeAt(d++)?(e.consume(L),d===ae.length?s.interrupt?t:U:E):n(L)}function k(L){return _r(L)?(e.consume(L),c=String.fromCharCode(L),w):n(L)}function w(L){if(L===null||L===47||L===62||Fn(L)){const ae=L===47,ce=c.toLowerCase();return!ae&&!l&&Yv.includes(ce)?(a=1,s.interrupt?t(L):U(L)):zI.includes(c.toLowerCase())?(a=6,ae?(e.consume(L),S):s.interrupt?t(L):U(L)):(a=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(L):l?T(L):N(L))}return L===45||Qn(L)?(e.consume(L),c+=String.fromCharCode(L),w):n(L)}function S(L){return L===62?(e.consume(L),s.interrupt?t:U):n(L)}function T(L){return rt(L)?(e.consume(L),T):J(L)}function N(L){return L===47?(e.consume(L),J):L===58||L===95||_r(L)?(e.consume(L),A):rt(L)?(e.consume(L),N):J(L)}function A(L){return L===45||L===46||L===58||L===95||Qn(L)?(e.consume(L),A):M(L)}function M(L){return L===61?(e.consume(L),R):rt(L)?(e.consume(L),M):N(L)}function R(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),f=L,I):rt(L)?(e.consume(L),R):O(L)}function I(L){return L===f?(e.consume(L),f=null,Y):L===null||Ue(L)?n(L):(e.consume(L),I)}function O(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||Fn(L)?M(L):(e.consume(L),O)}function Y(L){return L===47||L===62||rt(L)?N(L):n(L)}function J(L){return L===62?(e.consume(L),_):n(L)}function _(L){return L===null||Ue(L)?U(L):rt(L)?(e.consume(L),_):n(L)}function U(L){return L===45&&a===2?(e.consume(L),B):L===60&&a===1?(e.consume(L),W):L===62&&a===4?(e.consume(L),$):L===63&&a===3?(e.consume(L),C):L===93&&a===5?(e.consume(L),ee):Ue(L)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(UI,Z,X)(L)):L===null||Ue(L)?(e.exit("htmlFlowData"),X(L)):(e.consume(L),U)}function X(L){return e.check(HI,q,Z)(L)}function q(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),G}function G(L){return L===null||Ue(L)?X(L):(e.enter("htmlFlowData"),U(L))}function B(L){return L===45?(e.consume(L),C):U(L)}function W(L){return L===47?(e.consume(L),c="",D):U(L)}function D(L){if(L===62){const ae=c.toLowerCase();return Yv.includes(ae)?(e.consume(L),$):U(L)}return _r(L)&&c.length<8?(e.consume(L),c+=String.fromCharCode(L),D):U(L)}function ee(L){return L===93?(e.consume(L),C):U(L)}function C(L){return L===62?(e.consume(L),$):L===45&&a===2?(e.consume(L),C):U(L)}function $(L){return L===null||Ue(L)?(e.exit("htmlFlowData"),Z(L)):(e.consume(L),$)}function Z(L){return e.exit("htmlFlow"),t(L)}}function qI(e,t,n){const s=this;return a;function a(c){return Ue(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 KI(e,t,n){return s;function s(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Ou,t,n)}}const GI={name:"htmlText",tokenize:YI};function YI(e,t,n){const s=this;let a,l,c;return d;function d(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),f}function f(C){return C===33?(e.consume(C),m):C===47?(e.consume(C),M):C===63?(e.consume(C),N):_r(C)?(e.consume(C),O):n(C)}function m(C){return C===45?(e.consume(C),g):C===91?(e.consume(C),l=0,E):_r(C)?(e.consume(C),T):n(C)}function g(C){return C===45?(e.consume(C),v):n(C)}function x(C){return C===null?n(C):C===45?(e.consume(C),y):Ue(C)?(c=x,W(C)):(e.consume(C),x)}function y(C){return C===45?(e.consume(C),v):x(C)}function v(C){return C===62?B(C):C===45?y(C):x(C)}function E(C){const $="CDATA[";return C===$.charCodeAt(l++)?(e.consume(C),l===$.length?k:E):n(C)}function k(C){return C===null?n(C):C===93?(e.consume(C),w):Ue(C)?(c=k,W(C)):(e.consume(C),k)}function w(C){return C===93?(e.consume(C),S):k(C)}function S(C){return C===62?B(C):C===93?(e.consume(C),S):k(C)}function T(C){return C===null||C===62?B(C):Ue(C)?(c=T,W(C)):(e.consume(C),T)}function N(C){return C===null?n(C):C===63?(e.consume(C),A):Ue(C)?(c=N,W(C)):(e.consume(C),N)}function A(C){return C===62?B(C):N(C)}function M(C){return _r(C)?(e.consume(C),R):n(C)}function R(C){return C===45||Qn(C)?(e.consume(C),R):I(C)}function I(C){return Ue(C)?(c=I,W(C)):rt(C)?(e.consume(C),I):B(C)}function O(C){return C===45||Qn(C)?(e.consume(C),O):C===47||C===62||Fn(C)?Y(C):n(C)}function Y(C){return C===47?(e.consume(C),B):C===58||C===95||_r(C)?(e.consume(C),J):Ue(C)?(c=Y,W(C)):rt(C)?(e.consume(C),Y):B(C)}function J(C){return C===45||C===46||C===58||C===95||Qn(C)?(e.consume(C),J):_(C)}function _(C){return C===61?(e.consume(C),U):Ue(C)?(c=_,W(C)):rt(C)?(e.consume(C),_):Y(C)}function U(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),a=C,X):Ue(C)?(c=U,W(C)):rt(C)?(e.consume(C),U):(e.consume(C),q)}function X(C){return C===a?(e.consume(C),a=void 0,G):C===null?n(C):Ue(C)?(c=X,W(C)):(e.consume(C),X)}function q(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||Fn(C)?Y(C):(e.consume(C),q)}function G(C){return C===47||C===62||Fn(C)?Y(C):n(C)}function B(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function W(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),D}function D(C){return rt(C)?xt(e,ee,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):ee(C)}function ee(C){return e.enter("htmlTextData"),c(C)}}const bh={name:"labelEnd",resolveAll:ZI,resolveTo:eO,tokenize:tO},XI={tokenize:nO},JI={tokenize:rO},QI={tokenize:sO};function ZI(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&&Gr(e,0,e.length,n),e}function eO(e,t){let n=e.length,s=0,a,l,c,d;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 f={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}},g={type:"labelText",start:{...e[l+s+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",f,t],["enter",m,t]],d=lr(d,e.slice(l+1,l+s+3)),d=lr(d,[["enter",g,t]]),d=lr(d,vh(t.parser.constructs.insideSpan.null,e.slice(l+s+4,c-3),t)),d=lr(d,[["exit",g,t],e[c-2],e[c-1],["exit",m,t]]),d=lr(d,e.slice(c+1)),d=lr(d,[["exit",f,t]]),Gr(e,l,e.length,d),e}function tO(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 d;function d(y){return l?l._inactive?x(y):(c=s.parser.defined.includes(di(s.sliceSerialize({start:l.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),f):n(y)}function f(y){return y===40?e.attempt(XI,g,c?g:x)(y):y===91?e.attempt(JI,g,c?m:x)(y):c?g(y):x(y)}function m(y){return e.attempt(QI,g,x)(y)}function g(y){return t(y)}function x(y){return l._balanced=!0,n(y)}}function nO(e,t,n){return s;function s(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),a}function a(x){return Fn(x)?Pa(e,l)(x):l(x)}function l(x){return x===41?g(x):Tk(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function c(x){return Fn(x)?Pa(e,f)(x):g(x)}function d(x){return n(x)}function f(x){return x===34||x===39||x===40?Rk(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):g(x)}function m(x){return Fn(x)?Pa(e,g)(x):g(x)}function g(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),t):n(x)}}function rO(e,t,n){const s=this;return a;function a(d){return Pk.call(s,e,l,c,"reference","referenceMarker","referenceString")(d)}function l(d){return s.parser.defined.includes(di(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function sO(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 oO={name:"labelStartImage",resolveAll:bh.resolveAll,tokenize:iO};function iO(e,t,n){const s=this;return a;function a(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),l}function l(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):n(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):t(d)}}const aO={name:"labelStartLink",resolveAll:bh.resolveAll,tokenize:lO};function lO(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 np={name:"lineEnding",tokenize:cO};function cO(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),xt(e,t,"linePrefix")}}const qc={name:"thematicBreak",tokenize:uO};function uO(e,t,n){let s=0,a;return l;function l(m){return e.enter("thematicBreak"),c(m)}function c(m){return a=m,d(m)}function d(m){return m===a?(e.enter("thematicBreakSequence"),f(m)):s>=3&&(m===null||Ue(m))?(e.exit("thematicBreak"),t(m)):n(m)}function f(m){return m===a?(e.consume(m),s++,f):(e.exit("thematicBreakSequence"),rt(m)?xt(e,d,"whitespace")(m):d(m))}}const $n={continuation:{tokenize:mO},exit:gO,name:"list",tokenize:pO},dO={partial:!0,tokenize:xO},fO={partial:!0,tokenize:hO};function pO(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 d;function d(v){const E=s.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!s.containerState.marker||v===s.containerState.marker:Kp(v)){if(s.containerState.type||(s.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(qc,n,m)(v):m(v);if(!s.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(v)}return n(v)}function f(v){return Kp(v)&&++c<10?(e.consume(v),f):(!s.interrupt||c<2)&&(s.containerState.marker?v===s.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),m(v)):n(v)}function m(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||v,e.check(Ou,s.interrupt?n:g,e.attempt(dO,y,x))}function g(v){return s.containerState.initialBlankLine=!0,l++,y(v)}function x(v){return rt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return s.containerState.size=l+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function mO(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(Ou,a,l);function a(d){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,xt(e,t,"listItemIndent",s.containerState.size+1)(d)}function l(d){return s.containerState.furtherBlankLines||!rt(d)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(d)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(fO,t,c)(d))}function c(d){return s.containerState._closeFlow=!0,s.interrupt=void 0,xt(e,e.attempt($n,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function hO(e,t,n){const s=this;return xt(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 gO(e){e.exit(this.containerState.type)}function xO(e,t,n){const s=this;return xt(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!rt(l)&&c&&c[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Xv={name:"setextUnderline",resolveTo:yO,tokenize:vO};function yO(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 vO(e,t,n){const s=this;let a;return l;function l(m){let g=s.events.length,x;for(;g--;)if(s.events[g][1].type!=="lineEnding"&&s.events[g][1].type!=="linePrefix"&&s.events[g][1].type!=="content"){x=s.events[g][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||x)?(e.enter("setextHeadingLine"),a=m,c(m)):n(m)}function c(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===a?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),rt(m)?xt(e,f,"lineSuffix")(m):f(m))}function f(m){return m===null||Ue(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const bO={tokenize:wO};function wO(e){const t=this,n=e.attempt(Ou,s,e.attempt(this.parser.constructs.flowInitial,a,xt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(CI,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 jO={resolveAll:Dk()},kO=Ak("string"),SO=Ak("text");function Ak(e){return{resolveAll:Dk(e==="text"?NO:void 0),tokenize:t};function t(n){const s=this,a=this.parser.constructs[e],l=n.attempt(a,c,d);return c;function c(g){return m(g)?l(g):d(g)}function d(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),f}function f(g){return m(g)?(n.exit("data"),l(g)):(n.consume(g),f)}function m(g){if(g===null)return!0;const x=a[g];let y=-1;if(x)for(;++y<x.length;){const v=x[y];if(!v.previous||v.previous.call(s,s.previous))return!0}return!1}}}function Dk(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 NO(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,d=0,f;for(;l--;){const m=a[l];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(m===-2)f=!0,d++;else if(m!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const m={type:n===e.length||f||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:s.start._bufferIndex+c,_index:s.start._index+l,line:s.end.line,column:s.end.column-d,offset:s.end.offset-d},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 CO={42:$n,43:$n,45:$n,48:$n,49:$n,50:$n,51:$n,52:$n,53:$n,54:$n,55:$n,56:$n,57:$n,62:Sk},EO={91:AI},TO={[-2]:tp,[-1]:tp,32:tp},PO={35:MI,42:qc,45:[Xv,qc],60:BI,61:Xv,95:qc,96:Gv,126:Gv},RO={38:Ck,92:Nk},AO={[-5]:np,[-4]:np,[-3]:np,33:oO,38:Ck,42:Gp,60:[aI,GI],91:aO,92:[LI,Nk],93:bh,95:Gp,96:bI},DO={null:[Gp,jO]},IO={null:[42,95]},OO={null:[]},LO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:IO,contentInitial:EO,disable:OO,document:CO,flow:PO,flowInitial:TO,insideSpan:DO,string:RO,text:AO},Symbol.toStringTag,{value:"Module"}));function $O(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=[],d=[];const f={attempt:I(M),check:I(R),consume:T,enter:N,exit:A,interrupt:I(R,{interrupt:!0})},m={code:null,containerState:{},defineSkip:k,events:[],now:E,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:x};let g=t.tokenize.call(m,f);return t.resolveAll&&l.push(t),m;function x(_){return c=lr(c,_),w(),c[c.length-1]!==null?[]:(O(t,0),m.events=vh(l,m.events,m),m.events)}function y(_,U){return _O(v(_),U)}function v(_){return MO(c,_)}function E(){const{_bufferIndex:_,_index:U,line:X,column:q,offset:G}=s;return{_bufferIndex:_,_index:U,line:X,column:q,offset:G}}function k(_){a[_.line]=_.column,J()}function w(){let _;for(;s._index<c.length;){const U=c[s._index];if(typeof U=="string")for(_=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===_&&s._bufferIndex<U.length;)S(U.charCodeAt(s._bufferIndex));else S(U)}}function S(_){g=g(_)}function T(_){Ue(_)?(s.line++,s.column=1,s.offset+=_===-3?2:1,J()):_!==-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=_}function N(_,U){const X=U||{};return X.type=_,X.start=E(),m.events.push(["enter",X,m]),d.push(X),X}function A(_){const U=d.pop();return U.end=E(),m.events.push(["exit",U,m]),U}function M(_,U){O(_,U.from)}function R(_,U){U.restore()}function I(_,U){return X;function X(q,G,B){let W,D,ee,C;return Array.isArray(q)?Z(q):"tokenize"in q?Z([q]):$(q);function $(Q){return ge;function ge(je){const Ne=je!==null&&Q[je],ke=je!==null&&Q.null,Ve=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(ke)?ke:ke?[ke]:[]];return Z(Ve)(je)}}function Z(Q){return W=Q,D=0,Q.length===0?B:L(Q[D])}function L(Q){return ge;function ge(je){return C=Y(),ee=Q,Q.partial||(m.currentConstruct=Q),Q.name&&m.parser.constructs.disable.null.includes(Q.name)?ce():Q.tokenize.call(U?Object.assign(Object.create(m),U):m,f,ae,ce)(je)}}function ae(Q){return _(ee,C),G}function ce(Q){return C.restore(),++D<W.length?L(W[D]):B}}}function O(_,U){_.resolveAll&&!l.includes(_)&&l.push(_),_.resolve&&Gr(m.events,U,m.events.length-U,_.resolve(m.events.slice(U),m)),_.resolveTo&&(m.events=_.resolveTo(m.events,m))}function Y(){const _=E(),U=m.previous,X=m.currentConstruct,q=m.events.length,G=Array.from(d);return{from:q,restore:B};function B(){s=_,m.previous=U,m.currentConstruct=X,m.events.length=q,d=G,J()}}function J(){s.line in a&&s.column<2&&(s.column=a[s.line],s.offset+=a[s.line]-1)}}function MO(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 d=c[0];typeof d=="string"?c[0]=d.slice(s):c.shift()}l>0&&c.push(e[a].slice(0,l))}return c}function _O(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=`
477
- `;break}case-3:{c=`\r
478
- `;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 FO(e){const s={constructs:q4([LO,...(e||{}).extensions||[]]),content:a(eI),defined:[],document:a(nI),flow:a(bO),lazy:{},string:a(kO),text:a(SO)};return s;function a(l){return c;function c(d){return $O(s,l,d)}}}function zO(e){for(;!Ek(e););return e}const Jv=/[\0\t\n\r]/g;function BO(){let e=1,t="",n=!0,s;return a;function a(l,c,d){const f=[];let m,g,x,y,v;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(c||void 0).decode(l)),x=0,t="",n&&(l.charCodeAt(0)===65279&&x++,n=void 0);x<l.length;){if(Jv.lastIndex=x,m=Jv.exec(l),y=m&&m.index!==void 0?m.index:l.length,v=l.charCodeAt(y),!m){t=l.slice(x);break}if(v===10&&x===y&&s)f.push(-3),s=void 0;else switch(s&&(f.push(-5),s=void 0),x<y&&(f.push(l.slice(x,y)),e+=y-x),v){case 0:{f.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,f.push(-2);e++<g;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:s=!0,e=1}x=y+1}return d&&(s&&f.push(-5),t&&f.push(t),f.push(null)),f}}const UO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function HO(e){return e.replace(UO,WO)}function WO(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return kk(n.slice(l?2:1),l?16:10)}return yh(n)||e}const Ik={}.hasOwnProperty;function VO(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),qO(n)(zO(FO(n).document().write(BO()(e,t,!0))))}function qO(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(_e),autolinkProtocol:Y,autolinkEmail:Y,atxHeading:l(le),blockQuote:l(ke),characterEscape:Y,characterReference:Y,codeFenced:l(Ve),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(Ve,c),codeText:l(Ye,c),codeTextData:Y,data:Y,codeFlowValue:Y,definition:l(ie),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(ne),hardBreakEscape:l(H),hardBreakTrailing:l(H),htmlFlow:l(fe,c),htmlFlowData:Y,htmlText:l(fe,c),htmlTextData:Y,image:l(ve),label:c,link:l(_e),listItem:l(st),listItemValue:y,listOrdered:l(Ie,x),listUnordered:l(Ie),paragraph:l(lt),reference:L,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(le),strong:l(_t),thematicBreak:l(St)},exit:{atxHeading:f(),atxHeadingSequence:M,autolink:f(),autolinkEmail:Ne,autolinkProtocol:je,blockQuote:f(),characterEscapeValue:J,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:Q,characterReference:ge,codeFenced:f(w),codeFencedFence:k,codeFencedFenceInfo:v,codeFencedFenceMeta:E,codeFlowValue:J,codeIndented:f(S),codeText:f(G),codeTextData:J,data:J,definition:f(),definitionDestinationString:A,definitionLabelString:T,definitionTitleString:N,emphasis:f(),hardBreakEscape:f(U),hardBreakTrailing:f(U),htmlFlow:f(X),htmlFlowData:J,htmlText:f(q),htmlTextData:J,image:f(W),label:ee,labelText:D,lineEnding:_,link:f(B),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ae,resourceDestinationString:C,resourceTitleString:$,resource:Z,setextHeading:f(O),setextHeadingLineSequence:I,setextHeadingText:R,strong:f(),thematicBreak:f()}};Ok(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(se){let pe={type:"root",children:[]};const Pe={stack:[pe],tokenStack:[],config:t,enter:d,exit:m,buffer:c,resume:g,data:n},Fe=[];let qe=-1;for(;++qe<se.length;)if(se[qe][1].type==="listOrdered"||se[qe][1].type==="listUnordered")if(se[qe][0]==="enter")Fe.push(qe);else{const tt=Fe.pop();qe=a(se,tt,qe)}for(qe=-1;++qe<se.length;){const tt=t[se[qe][0]];Ik.call(tt,se[qe][1].type)&&tt[se[qe][1].type].call(Object.assign({sliceSerialize:se[qe][2].sliceSerialize},Pe),se[qe][1])}if(Pe.tokenStack.length>0){const tt=Pe.tokenStack[Pe.tokenStack.length-1];(tt[1]||Qv).call(Pe,void 0,tt[0])}for(pe.position={start:_s(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:_s(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<t.transforms.length;)pe=t.transforms[qe](pe)||pe;return pe}function a(se,pe,Pe){let Fe=pe-1,qe=-1,tt=!1,me,We,He,cn;for(;++Fe<=Pe;){const It=se[Fe];switch(It[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{It[0]==="enter"?qe++:qe--,cn=void 0;break}case"lineEndingBlank":{It[0]==="enter"&&(me&&!cn&&!qe&&!He&&(He=Fe),cn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:cn=void 0}if(!qe&&It[0]==="enter"&&It[1].type==="listItemPrefix"||qe===-1&&It[0]==="exit"&&(It[1].type==="listUnordered"||It[1].type==="listOrdered")){if(me){let Tn=Fe;for(We=void 0;Tn--;){const Qt=se[Tn];if(Qt[1].type==="lineEnding"||Qt[1].type==="lineEndingBlank"){if(Qt[0]==="exit")continue;We&&(se[We][1].type="lineEndingBlank",tt=!0),Qt[1].type="lineEnding",We=Tn}else if(!(Qt[1].type==="linePrefix"||Qt[1].type==="blockQuotePrefix"||Qt[1].type==="blockQuotePrefixWhitespace"||Qt[1].type==="blockQuoteMarker"||Qt[1].type==="listItemIndent"))break}He&&(!We||He<We)&&(me._spread=!0),me.end=Object.assign({},We?se[We][1].start:It[1].end),se.splice(We||Fe,0,["exit",me,It[2]]),Fe++,Pe++}if(It[1].type==="listItemPrefix"){const Tn={type:"listItem",_spread:!1,start:Object.assign({},It[1].start),end:void 0};me=Tn,se.splice(Fe,0,["enter",Tn,It[2]]),Fe++,Pe++,He=void 0,cn=!0}}}return se[pe][1]._spread=tt,Pe}function l(se,pe){return Pe;function Pe(Fe){d.call(this,se(Fe),Fe),pe&&pe.call(this,Fe)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(se,pe,Pe){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([pe,Pe||void 0]),se.position={start:_s(pe.start),end:void 0}}function f(se){return pe;function pe(Pe){se&&se.call(this,Pe),m.call(this,Pe)}}function m(se,pe){const Pe=this.stack.pop(),Fe=this.tokenStack.pop();if(Fe)Fe[0].type!==se.type&&(pe?pe.call(this,se,Fe[0]):(Fe[1]||Qv).call(this,se,Fe[0]));else throw new Error("Cannot close `"+se.type+"` ("+Ta({start:se.start,end:se.end})+"): it’s not open");Pe.position.end=_s(se.end)}function g(){return W4(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function y(se){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function v(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=se}function E(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=se}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se.replace(/(\r?\n|\r)$/g,"")}function T(se){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=pe,Pe.identifier=di(this.sliceSerialize(se)).toLowerCase()}function N(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.title=se}function A(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.url=se}function M(se){const pe=this.stack[this.stack.length-1];if(!pe.depth){const Pe=this.sliceSerialize(se).length;pe.depth=Pe}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function I(se){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function Y(se){const Pe=this.stack[this.stack.length-1].children;let Fe=Pe[Pe.length-1];(!Fe||Fe.type!=="text")&&(Fe=kt(),Fe.position={start:_s(se.start),end:void 0},Pe.push(Fe)),this.stack.push(Fe)}function J(se){const pe=this.stack.pop();pe.value+=this.sliceSerialize(se),pe.position.end=_s(se.end)}function _(se){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=pe.children[pe.children.length-1];Pe.position.end=_s(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(pe.type)&&(Y.call(this,se),J.call(this,se))}function U(){this.data.atHardBreak=!0}function X(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se}function q(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se}function G(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se}function B(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=pe,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function W(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=pe,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function D(se){const pe=this.sliceSerialize(se),Pe=this.stack[this.stack.length-2];Pe.label=HO(pe),Pe.identifier=di(pe).toLowerCase()}function ee(){const se=this.stack[this.stack.length-1],pe=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const Fe=se.children;Pe.children=Fe}else Pe.alt=pe}function C(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.url=se}function $(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.title=se}function Z(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function ae(se){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=pe,Pe.identifier=di(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function ce(se){this.data.characterReferenceType=se.type}function Q(se){const pe=this.sliceSerialize(se),Pe=this.data.characterReferenceType;let Fe;Pe?(Fe=kk(pe,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Fe=yh(pe);const qe=this.stack[this.stack.length-1];qe.value+=Fe}function ge(se){const pe=this.stack.pop();pe.position.end=_s(se.end)}function je(se){J.call(this,se);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(se)}function Ne(se){J.call(this,se);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(se)}function ke(){return{type:"blockquote",children:[]}}function Ve(){return{type:"code",lang:null,meta:null,value:""}}function Ye(){return{type:"inlineCode",value:""}}function ie(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ne(){return{type:"emphasis",children:[]}}function le(){return{type:"heading",depth:0,children:[]}}function H(){return{type:"break"}}function fe(){return{type:"html",value:""}}function ve(){return{type:"image",title:null,url:"",alt:null}}function _e(){return{type:"link",title:null,url:"",children:[]}}function Ie(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function st(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function lt(){return{type:"paragraph",children:[]}}function _t(){return{type:"strong",children:[]}}function kt(){return{type:"text",value:""}}function St(){return{type:"thematicBreak"}}}function _s(e){return{line:e.line,column:e.column,offset:e.offset}}function Ok(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?Ok(e,s):KO(e,s)}}function KO(e,t){let n;for(n in t)if(Ik.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 Qv(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ta({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ta({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ta({start:t.start,end:t.end})+") is still open")}function GO(e){const t=this;t.parser=n;function n(s){return VO(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function YO(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 XO(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
479
- `}]}function JO(e,t){const n=t.value?t.value+`
480
- `:"",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 QO(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZO(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),a=Ci(s.toLowerCase()),l=e.footnoteOrder.indexOf(s);let c,d=e.footnoteCounts.get(s);d===void 0?(d=0,e.footnoteOrder.push(s),c=e.footnoteOrder.length):c=l+1,d+=1,e.footnoteCounts.set(s,d);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,f);const m={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,m),e.applyData(t,m)}function tL(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 nL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Lk(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 rL(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return Lk(e,t);const a={src:Ci(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 sL(e,t){const n={src:Ci(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 oL(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 iL(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return Lk(e,t);const a={href:Ci(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 aL(e,t){const n={href:Ci(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 lL(e,t,n){const s=e.all(t),a=n?cL(n):$k(t),l={},c=[];if(typeof t.checked=="boolean"){const g=s[0];let x;g&&g.type==="element"&&g.tagName==="p"?x=g:(x={type:"element",tagName:"p",properties:{},children:[]},s.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let d=-1;for(;++d<s.length;){const g=s[d];(a||d!==0||g.type!=="element"||g.tagName!=="p")&&c.push({type:"text",value:`
481
- `}),g.type==="element"&&g.tagName==="p"&&!a?c.push(...g.children):c.push(g)}const f=s[s.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&c.push({type:"text",value:`
482
- `});const m={type:"element",tagName:"li",properties:l,children:c};return e.patch(t,m),e.applyData(t,m)}function cL(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=$k(n[s])}return t}function $k(e){const t=e.spread;return t??e.children.length>1}function uL(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 dL(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fL(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function pL(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mL(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)},d=mh(t.children[1]),f=gk(t.children[t.children.length-1]);d&&f&&(c.position={start:d,end:f}),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 hL(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,d=c?c.length:t.children.length;let f=-1;const m=[];for(;++f<d;){const x=t.children[f],y={},v=c?c[f]:void 0;v&&(y.align=v);let E={type:"element",tagName:l,properties:y,children:[]};x&&(E.children=e.all(x),e.patch(x,E),E=e.applyData(x,E)),m.push(E)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,g),e.applyData(t,g)}function gL(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Zv=9,eb=32;function xL(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),a=0;const l=[];for(;s;)l.push(tb(t.slice(a,s.index),a>0,!0),s[0]),a=s.index+s[0].length,s=n.exec(t);return l.push(tb(t.slice(a),a>0,!1)),l.join("")}function tb(e,t,n){let s=0,a=e.length;if(t){let l=e.codePointAt(s);for(;l===Zv||l===eb;)s++,l=e.codePointAt(s)}if(n){let l=e.codePointAt(a-1);for(;l===Zv||l===eb;)a--,l=e.codePointAt(a-1)}return a>s?e.slice(s,a):""}function yL(e,t){const n={type:"text",value:xL(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function vL(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const bL={blockquote:YO,break:XO,code:JO,delete:QO,emphasis:ZO,footnoteReference:eL,heading:tL,html:nL,imageReference:rL,image:sL,inlineCode:oL,linkReference:iL,link:aL,listItem:lL,list:uL,paragraph:dL,root:fL,strong:pL,table:mL,tableCell:gL,tableRow:hL,text:yL,thematicBreak:vL,toml:Pc,yaml:Pc,definition:Pc,footnoteDefinition:Pc};function Pc(){}const Mk=-1,Lu=0,Ra=1,au=2,wh=3,jh=4,kh=5,Sh=6,_k=7,Fk=8,nb=typeof self=="object"?self:globalThis,wL=(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 Lu:case Mk:return n(c,a);case Ra:{const d=n([],a);for(const f of c)d.push(s(f));return d}case au:{const d=n({},a);for(const[f,m]of c)d[s(f)]=s(m);return d}case wh:return n(new Date(c),a);case jh:{const{source:d,flags:f}=c;return n(new RegExp(d,f),a)}case kh:{const d=n(new Map,a);for(const[f,m]of c)d.set(s(f),s(m));return d}case Sh:{const d=n(new Set,a);for(const f of c)d.add(s(f));return d}case _k:{const{name:d,message:f}=c;return n(new nb[d](f),a)}case Fk: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:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(new nb[l](c),a)};return s},rb=e=>wL(new Map,e)(0),Qo="",{toString:jL}={},{keys:kL}=Object,ba=e=>{const t=typeof e;if(t!=="object"||!e)return[Lu,t];const n=jL.call(e).slice(8,-1);switch(n){case"Array":return[Ra,Qo];case"Object":return[au,Qo];case"Date":return[wh,Qo];case"RegExp":return[jh,Qo];case"Map":return[kh,Qo];case"Set":return[Sh,Qo];case"DataView":return[Ra,n]}return n.includes("Array")?[Ra,n]:n.includes("Error")?[_k,n]:[au,n]},Rc=([e,t])=>e===Lu&&(t==="function"||t==="symbol"),SL=(e,t,n,s)=>{const a=(c,d)=>{const f=s.push(c)-1;return n.set(d,f),f},l=c=>{if(n.has(c))return n.get(c);let[d,f]=ba(c);switch(d){case Lu:{let g=c;switch(f){case"bigint":d=Fk,g=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return a([Mk],c)}return a([d,g],c)}case Ra:{if(f){let y=c;return f==="DataView"?y=new Uint8Array(c.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(c)),a([f,[...y]],c)}const g=[],x=a([d,g],c);for(const y of c)g.push(l(y));return x}case au:{if(f)switch(f){case"BigInt":return a([f,c.toString()],c);case"Boolean":case"Number":case"String":return a([f,c.valueOf()],c)}if(t&&"toJSON"in c)return l(c.toJSON());const g=[],x=a([d,g],c);for(const y of kL(c))(e||!Rc(ba(c[y])))&&g.push([l(y),l(c[y])]);return x}case wh:return a([d,c.toISOString()],c);case jh:{const{source:g,flags:x}=c;return a([d,{source:g,flags:x}],c)}case kh:{const g=[],x=a([d,g],c);for(const[y,v]of c)(e||!(Rc(ba(y))||Rc(ba(v))))&&g.push([l(y),l(v)]);return x}case Sh:{const g=[],x=a([d,g],c);for(const y of c)(e||!Rc(ba(y)))&&g.push(l(y));return x}}const{message:m}=c;return a([d,{name:f,message:m}],c)};return l},sb=(e,{json:t,lossy:n}={})=>{const s=[];return SL(!(t||n),!!t,new Map,s)(e),s},lu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?rb(sb(e,t)):structuredClone(e):(e,t)=>rb(sb(e,t));function NL(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 CL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function EL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||NL,s=e.options.footnoteBackLabel||CL,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let f=-1;for(;++f<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[f]);if(!m)continue;const g=e.all(m),x=String(m.identifier).toUpperCase(),y=Ci(x.toLowerCase());let v=0;const E=[],k=e.footnoteCounts.get(x);for(;k!==void 0&&++v<=k;){E.length>0&&E.push({type:"text",value:" "});let T=typeof n=="string"?n:n(f,v);typeof T=="string"&&(T={type:"text",value:T}),E.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(f,v),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const w=g[g.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const T=w.children[w.children.length-1];T&&T.type==="text"?T.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...E)}else g.push(...E);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(g,!0)};e.patch(m,S),d.push(S)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...lu(c),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
483
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
484
- `}]}}const zk=(function(e){if(e==null)return AL;if(typeof e=="function")return $u(e);if(typeof e=="object")return Array.isArray(e)?TL(e):PL(e);if(typeof e=="string")return RL(e);throw new Error("Expected function, string, or object as test")});function TL(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=zk(e[n]);return $u(s);function s(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function PL(e){const t=e;return $u(n);function n(s){const a=s;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function RL(e){return $u(t);function t(n){return n&&n.type===e}}function $u(e){return t;function t(n,s,a){return!!(DL(n)&&e.call(this,n,typeof s=="number"?s:void 0,a||void 0))}}function AL(){return!0}function DL(e){return e!==null&&typeof e=="object"&&"type"in e}const Bk=[],IL=!0,ob=!1,OL="skip";function LL(e,t,n,s){let a;typeof t=="function"&&typeof n!="function"?(s=n,n=t):a=t;const l=zk(a),c=s?-1:1;d(e,void 0,[])();function d(f,m,g){const x=f&&typeof f=="object"?f:{};if(typeof x.type=="string"){const v=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(f.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=Bk,E,k,w;if((!t||l(f,m,g[g.length-1]||void 0))&&(v=$L(n(f,g)),v[0]===ob))return v;if("children"in f&&f.children){const S=f;if(S.children&&v[0]!==OL)for(k=(s?S.children.length:-1)+c,w=g.concat(S);k>-1&&k<S.children.length;){const T=S.children[k];if(E=d(T,k,w)(),E[0]===ob)return E;k=typeof E[1]=="number"?E[1]:k+c}}return v}}}function $L(e){return Array.isArray(e)?e:typeof e=="number"?[IL,e]:e==null?Bk:[e]}function Uk(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),LL(e,l,d,a);function d(f,m){const g=m[m.length-1],x=g?g.children.indexOf(f):void 0;return c(f,x,g)}}const Yp={}.hasOwnProperty,ML={};function _L(e,t){const n=t||ML,s=new Map,a=new Map,l=new Map,c={...bL,...n.handlers},d={all:m,applyData:zL,definitionById:s,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:c,one:f,options:n,patch:FL,wrap:UL};return Uk(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const x=g.type==="definition"?s:a,y=String(g.identifier).toUpperCase();x.has(y)||x.set(y,g)}}),d;function f(g,x){const y=g.type,v=d.handlers[y];if(Yp.call(d.handlers,y)&&v)return v(d,g,x);if(d.options.passThrough&&d.options.passThrough.includes(y)){if("children"in g){const{children:k,...w}=g,S=lu(w);return S.children=d.all(g),S}return lu(g)}return(d.options.unknownHandler||BL)(d,g,x)}function m(g){const x=[];if("children"in g){const y=g.children;let v=-1;for(;++v<y.length;){const E=d.one(y[v],g);if(E){if(v&&y[v-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=ib(E.value)),!Array.isArray(E)&&E.type==="element")){const k=E.children[0];k&&k.type==="text"&&(k.value=ib(k.value))}Array.isArray(E)?x.push(...E):x.push(E)}}}return x}}function FL(e,t){e.position&&(t.position=j4(e))}function zL(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,lu(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function BL(e,t){const n=t.data||{},s="value"in t&&!(Yp.call(n,"hProperties")||Yp.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 UL(e,t){const n=[];let s=-1;for(t&&n.push({type:"text",value:`
485
- `});++s<e.length;)s&&n.push({type:"text",value:`
486
- `}),n.push(e[s]);return t&&e.length>0&&n.push({type:"text",value:`
487
- `}),n}function ib(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ab(e,t){const n=_L(e,t),s=n.one(e,void 0),a=EL(n),l=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return a&&l.children.push({type:"text",value:`
488
- `},a),l}function HL(e,t){return e&&"run"in e?async function(n,s){const a=ab(n,{file:s,...t});await e.run(a,s)}:function(n,s){return ab(n,{file:s,...e||t})}}function lb(e){if(e)throw e}var rp,cb;function WL(){if(cb)return rp;cb=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 g=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!x)return!1;var y;for(y in m);return typeof y>"u"||e.call(m,y)},c=function(m,g){n&&g.name==="__proto__"?n(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},d=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(s)return s(m,g).value}else return;return m[g]};return rp=function f(){var m,g,x,y,v,E,k=arguments[0],w=1,S=arguments.length,T=!1;for(typeof k=="boolean"&&(T=k,k=arguments[1]||{},w=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});w<S;++w)if(m=arguments[w],m!=null)for(g in m)x=d(k,g),y=d(m,g),k!==y&&(T&&y&&(l(y)||(v=a(y)))?(v?(v=!1,E=x&&a(x)?x:[]):E=x&&l(x)?x:{},c(k,{name:g,newValue:f(T,E,y)})):typeof y<"u"&&c(k,{name:g,newValue:y}));return k},rp}var VL=WL();const sp=mu(VL);function Xp(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 qL(){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);d(null,...a);function d(f,...m){const g=e[++l];let x=-1;if(f){c(f);return}for(;++x<a.length;)(m[x]===null||m[x]===void 0)&&(m[x]=a[x]);a=m,g?KL(g,d)(...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 KL(e,t){let n;return s;function s(...c){const d=e.length>c.length;let f;d&&c.push(a);try{f=e.apply(this,c)}catch(m){const g=m;if(d&&n)throw g;return a(g)}d||(f&&f.then&&typeof f.then=="function"?f.then(l,a):f instanceof Error?a(f):l(f))}function a(c,...d){n||(n=!0,t(c,...d))}function l(c){a(null,c)}}const $r={basename:GL,dirname:YL,extname:XL,join:JL,sep:"/"};function GL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ol(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,d=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else c<0&&(l=!0,c=a+1),d>-1&&(e.codePointAt(a)===t.codePointAt(d--)?d<0&&(s=a):(d=-1,s=c));return n===s?s=c:s<0&&(s=e.length),e.slice(n,s)}function YL(e){if(ol(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 XL(e){ol(e);let t=e.length,n=-1,s=0,a=-1,l=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){s=t+1;break}continue}n<0&&(c=!0,n=t+1),d===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 JL(...e){let t=-1,n;for(;++t<e.length;)ol(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":QL(n)}function QL(e){ol(e);const t=e.codePointAt(0)===47;let n=ZL(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ZL(e,t){let n="",s=0,a=-1,l=0,c=-1,d,f;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===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(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",s=0):(n=n.slice(0,f),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 d===46&&l>-1?l++:l=-1}return n}function ol(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const e$={cwd:t$};function t$(){return"/"}function Jp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function n$(e){if(typeof e=="string")e=new URL(e);else if(!Jp(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 r$(e)}function r$(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 op=["history","path","basename","stem","extname","dirname"];class Hk{constructor(t){let n;t?Jp(t)?n={path:t}:typeof t=="string"||s$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":e$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<op.length;){const l=op[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)op.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?$r.basename(this.path):void 0}set basename(t){ap(t,"basename"),ip(t,"basename"),this.path=$r.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$r.dirname(this.path):void 0}set dirname(t){ub(this.basename,"dirname"),this.path=$r.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$r.extname(this.path):void 0}set extname(t){if(ip(t,"extname"),ub(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=$r.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Jp(t)&&(t=n$(t)),ap(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$r.basename(this.path,this.extname):void 0}set stem(t){ap(t,"stem"),ip(t,"stem"),this.path=$r.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 jn(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 ip(e,t){if(e&&e.includes($r.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$r.sep+"`")}function ap(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ub(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function s$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const o$=(function(e){const s=this.constructor.prototype,a=s[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,s),l}),i$={}.hasOwnProperty;class Nh extends o${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=qL()}copy(){const t=new Nh;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(sp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(up("data",this.frozen),this.namespace[t]=n,this):i$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(up("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=Ac(t),s=this.parser||this.Parser;return lp("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),lp("process",this.parser||this.Parser),cp("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,c){const d=Ac(t),f=s.parse(d);s.run(f,d,function(g,x,y){if(g||!x||!y)return m(g);const v=x,E=s.stringify(v,y);c$(E)?y.value=E:y.result=E,m(g,y)});function m(g,x){g||!x?c(g):l?l(x):n(void 0,x)}}}processSync(t){let n=!1,s;return this.freeze(),lp("processSync",this.parser||this.Parser),cp("processSync",this.compiler||this.Compiler),this.process(t,a),fb("processSync","process",n),s;function a(l,c){n=!0,lb(l),s=c}}run(t,n,s){db(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,d){const f=Ac(n);a.run(t,f,m);function m(g,x,y){const v=x||t;g?d(g):c?c(v):s(void 0,v,y)}}}runSync(t,n){let s=!1,a;return this.run(t,n,l),fb("runSync","run",s),a;function l(c,d){lb(c),a=d,s=!0}}stringify(t,n){this.freeze();const s=Ac(n),a=this.compiler||this.Compiler;return cp("stringify",a),db(t),a(t,s)}use(t,...n){const s=this.attachers,a=this.namespace;if(up("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(m){if(typeof m=="function")f(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...x]=m;f(g,x)}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");d(m.plugins),m.settings&&(a.settings=sp(!0,a.settings,m.settings))}function d(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const x=m[g];l(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function f(m,g){let x=-1,y=-1;for(;++x<s.length;)if(s[x][0]===m){y=x;break}if(y===-1)s.push([m,...g]);else if(g.length>0){let[v,...E]=g;const k=s[y][1];Xp(k)&&Xp(v)&&(v=sp(!0,k,v)),s[y]=[m,v,...E]}}}}const a$=new Nh().freeze();function lp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function cp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function up(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 db(e){if(!Xp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function fb(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ac(e){return l$(e)?e:new Hk(e)}function l$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function c$(e){return typeof e=="string"||u$(e)}function u$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const d$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",pb=[],mb={allowDangerousHtml:!0},f$=/^(https?|ircs?|mailto|xmpp)$/i,p$=[{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 m$(e){const t=h$(e),n=g$(e);return x$(t.runSync(t.parse(n),n),e)}function h$(e){const t=e.rehypePlugins||pb,n=e.remarkPlugins||pb,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...mb}:mb;return a$().use(GO).use(n).use(HL,s).use(t)}function g$(e){const t=e.children||"",n=new Hk;return typeof t=="string"&&(n.value=t),n}function x$(e,t){const n=t.allowedElements,s=t.allowElement,a=t.components,l=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,f=t.urlTransform||y$;for(const g of p$)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+d$+g.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Uk(e,m),E4(e,{Fragment:r.Fragment,components:a,ignoreInvalidStyle:!0,jsx:r.jsx,jsxs:r.jsxs,passKeys:!0,passNode:!0});function m(g,x,y){if(g.type==="raw"&&y&&typeof x=="number")return c?y.children.splice(x,1):y.children[x]={type:"text",value:g.value},x;if(g.type==="element"){let v;for(v in ep)if(Object.hasOwn(ep,v)&&Object.hasOwn(g.properties,v)){const E=g.properties[v],k=ep[v];(k===null||k.includes(g.tagName))&&(g.properties[v]=f(String(E||""),v,g))}}if(g.type==="element"){let v=n?!n.includes(g.tagName):l?l.includes(g.tagName):!1;if(!v&&s&&typeof x=="number"&&(v=!s(g,x,y)),v&&y&&typeof x=="number")return d&&g.children?y.children.splice(x,1,...g.children):y.children.splice(x,1),x}}}function y$(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||f$.test(e.slice(0,t))?e:""}function Ut({content:e,className:t,emptyState:n="No markdown content yet."}){const s=e.replace(/<!--[\s\S]*?-->/g,"");return s.trim()?r.jsx("div",{className:ze("prose-syntaur max-w-none",t),children:r.jsx(m$,{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 v$(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>s=>{t.forEach(a=>a(s))},t)}const Mu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ei(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ch(e){return"nodeType"in e}function Un(e){var t,n;return e?Ei(e)?e:Ch(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Eh(e){const{Document:t}=Un(e);return e instanceof t}function il(e){return Ei(e)?!1:e instanceof Un(e).HTMLElement}function Wk(e){return e instanceof Un(e).SVGElement}function Ti(e){return e?Ei(e)?e.document:Ch(e)?Eh(e)?e:il(e)||Wk(e)?e.ownerDocument:document:document:document}const Yr=Mu?p.useLayoutEffect:p.useEffect;function Th(e){const t=p.useRef(e);return Yr(()=>{t.current=e}),p.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 b$(){const e=p.useRef(null),t=p.useCallback((s,a)=>{e.current=setInterval(s,a)},[]),n=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Va(e,t){t===void 0&&(t=[e]);const n=p.useRef(e);return Yr(()=>{n.current!==e&&(n.current=e)},t),n}function al(e,t){const n=p.useRef();return p.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function cu(e){const t=Th(e),n=p.useRef(null),s=p.useCallback(a=>{a!==n.current&&(t==null||t(a,n.current)),n.current=a},[]);return[n,s]}function Qp(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let dp={};function ll(e,t){return p.useMemo(()=>{if(t)return t;const n=dp[e]==null?0:dp[e]+1;return dp[e]=n,e+"-"+n},[e,t])}function Vk(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 d=Object.entries(c);for(const[f,m]of d){const g=l[f];g!=null&&(l[f]=g+e*m)}return l},{...t})}}const fi=Vk(1),uu=Vk(-1);function w$(e){return"clientX"in e&&"clientY"in e}function Ph(e){if(!e)return!1;const{KeyboardEvent:t}=Un(e.target);return t&&e instanceof t}function j$(e){if(!e)return!1;const{TouchEvent:t}=Un(e.target);return t&&e instanceof t}function Zp(e){if(j$(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 w$(e)?{x:e.clientX,y:e.clientY}:null}const xo=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[xo.Translate.toString(e),xo.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),hb="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function k$(e){return e.matches(hb)?e:e.querySelector(hb)}const S$={display:"none"};function N$(e){let{id:t,value:n}=e;return Lt.createElement("div",{id:t,style:S$},n)}function C$(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 Lt.createElement("div",{id:t,style:a,role:"status","aria-live":s,"aria-atomic":!0},n)}function E$(){const[e,t]=p.useState("");return{announce:p.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const qk=p.createContext(null);function T$(e){const t=p.useContext(qk);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function P$(){const[e]=p.useState(()=>new Set),t=p.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[p.useCallback(s=>{let{type:a,event:l}=s;e.forEach(c=>{var d;return(d=c[a])==null?void 0:d.call(c,l)})},[e]),t]}const R$={draggable:`
489
- To pick up a draggable item, press the space bar.
490
- While dragging, use the arrow keys to move the item.
491
- Press space again to drop the item in its new position, or press escape to cancel.
492
- `},A$={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 D$(e){let{announcements:t=A$,container:n,hiddenTextDescribedById:s,screenReaderInstructions:a=R$}=e;const{announce:l,announcement:c}=E$(),d=ll("DndLiveRegion"),[f,m]=p.useState(!1);if(p.useEffect(()=>{m(!0)},[]),T$(p.useMemo(()=>({onDragStart(x){let{active:y}=x;l(t.onDragStart({active:y}))},onDragMove(x){let{active:y,over:v}=x;t.onDragMove&&l(t.onDragMove({active:y,over:v}))},onDragOver(x){let{active:y,over:v}=x;l(t.onDragOver({active:y,over:v}))},onDragEnd(x){let{active:y,over:v}=x;l(t.onDragEnd({active:y,over:v}))},onDragCancel(x){let{active:y,over:v}=x;l(t.onDragCancel({active:y,over:v}))}}),[l,t])),!f)return null;const g=Lt.createElement(Lt.Fragment,null,Lt.createElement(N$,{id:s,value:a.draggable}),Lt.createElement(C$,{id:d,announcement:c}));return n?Us.createPortal(g,n):g}var Yt;(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"})(Yt||(Yt={}));function du(){}function gi(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Rh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const Nr=Object.freeze({x:0,y:0});function I$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function O$(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return n-s}function L$(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function $$(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function gb(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 Ah=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const a=gb(t,t.left,t.top),l=[];for(const c of s){const{id:d}=c,f=n.get(d);if(f){const m=I$(gb(f),a);l.push({id:d,data:{droppableContainer:c,value:m}})}}return l.sort(O$)};function M$(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,d=l-n;if(s<a&&n<l){const f=t.width*t.height,m=e.width*e.height,g=c*d,x=g/(f+m-g);return Number(x.toFixed(4))}return 0}const _$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const a=[];for(const l of s){const{id:c}=l,d=n.get(c);if(d){const f=M$(d,t);f>0&&a.push({id:c,data:{droppableContainer:l,value:f}})}}return a.sort(L$)};function F$(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Kk(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Nr}function z$(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,d)=>({...c,top:c.top+e*d.y,bottom:c.bottom+e*d.y,left:c.left+e*d.x,right:c.right+e*d.x}),{...n})}}const B$=z$(1);function U$(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 H$(e,t,n){const s=U$(t);if(!s)return e;const{scaleX:a,scaleY:l,x:c,y:d}=s,f=e.left-c-(1-a)*parseFloat(n),m=e.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),g=a?e.width/a:e.width,x=l?e.height/l:e.height;return{width:g,height:x,top:m,right:f+g,bottom:m+x,left:f}}const W$={ignoreTransform:!1};function Pi(e,t){t===void 0&&(t=W$);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:g}=Un(e).getComputedStyle(e);m&&(n=H$(n,m,g))}const{top:s,left:a,width:l,height:c,bottom:d,right:f}=n;return{top:s,left:a,width:l,height:c,bottom:d,right:f}}function xb(e){return Pi(e,{ignoreTransform:!0})}function V$(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function q$(e,t){return t===void 0&&(t=Un(e).getComputedStyle(e)),t.position==="fixed"}function K$(e,t){t===void 0&&(t=Un(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 Dh(e,t){const n=[];function s(a){if(t!=null&&n.length>=t||!a)return n;if(Eh(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!il(a)||Wk(a)||n.includes(a))return n;const l=Un(e).getComputedStyle(a);return a!==e&&K$(a,l)&&n.push(a),q$(a,l)?n:s(a.parentNode)}return e?s(e):n}function Gk(e){const[t]=Dh(e,1);return t??null}function fp(e){return!Mu||!e?null:Ei(e)?e:Ch(e)?Eh(e)||e===Ti(e).scrollingElement?window:il(e)?e:null:null}function Yk(e){return Ei(e)?e.scrollX:e.scrollLeft}function Xk(e){return Ei(e)?e.scrollY:e.scrollTop}function em(e){return{x:Yk(e),y:Xk(e)}}var ln;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ln||(ln={}));function Jk(e){return!Mu||!e?!1:e===document.scrollingElement}function Qk(e){const t={x:0,y:0},n=Jk(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,d=e.scrollLeft>=s.x;return{isTop:a,isLeft:l,isBottom:c,isRight:d,maxScroll:s,minScroll:t}}const G$={x:.2,y:.2};function Y$(e,t,n,s,a){let{top:l,left:c,right:d,bottom:f}=n;s===void 0&&(s=10),a===void 0&&(a=G$);const{isTop:m,isBottom:g,isLeft:x,isRight:y}=Qk(e),v={x:0,y:0},E={x:0,y:0},k={height:t.height*a.y,width:t.width*a.x};return!m&&l<=t.top+k.height?(v.y=ln.Backward,E.y=s*Math.abs((t.top+k.height-l)/k.height)):!g&&f>=t.bottom-k.height&&(v.y=ln.Forward,E.y=s*Math.abs((t.bottom-k.height-f)/k.height)),!y&&d>=t.right-k.width?(v.x=ln.Forward,E.x=s*Math.abs((t.right-k.width-d)/k.width)):!x&&c<=t.left+k.width&&(v.x=ln.Backward,E.x=s*Math.abs((t.left+k.width-c)/k.width)),{direction:v,speed:E}}function X$(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 Zk(e){return e.reduce((t,n)=>fi(t,em(n)),Nr)}function J$(e){return e.reduce((t,n)=>t+Yk(n),0)}function Q$(e){return e.reduce((t,n)=>t+Xk(n),0)}function Z$(e,t){if(t===void 0&&(t=Pi),!e)return;const{top:n,left:s,bottom:a,right:l}=t(e);Gk(e)&&(a<=0||l<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const eM=[["x",["left","right"],J$],["y",["top","bottom"],Q$]];class Ih{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=Dh(n),a=Zk(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,d]of eM)for(const f of c)Object.defineProperty(this,f,{get:()=>{const m=d(s),g=a[l]-m;return this.rect[f]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Aa{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 tM(e){const{EventTarget:t}=Un(e);return e instanceof t?e:Ti(e)}function pp(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 ar;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ar||(ar={}));function yb(e){e.preventDefault()}function nM(e){e.stopPropagation()}var nt;(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"})(nt||(nt={}));const e1={start:[nt.Space,nt.Enter],cancel:[nt.Esc],end:[nt.Space,nt.Enter,nt.Tab]},rM=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case nt.Right:return{...n,x:n.x+25};case nt.Left:return{...n,x:n.x-25};case nt.Down:return{...n,y:n.y+25};case nt.Up:return{...n,y:n.y-25}}};class cl{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 Aa(Ti(n)),this.windowListeners=new Aa(Un(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ar.Resize,this.handleCancel),this.windowListeners.add(ar.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ar.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&Z$(s),n(Nr)}handleKeyDown(t){if(Ph(t)){const{active:n,context:s,options:a}=this.props,{keyboardCodes:l=e1,coordinateGetter:c=rM,scrollBehavior:d="smooth"}=a,{code:f}=t;if(l.end.includes(f)){this.handleEnd(t);return}if(l.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:m}=s.current,g=m?{x:m.left,y:m.top}:Nr;this.referenceCoordinates||(this.referenceCoordinates=g);const x=c(t,{active:n,context:s.current,currentCoordinates:g});if(x){const y=uu(x,g),v={x:0,y:0},{scrollableAncestors:E}=s.current;for(const k of E){const w=t.code,{isTop:S,isRight:T,isLeft:N,isBottom:A,maxScroll:M,minScroll:R}=Qk(k),I=X$(k),O={x:Math.min(w===nt.Right?I.right-I.width/2:I.right,Math.max(w===nt.Right?I.left:I.left+I.width/2,x.x)),y:Math.min(w===nt.Down?I.bottom-I.height/2:I.bottom,Math.max(w===nt.Down?I.top:I.top+I.height/2,x.y))},Y=w===nt.Right&&!T||w===nt.Left&&!N,J=w===nt.Down&&!A||w===nt.Up&&!S;if(Y&&O.x!==x.x){const _=k.scrollLeft+y.x,U=w===nt.Right&&_<=M.x||w===nt.Left&&_>=R.x;if(U&&!y.y){k.scrollTo({left:_,behavior:d});return}U?v.x=k.scrollLeft-_:v.x=w===nt.Right?k.scrollLeft-M.x:k.scrollLeft-R.x,v.x&&k.scrollBy({left:-v.x,behavior:d});break}else if(J&&O.y!==x.y){const _=k.scrollTop+y.y,U=w===nt.Down&&_<=M.y||w===nt.Up&&_>=R.y;if(U&&!y.x){k.scrollTo({top:_,behavior:d});return}U?v.y=k.scrollTop-_:v.y=w===nt.Down?k.scrollTop-M.y:k.scrollTop-R.y,v.y&&k.scrollBy({top:-v.y,behavior:d});break}}this.handleMove(t,fi(uu(x,this.referenceCoordinates),v))}}}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()}}cl.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=e1,onActivation:a}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(s.start.includes(c)){const d=l.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function vb(e){return!!(e&&"distance"in e)}function bb(e){return!!(e&&"delay"in e)}class Oh{constructor(t,n,s){var a;s===void 0&&(s=tM(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=Ti(c),this.documentListeners=new Aa(this.document),this.listeners=new Aa(s),this.windowListeners=new Aa(Un(c)),this.initialCoordinates=(a=Zp(l))!=null?a:Nr,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(ar.Resize,this.handleCancel),this.windowListeners.add(ar.DragStart,yb),this.windowListeners.add(ar.VisibilityChange,this.handleCancel),this.windowListeners.add(ar.ContextMenu,yb),this.documentListeners.add(ar.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(bb(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(vb(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(ar.Click,nM,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ar.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:a,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!a)return;const f=(n=Zp(t))!=null?n:Nr,m=uu(a,f);if(!s&&d){if(vb(d)){if(d.tolerance!=null&&pp(m,d.tolerance))return this.handleCancel();if(pp(m,d.distance))return this.handleStart()}if(bb(d)&&pp(m,d.tolerance))return this.handleCancel();this.handlePending(d,m);return}t.cancelable&&t.preventDefault(),c(f)}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===nt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const sM={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ul extends Oh{constructor(t){const{event:n}=t,s=Ti(n.target);super(t,sM,s)}}ul.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 oM={move:{name:"mousemove"},end:{name:"mouseup"}};var tm;(function(e){e[e.RightClick=2]="RightClick"})(tm||(tm={}));class iM extends Oh{constructor(t){super(t,oM,Ti(t.event.target))}}iM.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===tm.RightClick?!1:(s==null||s({event:n}),!0)}}];const mp={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class aM extends Oh{constructor(t){super(t,mp)}static setup(){return window.addEventListener(mp.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(mp.move.name,t)};function t(){}}}aM.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 Da;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Da||(Da={}));var fu;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(fu||(fu={}));function lM(e){let{acceleration:t,activator:n=Da.Pointer,canScroll:s,draggingRect:a,enabled:l,interval:c=5,order:d=fu.TreeOrder,pointerCoordinates:f,scrollableAncestors:m,scrollableAncestorRects:g,delta:x,threshold:y}=e;const v=uM({delta:x,disabled:!l}),[E,k]=b$(),w=p.useRef({x:0,y:0}),S=p.useRef({x:0,y:0}),T=p.useMemo(()=>{switch(n){case Da.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Da.DraggableRect:return a}},[n,a,f]),N=p.useRef(null),A=p.useCallback(()=>{const R=N.current;if(!R)return;const I=w.current.x*S.current.x,O=w.current.y*S.current.y;R.scrollBy(I,O)},[]),M=p.useMemo(()=>d===fu.TreeOrder?[...m].reverse():m,[d,m]);p.useEffect(()=>{if(!l||!m.length||!T){k();return}for(const R of M){if((s==null?void 0:s(R))===!1)continue;const I=m.indexOf(R),O=g[I];if(!O)continue;const{direction:Y,speed:J}=Y$(R,O,T,t,y);for(const _ of["x","y"])v[_][Y[_]]||(J[_]=0,Y[_]=0);if(J.x>0||J.y>0){k(),N.current=R,E(A,c),w.current=J,S.current=Y;return}}w.current={x:0,y:0},S.current={x:0,y:0},k()},[t,A,s,k,l,c,JSON.stringify(T),JSON.stringify(v),E,m,M,g,JSON.stringify(y)])}const cM={x:{[ln.Backward]:!1,[ln.Forward]:!1},y:{[ln.Backward]:!1,[ln.Forward]:!1}};function uM(e){let{delta:t,disabled:n}=e;const s=Qp(t);return al(a=>{if(n||!s||!a)return cM;const l={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[ln.Backward]:a.x[ln.Backward]||l.x===-1,[ln.Forward]:a.x[ln.Forward]||l.x===1},y:{[ln.Backward]:a.y[ln.Backward]||l.y===-1,[ln.Forward]:a.y[ln.Forward]||l.y===1}}},[n,t,s])}function dM(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return al(a=>{var l;return t==null?null:(l=s??a)!=null?l:null},[s,t])}function fM(e,t){return p.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 qa;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(qa||(qa={}));var nm;(function(e){e.Optimized="optimized"})(nm||(nm={}));const wb=new Map;function pM(e,t){let{dragging:n,dependencies:s,config:a}=t;const[l,c]=p.useState(null),{frequency:d,measure:f,strategy:m}=a,g=p.useRef(e),x=w(),y=Va(x),v=p.useCallback(function(S){S===void 0&&(S=[]),!y.current&&c(T=>T===null?S:T.concat(S.filter(N=>!T.includes(N))))},[y]),E=p.useRef(null),k=al(S=>{if(x&&!n)return wb;if(!S||S===wb||g.current!==e||l!=null){const T=new Map;for(let N of e){if(!N)continue;if(l&&l.length>0&&!l.includes(N.id)&&N.rect.current){T.set(N.id,N.rect.current);continue}const A=N.node.current,M=A?new Ih(f(A),A):null;N.rect.current=M,M&&T.set(N.id,M)}return T}return S},[e,l,n,x,f]);return p.useEffect(()=>{g.current=e},[e]),p.useEffect(()=>{x||v()},[n,x]),p.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),p.useEffect(()=>{x||typeof d!="number"||E.current!==null||(E.current=setTimeout(()=>{v(),E.current=null},d))},[d,x,v,...s]),{droppableRects:k,measureDroppableContainers:v,measuringScheduled:l!=null};function w(){switch(m){case qa.Always:return!1;case qa.BeforeDragging:return n;default:return!n}}}function t1(e,t){return al(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function mM(e,t){return t1(e,t)}function hM(e){let{callback:t,disabled:n}=e;const s=Th(t),a=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(s)},[s,n]);return p.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function _u(e){let{callback:t,disabled:n}=e;const s=Th(t),a=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(s)},[n]);return p.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function gM(e){return new Ih(Pi(e),e)}function jb(e,t,n){t===void 0&&(t=gM);const[s,a]=p.useState(null);function l(){a(f=>{if(!e)return null;if(e.isConnected===!1){var m;return(m=f??n)!=null?m:null}const g=t(e);return JSON.stringify(f)===JSON.stringify(g)?f:g})}const c=hM({callback(f){if(e)for(const m of f){const{type:g,target:x}=m;if(g==="childList"&&x instanceof HTMLElement&&x.contains(e)){l();break}}}}),d=_u({callback:l});return Yr(()=>{l(),e?(d==null||d.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),c==null||c.disconnect())},[e]),s}function xM(e){const t=t1(e);return Kk(e,t)}const kb=[];function yM(e){const t=p.useRef(e),n=al(s=>e?s&&s!==kb&&e&&t.current&&e.parentNode===t.current.parentNode?s:Dh(e):kb,[e]);return p.useEffect(()=>{t.current=e},[e]),n}function vM(e){const[t,n]=p.useState(null),s=p.useRef(e),a=p.useCallback(l=>{const c=fp(l.target);c&&n(d=>d?(d.set(c,em(c)),new Map(d)):null)},[]);return p.useEffect(()=>{const l=s.current;if(e!==l){c(l);const d=e.map(f=>{const m=fp(f);return m?(m.addEventListener("scroll",a,{passive:!0}),[m,em(m)]):null}).filter(f=>f!=null);n(d.length?new Map(d):null),s.current=e}return()=>{c(e),c(l)};function c(d){d.forEach(f=>{const m=fp(f);m==null||m.removeEventListener("scroll",a)})}},[a,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>fi(l,c),Nr):Zk(e):Nr,[e,t])}function Sb(e,t){t===void 0&&(t=[]);const n=p.useRef(null);return p.useEffect(()=>{n.current=null},t),p.useEffect(()=>{const s=e!==Nr;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?uu(e,n.current):Nr}function bM(e){p.useEffect(()=>{if(!Mu)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 wM(e,t){return p.useMemo(()=>e.reduce((n,s)=>{let{eventName:a,handler:l}=s;return n[a]=c=>{l(c,t)},n},{}),[e,t])}function n1(e){return p.useMemo(()=>e?V$(e):null,[e])}const Nb=[];function jM(e,t){t===void 0&&(t=Pi);const[n]=e,s=n1(n?Un(n):null),[a,l]=p.useState(Nb);function c(){l(()=>e.length?e.map(f=>Jk(f)?s:new Ih(t(f),f)):Nb)}const d=_u({callback:c});return Yr(()=>{d==null||d.disconnect(),c(),e.forEach(f=>d==null?void 0:d.observe(f))},[e]),a}function kM(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return il(t)?t:e}function SM(e){let{measure:t}=e;const[n,s]=p.useState(null),a=p.useCallback(m=>{for(const{target:g}of m)if(il(g)){s(x=>{const y=t(g);return x?{...x,width:y.width,height:y.height}:y});break}},[t]),l=_u({callback:a}),c=p.useCallback(m=>{const g=kM(m);l==null||l.disconnect(),g&&(l==null||l.observe(g)),s(g?t(g):null)},[t,l]),[d,f]=cu(c);return p.useMemo(()=>({nodeRef:d,rect:n,setRef:f}),[n,d,f])}const NM=[{sensor:ul,options:{}},{sensor:cl,options:{}}],CM={current:{}},Kc={draggable:{measure:xb},droppable:{measure:xb,strategy:qa.WhileDragging,frequency:nm.Optimized},dragOverlay:{measure:Pi}};class Ia 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 EM={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ia,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:du},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Kc,measureDroppableContainers:du,windowRect:null,measuringScheduled:!1},TM={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:du,draggableNodes:new Map,over:null,measureDroppableContainers:du},Fu=p.createContext(TM),r1=p.createContext(EM);function PM(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ia}}}function RM(e,t){switch(t.type){case Yt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Yt.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 Yt.DragEnd:case Yt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Yt.RegisterDroppable:{const{element:n}=t,{id:s}=n,a=new Ia(e.droppable.containers);return a.set(s,n),{...e,droppable:{...e.droppable,containers:a}}}case Yt.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 Ia(e.droppable.containers);return c.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:c}}}case Yt.UnregisterDroppable:{const{id:n,key:s}=t,a=e.droppable.containers.get(n);if(!a||s!==a.key)return e;const l=new Ia(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function AM(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:a}=p.useContext(Fu),l=Qp(s),c=Qp(n==null?void 0:n.id);return p.useEffect(()=>{if(!t&&!s&&l&&c!=null){if(!Ph(l)||document.activeElement===l.target)return;const d=a.get(c);if(!d)return;const{activatorNode:f,node:m}=d;if(!f.current&&!m.current)return;requestAnimationFrame(()=>{for(const g of[f.current,m.current]){if(!g)continue;const x=k$(g);if(x){x.focus();break}}})}},[s,t,a,c,l]),null}function DM(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...s}),n):n}function IM(e){return p.useMemo(()=>({draggable:{...Kc.draggable,...e==null?void 0:e.draggable},droppable:{...Kc.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Kc.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 OM(e){let{activeNode:t,measure:n,initialRect:s,config:a=!0}=e;const l=p.useRef(!1),{x:c,y:d}=typeof a=="boolean"?{x:a,y:a}:a;Yr(()=>{if(!c&&!d||!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 g=n(m),x=Kk(g,s);if(c||(x.x=0),d||(x.y=0),l.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const y=Gk(m);y&&y.scrollBy({top:x.y,left:x.x})}},[t,c,d,s,n])}const s1=p.createContext({...Nr,scaleX:1,scaleY:1});var Bs;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Bs||(Bs={}));const Lh=p.memo(function(t){var n,s,a,l;let{id:c,accessibility:d,autoScroll:f=!0,children:m,sensors:g=NM,collisionDetection:x=_$,measuring:y,modifiers:v,...E}=t;const k=p.useReducer(RM,void 0,PM),[w,S]=k,[T,N]=P$(),[A,M]=p.useState(Bs.Uninitialized),R=A===Bs.Initialized,{draggable:{active:I,nodes:O,translate:Y},droppable:{containers:J}}=w,_=I!=null?O.get(I):null,U=p.useRef({initial:null,translated:null}),X=p.useMemo(()=>{var mt;return I!=null?{id:I,data:(mt=_==null?void 0:_.data)!=null?mt:CM,rect:U}:null},[I,_]),q=p.useRef(null),[G,B]=p.useState(null),[W,D]=p.useState(null),ee=Va(E,Object.values(E)),C=ll("DndDescribedBy",c),$=p.useMemo(()=>J.getEnabled(),[J]),Z=IM(y),{droppableRects:L,measureDroppableContainers:ae,measuringScheduled:ce}=pM($,{dragging:R,dependencies:[Y.x,Y.y],config:Z.droppable}),Q=dM(O,I),ge=p.useMemo(()=>W?Zp(W):null,[W]),je=Rr(),Ne=mM(Q,Z.draggable.measure);OM({activeNode:I!=null?O.get(I):null,config:je.layoutShiftCompensation,initialRect:Ne,measure:Z.draggable.measure});const ke=jb(Q,Z.draggable.measure,Ne),Ve=jb(Q?Q.parentElement:null),Ye=p.useRef({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:L,draggableNodes:O,draggingNode:null,draggingNodeRect:null,droppableContainers:J,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=J.getNodeFor((n=Ye.current.over)==null?void 0:n.id),ne=SM({measure:Z.dragOverlay.measure}),le=(s=ne.nodeRef.current)!=null?s:Q,H=R?(a=ne.rect)!=null?a:ke:null,fe=!!(ne.nodeRef.current&&ne.rect),ve=xM(fe?null:ke),_e=n1(le?Un(le):null),Ie=yM(R?ie??Q:null),st=jM(Ie),lt=DM(v,{transform:{x:Y.x-ve.x,y:Y.y-ve.y,scaleX:1,scaleY:1},activatorEvent:W,active:X,activeNodeRect:ke,containerNodeRect:Ve,draggingNodeRect:H,over:Ye.current.over,overlayNodeRect:ne.rect,scrollableAncestors:Ie,scrollableAncestorRects:st,windowRect:_e}),_t=ge?fi(ge,Y):null,kt=vM(Ie),St=Sb(kt),se=Sb(kt,[ke]),pe=fi(lt,St),Pe=H?B$(H,lt):null,Fe=X&&Pe?x({active:X,collisionRect:Pe,droppableRects:L,droppableContainers:$,pointerCoordinates:_t}):null,qe=$$(Fe,"id"),[tt,me]=p.useState(null),We=fe?lt:fi(lt,se),He=F$(We,(l=tt==null?void 0:tt.rect)!=null?l:null,ke),cn=p.useRef(null),It=p.useCallback((mt,Ft)=>{let{sensor:qt,options:kn}=Ft;if(q.current==null)return;const un=O.get(q.current);if(!un)return;const Zt=mt.nativeEvent,ct=new qt({active:q.current,activeNode:un,event:Zt,options:kn,context:Ye,onAbort(ut){if(!O.get(ut))return;const{onDragAbort:en}=ee.current,Wn={id:ut};en==null||en(Wn),T({type:"onDragAbort",event:Wn})},onPending(ut,Pn,en,Wn){if(!O.get(ut))return;const{onDragPending:z}=ee.current,ue={id:ut,constraint:Pn,initialCoordinates:en,offset:Wn};z==null||z(ue),T({type:"onDragPending",event:ue})},onStart(ut){const Pn=q.current;if(Pn==null)return;const en=O.get(Pn);if(!en)return;const{onDragStart:Wn}=ee.current,tn={activatorEvent:Zt,active:{id:Pn,data:en.data,rect:U}};Us.unstable_batchedUpdates(()=>{Wn==null||Wn(tn),M(Bs.Initializing),S({type:Yt.DragStart,initialCoordinates:ut,active:Pn}),T({type:"onDragStart",event:tn}),B(cn.current),D(Zt)})},onMove(ut){S({type:Yt.DragMove,coordinates:ut})},onEnd:pr(Yt.DragEnd),onCancel:pr(Yt.DragCancel)});cn.current=ct;function pr(ut){return async function(){const{active:en,collisions:Wn,over:tn,scrollAdjustedTranslate:z}=Ye.current;let ue=null;if(en&&z){const{cancelDrop:Se}=ee.current;ue={activatorEvent:Zt,active:en,collisions:Wn,delta:z,over:tn},ut===Yt.DragEnd&&typeof Se=="function"&&await Promise.resolve(Se(ue))&&(ut=Yt.DragCancel)}q.current=null,Us.unstable_batchedUpdates(()=>{S({type:ut}),M(Bs.Uninitialized),me(null),B(null),D(null),cn.current=null;const Se=ut===Yt.DragEnd?"onDragEnd":"onDragCancel";if(ue){const Je=ee.current[Se];Je==null||Je(ue),T({type:Se,event:ue})}})}}},[O]),Tn=p.useCallback((mt,Ft)=>(qt,kn)=>{const un=qt.nativeEvent,Zt=O.get(kn);if(q.current!==null||!Zt||un.dndKit||un.defaultPrevented)return;const ct={active:Zt};mt(qt,Ft.options,ct)===!0&&(un.dndKit={capturedBy:Ft.sensor},q.current=kn,It(qt,Ft))},[O,It]),Qt=fM(g,Tn);bM(g),Yr(()=>{ke&&A===Bs.Initializing&&M(Bs.Initialized)},[ke,A]),p.useEffect(()=>{const{onDragMove:mt}=ee.current,{active:Ft,activatorEvent:qt,collisions:kn,over:un}=Ye.current;if(!Ft||!qt)return;const Zt={active:Ft,activatorEvent:qt,collisions:kn,delta:{x:pe.x,y:pe.y},over:un};Us.unstable_batchedUpdates(()=>{mt==null||mt(Zt),T({type:"onDragMove",event:Zt})})},[pe.x,pe.y]),p.useEffect(()=>{const{active:mt,activatorEvent:Ft,collisions:qt,droppableContainers:kn,scrollAdjustedTranslate:un}=Ye.current;if(!mt||q.current==null||!Ft||!un)return;const{onDragOver:Zt}=ee.current,ct=kn.get(qe),pr=ct&&ct.rect.current?{id:ct.id,rect:ct.rect.current,data:ct.data,disabled:ct.disabled}:null,ut={active:mt,activatorEvent:Ft,collisions:qt,delta:{x:un.x,y:un.y},over:pr};Us.unstable_batchedUpdates(()=>{me(pr),Zt==null||Zt(ut),T({type:"onDragOver",event:ut})})},[qe]),Yr(()=>{Ye.current={activatorEvent:W,active:X,activeNode:Q,collisionRect:Pe,collisions:Fe,droppableRects:L,draggableNodes:O,draggingNode:le,draggingNodeRect:H,droppableContainers:J,over:tt,scrollableAncestors:Ie,scrollAdjustedTranslate:pe},U.current={initial:H,translated:Pe}},[X,Q,Fe,Pe,O,le,H,L,J,tt,Ie,pe]),lM({...je,delta:Y,draggingRect:Pe,pointerCoordinates:_t,scrollableAncestors:Ie,scrollableAncestorRects:st});const Hn=p.useMemo(()=>({active:X,activeNode:Q,activeNodeRect:ke,activatorEvent:W,collisions:Fe,containerNodeRect:Ve,dragOverlay:ne,draggableNodes:O,droppableContainers:J,droppableRects:L,over:tt,measureDroppableContainers:ae,scrollableAncestors:Ie,scrollableAncestorRects:st,measuringConfiguration:Z,measuringScheduled:ce,windowRect:_e}),[X,Q,ke,W,Fe,Ve,ne,O,J,L,tt,ae,Ie,st,Z,ce,_e]),fr=p.useMemo(()=>({activatorEvent:W,activators:Qt,active:X,activeNodeRect:ke,ariaDescribedById:{draggable:C},dispatch:S,draggableNodes:O,over:tt,measureDroppableContainers:ae}),[W,Qt,X,ke,S,C,O,tt,ae]);return Lt.createElement(qk.Provider,{value:N},Lt.createElement(Fu.Provider,{value:fr},Lt.createElement(r1.Provider,{value:Hn},Lt.createElement(s1.Provider,{value:He},m)),Lt.createElement(AM,{disabled:(d==null?void 0:d.restoreFocus)===!1})),Lt.createElement(D$,{...d,hiddenTextDescribedById:C}));function Rr(){const mt=(G==null?void 0:G.autoScrollEnabled)===!1,Ft=typeof f=="object"?f.enabled===!1:f===!1,qt=R&&!mt&&!Ft;return typeof f=="object"?{...f,enabled:qt}:{enabled:qt}}}),LM=p.createContext(null),Cb="button",$M="Draggable";function MM(e){let{id:t,data:n,disabled:s=!1,attributes:a}=e;const l=ll($M),{activators:c,activatorEvent:d,active:f,activeNodeRect:m,ariaDescribedById:g,draggableNodes:x,over:y}=p.useContext(Fu),{role:v=Cb,roleDescription:E="draggable",tabIndex:k=0}=a??{},w=(f==null?void 0:f.id)===t,S=p.useContext(w?s1:LM),[T,N]=cu(),[A,M]=cu(),R=wM(c,t),I=Va(n);Yr(()=>(x.set(t,{id:t,key:l,node:T,activatorNode:A,data:I}),()=>{const Y=x.get(t);Y&&Y.key===l&&x.delete(t)}),[x,t]);const O=p.useMemo(()=>({role:v,tabIndex:k,"aria-disabled":s,"aria-pressed":w&&v===Cb?!0:void 0,"aria-roledescription":E,"aria-describedby":g.draggable}),[s,v,k,w,E,g.draggable]);return{active:f,activatorEvent:d,activeNodeRect:m,attributes:O,isDragging:w,listeners:s?void 0:R,node:T,over:y,setNodeRef:N,setActivatorNodeRef:M,transform:S}}function _M(){return p.useContext(r1)}const FM="Droppable",zM={timeout:25};function BM(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:a}=e;const l=ll(FM),{active:c,dispatch:d,over:f,measureDroppableContainers:m}=p.useContext(Fu),g=p.useRef({disabled:n}),x=p.useRef(!1),y=p.useRef(null),v=p.useRef(null),{disabled:E,updateMeasurementsFor:k,timeout:w}={...zM,...a},S=Va(k??s),T=p.useCallback(()=>{if(!x.current){x.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{m(Array.isArray(S.current)?S.current:[S.current]),v.current=null},w)},[w]),N=_u({callback:T,disabled:E||!c}),A=p.useCallback((O,Y)=>{N&&(Y&&(N.unobserve(Y),x.current=!1),O&&N.observe(O))},[N]),[M,R]=cu(A),I=Va(t);return p.useEffect(()=>{!N||!M.current||(N.disconnect(),x.current=!1,N.observe(M.current))},[M,N]),p.useEffect(()=>(d({type:Yt.RegisterDroppable,element:{id:s,key:l,disabled:n,node:M,rect:y,data:I}}),()=>d({type:Yt.UnregisterDroppable,key:l,id:s})),[s]),p.useEffect(()=>{n!==g.current.disabled&&(d({type:Yt.SetDroppableDisabled,id:s,key:l,disabled:n}),g.current.disabled=n)},[s,l,n,d]),{active:c,rect:y,isOver:(f==null?void 0:f.id)===s,node:M,over:f,setNodeRef:R}}function dl(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function UM(e,t){return e.reduce((n,s,a)=>{const l=t.get(s);return l&&(n[a]=l),n},Array(e.length))}function Dc(e){return e!==null&&e>=0}function HM(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 WM(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const o1=e=>{let{rects:t,activeIndex:n,overIndex:s,index:a}=e;const l=dl(t,s,n),c=t[a],d=l[a];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},Ic={scaleX:1,scaleY:1},$h=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:a,rects:l,overIndex:c}=e;const d=(t=l[n])!=null?t:s;if(!d)return null;if(a===n){const m=l[c];return m?{x:0,y:n<c?m.top+m.height-(d.top+d.height):m.top-d.top,...Ic}:null}const f=VM(l,a,n);return a>n&&a<=c?{x:0,y:-d.height-f,...Ic}:a<n&&a>=c?{x:0,y:d.height+f,...Ic}:{x:0,y:0,...Ic}};function VM(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 i1="Sortable",a1=Lt.createContext({activeIndex:-1,containerId:i1,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:o1,disabled:{draggable:!1,droppable:!1}});function Mh(e){let{children:t,id:n,items:s,strategy:a=o1,disabled:l=!1}=e;const{active:c,dragOverlay:d,droppableRects:f,over:m,measureDroppableContainers:g}=_M(),x=ll(i1,n),y=d.rect!==null,v=p.useMemo(()=>s.map(R=>typeof R=="object"&&"id"in R?R.id:R),[s]),E=c!=null,k=c?v.indexOf(c.id):-1,w=m?v.indexOf(m.id):-1,S=p.useRef(v),T=!HM(v,S.current),N=w!==-1&&k===-1||T,A=WM(l);Yr(()=>{T&&E&&g(v)},[T,v,E,g]),p.useEffect(()=>{S.current=v},[v]);const M=p.useMemo(()=>({activeIndex:k,containerId:x,disabled:A,disableTransforms:N,items:v,overIndex:w,useDragOverlay:y,sortedRects:UM(v,f),strategy:a}),[k,x,A.draggable,A.droppable,N,v,w,f,y,a]);return Lt.createElement(a1.Provider,{value:M},t)}const qM=e=>{let{id:t,items:n,activeIndex:s,overIndex:a}=e;return dl(n,s,a).indexOf(t)},KM=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:a,items:l,newIndex:c,previousItems:d,previousContainerId:f,transition:m}=e;return!m||!s||d!==l&&a===c?!1:n?!0:c!==a&&t===f},GM={duration:200,easing:"ease"},l1="transform",YM=xo.Transition.toString({property:l1,duration:0,easing:"linear"}),XM={roleDescription:"sortable"};function JM(e){let{disabled:t,index:n,node:s,rect:a}=e;const[l,c]=p.useState(null),d=p.useRef(n);return Yr(()=>{if(!t&&n!==d.current&&s.current){const f=a.current;if(f){const m=Pi(s.current,{ignoreTransform:!0}),g={x:f.left-m.left,y:f.top-m.top,scaleX:f.width/m.width,scaleY:f.height/m.height};(g.x||g.y)&&c(g)}}n!==d.current&&(d.current=n)},[t,n,s,a]),p.useEffect(()=>{l&&c(null)},[l]),l}function _h(e){let{animateLayoutChanges:t=KM,attributes:n,disabled:s,data:a,getNewIndex:l=qM,id:c,strategy:d,resizeObserverConfig:f,transition:m=GM}=e;const{items:g,containerId:x,activeIndex:y,disabled:v,disableTransforms:E,sortedRects:k,overIndex:w,useDragOverlay:S,strategy:T}=p.useContext(a1),N=QM(s,v),A=g.indexOf(c),M=p.useMemo(()=>({sortable:{containerId:x,index:A,items:g},...a}),[x,a,A,g]),R=p.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:I,node:O,isOver:Y,setNodeRef:J}=BM({id:c,data:M,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:R,...f}}),{active:_,activatorEvent:U,activeNodeRect:X,attributes:q,setNodeRef:G,listeners:B,isDragging:W,over:D,setActivatorNodeRef:ee,transform:C}=MM({id:c,data:M,attributes:{...XM,...n},disabled:N.draggable}),$=v$(J,G),Z=!!_,L=Z&&!E&&Dc(y)&&Dc(w),ae=!S&&W,ce=ae&&L?C:null,ge=L?ce??(d??T)({rects:k,activeNodeRect:X,activeIndex:y,overIndex:w,index:A}):null,je=Dc(y)&&Dc(w)?l({id:c,items:g,activeIndex:y,overIndex:w}):A,Ne=_==null?void 0:_.id,ke=p.useRef({activeId:Ne,items:g,newIndex:je,containerId:x}),Ve=g!==ke.current.items,Ye=t({active:_,containerId:x,isDragging:W,isSorting:Z,id:c,index:A,items:g,newIndex:ke.current.newIndex,previousItems:ke.current.items,previousContainerId:ke.current.containerId,transition:m,wasDragging:ke.current.activeId!=null}),ie=JM({disabled:!Ye,index:A,node:O,rect:I});return p.useEffect(()=>{Z&&ke.current.newIndex!==je&&(ke.current.newIndex=je),x!==ke.current.containerId&&(ke.current.containerId=x),g!==ke.current.items&&(ke.current.items=g)},[Z,je,x,g]),p.useEffect(()=>{if(Ne===ke.current.activeId)return;if(Ne!=null&&ke.current.activeId==null){ke.current.activeId=Ne;return}const le=setTimeout(()=>{ke.current.activeId=Ne},50);return()=>clearTimeout(le)},[Ne]),{active:_,activeIndex:y,attributes:q,data:M,rect:I,index:A,newIndex:je,items:g,isOver:Y,isSorting:Z,isDragging:W,listeners:B,node:O,overIndex:w,over:D,setNodeRef:$,setActivatorNodeRef:ee,setDroppableNodeRef:J,setDraggableNodeRef:G,transform:ie??ge,transition:ne()};function ne(){if(ie||Ve&&ke.current.newIndex===A)return YM;if(!(ae&&!Ph(U)||!m)&&(Z||Ye))return xo.Transition.toString({...m,property:l1})}}function QM(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}}nt.Down,nt.Right,nt.Up,nt.Left;function Zr(e){return`/api/projects/${encodeURIComponent(e)}/todos`}function ZM(e){const[t,n]=p.useState(null),[s,a]=p.useState(!0),[l,c]=p.useState(null),d=p.useCallback(async()=>{if(e)try{const f=await fetch(Zr(e));if(!f.ok)throw new Error(`HTTP ${f.status}`);n(await f.json()),c(null)}catch(f){c(f instanceof Error?f.message:"Failed to fetch todos")}finally{a(!1)}},[e]);return p.useEffect(()=>{d()},[d]),yu(f=>{f.type==="todos-updated"&&f.projectSlug===e&&d()}),{data:t,loading:s,error:l,refetch:d}}async function e_(e,t,n){await fetch(Zr(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,tags:n})})}async function t_(e,t,n){await fetch(`${Zr(e)}/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({summary:"Completed."})})}async function n_(e,t,n){await fetch(`${Zr(e)}/${t}/block`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:n})})}async function r_(e,t,n){await fetch(`${Zr(e)}/${t}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:n})})}async function s_(e,t){await fetch(`${Zr(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function o_(e,t){await fetch(`${Zr(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function i_(e,t){await fetch(`${Zr(e)}/${t}`,{method:"DELETE"})}async function c1(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 a_(e,t){return await c1(`${Zr(e)}/promote`,t)}async function l_(e,t,n){await c1(`${Zr(e)}/${t}/move`,{to:n})}const Eb=[{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 Fh({status:e,onChange:t}){const[n,s]=p.useState(!1),a=p.useRef(null);p.useEffect(()=>{if(!n)return;function c(d){a.current&&!a.current.contains(d.target)&&s(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]);const l=Eb.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:Eb.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))})]})}const u1="__one_off__";function zh({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:a,defaultProject:l,defaultTitle:c,allowOneOff:d=!0}){const[f,m]=p.useState("new"),[g,x]=p.useState(!1),[y,v]=p.useState(null),[E,k]=p.useState(null),[w,S]=p.useState(null),[T,N]=p.useState(""),[A,M]=p.useState(""),[R,I]=p.useState(""),[O,Y]=p.useState(""),[J,_]=p.useState(""),[U,X]=p.useState(""),[q,G]=p.useState(null),[B,W]=p.useState(!1),D=t.length>1;p.useEffect(()=>{if(!e){m("new"),v(null),N(""),M(""),I(""),Y(""),_(""),X(""),G(null);return}N(l??""),M(c??"");let ae=!1;return(async()=>{try{const ce=await fetch("/api/projects");if(!ce.ok)throw new Error(`HTTP ${ce.status}`);const Q=await ce.json();ae||k(Q.filter(ge=>!ge.archived))}catch(ce){ae||S(ce instanceof Error?ce.message:String(ce))}})(),()=>{ae=!0}},[e,l,c]),p.useEffect(()=>{if(!J){G(null);return}let ae=!1;return W(!0),(async()=>{try{const ce=await fetch(`/api/projects/${encodeURIComponent(J)}/assignments`);if(!ce.ok)throw new Error(`HTTP ${ce.status}`);const Q=await ce.json();ae||G(Q)}catch{ae||G([])}finally{ae||W(!1)}})(),()=>{ae=!0}},[J]);const ee=p.useMemo(()=>E??[],[E]);async function C(ae){if(ae.preventDefault(),!T){v('Pick a target project (or "One-off").');return}if(D&&!A.trim()){v("Title is required when promoting multiple todos.");return}const ce=T===u1?{oneOff:!0}:{project:T};if(n.kind==="aggregate"){const ge={groups:n.groups,mode:"new-assignment",target:ce,title:A.trim()||void 0,type:R.trim()||void 0,priority:O||void 0};await L(ge);return}const Q={todoIds:t,mode:"new-assignment",target:ce,title:A.trim()||void 0,type:R.trim()||void 0,priority:O||void 0};await Z(Q)}async function $(ae){if(ae.preventDefault(),n.kind==="aggregate"){v("Existing-assignment mode does not support cross-workspace selections yet.");return}if(!J||!U){v("Pick both project and assignment.");return}const ce={todoIds:t,mode:"to-assignment",target:{assignment:`${J}/${U}`}};await Z(ce)}async function Z(ae){x(!0),v(null);try{let ce;if(n.kind==="workspace")ce=await iT(n.workspace,ae);else if(n.kind==="project")ce=await a_(n.projectId,ae);else throw new Error("Aggregate scope requires runBulkMutation.");a(ce),s(!1)}catch(ce){v(ce instanceof Error?ce.message:String(ce))}finally{x(!1)}}async function L(ae){x(!0),v(null);try{const ce=await aT(ae);a(ce),s(!1)}catch(ce){v(ce instanceof Error?ce.message:String(ce))}finally{x(!1)}}return r.jsx(Jr,{open:e,onOpenChange:ae=>g?void 0:s(ae),children:r.jsxs(Tr,{className:"max-w-xl",children:[r.jsxs(bo,{children:[r.jsxs(Pr,{children:["Promote ",t.length," todo",t.length===1?"":"s"]}),r.jsxs(ps,{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(ak,{value:f,onValueChange:ae=>m(ae),children:[r.jsxs(lk,{className:"flex gap-2 rounded-md border border-border/70 bg-card/80 p-1 mb-4",children:[r.jsx(zp,{value:"new",className:ze("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(zp,{value:"existing",className:ze("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(Bp,{value:"new",children:r.jsxs("form",{onSubmit:C,className:"space-y-4",children:[r.jsx(Zo,{label:"Target project",children:r.jsx(Tb,{value:T,onChange:N,projects:ee,error:w,disabled:g,allowOneOff:d})}),r.jsx(Zo,{label:D?"Title (required)":"Title (defaults to first todo)",children:r.jsx("input",{type:"text",value:A,onChange:ae=>M(ae.target.value),disabled:g,className:"editor-textarea w-full bg-background/95 font-sans"})}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx(Zo,{label:"Type",children:r.jsx("input",{type:"text",value:R,onChange:ae=>I(ae.target.value),placeholder:"feature",disabled:g,className:"editor-textarea w-full bg-background/95 font-sans"})}),r.jsx(Zo,{label:"Priority",children:r.jsxs("select",{value:O,onChange:ae=>Y(ae.target.value),disabled:g,className:"editor-textarea w-full 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(Pb,{message:y}):null,r.jsx(Rb,{onCancel:()=>s(!1),submitting:g,submitLabel:"Promote"})]})}),r.jsx(Bp,{value:"existing",children:r.jsxs("form",{onSubmit:$,className:"space-y-4",children:[r.jsx(Zo,{label:"Project",children:r.jsx(Tb,{value:J,onChange:ae=>{_(ae),X("")},projects:ee,error:w,disabled:g})}),r.jsx(Zo,{label:B?"Assignment (loading...)":"Assignment",children:r.jsxs("select",{value:U,onChange:ae=>X(ae.target.value),disabled:g||!J||B,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:J?"Select assignment...":"Pick a project first"}),(q??[]).map(ae=>r.jsxs("option",{value:ae.slug,children:[ae.title," (",ae.status,")"]},ae.slug))]})}),y?r.jsx(Pb,{message:y}):null,r.jsx(Rb,{onCancel:()=>s(!1),submitting:g,submitLabel:"Promote"})]})})]})]})})}function Zo({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 Tb({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-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"Select project..."}),l?r.jsx("option",{value:u1,children:"One-off (no project)"}):null,n.map(c=>r.jsxs("option",{value:c.slug,children:[c.title," (",c.slug,")"]},c.slug))]})}function Pb({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 Rb({onCancel:e,submitting:t,submitLabel:n}){return r.jsxs(wo,{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 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:t?"Submitting...":n})]})}function d1({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:a}){const[l,c]=p.useState("project"),[d,f]=p.useState(""),[m,g]=p.useState(""),[x,y]=p.useState(!1),[v,E]=p.useState(null),[k,w]=p.useState(null),[S,T]=p.useState(null);p.useEffect(()=>{if(!e){c("project"),f(""),g(""),E(null),w(null);return}let I=!1;return(async()=>{try{const O=await fetch("/api/projects");if(!O.ok)throw new Error(`HTTP ${O.status}`);const Y=await O.json();I||T(Y.filter(J=>!J.archived))}catch(O){I||w(O instanceof Error?O.message:String(O))}})(),()=>{I=!0}},[e]);const N=p.useMemo(()=>S?n.kind==="project"?S.filter(I=>I.slug!==n.projectId):S:[],[S,n]);function A(){if(l==="global")return{global:!0};if(l==="workspace"){const I=d.trim();return I?{workspace:I}:"Workspace name is required."}return m?{project:m}:"Pick a target project."}async function M(I,O){try{return n.kind==="workspace"?await lT(n.workspace,I,O):await l_(n.projectId,I,O),{ok:!0}}catch(Y){return{ok:!1,error:Y instanceof Error?Y.message:String(Y)}}}async function R(I){I.preventDefault(),w(null);const O=A();if(typeof O=="string"){w(O);return}y(!0),E(null);const Y=[],J=[];for(const _ of t){const U=await M(_,O);U.ok?Y.push(_):J.push({id:_,error:U.error})}y(!1),a(),J.length===0?s(!1):E({succeeded:Y,failed:J})}return r.jsx(Jr,{open:e,onOpenChange:I=>x?void 0:s(I),children:r.jsx(Tr,{className:"max-w-xl",children:r.jsxs("form",{onSubmit:R,className:"space-y-4",children:[r.jsxs(bo,{children:[r.jsxs(Pr,{children:["Move ",t.length," todo",t.length===1?"":"s"]}),r.jsxs(ps,{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:x,children:[r.jsx("legend",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground mb-1",children:"Target scope"}),r.jsx(hp,{kind:"project",checked:l==="project",onChange:()=>c("project"),label:"Project"}),r.jsx(hp,{kind:"workspace",checked:l==="workspace",onChange:()=>c("workspace"),label:"Workspace"}),r.jsx(hp,{kind:"global",checked:l==="global",onChange:()=>c("global"),label:"Global"})]}),l==="project"?r.jsx(Ab,{label:"Target project",children:r.jsxs("select",{value:m,onChange:I=>g(I.target.value),disabled:x,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"Select project..."}),N.map(I=>r.jsxs("option",{value:I.slug,children:[I.title," (",I.slug,")"]},I.slug))]})}):null,l==="workspace"?r.jsx(Ab,{label:"Target workspace name",children:r.jsx("input",{type:"text",value:d,onChange:I=>f(I.target.value),disabled:x,placeholder:"e.g. syntaur",className:"editor-textarea w-full bg-background/95 font-sans"})}):null,k?r.jsx(c_,{message:k}):null,v?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 ",v.succeeded.length," of ",t.length,"; ",v.failed.length," failed."]}),r.jsx("ul",{className:"text-xs space-y-0.5",children:v.failed.map(I=>r.jsxs("li",{children:["[t:",I.id,"] ",I.error]},I.id))})]}):null,r.jsxs(wo,{children:[r.jsx("button",{type:"button",onClick:()=>s(!1),disabled:x,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:v?"Close":"Cancel"}),v===null?r.jsx("button",{type:"submit",disabled:x,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:x?"Moving...":"Move"}):null]})]})})})}function Ab({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 hp({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 c_({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 u_({item:e,copiedId:t,selected:n,onToggleSelected:s,onMoveOne:a,onCycleStatus:l,onStatusChange:c,onCopyId:d,onDelete:f,disabled:m,hotkeyRowProps:g}){const{attributes:x,listeners:y,setNodeRef:v,setActivatorNodeRef:E,transform:k,transition:w,isDragging:S}=_h({id:e.id,disabled:m}),T={transform:xo.Transform.toString(k),transition:w,zIndex:S?50:void 0,position:S?"relative":void 0};return r.jsxs("div",{ref:v,style:T,"data-todo-id":e.id,...g??{},className:`surface-panel flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-foreground/[0.03] transition ${S?"opacity-50 shadow-lg":""}`,onClick:()=>l(e.id,e.status),children:[r.jsx("input",{type:"checkbox","aria-label":`Select todo ${e.id}`,checked:n,onChange:N=>s(e.id,N),onClick:N=>N.stopPropagation(),className:"h-4 w-4 cursor-pointer accent-foreground"}),!m&&r.jsx("button",{ref:E,...x,...y,className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",onClick:N=>N.stopPropagation(),children:r.jsx(xm,{className:"h-4 w-4"})}),r.jsx(Fh,{status:e.status,onChange:N=>c(e.id,N)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:`text-sm ${e.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:e.description}),e.tags.length>0&&r.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:e.tags.map(N=>`#${N}`).join(" ")}),e.session&&r.jsxs("span",{className:"ml-2 text-xs text-info-foreground/70 font-mono",children:["session:",e.session.slice(0,8)]}),r.jsx(f1,{item:e})]}),t===e.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(vi,{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:N=>d(N,e.id),children:["t:",e.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>d(N,e.id),children:r.jsx(Fa,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:N=>a(e.id,N),children:r.jsx(Za,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:N=>f(N,e.id,e.description),children:r.jsx(zn,{className:"h-3 w-3"})})]})]})}function f1({item:e}){return!(e.branch||e.planDir||e.worktreePath||e.createdAt||e.updatedAt)?null:r.jsxs("span",{className:"inline-flex items-center gap-1 ml-2 align-middle",children:[e.branch?r.jsx(po,{delayDuration:120,children:r.jsxs(zr,{children:[r.jsx(Br,{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(gm,{className:"h-2.5 w-2.5"}),r.jsx("span",{className:"max-w-[120px] truncate",children:e.branch})]})}),r.jsx(wr,{children:e.branch})]})}):null,e.planDir?r.jsx(po,{delayDuration:120,children:r.jsxs(zr,{children:[r.jsx(Br,{asChild:!0,children:r.jsx("button",{type:"button",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(jw,{className:"h-2.5 w-2.5"})})}),r.jsxs(wr,{children:["Plan: ",e.planDir]})]})}):null,e.worktreePath||e.createdAt||e.updatedAt?r.jsx(po,{delayDuration:120,children:r.jsxs(zr,{children:[r.jsx(Br,{asChild:!0,children:r.jsx("span",{className:"text-[10px] text-muted-foreground/60 cursor-default",children:"·"})}),r.jsx(wr,{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]})}function d_(){const{workspace:e}=jt(),t=e||"_global",{data:n,loading:s,error:a,refetch:l}=sT(t),[c,d]=p.useState(""),[f,m]=p.useState(""),[g,x]=p.useState(""),[y,v]=p.useState(""),[E,k]=p.useState(null),[w,S]=p.useState(new Set),[T,N]=p.useState(!1),[A,M]=p.useState(!1),[R,I]=p.useState(null),O=p.useRef(null);Gs("list:todos");const Y=!!(c.trim()||f||g),J=Rh(gi(ul,{activationConstraint:{distance:8}}),gi(cl));function _(ne,le){ne.stopPropagation(),navigator.clipboard.writeText(le),k(le),setTimeout(()=>k(H=>H===le?null:H),1500)}const U=p.useMemo(()=>{if(!(n!=null&&n.items))return[];const ne=new Set;for(const le of n.items)for(const H of le.tags)ne.add(H);return Array.from(ne).sort()},[n]),X=p.useMemo(()=>{if(!(n!=null&&n.items))return[];let ne=n.items;if(c.trim()){const le=c.toLowerCase();ne=ne.filter(H=>H.description.toLowerCase().includes(le)||H.tags.some(fe=>fe.toLowerCase().includes(le))||H.id.includes(le))}return f&&(ne=ne.filter(le=>le.status===f)),g&&(ne=ne.filter(le=>le.tags.includes(g))),ne},[n,c,f,g]);p.useEffect(()=>{S(new Set)},[c,f,g,t]);const q=p.useMemo(()=>X.filter(ne=>w.has(ne.id)).length,[X,w]),G=X.length>0&&q===X.length,B=q>0&&!G;function W(ne){S(le=>{const H=new Set(le);return H.has(ne)?H.delete(ne):H.add(ne),H})}function D(){S(ne=>{const le=new Set(ne);if(G)for(const H of X)le.delete(H.id);else for(const H of X)le.add(H.id);return le})}function ee(){S(new Set)}const C=R?[R]:Array.from(w);function $(){S(new Set),I(null),l()}function Z(){S(new Set),l()}async function L(){y.trim()&&(await Pm(t,y.trim()),v(""),l())}const ae={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function ce(ne,le){ge(ne,ae[le]||"open")}async function Q(ne,le,H){ne.stopPropagation(),window.confirm(`Delete "${H}"? This can't be undone.`)&&(await t0(t,le),l())}async function ge(ne,le){switch(le){case"open":await e0(t,ne);break;case"in_progress":await Zw(t,ne);break;case"completed":await Jw(t,ne);break;case"blocked":await Qw(t,ne);break}l()}const{hotkeyRowProps:je}=el(X,{scope:"list:todos",bindO:!1,onOpen:ne=>ce(ne.id,ne.status)});pt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var ne;return(ne=O.current)==null?void 0:ne.focus()}}),pt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>l()});const[Ne,ke]=Xr(),Ve=Ne.get("focus");p.useEffect(()=>{if(!Ve)return;const ne=document.querySelector(`[data-todo-id="${window.CSS.escape(Ve)}"]`);if(!ne)return;ne.scrollIntoView({block:"nearest"}),ne.classList.add("ring-2","ring-primary/60");const le=window.setTimeout(()=>{ne.classList.remove("ring-2","ring-primary/60"),ke(H=>{const fe=new URLSearchParams(H);return fe.delete("focus"),fe})},1500);return()=>window.clearTimeout(le)},[Ve,X.length,ke]);async function Ye(ne){const{active:le,over:H}=ne;if(!H||le.id===H.id||!(n!=null&&n.items))return;const fe=n.items.findIndex(Ie=>Ie.id===le.id),ve=n.items.findIndex(Ie=>Ie.id===H.id);if(fe===-1||ve===-1)return;const _e=dl(n.items,fe,ve);await oT(t,_e.map(Ie=>Ie.id)),l()}if(s)return r.jsx(at,{label:"Loading todos..."});if(a)return r.jsx(et,{error:a});const ie=(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(mn,{label:"Open",value:ie.open,icon:cr}),r.jsx(mn,{label:"In Progress",value:ie.in_progress,icon:cr,tone:"info"}),r.jsx(mn,{label:"Blocked",value:ie.blocked,icon:jm,tone:"warn"}),r.jsx(mn,{label:"Total",value:ie.total,icon:cr})]}),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:y,onChange:ne=>v(ne.target.value),onKeyDown:ne=>ne.key==="Enter"&&L(),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:L,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(Ht,{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(qs,{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:c,onChange:ne=>d(ne.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:f,onChange:ne=>m(ne.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"})]}),U.length>0&&r.jsxs("select",{value:g,onChange:ne=>x(ne.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"}),U.map(ne=>r.jsxs("option",{value:ne,children:["#",ne]},ne))]})]}),w.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:[w.size," selected"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>N(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote selected"}),r.jsx("button",{type:"button",onClick:()=>{I(null),M(!0)},className:"shell-action",children:"Move to…"}),r.jsx("button",{type:"button",onClick:ee,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,X.length===0?r.jsx(ot,{title:"No todos",description:"Add your first todo above."}):r.jsxs(r.Fragment,{children:[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:G,ref:ne=>{ne&&(ne.indeterminate=B)},onChange:D,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",X.length,")"]})]}),r.jsx(Lh,{sensors:J,collisionDetection:Ah,onDragEnd:Ye,children:r.jsx(Mh,{items:X.map(ne=>ne.id),strategy:$h,children:r.jsx("div",{className:"space-y-1",children:X.map((ne,le)=>r.jsx(u_,{item:ne,copiedId:E,selected:w.has(ne.id),onToggleSelected:H=>W(H),onMoveOne:(H,fe)=>{fe.stopPropagation(),I(H),M(!0)},onCycleStatus:ce,onStatusChange:ge,onCopyId:_,onDelete:Q,disabled:Y,hotkeyRowProps:je(le)},ne.id))})})})]}),r.jsx(zh,{open:T,selectedIds:Array.from(w),scope:{kind:"workspace",workspace:t},onOpenChange:N,onDone:Z}),r.jsx(d1,{open:A,selectedIds:C,scope:{kind:"workspace",workspace:t},onOpenChange:ne=>{M(ne),ne||I(null)},onDone:$})]})}function f_({item:e,copiedId:t,selected:n,onToggleSelected:s,onMoveOne:a,onCycleStatus:l,onStatusChange:c,onCopyId:d,onDelete:f,disabled:m,hotkeyRowProps:g}){const{attributes:x,listeners:y,setNodeRef:v,setActivatorNodeRef:E,transform:k,transition:w,isDragging:S}=_h({id:e.id,disabled:m}),T={transform:xo.Transform.toString(k),transition:w,zIndex:S?50:void 0,position:S?"relative":void 0};return r.jsxs("div",{ref:v,style:T,"data-todo-id":e.id,...g??{},className:`surface-panel flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-foreground/[0.03] transition ${S?"opacity-50 shadow-lg":""}`,onClick:()=>l(e.id,e.status),children:[r.jsx("input",{type:"checkbox","aria-label":`Select todo ${e.id}`,checked:n,onChange:N=>s(e.id,N),onClick:N=>N.stopPropagation(),className:"h-4 w-4 cursor-pointer accent-foreground"}),!m&&r.jsx("button",{ref:E,...x,...y,className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",onClick:N=>N.stopPropagation(),children:r.jsx(xm,{className:"h-4 w-4"})}),r.jsx(Fh,{status:e.status,onChange:N=>c(e.id,N)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:`text-sm ${e.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:e.description}),e.tags.length>0&&r.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:e.tags.map(N=>`#${N}`).join(" ")}),e.session&&r.jsxs("span",{className:"ml-2 text-xs text-info-foreground/70 font-mono",children:["session:",e.session.slice(0,8)]}),r.jsx(f1,{item:e})]}),t===e.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(vi,{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:N=>d(N,e.id),children:["t:",e.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>d(N,e.id),children:r.jsx(Fa,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:N=>a(e.id,N),children:r.jsx(Za,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:N=>f(N,e.id,e.description),children:r.jsx(zn,{className:"h-3 w-3"})})]})]})}function p_({projectId:e}){const{data:t,loading:n,error:s,refetch:a}=ZM(e),[l,c]=p.useState(""),[d,f]=p.useState(""),[m,g]=p.useState(""),[x,y]=p.useState(""),[v,E]=p.useState(null),[k,w]=p.useState(new Set),[S,T]=p.useState(!1),[N,A]=p.useState(!1),[M,R]=p.useState(null),I=p.useRef(null);Gs("list:todos");const O=!!(l.trim()||d||m),Y=Rh(gi(ul,{activationConstraint:{distance:8}}),gi(cl));function J(ie,ne){ie.stopPropagation(),navigator.clipboard.writeText(ne),E(ne),setTimeout(()=>E(le=>le===ne?null:le),1500)}const _=p.useMemo(()=>{if(!(t!=null&&t.items))return[];const ie=new Set;for(const ne of t.items)for(const le of ne.tags)ie.add(le);return Array.from(ie).sort()},[t]),U=p.useMemo(()=>{if(!(t!=null&&t.items))return[];let ie=t.items;if(l.trim()){const ne=l.toLowerCase();ie=ie.filter(le=>le.description.toLowerCase().includes(ne)||le.tags.some(H=>H.toLowerCase().includes(ne))||le.id.includes(ne))}return d&&(ie=ie.filter(ne=>ne.status===d)),m&&(ie=ie.filter(ne=>ne.tags.includes(m))),ie},[t,l,d,m]);p.useEffect(()=>{w(new Set)},[l,d,m,e]);const X=p.useMemo(()=>U.filter(ie=>k.has(ie.id)).length,[U,k]),q=U.length>0&&X===U.length,G=X>0&&!q;function B(ie){w(ne=>{const le=new Set(ne);return le.has(ie)?le.delete(ie):le.add(ie),le})}function W(){w(ie=>{const ne=new Set(ie);if(q)for(const le of U)ne.delete(le.id);else for(const le of U)ne.add(le.id);return ne})}function D(){w(new Set)}const ee=M?[M]:Array.from(k);function C(){w(new Set),R(null),a()}function $(){w(new Set),a()}async function Z(){x.trim()&&(await e_(e,x.trim()),y(""),a())}const L={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function ae(ie,ne){Q(ie,L[ne]||"open")}async function ce(ie,ne,le){ie.stopPropagation(),window.confirm(`Delete "${le}"? This can't be undone.`)&&(await i_(e,ne),a())}async function Q(ie,ne){switch(ne){case"open":await s_(e,ie);break;case"in_progress":await r_(e,ie);break;case"completed":await t_(e,ie);break;case"blocked":await n_(e,ie);break}a()}const{hotkeyRowProps:ge}=el(U,{scope:"list:todos",bindO:!1,onOpen:ie=>ae(ie.id,ie.status)});pt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var ie;return(ie=I.current)==null?void 0:ie.focus()}}),pt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>a()});const[je,Ne]=Xr(),ke=je.get("focus");p.useEffect(()=>{if(!ke)return;const ie=document.querySelector(`[data-todo-id="${window.CSS.escape(ke)}"]`);if(!ie)return;ie.scrollIntoView({block:"nearest"}),ie.classList.add("ring-2","ring-primary/60");const ne=window.setTimeout(()=>{ie.classList.remove("ring-2","ring-primary/60"),Ne(le=>{const H=new URLSearchParams(le);return H.delete("focus"),H},{replace:!0})},1500);return()=>window.clearTimeout(ne)},[ke,U.length,Ne]);async function Ve(ie){const{active:ne,over:le}=ie;if(!le||ne.id===le.id||!(t!=null&&t.items))return;const H=t.items.findIndex(_e=>_e.id===ne.id),fe=t.items.findIndex(_e=>_e.id===le.id);if(H===-1||fe===-1)return;const ve=dl(t.items,H,fe);await o_(e,ve.map(_e=>_e.id)),a()}if(n)return r.jsx(at,{label:"Loading todos..."});if(s)return r.jsx(et,{error:s});const Ye=(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(mn,{label:"Open",value:Ye.open,icon:cr}),r.jsx(mn,{label:"In Progress",value:Ye.in_progress,icon:cr,tone:"info"}),r.jsx(mn,{label:"Blocked",value:Ye.blocked,icon:jm,tone:"warn"}),r.jsx(mn,{label:"Total",value:Ye.total,icon:cr})]}),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:x,onChange:ie=>y(ie.target.value),onKeyDown:ie=>ie.key==="Enter"&&Z(),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:Z,disabled:!x.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(Ht,{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(qs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:I,type:"text",placeholder:"Search...",value:l,onChange:ie=>c(ie.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:d,onChange:ie=>f(ie.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"})]}),_.length>0&&r.jsxs("select",{value:m,onChange:ie=>g(ie.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"}),_.map(ie=>r.jsxs("option",{value:ie,children:["#",ie]},ie))]})]}),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 bg-foreground text-background hover:opacity-90",children:"Promote selected"}),r.jsx("button",{type:"button",onClick:()=>{R(null),A(!0)},className:"shell-action",children:"Move to…"}),r.jsx("button",{type:"button",onClick:D,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,U.length===0?r.jsx(ot,{title:"No todos",description:"Add your first todo above."}):r.jsxs(r.Fragment,{children:[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:q,ref:ie=>{ie&&(ie.indeterminate=G)},onChange:W,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",U.length,")"]})]}),r.jsx(Lh,{sensors:Y,collisionDetection:Ah,onDragEnd:Ve,children:r.jsx(Mh,{items:U.map(ie=>ie.id),strategy:$h,children:r.jsx("div",{className:"space-y-1",children:U.map((ie,ne)=>r.jsx(f_,{item:ie,copiedId:v,selected:k.has(ie.id),onToggleSelected:le=>B(le),onMoveOne:(le,H)=>{H.stopPropagation(),R(le),A(!0)},onCycleStatus:ae,onStatusChange:Q,onCopyId:J,onDelete:ce,disabled:O,hotkeyRowProps:ge(ne)},ie.id))})})})]}),r.jsx(zh,{open:S,selectedIds:Array.from(k),scope:{kind:"project",projectId:e},onOpenChange:T,onDone:$}),r.jsx(d1,{open:N,selectedIds:ee,scope:{kind:"project",projectId:e},onOpenChange:ie=>{A(ie),ie||R(null)},onDone:C})]})}const p1=["kanban","list","table"],m_=["title","status","priority","assignee","dependencies","updated"],h_=["asc","desc"],g_=["comfortable","compact"],x_={defaultView:"kanban",sortField:"updated",sortDirection:"desc",density:"comfortable",grouping:"none",filters:{status:"all",priority:"all",assignee:"all",project:"all",activity:"all"}},Ka={version:1,global:x_,projects:{}};function Db(e){return e==="table"?"table":"kanban"}function y_(e,t){return t?{...e,...t}:{...e}}function m1(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:y_(n.filters,s.filters)}:n}const pi={...Ka,custom:!1},h1=`view-prefs.cache.v${Ka.version}`;let Ga=v_(),ei=null;const Ya=new Set;let g1=0;function Bh(){return++g1}function Uh(e){return e===g1}function v_(){if(typeof window>"u"||!window.localStorage)return null;try{const e=window.localStorage.getItem(h1);if(!e)return null;const t=JSON.parse(e);return t.version!==Ka.version?null:t}catch{return null}}function b_(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(h1,JSON.stringify(e))}catch{}}function Hh(e){Ga=e,b_(e);for(const t of Ya)t(e)}function Wh(e){if(!e||typeof e!="object")return pi;const t=e;return t.version!==Ka.version||!t.global||!t.projects?pi:{version:Ka.version,global:t.global,projects:t.projects,custom:t.custom===!0}}function Vh(){if(ei)return ei;const e=Bh();return ei=fetch("/api/view-prefs").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{const n=Wh(t);return Uh(e)&&Hh(n),ei=null,Ga??n}).catch(()=>(ei=null,Ga??pi)),ei}function x1(e){const[t,n]=p.useState(()=>Ga??pi);return p.useEffect(()=>{let s=!1;return Vh().then(a=>{s||n(a)}),Ya.add(n),()=>{s=!0,Ya.delete(n)}},[]),m1(t,e??null)}function w_(){const[e,t]=p.useState(()=>Ga??pi);return p.useEffect(()=>{let n=!1;return Vh().then(s=>{n||t(s)}),Ya.add(t),()=>{n=!0,Ya.delete(t)}},[]),e}async function y1(e){const t=Bh(),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=Wh(await n.json());return Uh(t)&&Hh(s),s}function v1(e){return y1({global:e})}function b1(e,t){return y1({projects:{[e]:t}})}async function j_(){const e=Bh(),t=await fetch("/api/view-prefs",{method:"DELETE"});if(!t.ok)throw new Error(`HTTP ${t.status}`);const n=Wh(await t.json());return Uh(e)&&Hh(n),n}const k_=new Set(["overview","assignments","todos","dependencies","knowledge"]);function Ib(){const{slug:e}=jt(),t=Tt(),n=Et();Gs("project"),pt({keys:"a",scope:"project",description:"Create assignment",handler:()=>n(`${t}/projects/${e}/create/assignment`)}),pt({keys:"e",scope:"project",description:"Edit project",handler:()=>n(`${t}/projects/${e}/edit`)});const{data:s,loading:a,error:l,refetch:c}=qw(e),d=Du(),{data:f}=vu(),[m,g]=Xr(),x=m.get("tab"),y=x&&k_.has(x)?x:"overview";function v(D){g(ee=>{const C=new URLSearchParams(ee);return D==="overview"?C.delete("tab"):C.set("tab",D),C},{replace:!0})}const E=e?`p:${e}`:null,k=x1(E),[w,S]=p.useState(()=>Db(k.defaultView)),[T,N]=p.useState(()=>k.filters.status??"all"),[A,M]=p.useState(()=>k.filters.assignee??"all"),[R,I]=p.useState(()=>k.filters.priority??"all");p.useEffect(()=>{S(Db(k.defaultView)),N(k.filters.status??"all"),M(k.filters.assignee??"all"),I(k.filters.priority??"all")},[e,k.defaultView,k.filters.status,k.filters.assignee,k.filters.priority]);const O=p.useCallback(D=>{E&&b1(E,D).catch(ee=>{console.warn("Failed to persist project view prefs:",ee)})},[E]),Y=p.useCallback(D=>{S(D),O({defaultView:D})},[O]),J=p.useCallback(D=>{N(D),O({filters:{status:D}})},[O]),_=p.useCallback(D=>{M(D),O({filters:{assignee:D}})},[O]),U=p.useCallback(D=>{I(D),O({filters:{priority:D}})},[O]),X=p.useMemo(()=>s?Object.fromEntries(s.assignments.flatMap(D=>{const ee=`${t}/projects/${s.slug}/assignments/${D.slug}`;return[[D.slug,ee],[D.title,ee]]})):{},[s]);async function q(D){await fetch(`/api/projects/${e}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:D})}),c()}async function G(D){await fetch(`/api/projects/${e}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:D})}),c()}if(a)return r.jsx(at,{label:"Loading project workspace…"});if(l||!s)return r.jsx(et,{error:l||"Project not found."});const B=Array.from(new Set(s.assignments.map(D=>D.assignee).filter(Boolean))).sort(),W=s.assignments.filter(D=>!(T!=="all"&&D.status!==T||A!=="all"&&D.assignee!==A||R!=="all"&&D.priority!==R));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(wn,{status:s.status}),s.statusOverride&&r.jsx("button",{type:"button",className:"shell-action border-warning-foreground/40 text-warning-foreground",onClick:()=>q(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:D=>{D.target.value&&q(D.target.value)},title:"Override project status",children:[r.jsx("option",{value:"",children:"Set Status…"}),d.statuses.map(D=>r.jsx("option",{value:D.id,children:D.label},D.id)),r.jsx("option",{value:"active",children:"Active"})]}),f&&f.workspaces.length>0&&r.jsxs("select",{className:"shell-action appearance-none bg-transparent text-sm",value:"",onChange:D=>{D.target.value==="_ungrouped"?G(null):D.target.value&&G(D.target.value)},title:"Move project to a different workspace",children:[r.jsx("option",{value:"",children:"Move to Workspace…"}),f.workspaces.filter(D=>D!==s.workspace).map(D=>r.jsx("option",{value:D,children:D},D)),s.workspace&&r.jsx("option",{value:"_ungrouped",children:"Ungrouped"})]}),r.jsxs(we,{className:"shell-action",to:`${t}/projects/${s.slug}/edit`,children:[r.jsx(zy,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Project"})]}),r.jsxs(we,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects/${s.slug}/create/assignment`,children:[r.jsx(Ht,{className:"h-4 w-4"}),r.jsx("span",{children:"New Assignment"})]}),r.jsx(ch,{externalIds:s.externalIds}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Created ",qr(s.created),". Last source update ",Kr(s.updated),"."]})]}),r.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:[r.jsx(mn,{label:"Assignments",value:s.progress.total}),r.jsx(mn,{label:"In Progress",value:s.progress.in_progress??0,tone:"info"}),r.jsx(mn,{label:"Review",value:s.progress.review??0,tone:"info"}),r.jsx(mn,{label:"Blocked",value:s.progress.blocked??0,tone:"warn"}),r.jsx(mn,{label:"Completed",value:s.progress.completed??0,tone:"success"})]}),r.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]",children:[r.jsx("div",{className:"space-y-4",children:r.jsx(dh,{value:y,onValueChange:v,items:[{value:"overview",label:"Overview",content:r.jsx("div",{className:"space-y-5",children:r.jsx(Le,{title:"Project Overview",children:r.jsx(Ut,{content:s.body,emptyState:"This project does not have overview content yet."})})})},{value:"assignments",label:"Assignments",count:s.assignments.length,content:r.jsx("div",{className:"space-y-5",children:r.jsx(Le,{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.jsxs("select",{value:T,onChange:D=>J(D.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All statuses"}),d.statuses.map(D=>r.jsx("option",{value:D.id,children:D.label},D.id))]}),r.jsxs("select",{value:A,onChange:D=>_(D.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All assignees"}),B.map(D=>r.jsx("option",{value:D??"",children:D},D))]}),r.jsxs("select",{value:R,onChange:D=>U(D.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All priorities"}),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(ih,{value:w,onChange:D=>Y(D),options:[{value:"kanban",label:"Kanban"},{value:"table",label:"Table"}]})]}),children:W.length===0?r.jsx(ot,{title:"No assignments match these filters",description:"Clear the current filters or create a new assignment for this project.",actions:r.jsx(we,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects/${s.slug}/create/assignment`,children:"Create Assignment"})}):w==="kanban"?r.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:W.map(D=>r.jsx(S_,{projectSlug:s.slug,assignment:D},D.slug))}):r.jsx("div",{className:"overflow-x-auto",children: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:[r.jsx("th",{className:"pb-3 font-medium",children:"Assignment"}),r.jsx("th",{className:"pb-3 font-medium",children:"Status"}),r.jsx("th",{className:"pb-3 font-medium",children:"Priority"}),r.jsx("th",{className:"pb-3 font-medium",children:"Assignee"}),r.jsx("th",{className:"pb-3 font-medium",children:"Updated"})]})}),r.jsx("tbody",{children:W.map(D=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[r.jsx("td",{className:"py-4",children:r.jsx(we,{to:`${t}/projects/${s.slug}/assignments/${D.slug}`,className:"font-semibold text-foreground hover:text-primary",children:D.title})}),r.jsx("td",{className:"py-4",children:r.jsx(wn,{status:D.status})}),r.jsx("td",{className:"py-4 capitalize text-muted-foreground",children:D.priority}),r.jsx("td",{className:"py-4 text-muted-foreground",children:D.assignee??"—"}),r.jsx("td",{className:"py-4 text-muted-foreground",children:qr(D.updated)})]},D.slug))})]})})})})},{value:"todos",label:"Todos",content:r.jsx(p_,{projectId:s.slug})},{value:"dependencies",label:"Dependencies",content:s.dependencyGraph?r.jsx(Le,{title:"Dependency Graph",description:"Rendered from the derived graph when available, with a source-based fallback.",children:r.jsx(XD,{definition:s.dependencyGraph,nodeRoutes:X})}):r.jsx(ot,{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(Le,{title:"Resources",description:"Shared project references.",actions:r.jsxs(we,{className:"shell-action",to:`/resources/new?project=${s.slug}`,children:[r.jsx(Ht,{className:"h-4 w-4"}),r.jsx("span",{children:"New Resource"})]}),children:s.resources.length===0?r.jsx(ot,{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:s.resources.map(D=>r.jsxs(we,{to:`/projects/${s.slug}/resources/${D.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:D.name}),r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[D.category," · ",D.source]})]},D.slug))})}),r.jsx(Le,{title:"Memories",description:"Learnings and patterns captured during the project.",actions:r.jsxs(we,{className:"shell-action",to:`/memories/new?project=${s.slug}`,children:[r.jsx(Ht,{className:"h-4 w-4"}),r.jsx("span",{children:"New Memory"})]}),children:s.memories.length===0?r.jsx(ot,{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:s.memories.map(D=>r.jsxs(we,{to:`/projects/${s.slug}/memories/${D.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:D.name}),r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[D.scope," · ",D.source]})]},D.slug))})})]})}]})}),r.jsxs("div",{className:"space-y-5",children:[r.jsx(Le,{title:"Progress Summary",children:r.jsx(iu,{progress:s.progress,showLegend:!0})}),r.jsx(Le,{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:s.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:s.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:s.needsAttention.openQuestions})]})]})}),r.jsx(Le,{title:"Quick Links",children:r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs(we,{className:"flex items-center gap-2 text-primary hover:underline",to:`${t}/projects/${s.slug}/edit`,children:[r.jsx(zy,{className:"h-4 w-4"}),"Edit project source"]}),r.jsxs(we,{className:"flex items-center gap-2 text-primary hover:underline",to:`${t}/projects/${s.slug}/create/assignment`,children:[r.jsx(Ht,{className:"h-4 w-4"}),"Create assignment"]}),r.jsxs(we,{className:"flex items-center gap-2 text-primary hover:underline",to:"/help",children:[r.jsx(bE,{className:"h-4 w-4"}),"Review project rules"]}),r.jsxs("button",{type:"button",onClick:()=>v("dependencies"),className:"flex items-center gap-2 text-primary hover:underline",children:[r.jsx(gm,{className:"h-4 w-4"}),"Jump to dependencies"]})]})}),s.archived?r.jsxs(Le,{title:"Archive Metadata",children:[r.jsxs("p",{className:"text-sm leading-6 text-muted-foreground",children:["Archived ",s.archivedAt?Kr(s.archivedAt):"with no timestamp recorded","."]}),s.archivedReason?r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:s.archivedReason}):null]}):null]})]})]})}function S_({projectSlug:e,assignment:t}){const n=Tt();return r.jsxs(we,{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(Vr,{value:t.id})})]}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",qr(t.updated)]})]}),r.jsx(wn,{status:t.status})]}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[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 w1({session:e,onMarkStopped:t}){const n=`syntaur://open?session=${encodeURIComponent(e.sessionId)}&mode=resume`,s=`syntaur://open?session=${encodeURIComponent(e.sessionId)}&mode=fork`,a="size-3.5",l=ze("shell-action","inline-flex items-center justify-center px-2 py-1 text-xs","disabled:cursor-not-allowed disabled:opacity-50");return r.jsx(po,{delayDuration:200,children:r.jsxs("div",{className:"inline-flex items-center gap-1",children:[e.resumeSupported&&(e.isLive?r.jsxs(zr,{children:[r.jsx(Br,{asChild:!0,children:r.jsxs("button",{type:"button",disabled:!0,"aria-disabled":!0,className:l,children:[r.jsx(Ba,{className:a}),r.jsx("span",{children:"Resume"})]})}),r.jsx(wr,{side:"top",children:"Session appears active — fork instead to avoid transcript corruption"})]}):r.jsxs(zr,{children:[r.jsx(Br,{asChild:!0,children:r.jsxs("a",{href:n,className:l,children:[r.jsx(Ba,{className:a}),r.jsx("span",{children:"Resume"})]})}),r.jsx(wr,{side:"top",children:"Continue this session in its agent (same session id, same transcript)"})]})),e.forkSupported&&r.jsxs(zr,{children:[r.jsx(Br,{asChild:!0,children:r.jsxs("a",{href:s,className:l,children:[r.jsx(DE,{className:a}),r.jsx("span",{children:"Fork"})]})}),r.jsx(wr,{side:"top",children:"Branch a new session from this point — safe even when the original is still running"})]}),e.status==="active"&&r.jsxs(zr,{children:[r.jsx(Br,{asChild:!0,children:r.jsxs("button",{type:"button",className:l,onClick:()=>t(e.sessionId),children:[r.jsx(wm,{className:a}),r.jsx("span",{children:"Mark stopped"})]})}),r.jsx(wr,{side:"top",children:"Tell the dashboard this session has ended so Resume re-enables"})]})]})})}async function N_(e){await fetch(`/api/agent-sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"stopped"})})}function j1({sessions:e,loading:t,error:n}){return t&&!e?null:n&&!e?r.jsx(Le,{title:"Agent Sessions",children:r.jsx(ot,{title:"Couldn't load sessions",description:n})}):!e||e.length===0?r.jsx(Le,{title:"Agent Sessions",children:r.jsx(ot,{title:"No agent sessions yet",description:"Sessions appear here when an agent registers one via /grab-assignment or syntaur track-session."})}):r.jsx(Le,{title:"Agent Sessions",children:r.jsx("div",{className:"space-y-2",children:e.map(s=>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(fm,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"font-medium text-foreground",children:s.agent}),r.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground",title:s.sessionId,children:[s.sessionId.slice(0,8),r.jsx(Vr,{value:s.sessionId})]})]}),r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(wn,{status:s.status}),r.jsx("span",{className:"text-xs text-muted-foreground",children:Kr(s.started)})]}),r.jsx(w1,{session:s,onMarkStopped:N_})]},s.sessionId))})})}function k1({open:e,action:t,assignmentTitle:n,loading:s=!1,onConfirm:a,onOpenChange:l}){const[c,d]=p.useState("");p.useEffect(()=>{e||d("")},[e,t==null?void 0:t.command]);const f=p.useMemo(()=>t&&t.command==="block"?"Blocked Reason":"Reason",[t]);if(!t)return null;const m=`${t.label} "${n}"`,g=s?"Applying...":t.label,x=c.trim()||void 0;return r.jsx(Jr,{open:e,onOpenChange:y=>s?void 0:l(y),children:r.jsx(Tr,{className:"max-w-xl",children:r.jsxs("form",{className:"space-y-5",onSubmit:y=>{y.preventDefault(),a(x)},children:[r.jsxs(bo,{children:[r.jsx(Pr,{children:m}),r.jsx(ps,{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:f}),r.jsx("textarea",{value:c,onChange:y=>d(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(wo,{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 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:g})]})]})})})}function fl({open:e,title:t,description:n,confirmLabel:s,cancelLabel:a="Cancel",loading:l=!1,destructive:c=!1,onConfirm:d,onOpenChange:f}){return r.jsx(nj,{open:e,onOpenChange:m=>l?void 0:f(m),children:r.jsxs(Hm,{children:[r.jsxs(sj,{children:[r.jsx(Wm,{children:t}),r.jsx(Vm,{children:n})]}),r.jsxs(oj,{children:[r.jsx(qm,{disabled:l,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:a}),r.jsx(Qc,{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":"bg-foreground text-background hover:opacity-90"}`,onClick:m=>{m.preventDefault(),d()},children:l?"Working...":s})]})]})})}function S1({target:e,worktreePath:t=null,size:n="default",title:s}){const a=e.kind==="assignment"&&(t==null||t===""),l=`syntaur://open?${e.kind}=${encodeURIComponent(e.id)}`,c=e.kind==="assignment"?"Open this assignment in your configured terminal + agent":"Resume this session in its agent",d="Set a worktree first — see the Workspace Before Code playbook",f=ze("shell-action",n==="compact"&&"inline-flex items-center justify-center px-2 py-1 text-xs","disabled:cursor-not-allowed disabled:opacity-50");return a?r.jsxs("button",{type:"button",disabled:!0,title:d,className:f,"aria-disabled":!0,children:[r.jsx(Ba,{className:"size-3.5"}),r.jsx("span",{children:"Open in agent"})]}):r.jsxs("a",{href:l,title:s??c,className:f,children:[r.jsx(Ba,{className:"size-3.5"}),r.jsx("span",{children:e.kind==="session"?"Open":"Open in agent"})]})}function C_(e){const t=e.split(`
493
- `),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(`
494
- `).replace(/\n{3,}/g,`
495
-
496
- `).trim();return{acceptanceCriteria:a,summaryBody:l}}function E_(e){const t=e.split(`
497
- `),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(`
498
- `).replace(/<!--[\s\S]*?-->/g,"").replace(/\n{3,}/g,`
499
-
500
- `).trim(),l=[...t.slice(0,n),...t.slice(s)].join(`
501
- `).replace(/\n{3,}/g,`
502
-
503
- `).trim();return{hasSection:!0,todosMarkdown:a,remaining:l}}function T_({projectSlug:e,dependencies:t,blockedReason:n}){const[s,a]=p.useState(!1);if(t.length===0)return null;const l=t.filter(d=>d.status!=="completed"&&d.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(mm,{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(_a,{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(Np,{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(Le,{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(d=>r.jsxs(we,{to:`/projects/${e}/assignments/${d.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(wn,{status:d.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:d.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:d.slug})]}),d.assignee&&r.jsx("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:d.assignee}),r.jsx(Yc,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},d.slug))})})]})}function P_({links:e}){const t=Tt();if(e.length===0)return null;const n=e.filter(a=>!a.isReverse),s=e.filter(a=>a.isReverse);return r.jsx(Le,{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(we,{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(yw,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),r.jsx(wn,{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(Yc,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`fwd-${a.slug}`)),s.map(a=>r.jsxs(we,{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(xw,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),r.jsx(wn,{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(Yc,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`rev-${a.slug}`))]})})}function R_(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 A_(e,t){return e===null?`/api/assignments/${encodeURIComponent(t)}/comments`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments`}function N1({projectSlug:e,assignmentSlug:t,entries:n}){const[s,a]=p.useState(n);p.useEffect(()=>{a(n)},[n]);const l=p.useMemo(()=>R_(s),[s]),[c,d]=p.useState(""),[f,m]=p.useState("note"),[g,x]=p.useState(!1),[y,v]=p.useState(null);async function E(w){var N;if(w.preventDefault(),!c.trim())return;x(!0),v(null);const S=`tmp-${Date.now()}`,T={id:S,timestamp:new Date().toISOString(),author:"human",type:f,body:c,resolved:f==="question"?!1:void 0};a(A=>[...A,T]);try{const A=await fetch(A_(e,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:c,type:f})});if(!A.ok){const I=await A.text();throw new Error(I||`HTTP ${A.status}`)}const M=await A.json().catch(()=>null),R=(N=M==null?void 0:M.comment)==null?void 0:N.id;a(I=>I.map(O=>O.id===S?{...O,id:R??O.id}:O)),d(""),window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(A){v(A instanceof Error?A.message:String(A)),a(M=>M.filter(R=>R.id!==S))}finally{x(!1)}}async function k(w,S){a(T=>T.map(N=>N.id===w?{...N,resolved:S}:N));try{const T=e===null?`/api/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(w)}/resolved`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(w)}/resolved`,N=await fetch(T,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({resolved:S})});if(!N.ok)throw new Error(`HTTP ${N.status}`);window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(T){v(T instanceof Error?T.message:String(T)),a(N=>N.map(A=>A.id===w?{...A,resolved:!S}:A))}}return r.jsx(Le,{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(C1,{node:w,onToggleResolved:k,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=>d(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:f,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:g||!c.trim(),className:"shell-action",children:g?"Posting…":"Post comment"}),y?r.jsx("span",{className:"text-xs text-error-foreground",children:y}):null]})]})]})})}function C1({node:e,depth:t,onToggleResolved:n}){const{entry:s,replies:a}=e,l=s.type==="question";return r.jsxs("div",{className:ze("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:ze("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:ze("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(mm,{className:"h-3 w-3"}):r.jsx(SE,{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(BE,{className:"h-3 w-3"}),s.replyTo]}):null]}),r.jsx(Ut,{content:s.body}),a.length>0?r.jsx("div",{className:"space-y-2",children:a.map(c=>r.jsx(C1,{node:c,depth:t+1,onToggleResolved:n},c.entry.id))}):null]})}const D_=["review","complete","shape","plan-ready","implement","unblock","start","block","fail","reopen"];function Ob(){var St,se,pe,Pe,Fe,qe,tt;const{slug:e,aslug:t}=jt(),n=Et(),s=Tt(),[a,l]=Xr(),[c,d]=p.useState(null),[f,m]=p.useState(null),[g,x]=p.useState(null),[y,v]=p.useState(null),[E,k]=p.useState(null),[w,S]=p.useState(!1),[T,N]=p.useState(!1),[A,M]=p.useState(0),R=a.get("tab")??"summary",I=Du(),{data:O,loading:Y,error:J,refetch:_}=z2(e,t),{data:U}=qw(e),{data:X}=Tm(),{data:q,loading:G,error:B}=W2(e,t),W=p.useMemo(()=>{if(!O||!U)return[];const me=new Map(U.assignments.map(We=>[We.slug,We]));return O.dependsOn.map(We=>{const He=me.get(We);return{slug:We,title:(He==null?void 0:He.title)??We,status:(He==null?void 0:He.status)??"pending",priority:(He==null?void 0:He.priority)??"medium",assignee:(He==null?void 0:He.assignee)??null}})},[O,U]),D=W.filter(me=>me.status!=="completed"&&me.status!=="review");Gs("assignment");const ee=p.useMemo(()=>((U==null?void 0:U.assignments)??[]).map(me=>me.slug),[U]),C=t?ee.indexOf(t):-1,$=C>0?ee[C-1]:null,Z=C>=0&&C<ee.length-1?ee[C+1]:null,L=`${s}/projects/${e}/assignments/${t}`;pt({keys:"e",scope:"assignment",description:"Edit assignment",handler:()=>n(`${L}/edit`)}),pt({keys:"p",scope:"assignment",description:"Edit plan",handler:()=>n(`${L}/plan/edit`)}),pt({keys:"h",scope:"assignment",description:"Append handoff",handler:()=>n(`${L}/handoff/edit`)}),pt({keys:"d",scope:"assignment",description:"Append decision record",handler:()=>n(`${L}/decision-record/edit`)}),pt({keys:"s",scope:"assignment",description:"Edit scratchpad",handler:()=>n(`${L}/scratchpad/edit`)}),pt({keys:"[",scope:"assignment",description:"Previous assignment in project",enabled:!!$,handler:()=>$&&n(`${s}/projects/${e}/assignments/${$}`)}),pt({keys:"]",scope:"assignment",description:"Next assignment in project",enabled:!!Z,handler:()=>Z&&n(`${s}/projects/${e}/assignments/${Z}`)});const ae=p.useMemo(()=>O?C_(O.body):{acceptanceCriteria:[],summaryBody:""},[O]),ce=p.useMemo(()=>E_(ae.summaryBody),[ae.summaryBody]),Q=ae.acceptanceCriteria,ge=Q.filter(me=>me.checked).length,je=Q.length>0&&ge===Q.length,Ne=p.useRef(je),ke=p.useRef(!1);if(p.useEffect(()=>{if(O){if(!ke.current){Ne.current=je,ke.current=!0;return}je&&!Ne.current&&M(me=>me+1),Ne.current=je}},[je,O]),Y)return r.jsx(at,{label:"Loading assignment workspace…"});if(J||!O||!e||!t)return r.jsx(et,{error:J||"Assignment not found."});const Ve=e,Ye=t,ie=Q.length>0?{checked:ge,total:Q.length}:void 0,ne=O.availableTransitions??[],le=ne.filter(me=>!me.disabled&&me.targetStatus!==O.status),H=D_.map(me=>le.find(We=>We.command===me)).find(Boolean)??le[0]??null,fe=[];if(X!=null&&X.sessions)for(const me of X.sessions)for(const We of me.windows)for(const He of We.panes)((St=He.assignment)==null?void 0:St.project)===e&&((se=He.assignment)==null?void 0:se.slug)===t&&fe.push({sessionName:me.name,command:He.command,urls:He.urls});async function ve(me){d(null);try{await Fj(Ve,Ye,me),_()}catch(We){d(We.message)}}async function _e(){N(!0);try{await G3(Ve,Ye),n(`${s}/projects/${Ve}`)}catch(me){d(me.message),N(!1),S(!1)}}async function Ie(me,We){d(null),m(me.command);try{return await sh(Ve,Ye,me,We),_(),!0}catch(He){return d(He.message),!1}finally{m(null)}}function st(me){if(zj(me)){x(me);return}Ie(me)}async function lt(me,We){v(null),k(me);try{const He=await fetch(`/api/projects/${Ve}/assignments/${Ye}/acceptance-criteria/${me}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({checked:We})}),cn=await He.json();if(!He.ok)throw new Error(cn.error||`HTTP ${He.status}`);_()}catch(He){v(He.message)}finally{k(null)}}const _t=[...le.filter(me=>me!==H).map(me=>({key:`transition-${me.command}`,label:me.label,onSelect:()=>st(me),disabled:f===me.command})),...ne.filter(me=>me.disabled||me.targetStatus===O.status).map(me=>({key:`transition-${me.command}`,label:me.label,disabled:!0,disabledReason:me.targetStatus===O.status?`Already ${O.status.replace(/_/g," ")}`:me.disabledReason??me.warning??me.description})),...I.statuses.map(me=>({key:`override-${me.id}`,label:`Override → ${me.label}`,onSelect:()=>ve(me.id),disabled:me.id===O.status,disabledReason:me.id===O.status?"Already in this status":void 0})),{key:"edit-assignment",label:"Edit assignment source",icon:AE,href:`${s}/projects/${e}/assignments/${t}/edit`},{key:"edit-plan",label:"Edit plan",icon:HE,href:`${s}/projects/${e}/assignments/${t}/plan/edit`},{key:"edit-scratchpad",label:"Edit scratchpad",icon:Of,href:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`},{key:"append-handoff",label:"Append handoff",icon:Yc,href:`${s}/projects/${e}/assignments/${t}/handoff/edit`},{key:"append-decision",label:"Append decision",icon:IE,href:`${s}/projects/${e}/assignments/${t}/decision-record/edit`},{key:"delete",label:"Delete assignment",icon:zn,destructive:!0,onSelect:()=>S(!0)}],kt=(H==null?void 0:H.command)==="review";return r.jsxs("div",{className:"space-y-5",children:[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(wn,{status:O.status,progress:ie}),r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:O.title}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Updated ",Nm(O.updated)]}),D.length>0&&r.jsxs("span",{className:"text-xs text-warning-foreground",children:["⚠ ",D.length," unmet dep",D.length===1?"":"s"]}),r.jsx(ch,{externalIds:O.externalIds}),r.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[r.jsx(S1,{target:{kind:"assignment",id:O.id},worktreePath:((pe=O.workspace)==null?void 0:pe.worktreePath)??null}),H&&r.jsx("button",{type:"button",title:H.warning||H.description,disabled:f===H.command,onClick:()=>st(H),className:ze("shell-action disabled:cursor-not-allowed disabled:opacity-50",H.warning&&"border-warning-foreground/40",kt&&A>0&&"send-to-review-glow"),children:r.jsx("span",{children:f===H.command?"Working…":H.label})},kt?`review-${A}`:H.command),r.jsx(rh,{items:_t,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]}),W.length>0&&r.jsx(T_,{projectSlug:e,dependencies:W,blockedReason:O.blockedReason}),O.enrichedLinks&&O.enrichedLinks.length>0&&r.jsx(P_,{links:O.enrichedLinks}),O.referencedBy&&O.referencedBy.length>0&&r.jsx(Le,{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(me=>{const We=me.sourceProjectSlug===null?`/assignments/${me.sourceId}`:`${s}/projects/${me.sourceProjectSlug}/assignments/${me.sourceSlug}`;return r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx(we,{to:We,className:"text-foreground hover:text-primary",children:me.sourceTitle}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",me.mentions," mention",me.mentions===1?"":"s",")"]}),me.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]},me.sourceId)})})}),r.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]",children:[r.jsx("div",{className:"space-y-4",children:r.jsx(dh,{value:R,onValueChange:me=>l({tab:me}),items:[{value:"summary",label:"Summary",content:r.jsxs("div",{className:"space-y-5",children:[ae.acceptanceCriteria.length>0?r.jsx(Le,{title:"Acceptance Criteria",description:"These checkboxes update the source assignment markdown.",children:r.jsxs("div",{className:"space-y-3",children:[y?r.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:y}):null,ae.acceptanceCriteria.map((me,We)=>{const He=E!==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:me.checked,disabled:He,onChange:cn=>lt(We,cn.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":me.checked,children:me.text})]},`${We}-${me.text}`)})]})}):null,ce.hasSection?r.jsx(Le,{title:"Todos",description:"Checklist of work items from assignment.md. Links point to plan files.",children:r.jsx(Ut,{content:ce.todosMarkdown,emptyState:"No todos yet."})}):null,r.jsx(Le,{title:"Assignment Summary",children:r.jsx(Ut,{content:ce.remaining,emptyState:ae.acceptanceCriteria.length>0||ce.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(Le,{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(we,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/plan/edit`,children:[r.jsx(Of,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Plan"})]}),children:[r.jsx("div",{className:"mb-4",children:r.jsx(wn,{status:O.plan.status})}),r.jsx(Ut,{content:O.plan.body,emptyState:"No plan content yet."})]})}):r.jsx(ot,{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(Le,{title:"Scratchpad",actions:r.jsxs(we,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`,children:[r.jsx(Of,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Scratchpad"})]}),children:r.jsx(Ut,{content:O.scratchpad.body,emptyState:"Scratchpad is empty."})}):r.jsx(ot,{title:"No scratchpad yet",description:"Scratchpad notes appear here when you use the Edit Scratchpad action."})},{value:"handoff",label:"Handoff",count:((Pe=O.handoff)==null?void 0:Pe.handoffCount)??0,content:r.jsx("div",{className:"space-y-5",children:O.handoff?r.jsx(Le,{children:r.jsx(Ut,{content:O.handoff.body,emptyState:"No handoff history yet."})}):r.jsx(ot,{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:((Fe=O.progress)==null?void 0:Fe.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:O.progress&&O.progress.entries.length>0?r.jsx(Le,{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((me,We)=>r.jsxs("li",{className:"border-l-2 border-border pl-3",children:[r.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:me.timestamp}),r.jsx(Ut,{content:me.body})]},`${me.timestamp}-${We}`))})}):r.jsx(ot,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((qe=O.comments)==null?void 0:qe.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:O.comments&&O.comments.entries.length>0?r.jsx(N1,{projectSlug:e,assignmentSlug:t,entries:O.comments.entries}):r.jsx(ot,{title:"No comments yet",description:"Comments appear here when agents or humans post via `syntaur comment` or the dashboard."})})},{value:"decisions",label:"Decisions",count:((tt=O.decisionRecord)==null?void 0:tt.decisionCount)??0,content:r.jsx("div",{className:"space-y-5",children:O.decisionRecord?r.jsx(Le,{children:r.jsx(Ut,{content:O.decisionRecord.body,emptyState:"No decision history yet."})}):r.jsx(ot,{title:"No decision record yet",description:"Decision records appear here when you append one via the Append Decision action."})})}]})}),r.jsxs("div",{className:"space-y-5",children:[r.jsx(Le,{title:"Details",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsx(Fs,{label:"ID",value:O.id,copyable:!0}),r.jsx(Fs,{label:"Priority",value:O.priority}),O.assignee&&r.jsx(Fs,{label:"Assignee",value:O.assignee}),r.jsx(Fs,{label:"Updated",value:`${R2(O.updated)} · Created ${P2(O.created)}`}),O.workspace.repository&&r.jsx(Fs,{label:"Repository",value:O.workspace.repository,copyable:!0}),O.workspace.worktreePath&&r.jsx(Fs,{label:"Worktree",value:O.workspace.worktreePath,copyable:!0}),O.workspace.branch&&r.jsx(Fs,{label:"Branch",value:O.workspace.branch,copyable:!0}),O.workspace.parentBranch&&r.jsx(Fs,{label:"Parent branch",value:O.workspace.parentBranch,copyable:!0})]})}),fe.length>0&&r.jsx(Le,{title:"Servers",children:r.jsx("div",{className:"space-y-2",children:fe.map((me,We)=>r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"rounded bg-muted/60 px-1.5 py-0.5 font-mono text-xs",children:me.command}),r.jsx("span",{className:"text-xs text-muted-foreground",children:me.sessionName}),me.urls.map(He=>r.jsxs("a",{href:He,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[He.replace("http://localhost:",":"),r.jsx(hm,{className:"h-2.5 w-2.5"})]},He))]},We))})}),r.jsx(j1,{sessions:q==null?void 0:q.sessions,loading:G,error:B})]})]}),r.jsx(k1,{open:g!==null,action:g,assignmentTitle:O.title,loading:f===(g==null?void 0:g.command),onOpenChange:me=>{me||x(null)},onConfirm:async me=>{if(!g)return;await Ie(g,me)&&x(null)}}),r.jsx(fl,{open:w,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:T,onOpenChange:me=>{me||S(!1)},onConfirm:_e})]})}function Fs({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(Vr,{value:t})]})]})}function I_(){var v,E,k,w,S,T;const{id:e}=jt(),[t,n]=Xr(),s=t.get("tab")??"summary",{data:a,loading:l,error:c,refetch:d}=B2(e),{data:f,loading:m,error:g}=V2(e),[x,y]=p.useState(!1);return l?r.jsx(at,{}):c?r.jsx(et,{error:c}):a?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("header",{className:"space-y-2",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(wn,{status:a.status}),r.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:a.id}),r.jsx(ch,{externalIds:a.externalIds}),r.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[r.jsx(S1,{target:{kind:"assignment",id:a.id},worktreePath:((v=a.workspace)==null?void 0:v.worktreePath)??null,size:"compact"}),r.jsxs("button",{type:"button",onClick:()=>y(!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(Za,{className:"h-3 w-3"}),"Move to workspace…"]}),r.jsx(we,{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.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]}),a.referencedBy&&a.referencedBy.length>0?r.jsx(Le,{title:"Referenced by",description:"Other assignments whose bodies link to this one.",children:r.jsx("ul",{className:"space-y-2",children:a.referencedBy.map(N=>r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx(we,{to:N.sourceProjectSlug===null?`/assignments/${N.sourceId}`:`/projects/${N.sourceProjectSlug}/assignments/${N.sourceSlug}`,className:"text-foreground hover:text-primary",children:N.sourceTitle}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",N.mentions," mention",N.mentions===1?"":"s",")"]})]},N.sourceId))})}):null,r.jsx(j1,{sessions:f==null?void 0:f.sessions,loading:m,error:g}),r.jsx(dh,{value:s,onValueChange:N=>n({tab:N}),items:[{value:"summary",label:"Summary",content:r.jsx("div",{className:"space-y-5",children:r.jsx(Le,{title:"Assignment",children:r.jsx(Ut,{content:a.body,emptyState:"This assignment does not have summary markdown yet."})})})},{value:"progress",label:"Progress",count:((E=a.progress)==null?void 0:E.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:a.progress&&a.progress.entries.length>0?r.jsx(Le,{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((N,A)=>r.jsxs("li",{className:"border-l-2 border-border pl-3",children:[r.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:N.timestamp}),r.jsx(Ut,{content:N.body})]},`${N.timestamp}-${A}`))})}):r.jsx(ot,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((k=a.comments)==null?void 0:k.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:r.jsx(N1,{projectSlug:null,assignmentSlug:a.id,entries:((w=a.comments)==null?void 0:w.entries)??[]})})},{value:"plan",label:"Plan",content:r.jsx("div",{className:"space-y-5",children:a.plan?r.jsxs(Le,{children:[r.jsx(Ut,{content:a.plan.body,emptyState:"Plan file exists but is empty."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(we,{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(ot,{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(Le,{children:[r.jsx(Ut,{content:a.scratchpad.body,emptyState:"Scratchpad is empty."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(we,{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(ot,{title:"No scratchpad yet",description:"Scratchpad is scaffolded at assignment creation time."})})},{value:"handoff",label:"Handoff",count:((S=a.handoff)==null?void 0:S.handoffCount)??0,content:r.jsx("div",{className:"space-y-5",children:a.handoff?r.jsxs(Le,{children:[r.jsx(Ut,{content:a.handoff.body,emptyState:"No handoff history yet."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(we,{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(ot,{title:"No handoff log yet",description:"Handoffs appear here when an agent appends one."})})},{value:"decisions",label:"Decisions",count:((T=a.decisionRecord)==null?void 0:T.decisionCount)??0,content:r.jsx("div",{className:"space-y-5",children:a.decisionRecord?r.jsxs(Le,{children:[r.jsx(Ut,{content:a.decisionRecord.body,emptyState:"No decision history yet."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(we,{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(ot,{title:"No decision record yet",description:"Decision records appear here once appended."})})}]}),r.jsx(lh,{open:x,onOpenChange:y,currentWorkspace:a.projectWorkspace,title:"Move assignment to workspace",description:"Standalone assignments belong to a project-workspace via the workspaceGroup frontmatter field.",onSubmit:async N=>{const A=await fetch(`/api/assignments/${encodeURIComponent(a.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:N})});if(!A.ok){const M=await A.json().catch(()=>({}));throw new Error(M.error||"Failed to move assignment")}d()}})]}):r.jsx(et,{error:"Assignment not found"})}const Lb=p1,$b={critical:0,high:1,medium:2,low:3};function Mb(e){return e==="1"?"stale":e==="0"?"fresh":"all"}function O_(e,t){return e.toString()===t.toString()}function _b(e){const t=Date.parse(e);return Number.isNaN(t)?!1:Date.now()-t>10080*60*1e3}function L_(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=($b[a.priority]??99)-($b[l.priority]??99);break;case"assignee":c=(a.assignee??"").localeCompare(l.assignee??"");break;case"dependencies":c=a.dependsOn.length-l.dependsOn.length;break;case"updated":c=a.updated.localeCompare(l.updated);break}return n==="asc"?c:-c})}function Fb(){const{workspace:e}=jt(),t=Tt(),n=Et(),s=p.useRef(null);Gs("list:assignments");const{data:a,loading:l,error:c,refetch:d}=Ww(),f=Du(),[m,g]=Xr(),x=e?`w:${e}`:null,y=x1(x),v=p.useRef(void 0),E=p.useMemo(()=>gD(f.order),[f]),k=p.useMemo(()=>{const z={};for(const ue of E)z[ue]=fD(f,ue);return z},[E,f]),w=p.useMemo(()=>E.map(z=>({id:z,title:k[z]??z,description:ij(z)})),[E,k]),S=p.useMemo(()=>new Set(["all",...E]),[E]),T=m.get("view"),N=m.get("status"),A=m.get("stale"),M=T&&Lb.includes(T)?T:"kanban";function R(z){return!z||!S.has(z)?"all":z}const I=p.useCallback(z=>{g(ue=>{const Se=new URLSearchParams(ue);return z==="kanban"?Se.delete("view"):Se.set("view",z),Se})},[g]),[O,Y]=p.useState(""),[J,_]=p.useState(()=>R(N)),[U,X]=p.useState(()=>y.filters.priority??"all"),[q,G]=p.useState(()=>y.filters.assignee??"all"),[B,W]=p.useState(()=>y.filters.project??"all"),[D,ee]=p.useState(()=>Mb(A)),[C,$]=p.useState(()=>y.sortField),[Z,L]=p.useState(()=>y.sortDirection),[ae,ce]=p.useState(()=>new Set(E)),[Q,ge]=p.useState([]),[je,Ne]=p.useState(null),[ke,Ve]=p.useState(null),[Ye,ie]=p.useState(null),[ne,le]=p.useState(null),[H,fe]=p.useState(null),[ve,_e]=p.useState(null),[Ie,st]=p.useState(null),[lt,_t]=p.useState(null),[kt,St]=p.useState(null);p.useEffect(()=>{ge((a==null?void 0:a.assignments)??[])},[a]),p.useEffect(()=>{const z=R(N);z!==J&&_(z);const ue=Mb(A);ue!==D&&ee(ue)},[D,A,J,N]),p.useEffect(()=>{v.current===x&&g(z=>{const ue=new URLSearchParams(z);return J==="all"?ue.delete("status"):ue.set("status",J),D==="all"?ue.delete("stale"):D==="stale"?ue.set("stale","1"):ue.set("stale","0"),O_(z,ue)?z:ue})},[D,x,g,J]),p.useEffect(()=>{X(y.filters.priority??"all"),G(y.filters.assignee??"all"),W(y.filters.project??"all"),$(y.sortField),L(y.sortDirection)},[y.filters.priority,y.filters.assignee,y.filters.project,y.sortField,y.sortDirection]),p.useEffect(()=>{if(v.current===x)return;let z=!1;return Vh().then(ue=>{if(z||v.current===x)return;const Se=m1(ue,x),Je=Se.defaultView,er=Se.filters.status??"all",hn=Se.filters.activity??"all",dt=new URLSearchParams(window.location.search);let Pt=!1;const nn=new URLSearchParams(dt);dt.get("view")===null&&Je!=="kanban"&&Lb.includes(Je)&&(nn.set("view",Je),Pt=!0),dt.get("status")===null&&er!=="all"&&(nn.set("status",er),_(er),Pt=!0),dt.get("stale")===null&&hn!=="all"&&(nn.set("stale",hn==="stale"?"1":"0"),ee(hn),Pt=!0),Pt&&g(nn,{replace:!0}),queueMicrotask(()=>{v.current=x})}),()=>{z=!0}},[x]);const se=p.useCallback(z=>{(x===null?v1(z):b1(x,z)).catch(Se=>{console.warn("Failed to persist view prefs:",Se)})},[x]),pe=p.useCallback(z=>{I(z),se({defaultView:z})},[I,se]),Pe=p.useCallback(z=>{_(z),se({filters:{status:z}})},[se]),Fe=p.useCallback(z=>{X(z),se({filters:{priority:z}})},[se]),qe=p.useCallback(z=>{G(z),se({filters:{assignee:z}})},[se]),tt=p.useCallback(z=>{W(z),se({filters:{project:z}})},[se]),me=p.useCallback(z=>{ee(z),se({filters:{activity:z}})},[se]),We=p.useCallback(z=>{$(z),se({sortField:z})},[se]),He=p.useCallback(z=>{L(z),se({sortDirection:z})},[se]),cn=p.useMemo(()=>Array.from(new Set(Q.map(z=>z.status))).sort(),[Q]),It=p.useMemo(()=>Array.from(new Set(Q.map(z=>z.priority))).sort(),[Q]),Tn=p.useMemo(()=>Array.from(new Set(Q.map(z=>z.assignee??"__unassigned__"))).sort(),[Q]),Qt=p.useMemo(()=>Array.from(new Map(Q.filter(z=>z.projectSlug!==null).map(z=>[z.projectSlug,z.projectTitle]))).sort(([,z],[,ue])=>z.localeCompare(ue)),[Q]),Hn=p.useMemo(()=>Q.filter(z=>{if(e){if(e==="_ungrouped"){if(z.projectWorkspace!==null)return!1}else if(z.projectWorkspace!==e)return!1}if(J!=="all"&&z.status!==J||U!=="all"&&z.priority!==U||D==="stale"&&!_b(z.updated)||D==="fresh"&&_b(z.updated)||q!=="all"&&(z.assignee??"__unassigned__")!==q)return!1;if(B!=="all"){if(B==="__standalone__"){if(z.projectSlug!==null)return!1}else if(z.projectSlug!==B)return!1}const ue=O.trim().toLowerCase();return!(ue&&!`${z.title} ${z.slug} ${z.projectTitle??"standalone"} ${z.projectSlug??""}`.toLowerCase().includes(ue))}),[D,Q,O,J,U,q,B,e]),fr=p.useMemo(()=>L_(Hn,C,Z),[Hn,C,Z]),{visibleItems:Rr,visibleIndexByKey:mt}=p.useMemo(()=>{const z=M==="table"?fr:E.flatMap(Se=>Hn.filter(Je=>Je.status===Se)),ue=new Map;return z.forEach((Se,Je)=>ue.set(an(Se),Je)),{visibleItems:z,visibleIndexByKey:ue}},[M,fr,Hn,E]),{hotkeyRowProps:Ft}=el(Rr,{scope:"list:assignments",onOpen:z=>{if(z.projectSlug===null){n(`/assignments/${z.id}`);return}const ue=z.projectWorkspace?`/w/${z.projectWorkspace}`:t;n(`${ue}/projects/${z.projectSlug}/assignments/${z.slug}`)}});if(pt({keys:"/",scope:"list:assignments",description:"Focus filter",handler:()=>{var z;return(z=s.current)==null?void 0:z.focus()}}),pt({keys:"r",scope:"list:assignments",description:"Refresh",handler:()=>d()}),l)return r.jsx(at,{label:"Loading assignments board…"});if(c||!a)return r.jsx(et,{error:c||"Assignments board is unavailable."});async function qt({item:z,toColumnId:ue,action:Se,reason:Je}){Ne(null),Ve(an(z));const er=Q;ge(hn=>hn.map(dt=>an(dt)===an(z)?{...dt,status:ue,blockedReason:ue==="blocked"?Je??dt.blockedReason:null}:dt));try{if(z.projectSlug===null){if(!Se)throw new Error("Standalone assignments require a transition action, not status override.");const dt=await fetch(`/api/assignments/${encodeURIComponent(z.id)}/transitions/${encodeURIComponent(Se.command)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Je?{reason:Je}:{})});if(!dt.ok)throw new Error((await dt.json()).error??`HTTP ${dt.status}`);const nn=(await dt.json()).assignment;ge(ko=>ko.map(es=>an(es)===an(z)?{...es,status:nn.status,blockedReason:nn.blockedReason,availableTransitions:nn.availableTransitions,updated:nn.updated}:es));return}const hn=Se?await sh(z.projectSlug,z.slug,Se,Je):await Fj(z.projectSlug,z.slug,ue);return ge(dt=>dt.map(Pt=>an(Pt)===an(z)?{...Pt,status:hn.status,blockedReason:hn.blockedReason,availableTransitions:hn.availableTransitions,updated:hn.updated}:Pt)),d(),!0}catch(hn){return ge(er),Ne(hn.message),!1}finally{Ve(null)}}async function kn({item:z,toColumnId:ue}){if(z.status===ue)return;const Se=wa(z,ue);if(Se!=null&&Se.disabled){Ne(Se.disabledReason||`Cannot move this assignment to ${ue}.`);return}if(Se&&zj(Se)){fe({item:z,toColumnId:ue,action:Se});return}await qt({item:z,toColumnId:ue,action:Se})}function un(z){ce(ue=>{const Se=new Set(ue);return Se.has(z)?Se.delete(z):Se.add(z),Se})}function Zt(z){C===z?He(Z==="asc"?"desc":"asc"):(We(z),He("asc"))}const ct=Ye?Q.find(z=>an(z)===Ye)??null:null;function pr(z,ue){z.dataTransfer.effectAllowed="move",z.dataTransfer.setData("text/plain",ue),ie(ue)}function ut(){ie(null),le(null)}function Pn(z,ue){if(!ct)return;const Se=wa(ct,ue);ct.status===ue||Se!=null&&Se.disabled||(z.preventDefault(),z.dataTransfer.dropEffect="move",le(ue))}function en(z,ue){ne===ue&&!z.currentTarget.contains(z.relatedTarget)&&le(null)}function Wn(z,ue){if(z.preventDefault(),!ct||ct.status===ue){ut();return}ut(),kn({item:ct,toColumnId:ue})}function tn({field:z,children:ue}){const Se=C===z;return r.jsx("th",{className:"pb-3 font-medium",children:r.jsxs("button",{type:"button",onClick:()=>Zt(z),className:"inline-flex items-center gap-1 hover:text-foreground",children:[ue,Se?Z==="asc"?r.jsx(bw,{className:"h-3 w-3"}):r.jsx(_a,{className:"h-3 w-3"}):null]})})}return r.jsxs("div",{className:"space-y-5","data-density":y.density,children:[r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs(we,{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(Ht,{className:"h-4 w-4"}),"New Assignment"]})}),r.jsxs(oh,{children:[r.jsx(Au,{ref:s,value:O,onChange:Y,placeholder:"Search assignments or projects"}),r.jsxs("select",{value:J,onChange:z=>Pe(R(z.target.value)),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All statuses"}),cn.map(z=>r.jsx("option",{value:z,children:k[z]??z},z))]}),r.jsxs("select",{value:U,onChange:z=>Fe(z.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All priorities"}),It.map(z=>r.jsx("option",{value:z,className:"capitalize",children:z},z))]}),r.jsxs("select",{value:q,onChange:z=>qe(z.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All assignees"}),Tn.map(z=>r.jsx("option",{value:z,children:z==="__unassigned__"?"Unassigned":z},z))]}),r.jsxs("select",{value:B,onChange:z=>tt(z.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All projects"}),r.jsx("option",{value:"__standalone__",children:"Standalone"}),Qt.map(([z,ue])=>r.jsx("option",{value:z,children:ue},z))]}),r.jsxs("select",{value:D,onChange:z=>me(z.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(ih,{value:M,onChange:z=>pe(z),options:[{value:"table",label:"Table"},{value:"list",label:"List"},{value:"kanban",label:"Kanban"}]})]}),je?r.jsx("div",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:je}):null,a.assignments.length===0?r.jsx(ot,{title:"No assignments yet",description:"Assignments appear here once projects contain concrete work items.",actions:r.jsxs(we,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects`,children:[r.jsx(kw,{className:"h-4 w-4"}),r.jsx("span",{children:"Browse Projects"})]})}):Hn.length===0?r.jsx(ot,{title:"No assignments match these filters",description:"Adjust the search term or filters to show assignments across all projects again."}):M==="table"?r.jsx(Le,{title:`${fr.length} assignment${fr.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(tn,{field:"title",children:"Assignment"}),r.jsx(tn,{field:"status",children:"Status"}),r.jsx(tn,{field:"priority",children:"Priority"}),r.jsx(tn,{field:"assignee",children:"Assignee"}),r.jsx(tn,{field:"dependencies",children:"Dependencies"}),r.jsx(tn,{field:"updated",children:"Updated"})]})}),r.jsx("tbody",{children:fr.map((z,ue)=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",...Ft(ue),children:[r.jsxs("td",{className:"py-4 pr-4",children:[r.jsx(we,{to:z.projectSlug===null?`/assignments/${z.id}`:`${t}/projects/${z.projectSlug}/assignments/${z.slug}`,className:"font-semibold text-foreground hover:text-primary",children:z.title}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:z.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:z.id,children:[z.id.slice(0,8),r.jsx(Vr,{value:z.id})]})]}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx("select",{value:z.status,disabled:ke===an(z),onChange:Se=>kn({item:z,toColumnId:Se.target.value}),className:ze("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")]`,(Zc[z.status]??Zc.pending).className,ke===an(z)&&"animate-pulse opacity-60"),children:E.map(Se=>{const Je=z.status===Se?void 0:wa(z,Se),er=(Je==null?void 0:Je.disabled)??!1;return r.jsx("option",{value:Se,disabled:er,title:er?(Je==null?void 0:Je.disabledReason)??void 0:void 0,children:k[Se]},Se)})})}),r.jsx("td",{className:"py-4 pr-4 capitalize text-muted-foreground",children:z.priority}),r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:z.assignee??"Unassigned"}),r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:z.dependsOn.length}),r.jsx("td",{className:"py-4 text-muted-foreground",children:qr(z.updated)})]},an(z)))})]})})}):M==="list"?r.jsx("div",{className:"space-y-3",children:E.map(z=>{var dt;const ue=Hn.filter(Pt=>Pt.status===z);if(ue.length===0&&!ct)return null;const Se=ae.has(z),Je=ct?ct.status!==z&&!((dt=wa(ct,z))!=null&&dt.disabled):!1,er=ct?ct.status!==z&&!Je:!1,hn=ne===z;return r.jsxs("div",{className:ze("rounded-lg border border-border/60 bg-card/90 transition",hn&&Je&&"ring-2 ring-ring/30",er&&"border-dashed opacity-65"),onDragOver:Pt=>Pn(Pt,z),onDragLeave:Pt=>en(Pt,z),onDrop:Pt=>Wn(Pt,z),children:[r.jsxs("button",{type:"button",onClick:()=>un(z),className:"flex w-full items-center gap-2 px-4 py-3 text-left",children:[r.jsx(_a,{className:`h-4 w-4 text-muted-foreground transition-transform ${Se?"":"-rotate-90"}`}),r.jsx("span",{className:"font-semibold text-foreground",children:k[z]}),r.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:ue.length})]}),Se&&ue.length>0&&r.jsx("div",{className:"space-y-3 px-4 pb-4",children:ue.map(Pt=>{const nn=an(Pt),ko=Ye===nn,es=mt.get(nn)??-1;return r.jsx("div",{draggable:!0,onDragStart:pl=>pr(pl,nn),onDragEnd:ut,...es>=0?Ft(es):{},className:ze("cursor-grab transition active:cursor-grabbing",ko&&"scale-[0.98] opacity-50"),children:r.jsx(zb,{assignment:Pt,dragging:ko,transitioning:ke===nn})},nn)})})]},z)})}):r.jsx(Bj,{columns:w,items:Hn,getItemId:an,getColumnId:z=>z.status,canDrop:({item:z,fromColumnId:ue,toColumnId:Se})=>{if(ue===Se)return{allowed:!0};const Je=wa(z,Se);return Je!=null&&Je.disabled?{allowed:!1,reason:Je.disabledReason||Je.description}:{allowed:!0,reason:Je?Je.warning||Je.description:`Move to ${Se} (direct status change).`}},onMove:({item:z,toColumnId:ue})=>kn({item:z,toColumnId:ue}),getExternalDragData:z=>z.projectSlug===null?{type:"standalone-assignment",id:z.id}:{type:"project-assignment",id:z.id},onCardContextMenu:(z,ue)=>{ue.preventDefault(),_e({item:z,anchor:{x:ue.clientX,y:ue.clientY}})},emptyMessage:z=>`No ${z.title.toLowerCase()} assignments.`,renderCard:(z,{dragging:ue})=>{const Se=mt.get(an(z))??-1;return r.jsx("div",{...Se>=0?Ft(Se):{},children:r.jsx(zb,{assignment:z,dragging:ue,transitioning:ke===an(z)})})}}),r.jsx(k1,{open:H!==null,action:(H==null?void 0:H.action)??null,assignmentTitle:(H==null?void 0:H.item.title)??"Assignment",loading:ke===(H?an(H.item):null),onOpenChange:z=>{z||fe(null)},onConfirm:async z=>{if(!H)return;const ue=H;await qt({item:ue.item,toColumnId:ue.toColumnId,action:ue.action,reason:z})&&fe(null)}}),r.jsx(Hj,{anchor:(ve==null?void 0:ve.anchor)??null,items:ve?$_(ve.item,{onEdit:()=>{const z=ve.item,ue=z.projectSlug===null?`/assignments/${z.id}`:`${z.projectWorkspace?`/w/${z.projectWorkspace}`:t}/projects/${z.projectSlug}/assignments/${z.slug}`;n(ue)},onDelete:()=>st(ve.item),onMove:()=>St(ve.item)}):[],onClose:()=>_e(null)}),r.jsx(fl,{open:Ie!==null,title:"Delete assignment?",description:Ie?`"${Ie.title}" will be permanently removed. This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,loading:lt!==null,onOpenChange:z=>{!z&&lt===null&&st(null)},onConfirm:async()=>{if(!Ie||Ie.projectSlug===null){st(null);return}const z=an(Ie);_t(z);try{const ue=await fetch(`/api/projects/${encodeURIComponent(Ie.projectSlug)}/assignments/${encodeURIComponent(Ie.slug)}`,{method:"DELETE"});if(!ue.ok){const Se=await ue.json().catch(()=>({}));throw new Error(Se.error||"Failed to delete assignment")}st(null),d()}catch(ue){alert(ue instanceof Error?ue.message:"Failed to delete assignment")}finally{_t(null)}}}),r.jsx(lh,{open:kt!==null,onOpenChange:z=>{z||St(null)},currentWorkspace:(kt==null?void 0:kt.projectWorkspace)??null,title:"Move assignment to workspace",description:"Standalone assignments belong to a project-workspace via the workspaceGroup frontmatter field.",onSubmit:async z=>{if(!kt)return;const ue=await fetch(`/api/assignments/${encodeURIComponent(kt.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:z})});if(!ue.ok){const Se=await ue.json().catch(()=>({}));throw new Error(Se.error||"Failed to move assignment")}d()}})]})}function $_(e,t){const n=[{key:"edit",label:"Edit",icon:bi,onSelect:t.onEdit}];return e.projectSlug!==null?n.push({key:"delete",label:"Delete",icon:zn,destructive:!0,onSelect:t.onDelete}):n.push({key:"move",label:"Move to workspace…",icon:Za,onSelect:t.onMove}),n}function zb({assignment:e,dragging:t,transitioning:n}){var a;const s=Tt();return r.jsxs("div",{className:"vp-card 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(we,{to:e.projectSlug===null?`/assignments/${e.id}`:`${s}/projects/${e.projectSlug}/assignments/${e.slug}`,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:[(a=e.id)==null?void 0:a.slice(0,8),e.id&&r.jsx(Vr,{value:e.id})]})]}),r.jsx(wn,{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("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:qr(e.updated)})]})]})}function wa(e,t){return e.availableTransitions.find(n=>n.targetStatus===t)}function an(e){return e.id||e.slug||"unknown"}function dr(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(`
504
- `),l=[],c=new Map;let d=null,f=[];const m=()=>{d&&(l.push(d),c.set(d,f))};for(const g of a){const x=g.match(/^([A-Za-z_][A-Za-z0-9_-]*):/);if(x&&!g.startsWith(" ")){m(),d=x[1],f=[g];continue}d&&f.push(g)}return m(),{order:l,blocks:c,body:s}}function Ri(e){return`---
505
- ${e.order.map(n=>e.blocks.get(n)).filter(n=>!!n).flat().join(`
506
- `)}
507
- ---
508
-
509
- ${e.body.replace(/^\n+/,"")}`}function Xt(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 M_(e,t){return Xt(e,t)==="true"}function Oa(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 __(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 Jt(e,t,n){e.blocks.has(t)||e.order.push(t),e.blocks.set(t,[`${t}: ${__(n)}`])}function La(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 $a(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}function zu(e){const t=dr(e);return{title:Xt(t,"title"),slug:Xt(t,"slug"),workspace:Xt(t,"workspace"),archived:M_(t,"archived"),archivedAt:Xt(t,"archivedAt"),archivedReason:Xt(t,"archivedReason"),tags:Oa(t,"tags").join(", "),body:t.body}}function F_(e,t){const n=dr(e),s={...zu(e),...t};return Jt(n,"title",s.title),Jt(n,"slug",s.slug),Jt(n,"workspace",s.workspace||null),Jt(n,"archived",s.archived),Jt(n,"archivedAt",s.archivedAt||null),Jt(n,"archivedReason",s.archivedReason||null),La(n,"tags",$a(s.tags)),n.body=s.body,Ri(n)}function Bu(e){const t=dr(e);return{title:Xt(t,"title"),slug:Xt(t,"slug"),status:Xt(t,"status"),priority:Xt(t,"priority")||"medium",assignee:Xt(t,"assignee"),dependsOn:Oa(t,"dependsOn").join(", "),links:Oa(t,"links").join(", "),blockedReason:Xt(t,"blockedReason"),tags:Oa(t,"tags").join(", "),body:t.body}}function z_(e,t){const n=dr(e),s={...Bu(e),...t};return Jt(n,"title",s.title),Jt(n,"slug",s.slug),Jt(n,"status",s.status),Jt(n,"priority",s.priority),Jt(n,"assignee",s.assignee||null),La(n,"dependsOn",$a(s.dependsOn)),La(n,"links",$a(s.links)),Jt(n,"blockedReason",s.blockedReason||null),La(n,"tags",$a(s.tags)),n.body=s.body,Ri(n)}function Uu(e){const t=dr(e);return{assignment:Xt(t,"assignment"),status:Xt(t,"status"),body:t.body}}function B_(e,t){const n=dr(e),s={...Uu(e),...t};return Jt(n,"assignment",s.assignment),Jt(n,"status",s.status),n.body=s.body,Ri(n)}function Hu(e){const t=dr(e);return{assignment:Xt(t,"assignment"),body:t.body}}function U_(e,t){const n=dr(e),s={...Hu(e),...t};return Jt(n,"assignment",s.assignment),n.body=s.body,Ri(n)}function Wu(e){const t=dr(e);return{name:Xt(t,"name"),slug:Xt(t,"slug"),description:Xt(t,"description"),whenToUse:Xt(t,"when_to_use"),tags:Oa(t,"tags").join(", "),body:t.body}}function H_(e,t){const n=dr(e),s={...Wu(e),...t};return Jt(n,"name",s.name),Jt(n,"slug",s.slug),Jt(n,"description",s.description||null),Jt(n,"when_to_use",s.whenToUse||null),La(n,"tags",$a(s.tags)),n.body=s.body,Ri(n)}function qh(e){return{body:dr(e).body}}function E1(e){return qh(e)}function T1(e,t){const n=dr(e);return t.body!==void 0&&(n.body=t.body),Ri(n)}function W_(e,t){return T1(e,t)}function wt(e,t,n){switch(e){case"project":return F_(t,n);case"assignment":return z_(t,n);case"plan":return B_(t,n);case"scratchpad":return U_(t,n);case"playbook":return H_(t,n);case"memory":return T1(t,n);case"resource":return W_(t,n);default:return t}}function Ai({initialContent:e,documentType:t,mode:n="edit",onSave:s,saving:a,error:l,title:c,description:d,onCancel:f,helpTitle:m,helpBody:g,allowSlugEdit:x=!1}){const[y,v]=p.useState(e),[E,k]=p.useState(!1),[w,S]=p.useState("edit");p.useEffect(()=>{v(e)},[e]);const T=G_(t,y),N=y!==e,A=K_(t,y),M=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:M})]}),d?r.jsx("p",{className:"max-w-3xl text-sm leading-6 text-muted-foreground",children:d}):null]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("button",{type:"button",onClick:f,className:"shell-action",children:[r.jsx(xw,{className:"h-4 w-4"}),r.jsx("span",{children:"Back"})]}),R?r.jsxs("button",{type:"button",onClick:()=>k(I=>!I),className:"shell-action",children:[r.jsx(RE,{className:"h-4 w-4"}),r.jsx("span",{children:E?"Structured":"Raw Markdown"})]}):null,r.jsxs("button",{type:"button",onClick:()=>s(y),disabled:a||T.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(xu,{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,T.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:T.map(I=>r.jsx("li",{children:I},I))})}):null]}),r.jsxs("div",{className:"flex items-center gap-2 md:hidden",children:[r.jsx("button",{type:"button",onClick:()=>S("edit"),className:`shell-action ${w==="edit"?"bg-foreground text-background":""}`,children:"Edit"}),r.jsxs("button",{type:"button",onClick:()=>S("preview"),className:`shell-action ${w==="preview"?"bg-foreground text-background":""}`,children:[r.jsx(Fy,{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:I=>v(I.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(V_,{documentType:t,content:y,onChange:v,allowSlugEdit:x})})}),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(Fy,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Preview"})]}),r.jsx(Ut,{content:A,emptyState:"Write markdown body content to preview it here."})]})})]})]})}function V_({documentType:e,content:t,onChange:n,allowSlugEdit:s}){if(e==="project"){const l=zu(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(ja,{children:[r.jsx(ft,{label:"Project title",children:r.jsx("input",{value:l.title,onChange:c=>{const d=c.target.value,f={title:d};s&&(l.slug===Xn(l.title)||!l.slug.trim())&&(f.slug=Xn(d)),n(wt(e,t,f))},className:"editor-input"})}),r.jsx(ft,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(wt(e,t,{slug:Xn(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(ft,{label:"Tags",children:r.jsx("input",{value:l.tags,onChange:c=>n(wt(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),r.jsx(q_,{value:l.workspace,onChange:c=>n(wt(e,t,{workspace:c}))})]}),r.jsx(ft,{label:"Project body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(wt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="assignment"){const l=Bu(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(ja,{children:[r.jsx(ft,{label:"Assignment title",children:r.jsx("input",{value:l.title,onChange:c=>{const d=c.target.value,f={title:d};s&&(l.slug===Xn(l.title)||!l.slug.trim())&&(f.slug=Xn(d)),n(wt(e,t,f))},className:"editor-input"})}),r.jsx(ft,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(wt(e,t,{slug:Xn(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(ft,{label:"Status",children:r.jsxs("select",{value:l.status,onChange:c=>n(wt(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(ft,{label:"Priority",children:r.jsxs("select",{value:l.priority,onChange:c=>n(wt(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(ft,{label:"Assignee",children:r.jsx("input",{value:l.assignee,onChange:c=>n(wt(e,t,{assignee:c.target.value})),placeholder:"Agent name",className:"editor-input"})}),r.jsx(ft,{label:"Depends on",className:"md:col-span-2",children:r.jsx("input",{value:l.dependsOn,onChange:c=>n(wt(e,t,{dependsOn:c.target.value})),placeholder:"Comma-separated assignment slugs",className:"editor-input"})}),r.jsx(ft,{label:"Links",className:"md:col-span-2",children:r.jsx("input",{value:l.links,onChange:c=>n(wt(e,t,{links:c.target.value})),placeholder:"Comma-separated: projectSlug/assignmentSlug",className:"editor-input"})}),r.jsx(ft,{label:"Blocked reason",className:"md:col-span-2",children:r.jsx("input",{value:l.blockedReason,onChange:c=>n(wt(e,t,{blockedReason:c.target.value})),placeholder:"Read-only unless the assignment is actually blocked",className:"editor-input"})}),r.jsx(ft,{label:"Tags",className:"md:col-span-2",children:r.jsx("input",{value:l.tags,onChange:c=>n(wt(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})})]}),r.jsx(ft,{label:"Assignment body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(wt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="plan"){const l=Uu(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(ja,{children:[r.jsx(ft,{label:"Assignment",children:r.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})}),r.jsx(ft,{label:"Plan status",children:r.jsxs("select",{value:l.status,onChange:c=>n(wt(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(ft,{label:"Plan body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(wt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="scratchpad"){const l=Hu(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsx(ja,{children:r.jsx(ft,{label:"Assignment",children:r.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})})}),r.jsx(ft,{label:"Scratchpad body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(wt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="memory"||e==="resource"){const l=e==="memory"?qh(t):E1(t),c=e==="memory"?"Memory body":"Resource body";return r.jsxs("div",{className:"space-y-3",children:[r.jsx(ft,{label:c,children:r.jsx("textarea",{value:l.body,onChange:d=>n(wt(e,t,{body:d.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=Wu(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(ja,{children:[r.jsx(ft,{label:"Playbook name",children:r.jsx("input",{value:a.name,onChange:l=>{const c=l.target.value,d={name:c};s&&(a.slug===Xn(a.name)||!a.slug.trim())&&(d.slug=Xn(c)),n(wt(e,t,d))},className:"editor-input"})}),r.jsx(ft,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:a.slug,disabled:!s,onChange:l=>n(wt(e,t,{slug:Xn(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(ft,{label:"Description",className:"md:col-span-2",children:r.jsx("input",{value:a.description,onChange:l=>n(wt(e,t,{description:l.target.value})),placeholder:"One-line description of what this playbook does",className:"editor-input"})}),r.jsx(ft,{label:"Tags",className:"md:col-span-2",children:r.jsx("input",{value:a.tags,onChange:l=>n(wt(e,t,{tags:l.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),r.jsx(ft,{label:"When to use",className:"md:col-span-2",children:r.jsx("input",{value:a.whenToUse,onChange:l=>n(wt(e,t,{whenToUse:l.target.value})),placeholder:"Describe when agents should apply this playbook",className:"editor-input"})})]}),r.jsx(ft,{label:"Playbook rules",children:r.jsx("textarea",{value:a.body,onChange:l=>n(wt(e,t,{body:l.target.value})),className:"editor-textarea",spellCheck:!1})})]})}function ja({children:e}){return r.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e})}function ft({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 q_({value:e,onChange:t}){const{data:n}=vu(),s=(n==null?void 0:n.workspaces)??[];return r.jsx(ft,{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 K_(e,t){switch(e){case"project":return zu(t).body;case"assignment":return Bu(t).body;case"plan":return Uu(t).body;case"scratchpad":return Hu(t).body;case"playbook":return Wu(t).body;case"memory":return qh(t).body;case"resource":return E1(t).body}}function G_(e,t){switch(e){case"project":{const n=zu(t);return[n.title.trim()?null:"Project title is required.",n.slug.trim()?null:"Project slug is required.",n.slug.trim()&&!zc(n.slug)?"Project slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"assignment":{const n=Bu(t);return[n.title.trim()?null:"Assignment title is required.",n.slug.trim()?null:"Assignment slug is required.",n.slug.trim()&&!zc(n.slug)?"Assignment slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"plan":return Uu(t).assignment.trim()?[]:["Plan assignment is required."];case"scratchpad":return Hu(t).assignment.trim()?[]:["Scratchpad assignment is required."];case"playbook":{const n=Wu(t);return[n.name.trim()?null:"Playbook name is required.",n.slug.trim()?null:"Playbook slug is required.",n.slug.trim()&&!zc(n.slug)?"Playbook slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"memory":case"resource":return[]}}function Bb(){const e=Et(),{workspace:t}=jt(),n=Tt(),[s,a]=p.useState(null),[l,c]=p.useState(!0),[d,f]=p.useState(!1),[m,g]=p.useState(null);p.useEffect(()=>{fetch("/api/templates/project").then(y=>y.json()).then(y=>{let v=y.content;t&&t!=="_ungrouped"&&(v=v.replace(/^(tags: \[\])$/m,`$1
510
- workspace: ${t}`)),a(v),c(!1)}).catch(y=>{g(y.message),c(!1)})},[t]);async function x(y){f(!0),g(null);try{const v=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),E=await v.json();if(!v.ok){g(E.error||`HTTP ${v.status}`),f(!1);return}e(`${n}/projects/${E.slug}`)}catch(v){g(v.message),f(!1);return}f(!1)}return l?r.jsx(at,{label:"Loading project template…"}):m&&!s?r.jsx(et,{error:m}):r.jsx(Ai,{initialContent:s||"",documentType:"project",mode:"create",onSave:x,saving:d,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 Ub(){const{slug:e}=jt(),t=Tt(),n=Et(),[s,a]=p.useState(null),[l,c]=p.useState(!0),[d,f]=p.useState(!1),[m,g]=p.useState(null);p.useEffect(()=>{fetch("/api/templates/assignment").then(y=>y.json()).then(y=>{a(y.content),c(!1)}).catch(y=>{g(y.message),c(!1)})},[]);async function x(y){if(!e){g("Project slug is required.");return}f(!0),g(null);try{const v=await fetch(`/api/projects/${e}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),E=await v.json();if(!v.ok){g(E.error||`HTTP ${v.status}`),f(!1);return}n(`${t}/projects/${e}/assignments/${E.slug}`)}catch(v){g(v.message),f(!1);return}f(!1)}return l?r.jsx(at,{label:"Loading assignment template…"}):m&&!s?r.jsx(et,{error:m}):r.jsx(Ai,{initialContent:s||"",documentType:"assignment",mode:"create",onSave:x,saving:d,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 Hb(){const{workspace:e}=jt(),t=Tt(),n=Et(),[s,a]=p.useState(null),[l,c]=p.useState(!0),[d,f]=p.useState(!1),[m,g]=p.useState(null);p.useEffect(()=>{const y=new URLSearchParams({standalone:"1"});e&&y.set("workspace",e),fetch(`/api/templates/assignment?${y.toString()}`).then(v=>v.json()).then(v=>{a(v.content),c(!1)}).catch(v=>{g(v.message),c(!1)})},[e]);async function x(y){var v;f(!0),g(null);try{const E=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),k=await E.json();if(!E.ok){g(k.error||`HTTP ${E.status}`),f(!1);return}const w=(v=k==null?void 0:k.assignment)==null?void 0:v.id;if(!w){g("Server did not return the new assignment id."),f(!1);return}n(`/assignments/${w}`)}catch(E){g(E.message),f(!1);return}f(!1)}return l?r.jsx(at,{label:"Loading assignment template…"}):m&&!s?r.jsx(et,{error:m}):r.jsx(Ai,{initialContent:s||"",documentType:"assignment",mode:"create",onSave:x,saving:d,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 Di({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:a,documentType:l,helpTitle:c,helpBody:d}){const f=Et(),{data:m,loading:g,error:x}=Kw(e),[y,v]=p.useState(!1),[E,k]=p.useState(null);async function w(S){v(!0),k(null);try{const T=await fetch(t,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:S})}),N=await T.json();if(!T.ok){k(N.error||`HTTP ${T.status}`),v(!1);return}f(n)}catch(T){k(T.message),v(!1);return}v(!1)}return g?r.jsx(at,{label:`Loading ${s.toLowerCase()}…`}):x||!m?r.jsx(et,{error:x||`${s} is unavailable.`}):r.jsx(Ai,{initialContent:m.content,documentType:l,onSave:w,saving:y,error:E,title:s,description:a,onCancel:()=>f(n),helpTitle:c,helpBody:d})}function Wb(){const{slug:e}=jt(),t=Tt(),n=e??"";return r.jsx(Di,{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 gp(){const{slug:e,aslug:t,id:n}=jt(),s=Tt(),a=!!n,l=a?`/api/assignments/${n}/edit`:`/api/projects/${e}/assignments/${t}/edit`,c=a?`/api/assignments/${n}`:`/api/projects/${e}/assignments/${t}`,d=a?`/assignments/${n}`:`${s}/projects/${e}/assignments/${t}`;return r.jsx(Di,{loadUrl:l,saveUrl:c,redirectTo:d,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 xp(){const{slug:e,aslug:t,id:n}=jt(),s=Tt(),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`,d=a?`/assignments/${n}?tab=plan`:`${s}/projects/${e}/assignments/${t}?tab=plan`;return r.jsx(Di,{loadUrl:l,saveUrl:c,redirectTo:d,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 yp(){const{slug:e,aslug:t,id:n}=jt(),s=Tt(),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`,d=a?`/assignments/${n}?tab=scratchpad`:`${s}/projects/${e}/assignments/${t}?tab=scratchpad`;return r.jsx(Di,{loadUrl:l,saveUrl:c,redirectTo:d,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 P1({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:a,helpTitle:l,helpBody:c}){const d=Et(),{data:f,loading:m,error:g}=Kw(e),[x,y]=p.useState(""),[v,E]=p.useState(""),[k,w]=p.useState(!1),[S,T]=p.useState(null);async function N(){w(!0),T(null);try{const A=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:x,body:v})}),M=await A.json();if(!A.ok){T(M.error||`HTTP ${A.status}`),w(!1);return}d(n)}catch(A){T(A.message),w(!1);return}w(!1)}return m?r.jsx(at,{label:`Loading ${s.toLowerCase()}…`}):g||!f?r.jsx(et,{error:g||`${s} is unavailable.`}):r.jsxs("div",{className:"space-y-4",children:[r.jsx(Le,{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:x,onChange:A=>y(A.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:v,onChange:A=>E(A.target.value),className:"editor-textarea",spellCheck:!1})]}),S?r.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:S}):null,r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{type:"button",onClick:()=>d(n),className:"shell-action",children:"Cancel"}),r.jsx("button",{type:"button",onClick:N,disabled:k||!v.trim(),className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:k?"Appending…":"Append Entry"})]})]})}),r.jsx(Le,{title:"Current Document",children:r.jsx(Ut,{content:f.content.replace(/^---[\s\S]*?---\n?/,""),emptyState:"No existing content."})})]})}function vp(){const{slug:e,aslug:t,id:n}=jt(),s=Tt(),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`,d=a?`/assignments/${n}?tab=handoff`:`${s}/projects/${e}/assignments/${t}?tab=handoff`;return r.jsx(P1,{loadUrl:l,saveUrl:c,redirectTo:d,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 bp(){const{slug:e,aslug:t,id:n}=jt(),s=Tt(),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`,d=a?`/assignments/${n}?tab=decisions`:`${s}/projects/${e}/assignments/${t}?tab=decisions`;return r.jsx(P1,{loadUrl:l,saveUrl:c,redirectTo:d,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 Vb(){const{workspace:e}=jt(),{data:t}=ji(),{data:n,loading:s,error:a,refetch:l}=Tm(),[c,d]=p.useState(!1),[f,m]=p.useState(""),[g,x]=p.useState(!1),y=En();p.useEffect(()=>{const T=y.hash.match(/^#server-(.+)/);if(!T)return;const N=decodeURIComponent(T[1]),A=document.querySelector(`[data-server-name="${window.CSS.escape(N)}"]`);if(!A)return;A.scrollIntoView({block:"nearest"}),A.classList.add("ring-2","ring-primary/60");const M=window.setTimeout(()=>A.classList.remove("ring-2","ring-primary/60"),1500);return()=>window.clearTimeout(M)},[y.hash,n]);const v=(()=>{if(!e||!n)return(n==null?void 0:n.sessions)??[];if(!t)return[];const T=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(A=>A.panes.some(M=>M.assignment&&M.assignment.project!==null&&T.has(M.assignment.project))))})();async function E(T){if(T.preventDefault(),!!f.trim())try{await fetch("/api/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f.trim()})}),m(""),d(!1),l()}catch{}}async function k(){x(!0);try{await fetch("/api/servers/refresh",{method:"POST"}),l()}finally{x(!1)}}async function w(T){await fetch(`/api/servers/${encodeURIComponent(T)}`,{method:"DELETE"}),l()}async function S(T){await fetch(`/api/servers/${encodeURIComponent(T)}/refresh`,{method:"POST"}),l()}return s?r.jsx(at,{label:"Loading servers…"}):a?r.jsx(et,{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:f,onChange:T=>m(T.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:()=>d(!1),children:"Cancel"})]}):r.jsxs("button",{className:"shell-action",onClick:()=>d(!0),children:[r.jsx(Ht,{className:"h-3.5 w-3.5"}),"Track Session"]}),r.jsxs("button",{className:"shell-action",onClick:k,disabled:g,children:[r.jsx(Sw,{className:`h-3.5 w-3.5 ${g?"animate-spin":""}`}),"Refresh All"]})]}),v.length===0?r.jsx(ot,{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:v.map(T=>r.jsx(Y_,{session:T,onRefresh:()=>S(T.name),onRemove:()=>w(T.name),onRefetch:l},T.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(Ba,{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 Y_({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(bm,{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(Sw,{className:"h-3.5 w-3.5"})}),r.jsx("button",{className:"shell-action",onClick:n,title:"Remove",children:r.jsx(zn,{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(X_,{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(WE,{className:"h-4 w-4"}),r.jsx("span",{children:e.kind==="process"?"Process no longer running":"Session no longer exists"})]})]})}function X_({pane:e,sessionName:t,windowIndex:n,onRefetch:s}){const a=Tt(),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:"truncate",title:e.cwd,children:l}),r.jsx(Vr,{value:e.cwd})]}),e.branch&&r.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-xs text-muted-foreground",children:[r.jsx(gm,{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(hm,{className:"h-2.5 w-2.5"})]},c))}),r.jsx("div",{className:"ml-auto shrink-0",children:e.assignment?r.jsxs(we,{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($E,{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 R1(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 J_(e,t){const n=Date.parse(e),s=Math.floor((n-t)/1e3);return Number.isNaN(s)?"–":s<=0?"expired":R1(s)}function Q_(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 Z_(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function qb(){const{data:e,loading:t,error:n,refetch:s}=U2(),[a,l]=p.useState(()=>Date.now()),[c,d]=p.useState(null),[f,m]=p.useState(!1);if(p.useEffect(()=>{const x=window.setInterval(()=>l(Date.now()),1e3);return()=>window.clearInterval(x)},[]),t)return r.jsx(at,{label:"Loading inventories…"});if(n)return r.jsx(et,{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(ot,{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 g(){if(c){m(!0);try{const x=await fetch(`/api/leases/${encodeURIComponent(c.slug)}/force-release/${encodeURIComponent(c.lease.lease_id)}`,{method:"POST"});if(!x.ok){const y=await x.json().catch(()=>null);throw new Error((y==null?void 0:y.error)??`HTTP ${x.status}`)}s(),d(null)}catch(x){window.alert(x instanceof Error?`Force release failed: ${x.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(x=>r.jsx(e5,{detail:x,now:a,onForceRelease:y=>d({slug:x.inventory.slug,lease:y})},x.inventory.slug))}),r.jsx(fl,{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:f,onConfirm:g,onOpenChange:x=>{x||d(null)}})]})}function e5({detail:e,now:t,onForceRelease:n}){const{inventory:s,members:a,active_leases:l}=e,c=a.filter(f=>f.status==="idle").length,d=a.filter(f=>f.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(pm,{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=",R1(s.default_ttl_s)]})]}),r.jsx("div",{className:"text-right text-xs text-muted-foreground",children:r.jsxs("div",{children:[c," idle · ",d," leased · ",a.length," total"]})})]}),r.jsx("div",{className:"mt-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:a.map(f=>r.jsx(t5,{member:f},f.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(f=>r.jsx(n5,{lease:f,now:t,onForceRelease:()=>n(f)},f.lease_id))})]})]})}function t5({member:e}){const t=Z_(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 ${Q_(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 n5({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(CE,{className:"h-3 w-3"}),J_(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(qE,{className:"h-3 w-3"}),"Force release"]})]})]})}function Kb(){const{workspace:e}=jt(),{data:t}=ji(),{data:n,loading:s,error:a}=H2(),[l,c]=p.useState(""),[d,f]=p.useState(""),[m,g]=p.useState(""),[x,y]=p.useState("started_desc"),[v,E]=p.useState(0),[k,w]=p.useState(new Set),[S,T]=p.useState(!1),[N,A]=p.useState(null),[M,R]=p.useState(null),I=(n==null?void 0:n.sessions.some(q=>q.status==="active"))??!1;p.useEffect(()=>{if(!I)return;const q=window.setInterval(()=>E(G=>G+1),3e4);return()=>window.clearInterval(q)},[I]),p.useEffect(()=>{w(q=>{if(q.size===0)return q;const G=new Set((n==null?void 0:n.sessions.map(W=>W.sessionId))??[]),B=new Set([...q].filter(W=>G.has(W)));return B.size===q.size?q:B})},[n]);const O=p.useMemo(()=>{if(!n)return[];if(e&&!t)return[];const q=l.trim().toLowerCase();return[...n.sessions.filter(B=>{var ee;if(e&&t){const C=((ee=t.find($=>$.slug===B.projectSlug))==null?void 0:ee.workspace)??null;if(e==="_ungrouped"){if(C!==null)return!1}else if(C!==e)return!1}const W=s5(B.started);return d&&(!W||W<d)||m&&(!W||W>m)?!1:q?[B.projectSlug??"",B.assignmentSlug??"",B.agent,B.sessionId,B.path,B.description??"",B.transcriptPath??""].join(" ").toLowerCase().includes(q):!0})].sort((B,W)=>o5(B,W,x))},[n,l,x,d,m,v,e,t]);function Y(q){w(G=>{const B=new Set(G);return B.has(q)?B.delete(q):B.add(q),B})}function J(){k.size===O.length&&O.length>0?w(new Set):w(new Set(O.map(q=>q.sessionId)))}async function _(q){A(null),T(!0);try{const G=await fetch("/api/agent-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionIds:q})}),B=await G.json().catch(()=>null);if(!G.ok)throw new Error((B==null?void 0:B.error)||`HTTP ${G.status}`);w(W=>new Set([...W].filter(D=>!q.includes(D)))),R(null)}catch(G){A(G.message)}finally{T(!1)}}async function U(q){try{const G=await fetch(`/api/agent-sessions/${encodeURIComponent(q)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"stopped"})});if(!G.ok){const B=await G.json().catch(()=>null);A((B==null?void 0:B.error)||`Failed to mark session stopped: HTTP ${G.status}`)}}catch(G){A(G.message)}}if(s)return r.jsx(at,{label:"Loading agent sessions..."});if(a)return r.jsx(et,{error:a});if(!n)return null;const X=n.sessions.length>0;return r.jsxs(r.Fragment,{children:[r.jsxs(oh,{children:[r.jsx(Au,{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:d,onChange:q=>f(q.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:q=>g(q.target.value),className:"editor-input min-w-[150px]"})]}),r.jsxs("select",{value:x,onChange:q=>y(q.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,k.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:[k.size," session",k.size!==1?"s":""," selected"]}),r.jsxs("button",{className:"shell-action text-destructive",onClick:()=>R({sessionIds:[...k],title:`Delete ${k.size} selected session${k.size===1?"":"s"}?`,description:"This removes the selected agent session records from the dashboard. This cannot be undone.",confirmLabel:k.size===1?"Delete Session":"Delete Sessions"}),disabled:S,children:[r.jsx(zn,{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"})]}),X?O.length===0?r.jsx(ot,{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:J,className:"text-muted-foreground hover:text-foreground",children:k.size===O.length&&O.length>0?r.jsx(cr,{className:"h-4 w-4"}):r.jsx(wm,{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:O.map(q=>r.jsx(r5,{session:q,selected:k.has(q.sessionId),onToggle:()=>Y(q.sessionId),onDelete:()=>R({sessionIds:[q.sessionId],title:`Delete session ${q.sessionId.slice(0,8)}...?`,description:`Remove this ${q.agent} session record${q.assignmentSlug?` for ${q.assignmentSlug}`:""}. This cannot be undone.`,confirmLabel:"Delete Session"}),onMarkStopped:U},q.sessionId))})]})}):r.jsx(ot,{title:"No agent sessions",description:"No agent sessions have been registered yet. Use /grab-assignment or syntaur track-session to register one."}),r.jsx(fl,{open:M!==null,title:(M==null?void 0:M.title)??"Delete session?",description:(M==null?void 0:M.description)??"",confirmLabel:(M==null?void 0:M.confirmLabel)??"Delete",destructive:!0,loading:S,onOpenChange:q=>{q||R(null)},onConfirm:async()=>{M&&await _(M.sessionIds)}})]})}function r5({session:e,selected:t,onToggle:n,onDelete:s,onMarkStopped:a}){const l=Tt(),c=e.sessionId.length>12?e.sessionId.slice(0,8)+"...":e.sessionId,d=e.path?e.path.replace(/^\/Users\/[^/]+/,"~"):"—",f=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(cr,{className:"h-4 w-4"}):r.jsx(wm,{className:"h-4 w-4"})})}),r.jsx("td",{className:"py-2 pr-3",children:e.projectSlug?r.jsx(we,{to:`${l}/projects/${e.projectSlug}`,className:"block truncate text-primary hover:underline",title:pn(e.projectSlug),children:pn(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(we,{to:`${l}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`,className:"block truncate text-primary hover:underline",title:pn(e.assignmentSlug),children:pn(e.assignmentSlug)}):e.assignmentSlug?r.jsx(we,{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(fm,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"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:"truncate font-mono text-xs text-muted-foreground",title:e.sessionId,children:c}),r.jsx(Vr,{value:e.sessionId})]})}),r.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:r.jsx("span",{className:"truncate block",children:Kr(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:"truncate text-xs text-muted-foreground",title:e.path,children:d}),e.path&&r.jsx(Vr,{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:"truncate font-mono text-xs text-muted-foreground",title:e.transcriptPath,children:f}),r.jsx(Vr,{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(w1,{session:e,onMarkStopped:a}),r.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-destructive",title:"Delete session",children:r.jsx(zn,{className:"h-3.5 w-3.5"})})]})})]})}function s5(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 Oc(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 o5(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 Oc(e)-Oc(t);case"duration_desc":return Oc(t)-Oc(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 i5(){const{data:e,loading:t,error:n,refetch:s}=Gw(),[a,l]=p.useState(""),[c,d]=p.useState(null),[f,m]=p.useState(null),[g,x]=p.useState(null),y=p.useMemo(()=>{if(!(e!=null&&e.playbooks))return[];if(!a.trim())return e.playbooks;const k=a.toLowerCase();return e.playbooks.filter(w=>w.name.toLowerCase().includes(k)||w.description.toLowerCase().includes(k)||w.slug.toLowerCase().includes(k)||w.tags.some(S=>S.toLowerCase().includes(k)))},[e,a]);async function v(k,w,S){if(k.preventDefault(),k.stopPropagation(),!c){d(w);try{const T=S?"disable":"enable",N=await fetch(`/api/playbooks/${encodeURIComponent(w)}/${T}`,{method:"POST"});if(!N.ok){const A=await N.json().catch(()=>({}));throw new Error(A.error||`Failed to ${T} playbook`)}s()}catch(T){console.error(T),alert(T instanceof Error?T.message:"Failed to update playbook")}finally{d(null)}}}async function E(){if(f){x(f.slug);try{const k=await fetch(`/api/playbooks/${encodeURIComponent(f.slug)}`,{method:"DELETE"});if(!k.ok){const w=await k.json().catch(()=>({}));throw new Error(w.error||"Failed to delete playbook")}m(null),s()}catch(k){console.error(k),alert(k instanceof Error?k.message:"Failed to delete playbook")}finally{x(null)}}}return t?r.jsx(at,{label:"Loading playbooks..."}):n?r.jsx(et,{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(qs,{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:k=>l(k.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(we,{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(Ht,{className:"h-4 w-4"}),"Create Playbook"]})]}),r.jsxs(we,{to:"/playbooks/manifest",className:"surface-panel group flex items-center gap-3 p-3 transition hover:border-foreground/20",children:[r.jsx(jw,{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(ot,{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(we,{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(Ht,{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(k=>{const w=c===k.slug,S=[{key:"delete",label:"Delete",icon:zn,destructive:!0,onSelect:()=>m({slug:k.slug,name:k.name})}];return r.jsxs("div",{className:`surface-panel relative flex flex-col gap-2 p-4 transition hover:border-foreground/20 ${k.enabled?"":"opacity-75"}`,children:[r.jsx("div",{className:"absolute right-3 top-3 z-10",children:r.jsx(rh,{items:S})}),r.jsxs(we,{to:`/playbooks/${k.slug}`,className:"group flex flex-col gap-2",children:[r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx(vw,{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:k.name}),k.description?r.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground line-clamp-2",children:k.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:[k.tags.slice(0,3).map(T=>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(Nw,{className:"h-2.5 w-2.5"}),T]},T)),k.tags.length>3?r.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["+",k.tags.length-3]}):null]})})]}),r.jsx("button",{type:"button",role:"switch","aria-checked":k.enabled,"aria-label":k.enabled?"Disable playbook":"Enable playbook",onClick:T=>v(T,k.slug,k.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 ${k.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 ${k.enabled?"translate-x-[18px] bg-background":"translate-x-[2px] bg-foreground/70"}`})})]},k.slug)})}),r.jsx(fl,{open:f!==null,title:"Delete playbook?",description:f?`"${f.name}" will be removed from disk and the playbook manifest will be regenerated. This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,loading:g!==null,onConfirm:E,onOpenChange:k=>{k||m(null)}})]})}function a5(){const{slug:e}=jt(),t=Et(),{data:n,loading:s,error:a,refetch:l}=q2(e),[c,d]=p.useState(!1),[f,m]=p.useState(!1),[g,x]=p.useState(!1),[y,v]=p.useState(!1),[E,k]=p.useState(""),[w,S]=p.useState(!1),[T,N]=p.useState(null),A=e==="manifest";p.useEffect(()=>{y&&(k(e??""),N(null))},[y,e]);const M=Xn(E),R=M.length>0&&zc(M)&&M!=="manifest",I=M!==e;async function O(){if(!(!e||!R||!I)){S(!0),N(null);try{const _=await fetch(`/api/playbooks/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({newSlug:M})});if(!_.ok){const U=await _.json().catch(()=>({}));throw new Error(U.error||"Failed to rename playbook")}v(!1),t(`/playbooks/${M}`)}catch(_){N(_ instanceof Error?_.message:"Failed to rename playbook")}finally{S(!1)}}}async function Y(){if(e){m(!0);try{(await fetch(`/api/playbooks/${e}`,{method:"DELETE"})).ok&&t("/playbooks")}finally{m(!1)}}}async function J(){if(!(!e||!n)){x(!0);try{const _=n.enabled?"disable":"enable",U=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${_}`,{method:"POST"});if(!U.ok){const X=await U.json().catch(()=>({}));throw new Error(X.error||`Failed to ${_} playbook`)}l()}catch(_){console.error(_),alert(_ instanceof Error?_.message:"Failed to update playbook")}finally{x(!1)}}}return s?r.jsx(at,{label:"Loading playbook..."}):a?r.jsx(et,{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:A?"Playbook Manifest":n.name}),A?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]}),!A&&n.description?r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:n.description}):null,A?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,!A&&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 ",Kr(n.created)]}),r.jsxs("span",{children:["Updated ",Kr(n.updated)]})]}),n.tags.length>0?r.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:n.tags.map(_=>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(Nw,{className:"h-3 w-3"}),_]},_))}):null]}),A?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:J,disabled:g,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(we,{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:()=>v(!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(GE,{className:"h-3 w-3"}),"Rename"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:Y,disabled:f,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:f?"Deleting...":"Confirm"}),r.jsx("button",{type:"button",onClick:()=>d(!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:()=>d(!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(zn,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(Ut,{content:n.body})}),r.jsx(Jr,{open:y,onOpenChange:_=>w?void 0:v(_),children:r.jsxs(Tr,{children:[r.jsxs(bo,{children:[r.jsx(Pr,{children:"Rename playbook"}),r.jsx(ps,{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:_=>k(_.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&&M!==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:M||"—"})]}):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]}),T?r.jsx("p",{className:"text-sm text-destructive",role:"alert",children:T}):null,r.jsxs(wo,{children:[r.jsx("button",{type:"button",onClick:()=>v(!1),disabled:w,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",onClick:O,disabled:w||!R||!I,className:"shell-action mt-0 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:w?"Renaming…":"Rename"})]})]})})]}):null}function l5(){const e=Et(),[t,n]=p.useState(null),[s,a]=p.useState(!0),[l,c]=p.useState(!1),[d,f]=p.useState(null);p.useEffect(()=>{fetch("/api/playbooks/template/new").then(g=>g.json()).then(g=>{n(g.content),a(!1)}).catch(g=>{f(g.message),a(!1)})},[]);async function m(g){c(!0),f(null);try{const x=await fetch("/api/playbooks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:g})}),y=await x.json();if(!x.ok){f(y.error||`HTTP ${x.status}`),c(!1);return}e(`/playbooks/${y.slug}`)}catch(x){f(x.message),c(!1);return}c(!1)}return s?r.jsx(at,{label:"Loading playbook template..."}):d&&!t?r.jsx(et,{error:d}):r.jsx(Ai,{initialContent:t||"",documentType:"playbook",mode:"create",onSave:m,saving:l,error:d,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 c5(){const{slug:e}=jt(),t=Et(),[n,s]=p.useState(null),[a,l]=p.useState(!0),[c,d]=p.useState(!1),[f,m]=p.useState(null);p.useEffect(()=>{e&&fetch(`/api/playbooks/${e}/edit`).then(x=>x.json()).then(x=>{s(x.content),l(!1)}).catch(x=>{m(x.message),l(!1)})},[e]);async function g(x){if(e){d(!0),m(null);try{const y=await fetch(`/api/playbooks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:x})}),v=await y.json();if(!y.ok){m(v.error||`HTTP ${y.status}`),d(!1);return}t(`/playbooks/${e}`)}catch(y){m(y.message),d(!1);return}d(!1)}}return a?r.jsx(at,{label:"Loading playbook..."}):f&&!n?r.jsx(et,{error:f}):r.jsx(Ai,{initialContent:n||"",documentType:"playbook",mode:"edit",onSave:g,saving:c,error:f,title:"Edit Playbook",onCancel:()=>t(`/playbooks/${e}`)})}function u5(){const{data:e,loading:t,error:n}=K2(),[s,a]=p.useState(""),[l,c]=p.useState("all"),[d,f]=p.useState("all"),[m,g]=p.useState("all"),x=(e==null?void 0:e.memories)??[],y=p.useMemo(()=>Array.from(new Set(x.map(w=>w.projectSlug))).sort(),[x]),v=p.useMemo(()=>Array.from(new Set(x.map(w=>w.scope).filter(Boolean))).sort(),[x]),E=p.useMemo(()=>Array.from(new Set(x.map(w=>w.source).filter(Boolean))).sort(),[x]),k=p.useMemo(()=>x.filter(w=>{if(l!=="all"&&w.projectSlug!==l||d!=="all"&&w.scope!==d||m!=="all"&&w.source!==m)return!1;if(s.trim()){const S=s.toLowerCase();if(!w.name.toLowerCase().includes(S)&&!w.slug.toLowerCase().includes(S)&&!w.projectTitle.toLowerCase().includes(S))return!1}return!0}),[x,s,l,d,m]);return t?r.jsx(at,{label:"Loading memories…"}):n?r.jsx(et,{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(qs,{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:d,onChange:w=>f(w.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All scopes"}),v.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:m,onChange:w=>g(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(we,{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(Ht,{className:"h-4 w-4"}),"New Memory"]})]}),k.length===0?r.jsx(ot,{title:x.length===0?"No memories yet":"No memories match these filters",description:x.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:x.length===0?r.jsxs(we,{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(Ht,{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:k.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(we,{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(we,{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:qr(w.updated)})]},`${w.projectSlug}/${w.slug}`))})]})})]})}function d5(){const{slug:e,itemSlug:t}=jt(),n=Et(),{data:s,loading:a,error:l}=G2(e,t),[c,d]=p.useState(!1),[f,m]=p.useState(!1);async function g(){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(at,{label:"Loading memory…"}):l?r.jsx(et,{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(we,{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 ",Kr(s.created)]}),r.jsxs("span",{children:["Updated ",Kr(s.updated)]})]}),s.tags&&s.tags.length>0?r.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:s.tags.map(x=>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:x},x))}):null]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsxs(we,{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:g,disabled:f,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:f?"Deleting…":"Confirm"}),r.jsx("button",{type:"button",onClick:()=>d(!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:()=>d(!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(zn,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(Ut,{content:s.body})})]}):null}function f5(){const e=Et(),[t]=Xr(),n=t.get("project"),{data:s,loading:a,error:l}=ji(),[c,d]=p.useState(n??""),[f,m]=p.useState(""),[g,x]=p.useState(""),[y,v]=p.useState(!1),[E,k]=p.useState(null);p.useEffect(()=>{!c&&s&&s.length>0&&d(n??s[0].slug)},[s,n,c]);async function w(S){if(S.preventDefault(),!(!c||!f.trim())){v(!0),k(null);try{const T=await fetch(`/api/projects/${c}/memories`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f.trim(),body:g||void 0})}),N=await T.json();if(!T.ok){k(N.error||`HTTP ${T.status}`),v(!1);return}e(`/projects/${N.projectSlug}/memories/${N.slug}`)}catch(T){k(T.message),v(!1)}}}return a?r.jsx(at,{label:"Loading projects…"}):l?r.jsx(et,{error:l}):!s||s.length===0?r.jsx(et,{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:S=>d(S.target.value),className:"editor-input",required:!0,children:s.map(S=>r.jsx("option",{value:S.slug,children:S.title},S.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:f,onChange:S=>m(S.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:g,onChange:S=>x(S.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||!f.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 p5(){const{slug:e,itemSlug:t}=jt();return r.jsx(Di,{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 m5(){const{data:e,loading:t,error:n}=Y2(),[s,a]=p.useState(""),[l,c]=p.useState("all"),[d,f]=p.useState("all"),[m,g]=p.useState("all"),x=(e==null?void 0:e.resources)??[],y=p.useMemo(()=>Array.from(new Set(x.map(w=>w.projectSlug))).sort(),[x]),v=p.useMemo(()=>Array.from(new Set(x.map(w=>w.category).filter(Boolean))).sort(),[x]),E=p.useMemo(()=>Array.from(new Set(x.map(w=>w.source).filter(Boolean))).sort(),[x]),k=p.useMemo(()=>x.filter(w=>{if(l!=="all"&&w.projectSlug!==l||d!=="all"&&w.category!==d||m!=="all"&&w.source!==m)return!1;if(s.trim()){const S=s.toLowerCase();if(!w.name.toLowerCase().includes(S)&&!w.slug.toLowerCase().includes(S)&&!w.projectTitle.toLowerCase().includes(S))return!1}return!0}),[x,s,l,d,m]);return t?r.jsx(at,{label:"Loading resources…"}):n?r.jsx(et,{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(qs,{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:d,onChange:w=>f(w.target.value),className:"editor-input max-w-[160px]",children:[r.jsx("option",{value:"all",children:"All categories"}),v.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:m,onChange:w=>g(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(we,{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(Ht,{className:"h-4 w-4"}),"New Resource"]})]}),k.length===0?r.jsx(ot,{title:x.length===0?"No resources yet":"No resources match these filters",description:x.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:x.length===0?r.jsxs(we,{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(Ht,{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:k.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(we,{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(we,{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:qr(w.updated)})]},`${w.projectSlug}/${w.slug}`))})]})})]})}function h5(){const{slug:e,itemSlug:t}=jt(),n=Et(),{data:s,loading:a,error:l}=X2(e,t),[c,d]=p.useState(!1),[f,m]=p.useState(!1);async function g(){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(at,{label:"Loading resource…"}):l?r.jsx(et,{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(we,{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 ",Kr(s.created)]}),r.jsxs("span",{children:["Updated ",Kr(s.updated)]})]})]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsxs(we,{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:g,disabled:f,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:f?"Deleting…":"Confirm"}),r.jsx("button",{type:"button",onClick:()=>d(!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:()=>d(!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(zn,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(Ut,{content:s.body})})]}):null}function g5(){const e=Et(),[t]=Xr(),n=t.get("project"),{data:s,loading:a,error:l}=ji(),[c,d]=p.useState(n??""),[f,m]=p.useState(""),[g,x]=p.useState(""),[y,v]=p.useState(!1),[E,k]=p.useState(null);p.useEffect(()=>{!c&&s&&s.length>0&&d(n??s[0].slug)},[s,n,c]);async function w(S){if(S.preventDefault(),!(!c||!f.trim())){v(!0),k(null);try{const T=await fetch(`/api/projects/${c}/resources`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f.trim(),body:g||void 0})}),N=await T.json();if(!T.ok){k(N.error||`HTTP ${T.status}`),v(!1);return}e(`/projects/${N.projectSlug}/resources/${N.slug}`)}catch(T){k(T.message),v(!1)}}}return a?r.jsx(at,{label:"Loading projects…"}):l?r.jsx(et,{error:l}):!s||s.length===0?r.jsx(et,{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:S=>d(S.target.value),className:"editor-input",required:!0,children:s.map(S=>r.jsx("option",{value:S.slug,children:S.title},S.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:f,onChange:S=>m(S.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:g,onChange:S=>x(S.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||!f.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 x5(){const{slug:e,itemSlug:t}=jt();return r.jsx(Di,{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 y5({value:e,onChange:t}){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"color",value:e||"#64748b",onChange:n=>t(n.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"}),r.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),placeholder:"#64748b",className:"editor-input w-[5.5rem] font-mono text-xs"})]})}const rm=["projects","playbooks","todos","servers","config"];function v5(e){const t=new Set;for(const n of e.split(",").map(s=>s.trim()))rm.includes(n)&&t.add(n);return t}function Gb(e){if(!e)return"never";try{return new Date(e).toLocaleString()}catch{return e}}function b5(){const[e,t]=p.useState(!0),[n,s]=p.useState(null),[a,l]=p.useState(""),[c,d]=p.useState(new Set(rm)),[f,m]=p.useState(!1),[g,x]=p.useState(!1),[y,v]=p.useState(null),[E,k]=p.useState(null),w=p.useCallback(async()=>{try{const R=await fetch("/api/backup");if(!R.ok)throw new Error(`HTTP ${R.status}`);const I=await R.json();s(I),l(I.repo??""),d(v5(I.categories)),m(!1)}catch(R){k({type:"error",message:`Failed to load backup config: ${R instanceof Error?R.message:String(R)}`})}finally{t(!1)}},[]);p.useEffect(()=>{w()},[w]);function S(R){d(I=>{const O=new Set(I);return O.has(R)?O.delete(R):O.add(R),O}),m(!0)}async function T(){x(!0),k(null);try{const R=Array.from(c),I=await fetch("/api/backup/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:a.trim()||null,categories:R})}),O=await I.json();if(!I.ok)throw new Error(O.error||`HTTP ${I.status}`);s(O),m(!1),k({type:"success",message:"Backup configuration saved."})}catch(R){k({type:"error",message:`Save failed: ${R instanceof Error?R.message:String(R)}`})}finally{x(!1)}}async function N(){v("push"),k(null);try{const R=await fetch("/api/backup/push",{method:"POST"}),I=await R.json();if(!R.ok||I.success===!1)throw new Error(I.error||I.message||`HTTP ${R.status}`);k({type:"success",message:I.message||"Backup complete."}),await w()}catch(R){k({type:"error",message:`Backup failed: ${R instanceof Error?R.message:String(R)}`})}finally{v(null)}}async function A(){if(window.confirm("Restore will overwrite local files for the selected categories with the contents of the GitHub repo. This cannot be undone. Continue?")){v("pull"),k(null);try{const I=await fetch("/api/backup/pull",{method:"POST"}),O=await I.json();if(!I.ok||O.success===!1)throw new Error(O.error||O.message||`HTTP ${I.status}`);k({type:"success",message:O.message||"Restore complete."}),await w()}catch(I){k({type:"error",message:`Restore failed: ${I instanceof Error?I.message:String(I)}`})}finally{v(null)}}}if(e)return r.jsx(Le,{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 M=!!a.trim()&&c.size>0&&!y&&!f;return r.jsx(Le,{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:rm.map(R=>{const I=c.has(R);return r.jsxs("button",{type:"button",onClick:()=>S(R),className:`shell-action text-xs ${I?"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 ${I?"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: "}),Gb((n==null?void 0:n.lastBackup)??null)]}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-foreground",children:"Last restore: "}),Gb((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:T,disabled:g||!f,children:[r.jsx(xu,{className:"h-3.5 w-3.5"}),g?"Saving...":"Save Config"]}),r.jsxs("button",{className:"shell-action",onClick:N,disabled:!M,title:M?"Back up now":f?"Save config first":"Set repo and pick categories",children:[r.jsx(YE,{className:"h-3.5 w-3.5"}),y==="push"?"Backing up...":"Back Up Now"]}),r.jsxs("button",{className:"shell-action",onClick:A,disabled:!M,title:M?"Restore from backup":f?"Save config first":"Set repo and pick categories",children:[r.jsx(TE,{className:"h-3.5 w-3.5"}),y==="pull"?"Restoring...":"Restore"]}),f&&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(EE,{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 w5(){const{customBindings:e,userBindings:t,actionEntries:n,findConflict:s,bindAction:a,unbindAction:l}=Ks(),[c,d]=p.useState(null),[f,m]=p.useState(null),[g,x]=p.useState(!1),y=Object.values(t).some(N=>typeof N=="string"&&N.length>0);function v(N,A){m({type:N,message:A}),setTimeout(()=>m(null),2500)}function E(N){d({kind:N,combo:null,conflict:null,saving:!1,error:null})}function k(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 A=Yw(N.nativeEvent);if(!A)return;const M=s(A,c.kind);d({...c,combo:A,conflict:M,error:null})}async function w(){var N;if(c!=null&&c.combo){if((N=c.conflict)!=null&&N.description){d({...c,error:`Reserved: ${c.conflict.description}`});return}d({...c,saving:!0,error:null});try{await a(c.kind,c.combo),d(null),v("success",`Bound ${ga[c.kind]}`)}catch(A){d({...c,saving:!1,error:A instanceof Error?A.message:"Failed to save"})}}}async function S(N){try{await l(N),v("success",`Cleared ${ga[N]} binding`)}catch(A){v("error",A instanceof Error?A.message:"Failed to clear binding")}}async function T(){if(!g){x(!0);try{await hR(),v("success","All hotkey bindings cleared")}catch(N){v("error",N instanceof Error?N.message:"Failed to reset bindings")}finally{x(!1)}}}return r.jsxs(Le,{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 T(),disabled:g,children:[r.jsx(za,{className:"h-3 w-3"}),"Restore defaults"]}):void 0,children:[f?r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${f.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:f.message}):null,r.jsx("ul",{className:"space-y-2",children:bu.map(N=>{var O,Y;const A=n.find(J=>J.bindableKind===N),M=e[N],R=typeof t[N]=="string"&&!!t[N],I=(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(Ep,{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:(A==null?void 0:A.title)??ga[N]}),A!=null&&A.subtitle?r.jsx("div",{className:"text-xs text-muted-foreground",children:A.subtitle}):null]}),M?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:Hr(M)}),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:M?"Rebind":"Bind"}),R?r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:()=>void S(N),"aria-label":`Restore default ${ga[N]} binding`,children:[r.jsx(km,{className:"h-3 w-3"}),"Restore default"]}):null]}),I?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:k,onBlur:()=>{(c==null?void 0:c.kind)===N&&!c.saving&&d(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:Hr(c.combo)}),(O=c.conflict)!=null&&O.description?r.jsxs("div",{className:"text-xs text-destructive",children:["Reserved: ",c.conflict.description]}):(Y=c.conflict)!=null&&Y.kind?r.jsxs("div",{className:"text-xs text-amber-500 dark:text-amber-400",children:['Already bound to "',ga[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 j5={kanban:"Kanban",list:"List",table:"Table"},k5={comfortable:"Comfortable",compact:"Compact"},S5={title:"Title",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",updated:"Updated"},N5={asc:"Ascending",desc:"Descending"};function C5(){const e=w_(),t=e.global,[n,s]=p.useState(!1),[a,l]=p.useState(null);function c(m,g){l({type:m,message:g}),setTimeout(()=>l(null),2e3)}async function d(m,g){if(t[m]!==g){s(!0);try{await v1({[m]:g}),c("success","Saved")}catch(x){c("error",x instanceof Error?x.message:"Failed to save")}finally{s(!1)}}}async function f(){if(e.custom){s(!0);try{await j_(),c("success","Reset to defaults")}catch(m){c("error",m instanceof Error?m.message:"Failed to reset")}finally{s(!1)}}}return r.jsxs(Le,{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:f,disabled:n,children:[r.jsx(za,{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:p1.map(m=>r.jsx("button",{type:"button",onClick:()=>d("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:j5[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:g_.map(m=>r.jsx("button",{type:"button",onClick:()=>d("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:k5[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=>d("sortField",m.target.value),disabled:n,className:"editor-input max-w-[220px]",children:m_.map(m=>r.jsx("option",{value:m,children:S5[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:h_.map(m=>r.jsx("button",{type:"button",onClick:()=>d("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:N5[m]},m))})]})]})]})}const E5=/^[a-z0-9][a-z0-9_-]*$/,A1=["first","last","none"];class D1 extends Error{constructor(n,s){super(n);jy(this,"fieldErrors");this.name="AgentsConfigError",this.fieldErrors=s}}const Kh={agents:[],custom:!1};let ri=null,ti=null,pu=0;const sm=new Set;function I1(e){ri=e;for(const t of sm)t(e)}function T5(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"&&A1.includes(t.promptArgPosition)&&(n.promptArgPosition=t.promptArgPosition),typeof t.resolveFromShellAliases=="boolean"&&(n.resolveFromShellAliases=t.resolveFromShellAliases),typeof t.default=="boolean"&&(n.default=t.default),n}function Gh(e){if(!e||typeof e!="object")return Kh;const t=e,n=Array.isArray(t.agents)?t.agents:[],s=[];for(const a of n){const l=T5(a);l&&s.push(l)}return{agents:s,custom:t.custom===!0}}function P5(){if(ri)return Promise.resolve(ri);if(ti)return ti;const e=++pu;return ti=fetch("/api/config/agents").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{ti=null;const n=Gh(t);return e!==pu?ri??n:(ri=n,n)}).catch(()=>(ti=null,Kh)),ti}function R5(){const[e,t]=p.useState(()=>ri??Kh);return p.useEffect(()=>{let n=!1;return P5().then(s=>{n||t(s)}),sm.add(t),()=>{n=!0,sm.delete(t)}},[]),e}async function O1(e){const t=await e.json().catch(()=>null),n=(t==null?void 0:t.error)??`HTTP ${e.status}`;return new D1(n,t==null?void 0:t.fieldErrors)}async function A5(e){++pu;const t=await fetch("/api/config/agents",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:e})});if(!t.ok)throw await O1(t);const n=Gh(await t.json());return I1(n),n}async function D5(){++pu;const e=await fetch("/api/config/agents",{method:"DELETE"});if(!e.ok)throw await O1(e);const t=Gh(await e.json());return I1(t),t}const I5={first:"first",last:"last",none:"none"};function L1(){return`row_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function ka(e){return e.map(t=>({rowKey:L1(),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,fieldErrors:{}}))}function O5(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),n})}function L5(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 $5(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 M5(e){return e.map(t=>Object.keys(t.fieldErrors).length===0?t:{...t,fieldErrors:{}})}function _5(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)return!1}return!0}function F5({row:e,index:t,canRemove:n,onPatch:s,onSetDefault:a,onRemove:l}){const{attributes:c,listeners:d,setNodeRef:f,setActivatorNodeRef:m,transform:g,transition:x,isDragging:y}=_h({id:e.rowKey}),v={transform:xo.Transform.toString(g),transition:x,zIndex:y?50:void 0,position:y?"relative":void 0};function E(S){const T={label:S};if(e.autoSlugFromLabel){const N=Xn(S);N&&E5.test(N)?T.id=N:T.id=`agent-${t+1}`}s(T)}function k(S){s({id:S,autoSlugFromLabel:!1})}const w=S=>e.fieldErrors[S]?"border-error-foreground/60":"";return r.jsxs("div",{ref:f,style:v,className:`surface-panel space-y-2 px-3 py-2 ${y?"opacity-60 shadow-lg":""}`,children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{ref:m,...c,...d,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(xm,{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:a,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:S=>k(S.target.value),className:`editor-input w-32 font-mono text-xs ${w("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:l,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(zn,{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:S=>E(S.target.value),className:`editor-input mt-0.5 w-full ${w("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:S=>s({command:S.target.value}),className:`editor-input mt-0.5 w-full font-mono ${w("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:S=>s({argsText:S.target.value}),className:`editor-input mt-0.5 w-full font-mono ${w("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:S=>s({promptArgPosition:S.target.value}),className:`editor-input mt-0.5 w-full ${w("promptArgPosition")}`,children:A1.map(S=>r.jsx("option",{value:S,children:I5[S]},S))}),e.fieldErrors.promptArgPosition&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.promptArgPosition})]}),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:S=>s({resolveFromShellAliases:S.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 z5(){const e=R5(),[t,n]=p.useState(()=>ka(e.agents)),[s,a]=p.useState(()=>ka(e.agents)),[l,c]=p.useState(!1),[d,f]=p.useState(null),[m,g]=p.useState(null);p.useEffect(()=>{const R=ka(e.agents);n(R),a(R),f(null)},[e.agents]);const x=p.useMemo(()=>!_5(t,s),[t,s]),y=Rh(gi(ul,{activationConstraint:{distance:8}}),gi(cl));function v(R,I){g({type:R,message:I}),setTimeout(()=>g(null),2500)}function E(R,I){n(O=>O.map(Y=>Y.rowKey===R?{...Y,...I,fieldErrors:B5(Y.fieldErrors,I)}:Y))}function k(R){n(I=>I.map(O=>({...O,default:O.rowKey===R})))}function w(){n(R=>{const I=new Set(R.map(X=>X.id)),O="new-agent";let Y=O,J=1;for(;I.has(Y);)J+=1,Y=`${O}-${J}`;const _=J===1?"New Agent":`New Agent ${J}`,U={rowKey:L1(),id:Y,originalId:null,isNew:!0,idEditable:!0,autoSlugFromLabel:!0,label:_,command:"",argsText:"",promptArgPosition:"first",resolveFromShellAliases:!1,default:!1,fieldErrors:{}};return[...R,U]})}function S(R){n(I=>I.filter(O=>O.rowKey!==R))}async function T(){c(!0),f(null);try{const R=L5(t),I=O5(R),O=await A5(I),Y=ka(O.agents);n(Y),a(Y),v("success","Agents saved")}catch(R){if(R instanceof D1)f(R.message),n(I=>$5(M5(I),R.fieldErrors)),v("error",R.message);else{const I=R instanceof Error?R.message:"Failed to save";f(I),v("error",I)}}finally{c(!1)}}function N(){n(s),f(null)}async function A(){if(e.custom&&window.confirm("Reset agents to built-in defaults? Any custom agents will be deleted from your config.")){c(!0),f(null);try{const R=await D5(),I=ka(R.agents);n(I),a(I),v("success","Reset to defaults")}catch(R){const I=R instanceof Error?R.message:"Failed to reset";f(I),v("error",I)}finally{c(!1)}}}function M(R){const{active:I,over:O}=R;!O||I.id===O.id||n(Y=>{const J=Y.findIndex(U=>U.rowKey===I.id),_=Y.findIndex(U=>U.rowKey===O.id);return J===-1||_===-1?Y:dl(Y,J,_)})}return r.jsxs(Le,{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:A,disabled:l,children:[r.jsx(za,{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(ym,{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"}),"."]})]}),m&&r.jsx("div",{className:`rounded-md border px-3 py-1.5 text-xs ${m.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:m.message}),d&&(!m||m.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:d}),r.jsx(Lh,{sensors:y,collisionDetection:Ah,onDragEnd:M,children:r.jsx(Mh,{items:t.map(R=>R.rowKey),strategy:$h,children:r.jsx("div",{className:"space-y-2",children:t.map((R,I)=>r.jsx(F5,{row:R,index:I,canRemove:t.length>1,onPatch:O=>E(R.rowKey,O),onSetDefault:()=>k(R.rowKey),onRemove:()=>S(R.rowKey)},R.rowKey))})})}),r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[r.jsxs("button",{type:"button",onClick:w,disabled:l,className:"shell-action text-xs",children:[r.jsx(Ht,{className:"h-3 w-3"}),"Add agent"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:N,disabled:!x||l,className:"shell-action text-xs",children:"Discard"}),r.jsxs("button",{type:"button",onClick:T,disabled:!x||l,className:"shell-action text-xs",children:[r.jsx(xu,{className:"h-3 w-3"}),"Save"]})]})]})]})}function B5(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,n}function wp(e){return{statuses:e.statuses.map(t=>({id:t.id,label:t.label,description:t.description??"",color:t.color??"",terminal:t.terminal??!1})),order:[...e.order]}}function U5(){const[e,t]=p.useState(!0),[n,s]=p.useState(null),[a,l]=p.useState(!1),[c,d]=p.useState([]),[f,m]=p.useState([]),[g,x]=p.useState(!1),[y,v]=p.useState(null),[E,k]=p.useState(!1),{preset:w,setPreset:S,resetPreset:T}=Em(),[N,A]=p.useState(!1),[M,R]=p.useState(null);async function I(W){if(!(W===w||N)){A(!0),R(null);try{await S(W),R({type:"success",message:"Theme updated"}),setTimeout(()=>R(null),2e3)}catch(D){R({type:"error",message:D instanceof Error?D.message:"Failed to save theme"})}finally{A(!1)}}}async function O(){A(!0),R(null);try{await T(),R({type:"success",message:"Theme reset to default"}),setTimeout(()=>R(null),2e3)}catch(W){R({type:"error",message:W instanceof Error?W.message:"Failed to reset theme"})}finally{A(!1)}}const Y=p.useCallback(async()=>{try{const W=await fetch("/api/config/statuses");if(!W.ok)throw new Error(`HTTP ${W.status}`);const D=await W.json(),ee=wp(D);d(ee.statuses),m(ee.order),l(D.custom),k(!1),s(null)}catch(W){s(W instanceof Error?W.message:"Failed to load config")}finally{t(!1)}},[]);p.useEffect(()=>{Y()},[Y]);function J(){setTimeout(()=>v(null),3e3)}async function _(){x(!0),v(null);try{const W={statuses:c.map($=>({id:$.id,label:$.label,...$.description?{description:$.description}:{},...$.color?{color:$.color}:{},...$.terminal?{terminal:!0}:{}})),order:f,transitions:[]},D=await fetch("/api/config/statuses",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)});if(!D.ok){const $=await D.json().catch(()=>({error:"Unknown error"}));throw new Error($.error??"Save failed")}const ee=await D.json(),C=wp(ee);d(C.statuses),m(C.order),l(ee.custom),k(!1),kv(),v({type:"success",message:"Status config saved"}),J()}catch(W){v({type:"error",message:W instanceof Error?W.message:"Save failed"})}finally{x(!1)}}async function U(){x(!0),v(null);try{const W=await fetch("/api/config/statuses",{method:"DELETE"});if(!W.ok)throw new Error("Reset failed");const D=await W.json(),ee=wp(D);d(ee.statuses),m(ee.order),l(D.custom),k(!1),kv(),v({type:"success",message:"Reset to defaults"}),J()}catch(W){v({type:"error",message:W instanceof Error?W.message:"Reset failed"})}finally{x(!1)}}function X(W,D,ee){d(C=>{const $=[...C];if($[W]={...$[W],[D]:ee},D==="id"&&typeof ee=="string"){const Z=C[W].id;m(L=>L.map(ae=>ae===Z?ee:ae))}return $}),k(!0)}function q(){const W=`status_${c.length+1}`;d(D=>[...D,{id:W,label:"New Status",description:"",color:"",terminal:!1}]),m(D=>[...D,W]),k(!0)}function G(W){const D=c[W].id;d(ee=>ee.filter((C,$)=>$!==W)),m(ee=>ee.filter(C=>C!==D)),k(!0)}function B(W,D){const ee=W+D;ee<0||ee>=f.length||(m(C=>{const $=[...C];return[$[W],$[ee]]=[$[ee],$[W]],$}),k(!0))}return e?r.jsx(at,{label:"Loading settings..."}):n?r.jsx(et,{error:n}):r.jsx(po,{children:r.jsxs("div",{className:"space-y-6",children:[r.jsxs(Le,{title:"Theme",description:"Pick a color theme for the dashboard. The default is the Syntaur brand.",actions:w!=="default"?r.jsxs("button",{className:"shell-action text-xs",onClick:O,disabled:N,children:[r.jsx(za,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[M&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${M.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:M.message}),r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:Lw.map(W=>{const D=W.slug===w;return r.jsxs("button",{type:"button",onClick:()=>I(W.slug),disabled:N,"aria-pressed":D,className:`group relative flex flex-col gap-2 rounded-lg border bg-card/95 p-3 text-left transition disabled:opacity-60 ${D?"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:W.swatches.primary}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:W.swatches.secondary}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:W.swatches.coral}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:W.swatches.teal}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:W.swatches.amber}}),D&&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(vi,{className:"h-3 w-3"})})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-medium text-foreground",children:W.label}),r.jsx("div",{className:"text-xs text-muted-foreground",children:W.description})]})]},W.slug)})})]}),r.jsx(w5,{}),r.jsx(z5,{}),r.jsx(C5,{}),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(ym,{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:U,disabled:g||!a&&!E,children:[r.jsx(za,{className:"h-3 w-3"}),"Reset to Defaults"]})]}),y&&r.jsx("div",{className:`rounded-lg border px-4 py-2 text-sm ${y.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:y.message}),r.jsx(Le,{title:"Status Definitions",description:"Define the statuses assignments can have",actions:r.jsxs("button",{className:"shell-action text-xs",onClick:q,children:[r.jsx(Ht,{className:"h-3 w-3"}),"Add Status"]}),children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/50 text-left text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[r.jsx("th",{className:"pb-2 pr-3",children:"ID"}),r.jsx("th",{className:"pb-2 pr-3",children:"Label"}),r.jsx("th",{className:"pb-2 pr-3",children:"Color"}),r.jsx("th",{className:"pb-2 pr-3",children:r.jsxs(zr,{children:[r.jsx(Br,{asChild:!0,children:r.jsx("span",{className:"cursor-help underline decoration-dotted underline-offset-4",children:"Done State"})}),r.jsx(wr,{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("th",{className:"pb-2 w-10"})]})}),r.jsx("tbody",{className:"divide-y divide-border/30",children:c.map((W,D)=>r.jsxs("tr",{children:[r.jsx("td",{className:"py-2 pr-3",children:r.jsx("input",{type:"text",value:W.id,onChange:ee=>X(D,"id",ee.target.value),className:"editor-input w-full text-sm"})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsx("input",{type:"text",value:W.label,onChange:ee=>X(D,"label",ee.target.value),className:"editor-input w-full text-sm"})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsx(y5,{value:W.color,onChange:ee=>X(D,"color",ee)})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsx("button",{type:"button",role:"switch","aria-checked":W.terminal,onClick:()=>X(D,"terminal",!W.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 ${W.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 ${W.terminal?"translate-x-4":"translate-x-0"}`})})}),r.jsx("td",{className:"py-2",children:r.jsx("button",{className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>G(D),title:"Remove status",children:r.jsx(zn,{className:"h-3.5 w-3.5"})})})]},D))})]})})}),r.jsx(Le,{title:"Status Order",description:"Controls display order in the dashboard (Kanban columns, progress bars, dropdowns)",children:r.jsx("div",{className:"space-y-1",children:f.map((W,D)=>{var C;const ee=((C=c.find($=>$.id===W))==null?void 0:C.label)??W;return r.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/60 px-3 py-2 text-sm",children:[r.jsx("span",{className:"mr-1 font-mono text-xs text-muted-foreground/60",children:D+1}),r.jsx("span",{className:"flex-1 font-medium",children:ee}),r.jsx("span",{className:"text-xs text-muted-foreground",children:W}),r.jsx("button",{className:"inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30",onClick:()=>B(D,-1),disabled:D===0,title:"Move up",children:r.jsx(bw,{className:"h-3.5 w-3.5"})}),r.jsx("button",{className:"inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30",onClick:()=>B(D,1),disabled:D===f.length-1,title:"Move down",children:r.jsx(_a,{className:"h-3.5 w-3.5"})})]},D)})})}),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:_,disabled:g||!E,children:[r.jsx(xu,{className:"h-3.5 w-3.5"}),g?"Saving...":"Save Configuration"]}),E&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"shell-action text-xs",onClick:()=>{t(!0),Y()},disabled:g,children:"Discard Changes"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Unsaved changes"})]})]}),r.jsx(b5,{})]})})}const ni=e=>`${e.workspace}::${e.id}`;function Yb(e){if(e.includes("/")){const[t,n]=e.split("/");return`/projects/${t}/assignments/${n}`}return`/assignments/${e}`}function H5(){var le;const{data:e,loading:t,error:n,refetch:s}=Xw(),a=Et(),[l,c]=p.useState(""),d=p.useRef(null);Gs("list:todos");const[f,m]=p.useState(""),[g,x]=p.useState(""),[y,v]=p.useState(""),[E,k]=p.useState("_global"),[w,S]=p.useState(null),[T,N]=p.useState(new Set),[A,M]=p.useState(!1),R=p.useRef(null),[I,O]=p.useState(null);p.useEffect(()=>{let H=!1;return(async()=>{try{const fe=await fetch("/api/projects");if(!fe.ok)return;const ve=await fe.json();H||O(ve.filter(_e=>!_e.archived))}catch{}})(),()=>{H=!0}},[]);function Y(H,fe){H.stopPropagation(),navigator.clipboard.writeText(fe),S(fe),setTimeout(()=>S(ve=>ve===fe?null:ve),1500)}const J=p.useMemo(()=>{if(!(e!=null&&e.workspaces))return[];const H=[];for(const fe of e.workspaces)for(const ve of fe.items)H.push({...ve,workspace:fe.workspace});return H},[e]),_=p.useMemo(()=>{const H=new Set;for(const fe of J)for(const ve of fe.tags)H.add(ve);return Array.from(H).sort()},[J]),U=p.useMemo(()=>{let H=J;if(l.trim()){const fe=l.toLowerCase();H=H.filter(ve=>ve.description.toLowerCase().includes(fe)||ve.tags.some(_e=>_e.toLowerCase().includes(fe))||ve.id.includes(fe))}return f&&(H=H.filter(fe=>fe.status===f)),g&&(H=H.filter(fe=>fe.tags.includes(g))),H},[J,l,f,g]);p.useEffect(()=>{N(new Set),R.current=null},[l,f,g]);const X=p.useMemo(()=>U.filter(H=>T.has(ni(H))),[U,T]),q=U.length>0&&X.length===U.length,G=X.length>0&&!q,B=p.useMemo(()=>{if(X.length===0)return null;const H=new Set(X.map(fe=>fe.workspace));return H.size===1?[...H][0]:null},[X]),W=p.useMemo(()=>{if(!B||!I)return;const H=I.filter(fe=>fe.workspace===B);return H.length===1?H[0].slug:void 0},[B,I]),D=((le=X[0])==null?void 0:le.description)??"",ee=p.useMemo(()=>{if(B)return null;const H=new Map;for(const fe of X)H.has(fe.workspace)||H.set(fe.workspace,[]),H.get(fe.workspace).push(fe.id);return Array.from(H,([fe,ve])=>({workspace:fe,todoIds:ve}))},[X,B]),C=B?{kind:"workspace",workspace:B}:{kind:"aggregate",groups:ee??[]};function $(H,fe,ve){const _e=ni(H);if(!!(ve&&"shiftKey"in ve&&ve.shiftKey)&&R.current!=null){const st=Math.min(R.current,fe),lt=Math.max(R.current,fe);N(_t=>{const kt=new Set(_t);for(let St=st;St<=lt;St++){const se=U[St];se&&kt.add(ni(se))}return kt})}else N(st=>{const lt=new Set(st);return lt.has(_e)?lt.delete(_e):lt.add(_e),lt});R.current=fe}function Z(){N(H=>{const fe=new Set(H);if(q)for(const ve of U)fe.delete(ni(ve));else for(const ve of U)fe.add(ni(ve));return fe})}function L(){N(new Set),R.current=null}function ae(H){L(),s(),H!=null&&H.assignmentRef&&a(Yb(H.assignmentRef))}const ce=p.useMemo(()=>{if(!(e!=null&&e.workspaces))return{open:0,in_progress:0,completed:0,blocked:0,total:0};const H={open:0,in_progress:0,completed:0,blocked:0,total:0};for(const fe of e.workspaces)H.open+=fe.counts.open,H.in_progress+=fe.counts.in_progress,H.completed+=fe.counts.completed,H.blocked+=fe.counts.blocked,H.total+=fe.counts.total;return H},[e]);async function Q(){y.trim()&&(await Pm(E,y.trim()),v(""),s())}const ge={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function je(H,fe,ve){Ne(H,fe,ge[ve]||"open")}async function Ne(H,fe,ve){switch(ve){case"open":await e0(H,fe);break;case"in_progress":await Zw(H,fe);break;case"completed":await Jw(H,fe);break;case"blocked":await Qw(H,fe);break}s()}async function ke(H,fe){await t0(H,fe),s()}const{hotkeyRowProps:Ve}=el(U,{scope:"list:todos",bindO:!1,onOpen:H=>je(H.workspace,H.id,H.status)});pt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var H;return(H=d.current)==null?void 0:H.focus()}}),pt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>s()});const[Ye,ie]=Xr(),ne=Ye.get("focus");return p.useEffect(()=>{if(!ne)return;const H=document.querySelector(`[data-todo-id="${CSS.escape(ne)}"]`);if(!H)return;H.scrollIntoView({block:"nearest"}),H.classList.add("ring-2","ring-primary/60");const fe=window.setTimeout(()=>{H.classList.remove("ring-2","ring-primary/60"),ie(ve=>{const _e=new URLSearchParams(ve);return _e.delete("focus"),_e})},1500);return()=>window.clearTimeout(fe)},[ne,U.length,ie]),t?r.jsx(at,{label:"Loading todos..."}):n?r.jsx(et,{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(mn,{label:"Open",value:ce.open,icon:cr}),r.jsx(mn,{label:"In Progress",value:ce.in_progress,icon:vm,tone:"info"}),r.jsx(mn,{label:"Blocked",value:ce.blocked,icon:jm,tone:"warn"}),r.jsx(mn,{label:"Completed",value:ce.completed,icon:cr,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:H=>k(H.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(H=>H.workspace!=="_global").map(H=>r.jsx("option",{value:H.workspace,children:H.workspace},H.workspace))]}),r.jsx("input",{type:"text",placeholder:"Add a todo...",value:y,onChange:H=>v(H.target.value),onKeyDown:H=>H.key==="Enter"&&Q(),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:Q,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(Ht,{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(qs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:d,type:"text",placeholder:"Search todos...",value:l,onChange:H=>c(H.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:f,onChange:H=>m(H.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"})]}),_.length>0&&r.jsxs("select",{value:g,onChange:H=>x(H.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"}),_.map(H=>r.jsxs("option",{value:H,children:["#",H]},H))]})]}),X.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:[X.length," selected",B?r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(from ",r.jsx("strong",{children:B}),")"]}):r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["across ",new Set(X.map(H=>H.workspace)).size," workspaces"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>M(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote to assignment"}),r.jsx("button",{type:"button",onClick:L,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,U.length===0?r.jsx(ot,{title:"No todos",description:"Add your first todo above or use the CLI: syntaur todo add"}):r.jsxs(r.Fragment,{children:[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:q,ref:H=>{H&&(H.indeterminate=G)},onChange:Z,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",U.length,")"]}),r.jsx("span",{className:"text-muted-foreground/60",children:"— shift-click for range select"})]}),r.jsx("div",{className:"space-y-1",children:U.map((H,fe)=>{const ve=ni(H),_e=T.has(ve);return r.jsxs("div",{"data-todo-id":H.id,...Ve(fe),className:`surface-panel flex items-center gap-3 px-3 py-2 group cursor-pointer hover:bg-foreground/[0.03] transition ${_e?"ring-1 ring-foreground/20":""}`,onClick:()=>je(H.workspace,H.id,H.status),children:[r.jsx("input",{type:"checkbox","aria-label":`Select todo ${H.id}`,checked:_e,onChange:()=>{},onClick:Ie=>{Ie.stopPropagation(),$(H,fe,Ie)},className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsx(Fh,{status:H.status,onChange:Ie=>Ne(H.workspace,H.id,Ie)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:`text-sm ${H.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:H.description}),H.tags.length>0&&r.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:H.tags.map(Ie=>`#${Ie}`).join(" ")}),H.linkedAssignmentRef?r.jsxs(we,{to:Yb(H.linkedAssignmentRef),className:"ml-2 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:Ie=>Ie.stopPropagation(),children:[r.jsx(yw,{className:"h-2.5 w-2.5"}),H.linkedAssignmentRef.includes("/")?H.linkedAssignmentRef:`oneoff:${H.linkedAssignmentRef.slice(0,8)}`]}):null]}),r.jsx("span",{className:"text-xs text-muted-foreground/60 font-mono",children:H.workspace!=="_global"&&r.jsx(we,{to:`/w/${H.workspace}/todos`,className:"hover:text-foreground transition mr-2",onClick:Ie=>Ie.stopPropagation(),children:H.workspace})}),w===H.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(vi,{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:Ie=>Y(Ie,H.id),children:["t:",H.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:Ie=>Y(Ie,H.id),children:r.jsx(Fa,{className:"h-3 w-3"})})]}),r.jsx("button",{onClick:Ie=>{Ie.stopPropagation(),ke(H.workspace,H.id)},className:"text-xs text-muted-foreground/40 hover:text-destructive transition opacity-0 group-hover:opacity-100",children:"delete"})]},`${H.workspace}-${H.id}`)})})]}),r.jsx(zh,{open:A,selectedIds:X.map(H=>H.id),scope:C,onOpenChange:M,onDone:ae,defaultProject:W,defaultTitle:D,allowOneOff:!0})]})}function W5(){return r.jsx(iE,{children:r.jsx(xR,{children:r.jsx(LC,{children:r.jsxs(Oe,{element:r.jsx(_R,{}),children:[r.jsx(Oe,{path:"/",element:r.jsx(iD,{})}),r.jsx(Oe,{path:"/projects",element:r.jsx(Nv,{})}),r.jsx(Oe,{path:"/assignments",element:r.jsx(Fb,{})}),r.jsx(Oe,{path:"/assignments/new",element:r.jsx(Hb,{})}),r.jsx(Oe,{path:"/assignments/:id",element:r.jsx(I_,{})}),r.jsx(Oe,{path:"/assignments/:id/edit",element:r.jsx(gp,{})}),r.jsx(Oe,{path:"/assignments/:id/plan/edit",element:r.jsx(xp,{})}),r.jsx(Oe,{path:"/assignments/:id/scratchpad/edit",element:r.jsx(yp,{})}),r.jsx(Oe,{path:"/assignments/:id/handoff/edit",element:r.jsx(vp,{})}),r.jsx(Oe,{path:"/assignments/:id/decision-record/edit",element:r.jsx(bp,{})}),r.jsx(Oe,{path:"/servers",element:r.jsx(Vb,{})}),r.jsx(Oe,{path:"/inventories",element:r.jsx(qb,{})}),r.jsx(Oe,{path:"/agent-sessions",element:r.jsx(Kb,{})}),r.jsx(Oe,{path:"/playbooks",element:r.jsx(i5,{})}),r.jsx(Oe,{path:"/playbooks/create",element:r.jsx(l5,{})}),r.jsx(Oe,{path:"/playbooks/:slug",element:r.jsx(a5,{})}),r.jsx(Oe,{path:"/playbooks/:slug/edit",element:r.jsx(c5,{})}),r.jsx(Oe,{path:"/memories",element:r.jsx(u5,{})}),r.jsx(Oe,{path:"/memories/new",element:r.jsx(f5,{})}),r.jsx(Oe,{path:"/projects/:slug/memories/:itemSlug",element:r.jsx(d5,{})}),r.jsx(Oe,{path:"/projects/:slug/memories/:itemSlug/edit",element:r.jsx(p5,{})}),r.jsx(Oe,{path:"/resources",element:r.jsx(m5,{})}),r.jsx(Oe,{path:"/resources/new",element:r.jsx(g5,{})}),r.jsx(Oe,{path:"/projects/:slug/resources/:itemSlug",element:r.jsx(h5,{})}),r.jsx(Oe,{path:"/projects/:slug/resources/:itemSlug/edit",element:r.jsx(x5,{})}),r.jsx(Oe,{path:"/todos",element:r.jsx(H5,{})}),r.jsx(Oe,{path:"/help",element:r.jsx(cD,{})}),r.jsx(Oe,{path:"/settings",element:r.jsx(U5,{})}),r.jsx(Oe,{path:"/create/project",element:r.jsx(Bb,{})}),r.jsx(Oe,{path:"/projects/:slug",element:r.jsx(Ib,{})}),r.jsx(Oe,{path:"/projects/:slug/edit",element:r.jsx(Wb,{})}),r.jsx(Oe,{path:"/projects/:slug/create/assignment",element:r.jsx(Ub,{})}),r.jsx(Oe,{path:"/projects/:slug/assignments/:aslug",element:r.jsx(Ob,{})}),r.jsx(Oe,{path:"/projects/:slug/assignments/:aslug/edit",element:r.jsx(gp,{})}),r.jsx(Oe,{path:"/projects/:slug/assignments/:aslug/plan/edit",element:r.jsx(xp,{})}),r.jsx(Oe,{path:"/projects/:slug/assignments/:aslug/scratchpad/edit",element:r.jsx(yp,{})}),r.jsx(Oe,{path:"/projects/:slug/assignments/:aslug/handoff/edit",element:r.jsx(vp,{})}),r.jsx(Oe,{path:"/projects/:slug/assignments/:aslug/decision-record/edit",element:r.jsx(bp,{})}),r.jsx(Oe,{path:"/w/:workspace/projects",element:r.jsx(Nv,{})}),r.jsx(Oe,{path:"/w/:workspace/assignments",element:r.jsx(Fb,{})}),r.jsx(Oe,{path:"/w/:workspace/assignments/new",element:r.jsx(Hb,{})}),r.jsx(Oe,{path:"/w/:workspace/servers",element:r.jsx(Vb,{})}),r.jsx(Oe,{path:"/w/:workspace/inventories",element:r.jsx(qb,{})}),r.jsx(Oe,{path:"/w/:workspace/agent-sessions",element:r.jsx(Kb,{})}),r.jsx(Oe,{path:"/w/:workspace/todos",element:r.jsx(d_,{})}),r.jsx(Oe,{path:"/w/:workspace/create/project",element:r.jsx(Bb,{})}),r.jsx(Oe,{path:"/w/:workspace/projects/:slug",element:r.jsx(Ib,{})}),r.jsx(Oe,{path:"/w/:workspace/projects/:slug/edit",element:r.jsx(Wb,{})}),r.jsx(Oe,{path:"/w/:workspace/projects/:slug/create/assignment",element:r.jsx(Ub,{})}),r.jsx(Oe,{path:"/w/:workspace/projects/:slug/assignments/:aslug",element:r.jsx(Ob,{})}),r.jsx(Oe,{path:"/w/:workspace/projects/:slug/assignments/:aslug/edit",element:r.jsx(gp,{})}),r.jsx(Oe,{path:"/w/:workspace/projects/:slug/assignments/:aslug/plan/edit",element:r.jsx(xp,{})}),r.jsx(Oe,{path:"/w/:workspace/projects/:slug/assignments/:aslug/scratchpad/edit",element:r.jsx(yp,{})}),r.jsx(Oe,{path:"/w/:workspace/projects/:slug/assignments/:aslug/handoff/edit",element:r.jsx(vp,{})}),r.jsx(Oe,{path:"/w/:workspace/projects/:slug/assignments/:aslug/decision-record/edit",element:r.jsx(bp,{})})]})})})})}$2();LN.createRoot(document.getElementById("root")).render(r.jsx(p.StrictMode,{children:r.jsx(M2,{children:r.jsx(W5,{})})}));export{YD as _,q5 as a,mu as g};