@luuthuong/devboard 1.0.0 → 1.0.1

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 (37) hide show
  1. package/dist/assets/CardDetailView-BZE_MfjM.js +24 -0
  2. package/dist/assets/{DiffPane-bQsGoT7y.js → DiffPane-2WnoRvZ0.js} +2 -2
  3. package/dist/assets/KnowledgeView-C4WPFAUM.js +3 -0
  4. package/dist/assets/ListBoardView-DEE_eK4h.js +3 -0
  5. package/dist/assets/NewTaskDialog-D8cpc7Bc.js +1 -0
  6. package/dist/assets/OnboardingWizard-9ZkFPGvH.js +1 -0
  7. package/dist/assets/{ProcessManagerView-BIYjQpoP.js → ProcessManagerView-DJOr44DY.js} +1 -1
  8. package/dist/assets/ProposalCard-B8jqFtL8.js +1 -0
  9. package/dist/assets/{SearchOverlay-B4aywpIh.js → SearchOverlay-qGxzmM_v.js} +1 -1
  10. package/dist/assets/SettingsView-C3GkCbTz.js +1 -0
  11. package/dist/assets/SetupProjectView-CSx6ax5r.js +1 -0
  12. package/dist/assets/TaskDescriptionEditor-D0_b81zY.js +58 -0
  13. package/dist/assets/{Terminal-DJJcg-t6.js → Terminal-yq90NOBX.js} +1 -1
  14. package/dist/assets/deepEqual-BiJVGDfM.js +1 -0
  15. package/dist/assets/index-BtXUncAU.css +1 -0
  16. package/dist/assets/index-CQnL8JJ5.js +18 -0
  17. package/dist/assets/plus-Cecrm8sZ.js +1 -0
  18. package/dist/assets/x-B6wVesqk.js +1 -0
  19. package/dist/index.html +2 -2
  20. package/package.json +2 -2
  21. package/server-dist/server/commands.js +5 -39
  22. package/server-dist/server/fsBrowse.js +143 -0
  23. package/server-dist/server/transcripts.js +21 -22
  24. package/dist/assets/CardDetailView-CVWOsYyA.js +0 -24
  25. package/dist/assets/KnowledgeView-C5KHiBRG.js +0 -3
  26. package/dist/assets/ListBoardView-CzJcCLXS.js +0 -3
  27. package/dist/assets/NewTaskDialog-BuxvfgNU.js +0 -1
  28. package/dist/assets/OnboardingWizard-8WLFjTd8.js +0 -1
  29. package/dist/assets/ProposalCard-BbPobl1f.js +0 -1
  30. package/dist/assets/SettingsView-spBB3EwB.js +0 -1
  31. package/dist/assets/SetupProjectView-BuUDqDYU.js +0 -1
  32. package/dist/assets/TaskDescriptionEditor-Cv0nlU3w.js +0 -58
  33. package/dist/assets/chevron-right-BsVThPz4.js +0 -1
  34. package/dist/assets/index-DNKB6XwG.css +0 -1
  35. package/dist/assets/index-gWSenOqD.js +0 -18
  36. package/dist/assets/plus-XSPxArj5.js +0 -1
  37. package/dist/assets/x-CdEDbLMR.js +0 -1
@@ -1,24 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Terminal-DJJcg-t6.js","assets/jsx-runtime-QmcfnBgR.js","assets/index-gWSenOqD.js","assets/react-dom-DjtJUrx3.js","assets/Surface-BQKeigoq.js","assets/index-DNKB6XwG.css","assets/Terminal-BrP-ENHg.css","assets/DiffPane-bQsGoT7y.js","assets/TaskDescriptionEditor-Cv0nlU3w.js","assets/x-CdEDbLMR.js","assets/DiffPane-CpoDDQrA.css"])))=>i.map(i=>d[i]);
2
- import{a as e,d as t,f as n,i as r,m as i,n as a,p as o,t as s,u as c}from"./jsx-runtime-QmcfnBgR.js";import{_ as l,a as u,c as d,d as f,f as p,g as m,i as h,l as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./TaskDescriptionEditor-Cv0nlU3w.js";import{t as w}from"./chevron-right-BsVThPz4.js";import{t as T}from"./x-CdEDbLMR.js";import{a as E,b as D,o as O,p as k,t as A}from"./Surface-BQKeigoq.js";import{$ as j,B as M,C as N,E as P,G as F,J as ee,K as te,L as ne,Q as re,T as I,V as L,W as ie,_ as R,at as ae,c as z,d as oe,dt as se,et as ce,f as le,ft as ue,g as de,gt as fe,h as pe,l as me,n as he,nt as ge,p as B,pt as V,q as _e,rt as ve,st as ye,t as be,tt as xe,ut as Se,v as Ce,vt as we,w as Te,x as Ee,y as De,yt as Oe,z as ke}from"./index-gWSenOqD.js";import{a as Ae,i as je,t as Me}from"./ProposalCard-BbPobl1f.js";var Ne={name:`copy`,size:24,node:[[`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`}]]};Ne.node;var Pe=Oe(Ne),Fe={name:`list-plus`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]};Fe.node;var Ie=Oe(Fe),Le={name:`pencil`,size:24,node:[[`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`}]]};Le.node;var Re=Oe(Le),ze={name:`rotate-ccw`,size:24,node:[[`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`}]]};ze.node;var Be=Oe(ze),Ve={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};Ve.node;var He=Oe(Ve),Ue={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Ue.node;var We=Oe(Ue),Ge={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};Ge.node;var Ke=Oe(Ge),qe={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};qe.node;var Je=Oe(qe);function Ye(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Xe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ze=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qe={};function $e(e,t){return((t||Qe).jsx?Ze:Xe).test(e)}var et=/[ \t\n\f\r]/g;function tt(e){return typeof e==`object`?e.type===`text`&&nt(e.value):nt(e)}function nt(e){return e.replace(et,``)===``}var rt=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};rt.prototype.normal={},rt.prototype.property={},rt.prototype.space=void 0;function it(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new rt(n,r,t)}function at(e){return e.toLowerCase()}var H=class{constructor(e,t){this.attribute=t,this.property=e}};H.prototype.attribute=``,H.prototype.booleanish=!1,H.prototype.boolean=!1,H.prototype.commaOrSpaceSeparated=!1,H.prototype.commaSeparated=!1,H.prototype.defined=!1,H.prototype.mustUseProperty=!1,H.prototype.number=!1,H.prototype.overloadedBoolean=!1,H.prototype.property=``,H.prototype.spaceSeparated=!1,H.prototype.space=void 0;var ot=o({boolean:()=>U,booleanish:()=>W,commaOrSpaceSeparated:()=>q,commaSeparated:()=>lt,number:()=>G,overloadedBoolean:()=>ct,spaceSeparated:()=>K}),st=0,U=ut(),W=ut(),ct=ut(),G=ut(),K=ut(),lt=ut(),q=ut();function ut(){return 2**++st}var dt=Object.keys(ot),ft=class extends H{constructor(e,t,n,r){let i=-1;if(super(e,t),pt(this,`space`,r),typeof n==`number`)for(;++i<dt.length;){let e=dt[i];pt(this,dt[i],(n&ot[e])===ot[e])}}};ft.prototype.defined=!0;function pt(e,t,n){n&&(e[t]=n)}function mt(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new ft(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[at(r)]=r,n[at(a.attribute)]=r}return new rt(t,n,e.space)}var ht=mt({properties:{ariaActiveDescendant:null,ariaAtomic:W,ariaAutoComplete:null,ariaBusy:W,ariaChecked:W,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:K,ariaCurrent:null,ariaDescribedBy:K,ariaDetails:null,ariaDisabled:W,ariaDropEffect:K,ariaErrorMessage:null,ariaExpanded:W,ariaFlowTo:K,ariaGrabbed:W,ariaHasPopup:null,ariaHidden:W,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:K,ariaLevel:G,ariaLive:null,ariaModal:W,ariaMultiLine:W,ariaMultiSelectable:W,ariaOrientation:null,ariaOwns:K,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:W,ariaReadOnly:W,ariaRelevant:null,ariaRequired:W,ariaRoleDescription:K,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:W,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function gt(e,t){return t in e?e[t]:t}function _t(e,t){return gt(e,t.toLowerCase())}var vt=mt({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:lt,acceptCharset:K,accessKey:K,action:null,allow:null,allowFullScreen:U,allowPaymentRequest:U,allowUserMedia:U,alpha:U,alt:null,as:null,async:U,autoCapitalize:null,autoComplete:K,autoFocus:U,autoPlay:U,blocking:K,capture:null,charSet:null,checked:U,cite:null,className:K,closedBy:null,colorSpace:null,cols:G,colSpan:G,command:null,commandFor:null,content:null,contentEditable:W,controls:U,controlsList:K,coords:G|lt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:U,defer:U,dir:null,dirName:null,disabled:U,download:ct,draggable:W,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:U,formTarget:null,headers:K,height:G,hidden:ct,high:G,href:null,hrefLang:null,htmlFor:K,httpEquiv:K,id:null,imageSizes:null,imageSrcSet:null,inert:U,inputMode:null,integrity:null,is:null,isMap:U,itemId:null,itemProp:K,itemRef:K,itemScope:U,itemType:K,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:U,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:U,muted:U,name:null,nonce:null,noModule:U,noValidate:U,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:U,optimum:G,pattern:null,ping:K,placeholder:null,playsInline:U,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:U,referrerPolicy:null,rel:K,required:U,reversed:U,rows:G,rowSpan:G,sandbox:K,scope:null,scoped:U,seamless:U,selected:U,shadowRootClonable:U,shadowRootCustomElementRegistry:U,shadowRootDelegatesFocus:U,shadowRootMode:null,shadowRootSerializable:U,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:W,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:U,useMap:null,value:W,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:K,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:U,declare:U,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:U,noHref:U,noShade:U,noWrap:U,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:W,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:U,disablePictureInPicture:U,disableRemotePlayback:U,exportParts:lt,part:K,prefix:null,property:null,results:G,security:null,unselectable:null},space:`html`,transform:_t}),yt=mt({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`,maskType:`mask-type`,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:q,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:K,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:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:U,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,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:lt,g2:lt,glyphName:lt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:q,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:G,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:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:K,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:q,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:q,rev:q,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:q,requiredFeatures:q,requiredFonts:q,requiredFormats:q,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:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:q,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:q,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:q,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:gt}),bt=mt({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()}}),xt=mt({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:_t}),St=mt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ct={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`},wt=/[A-Z]/g,Tt=/-[a-z]/g,Et=/^data[-\w.:]+$/i;function Dt(e,t){let n=at(t),r=t,i=H;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Et.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Tt,Y);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Tt.test(e)){let n=e.replace(wt,J);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=ft}return new i(r,t)}function J(e){return`-`+e.toLowerCase()}function Y(e){return e.charAt(1).toUpperCase()}var Ot=it([ht,vt,bt,xt,St],`html`),X=it([ht,yt,bt,xt,St],`svg`);function kt(e){return e.join(` `).trim()}var At=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
3
- `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),jt=n(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(At());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),Mt=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Z=n(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(jt()),i=Mt();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),Nt=Ft(`end`),Pt=Ft(`start`);function Ft(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function It(e){let t=Pt(e),n=Nt(e);if(t&&n)return{start:t,end:n}}var Lt=i(Z(),1),Rt={}.hasOwnProperty,zt=new Map,Bt=/[A-Z]/g,Vt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ht=new Set([`td`,`th`]),Ut=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Wt(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=tn(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=en(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,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`?X:Ot,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Gt(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Gt(e,t,n){if(t.type===`element`)return Kt(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return qt(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Yt(e,t,n);if(t.type===`mdxjsEsm`)return Jt(e,t);if(t.type===`root`)return Xt(e,t,n);if(t.type===`text`)return Zt(e,t)}function Kt(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=X,e.schema=i),e.ancestors.push(t);let a=cn(e,t.tagName,!1),o=nn(e,t),s=an(e,t);return Vt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!tt(e)})),Qt(e,o,a,t),$t(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function qt(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}ln(e,t.position)}function Jt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ln(e,t.position)}function Yt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=X,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:cn(e,t.name,!0),o=rn(e,t),s=an(e,t);return Qt(e,o,a,t),$t(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Xt(e,t,n){let r={};return $t(r,an(e,t)),e.create(t,e.Fragment,r,n)}function Zt(e,t){return t.value}function Qt(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $t(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function en(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function tn(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Pt(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function nn(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Rt.call(t.properties,i)){let a=on(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ht.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function rn(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ln(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else ln(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function an(e,t){let n=[],r=-1,i=e.passKeys?new Map:zt;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Gt(e,a,o);s!==void 0&&n.push(s)}return n}function on(e,t,n){let r=Dt(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ye(n):kt(n)),r.property===`style`){let t=typeof n==`object`?n:sn(e,String(n));return e.stylePropertyNameCase===`css`&&(t=un(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Ct[r.property]||r.property:r.attribute,n]}}function sn(e,t){try{return(0,Lt.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new y("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Ut+`#cannot-parse-style-attribute`,r}}function cn(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=$e(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=$e(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Rt.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);ln(e)}function ln(e,t){let n=new y("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=Ut+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function un(e){let t={},n;for(n in e)Rt.call(e,n)&&(t[dn(n)]=e[n]);return t}function dn(e){let t=e.replace(Bt,fn);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function fn(e){return`-`+e.toLowerCase()}var pn={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`]};function mn(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&p(e.charCodeAt(n+1))&&p(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function hn(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function gn(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
4
- `}]}function _n(e,t){let n=t.value?t.value+`
5
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function vn(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yn(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bn(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=mn(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function xn(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sn(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Cn(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function wn(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Cn(e,t);let i={src:mn(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Tn(e,t){let n={src:mn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function En(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Dn(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Cn(e,t);let i={href:mn(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function On(e,t){let n={href:mn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function kn(e,t,n){let r=e.all(t),i=n?An(n):jn(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
6
- `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
7
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function An(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=jn(n[r])}return t}function jn(e){return e.spread??e.children.length>1}function Mn(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Nn(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pn(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Fn(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function In(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Pt(t.children[1]),o=Nt(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Ln(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Rn(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var zn=9,Bn=32;function Vn(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Hn(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Hn(t.slice(i),i>0,!1)),a.join(``)}function Hn(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===zn||t===Bn;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===zn||t===Bn;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Un(e,t){let n={type:`text`,value:Vn(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Wn(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Gn={blockquote:hn,break:gn,code:_n,delete:vn,emphasis:yn,footnoteReference:bn,heading:xn,html:Sn,imageReference:wn,image:Tn,inlineCode:En,linkReference:Dn,link:On,listItem:kn,list:Mn,paragraph:Nn,root:Pn,strong:Fn,table:In,tableCell:Rn,tableRow:Ln,text:Un,thematicBreak:Wn,toml:Kn,yaml:Kn,definition:Kn,footnoteDefinition:Kn};function Kn(){}var{defineProperty:qn}=Object,Jn=typeof self==`object`?self:globalThis,Yn=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Jn[e](t)},Xn=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?qn(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Jn[e]==`function`?Yn(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(Yn(a,o),i)};return r},Zn=e=>Xn(new Map,e)(0),Qn=``,{toString:$n}={},{keys:er,is:tr}=Object,nr=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=$n.call(e).slice(8,-1);switch(n){case`Array`:return[1,Qn];case`Object`:return[2,Qn];case`Date`:return[3,Qn];case`RegExp`:return[4,Qn];case`Map`:return[5,Qn];case`Set`:return[6,Qn];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},rr=([e,t])=>e===0&&(t===`function`||t===`symbol`),ir=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=nr(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&tr(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of er(o))(e||!rr(nr(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?Qn:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(rr(nr(n))||rr(nr(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!rr(nr(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},ar=(e,{json:t,lossy:n}={})=>{let r=[];return ir(!(t||n),!!t,new Map,r)(e),r},or=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Zn(ar(e,t)):structuredClone(e):(e,t)=>Zn(ar(e,t));function sr(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function cr(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function lr(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||sr,r=e.options.footnoteBackLabel||cr,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=mn(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...or(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
8
- `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
9
- `}]}}var ur={}.hasOwnProperty,dr={};function fr(e,t){let n=t||dr,r=new Map,i=new Map,a={all:s,applyData:mr,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Gn,...n.handlers},one:o,options:n,patch:pr,wrap:gr};return C(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(ur.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=or(n);return r.children=a.all(e),r}return or(e)}return(a.options.unknownHandler||hr)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=_r(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=_r(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function pr(e,t){e.position&&(t.position=It(e))}function mr(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,or(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function hr(e,t){let n=t.data||{},r=`value`in t&&!(ur.call(n,`hProperties`)||ur.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function gr(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
10
- `});++r<e.length;)r&&n.push({type:`text`,value:`
11
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
12
- `}),n}function _r(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function vr(e,t){let n=fr(e,t),r=n.one(e,void 0),i=lr(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
13
- `},i)),a}function yr(e,t){return e&&`run`in e?async function(n,r){let i=vr(n,{file:r,...t});await e.run(i,r)}:function(n,r){return vr(n,{file:r,...e||t})}}var Q=s(),$=i(t(),1),br=[],xr={allowDangerousHtml:!0},Sr=/^(https?|ircs?|mailto|xmpp)$/i,Cr=[{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:`className`,id:`remove-classname`},{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 wr(e){let t=Tr(e),n=Er(e);return Dr(t.runSync(t.parse(n),n),e)}function Tr(e){let t=e.rehypePlugins||br,n=e.remarkPlugins||br,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xr}:xr;return d().use(f).use(n).use(yr,r).use(t)}function Er(e){let t=e.children||``,n=new g;return typeof t==`string`?n.value=t:``+t,n}function Dr(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Or;for(let e of Cr)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return C(e,l),Wt(e,{Fragment:Q.Fragment,components:i,ignoreInvalidStyle:!0,jsx:Q.jsx,jsxs:Q.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in pn)if(Object.hasOwn(pn,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=pn[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Or(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Sr.test(e.slice(0,t))?e:``}var kr=c(),Ar=e=>e.toLocaleString(`en-US`);function jr(e){let t=(0,kr.c)(56),{sessionId:n}=e,[i,a]=(0,$.useState)(void 0),o,s;if(t[0]===n?(o=t[1],s=t[2]):(o=()=>{let e=!0,t=()=>r(`session_usage`,{sessionId:n}).then(t=>e&&a(t)).catch(()=>e&&a(Nr));a(void 0),t();let i=setInterval(t,1e4);return()=>{e=!1,clearInterval(i)}},s=[n],t[0]=n,t[1]=o,t[2]=s),(0,$.useEffect)(o,s),i===void 0)return null;if(!i){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsxs)(`div`,{className:`cdv-empty-copy bd-usage-empty`,children:[(0,Q.jsx)(`h3`,{children:`No usage data yet`}),(0,Q.jsx)(`p`,{children:`This session has no assistant responses to read usage from.`})]}),t[3]=e):e=t[3],e}let c=Math.min(100,Math.max(0,i.usedPercentage)),l=c>=85?`danger`:c>=65?`warning`:`ok`,u=i.model||`—`,d;t[4]===u?d=t[5]:(d={label:`Model`,value:u},t[4]=u,t[5]=d);let f;t[6]===i.inputTokens?f=t[7]:(f=Ar(i.inputTokens),t[6]=i.inputTokens,t[7]=f);let p;t[8]===f?p=t[9]:(p={label:`Input tokens`,value:f},t[8]=f,t[9]=p);let m;t[10]===i.outputTokens?m=t[11]:(m=Ar(i.outputTokens),t[10]=i.outputTokens,t[11]=m);let h;t[12]===m?h=t[13]:(h={label:`Output tokens`,value:m},t[12]=m,t[13]=h);let g;t[14]===i.costUsd?g=t[15]:(g=i.costUsd===null?`—`:`$${i.costUsd.toFixed(2)}`,t[14]=i.costUsd,t[15]=g);let _;t[16]===g?_=t[17]:(_={label:`Cost`,value:g},t[16]=g,t[17]=_);let v;t[18]!==_||t[19]!==d||t[20]!==p||t[21]!==h?(v=[d,p,h,_],t[18]=_,t[19]=d,t[20]=p,t[21]=h,t[22]=v):v=t[22];let y=v,b;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(`span`,{children:`Context window`}),t[23]=b):b=t[23];let x;t[24]===c?x=t[25]:(x=Math.round(c),t[24]=c,t[25]=x);let S;t[26]===x?S=t[27]:(S=(0,Q.jsxs)(`div`,{className:`bd-usage-head`,children:[b,(0,Q.jsxs)(`b`,{children:[x,`%`]})]}),t[26]=x,t[27]=S);let C;t[28]===c?C=t[29]:(C=Math.round(c),t[28]=c,t[29]=C);let w=`${c}%`,T;t[30]===w?T=t[31]:(T=(0,Q.jsx)(`i`,{style:{width:w}}),t[30]=w,t[31]=T);let E;t[32]!==C||t[33]!==T||t[34]!==l?(E=(0,Q.jsx)(`div`,{className:`bd-usage-bar`,"data-tone":l,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":C,children:T}),t[32]=C,t[33]=T,t[34]=l,t[35]=E):E=t[35];let D;t[36]===i.tokens?D=t[37]:(D=Ar(i.tokens),t[36]=i.tokens,t[37]=D);let O;t[38]===i.contextWindowSize?O=t[39]:(O=i.contextWindowSize>0&&` of ${Ar(i.contextWindowSize)}`,t[38]=i.contextWindowSize,t[39]=O);let k;t[40]!==D||t[41]!==O?(k=(0,Q.jsxs)(`p`,{className:`bd-usage-sub`,children:[D,O,` tokens in context`]}),t[40]=D,t[41]=O,t[42]=k):k=t[42];let A;t[43]!==S||t[44]!==E||t[45]!==k?(A=(0,Q.jsxs)(`section`,{className:`bd-usage-ctx`,"aria-label":`Context window`,children:[S,E,k]}),t[43]=S,t[44]=E,t[45]=k,t[46]=A):A=t[46];let j;t[47]===y?j=t[48]:(j=(0,Q.jsx)(`dl`,{className:`bd-usage-grid`,children:y.map(Mr)}),t[47]=y,t[48]=j);let M;t[49]===i.estimated?M=t[50]:(M=i.estimated&&(0,Q.jsx)(`p`,{className:`bd-usage-sub`,children:`Estimated from the session transcript: the window size is assumed and cost is unavailable. Install the Claude Code statusline in Settings → General for exact figures.`}),t[49]=i.estimated,t[50]=M);let N;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(`p`,{className:`bd-usage-sub`,children:`Input and output are lifetime totals for the session, so they stay high after a compact; the context bar does not.`}),t[51]=N):N=t[51];let P;return t[52]!==A||t[53]!==j||t[54]!==M?(P=(0,Q.jsxs)(`div`,{className:`bd-usage`,children:[A,j,M,N]}),t[52]=A,t[53]=j,t[54]=M,t[55]=P):P=t[55],P}function Mr(e){return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{children:e.label}),(0,Q.jsx)(`dd`,{children:e.value})]},e.label)}function Nr(e){return e??null}var Pr=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function Fr(e,t){return e.replace(/\[Image #(\d+)\]/g,(e,n)=>{let r=t[Number(n)-1];return r?`![Image #${n}](<${a(r)}>)`:e})}function Ir(e){let t=(0,kr.c)(28),{card:n}=e,[r,i]=(0,$.useState)(!1),a=n.link.promptBody??``,o,s,c,l,d,f;if(t[0]!==a||t[1]!==n.link.promptImagePaths||t[2]!==r){let e=n.link.promptImagePaths??[],{text:p,files:m}=u(a),h;t[9]===a?h=t[10]:(h=async()=>{try{await navigator.clipboard.writeText(a),i(!0),window.setTimeout(()=>i(!1),1500)}catch{}},t[9]=a,t[10]=h);let g=h;d=`cdv-task`;let _;t[11]===r?_=t[12]:(_=r?(0,Q.jsx)(we,{size:14,"aria-hidden":!0}):(0,Q.jsx)(Pe,{size:14,"aria-hidden":!0}),t[11]=r,t[12]=_);let v=r?`Copied`:`Copy`;t[13]!==g||t[14]!==_||t[15]!==v?(f=(0,Q.jsx)(`header`,{className:`cdv-task-head`,children:(0,Q.jsxs)(O,{size:`sm`,variant:`ghost`,onClick:g,"aria-live":`polite`,children:[_,v]})}),t[13]=g,t[14]=_,t[15]=v,t[16]=f):f=t[16],o=`hist-prose cdv-task-body`,s=!0;let y,b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(y=[x],b={a:Rr},t[17]=y,t[18]=b):(y=t[17],b=t[18]),c=(0,Q.jsx)(wr,{remarkPlugins:y,components:b,children:Fr(p,e)}),l=m.length>0&&(0,Q.jsx)(`ul`,{className:`nt-attachments cdv-task-files`,"aria-label":`Attached files`,children:m.map(Lr)}),t[0]=a,t[1]=n.link.promptImagePaths,t[2]=r,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=d,t[8]=f}else o=t[3],s=t[4],c=t[5],l=t[6],d=t[7],f=t[8];let p;t[19]!==o||t[20]!==s||t[21]!==c||t[22]!==l?(p=(0,Q.jsxs)(`div`,{className:o,"data-md":s,children:[c,l]}),t[19]=o,t[20]=s,t[21]=c,t[22]=l,t[23]=p):p=t[23];let m;return t[24]!==d||t[25]!==f||t[26]!==p?(m=(0,Q.jsxs)(`section`,{className:d,children:[f,p]}),t[24]=d,t[25]=f,t[26]=p,t[27]=m):m=t[27],m}function Lr(e){return(0,Q.jsxs)(`li`,{className:`nt-chip`,title:e.path,children:[(0,Q.jsx)(m,{size:14,strokeWidth:2,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`nt-chip-name`,children:e.name})]},e.path)}function Rr(e){let{node:t,...n}=e;return(0,Q.jsx)(`a`,{...n,target:`_blank`,rel:`noopener noreferrer`})}function zr(e){let t=(0,kr.c)(65),{card:n,onDone:r}=e,i=V(Br),[a,o]=(0,$.useState)(!1),s=n.link,c=s.promptBody??``,l;t[0]===s.promptImagePaths?l=t[1]:(l=s.promptImagePaths??[],t[0]=s.promptImagePaths,t[1]=l);let d=l,f=!!s.sessionLink,[p,m]=(0,$.useState)(s.name??``),h;t[2]===c?h=t[3]:(h=()=>u(c),t[2]=c,t[3]=h);let[g]=(0,$.useState)(h),[_,y]=(0,$.useState)(g.text),[b,x]=(0,$.useState)(d),[C,w]=(0,$.useState)(g.files),T;t[4]!==_||t[5]!==C?(T=()=>v(_,C),t[4]=_,t[5]=C,t[6]=T):T=t[6];let E=T,D;t[7]!==c||t[8]!==b||t[9]!==E||t[10]!==d||t[11]!==s.name||t[12]!==p?(D=p.trim()!==(s.name??``)||E()!==c.trim()||b.join(`
14
- `)!==d.join(`
15
- `),t[7]=c,t[8]=b,t[9]=E,t[10]=d,t[11]=s.name,t[12]=p,t[13]=D):D=t[13];let A=D,j;t[14]!==A||t[15]!==_||t[16]!==a?(j=!!_.trim()&&A&&!a,t[14]=A,t[15]=_,t[16]=a,t[17]=j):j=t[17];let M=j,N;t[18]!==M||t[19]!==n.id||t[20]!==b||t[21]!==E||t[22]!==r||t[23]!==p||t[24]!==i?(N=async()=>{if(!M)return;o(!0);let e=await i(n.id,{name:p,promptBody:E(),promptImagePaths:b});o(!1),e&&r()},t[18]=M,t[19]=n.id,t[20]=b,t[21]=E,t[22]=r,t[23]=p,t[24]=i,t[25]=N):N=t[25];let P=N,F;t[26]===P?F=t[27]:(F=e=>{e.preventDefault(),P()},t[26]=P,t[27]=F);let ee;t[28]!==r||t[29]!==P||t[30]!==a?(ee=e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)?(e.preventDefault(),P()):e.key===`Escape`&&!a&&(e.stopPropagation(),r())},t[28]=r,t[29]=P,t[30]=a,t[31]=ee):ee=t[31];let te;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Q.jsx)(`h3`,{className:`cdv-edit-heading`,children:`Edit task`}),t[32]=te):te=t[32];let ne;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsxs)(R,{htmlFor:`cdv-task-title`,children:[`Title `,(0,Q.jsx)(`span`,{className:`tg-muted`,children:`(optional, defaults to the first line)`})]}),t[33]=ne):ne=t[33];let re;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(re=e=>m(e.target.value),t[34]=re):re=t[34];let I;t[35]===p?I=t[36]:(I=(0,Q.jsxs)(`div`,{className:`cdv-task-field`,children:[ne,(0,Q.jsx)(de,{id:`cdv-task-title`,value:p,onChange:re,placeholder:`Short name shown on the board card`,autoComplete:`off`})]}),t[35]=p,t[36]=I);let L;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(R,{children:`Description`}),t[37]=L):L=t[37];let ie;t[38]!==b||t[39]!==C||t[40]!==g.text?(ie=(0,Q.jsx)(S,{initialValue:g.text,onChange:y,imagePaths:b,onImagePathsChange:x,files:C,onFilesChange:w,autoFocus:!0}),t[38]=b,t[39]=C,t[40]=g.text,t[41]=ie):ie=t[41];let ae;t[42]===f?ae=t[43]:(ae=f&&(0,Q.jsx)(pe,{children:`Claude already received the original prompt. Changes update this card and apply the next time it is launched from the card.`}),t[42]=f,t[43]=ae);let z;t[44]!==ie||t[45]!==ae?(z=(0,Q.jsxs)(`div`,{className:`cdv-task-field`,children:[L,ie,ae]}),t[44]=ie,t[45]=ae,t[46]=z):z=t[46];let oe;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Q.jsxs)(`span`,{className:`nt-shortcut`,children:[(0,Q.jsx)(k,{children:Pr?`⌘`:`Ctrl`}),(0,Q.jsx)(k,{children:`↵`}),(0,Q.jsx)(`span`,{children:`to save`})]}),t[47]=oe):oe=t[47];let se;t[48]!==r||t[49]!==a?(se=(0,Q.jsx)(O,{variant:`ghost`,onClick:r,disabled:a,children:`Cancel`}),t[48]=r,t[49]=a,t[50]=se):se=t[50];let ce=!M,le=a?`Saving...`:`Save changes`,ue;t[51]!==ce||t[52]!==le?(ue=(0,Q.jsx)(O,{type:`submit`,variant:`solid`,disabled:ce,children:le}),t[51]=ce,t[52]=le,t[53]=ue):ue=t[53];let fe;t[54]!==se||t[55]!==ue?(fe=(0,Q.jsxs)(`footer`,{className:`cdv-task-foot`,children:[oe,se,ue]}),t[54]=se,t[55]=ue,t[56]=fe):fe=t[56];let me;t[57]!==I||t[58]!==z||t[59]!==fe?(me=(0,Q.jsxs)(`div`,{className:`cdv-task cdv-task--editing`,children:[te,I,z,fe]}),t[57]=I,t[58]=z,t[59]=fe,t[60]=me):me=t[60];let he;return t[61]!==me||t[62]!==F||t[63]!==ee?(he=(0,Q.jsx)(`form`,{className:`cdv-pane cdv-scroll cdv-edit`,onSubmit:F,onKeyDown:ee,children:me}),t[61]=me,t[62]=F,t[63]=ee,t[64]=he):he=t[64],he}function Br(e){return e.updateCardTask}function Vr(e){let t=(0,kr.c)(57),{open:n,onClose:r,onSave:i,editBody:a,editSendAuto:o,editImagePaths:s}=e,[c,l]=(0,$.useState)(``),[u,d]=(0,$.useState)(!0),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],t[0]=f):f=t[0];let[p,m]=(0,$.useState)(f),h=(0,$.useRef)(null),g=a!==void 0,v;t[1]!==a||t[2]!==s||t[3]!==o||t[4]!==n?(v=()=>{n&&(l(a??``),d(o??!0),m(s??[]),setTimeout(()=>h.current?.focus(),50))},t[1]=a,t[2]=s,t[3]=o,t[4]=n,t[5]=v):v=t[5];let y;if(t[6]===n?y=t[7]:(y=[n],t[6]=n,t[7]=y),(0,$.useEffect)(v,y),!n)return null;let x;t[8]===c?x=t[9]:(x=c.trim(),t[8]=c,t[9]=x);let S=x.length>0,C;t[10]!==c||t[11]!==S||t[12]!==p||t[13]!==r||t[14]!==i||t[15]!==u?(C=()=>{S&&(i(c.trim(),u,p.length>0?p:void 0),r())},t[10]=c,t[11]=S,t[12]=p,t[13]=r,t[14]=i,t[15]=u,t[16]=C):C=t[16];let w=C,T;t[17]!==c||t[18]!==p?(T=async e=>{let t=Array.from(e.clipboardData.items).filter(Hr);if(t.length===0)return;e.preventDefault();let n=e.currentTarget,r=n.selectionStart,i=n.selectionEnd,a=[];for(let e of t){let t=e.getAsFile();if(!t)continue;let n=new Uint8Array(await t.arrayBuffer());try{a.push(await ye(n))}catch(e){let t=e;V.setState({error:String(t)});return}}let o=p.length,s=a.map((e,t)=>_(o+t+1)).join(` `);l(c.slice(0,r)+s+c.slice(i)),m([...p,...a])},t[17]=c,t[18]=p,t[19]=T):T=t[19];let D=T,k;t[20]!==c||t[21]!==p?(k=e=>{let t=b(c,p,e);l(t.body),m(t.imagePaths)},t[20]=c,t[21]=p,t[22]=k):k=t[22];let A=k,j;t[23]===r?j=t[24]:(j=e=>!e&&r(),t[23]=r,t[24]=j);let M=g?`Edit Queued Prompt`:`Queue Prompt`,P=g?`Update the prompt text and settings.`:`Add a prompt to send to Claude later.`,F;t[25]===r?F=t[26]:(F=(0,Q.jsx)(O,{variant:`ghost`,onClick:r,children:`Cancel`}),t[25]=r,t[26]=F);let ee=!S,te=g?`Save`:`Add`,ne;t[27]!==w||t[28]!==ee||t[29]!==te?(ne=(0,Q.jsx)(O,{variant:`solid`,onClick:w,disabled:ee,children:te}),t[27]=w,t[28]=ee,t[29]=te,t[30]=ne):ne=t[30];let re;t[31]!==F||t[32]!==ne?(re=(0,Q.jsxs)(Q.Fragment,{children:[F,ne]}),t[31]=F,t[32]=ne,t[33]=re):re=t[33];let I;t[34]===w?I=t[35]:(I=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&w()},t[34]=w,t[35]=I);let L;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>l(e.target.value),t[36]=L):L=t[36];let ie;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(ie={minHeight:100,maxHeight:250},t[37]=ie):ie=t[37];let R;t[38]!==c||t[39]!==D?(R=(0,Q.jsx)(Ee,{ref:h,value:c,onChange:L,onPaste:D,placeholder:`Enter your prompt...`,"aria-label":`Prompt`,className:`font-mono`,style:ie,"data-autofocus":!0}),t[38]=c,t[39]=D,t[40]=R):R=t[40];let ae;t[41]!==p||t[42]!==A?(ae=p.length>0&&(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:p.map((e,t)=>(0,Q.jsxs)(E,{title:e,children:[`Image #`,t+1,(0,Q.jsx)(`button`,{type:`button`,onClick:()=>A(t),"aria-label":`Remove image ${t+1}`,style:{display:`inline-flex`,background:`none`,border:0,padding:0,color:`inherit`,cursor:`pointer`},children:(0,Q.jsx)(`svg`,{width:`12`,height:`12`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,strokeLinecap:`round`,children:(0,Q.jsx)(`path`,{d:`M6 18 18 6M6 6l12 12`})})})]},e))}),t[41]=p,t[42]=A,t[43]=ae):ae=t[43];let z;t[44]===u?z=t[45]:(z=(0,Q.jsx)(B,{checked:u,onCheckedChange:d,label:`Send automatically when Claude finishes`}),t[44]=u,t[45]=z);let oe;t[46]!==I||t[47]!==R||t[48]!==ae||t[49]!==z?(oe=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,onKeyDown:I,children:[R,ae,z]}),t[46]=I,t[47]=R,t[48]=ae,t[49]=z,t[50]=oe):oe=t[50];let se;return t[51]!==P||t[52]!==re||t[53]!==oe||t[54]!==j||t[55]!==M?(se=(0,Q.jsx)(N,{open:!0,onOpenChange:j,title:M,description:P,width:450,footer:re,children:oe}),t[51]=P,t[52]=re,t[53]=oe,t[54]=j,t[55]=M,t[56]=se):se=t[56],se}function Hr(e){return e.kind===`file`&&e.type.startsWith(`image/`)}function Ur(e){let t=(0,kr.c)(25),{prompts:n,onSendNow:r,onEdit:i,onRemove:a}=e,{theme:o}=M(),s;t[0]===o?s=t[1]:(s=ke(o),t[0]=o,t[1]=s);let c=s;if(n.length===0)return null;let l=o===`dark`?`rgba(255,255,255,0.03)`:`rgba(0,0,0,0.03)`,u=`1px solid ${c.border}`,d;t[2]!==l||t[3]!==u?(d={background:l,border:u},t[2]=l,t[3]=u,t[4]=d):d=t[4];let f;if(t[5]!==c.border||t[6]!==c.hoverBg||t[7]!==c.textDim||t[8]!==c.textSecondary||t[9]!==i||t[10]!==a||t[11]!==r||t[12]!==n){let e;t[14]!==c.border||t[15]!==c.hoverBg||t[16]!==c.textDim||t[17]!==c.textSecondary||t[18]!==i||t[19]!==a||t[20]!==r?(e=(e,t)=>(0,Q.jsxs)(`div`,{children:[t>0&&(0,Q.jsx)(`div`,{style:{height:1,background:c.border}}),(0,Q.jsxs)(`div`,{className:`flex items-start gap-2.5 px-3 py-2`,children:[(0,Q.jsx)(`span`,{className:`shrink-0 mt-0.5 text-[13px]`,style:{color:e.sendAutomatically?`#d29922`:c.textDim},title:e.sendAutomatically?`Will send automatically when Claude finishes`:`Manual send only`,children:e.sendAutomatically?`⚡`:`⏸`}),(0,Q.jsx)(`span`,{className:`flex-1 text-[12px] leading-[1.5] font-mono`,style:{color:c.textSecondary,display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`},children:e.body}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,Q.jsx)(`button`,{onClick:()=>r(e.id),className:`px-2 py-0.5 rounded-md text-[11px] font-medium transition-all duration-150`,style:{color:`var(--ink)`,border:`1px solid rgba(79,142,247,0.3)`},onMouseEnter:Kr,onMouseLeave:Gr,title:`Send this prompt now`,children:`Send`}),(0,Q.jsx)(`button`,{onClick:()=>i(e),className:`p-1 rounded-md transition-all duration-150`,style:{color:c.textDim},onMouseEnter:e=>{e.currentTarget.style.color=c.textSecondary,e.currentTarget.style.background=c.hoverBg},onMouseLeave:e=>{e.currentTarget.style.color=c.textDim,e.currentTarget.style.background=``},title:`Edit`,children:(0,Q.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,Q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Z`})})}),(0,Q.jsx)(`button`,{onClick:()=>a(e.id),className:`p-1 rounded-md transition-all duration-150`,style:{color:c.textDim},onMouseEnter:Wr,onMouseLeave:e=>{e.currentTarget.style.color=c.textDim,e.currentTarget.style.background=``},title:`Remove`,children:(0,Q.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,Q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 18 18 6M6 6l12 12`})})})]})]})]},e.id),t[14]=c.border,t[15]=c.hoverBg,t[16]=c.textDim,t[17]=c.textSecondary,t[18]=i,t[19]=a,t[20]=r,t[21]=e):e=t[21],f=n.map(e),t[5]=c.border,t[6]=c.hoverBg,t[7]=c.textDim,t[8]=c.textSecondary,t[9]=i,t[10]=a,t[11]=r,t[12]=n,t[13]=f}else f=t[13];let p;return t[22]!==d||t[23]!==f?(p=(0,Q.jsx)(`div`,{className:`shrink-0 mx-2 mt-1 rounded-xl overflow-hidden`,style:d,children:f}),t[22]=d,t[23]=f,t[24]=p):p=t[24],p}function Wr(e){e.currentTarget.style.color=`#f85149`,e.currentTarget.style.background=`rgba(248,81,73,0.06)`}function Gr(e){e.currentTarget.style.background=``}function Kr(e){e.currentTarget.style.background=`rgba(79,142,247,0.1)`}function qr({card:e}){let[t,n]=(0,$.useState)(``),[i,a]=(0,$.useState)(!1),{stage:o,gate:s}=e.link;if(!o)return null;if(s?.status!==`pending`)return(0,Q.jsxs)(`div`,{className:`bd-gate-line`,children:[(0,Q.jsxs)(E,{tone:`outline`,children:[`AI-DLC · `,o]}),s?.status===`rejected`&&(0,Q.jsxs)(`span`,{children:[`sent back: `,s.note]})]});let c=async i=>{a(!0);try{await r(i,{cardId:e.id,note:t}),n(``)}catch(e){I({title:e instanceof Error?e.message:String(e),tone:`danger`})}finally{a(!1)}};return(0,Q.jsx)(A,{tone:`warning`,title:`Review the ${o} stage`,description:s.note,action:(0,Q.jsxs)(`div`,{className:`bd-kb-actions`,children:[(0,Q.jsx)(de,{"aria-label":`Note for the agent`,placeholder:`Note (required to send back)`,value:t,onChange:e=>n(e.target.value)}),(0,Q.jsx)(O,{variant:`solid`,size:`sm`,loading:i,onClick:()=>c(`gate_approve`),children:`Approve`}),(0,Q.jsx)(O,{size:`sm`,disabled:i||!t.trim(),onClick:()=>c(`gate_reject`),children:`Send back`})]})})}var Jr=()=>{};function Yr(e){let t=(0,kr.c)(21),{card:n,data:r}=e,i,a,o,s,c;if(t[0]!==n||t[1]!==r.injected||t[2]!==r.proposals||t[3]!==r.review){let e=r.proposals.filter($r),l=r.proposals.filter(Qr);i=`cdv-kb`,t[9]!==n||t[10]!==r.review?(a=r.review.length>0&&(0,Q.jsx)(ei,{title:`May be outdated`,hint:`Entries about files this task changed, written before the change.`,children:r.review.map(e=>(0,Q.jsx)(ti,{hit:e,card:n,onChanged:Jr},e.entry.id))}),t[9]=n,t[10]=r.review,t[11]=a):a=t[11],o=e.length>0&&(0,Q.jsx)(ei,{title:`Proposed by this task`,hint:`Approving opens a pull request in the harness repository.`,children:e.map(Zr)}),t[12]!==n||t[13]!==r.injected?(s=r.injected.length>0&&(0,Q.jsx)(ei,{title:`Given to this task`,hint:`Injected when its session started.`,children:r.injected.map(e=>(0,Q.jsx)(ti,{hit:e,card:n,onChanged:Jr},e.entry.id))}),t[12]=n,t[13]=r.injected,t[14]=s):s=t[14],c=l.length>0&&(0,Q.jsx)(ei,{title:`Decided`,children:l.map(Xr)}),t[0]=n,t[1]=r.injected,t[2]=r.proposals,t[3]=r.review,t[4]=i,t[5]=a,t[6]=o,t[7]=s,t[8]=c}else i=t[4],a=t[5],o=t[6],s=t[7],c=t[8];let l;return t[15]!==i||t[16]!==a||t[17]!==o||t[18]!==s||t[19]!==c?(l=(0,Q.jsxs)(`div`,{className:i,children:[a,o,s,c]}),t[15]=i,t[16]=a,t[17]=o,t[18]=s,t[19]=c,t[20]=l):l=t[20],l}function Xr(e){return(0,Q.jsx)(Me,{proposal:e,onChanged:Jr,showSourceCard:!1},e.id)}function Zr(e){return(0,Q.jsx)(Me,{proposal:e,onChanged:Jr,showSourceCard:!1},e.id)}function Qr(e){return e.status!==`pending`}function $r(e){return e.status===`pending`}function ei(e){let t=(0,kr.c)(17),{title:n,hint:r,children:i}=e,a;t[0]===i?a=t[1]:(a=$.Children.count(i),t[0]=i,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(`span`,{className:`cdv-kb-count`,children:a}),t[2]=a,t[3]=o);let s;t[4]!==o||t[5]!==n?(s=(0,Q.jsxs)(`h3`,{className:`cdv-kb-title`,children:[n,o]}),t[4]=o,t[5]=n,t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=r&&(0,Q.jsx)(`p`,{className:`cdv-kb-hint`,children:r}),t[7]=r,t[8]=c);let l;t[9]!==s||t[10]!==c?(l=(0,Q.jsxs)(`header`,{className:`cdv-kb-head`,children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11];let u;t[12]===i?u=t[13]:(u=(0,Q.jsx)(`div`,{className:`cdv-kb-group`,children:i}),t[12]=i,t[13]=u);let d;return t[14]!==l||t[15]!==u?(d=(0,Q.jsxs)(`section`,{className:`cdv-kb-section`,children:[l,u]}),t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function ti(e){let t=(0,kr.c)(42),{hit:n,card:r,onChanged:i}=e,a=n.entry,[o,s]=(0,$.useState)(!1),[c,l]=(0,$.useState)(!1),u=n.stale||void 0,d;t[0]===a.type?d=t[1]:(d=(0,Q.jsx)(E,{children:a.type}),t[0]=a.type,t[1]=d);let f;t[2]===n.stale?f=t[3]:(f=n.stale&&(0,Q.jsx)(E,{tone:`warning`,children:`may be outdated`}),t[2]=n.stale,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>s(ii),t[4]=p):p=t[4];let m=o?`Hide`:`Read`,h;t[5]!==o||t[6]!==m?(h=(0,Q.jsx)(O,{variant:`ghost`,size:`sm`,onClick:p,"aria-expanded":o,children:m}),t[5]=o,t[6]=m,t[7]=h):h=t[7];let g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>l(ri),t[8]=g):g=t[8];let _;t[9]===c?_=t[10]:(_=(0,Q.jsx)(O,{variant:`ghost`,size:`sm`,onClick:g,"aria-expanded":c,children:`Propose correction`}),t[9]=c,t[10]=_);let v;t[11]!==h||t[12]!==_?(v=(0,Q.jsxs)(`div`,{className:`kbe-actions`,children:[h,_]}),t[11]=h,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==d||t[15]!==f||t[16]!==v?(y=(0,Q.jsxs)(`div`,{className:`kbe-head`,children:[d,f,v]}),t[14]=d,t[15]=f,t[16]=v,t[17]=y):y=t[17];let b;t[18]===a.title?b=t[19]:(b=(0,Q.jsx)(`h4`,{className:`kbe-title`,children:a.title}),t[18]=a.title,t[19]=b);let x;t[20]===a.summary?x=t[21]:(x=(0,Q.jsx)(`p`,{className:`kbe-summary`,children:a.summary}),t[20]=a.summary,t[21]=x);let S;t[22]!==a.id||t[23]!==a.kbId||t[24]!==a.scope?(S=a.scope.length>0&&(0,Q.jsx)(`ul`,{className:`kbe-scope`,"aria-label":`About`,title:`${a.kbId} · ${a.id}`,children:a.scope.map(ni)}),t[22]=a.id,t[23]=a.kbId,t[24]=a.scope,t[25]=S):S=t[25];let C;t[26]!==a.body||t[27]!==o?(C=o&&(0,Q.jsx)(`pre`,{className:`kbe-body`,children:a.body}),t[26]=a.body,t[27]=o,t[28]=C):C=t[28];let w;t[29]!==r||t[30]!==a||t[31]!==c||t[32]!==i?(w=c&&(0,Q.jsx)(ai,{entry:a,cardId:r.id,onDone:()=>{l(!1),i()}}),t[29]=r,t[30]=a,t[31]=c,t[32]=i,t[33]=w):w=t[33];let T;return t[34]!==u||t[35]!==y||t[36]!==b||t[37]!==x||t[38]!==S||t[39]!==C||t[40]!==w?(T=(0,Q.jsxs)(`article`,{className:`kbe`,"data-stale":u,children:[y,b,x,S,C,w]}),t[34]=u,t[35]=y,t[36]=b,t[37]=x,t[38]=S,t[39]=C,t[40]=w,t[41]=T):T=t[41],T}function ni(e){return(0,Q.jsx)(`li`,{children:e},e)}function ri(e){return!e}function ii(e){return!e}function ai({entry:e,cardId:t,onDone:n}){let i={title:e.title,summary:e.summary,body:e.body},[a,o]=(0,$.useState)(i),[s,c]=(0,$.useState)(!1);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(je,{id:`fix-${e.id}`,value:a,onChange:o}),(0,Q.jsx)(`div`,{className:`bd-kb-actions`,children:(0,Q.jsx)(O,{variant:`solid`,loading:s,disabled:Ae(a,i),onClick:async()=>{c(!0);try{await r(`kb_propose`,{kbId:e.kbId,type:e.type,...a,scope:e.scope,supersedes:[e.id],source:{cardId:t},reason:`Corrects ${e.id}`}),I({title:`Correction proposed`,description:`It replaces the old entry once approved.`,tone:`success`}),n()}catch(e){I({title:e instanceof Error?e.message:String(e),tone:`danger`})}finally{c(!1)}},children:`Propose`})})]})}var oi=[{value:`normal`,label:`Normal`,hint:`Claude works on the description as written`},{value:`full`,label:`Full workflow`,hint:`Requirements, design, implementation, review and PR, each with its skill or reviewer`}],si="Run the full team workflow for this task. Invoke each skill or subagent by name; do not skip a stage.\n1. `aidlc-requirements`: turn the description into requirements and acceptance criteria.\n2. `aidlc-design`: write the design before any code.\n3. `aidlc-implement`: implement it with tests and run the project's checks.\n4. Run the `code-reviewer` subagent on the diff and fix what it finds. If the change touches auth, input parsing, file paths, process execution, network endpoints or secrets, also run `security-reviewer`.\n5. `aidlc-pr`: prepare the pull request. Do not push or open it until I confirm.\nStop and ask me whenever a stage leaves an open question.";function ci(e,t){return t===`full`?`${e}\n\n---\n${si}`:e}var li=[{value:``,label:`Default`,hint:`Whatever Claude Code or the API service picks`},{value:`opus`,label:`Opus`,hint:`Most capable — hardest tasks`},{value:`sonnet`,label:`Sonnet`,hint:`Balanced speed and quality`},{value:`haiku`,label:`Haiku`,hint:`Fastest and cheapest`},{value:`opusplan`,label:`Opus plan → Sonnet`,hint:`Opus plans, Sonnet implements`},{value:`__custom`,label:`Custom…`,hint:`A full model id`}],ui=/^[\w.\-:/[\]]+$/,di=/^[A-Z_][A-Z0-9_]*=/i,fi=typeof navigator<`u`&&/Mac/i.test(navigator.platform);function pi(e){let t=(0,kr.c)(173),{projectPath:n,initialPrompt:r,canCreateWorktree:i,initialSkipPermissions:a,buildCommand:o,onLaunch:s,onCancel:c,runtime:l,onRuntimeChange:d,windowsLabel:f}=e,p=f===void 0?`Windows`:f,h;t[0]===r?h=t[1]:(h=()=>u(r),t[0]=r,t[1]=h);let[g]=(0,$.useState)(h),[_,y]=(0,$.useState)(g.text),[b,x]=(0,$.useState)(g.files),[S,C]=(0,$.useState)(`normal`),E;t[2]!==b||t[3]!==S||t[4]!==_?(E=ci(v(_,b),S),t[2]=b,t[3]=S,t[4]=_,t[5]=E):E=t[5];let D=E,[k,A]=(0,$.useState)(``),[j,M]=(0,$.useState)(a),[N,P]=(0,$.useState)(``),[F,ee]=(0,$.useState)(``),[te,ne]=(0,$.useState)(``),[re,I]=(0,$.useState)(!1),[L,ie]=(0,$.useState)(!1),[R,ae]=(0,$.useState)(``),[z,se]=(0,$.useState)(!1),ce=(0,$.useRef)(null),ue;t[6]===te?ue=t[7]:(ue=te.split(`
16
- `).map(bi).filter(yi),t[6]=te,t[7]=ue);let pe=ue,he;t[8]===pe?he=t[9]:(he=pe.filter(vi),t[8]=pe,t[9]=he);let ge=he,B=pe.length-ge.length,V;t[10]!==F||t[11]!==N?(V=N===`__custom`&&F.trim()!==``&&!ui.test(F.trim()),t[10]=F,t[11]=N,t[12]=V):V=t[12];let _e=V,ve;t[13]!==_e||t[14]!==F||t[15]!==N?(ve=N===`__custom`?_e?``:F.trim():N,t[13]=_e,t[14]=F,t[15]=N,t[16]=ve):ve=t[16];let ye=ve,be=i?k:``,xe;t[17]!==o||t[18]!==ge||t[19]!==ye||t[20]!==D||t[21]!==j||t[22]!==be?(xe=o({prompt:D,worktreeBranch:be,dangerouslySkipPermissions:j,envPrefix:ge,model:ye}),t[17]=o,t[18]=ge,t[19]=ye,t[20]=D,t[21]=j,t[22]=be,t[23]=xe):xe=t[23];let Se=xe,we,Te;t[24]!==z||t[25]!==Se?(we=()=>{z||ae(Se)},Te=[Se,z],t[24]=z,t[25]=Se,t[26]=we,t[27]=Te):(we=t[26],Te=t[27]),(0,$.useEffect)(we,Te);let Oe,ke;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=()=>{ce.current?.focus()},ke=[],t[28]=Oe,t[29]=ke):(Oe=t[28],ke=t[29]),(0,$.useEffect)(Oe,ke);let Ae;t[30]===Se?Ae=t[31]:(Ae=e=>{ae(e),se(e!==Se)},t[30]=Se,t[31]=Ae);let je=Ae,Me;t[32]===Se?Me=t[33]:(Me=()=>{se(!1),ae(Se)},t[32]=Se,t[33]=Me);let Ne=Me,Pe;t[34]!==R||t[35]!==_e||t[36]!==D?(Pe=D.trim().length>0&&R.trim().length>0&&!_e,t[34]=R,t[35]=_e,t[36]=D,t[37]=Pe):Pe=t[37];let Fe=Pe,Ie;t[38]!==Fe||t[39]!==z||t[40]!==R||t[41]!==ge||t[42]!==ye||t[43]!==s||t[44]!==D||t[45]!==j||t[46]!==k?(Ie=()=>{Fe&&s({prompt:D.trim(),worktreeBranch:k.trim(),dangerouslySkipPermissions:j,envPrefix:ge,model:ye,commandOverride:z?R:null})},t[38]=Fe,t[39]=z,t[40]=R,t[41]=ge,t[42]=ye,t[43]=s,t[44]=D,t[45]=j,t[46]=k,t[47]=Ie):Ie=t[47];let Le=Ie,Re;t[48]!==c||t[49]!==Le?(Re=e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)?(e.preventDefault(),Le()):e.key===`Escape`&&(e.preventDefault(),c())},t[48]=c,t[49]=Le,t[50]=Re):Re=t[50];let ze=Re,Be;t[51]===S?Be=t[52]:(Be=oi.find(e=>e.value===S)?.hint,t[51]=S,t[52]=Be);let Ve=Be,He;t[53]===N?He=t[54]:(He=li.find(e=>e.value===N)?.hint,t[53]=N,t[54]=He);let Ue=He,We;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,Q.jsx)(`label`,{htmlFor:`ls-prompt`,children:`Description`}),t[55]=We):We=t[55];let Ge;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,Q.jsx)(fe,{size:13,strokeWidth:2,"aria-hidden":!0}),t[56]=Ge):Ge=t[56];let Ke;t[57]===n?Ke=t[58]:(Ke=(0,Q.jsx)(`span`,{children:n}),t[57]=n,t[58]=Ke);let qe;t[59]!==n||t[60]!==Ke?(qe=(0,Q.jsxs)(`div`,{className:`ls-fieldhead`,children:[We,(0,Q.jsxs)(`span`,{className:`ls-cwd`,title:n,children:[Ge,Ke]})]}),t[59]=n,t[60]=Ke,t[61]=qe):qe=t[61];let Je;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Je=e=>y(e.target.value),t[62]=Je):Je=t[62];let Ye;t[63]===_?Ye=t[64]:(Ye=(0,Q.jsx)(Ee,{id:`ls-prompt`,ref:ce,className:`ls-prompt`,value:_,onChange:Je,placeholder:`What should Claude work on?`,spellCheck:!1}),t[63]=_,t[64]=Ye);let Xe;t[65]===b?Xe=t[66]:(Xe=b.length>0&&(0,Q.jsx)(`ul`,{className:`ls-files`,"aria-label":`Attached files`,children:b.map(e=>(0,Q.jsxs)(`li`,{className:`ls-file`,title:e.path,children:[(0,Q.jsx)(m,{size:14,strokeWidth:2,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:e.name}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>x(t=>t.filter(t=>t.path!==e.path)),"aria-label":`Remove ${e.name}`,children:(0,Q.jsx)(T,{size:12,strokeWidth:2.5,"aria-hidden":!0})})]},e.path))}),t[65]=b,t[66]=Xe);let Ze;t[67]!==qe||t[68]!==Ye||t[69]!==Xe?(Ze=(0,Q.jsxs)(`section`,{className:`ls-field ls-main`,children:[qe,Ye,Xe]}),t[67]=qe,t[68]=Ye,t[69]=Xe,t[70]=Ze):Ze=t[70];let Qe;t[71]!==d||t[72]!==l||t[73]!==p?(Qe=l&&d&&(0,Q.jsxs)(`div`,{className:`ls-set`,children:[(0,Q.jsxs)(`div`,{className:`ls-set-text`,children:[(0,Q.jsx)(`span`,{className:`ls-set-name`,id:`ls-runtime-label`,children:`Run in`}),(0,Q.jsx)(`small`,{children:`Where the Claude process starts.`})]}),(0,Q.jsx)(oe,{className:`ls-seg`,value:l,onValueChange:e=>d(e),"aria-labelledby":`ls-runtime-label`,children:(0,Q.jsxs)(le,{children:[(0,Q.jsx)(me,{value:`windows`,children:p}),(0,Q.jsx)(me,{value:`wsl`,children:`WSL`})]})})]}),t[71]=d,t[72]=l,t[73]=p,t[74]=Qe):Qe=t[74];let $e;t[75]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,Q.jsx)(`label`,{className:`ls-set-name`,htmlFor:`ls-mode`,children:`Mode`}),t[75]=$e):$e=t[75];let et;t[76]===Ve?et=t[77]:(et=(0,Q.jsxs)(`div`,{className:`ls-set-text`,children:[$e,(0,Q.jsx)(`small`,{children:Ve})]}),t[76]=Ve,t[77]=et);let tt,nt;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(tt=e=>C(e),nt=oi.map(_i),t[78]=tt,t[79]=nt):(tt=t[78],nt=t[79]);let rt;t[80]===S?rt=t[81]:(rt=(0,Q.jsx)(Ce,{id:`ls-mode`,className:`ls-ctl`,value:S,onValueChange:tt,options:nt}),t[80]=S,t[81]=rt);let it;t[82]!==et||t[83]!==rt?(it=(0,Q.jsxs)(`div`,{className:`ls-set`,children:[et,rt]}),t[82]=et,t[83]=rt,t[84]=it):it=t[84];let at;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,Q.jsx)(`label`,{className:`ls-set-name`,htmlFor:`ls-model`,children:`Model`}),t[85]=at):at=t[85];let H=N===`__custom`?`A full model id.`:Ue,ot;t[86]===H?ot=t[87]:(ot=(0,Q.jsxs)(`div`,{className:`ls-set-text`,children:[at,(0,Q.jsx)(`small`,{children:H})]}),t[86]=H,t[87]=ot);let st;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(st=li.map(gi),t[88]=st):st=t[88];let U;t[89]===N?U=t[90]:(U=(0,Q.jsx)(Ce,{id:`ls-model`,className:`ls-ctl`,value:N,onValueChange:P,options:st}),t[89]=N,t[90]=U);let W;t[91]!==ot||t[92]!==U?(W=(0,Q.jsxs)(`div`,{className:`ls-set`,children:[ot,U]}),t[91]=ot,t[92]=U,t[93]=W):W=t[93];let ct;t[94]!==_e||t[95]!==F||t[96]!==N?(ct=N===`__custom`&&(0,Q.jsxs)(`div`,{className:`ls-sub`,children:[(0,Q.jsx)(de,{className:`ls-line`,value:F,onChange:e=>ee(e.target.value),placeholder:`claude-opus-4-1`,"aria-label":`Custom model id`,"aria-invalid":_e||void 0,spellCheck:!1}),_e&&(0,Q.jsx)(`small`,{"data-warn":!0,children:`Model ids can only use letters, digits and . - _ : / [ ]`})]}),t[94]=_e,t[95]=F,t[96]=N,t[97]=ct):ct=t[97];let G;t[98]!==i||t[99]!==k?(G=i&&(0,Q.jsxs)(`div`,{className:`ls-set`,children:[(0,Q.jsxs)(`div`,{className:`ls-set-text`,children:[(0,Q.jsx)(`label`,{className:`ls-set-name`,htmlFor:`ls-branch`,children:`Worktree branch`}),(0,Q.jsx)(`small`,{children:`Optional. Creates a git worktree.`})]}),(0,Q.jsx)(de,{id:`ls-branch`,className:`ls-line ls-ctl`,value:k,onChange:e=>A(e.target.value),placeholder:`feat/ksuid`,spellCheck:!1})]}),t[98]=i,t[99]=k,t[100]=G):G=t[100];let K=j||void 0,lt;t[101]===Symbol.for(`react.memo_cache_sentinel`)?(lt=(0,Q.jsx)(`span`,{className:`ls-set-name`,children:`Skip permission prompts`}),t[101]=lt):lt=t[101];let q=j?`Claude can edit files and run commands without asking.`:`Claude asks before editing files or running commands.`,ut;t[102]===q?ut=t[103]:(ut=(0,Q.jsxs)(`span`,{className:`ls-set-text`,children:[lt,(0,Q.jsx)(`small`,{children:q})]}),t[102]=q,t[103]=ut);let dt;t[104]===j?dt=t[105]:(dt=(0,Q.jsx)(De,{id:`ls-skip`,checked:j,onCheckedChange:M}),t[104]=j,t[105]=dt);let ft;t[106]!==K||t[107]!==ut||t[108]!==dt?(ft=(0,Q.jsxs)(`label`,{className:`ls-set ls-set--click`,htmlFor:`ls-skip`,"data-danger":K,children:[ut,dt]}),t[106]=K,t[107]=ut,t[108]=dt,t[109]=ft):ft=t[109];let pt=re||void 0,mt,ht;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(mt=()=>I(hi),ht=(0,Q.jsx)(`span`,{className:`ls-set-name`,children:`Environment variables`}),t[110]=mt,t[111]=ht):(mt=t[110],ht=t[111]);let gt;t[112]===ge.length?gt=t[113]:(gt=ge.length>0&&(0,Q.jsx)(`b`,{children:ge.length}),t[112]=ge.length,t[113]=gt);let _t;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,Q.jsx)(w,{size:14,strokeWidth:2.5,"aria-hidden":!0}),t[114]=_t):_t=t[114];let vt;t[115]!==re||t[116]!==gt?(vt=(0,Q.jsxs)(`button`,{type:`button`,className:`ls-foldhead`,"aria-expanded":re,onClick:mt,children:[ht,gt,_t]}),t[115]=re,t[116]=gt,t[117]=vt):vt=t[117];let yt;t[118]!==B||t[119]!==re||t[120]!==te?(yt=re&&(0,Q.jsxs)(`div`,{className:`ls-foldbody`,children:[(0,Q.jsx)(Ee,{className:`ls-env-input`,value:te,onChange:e=>ne(e.target.value),placeholder:`ANTHROPIC_API_KEY=sk-...`,"aria-label":`Environment variables, one KEY=value per line`,spellCheck:!1,autoFocus:!0}),(0,Q.jsx)(`small`,{"data-warn":B>0||void 0,children:B>0?`${B} line${B===1?``:`s`} ignored — use KEY=value.`:`One KEY=value per line, set before claude starts.`})]}),t[118]=B,t[119]=re,t[120]=te,t[121]=yt):yt=t[121];let bt;t[122]!==pt||t[123]!==vt||t[124]!==yt?(bt=(0,Q.jsxs)(`div`,{className:`ls-fold`,"data-open":pt,children:[vt,yt]}),t[122]=pt,t[123]=vt,t[124]=yt,t[125]=bt):bt=t[125];let xt=L||void 0,St,Ct;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(St=()=>ie(mi),Ct=(0,Q.jsx)(`span`,{className:`ls-set-name`,children:`Command`}),t[126]=St,t[127]=Ct):(St=t[126],Ct=t[127]);let wt;t[128]===z?wt=t[129]:(wt=z&&(0,Q.jsx)(`span`,{className:`ls-edited`,children:`Edited`}),t[128]=z,t[129]=wt);let Tt;t[130]!==L||t[131]!==R?(Tt=!L&&(0,Q.jsx)(`code`,{className:`ls-cmdpeek`,children:R.replace(/\s+/g,` `)}),t[130]=L,t[131]=R,t[132]=Tt):Tt=t[132];let Et;t[133]===Symbol.for(`react.memo_cache_sentinel`)?(Et=(0,Q.jsx)(w,{size:14,strokeWidth:2.5,"aria-hidden":!0}),t[133]=Et):Et=t[133];let Dt;t[134]!==L||t[135]!==wt||t[136]!==Tt?(Dt=(0,Q.jsxs)(`button`,{type:`button`,className:`ls-foldhead`,"aria-expanded":L,"aria-controls":`ls-cmd`,onClick:St,children:[Ct,wt,Tt,Et]}),t[134]=L,t[135]=wt,t[136]=Tt,t[137]=Dt):Dt=t[137];let J;t[138]!==L||t[139]!==z||t[140]!==R||t[141]!==je||t[142]!==Ne?(J=L&&(0,Q.jsxs)(`div`,{className:`ls-foldbody`,children:[(0,Q.jsxs)(`div`,{className:`ls-cmd`,"data-edited":z||void 0,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,children:`$`}),(0,Q.jsx)(`textarea`,{id:`ls-cmd`,className:`ls-cmd-input`,value:R,onChange:e=>je(e.target.value),spellCheck:!1,rows:3,"aria-label":`Launch command`})]}),(0,Q.jsxs)(`div`,{className:`ls-cmdfoot`,children:[(0,Q.jsx)(`span`,{className:z?`ls-edited`:`ls-auto`,children:z?`Edited by hand — the options above no longer apply.`:`Follows the options above.`}),z&&(0,Q.jsx)(`button`,{type:`button`,className:`ls-reset`,onClick:Ne,children:`Reset`})]})]}),t[138]=L,t[139]=z,t[140]=R,t[141]=je,t[142]=Ne,t[143]=J):J=t[143];let Y;t[144]!==xt||t[145]!==Dt||t[146]!==J?(Y=(0,Q.jsxs)(`div`,{className:`ls-fold`,"data-open":xt,children:[Dt,J]}),t[144]=xt,t[145]=Dt,t[146]=J,t[147]=Y):Y=t[147];let Ot;t[148]!==Qe||t[149]!==it||t[150]!==W||t[151]!==ct||t[152]!==G||t[153]!==ft||t[154]!==bt||t[155]!==Y?(Ot=(0,Q.jsxs)(`div`,{className:`ls-list`,children:[Qe,it,W,ct,G,ft,bt,Y]}),t[148]=Qe,t[149]=it,t[150]=W,t[151]=ct,t[152]=G,t[153]=ft,t[154]=bt,t[155]=Y,t[156]=Ot):Ot=t[156];let X;t[157]!==Ze||t[158]!==Ot?(X=(0,Q.jsx)(`div`,{className:`ls-scroll`,children:(0,Q.jsxs)(`div`,{className:`ls-form`,children:[Ze,Ot]})}),t[157]=Ze,t[158]=Ot,t[159]=X):X=t[159];let kt;t[160]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,Q.jsxs)(`span`,{className:`ls-hint`,children:[(0,Q.jsx)(`kbd`,{children:fi?`⌘`:`Ctrl`}),(0,Q.jsx)(`kbd`,{children:`↵`}),` launch`]}),t[160]=kt):kt=t[160];let At;t[161]===c?At=t[162]:(At=(0,Q.jsx)(O,{variant:`ghost`,onClick:c,children:`Cancel`}),t[161]=c,t[162]=At);let jt=!Fe,Mt;t[163]!==Le||t[164]!==jt?(Mt=(0,Q.jsx)(O,{variant:`solid`,onClick:Le,disabled:jt,children:`Launch Claude`}),t[163]=Le,t[164]=jt,t[165]=Mt):Mt=t[165];let Z;t[166]!==At||t[167]!==Mt?(Z=(0,Q.jsxs)(`div`,{className:`ls-bar`,children:[kt,(0,Q.jsxs)(`div`,{className:`ls-bar-actions`,children:[At,Mt]})]}),t[166]=At,t[167]=Mt,t[168]=Z):Z=t[168];let Nt;return t[169]!==ze||t[170]!==X||t[171]!==Z?(Nt=(0,Q.jsxs)(`div`,{className:`cdv-pane cdv-pane--fade ls`,onKeyDown:ze,children:[X,Z]}),t[169]=ze,t[170]=X,t[171]=Z,t[172]=Nt):Nt=t[172],Nt}function mi(e){return!e}function hi(e){return!e}function gi(e){return{value:e.value,label:e.label}}function _i(e){return{value:e.value,label:e.label}}function vi(e){return di.test(e)}function yi(e){return e.length>0}function bi(e){return e.trim()}function xi({onInstalled:t}){let[n,i]=(0,$.useState)(null),[a,o]=(0,$.useState)(!1),[s,c]=(0,$.useState)(``),[l,u]=(0,$.useState)(null);return(0,$.useEffect)(()=>{let t=!1;r(`psmux_status`).then(e=>{t||(i(e),o(e.installing))}).catch(()=>{});let n=e(`psmux-install-progress`,e=>{e.payload?.line&&c(e.payload.line)});return()=>{t=!0,n.then(e=>e())}},[]),!n||!n.supported||n.available?null:(0,Q.jsxs)(`div`,{className:`cdv-psmux`,role:`status`,children:[(0,Q.jsxs)(`div`,{className:`cdv-psmux-copy`,children:[(0,Q.jsx)(`strong`,{children:`Keep this terminal alive`}),(0,Q.jsxs)(`span`,{children:[`Install psmux so closing the card or reloading the page doesn't end the session.`,l&&(0,Q.jsxs)(`span`,{className:`cdv-psmux-error`,children:[` `,l]})]}),a&&s&&(0,Q.jsx)(`code`,{className:`cdv-psmux-log`,children:s})]}),n.canInstall?(0,Q.jsxs)(O,{size:`sm`,variant:`solid`,disabled:a,onClick:async()=>{o(!0),u(null),c(``);try{let e=await r(`psmux_install`);i(e),I({title:`psmux installed`,description:e.version,tone:`success`}),t?.()}catch(e){u(e instanceof Error?e.message:String(e))}finally{o(!1)}},children:[a?(0,Q.jsx)(D,{}):null,a?`Installing…`:`Install psmux`]}):(0,Q.jsx)(`code`,{className:`cdv-psmux-log`,children:`winget install psmux`})]})}var Si=(0,$.lazy)(()=>be(()=>import(`./Terminal-DJJcg-t6.js`),__vite__mapDeps([0,1,2,3,4,5,6]))),Ci=(0,$.lazy)(()=>be(()=>import(`./DiffPane-bQsGoT7y.js`),__vite__mapDeps([7,1,3,8,9,2,4,5,10]))),wi={terminal:`Terminal`,trace:`Trace`,usage:`Usage`,diff:`Diff`,issue:`Issue`,pr:`PR`,prompt:`Description`,knowledge:`Knowledge`},Ti=[`prompt`,`terminal`,`trace`,`usage`,`diff`,`issue`,`pr`,`knowledge`];function Ei(e){let t=(0,kr.c)(7),{d:n,size:r,sw:i}=e,a=r===void 0?16:r,o=i===void 0?2:i,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={flex:`none`},t[0]=s):s=t[0];let c;t[1]===n?c=t[2]:(c=(0,Q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:n}),t[1]=n,t[2]=c);let l;return t[3]!==a||t[4]!==o||t[5]!==c?(l=(0,Q.jsx)(`svg`,{width:a,height:a,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:o,"aria-hidden":`true`,style:s,children:c}),t[3]=a,t[4]=o,t[5]=c,t[6]=l):l=t[6],l}async function Di(e,t){let n=[],r=null,i=0;for(;;){let a=await j(e,i);if(t()||(n.push(...a.turns),r=a,!a.hasMore))break;i=a.nextOffset}return{turns:n,lastPage:r}}function Oi(e){return!e||e.link.promptBody?`prompt`:e.link.sessionLink?.sessionId?`terminal`:`trace`}function ki(e){let t=``;for(let n of new TextEncoder().encode(e))t+=String.fromCharCode(n);return btoa(t)}function Ai(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``).slice(0,32).replace(/-+$/,``)||`card`}function ji(e){if(!e.length)return``;let t=`\x1B[0m`,n=`\x1B[2m`,r=[],i=e=>e.replace(/\r\n|\r|\n/g,`\r
17
- `);for(let a of e){let e=a.timestamp?new Date(a.timestamp).toLocaleString():``,o=a.role===`user`?`▶ user${t}`:`◀ assistant${t}`;r.push(`${o}${e?` ${n}· ${e}${t}`:``}`);for(let e of a.contentBlocks)if(e.kind===`text`)r.push(i(e.text));else if(e.kind===`thinking`){let a=e.text.length>240?e.text.slice(0,240)+`…`:e.text;r.push(`${n}[thinking] ${i(a)}${t}`)}else if(e.kind===`tool_use`)r.push(`${n}⚙ ${i(e.text)}${t}`);else if(e.kind===`tool_result`){let a=e.text.length>400?e.text.slice(0,400)+`…`:e.text;r.push(`${n}↳ ${i(a)}${t}`)}r.push(``)}return r.push(`${n}── session resumes below ──${t}`),r.push(``),r.join(`\r
18
- `)}var Mi=200,Ni=`cubic-bezier(0.22, 1, 0.36, 1)`,Pi=28,Fi=[{opacity:0,transform:`translateY(16px) scale(0.97)`},{opacity:1,transform:`none`}];function Ii({mode:t=`popup`}){let n=t===`popup`,i=(0,$.useRef)(null),a=V(e=>e.selectedCard),o=V(e=>e.selectCard),s=V(e=>e.renameCard),c=V(e=>e.deleteCard),u=V(e=>e.moveCard);V(e=>e.cards),V(e=>e.selectedCardId);let d=a(),{theme:f}=M(),p=ke(f),[m,g]=(0,$.useState)(()=>Oi(d)),_=z(d?.id),v=_?.proposals.filter(e=>e.status===`pending`).length??0,y=!!_&&_.proposals.length+_.injected.length+_.review.length>0,b=(0,$.useRef)(!1),[x,S]=(0,$.useState)(!1),[C,w]=(0,$.useState)(d?.id);d?.id!==C&&(w(d?.id),g(Oi(d)),S(!1));let[T,k]=(0,$.useState)([]),[A,N]=(0,$.useState)(null),[I,R]=(0,$.useState)(!1),[de,fe]=(0,$.useState)(!1),[pe,he]=(0,$.useState)(``),[B,ye]=(0,$.useState)(!1),[be,we]=(0,$.useState)(!1),[Ee,De]=(0,$.useState)(0),[Oe,Ae]=(0,$.useState)(720),je=(0,$.useRef)(!1),[Me,Ne]=(0,$.useState)(!1),[Pe,Fe]=(0,$.useState)(null),[Le,ze]=(0,$.useState)([]),Ve=(0,$.useRef)(null),[Ue,Ge]=(0,$.useState)(15),[qe,Ye]=(0,$.useState)(12),[Xe,Ze]=(0,$.useState)([]),[Qe,$e]=(0,$.useState)({}),[et,tt]=(0,$.useState)(!1),[nt,rt]=(0,$.useState)(null),[it,at]=(0,$.useState)(null),[H,ot]=(0,$.useState)(!1),[st,U]=(0,$.useState)(null),[W,ct]=(0,$.useState)([]),[G,K]=(0,$.useState)(1),[lt,q]=(0,$.useState)(``),[ut,dt]=(0,$.useState)([]),[ft,pt]=(0,$.useState)(0),[mt,ht]=(0,$.useState)(!1),gt=(0,$.useRef)(null),[_t,vt]=(0,$.useState)(!1),[yt,bt]=(0,$.useState)(!1),xt=(0,$.useRef)(null),St=(0,$.useRef)(m);(0,$.useEffect)(()=>{St.current=m},[m]);let Ct=(0,$.useCallback)(()=>{if(xt.current)return;if(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches){o(null);return}vt(!0);let e=180,t=i.current;n&&t&&(e=Mi,t.animate([...Fi].reverse(),{duration:Mi,easing:Ni,fill:`forwards`})),xt.current=setTimeout(()=>{xt.current=null,o(null)},e)},[o,n]);(0,$.useEffect)(()=>(window.addEventListener(`cdv-close`,Ct),()=>window.removeEventListener(`cdv-close`,Ct)),[Ct]),(0,$.useLayoutEffect)(()=>{let e=i.current;n&&e&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches&&e.animate(Fi,{duration:Mi,easing:Ni})},[n]),(0,$.useEffect)(()=>{xt.current&&=(clearTimeout(xt.current),null),vt(!1)},[d?.id]),(0,$.useEffect)(()=>()=>{xt.current&&clearTimeout(xt.current)},[]),(0,$.useEffect)(()=>{let e=e=>{e.key!==`Escape`||e.defaultPrevented||document.activeElement&&document.activeElement!==document.body||document.querySelector(`[role="dialog"], [role="menu"]`)||Ct()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Ct]);let wt=(0,$.useCallback)(e=>{e.preventDefault(),je.current=!0,bt(!0);let t=e.clientX,n=Oe,r=e=>{if(!je.current)return;let r=t-e.clientX;Ae(Math.min(Math.max(n+r,340),1280))},i=()=>{je.current=!1,bt(!1),document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i),document.body.style.cursor=``,document.body.style.userSelect=``};document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)},[Oe]);(0,$.useEffect)(()=>{re().then(e=>{Ge(e.terminalFontSize||15),Ye(e.sessionDetailFontSize||12),Ze(e.apiServices??[]),$e(e.defaultAPIServiceIds??{})}).catch(()=>{}),r(`tmux_available`).then(e=>tt(!!e)).catch(()=>tt(!1)),Tt()},[]);let Tt=(0,$.useCallback)(()=>{r(`psmux_status`).then(e=>rt(e.available?e.path??null:null)).catch(()=>rt(null))},[]);(0,$.useEffect)(()=>{if(!d)return;let e=d.link.sessionLink?.sessionId,t=d.link.cardRuntime;if(k([]),N(null),ye(!1),ze(d.link.queuedPrompts??[]),q(``),dt([]),pt(0),!e)return;let n=!1;return b.current=!0,(async()=>{R(!0);let r=[],i=null;try{({turns:r,lastPage:i}=await Di(e,()=>n))}catch{}finally{b.current=!1,n||R(!1)}n||(k(r),N(i),t&&ye(!0))})(),()=>{n=!0}},[d?.id]),(0,$.useEffect)(()=>{d?.link.sessionLink?.sessionId&&d?.link.cardRuntime&&!B&&ye(!0)},[d?.link.cardRuntime]),(0,$.useEffect)(()=>{d&&ze(d.link.queuedPrompts??[])},[d?.link.updatedAt]);let Et=d?.link.sessionLink?.sessionId;(0,$.useEffect)(()=>{if(m!==`trace`||!Et||b.current)return;let e=!1;return Di(Et,()=>e).then(({turns:t,lastPage:n})=>{e||(k(t),N(n))}).catch(()=>{}),()=>{e=!0}},[m,Et,d?.link.updatedAt]);let Dt=async(e,t,n)=>{R(!0);try{let r=await j(e,t);N(r),k(e=>n?r.turns:[...e,...r.turns])}catch{}finally{R(!1)}};if((0,$.useEffect)(()=>{if(d?.link.sessionLink?.sessionId){if(gt.current&&clearTimeout(gt.current),lt.trim().length<2)dt([]),pt(0),ht(!1);else return ht(!0),gt.current=setTimeout(async()=>{try{let e=await Se(d.link.sessionLink.sessionId,lt.trim());dt(e),pt(0)}catch{dt([])}finally{ht(!1)}},300),()=>{gt.current&&clearTimeout(gt.current)}}},[lt,d?.link.sessionLink?.sessionId]),!d)return null;let J=d.link.sessionLink?.sessionId,Y=d.link.projectPath??d.session?.projectPath,Ot=d.link.worktreeLink?.branch,X=d.link.prLinks[0],kt=d.link.worktreeLink?.path??Y,At=d.link.issueLink,jt=d.link.promptBody,Mt=!!J||!!jt,Z=d.link.cardRuntime??null,Nt=async e=>{try{await r(`set_card_runtime`,{cardId:d.id,runtime:e}),await V.getState().refresh()}catch(e){V.setState({error:String(e)})}},Pt=()=>{pe.trim()&&s(d.id,pe.trim()),fe(!1)},Ft=async()=>{if(!d)return;let e=d.displayTitle||d.link.name||`this card`;await ne(`Delete "${e}"?\n\n${B?`The open terminal will be stopped. The Claude session .jsonl on disk is not deleted.`:`The Claude session .jsonl on disk is not deleted — you can still find it in All Sessions.`}`,{title:`Delete card`,kind:`warning`,okLabel:`Delete`,cancelLabel:`Cancel`})&&c(d.id)},It=async e=>{if(!d)return;let t=d.link.sessionLink?.sessionPath;if(!t)return;let n=e+1;if(await ne(`Checkpoint session to turn ${n}?\n\nEverything after this turn is removed from the .jsonl. The original is backed up next to it as <session>.jsonl.bkp.`,{title:`Checkpoint session`,kind:`warning`,okLabel:`Checkpoint`,cancelLabel:`Cancel`}))try{await se(t,n),Dt(d.link.sessionLink.sessionId,0,!0)}catch(e){V.setState({error:String(e)})}},Lt=Z===`wsl`,Rt=Z===`windows`&&!!nt,zt=Lt&&et||Rt,Bt=Rt?`windows`:`wsl`,Vt=d.link.assistantId??`claude`,Ht=L[Vt]??`claude`,Ut=(0,$.useMemo)(()=>_e({apiServices:Xe,defaultAPIServiceIds:Qe},d.link.apiServiceId,Vt),[Xe,Qe,d.link.apiServiceId,Vt]),Wt=(0,$.useMemo)(()=>Ut?.baseURL?[`ANTHROPIC_BASE_URL=${Ut.baseURL}`]:[],[Ut]),[Gt,Kt]=(0,$.useState)(null);(0,$.useEffect)(()=>{r(`launcher_info`).then(Kt).catch(()=>{})},[]);let qt=(0,$.useMemo)(()=>Ut?{exe:Ut.launcherPrefix?`${Ut.launcherPrefix} ${Ht}`:Ht,modelFlag:Ut.modelFlag?` --model ${Ut.modelFlag}`:``,separator:te(Ut)?` --`:``}:{exe:Ht,modelFlag:``,separator:``},[Ut,Ht]),Jt=Ai(d.displayTitle),Yt=d.id,Xt=st?.prompt??jt??``,Zt=d.link.promptImagePaths?.length?h(Xt,d.link.promptImagePaths):Xt,Qt=st?.dangerouslySkipPermissions??!1,$t=st?.envPrefix??[],en=st?.model??``,tn=(0,$.useCallback)((e,t,n,r,i,a=``)=>{let o=[`DEVBOARD_CARD_ID=${Yt}`,`DEVBOARD_HANDLE=${Jt}`,...Wt,...i].join(` `)+` `,s=e?.match(/^([A-Za-z]):[\\/]*(.*)$/),c=e&&s?`/mnt/${s[1].toLowerCase()}/${s[2].replace(/\\/g,`/`)}`:e,l=c?`cd '${c.replace(/'/g,`'\\''`)}' && `:``,u=r?` --dangerously-skip-permissions`:``,d=`${a?` --model ${a}`:qt.modelFlag}${qt.separator}${u}`;return t?`${l}${o}${qt.exe} --resume ${t}${d}`:`${l}${o}${qt.exe}${d} '${n.replace(/'/g,`'\\''`)}'`},[Yt,Jt,Wt,qt]),nn=(0,$.useCallback)((e,t,n,r,i,a=``,o=!1)=>{let s=[`DEVBOARD_CARD_ID=${Yt}`,`DEVBOARD_HANDLE=${Jt}`,...Wt,...i].map(e=>`set ${e}&& `).join(``),c=e?`cd "${e}" && `:``,l=r?` --dangerously-skip-permissions`:``,u=`${a?` --model ${a}`:qt.modelFlag}${qt.separator}${l}`;if(t)return`${c}${s}${qt.exe} --resume ${t}${u}`;let d=ki(n);if(Gt&&!o&&d.length<=6e3){let e=e=>`"${e.split(`\\`).join(`/`)}"`;return`${c}${s}${e(Gt.node)} ${e(Gt.script)} ${d} ${qt.exe}${u}`}return`${c}${s}${qt.exe}${u} "${n.replace(/"/g,`""`)}"`},[Yt,Jt,Wt,qt,Gt]),rn=st?.commandOverride??tn(Y??void 0,J??null,Zt,Qt,$t,en),an=st?.commandOverride??nn(Y??void 0,J??null,Zt,Qt,$t,en),on=`devboard-${d.id}`,{shellCommand:sn,terminalInput:cn,external:ln}=(()=>{if(Rt&&nt)return{shellCommand:[nt,...W.some(e=>e.index===G)?[`select-window`,`-t`,`${on}:${G}`,`;`]:[],`attach-session`,`-t`,on],terminalInput:``,external:{argv:[nt,`attach-session`,`-t`,on]}};if(zt){let e=`${rn}; exec bash`,t=btoa(unescape(encodeURIComponent(e))),n=`tmux new-session -A -d -s '${on}' -- bash -lc "$(echo ${t} | base64 -d)" 2>/dev/null; tmux select-window -t '${on}:${G}' 2>/dev/null; exec tmux attach-session -t '${on}'`;return{shellCommand:[`wsl.exe`,`--`,`bash`,`-lc`,n],terminalInput:``,external:{wslScript:n}}}return Lt?{shellCommand:[`wsl.exe`],terminalInput:`${rn}\r`,external:{wslScript:`${rn}; exec bash`}}:{shellCommand:[`cmd.exe`],terminalInput:`${an}\r`,external:{cmdLine:an}}})(),un=async()=>{try{Rt&&await r(`tmux_ensure_session`,{name:on,cwdWindows:Y??``,command:an,runtime:`windows`}),await r(`open_in_terminal`,ln)}catch(e){V.setState({error:String(e)})}},dn=(0,$.useCallback)(async()=>{if(zt)try{let e=await r(`tmux_list_windows`,{session:on,runtime:Bt});ct(e),e.length>0&&!e.some(e=>e.index===G)&&K((e.find(e=>e.active)??e[0]).index)}catch{ct([])}},[zt,on,Bt,G]);(0,$.useEffect)(()=>{if(zt&&B){let e=setTimeout(dn,800);return()=>clearTimeout(e)}},[zt,B,dn,d.id]),(0,$.useEffect)(()=>{if(!Rt||!B||it===on)return;let e=!1;return r(`tmux_ensure_session`,{name:on,cwdWindows:Y??``,command:an,runtime:`windows`}).then(()=>{e||(K(e=>e===1?0:e),at(on))}).catch(e=>V.setState({error:String(e)})),()=>{e=!0}},[Rt,B,on]);let fn=async()=>{if(zt)try{let e=await r(`tmux_new_window`,{session:on,cwdWindows:Y??null,command:null,runtime:Bt});K(e),await dn()}catch(e){V.setState({error:String(e)})}},pn=(0,$.useRef)(0),mn=(0,$.useRef)(new Map);(0,$.useEffect)(()=>{if(!d)return;let t=d.link.sessionLink?.sessionId;if(!t)return;let n=!1,i=null,a=e(`hook-event`,e=>{if(n)return;let a=e.payload;a&&a.sessionId===t&&(a.eventName===`UserPromptSubmit`?pn.current=Date.now():a.eventName===`Stop`&&(i&&clearTimeout(i),i=setTimeout(async()=>{if(Date.now()-pn.current<1100)return;let e=V.getState().cards.find(e=>e.id===d.id)?.link.queuedPrompts??Le,t=Date.now(),n=e.find(e=>e.sendAutomatically&&(mn.current.get(e.id)??0)+62e3<t);if(!n||!Ve.current)return;let i=!1;if(n.selfCompactThresholdTokens!=null)try{i=await r(`should_drop_self_compact_prompt`,{cardId:d.id,promptId:n.id})}catch{i=!1}if(i){ae(d.id,n.id).then(()=>ze(e=>e.filter(e=>e.id!==n.id))).catch(()=>{});return}let a=n.imagePaths?.length?h(n.body,n.imagePaths):n.body;Ve.current(a+`\r`),mn.current.set(n.id,t);for(let[e,n]of mn.current)t-n>3e5&&mn.current.delete(e);ae(d.id,n.id).then(()=>ze(e=>e.filter(e=>e.id!==n.id))).catch(()=>{})},1e3)))});return()=>{n=!0,i&&clearTimeout(i),a.then(e=>e()).catch(()=>{})}},[d?.id,d?.link.sessionLink?.sessionId]);let hn=async e=>{if(zt&&e!==(W[0]?.index??1))try{await r(`tmux_kill_window`,{target:`${on}:${e}`,runtime:Bt}),G===e&&K(W[0]?.index??1),await dn()}catch(e){V.setState({error:String(e)})}},gn=()=>{Z?J?(ye(!0),g(`terminal`)):(ot(!0),g(`terminal`)):g(`terminal`)};(0,$.useEffect)(()=>{!J&&jt&&!B&&!H&&!st&&Z&&(ot(!0),g(`terminal`))},[d.id,Z]);let _n=async(e,t,n)=>{try{let r=await ee(d.id,e,t,n);ze(e=>[...e,r])}catch{}},vn=async(e,t,n)=>{if(Pe)try{let r=n??[];await ue(d.id,Pe.id,e,t,r),ze(n=>n.map(n=>n.id===Pe.id?{...n,body:e,sendAutomatically:t,imagePaths:r.length>0?r:void 0}:n))}catch{}},yn=async e=>{try{await ae(d.id,e),ze(t=>t.filter(t=>t.id!==e))}catch{}},bn=async e=>{let t=Le.find(t=>t.id===e);if(!t||!Ve.current)return;let n=t.imagePaths?.length?h(t.body,t.imagePaths):t.body;Ve.current(n+`\r`),yn(e)},xn=e=>{Fe(e),Ne(!0)},Sn=e=>{ut.length!==0&&pt(t=>e===`next`?(t+1)%ut.length:(t-1+ut.length)%ut.length)},Cn=e=>g(e),wn=Ti.filter(e=>e===`terminal`?Mt:e===`trace`||e===`usage`?!!J:e===`diff`?!!kt:e===`issue`?!!At:e===`pr`?!!X:e===`prompt`?!!jt:e===`knowledge`&&y),Tn=wn.length>1,En={"--cdv-dx":`${(Ti.indexOf(m)>=Ti.indexOf(St.current)?1:-1)*14}px`},Dn=(X?.status??``).toUpperCase(),On=Dn===`MERGED`?`default`:Dn===`CLOSED`?`danger`:`success`,kn=H&&!!Y&&!B,An=m===`terminal`&&B,jn=(0,Q.jsxs)(`div`,{ref:i,className:`cdv`,"data-mode":n?`popup`:`drawer`,"data-closing":_t||void 0,"data-resizing":yt||void 0,style:n?{...p.mat.ultrathick,border:`1px solid ${p.border}`,borderRadius:Pi}:{width:Oe,minWidth:340,maxWidth:1280,...p.mat.ultrathick,borderLeft:`1px solid ${p.border}`,borderTopLeftRadius:34,borderBottomLeftRadius:34},children:[!n&&(0,Q.jsx)(`div`,{onMouseDown:wt,className:`cdv-resize`,"aria-hidden":`true`,children:(0,Q.jsx)(`span`,{className:`cdv-grip`})}),(0,Q.jsxs)(`header`,{className:`cdv-head`,children:[(0,Q.jsxs)(`div`,{className:`cdv-row cdv-rise`,style:{"--i":0},children:[de?(0,Q.jsx)(`input`,{autoFocus:!0,className:`cdv-title-input`,value:pe,"aria-label":`Card title`,onChange:e=>he(e.target.value),onBlur:Pt,onKeyDown:e=>{e.key===`Enter`&&Pt(),e.key===`Escape`&&(e.stopPropagation(),fe(!1))}}):(0,Q.jsx)(`h2`,{className:`cdv-title`,children:(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{he(d.displayTitle),fe(!0)},title:`Rename`,children:d.displayTitle})}),(0,Q.jsxs)(`div`,{className:`cdv-tools`,children:[jt&&(0,Q.jsx)(O,{icon:!0,size:`sm`,variant:`ghost`,"aria-label":x?`Stop editing task`:`Edit task`,"aria-pressed":x,"data-active":x||void 0,onClick:()=>S(e=>!e),title:`Edit task`,children:(0,Q.jsx)(Re,{size:16,strokeWidth:2,"aria-hidden":!0})}),(0,Q.jsx)(O,{icon:!0,size:`sm`,variant:`ghost`,"aria-label":`Close`,onClick:Ct,title:`Close (Esc)`,children:(0,Q.jsx)(Ei,{d:`M6 18 18 6M6 6l12 12`,sw:2.25})})]})]}),(0,Q.jsxs)(`div`,{className:`cdv-bar`,children:[(0,Q.jsxs)(`div`,{className:`cdv-meta cdv-rise`,style:{"--i":1,...x?{display:`none`}:null},children:[(0,Q.jsx)(Ce,{"aria-label":`Status`,className:`cdv-status`,value:d.link.column,options:ie.map(e=>{let t=e===`all_sessions`&&(d.link.manuallyArchived||d.link.column!==e);return{value:e,label:(0,Q.jsxs)(`span`,{className:`cdv-st`,"data-st":t?`archived`:e,children:[(0,Q.jsx)(`i`,{"aria-hidden":!0}),t?`Archived`:F[e]]})}}),onValueChange:e=>{e!==d.link.column&&u(d.id,e)}}),d.projectName&&(0,Q.jsx)(E,{title:Y??``,className:`cdv-badge`,children:d.projectName}),Ot&&(0,Q.jsxs)(E,{title:`Branch: ${Ot}`,className:`cdv-badge cdv-badge--branch`,children:[(0,Q.jsx)(Ei,{d:`M6 3v12m0 0a3 3 0 1 0 0 6 3 3 0 0 0 0-6Zm12-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm0 0a9 9 0 0 1-9 9`,size:12}),(0,Q.jsx)(`span`,{children:Ot})]}),X&&(0,Q.jsx)(`button`,{type:`button`,className:`cdv-chip`,onClick:()=>Cn(`pr`),title:X.title??``,children:(0,Q.jsxs)(E,{tone:On,children:[`PR #`,X.number]})}),At&&(0,Q.jsx)(`button`,{type:`button`,className:`cdv-chip`,onClick:()=>Cn(`issue`),title:At.title??``,children:(0,Q.jsxs)(E,{tone:`outline`,children:[`#`,At.number]})}),(0,Q.jsx)(P,{sessionId:J})]}),(0,Q.jsxs)(`div`,{className:`cdv-actions cdv-rise`,style:{"--i":2,...x?{display:`none`}:null},children:[Mt&&(0,Q.jsxs)(O,{variant:`solid`,className:`cdv-primary`,onClick:gn,title:B?`Switch to terminal view`:J?`Resume this session`:`Start Claude session`,children:[(0,Q.jsx)(Ei,{d:`m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5`,size:15,sw:2.5}),B?`Terminal`:J?`Resume`:`Start`]}),Mt&&B&&(0,Q.jsx)(Te,{label:`Queue a prompt to send to Claude later`,side:`bottom`,children:(0,Q.jsx)(O,{icon:!0,"aria-label":`Queue prompt`,onClick:()=>{Fe(null),Ne(!0)},children:(0,Q.jsx)(Ie,{size:16})})}),Mt&&B&&(0,Q.jsx)(Te,{label:`Set up and launch again`,side:`bottom`,children:(0,Q.jsx)(O,{icon:!0,"aria-label":`Set up and launch again`,onClick:()=>{we(!1),U(null),ye(!1),ot(!0),g(`terminal`)},children:(0,Q.jsx)(Be,{size:16})})}),Mt&&Z&&(0,Q.jsx)(Te,{label:`Open in external terminal`,side:`bottom`,children:(0,Q.jsx)(O,{icon:!0,"aria-label":`Open in external terminal`,onClick:un,children:(0,Q.jsx)(Ke,{size:16})})}),Y&&(0,Q.jsx)(Te,{label:`Open in editor`,side:`bottom`,children:(0,Q.jsx)(O,{icon:!0,"aria-label":`Open in editor`,onClick:()=>ve(Y),children:(0,Q.jsx)(l,{size:16})})}),(0,Q.jsx)(Te,{label:`Delete card`,side:`bottom`,children:(0,Q.jsx)(O,{icon:!0,variant:`danger`,className:`cdv-delete`,"aria-label":`Delete card`,onClick:Ft,children:(0,Q.jsx)(Je,{size:16})})})]})]})]}),Tn&&(0,Q.jsx)(`div`,{className:`cdv-tabs`,style:x?{display:`none`}:void 0,children:(0,Q.jsx)(oe,{value:m,onValueChange:e=>Cn(e),children:(0,Q.jsx)(le,{"aria-label":`Card sections`,children:wn.map(e=>(0,Q.jsxs)(me,{value:e,children:[wi[e],e===`knowledge`&&v>0&&(0,Q.jsx)(`span`,{className:`tr-n`,children:v}),e===`terminal`&&B&&(0,Q.jsx)(`span`,{className:`cdv-live`,role:`img`,"aria-label":`Session running`})]},e))})})}),x&&jt&&(0,Q.jsx)(zr,{card:d,onDone:()=>S(!1)},d.id),(0,Q.jsxs)(`div`,{className:`cdv-body`,"data-dark":An||void 0,style:x?{display:`none`}:void 0,children:[m===`terminal`&&Mt&&!Z&&(0,Q.jsxs)(`div`,{className:`cdv-pane cdv-empty`,style:En,children:[(0,Q.jsxs)(`div`,{className:`cdv-empty-copy`,children:[(0,Q.jsx)(`h3`,{children:`Where should Claude run?`}),(0,Q.jsx)(`p`,{children:Y?.startsWith(`/`)?(0,Q.jsxs)(Q.Fragment,{children:[`This project lives under `,(0,Q.jsx)(`code`,{children:`/`}),`, so WSL is the natural pick. Saved per card.`]}):Y?(0,Q.jsxs)(Q.Fragment,{children:[`Windows suits projects under `,(0,Q.jsx)(`code`,{children:`C:\\`}),`; WSL suits `,(0,Q.jsx)(`code`,{children:`/home/`}),`. Saved per card.`]}):(0,Q.jsx)(Q.Fragment,{children:`Choose where Claude launches for this card. Saved per card.`})})]}),(0,Q.jsx)(`div`,{className:`cdv-runtimes`,children:[{id:`windows`,label:`Windows`,hint:nt?`psmux · stays running`:`cmd.exe`,d:`M3 5.5 10.5 4.5v7H3v-6Zm8.5-1.1L21 3v8.5h-9.5v-7.1ZM3 12.5h7.5v7L3 18.5v-6Zm8.5 0H21V21l-9.5-1.4v-7.1Z`},{id:`wsl`,label:`WSL`,hint:et?`wsl.exe + tmux · stays running`:`wsl.exe + bash`,d:`m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5`}].map(e=>(0,Q.jsxs)(`button`,{type:`button`,className:`cdv-runtime`,onClick:()=>Nt(e.id),children:[(0,Q.jsx)(`span`,{className:`cdv-tile`,children:(0,Q.jsx)(Ei,{d:e.d,size:20,sw:1.75})}),(0,Q.jsxs)(`span`,{className:`cdv-runtime-text`,children:[(0,Q.jsx)(`strong`,{children:e.label}),(0,Q.jsx)(`small`,{children:e.hint})]}),e.id===`wsl`&&Y?.startsWith(`/`)&&(0,Q.jsx)(E,{children:`Suggested`})]},e.id))}),(0,Q.jsx)(xi,{onInstalled:Tt})]}),Mt&&Z&&B&&(0,Q.jsxs)(`div`,{className:m===`terminal`?`cdv-pane cdv-pane--fade cdv-term`:`hidden`,style:En,children:[Z===`windows`&&(0,Q.jsx)(xi,{onInstalled:Tt}),(0,Q.jsx)(qr,{card:d}),(0,Q.jsx)(Ur,{prompts:Le,onSendNow:bn,onEdit:xn,onRemove:yn}),zt&&W.length>0&&(0,Q.jsxs)(`div`,{className:`cdv-termtabs`,role:`tablist`,"aria-label":`Terminal windows`,children:[W.map(e=>{let t=e.index===G;return(0,Q.jsxs)(`div`,{role:`tab`,"aria-selected":t,tabIndex:0,className:`cdv-termtab`,"data-active":t||void 0,onClick:()=>K(e.index),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),K(e.index))},title:e.name,children:[(0,Q.jsx)(`span`,{children:e.index===1?`Claude`:e.name||`tab ${e.index}`}),e.index!==1&&(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),hn(e.index)},"aria-label":`Close ${e.name||`tab ${e.index}`}`,title:`Close tab`,children:(0,Q.jsx)(Ei,{d:`M6 18 18 6M6 6l12 12`,size:11,sw:2.5})})]},e.index)}),(0,Q.jsx)(`button`,{type:`button`,className:`cdv-termadd`,onClick:fn,"aria-label":`New shell tab`,title:`New shell tab`,children:(0,Q.jsx)(Ei,{d:`M12 4.5v15m7.5-7.5h-15`,size:12,sw:2.5})})]}),be&&(0,Q.jsxs)(`div`,{className:`cdv-exited`,role:`status`,children:[(0,Q.jsx)(`span`,{className:`cdv-exited-dot`,"aria-hidden":!0}),(0,Q.jsxs)(`span`,{className:`cdv-exited-text`,children:[(0,Q.jsx)(`strong`,{children:`Process exited`}),(0,Q.jsx)(`span`,{children:`Run the same command again, or change the setup first.`})]}),(0,Q.jsxs)(`button`,{type:`button`,className:`cdv-exited-btn`,onClick:()=>{we(!1),De(e=>e+1)},children:[(0,Q.jsx)(He,{size:14,strokeWidth:2.25,"aria-hidden":!0}),`Run again`]}),(0,Q.jsxs)(`button`,{type:`button`,className:`cdv-exited-btn`,"data-primary":!0,onClick:()=>{we(!1),U(null),ye(!1),ot(!0)},children:[(0,Q.jsx)(We,{size:14,strokeWidth:2.25,"aria-hidden":!0}),`Edit setup`]})]}),(0,Q.jsx)($.Suspense,{fallback:null,children:Rt&&it!==on?(0,Q.jsx)(D,{}):(0,Q.jsx)(Si,{ptyId:`term-${d.id}-${G}`,command:sn,initialInput:cn,onExit:()=>we(!0),writeRef:Ve,fontSize:Ue,initialScrollback:J?ji(T):void 0},`${G}-${Ee}`)})]}),m===`terminal`&&Mt&&Z&&kn&&Y&&(0,Q.jsx)(pi,{projectPath:Y,initialPrompt:jt??``,canCreateWorktree:!1,runtime:Z,onRuntimeChange:Nt,windowsLabel:nt?`Windows (psmux)`:`Windows (cmd.exe)`,initialSkipPermissions:!1,buildCommand:e=>Lt?tn(Y,J??null,e.prompt,e.dangerouslySkipPermissions,e.envPrefix,e.model):nn(Y,J??null,e.prompt,e.dangerouslySkipPermissions,e.envPrefix,e.model,!0),onLaunch:e=>{U(e),ot(!1),ye(!0)},onCancel:()=>ot(!1)}),m===`terminal`&&Mt&&Z&&!B&&!kn&&(0,Q.jsx)(`div`,{className:`cdv-pane cdv-empty`,style:En,children:I?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(D,{}),(0,Q.jsxs)(`div`,{className:`cdv-empty-copy`,children:[(0,Q.jsx)(`h3`,{children:`Restoring session`}),(0,Q.jsx)(`p`,{children:`Reading the transcript so the terminal opens with its history.`})]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`cdv-tile cdv-tile--lg`,children:(0,Q.jsx)(Ei,{d:`m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5`,size:24,sw:1.5})}),(0,Q.jsxs)(`div`,{className:`cdv-empty-copy`,children:[(0,Q.jsx)(`h3`,{children:J?`Session is paused`:`Not started yet`}),(0,Q.jsx)(`p`,{children:J?`Resume to reattach to this Claude session.`:`Start to launch Claude with this card's prompt.`})]}),(0,Q.jsx)(O,{variant:`solid`,onClick:gn,children:J?`Resume session`:`Start session`})]})}),m===`trace`&&(0,Q.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:En,children:(0,Q.jsx)(ra,{turns:T,transcriptPage:A,loading:I,fontSize:qe,onLoadMore:()=>{J&&A?.hasMore&&Dt(J,A.nextOffset,!1)},searchText:lt,searchMatches:ut,currentMatchIdx:ft,isSearching:mt,onSearchChange:q,onNextMatch:()=>Sn(`next`),onPrevMatch:()=>Sn(`prev`),onCheckpoint:J?It:void 0})}),m===`usage`&&J&&(0,Q.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:En,children:(0,Q.jsx)(jr,{sessionId:J})}),m===`diff`&&kt&&(0,Q.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:En,children:(0,Q.jsx)($.Suspense,{fallback:(0,Q.jsxs)(`div`,{className:`cdv-diff-loading`,"aria-busy":`true`,children:[(0,Q.jsx)(D,{}),(0,Q.jsx)(`span`,{children:`Loading changes…`})]}),children:(0,Q.jsx)(Ci,{path:kt,isWorktree:!!d.link.worktreeLink?.path})})}),m===`issue`&&At&&(0,Q.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:En,children:(0,Q.jsx)(_a,{title:At.title??`Issue #${At.number}`,body:At.body,url:At.url,onOpenInBrowser:Y?()=>xe(Y,At.number).catch(()=>{}):void 0})}),m===`pr`&&X&&(0,Q.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:En,children:(0,Q.jsx)(_a,{title:X.title??`PR #${X.number}`,body:X.body,url:X.url,onOpenInBrowser:Y?()=>ge(Y,X.number).catch(()=>{}):void 0,mergeAction:Y&&X.status===`OPEN`?{onMerge:()=>ce(Y,X.number),number:X.number}:void 0,prMeta:{reviewDecision:X.reviewDecision,approvalCount:X.approvalCount,mergeStateStatus:X.mergeStateStatus,checkRuns:X.checkRuns??[],unresolvedThreads:X.unresolvedThreads}})}),m===`knowledge`&&_&&(0,Q.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:En,children:(0,Q.jsx)(Yr,{card:d,data:_})}),m===`prompt`&&d.link.promptBody&&(0,Q.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:En,children:(0,Q.jsx)(Ir,{card:d},d.id)})]}),(0,Q.jsx)(Vr,{open:Me,onClose:()=>{Ne(!1),Fe(null)},onSave:Pe?vn:_n,editBody:Pe?.body,editSendAuto:Pe?.sendAutomatically,editImagePaths:Pe?.imagePaths})]});return n?(0,Q.jsxs)(`div`,{className:`cdv-pop`,children:[(0,Q.jsx)(`div`,{className:`cdv-scrim`,"data-closing":_t||void 0,onClick:Ct,"aria-hidden":`true`}),jn]}):jn}function Li(e){let t=(0,kr.c)(25),{meta:n,c:r}=e,i=n.checkRuns,a;t[0]===i?a=t[1]:(a=i.reduce(zi,{}),t[0]=i,t[1]=a);let o=a,s=(o.FAILURE??0)+(o.CANCELLED??0)+(o.TIMED_OUT??0)+(o.STARTUP_FAILURE??0)+(o.ACTION_REQUIRED??0),c=(o.PENDING??0)+(o.QUEUED??0)+(o.IN_PROGRESS??0),l=o.SUCCESS??0,u=n.reviewDecision===`APPROVED`?`#3fb950`:n.reviewDecision===`CHANGES_REQUESTED`?`#f85149`:n.reviewDecision===`REVIEW_REQUIRED`?`#d29922`:r.textMuted,d=n.mergeStateStatus===`CLEAN`?`#3fb950`:n.mergeStateStatus===`BLOCKED`||n.mergeStateStatus===`DIRTY`?`#f85149`:n.mergeStateStatus===`UNSTABLE`||n.mergeStateStatus===`BEHIND`?`#d29922`:r.textMuted;if(!n.reviewDecision&&!n.mergeStateStatus&&i.length===0&&n.approvalCount==null)return null;let f;t[2]!==r||t[3]!==n.approvalCount||t[4]!==n.reviewDecision||t[5]!==u?(f=n.reviewDecision&&(0,Q.jsxs)(Bi,{color:u,c:r,children:[n.reviewDecision.replace(/_/g,` `).toLowerCase(),n.approvalCount!=null&&n.approvalCount>0?` · ${n.approvalCount}✓`:``]}),t[2]=r,t[3]=n.approvalCount,t[4]=n.reviewDecision,t[5]=u,t[6]=f):f=t[6];let p;t[7]!==r||t[8]!==d||t[9]!==n.mergeStateStatus?(p=n.mergeStateStatus&&(0,Q.jsxs)(Bi,{color:d,c:r,children:[`merge: `,n.mergeStateStatus.toLowerCase()]}),t[7]=r,t[8]=d,t[9]=n.mergeStateStatus,t[10]=p):p=t[10];let m;t[11]!==r||t[12]!==n.unresolvedThreads?(m=n.unresolvedThreads!=null&&n.unresolvedThreads>0&&(0,Q.jsxs)(Bi,{color:`#d29922`,c:r,title:`Unresolved review threads`,children:[n.unresolvedThreads,` unresolved thread`,n.unresolvedThreads===1?``:`s`]}),t[11]=r,t[12]=n.unresolvedThreads,t[13]=m):m=t[13];let h;t[14]!==r||t[15]!==i||t[16]!==s||t[17]!==c||t[18]!==l?(h=i.length>0&&(0,Q.jsx)(Bi,{color:s>0?`#f85149`:c>0?`#d29922`:`#3fb950`,c:r,title:i.map(Ri).join(`
19
- `),children:s>0?`${s}/${i.length} failing`:c>0?`${c}/${i.length} running`:`${l}/${i.length} passing`}),t[14]=r,t[15]=i,t[16]=s,t[17]=c,t[18]=l,t[19]=h):h=t[19];let g;return t[20]!==f||t[21]!==p||t[22]!==m||t[23]!==h?(g=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[f,p,m,h]}),t[20]=f,t[21]=p,t[22]=m,t[23]=h,t[24]=g):g=t[24],g}function Ri(e){return`${e.name}: ${e.conclusion??`pending`}`}function zi(e,t){let n=t.conclusion??`PENDING`;return e[n]=(e[n]??0)+1,e}function Bi(e){let t=(0,kr.c)(8),{children:n,color:r,title:i}=e,a=r+`1f`,o=`1px solid ${r}33`,s;t[0]!==r||t[1]!==a||t[2]!==o?(s={color:r,background:a,border:o},t[0]=r,t[1]=a,t[2]=o,t[3]=s):s=t[3];let c;return t[4]!==n||t[5]!==s||t[6]!==i?(c=(0,Q.jsx)(`span`,{className:`text-[11px] font-medium px-2 py-0.5 rounded-md cursor-default`,style:s,title:i,children:n}),t[4]=n,t[5]=s,t[6]=i,t[7]=c):c=t[7],c}var Vi={fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`},Hi=new Set([`Task`,`Agent`]),Ui=/^<(system-reminder|local-command-caveat|local-command-stdout|command-name|command-message|task-notification|user-prompt-submit-hook)\b/,Wi=14;function Gi(e){let t=e.indexOf(`: `);return t===-1?{name:e,args:``}:{name:e.slice(0,t),args:e.slice(t+2)}}function Ki(e,t){try{let n=JSON.parse(e)?.[t];if(typeof n==`string`)return n}catch{}let n=RegExp(`"${t}"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)`).exec(e);return n?n[1].replace(/\\n/g,`
20
- `).replace(/\\"/g,`"`).replace(/\\\\/g,`\\`):``}var qi=[`command`,`file_path`,`path`,`pattern`,`url`,`query`,`description`,`prompt`];function Ji(e){for(let t of qi){let n=Ki(e,t);if(n)return n.split(`
21
- `)[0]}return e}function Yi(e){let t=e.trim();if(t[0]!==`{`&&t[0]!==`[`)return e;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}}function Xi(e){let t=Math.round(e/1e3);if(t<1)return``;if(t<60)return`+${t}s`;let n=Math.floor(t/60);return n<60?`+${n}m${t%60?` ${t%60}s`:``}`:`+${Math.floor(n/60)}h ${n%60}m`}function Zi(e){let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function Qi(e){if(!e)return null;let t=new Date(e);if(Number.isNaN(t.getTime()))return null;let n=t.toDateString()===new Date().toDateString(),r=t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`});return{label:n?r:`${t.toLocaleDateString([],{month:`short`,day:`numeric`})}, ${r}`,full:t.toLocaleString()}}function $i(e,t){let n=e.contentBlocks.filter(e=>e.kind===`text`&&e.text.trim()),r=e.contentBlocks.filter(e=>e.kind===`tool_use`).map(e=>Gi(e.text)),i=e.contentBlocks.filter(e=>e.kind===`tool_result`),a=e.contentBlocks.length===0?e.textPreview||`(empty)`:null,o=e.role===`user`&&n.length===0&&a===null,s=e.role===`user`&&n.length>0&&n.every(e=>Ui.test(e.text.trimStart())),c=t?.timestamp?Date.parse(t.timestamp):NaN,l=e.timestamp?Date.parse(e.timestamp):NaN;return{turn:e,kind:o?`result`:s?`system`:e.role===`assistant`?`reply`:`prompt`,speaker:e.role===`assistant`?`Claude`:s?`System`:`You`,prose:n,calls:r,results:i,thinking:e.contentBlocks.some(e=>e.kind===`thinking`),fallback:a,gap:Number.isNaN(c)||Number.isNaN(l)?null:Math.max(0,l-c),spawns:r.filter(e=>Hi.has(e.name)).length}}var ea=36;function ta(e){let t=e.prose.reduce((e,t)=>e+Math.ceil(t.text.length/90)+(t.text.split(`
22
- `).length-1),0);return 40+Math.min(t,Wi)*24+e.calls.length*28+e.results.length*40+(e.kind===`prompt`?14:0)}function na(e,t){switch(t){case`messages`:return e.kind!==`result`&&(e.prose.length>0||e.fallback!==null);case`tools`:return e.calls.length>0||e.results.length>0;case`agents`:return e.spawns>0;default:return!0}}function ra({turns:e,transcriptPage:t,loading:n,fontSize:r,onLoadMore:i,searchText:a,searchMatches:o,currentMatchIdx:s,isSearching:c,onSearchChange:l,onNextMatch:u,onPrevMatch:d,onCheckpoint:f}){let p=o.length>0?o[s]:-1,m=(0,$.useMemo)(()=>new Set(o),[o]),h=(0,$.useRef)(null),g=a.length>=2,[_,v]=(0,$.useState)(`all`),y=g?`all`:_,b=(0,$.useMemo)(()=>e.map((t,n)=>$i(t,e[n-1])),[e]),x=(0,$.useMemo)(()=>{let e=0,t=0,n=NaN,r=NaN;for(let i of b){e+=i.calls.length,t+=i.spawns;let a=i.turn.timestamp?Date.parse(i.turn.timestamp):NaN;Number.isNaN(a)||(Number.isNaN(n)&&(n=a),r=a)}return{calls:e,spawns:t,span:Number.isNaN(n)?null:r-n}},[b]),S=(0,$.useMemo)(()=>b.filter(e=>na(e,y)),[b,y]),[C,w]=(0,$.useState)(!1);(0,$.useEffect)(()=>{if(!f)return;let e=e=>{e.key===`Control`&&w(!0)},t=e=>{e.key===`Control`&&w(!1)},n=()=>w(!1);return window.addEventListener(`keydown`,e),window.addEventListener(`keyup`,t),window.addEventListener(`blur`,n),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`keyup`,t),window.removeEventListener(`blur`,n)}},[f]);let T=!!t?.hasMore,E=T?ea:0,O=he({count:S.length,getScrollElement:()=>h.current,estimateSize:e=>ta(S[e]),getItemKey:e=>S[e].turn.index,overscan:8,scrollMargin:E}),k=(0,$.useRef)(null);(0,$.useLayoutEffect)(()=>{let e=h.current,t=k.current;if(!e||!t||t.filter!==y)return;let n=S.findIndex(e=>e.turn.index===t.key);n<=0||(e.scrollTop=O.measurementsCache[n].start-t.top,k.current=null)},[S,y,O]),(0,$.useEffect)(()=>{if(p<0)return;let e=S.findIndex(e=>e.turn.index===p);e>=0&&O.scrollToIndex(e,{align:`center`})},[s,o]);let A=e=>{let r=O.getVirtualItems()[0];r&&(k.current={key:r.key,top:r.start-e.currentTarget.scrollTop,filter:y}),!n&&t?.hasMore&&e.currentTarget.scrollTop<120&&i()};return(0,Q.jsxs)(`div`,{className:`hist`,children:[(0,Q.jsxs)(`div`,{className:`hist-bar`,children:[(0,Q.jsxs)(`label`,{className:`hist-search`,children:[(0,Q.jsx)(`svg`,{className:`w-4 h-4 shrink-0`,strokeWidth:2,...Vi,"aria-hidden":!0,children:(0,Q.jsx)(`path`,{d:`m21 21-4.35-4.35M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14Z`})}),(0,Q.jsx)(`input`,{type:`text`,value:a,onChange:e=>l(e.target.value),placeholder:`Search this trace`,"aria-label":`Search this trace`,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),e.shiftKey?d():u()):e.key===`Escape`&&a&&(e.stopPropagation(),l(``))}}),g&&(0,Q.jsxs)(Q.Fragment,{children:[c?(0,Q.jsx)(D,{className:`w-3.5 h-3.5`}):(0,Q.jsx)(`span`,{className:`hist-count`,"aria-live":`polite`,children:o.length>0?`${s+1} of ${o.length}`:`No matches`}),(0,Q.jsx)(`button`,{type:`button`,className:`hist-iconbtn`,onClick:d,disabled:o.length===0,title:`Previous match (Shift+Enter)`,"aria-label":`Previous match`,children:(0,Q.jsx)(`svg`,{className:`w-3.5 h-3.5`,strokeWidth:2.5,...Vi,children:(0,Q.jsx)(`path`,{d:`m5 15 7-7 7 7`})})}),(0,Q.jsx)(`button`,{type:`button`,className:`hist-iconbtn`,onClick:u,disabled:o.length===0,title:`Next match (Enter)`,"aria-label":`Next match`,children:(0,Q.jsx)(`svg`,{className:`w-3.5 h-3.5`,strokeWidth:2.5,...Vi,children:(0,Q.jsx)(`path`,{d:`m5 9 7 7 7-7`})})})]}),a&&(0,Q.jsx)(`button`,{type:`button`,className:`hist-iconbtn`,onClick:()=>l(``),title:`Clear search (Esc)`,"aria-label":`Clear search`,children:(0,Q.jsx)(`svg`,{className:`w-3.5 h-3.5`,strokeWidth:2.5,...Vi,children:(0,Q.jsx)(`path`,{d:`M6 6l12 12M18 6 6 18`})})})]}),(0,Q.jsx)(oe,{value:y,onValueChange:e=>v(e),children:(0,Q.jsxs)(le,{"aria-label":`Trace filter`,children:[(0,Q.jsx)(me,{value:`all`,children:`All`}),(0,Q.jsx)(me,{value:`messages`,children:`Messages`}),(0,Q.jsxs)(me,{value:`tools`,children:[`Tools`,x.calls>0&&(0,Q.jsx)(`span`,{className:`tr-n`,children:x.calls})]}),(0,Q.jsxs)(me,{value:`agents`,children:[`Agents`,x.spawns>0&&(0,Q.jsx)(`span`,{className:`tr-n`,children:x.spawns})]})]})})]}),t&&e.length>0&&(0,Q.jsxs)(`div`,{className:`tr-summary`,"aria-label":`Trace summary`,children:[(0,Q.jsx)(`span`,{children:e.length===t.totalTurns?`${e.length} turns`:`${e.length} of ${t.totalTurns} turns`}),(0,Q.jsxs)(`span`,{children:[x.calls,` tool `,x.calls===1?`call`:`calls`]}),(0,Q.jsxs)(`span`,{children:[x.spawns,` `,x.spawns===1?`subagent`:`subagents`]}),x.span!==null&&x.span>0&&(0,Q.jsxs)(`span`,{children:[`over `,Zi(x.span)]})]}),n&&e.length===0?(0,Q.jsx)(`div`,{className:`hist-empty`,children:(0,Q.jsx)(D,{className:`w-5 h-5`})}):e.length===0?(0,Q.jsxs)(`div`,{className:`hist-empty`,children:[(0,Q.jsx)(`svg`,{className:`w-8 h-8`,strokeWidth:1.25,...Vi,"aria-hidden":!0,children:(0,Q.jsx)(`path`,{d:`M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM18 9a9 9 0 0 1-9 9`})}),(0,Q.jsx)(`span`,{children:`No trace yet`}),(0,Q.jsx)(`small`,{children:`Steps appear here once the session has run.`})]}):S.length===0?(0,Q.jsxs)(`div`,{className:`hist-empty`,children:[(0,Q.jsx)(`span`,{children:`Nothing to show for this filter`}),(0,Q.jsx)(`small`,{children:y===`agents`?`This session has not spawned a subagent.`:`Try another filter.`})]}):(0,Q.jsxs)(`div`,{ref:h,onScroll:A,className:`hist-scroll tr-timeline`,style:{fontSize:`${r}px`},children:[T&&t&&(0,Q.jsx)(`div`,{className:`hist-earlier`,children:n?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(D,{className:`w-3 h-3`}),` Loading earlier turns…`]}):(0,Q.jsxs)(Q.Fragment,{children:[t.totalTurns-e.length,` earlier turns · scroll up to load`]})}),(0,Q.jsx)(`div`,{style:{height:O.getTotalSize(),position:`relative`,width:`100%`},children:O.getVirtualItems().map(e=>{let t=S[e.index],n=t.turn.index===p;return(0,Q.jsx)(`div`,{"data-index":e.index,ref:O.measureElement,className:`tr-row`,"data-lead":t.kind===`prompt`||void 0,style:{transform:`translateY(${e.start-E}px)`},children:(0,Q.jsx)(ia,{step:t,first:e.index===0&&!T,filter:y,searchQuery:g?a:``,isSearchMatch:m.has(t.turn.index),isCurrentMatch:n,onCheckpoint:f,ctrlHeld:C})},e.key)})})]})]})}function ia(e){let t=(0,kr.c)(53),{step:n,first:r,filter:i,searchQuery:a,isSearchMatch:o,isCurrentMatch:s,onCheckpoint:c,ctrlHeld:l}=e,{turn:u}=n,d=!!c&&!!l,f;t[0]===u.timestamp?f=t[1]:(f=Qi(u.timestamp),t[0]=u.timestamp,t[1]=f);let p=f,m=i!==`tools`&&i!==`agents`,h=i!==`messages`,g;t[2]===n.gap?g=t[3]:(g=n.gap?Xi(n.gap):``,t[2]=n.gap,t[3]=g);let _=g,v=n.kind===`result`,y;t[4]!==i||t[5]!==n.calls?(y=i===`agents`?n.calls.filter(aa):n.calls,t[4]=i,t[5]=n.calls,t[6]=y):y=t[6];let b=y,x=r||void 0,S=n.spawns>0||void 0,C=o||void 0,w=s||void 0,T=d||void 0,E;t[7]!==d||t[8]!==l||t[9]!==c||t[10]!==u.index?(E=e=>{d&&(e.ctrlKey||l)&&(e.preventDefault(),e.stopPropagation(),c(u.index))},t[7]=d,t[8]=l,t[9]=c,t[10]=u.index,t[11]=E):E=t[11];let D;t[12]!==p||t[13]!==u.timestamp?(D=p&&(0,Q.jsx)(`time`,{dateTime:u.timestamp,title:p.full,children:p.label}),t[12]=p,t[13]=u.timestamp,t[14]=D):D=t[14];let O;t[15]===_?O=t[16]:(O=_&&(0,Q.jsx)(`span`,{className:`tr-gap`,children:_}),t[15]=_,t[16]=O);let k;t[17]!==D||t[18]!==O?(k=(0,Q.jsxs)(`div`,{className:`tr-when`,children:[D,O]}),t[17]=D,t[18]=O,t[19]=k):k=t[19];let A;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(`div`,{className:`tr-rail`,"aria-hidden":!0,children:(0,Q.jsx)(`span`,{className:`tr-node`})}),t[20]=A):A=t[20];let j;t[21]!==v||t[22]!==c||t[23]!==n.speaker||t[24]!==u.index?(j=!v&&(0,Q.jsxs)(`header`,{className:`tr-head`,children:[(0,Q.jsx)(`span`,{className:`tr-who`,children:n.speaker}),c&&(0,Q.jsxs)(`button`,{type:`button`,className:`hist-ckpt`,onClick:e=>{e.stopPropagation(),c(u.index)},title:`Truncate the session to keep everything through turn ${u.index+1}. The original is backed up as <session>.jsonl.bkp.`,children:[(0,Q.jsx)(`svg`,{className:`w-3 h-3`,strokeWidth:2,...Vi,"aria-hidden":!0,children:(0,Q.jsx)(`path`,{d:`M6 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm0 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM20 4 8.1 15.9M14.5 14.5 20 20M8.1 8.1 12 12`})}),`Checkpoint here`]})]}),t[21]=v,t[22]=c,t[23]=n.speaker,t[24]=u.index,t[25]=j):j=t[25];let M;t[26]!==a||t[27]!==m||t[28]!==n.fallback||t[29]!==n.prose?(M=m&&(n.fallback===null?n.prose.map((e,t)=>(0,Q.jsx)(sa,{text:e.text.trim(),query:a},t)):(0,Q.jsx)(sa,{text:n.fallback,query:a})),t[26]=a,t[27]=m,t[28]=n.fallback,t[29]=n.prose,t[30]=M):M=t[30];let N;t[31]!==b||t[32]!==i||t[33]!==o||t[34]!==a||t[35]!==h||t[36]!==n.results||t[37]!==n.thinking?(N=h&&(b.length>0||n.results.length>0||n.thinking)&&(0,Q.jsxs)(`div`,{className:`tr-calls`,children:[n.thinking&&i===`all`&&(0,Q.jsx)(`div`,{className:`hist-think`,children:`Thinking…`}),b.map((e,t)=>Hi.has(e.name)?(0,Q.jsx)(da,{args:e.args,query:a},t):(0,Q.jsx)(la,{name:e.name,args:e.args,query:a,forceOpen:o},t)),n.results.map((e,t)=>(0,Q.jsx)(pa,{text:e.text,query:a,forceOpen:o},t))]}),t[31]=b,t[32]=i,t[33]=o,t[34]=a,t[35]=h,t[36]=n.results,t[37]=n.thinking,t[38]=N):N=t[38];let P;t[39]!==j||t[40]!==M||t[41]!==N?(P=(0,Q.jsxs)(`div`,{className:`tr-body`,children:[j,M,N]}),t[39]=j,t[40]=M,t[41]=N,t[42]=P):P=t[42];let F;return t[43]!==n.kind||t[44]!==k||t[45]!==P||t[46]!==x||t[47]!==S||t[48]!==C||t[49]!==w||t[50]!==T||t[51]!==E?(F=(0,Q.jsxs)(`article`,{className:`tr-step`,"data-kind":n.kind,"data-first":x,"data-spawn":S,"data-match":C,"data-current":w,"data-armed":T,onClick:E,children:[k,A,P]}),t[43]=n.kind,t[44]=k,t[45]=P,t[46]=x,t[47]=S,t[48]=C,t[49]=w,t[50]=T,t[51]=E,t[52]=F):F=t[52],F}function aa(e){return Hi.has(e.name)}var oa={a:({node:e,...t})=>(0,Q.jsx)(`a`,{...t,target:`_blank`,rel:`noopener noreferrer`})};function sa(e){let t=(0,kr.c)(19),{text:n,query:r}=e,i;t[0]===n?i=t[1]:(i=n.length>900||n.split(`
23
- `).length>Wi,t[0]=n,t[1]=i);let a=i,[o,s]=(0,$.useState)(!1),c=a&&!o&&!r,l=!r||void 0,u=c||void 0,d;t[2]===c?d=t[3]:(d=c?{WebkitLineClamp:Wi}:void 0,t[2]=c,t[3]=d);let f;t[4]!==r||t[5]!==n?(f=r?(0,Q.jsx)(ha,{text:n,query:r}):(0,Q.jsx)(wr,{remarkPlugins:[x],components:oa,children:n}),t[4]=r,t[5]=n,t[6]=f):f=t[6];let p;t[7]!==l||t[8]!==u||t[9]!==d||t[10]!==f?(p=(0,Q.jsx)(`div`,{className:`hist-prose`,"data-md":l,"data-clamped":u,style:d,children:f}),t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;t[12]!==o||t[13]!==a||t[14]!==r?(m=a&&!r&&(0,Q.jsx)(`button`,{type:`button`,className:`hist-more`,onClick:()=>s(ca),"aria-expanded":o,children:o?`Show less`:`Show more`}),t[12]=o,t[13]=a,t[14]=r,t[15]=m):m=t[15];let h;return t[16]!==p||t[17]!==m?(h=(0,Q.jsxs)(Q.Fragment,{children:[p,m]}),t[16]=p,t[17]=m,t[18]=h):h=t[18],h}function ca(e){return!e}function la(e){let t=(0,kr.c)(25),{name:n,args:r,query:i,forceOpen:a}=e,[o,s]=(0,$.useState)(!1),c=o||a,l;t[0]===r?l=t[1]:(l=Ji(r),t[0]=r,t[1]=l);let u=l,d;t[2]===r?d=t[3]:(d=Yi(r),t[2]=r,t[3]=d);let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>s(ua),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(`svg`,{className:`w-3 h-3 hist-chev`,strokeWidth:2.5,...Vi,"aria-hidden":!0,children:(0,Q.jsx)(`path`,{d:`m9 5 7 7-7 7`})}),t[5]=m):m=t[5];let h;t[6]!==n||t[7]!==i?(h=(0,Q.jsx)(`span`,{className:`hist-tool-name`,children:(0,Q.jsx)(ha,{text:n,query:i})}),t[6]=n,t[7]=i,t[8]=h):h=t[8];let g;t[9]!==c||t[10]!==u?(g=!c&&u&&(0,Q.jsx)(`span`,{className:`tr-call-sum`,children:u}),t[9]=c,t[10]=u,t[11]=g):g=t[11];let _;t[12]!==c||t[13]!==h||t[14]!==g?(_=(0,Q.jsxs)(`button`,{type:`button`,className:`tr-call-head`,onClick:p,"aria-expanded":c,children:[m,h,g]}),t[12]=c,t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==r||t[17]!==f||t[18]!==c||t[19]!==i?(v=c&&r&&(0,Q.jsx)(`pre`,{className:`tr-call-args`,children:(0,Q.jsx)(ha,{text:f,query:i})}),t[16]=r,t[17]=f,t[18]=c,t[19]=i,t[20]=v):v=t[20];let y;return t[21]!==c||t[22]!==_||t[23]!==v?(y=(0,Q.jsxs)(`div`,{className:`tr-call`,"data-open":c,children:[_,v]}),t[21]=c,t[22]=_,t[23]=v,t[24]=y):y=t[24],y}function ua(e){return!e}function da(e){let t=(0,kr.c)(23),{args:n,query:r}=e,i;t[0]===n?i=t[1]:(i=Ki(n,`subagent_type`),t[0]=n,t[1]=i);let a=i,o;t[2]===n?o=t[3]:(o=Ki(n,`description`)||`Subagent`,t[2]=n,t[3]=o);let s=o,c;t[4]===n?c=t[5]:(c=Ki(n,`prompt`),t[4]=n,t[5]=c);let l=c,[u,d]=(0,$.useState)(!1),f;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`svg`,{className:`w-3.5 h-3.5 shrink-0`,strokeWidth:2,...Vi,"aria-hidden":!0,children:(0,Q.jsx)(`path`,{d:`M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM18 9a9 9 0 0 1-9 9`})}),t[6]=f):f=t[6];let p;t[7]!==r||t[8]!==s?(p=(0,Q.jsx)(`span`,{className:`tr-spawn-title`,children:(0,Q.jsx)(ha,{text:s,query:r})}),t[7]=r,t[8]=s,t[9]=p):p=t[9];let m;t[10]===a?m=t[11]:(m=a&&(0,Q.jsx)(E,{children:a}),t[10]=a,t[11]=m);let h;t[12]!==p||t[13]!==m?(h=(0,Q.jsxs)(`div`,{className:`tr-spawn-head`,children:[f,p,m]}),t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]!==u||t[16]!==l||t[17]!==r?(g=l&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`tr-spawn-prompt`,"data-open":u,children:(0,Q.jsx)(ha,{text:l,query:r})}),(0,Q.jsx)(`button`,{type:`button`,className:`hist-more`,onClick:()=>d(fa),"aria-expanded":u,children:u?`Hide brief`:`Show brief`})]}),t[15]=u,t[16]=l,t[17]=r,t[18]=g):g=t[18];let _;return t[19]!==u||t[20]!==h||t[21]!==g?(_=(0,Q.jsxs)(`div`,{className:`tr-spawn`,"data-open":u,children:[h,g]}),t[19]=u,t[20]=h,t[21]=g,t[22]=_):_=t[22],_}function fa(e){return!e}function pa(e){let t=(0,kr.c)(15),{text:n,query:r,forceOpen:i}=e,[a,o]=(0,$.useState)(!1),s=a||i,c;t[0]===n?c=t[1]:(c=Yi(n),t[0]=n,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=l.length>160||l.includes(`
24
- `),t[2]=l,t[3]=u);let d=u,f;t[4]!==r||t[5]!==l?(f=(0,Q.jsx)(`div`,{className:`tr-result-text`,children:(0,Q.jsx)(ha,{text:l,query:r})}),t[4]=r,t[5]=l,t[6]=f):f=t[6];let p;t[7]!==s||t[8]!==d||t[9]!==r?(p=d&&!r&&(0,Q.jsx)(`button`,{type:`button`,className:`hist-more`,onClick:()=>o(ma),"aria-expanded":s,children:s?`Collapse`:`Expand`}),t[7]=s,t[8]=d,t[9]=r,t[10]=p):p=t[10];let m;return t[11]!==s||t[12]!==f||t[13]!==p?(m=(0,Q.jsxs)(`div`,{className:`tr-result`,"data-open":s,children:[f,p]}),t[11]=s,t[12]=f,t[13]=p,t[14]=m):m=t[14],m}function ma(e){return!e}function ha(e){let t=(0,kr.c)(14),{text:n,query:r}=e;if(!r||r.length<2){let e;return t[0]===n?e=t[1]:(e=(0,Q.jsx)(Q.Fragment,{children:n}),t[0]=n,t[1]=e),e}let i;if(t[2]!==r||t[3]!==n){let e=n.toLowerCase(),a=r.toLowerCase();i=[];let o=0,s=e.indexOf(a,0);for(;s!==-1;)s>o&&i.push({text:n.slice(o,s),highlight:!1}),i.push({text:n.slice(s,s+r.length),highlight:!0}),o=s+r.length,s=e.indexOf(a,o);if(o<n.length){let e;t[5]!==o||t[6]!==n?(e=n.slice(o),t[5]=o,t[6]=n,t[7]=e):e=t[7];let r;t[8]===e?r=t[9]:(r={text:e,highlight:!1},t[8]=e,t[9]=r),i.push(r)}t[2]=r,t[3]=n,t[4]=i}else i=t[4];if(i.length===0){let e;return t[10]===n?e=t[11]:(e=(0,Q.jsx)(Q.Fragment,{children:n}),t[10]=n,t[11]=e),e}let a;return t[12]===i?a=t[13]:(a=(0,Q.jsx)(Q.Fragment,{children:i.map(ga)}),t[12]=i,t[13]=a),a}function ga(e,t){return e.highlight?(0,Q.jsx)(`mark`,{children:e.text},t):(0,Q.jsx)(`span`,{children:e.text},t)}function _a({title:e,body:t,url:n,onOpenInBrowser:r,mergeAction:i,prMeta:a}){let{theme:o}=M(),s=ke(o),[c,l]=(0,$.useState)(!1),[u,d]=(0,$.useState)(null),[f,p]=(0,$.useState)(null);return(0,Q.jsxs)(`div`,{className:`p-5 flex flex-col gap-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsx)(`h3`,{className:`text-[15px] font-medium leading-snug`,style:{color:s.textPrimary},children:e}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[i&&(0,Q.jsxs)(`button`,{onClick:async()=>{if(i){d(null),p(null),l(!0);try{let e=await i.onMerge();p(e||`Merged PR #${i.number}`)}catch(e){d(String(e))}finally{l(!1)}}},disabled:c,className:`tg-btn tg-btn--solid tg-btn--sm flex items-center gap-1.5 px-3 py-1 text-[12px] font-medium disabled:opacity-60`,title:`Run the configured merge command for PR #${i.number}`,children:[c?(0,Q.jsx)(`div`,{className:`w-3 h-3 border-[1.5px] border-current border-t-transparent rounded-full animate-spin`}):(0,Q.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,Q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 6V18a2.25 2.25 0 0 0 2.25 2.25h.5A2.25 2.25 0 0 0 14 18.5V14a2.25 2.25 0 0 1 2.25-2.25H18M9 6a2.25 2.25 0 1 1 0 4.5 2.25 2.25 0 0 1 0-4.5ZM18 11.75a2.25 2.25 0 1 1 0 4.5 2.25 2.25 0 0 1 0-4.5Z`})}),c?`Merging…`:`Merge`]}),(n||r)&&(0,Q.jsx)(`button`,{onClick:()=>{r?r():n&&window.open(n,`_blank`,`noreferrer`)},className:`p-1.5 rounded-lg transition-all duration-150`,style:{color:`var(--ink)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(79,142,247,0.08)`},onMouseLeave:e=>{e.currentTarget.style.background=``},title:`Open in browser`,children:(0,Q.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,Q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-4M14 4h6m0 0v6m0-6L10 14`})})})]})]}),a&&(0,Q.jsx)(Li,{meta:a,c:s}),f&&(0,Q.jsx)(`div`,{className:`rounded-lg px-3 py-2 text-[12px]`,style:{background:`rgba(63,185,80,0.10)`,color:`#3fb950`,border:`1px solid rgba(63,185,80,0.30)`},children:f}),u&&(0,Q.jsx)(`div`,{className:`rounded-lg px-3 py-2 text-[12px]`,style:{background:`rgba(248,81,73,0.10)`,color:`#f85149`,border:`1px solid rgba(248,81,73,0.30)`},children:u}),t?(0,Q.jsx)(`div`,{className:`text-[13px] leading-[1.7] whitespace-pre-wrap break-words`,style:{color:s.textSecondary},children:t}):(0,Q.jsx)(`p`,{className:`text-[13px]`,style:{color:s.textDim},children:`No description`})]})}export{Ii as default};
@@ -1,3 +0,0 @@
1
- import{a as e,d as t,i as n,m as r,t as i,u as a}from"./jsx-runtime-QmcfnBgR.js";import{a as o,c as s,d as c,o as l,s as u,t as d,u as f}from"./Surface-BQKeigoq.js";import{C as p,Q as m,T as h,_ as g,b as _,ct as v,d as y,f as b,g as x,h as S,it as C,l as w,m as T,pt as E,u as D,v as O,x as k}from"./index-gWSenOqD.js";import{n as A,r as j,t as M}from"./ProposalCard-BbPobl1f.js";var N=r(t(),1),P=a(),F=i();function I(e){let t=(0,P.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,F.jsx)(`p`,{className:`bd-kb-intro`,children:n}),t[0]=n,t[1]=r),r}function L(e){let t=(0,P.c)(18),{title:n,count:r,hint:i,action:a,children:o}=e,s;t[0]===r?s=t[1]:(s=r!==void 0&&(0,F.jsx)(`span`,{className:`bd-kb-count`,children:r}),t[0]=r,t[1]=s);let c;t[2]!==s||t[3]!==n?(c=(0,F.jsxs)(`h3`,{className:`bd-kb-h`,children:[n,s]}),t[2]=s,t[3]=n,t[4]=c):c=t[4];let l;t[5]===i?l=t[6]:(l=i&&(0,F.jsx)(`p`,{className:`bd-kb-hint`,children:i}),t[5]=i,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,F.jsxs)(`div`,{children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d;t[10]!==a||t[11]!==u?(d=(0,F.jsxs)(`header`,{className:`bd-kb-section-head`,children:[u,a]}),t[10]=a,t[11]=u,t[12]=d):d=t[12];let f;t[13]===o?f=t[14]:(f=(0,F.jsx)(`div`,{className:`bd-kb-list`,children:o}),t[13]=o,t[14]=f);let p;return t[15]!==d||t[16]!==f?(p=(0,F.jsxs)(`section`,{className:`bd-kb-section`,children:[d,f]}),t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function R(e){let t=(0,P.c)(8),{title:n,children:r,action:i}=e,a;t[0]===n?a=t[1]:(a=(0,F.jsx)(`strong`,{children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r&&(0,F.jsx)(`p`,{children:r}),t[2]=r,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,F.jsxs)(`div`,{className:`bd-kb-empty`,children:[a,o,i]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var z={inception:`Planning`,construction:`Building`,operations:`Running`,done:`Done`};function ee({intents:e,onChanged:t}){let r=E(e=>e.cards),i=E(e=>e.projects),a=C(r,i),[d,p]=(0,N.useState)(!1),[m,_]=(0,N.useState)(a[0]?.path??``),[v,y]=(0,N.useState)(``),[b,w]=(0,N.useState)(``),[D,j]=(0,N.useState)(!1),M=async()=>{j(!0);try{await n(`intent_create`,{projectPath:m,title:v,body:b}),y(``),w(``),p(!1),h({title:`Intent created`,description:`Its planning card is in the backlog.`,tone:`success`}),t()}catch(e){A(e)}finally{j(!1)}},P=e=>e===`done`?`success`:e===`inception`?`outline`:`default`;return(0,F.jsxs)(`div`,{className:`bd-kb-stack`,children:[(0,F.jsx)(I,{children:`An intent is a goal you hand to agents, such as “add dark mode”. They plan it first, then you approve each stage before they build it as separate task cards.`}),(0,F.jsxs)(L,{title:`Your intents`,count:e.length,action:!d&&(0,F.jsx)(l,{size:`sm`,variant:`solid`,onClick:()=>p(!0),children:`New intent`}),children:[d&&(0,F.jsxs)(u,{material:`thin`,children:[(0,F.jsx)(f,{children:(0,F.jsx)(c,{children:`New intent`})}),(0,F.jsxs)(T,{children:[(0,F.jsx)(g,{children:`Project`}),(0,F.jsx)(O,{"aria-label":`Project`,options:a.map(e=>({value:e.path,label:e.name})),value:m,onValueChange:_})]}),(0,F.jsxs)(T,{children:[(0,F.jsx)(g,{htmlFor:`intent-title`,children:`Goal`}),(0,F.jsx)(x,{id:`intent-title`,placeholder:`What should be built or fixed?`,value:v,onChange:e=>y(e.target.value)})]}),(0,F.jsxs)(T,{children:[(0,F.jsx)(g,{htmlFor:`intent-body`,children:`Details`}),(0,F.jsx)(k,{id:`intent-body`,rows:3,placeholder:`Context, constraints, links. The more the agent knows, the better its plan.`,value:b,onChange:e=>w(e.target.value)}),(0,F.jsx)(S,{children:`Creates a planning card in the backlog. Nothing runs until you start it.`})]}),(0,F.jsxs)(`div`,{className:`bd-kb-actions`,children:[(0,F.jsx)(l,{variant:`solid`,loading:D,disabled:!m||!v.trim(),onClick:M,children:`Create intent`}),(0,F.jsx)(l,{variant:`ghost`,disabled:D,onClick:()=>p(!1),children:`Cancel`})]})]}),e.length===0&&!d&&(0,F.jsx)(R,{title:`No intents yet`,children:`Create one to have agents plan and build a larger piece of work in stages.`}),e.slice().reverse().map(e=>{let t=r.filter(t=>t.link.intentId===e.id&&t.id!==e.inceptionCardId),n=t.filter(e=>e.link.column===`done`).length;return(0,F.jsx)(u,{material:`thin`,children:(0,F.jsx)(f,{children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(c,{children:e.title}),(0,F.jsxs)(s,{children:[(0,F.jsx)(o,{tone:P(e.phase),children:z[e.phase]}),` `,t.length?`${n} of ${t.length} tasks done · `:`No tasks yet · `,e.artifactsDir]})]})})},e.id)})]})]})}function te(e){let t=(0,P.c)(16),{proposals:n,gates:r,intents:i,configured:a,onChanged:o,onOpenCard:s}=e;if(n.length===0&&r.length===0){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,F.jsx)(I,{children:`Agents propose things worth remembering and pause between stages of an intent. Both wait here for you.`}),t[0]=e):e=t[0];let n=a?`New proposals appear after an agent session finishes and the librarian finds something worth keeping.`:`Connect a harness repository in Setup to start collecting proposals.`,r;return t[1]===n?r=t[2]:(r=(0,F.jsxs)(F.Fragment,{children:[e,(0,F.jsx)(R,{title:`You're all caught up`,children:n})]}),t[1]=n,t[2]=r),r}let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,F.jsx)(I,{children:`Nothing here changes until you decide. Approve to move on, or reject to send it back.`}),t[3]=c):c=t[3];let l;t[4]!==r||t[5]!==i||t[6]!==o||t[7]!==s?(l=r.length>0&&(0,F.jsx)(L,{title:`Stages waiting for approval`,count:r.length,hint:`An agent finished a stage of an intent and is paused. Approve to let it continue, or send it back with a note.`,children:r.map(e=>(0,F.jsx)(ne,{card:e,intent:i.find(t=>t.id===e.link.intentId),onChanged:o,onOpenCard:s},e.id))}),t[4]=r,t[5]=i,t[6]=o,t[7]=s,t[8]=l):l=t[8];let u;t[9]!==o||t[10]!==s||t[11]!==n?(u=n.length>0&&(0,F.jsx)(L,{title:`Proposed knowledge`,count:n.length,hint:`Approving opens a pull request in the harness repository. Once merged, new sessions start with this entry.`,children:n.map(e=>(0,F.jsx)(M,{proposal:e,onChanged:o,onOpenCard:s},e.id))}),t[9]=o,t[10]=s,t[11]=n,t[12]=u):u=t[12];let d;return t[13]!==l||t[14]!==u?(d=(0,F.jsxs)(`div`,{className:`bd-kb-stack`,children:[c,l,u]}),t[13]=l,t[14]=u,t[15]=d):d=t[15],d}function ne({card:e,intent:t,onChanged:r,onOpenCard:i}){let[a,d]=(0,N.useState)(``),[p,m]=(0,N.useState)(!1),_=E(e=>e.selectCard),v=e.link.gate,y=async t=>{m(!0);try{let i=await n(t,{cardId:e.id,note:a});h({title:t===`gate_approve`?`Approved ${v.stage}`:`Sent ${v.stage} back`,description:i?.created?.length?`${i.created.length} unit cards created`:void 0,tone:`success`}),r()}catch(e){A(e)}finally{m(!1)}};return(0,F.jsxs)(u,{material:`thin`,children:[(0,F.jsxs)(f,{children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(c,{children:e.displayTitle}),(0,F.jsxs)(s,{children:[(0,F.jsxs)(o,{tone:`warning`,children:[v.stage,` stage`]}),` `,t?`${t.title} · ${t.artifactsDir}`:e.projectName]})]}),(0,F.jsx)(l,{variant:`ghost`,size:`sm`,onClick:()=>{_(e.id),i()},children:`Open task`})]}),v.note&&(0,F.jsx)(`p`,{className:`bd-kb-summary`,children:v.note}),(0,F.jsxs)(T,{children:[(0,F.jsx)(g,{htmlFor:`note-${e.id}`,children:`Note for the agent`}),(0,F.jsx)(k,{id:`note-${e.id}`,rows:2,placeholder:`What should change? Required to send back.`,value:a,onChange:e=>d(e.target.value)}),(0,F.jsx)(S,{children:`Optional when approving.`})]}),(0,F.jsxs)(`div`,{className:`bd-kb-actions`,children:[(0,F.jsx)(l,{variant:`solid`,loading:p,onClick:()=>y(`gate_approve`),children:`Approve and continue`}),(0,F.jsx)(l,{disabled:p||!a.trim(),onClick:()=>y(`gate_reject`),children:`Send back`})]})]})}var B=``;function re({configured:e,status:t}){let[r,i]=(0,N.useState)(``),[a,o]=(0,N.useState)(``),[s,c]=(0,N.useState)(B),u=[{value:B,label:`All projects`},...(t?.projects??[]).map(e=>({value:e.kbId,label:e.name??e.id})),...(t?.kbs??[]).filter(e=>!t?.projects.some(t=>t.kbId===e.id)).map(e=>({value:e.id,label:e.id}))],[d,f]=(0,N.useState)(null),[p,m]=(0,N.useState)(``),[h,g]=(0,N.useState)(!1),[_,v]=(0,N.useState)(null),y=e&&(r.trim()!==``||a.trim()!==``),b=async()=>{g(!0);try{f(await n(`kb_search`,{text:r,files:a.trim()?[a.trim()]:[],onlyKbs:s?[s]:[],limit:25})),m(r.trim()||a.trim()),v(null)}catch(e){A(e)}finally{g(!1)}};return(0,F.jsxs)(`div`,{className:`bd-kb-stack`,children:[(0,F.jsx)(I,{children:`Look up what your team already decided or learned. This is the same index agents search at the start of a session.`}),(0,F.jsxs)(`form`,{className:`bd-kb-search`,onSubmit:e=>{e.preventDefault(),y&&b()},children:[(0,F.jsx)(O,{"aria-label":`Project`,options:u,value:s,onValueChange:c}),(0,F.jsx)(x,{"aria-label":`Search words`,placeholder:`Search words, e.g. “auth token refresh”`,value:r,onChange:e=>i(e.target.value)}),(0,F.jsx)(x,{"aria-label":`Limit to a file or folder`,placeholder:`Only entries about a file or folder (optional)`,value:a,onChange:e=>o(e.target.value)}),(0,F.jsx)(l,{type:`submit`,variant:`solid`,loading:h,disabled:!y,children:`Search`})]}),d===null&&(0,F.jsxs)(R,{title:`Search the knowledge bases`,children:[`Try a topic, an error message or a path like `,(0,F.jsx)(`code`,{children:`src/auth/`}),`.`]}),d?.length===0&&(0,F.jsx)(R,{title:`Nothing found for “${p}”`,children:`Try fewer or different words, or drop the file filter.`}),d&&d.length>0&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`bd-kb-hint`,children:[j(d.length,`entry`,`entries`),` · select one to read it`]}),(0,F.jsx)(`div`,{className:`bd-kb-list`,children:d.map(e=>(0,F.jsx)(V,{entry:e.entry,stale:e.stale,open:_===e.entry.id,onToggle:()=>v(_===e.entry.id?null:e.entry.id)},e.entry.id))})]})]})}function V(e){let t=(0,P.c)(27),{entry:n,stale:r,open:i,onToggle:a}=e,l;t[0]===n.title?l=t[1]:(l=(0,F.jsx)(c,{children:n.title}),t[0]=n.title,t[1]=l);let d;t[2]===n.type?d=t[3]:(d=(0,F.jsx)(o,{children:n.type}),t[2]=n.type,t[3]=d);let p;t[4]===r?p=t[5]:(p=r&&(0,F.jsx)(o,{tone:`warning`,children:`may be outdated`}),t[4]=r,t[5]=p);let m;t[6]===n.scope?m=t[7]:(m=n.scope.length?` · ${n.scope.join(`, `)}`:``,t[6]=n.scope,t[7]=m);let h;t[8]!==n.kbId||t[9]!==d||t[10]!==p||t[11]!==m?(h=(0,F.jsxs)(s,{children:[d,` `,p,` `,n.kbId,m]}),t[8]=n.kbId,t[9]=d,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g;t[13]!==l||t[14]!==h?(g=(0,F.jsx)(f,{children:(0,F.jsxs)(`div`,{children:[l,h]})}),t[13]=l,t[14]=h,t[15]=g):g=t[15];let _;t[16]===n.summary?_=t[17]:(_=(0,F.jsx)(`p`,{className:`bd-kb-summary`,children:n.summary}),t[16]=n.summary,t[17]=_);let v;t[18]!==n.body||t[19]!==i?(v=i&&(0,F.jsx)(`pre`,{className:`bd-kb-body-text`,children:n.body}),t[18]=n.body,t[19]=i,t[20]=v):v=t[20];let y;return t[21]!==a||t[22]!==i||t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,F.jsxs)(u,{material:`thin`,interactive:!0,onClick:a,"aria-expanded":i,children:[g,_,v]}),t[21]=a,t[22]=i,t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26],y}function ie({status:e,onChanged:t}){let[r,i]=(0,N.useState)(null),[a,p]=(0,N.useState)(null),[y,b]=(0,N.useState)(null),[w,D]=(0,N.useState)({}),O=E(e=>e.cards),k=E(e=>e.projects),M=C(O,k),P=M.map(e=>e.path).join(`
2
- `);(0,N.useEffect)(()=>{e?.configured&&n(`harness_projects`,{paths:P.split(`
3
- `).filter(Boolean)}).then(e=>D(Object.fromEntries(e.map(e=>[e.path,e.projectId])))).catch(A)},[e,P]),(0,N.useEffect)(()=>{m().then(e=>{i(e),p(e.harness??null)}).catch(A)},[]);let L=async(e,n,r)=>{b(e);try{await n(),r&&h({title:r,tone:`success`}),t()}catch(e){A(e)}finally{b(null)}};if(!r||!a)return null;let R=e=>p({...a,...e}),z=!!e?.configured,ee=M.filter(e=>w[e.path]).length;return(0,F.jsxs)(`div`,{className:`bd-kb-stack`,children:[(0,F.jsx)(I,{children:`Set this up once. Your harness repository holds the knowledge; agents on this machine and your teammates' read from it.`}),e?.error&&(0,F.jsx)(d,{tone:`danger`,title:`Harness error`,description:e.error}),(0,F.jsxs)(u,{material:`thin`,children:[(0,F.jsxs)(f,{children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(c,{children:`Harness repository`}),(0,F.jsx)(s,{children:`A private git repository that stores the knowledge bases and the agent pack. This server keeps a clone and opens pull requests for approved entries.`})]}),(0,F.jsx)(o,{tone:z?`success`:`warning`,children:z?`Connected`:`Not connected`})]}),(0,F.jsxs)(T,{children:[(0,F.jsx)(g,{htmlFor:`h-path`,children:`Local folder`}),(0,F.jsx)(x,{id:`h-path`,placeholder:`Where the clone lives on this server`,value:a.repoPath??``,onChange:e=>R({repoPath:e.target.value||void 0})})]}),(0,F.jsxs)(T,{children:[(0,F.jsx)(g,{htmlFor:`h-url`,children:`Git URL`}),(0,F.jsx)(x,{id:`h-url`,placeholder:`git@github.com:your-team/harness.git`,value:a.gitUrl??``,onChange:e=>R({gitUrl:e.target.value||void 0})}),(0,F.jsx)(S,{children:`Only used to clone when the folder does not exist yet.`})]}),(0,F.jsxs)(`div`,{className:`bd-kb-actions`,children:[(0,F.jsx)(l,{variant:`solid`,loading:y===`save`,onClick:()=>L(`save`,()=>v({...r,harness:a}),`Saved`),children:`Save`}),(0,F.jsx)(l,{loading:y===`init`,disabled:!a.repoPath,onClick:()=>L(`init`,()=>n(`harness_init_repo`,{repoPath:a.repoPath}),`Repository created from the template`),children:`Start a new repository`}),(0,F.jsx)(l,{loading:y===`sync`,disabled:!z,onClick:()=>L(`sync`,()=>n(`kb_sync`)),children:`Pull latest`})]}),(0,F.jsx)(S,{children:z&&e?(0,F.jsxs)(F.Fragment,{children:[e.kbs.map(e=>`${e.id}: ${j(e.entries,`entry`,`entries`)}${e.stale?`, ${e.stale} may be outdated`:``}`).join(` · `),e.lastPull?` · pulled ${new Date(e.lastPull).toLocaleTimeString()}`:``,e.indexStore?` · search: ${e.indexStore===`sqlite`?`SQLite FTS5`:`in memory`}`:``]}):`“Start a new repository” fills the folder with a ready-made template: knowledge bases, skills and reviewer agents.`})]}),(0,F.jsxs)(u,{material:`thin`,children:[(0,F.jsx)(f,{children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(c,{children:`Librarian`}),(0,F.jsx)(s,{children:`Reads finished sessions and proposes entries worth remembering. Nothing is saved until you approve it in Review.`})]})}),(0,F.jsx)(_,{label:`Propose entries from finished sessions`,checked:a.librarian.enabled,onCheckedChange:e=>R({librarian:{...a.librarian,enabled:e}})}),(0,F.jsxs)(T,{children:[(0,F.jsx)(g,{htmlFor:`h-model`,children:`Model`}),(0,F.jsx)(x,{id:`h-model`,value:a.librarian.model,onChange:e=>R({librarian:{...a.librarian,model:e.target.value}})}),(0,F.jsx)(S,{children:`Passed to claude --model.`})]}),(0,F.jsx)(`div`,{className:`bd-kb-actions`,children:(0,F.jsx)(l,{variant:`solid`,loading:y===`save`,onClick:()=>L(`save`,()=>v({...r,harness:a}),`Saved`),children:`Save`})})]}),(0,F.jsxs)(u,{material:`thin`,children:[(0,F.jsxs)(f,{children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(c,{children:`Projects`}),(0,F.jsx)(s,{children:`Adding a project opens a pull request in the harness repository with its knowledge base, then has the librarian propose a first set of entries from its docs.`})]}),z&&M.length>0&&(0,F.jsxs)(o,{tone:ee===M.length?`success`:`outline`,children:[ee,` of `,M.length,` added`]})]}),!z&&(0,F.jsx)(S,{children:`Connect the repository above to add projects.`}),z&&M.length===0&&(0,F.jsx)(S,{children:`Projects appear here once you have tasks on the board.`}),M.map(e=>{let t=w[e.path];return(0,F.jsxs)(`div`,{className:`bd-kb-row`,children:[(0,F.jsx)(`span`,{className:`bd-kb-grow`,children:e.name}),t?(0,F.jsxs)(o,{tone:`success`,children:[`In harness · `,t]}):(0,F.jsx)(l,{size:`sm`,disabled:!z,loading:y===e.path,onClick:()=>L(e.path,async()=>{let t=await n(`project_onboard`,{projectPath:e.path});h({title:`Project added`,description:t.url??t.mode,tone:`success`})}),children:`Add to harness`})]},e.path)})]}),(0,F.jsxs)(u,{material:`thin`,children:[(0,F.jsx)(f,{children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(c,{children:`Agent pack`}),(0,F.jsx)(s,{children:`The team's skills, reviewer subagents and a SessionStart hook that hands each new session the relevant knowledge. Install it on every machine that runs agents.`})]})}),(0,F.jsx)(`div`,{className:`bd-kb-actions`,children:(0,F.jsx)(l,{loading:y===`pack`,disabled:!z,onClick:()=>L(`pack`,()=>n(`harness_install_pack`),`Skills, subagents and hook installed`),children:`Install on this machine`})}),(0,F.jsx)(S,{children:`On a teammate's machine, run this once, pointing at this server:`}),(0,F.jsxs)(`pre`,{className:`bd-kb-body-text`,children:[`devboard harness install --server `,window.location.origin,` --token `,`<token>`]})]})]})}function H(t){let r=(0,P.c)(67),{open:i,onClose:a}=t,[s,c]=(0,N.useState)(`review`),[u,f]=(0,N.useState)(null),m;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],r[0]=m):m=r[0];let[h,g]=(0,N.useState)(m),_;r[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=[],r[1]=_):_=r[1];let[v,x]=(0,N.useState)(_),S=(0,N.useRef)(!1),C;r[2]===Symbol.for(`react.memo_cache_sentinel`)?(C=async()=>{try{let[e,t,r]=await Promise.all([n(`kb_status`),n(`kb_proposals`,{status:`pending`}),n(`intent_list`)]);f(e),g(t),x(r)}catch(e){A(e)}},r[2]=C):C=r[2];let T=C,O,k;r[3]===i?(O=r[4],k=r[5]):(O=()=>{if(!i)return;S.current=!1,T();let t;return e(`harness-updated`,()=>void T()).then(e=>t=e),()=>t?.()},k=[i,T],r[3]=i,r[4]=O,r[5]=k),(0,N.useEffect)(O,k);let M=E(se),I;r[6]===M?I=r[7]:(I=M.filter(oe),r[6]=M,r[7]=I);let L=I,R=h.length+L.length,z,ne;r[8]!==u||r[9]!==R?(z=()=>{u&&!S.current&&(S.current=!0,c(u.configured?R>0?`review`:`search`:`setup`))},ne=[u,R],r[8]=u,r[9]=R,r[10]=z,r[11]=ne):(z=r[10],ne=r[11]),(0,N.useEffect)(z,ne);let B=!!u?.configured,V,H,U,W,G;if(r[12]!==B||r[13]!==a||r[14]!==i||r[15]!==u){let e=u?.kbs.reduce(ae,0)??0;V=p,G=i,r[21]===a?H=r[22]:(H=e=>!e&&a(),r[21]=a,r[22]=H),U=`Knowledge`,W=u?B?`What your agents have learned, shared with every session. ${j(e,`entry`,`entries`)} in ${j(u.kbs.length,`knowledge base`,`knowledge bases`)}.`:`Shared memory for your agents: decisions, conventions and gotchas that every new session starts with.`:`Loading…`,r[12]=B,r[13]=a,r[14]=i,r[15]=u,r[16]=V,r[17]=H,r[18]=U,r[19]=W,r[20]=G}else V=r[16],H=r[17],U=r[18],W=r[19],G=r[20];let ce;r[23]===Symbol.for(`react.memo_cache_sentinel`)?(ce=e=>c(e),r[23]=ce):ce=r[23];let K;r[24]===R?K=r[25]:(K=R>0&&(0,F.jsx)(o,{tone:`warning`,className:`bd-kb-tabcount`,children:R}),r[24]=R,r[25]=K);let q;r[26]===K?q=r[27]:(q=(0,F.jsxs)(w,{value:`review`,children:[`Review`,K]}),r[26]=K,r[27]=q);let le,ue,de;r[28]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,F.jsx)(w,{value:`search`,children:`Search`}),ue=(0,F.jsx)(w,{value:`intents`,children:`Intents`}),de=(0,F.jsx)(w,{value:`setup`,children:`Setup`}),r[28]=le,r[29]=ue,r[30]=de):(le=r[28],ue=r[29],de=r[30]);let J;r[31]===q?J=r[32]:(J=(0,F.jsxs)(b,{"aria-label":`Knowledge sections`,children:[q,le,ue,de]}),r[31]=q,r[32]=J);let Y;r[33]!==B||r[34]!==u||r[35]!==s?(Y=u&&!B&&s!==`setup`&&(0,F.jsx)(d,{className:`bd-kb-banner`,tone:`info`,title:`Connect a harness repository first`,description:`Knowledge is stored in a private git repository. Until one is connected there is nothing to review or search.`,action:(0,F.jsx)(l,{size:`sm`,variant:`solid`,onClick:()=>c(`setup`),children:`Go to Setup`})}),r[33]=B,r[34]=u,r[35]=s,r[36]=Y):Y=r[36];let X;r[37]!==B||r[38]!==L||r[39]!==v||r[40]!==a||r[41]!==h?(X=(0,F.jsx)(D,{value:`review`,children:(0,F.jsx)(te,{proposals:h,gates:L,intents:v,configured:B,onChanged:T,onOpenCard:a})}),r[37]=B,r[38]=L,r[39]=v,r[40]=a,r[41]=h,r[42]=X):X=r[42];let Z;r[43]!==B||r[44]!==u?(Z=(0,F.jsx)(D,{value:`search`,children:(0,F.jsx)(re,{configured:B,status:u})}),r[43]=B,r[44]=u,r[45]=Z):Z=r[45];let Q;r[46]===v?Q=r[47]:(Q=(0,F.jsx)(D,{value:`intents`,children:(0,F.jsx)(ee,{intents:v,onChanged:T})}),r[46]=v,r[47]=Q);let $;r[48]===u?$=r[49]:($=(0,F.jsx)(D,{value:`setup`,children:(0,F.jsx)(ie,{status:u,onChanged:T})}),r[48]=u,r[49]=$);let fe;r[50]!==X||r[51]!==Z||r[52]!==Q||r[53]!==$?(fe=(0,F.jsxs)(`div`,{className:`bd-kb-body`,children:[X,Z,Q,$]}),r[50]=X,r[51]=Z,r[52]=Q,r[53]=$,r[54]=fe):fe=r[54];let pe;r[55]!==J||r[56]!==Y||r[57]!==fe||r[58]!==s?(pe=(0,F.jsxs)(y,{value:s,onValueChange:ce,children:[J,Y,fe]}),r[55]=J,r[56]=Y,r[57]=fe,r[58]=s,r[59]=pe):pe=r[59];let me;return r[60]!==V||r[61]!==H||r[62]!==U||r[63]!==W||r[64]!==pe||r[65]!==G?(me=(0,F.jsx)(V,{open:G,onOpenChange:H,title:U,description:W,width:880,children:pe}),r[60]=V,r[61]=H,r[62]=U,r[63]=W,r[64]=pe,r[65]=G,r[66]=me):me=r[66],me}function ae(e,t){return e+t.entries}function oe(e){return e.link.gate?.status===`pending`}function se(e){return e.cards}export{H as default};
@@ -1,3 +0,0 @@
1
- import{d as e,m as t,t as n,u as r}from"./jsx-runtime-QmcfnBgR.js";import{A as i,D as a,G as o,I as s,L as c,M as l,N as u,O as d,P as f,S as p,T as m,U as h,a as g,i as _,it as v,j as y,k as b,mt as x,o as S,pt as C,r as ee,s as te}from"./index-gWSenOqD.js";var ne=r(),re=t(e(),1),w=n(),T=`devboard.listCollapsedColumns`,E=`pinned`;function ie(){try{let e=window.localStorage.getItem(T);return new Set(e?JSON.parse(e):[])}catch{return new Set}}function D(e){try{window.localStorage.setItem(T,JSON.stringify(Array.from(e)))}catch{}}function ae(){let e=(0,ne.c)(16),t=C(j),n=C(oe),r=C(A),i=C(k),a=C(x(O)),[s,c]=(0,re.useState)(ie),l=(0,re.useRef)(null),u;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),D(n),n})},e[0]=u):u=e[0];let d=u,f;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=Array.from(l.current?.querySelectorAll(`[data-ls-stop]`)??[]),n=t.indexOf(document.activeElement);n!==-1&&(e.preventDefault(),t[Math.max(0,Math.min(t.length-1,n+(e.key===`ArrowDown`?1:-1)))]?.focus())},e[1]=f):f=e[1];let p=f,m;if(e[2]!==t||e[3]!==i||e[4]!==s||e[5]!==a||e[6]!==r||e[7]!==n){let c=n===null?v(t,r):null,u;e[9]===i?u=e[10]:(u=e=>h.map(t=>({id:t,cid:e===void 0?t:`${e}|${t}`,label:o[t],cards:i(t,e)})),e[9]=i,e[10]=u);let f=u,g;e[11]===s?g=e[12]:(g=e=>(0,w.jsx)(M,{id:e.id,cid:e.cid,label:e.label,cards:e.cards,open:!s.has(e.cid),onToggle:d},e.cid),e[11]=s,e[12]=g);let _=g,y;e[13]!==a||e[14]!==_?(y=a.length>0&&_({id:E,cid:E,label:`Pinned`,cards:a}),e[13]=a,e[14]=_,e[15]=y):y=e[15],m=(0,w.jsxs)(`div`,{ref:l,className:`ls-root`,onKeyDown:p,role:`list`,"aria-label":`Cards by status`,children:[y,c?c.map(e=>(0,w.jsxs)(`section`,{className:`ls-project`,"aria-label":e.name,children:[(0,w.jsx)(`h2`,{className:`ls-project-head`,title:e.path||void 0,children:e.name}),f(e.path).map(_)]},e.path)):f().map(_)]}),e[2]=t,e[3]=i,e[4]=s,e[5]=a,e[6]=r,e[7]=n,e[8]=m}else m=e[8];return m}function O(e){return e.pinnedCards()}function k(e){return e.cardsInColumn}function A(e){return e.projects}function oe(e){return e.selectedProjectPath}function j(e){return e.cards}function M(e){let t=(0,ne.c)(36),{id:n,cid:r,label:a,cards:o,open:s,onToggle:c}=e,l=`ls-body-${(0,re.useId)()}`,u;t[0]!==r||t[1]!==c?(u=()=>c(r),t[0]=r,t[1]=c,t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,w.jsx)(i,{}),t[3]=d):d=t[3];let p;t[4]===s?p=t[5]:(p=(0,w.jsx)(`span`,{className:`ls-chev`,"data-open":s,children:d}),t[4]=s,t[5]=p);let m;t[6]===n?m=t[7]:(m=n===E&&(0,w.jsx)(`span`,{className:`ls-head-icon`,children:(0,w.jsx)(f,{})}),t[6]=n,t[7]=m);let h;t[8]===a?h=t[9]:(h=(0,w.jsx)(`span`,{className:`ls-head-title`,children:a}),t[8]=a,t[9]=h);let g;t[10]===o.length?g=t[11]:(g=(0,w.jsx)(`span`,{className:`ls-head-count`,children:o.length}),t[10]=o.length,t[11]=g);let _;t[12]!==l||t[13]!==s||t[14]!==u||t[15]!==p||t[16]!==m||t[17]!==h||t[18]!==g?(_=(0,w.jsxs)(`button`,{type:`button`,className:`ls-head`,"data-ls-stop":!0,"aria-expanded":s,"aria-controls":l,onClick:u,children:[p,m,h,g]}),t[12]=l,t[13]=s,t[14]=u,t[15]=p,t[16]=m,t[17]=h,t[18]=g,t[19]=_):_=t[19];let v=!s,y;t[20]!==o||t[21]!==n?(y=o.length===0?(0,w.jsx)(`p`,{className:`ls-empty`,children:n===`backlog`?`Nothing queued. New tasks land here.`:`No cards in this status.`}):o.map(N),t[20]=o,t[21]=n,t[22]=y):y=t[22];let b;t[23]!==l||t[24]!==y?(b=(0,w.jsx)(`div`,{id:l,className:`ls-body`,role:`list`,children:y}),t[23]=l,t[24]=y,t[25]=b):b=t[25];let x;t[26]!==b||t[27]!==v?(x=(0,w.jsx)(`div`,{className:`ls-collapse-inner`,inert:v,children:b}),t[26]=b,t[27]=v,t[28]=x):x=t[28];let S;t[29]!==s||t[30]!==x?(S=(0,w.jsx)(`div`,{className:`ls-collapse`,"data-open":s,children:x}),t[29]=s,t[30]=x,t[31]=S):S=t[31];let C;return t[32]!==s||t[33]!==S||t[34]!==_?(C=(0,w.jsxs)(`section`,{className:`ls-group`,role:`listitem`,"data-open":s,children:[_,S]}),t[32]=s,t[33]=S,t[34]=_,t[35]=C):C=t[35],C}function N(e){return(0,w.jsx)(se,{card:e},e.id)}var se=(0,re.memo)(function(e){let t=(0,ne.c)(107),{card:n}=e,{selectCard:r,moveCard:i,deleteCard:v,archiveCard:T,setCardPinned:E}=C(x(ce)),ie;t[0]===n.id?ie=t[1]:(ie=e=>e.selectedCardId===n.id,t[0]=n.id,t[1]=ie);let D=C(ie),ae=(0,re.useRef)(null),O=n.link.worktreeLink?.branch,k=n.link.prLinks[0],A=n.link.issueLink,oe;t[2]!==n.activityState||t[3]!==n.showSpinner?(oe=S(n.activityState,n.showSpinner),t[2]=n.activityState,t[3]=n.showSpinner,t[4]=oe):oe=t[4];let j=oe,M=!!n.link.pinnedAt,N=h[h.indexOf(n.link.column)+1],se;t[5]!==n.id||t[6]!==i?(se=e=>s(n.id,ae.current,()=>i(n.id,e)),t[5]=n.id,t[6]=i,t[7]=se):se=t[7];let P=se,ue;t[8]!==n.id||t[9]!==M||t[10]!==E?(ue=()=>s(n.id,ae.current,()=>E(n.id,!M)),t[8]=n.id,t[9]=M,t[10]=E,t[11]=ue):ue=t[11];let F=ue,de;t[12]!==n.id||t[13]!==D||t[14]!==r?(de=()=>r(D?null:n.id),t[12]=n.id,t[13]=D,t[14]=r,t[15]=de):de=t[15];let I=de,fe;t[16]!==n.displayTitle||t[17]!==n.id||t[18]!==n.link.name||t[19]!==v?(fe=async()=>{let e=n.displayTitle||n.link.name||`this card`;await c(`Delete "${e}"?
2
-
3
- The Claude session .jsonl on disk is not deleted — you can still find it in All Sessions.`,{title:`Delete card`,kind:`warning`,okLabel:`Delete`,cancelLabel:`Cancel`})&&v(n.id)},t[16]=n.displayTitle,t[17]=n.id,t[18]=n.link.name,t[19]=v,t[20]=fe):fe=t[20];let pe=fe,me;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(me={display:`contents`},t[21]=me):me=t[21];let L;t[22]!==T||t[23]!==n.id?(L=()=>T(n.id),t[22]=T,t[23]=n.id,t[24]=L):L=t[24];let R;t[25]!==n||t[26]!==P||t[27]!==F||t[28]!==pe||t[29]!==L?(R=(0,w.jsx)(_,{card:n,onMove:P,onTogglePin:F,onArchive:L,onDelete:pe}),t[25]=n,t[26]=P,t[27]=F,t[28]=pe,t[29]=L,t[30]=R):R=t[30];let he=n.activityState===`needsAttention`,ge=D||void 0,z;t[31]===I?z=t[32]:(z=e=>{(e.key===`Enter`||e.key===` `)&&e.target===e.currentTarget&&(e.preventDefault(),I())},t[31]=I,t[32]=z);let _e=j?.label,B;t[33]===j?B=t[34]:(B=j?(0,w.jsx)(`span`,{className:`bd-dot`,"data-tone":j.tone,"data-pulse":j.pulse,role:`img`,"aria-label":j.label}):(0,w.jsx)(`span`,{className:`bd-dot`,"aria-hidden":!0}),t[33]=j,t[34]=B);let V;t[35]!==_e||t[36]!==B?(V=(0,w.jsx)(`span`,{className:`ls-state`,title:_e,children:B}),t[35]=_e,t[36]=B,t[37]=V):V=t[37];let ve;t[38]===n.displayTitle?ve=t[39]:(ve=(0,w.jsx)(`span`,{className:`ls-title`,title:n.displayTitle,children:n.displayTitle}),t[38]=n.displayTitle,t[39]=ve);let H;t[40]!==n.projectName||t[41]!==j?(H=(n.projectName||j)&&(0,w.jsxs)(`span`,{className:`ls-sub`,children:[j&&(0,w.jsx)(`span`,{className:`bd-state`,"data-tone":j.tone,children:j.label}),j&&n.projectName&&(0,w.jsx)(`span`,{"aria-hidden":!0,children:`·`}),n.projectName&&(0,w.jsx)(`span`,{className:`ls-project`,children:n.projectName})]}),t[40]=n.projectName,t[41]=j,t[42]=H):H=t[42];let U;t[43]!==ve||t[44]!==H?(U=(0,w.jsxs)(`div`,{className:`ls-main`,children:[ve,H]}),t[43]=ve,t[44]=H,t[45]=U):U=t[45];let W;t[46]===O?W=t[47]:(W=O&&(0,w.jsxs)(`span`,{className:`bd-chip bd-chip--branch`,title:`Branch: ${O}`,children:[(0,w.jsx)(b,{}),(0,w.jsx)(`span`,{children:O})]}),t[46]=O,t[47]=W);let G;t[48]===W?G=t[49]:(G=(0,w.jsx)(`div`,{className:`ls-cell ls-cell--branch`,children:W}),t[48]=W,t[49]=G);let K;t[50]===k?K=t[51]:(K=k&&(0,w.jsx)(g,{pr:k,ci:te(k.checkRuns)}),t[50]=k,t[51]=K);let q;t[52]===K?q=t[53]:(q=(0,w.jsx)(`div`,{className:`ls-cell ls-cell--pr`,children:K}),t[52]=K,t[53]=q);let J;t[54]===A?J=t[55]:(J=A&&(0,w.jsxs)(`span`,{className:`bd-chip`,title:A.title??`Issue #${A.number}`,children:[(0,w.jsx)(u,{}),(0,w.jsxs)(`span`,{children:[`#`,A.number]})]}),t[54]=A,t[55]=J);let Y;t[56]===J?Y=t[57]:(Y=(0,w.jsx)(`div`,{className:`ls-cell ls-cell--issue`,children:J}),t[56]=J,t[57]=Y);let X;t[58]===M?X=t[59]:(X=M&&(0,w.jsx)(`span`,{className:`ls-pin`,role:`img`,"aria-label":`Pinned`,children:(0,w.jsx)(f,{})}),t[58]=M,t[59]=X);let Z;t[60]===n.relativeTime?Z=t[61]:(Z=(0,w.jsx)(`time`,{className:`ls-time`,children:n.relativeTime}),t[60]=n.relativeTime,t[61]=Z);let Q;t[62]!==P||t[63]!==N?(Q=N&&(0,w.jsx)(ee,{label:`Move to ${o[N]}`,onClick:()=>P(N),children:(0,w.jsx)(d,{})}),t[62]=P,t[63]=N,t[64]=Q):Q=t[64];let ye;t[65]===k?ye=t[66]:(ye=k?.url&&(0,w.jsx)(ee,{label:`Open PR #${k.number}`,onClick:()=>window.open(k.url,`_blank`,`noopener`),children:(0,w.jsx)(l,{})}),t[65]=k,t[66]=ye);let be;t[67]===O?be=t[68]:(be=O&&(0,w.jsx)(ee,{label:`Copy branch name`,onClick:()=>{navigator.clipboard?.writeText(O),m(`Branch copied`)},children:(0,w.jsx)(y,{})}),t[67]=O,t[68]=be);let xe=M?`Unpin`:`Pin to top`,Se;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,w.jsx)(f,{}),t[69]=Se):Se=t[69];let Ce;t[70]!==F||t[71]!==M||t[72]!==xe?(Ce=(0,w.jsx)(ee,{label:xe,pressed:M,onClick:F,children:Se}),t[70]=F,t[71]=M,t[72]=xe,t[73]=Ce):Ce=t[73];let we;t[74]!==T||t[75]!==n.id?(we=()=>s(n.id,ae.current,()=>T(n.id)),t[74]=T,t[75]=n.id,t[76]=we):we=t[76];let Te;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,w.jsx)(a,{}),t[77]=Te):Te=t[77];let Ee;t[78]===we?Ee=t[79]:(Ee=(0,w.jsx)(ee,{label:`Archive`,onClick:we,children:Te}),t[78]=we,t[79]=Ee);let De;t[80]!==Q||t[81]!==ye||t[82]!==be||t[83]!==Ce||t[84]!==Ee?(De=(0,w.jsxs)(`div`,{className:`ls-actions`,onClick:le,children:[Q,ye,be,Ce,Ee]}),t[80]=Q,t[81]=ye,t[82]=be,t[83]=Ce,t[84]=Ee,t[85]=De):De=t[85];let Oe;t[86]!==X||t[87]!==Z||t[88]!==De?(Oe=(0,w.jsxs)(`div`,{className:`ls-end`,children:[X,Z,De]}),t[86]=X,t[87]=Z,t[88]=De,t[89]=Oe):Oe=t[89];let $;t[90]!==n.displayTitle||t[91]!==n.id||t[92]!==D||t[93]!==I||t[94]!==he||t[95]!==ge||t[96]!==z||t[97]!==V||t[98]!==U||t[99]!==G||t[100]!==q||t[101]!==Y||t[102]!==Oe?($=(0,w.jsxs)(`div`,{ref:ae,role:`listitem`,tabIndex:0,"data-ls-stop":!0,"data-card-id":n.id,"data-selected":D,"data-attention":he,className:`ls-row`,"aria-label":n.displayTitle,"aria-current":ge,onClick:I,onKeyDown:z,children:[V,U,G,q,Y,Oe]}),t[90]=n.displayTitle,t[91]=n.id,t[92]=D,t[93]=I,t[94]=he,t[95]=ge,t[96]=z,t[97]=V,t[98]=U,t[99]=G,t[100]=q,t[101]=Y,t[102]=Oe,t[103]=$):$=t[103];let ke;return t[104]!==$||t[105]!==R?(ke=(0,w.jsx)(p,{style:me,menu:R,children:$}),t[104]=$,t[105]=R,t[106]=ke):ke=t[106],ke});function ce(e){return{selectCard:e.selectCard,moveCard:e.moveCard,deleteCard:e.deleteCard,archiveCard:e.archiveCard,setCardPinned:e.setCardPinned}}function le(e){return e.stopPropagation()}export{ae as default};
@@ -1 +0,0 @@
1
- import{d as e,m as t,t as n}from"./jsx-runtime-QmcfnBgR.js";import{o as r,t as i}from"./TaskDescriptionEditor-Cv0nlU3w.js";import{o as a,p as o}from"./Surface-BQKeigoq.js";import{C as s,Q as c,_ as l,g as u,h as d,m as f,p,pt as m,v as h}from"./index-gWSenOqD.js";var g=t(e(),1),_=n(),v=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function y(e,t){return t?e.find(e=>e===t)||(e.filter(e=>t.startsWith(e+`/`)||t.startsWith(e+`\\`)).sort((e,t)=>t.length-e.length)[0]??null):null}function b(){let e=m(e=>e.createCard),t=m(e=>e.setNewTaskOpen),n=m(e=>e.selectCard),b=m(e=>e.cards),x=m(e=>e.newTaskProject),[S,C]=(0,g.useState)(``),[w,T]=(0,g.useState)(``),[E,D]=(0,g.useState)(``),[O,k]=(0,g.useState)(!0),A=`claude`,[j,M]=(0,g.useState)(!1),[N,P]=(0,g.useState)([]),[F,I]=(0,g.useState)([]),[L,R]=(0,g.useState)([]),[z,B]=(0,g.useState)({}),[V,H]=(0,g.useState)(null),U=(0,g.useRef)(null),[W,G]=(0,g.useState)([]),K=[...new Set(b.map(e=>e.link.projectPath??e.session?.projectPath).filter(Boolean))],q=N.length>0?N:K.slice(0,30);(0,g.useEffect)(()=>{c().then(e=>{let t=e.projects.map(e=>e.path).filter(Boolean);P(t),!E&&t.length>0?D(y(t,x)??t[0]):!E&&x&&D(x),R(e.apiServices??[]),B(e.defaultAPIServiceIds??{})}).catch(console.error)},[]);let J=async i=>{if(i.preventDefault(),S.trim()&&!j){M(!0);try{let i=await e(r(S,W),w.trim()||null,E||`.`,O,A,F.length>0?F:void 0,V);t(!1),O&&i&&n(i)}finally{M(!1)}}},Y=()=>t(!1),X=L.filter(e=>e.assistant===A);return(0,_.jsx)(s,{open:!0,onOpenChange:e=>!e&&Y(),title:`New task`,description:`Describe what Claude should do. Each task becomes a card with its own session.`,width:640,footer:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`span`,{className:`nt-shortcut`,children:[(0,_.jsx)(o,{children:v?`⌘`:`Ctrl`}),(0,_.jsx)(o,{children:`↵`}),(0,_.jsxs)(`span`,{children:[`to `,O?`create & start`:`create`]})]}),(0,_.jsx)(a,{variant:`ghost`,onClick:Y,children:`Cancel`}),(0,_.jsx)(a,{type:`submit`,form:`new-task-form`,variant:`solid`,disabled:!S.trim()||j,children:j?`Creating...`:O?`Create & start`:`Create task`})]}),children:(0,_.jsxs)(`form`,{id:`new-task-form`,ref:U,onSubmit:J,className:`flex flex-col gap-4`,onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),U.current?.requestSubmit())},onDragOver:e=>e.dataTransfer.types.includes(`Files`)&&e.preventDefault(),onDrop:e=>e.dataTransfer.types.includes(`Files`)&&e.preventDefault(),children:[(0,_.jsxs)(f,{children:[(0,_.jsxs)(l,{htmlFor:`nt-title`,children:[`Title `,(0,_.jsx)(`span`,{className:`tg-muted`,children:`(optional, defaults to the first line)`})]}),(0,_.jsx)(u,{id:`nt-title`,placeholder:`Short name shown on the board card`,value:w,onChange:e=>T(e.target.value),autoComplete:`off`})]}),(0,_.jsxs)(f,{children:[(0,_.jsx)(l,{htmlFor:`nt-prompt`,children:`Description`}),(0,_.jsx)(i,{initialValue:``,onChange:C,imagePaths:F,onImagePathsChange:I,files:W,onFilesChange:G,autoFocus:!0})]}),(0,_.jsxs)(`div`,{className:`nt-row`,"data-cols":X.length>0?2:1,children:[(0,_.jsxs)(f,{children:[(0,_.jsx)(l,{htmlFor:`nt-project`,children:`Project`}),q.length>0?(0,_.jsx)(h,{id:`nt-project`,value:E,onValueChange:D,options:q.map(e=>({value:e,label:e.split(/[/\\]/).pop()??e}))}):(0,_.jsx)(u,{id:`nt-project`,placeholder:`C:\\path\\to\\project`,value:E,onChange:e=>D(e.target.value)})]}),X.length>0&&(0,_.jsxs)(f,{children:[(0,_.jsx)(l,{htmlFor:`nt-api`,children:`API service`}),(0,_.jsx)(h,{id:`nt-api`,value:V??``,onValueChange:e=>H(e||null),options:[{value:``,label:z[A]?`Default: ${L.find(e=>e.id===z[A])?.name??`configured default`}`:`Default: bare CLI`},...X.map(e=>({value:e.id,label:e.name}))]})]})]}),(0,_.jsxs)(f,{children:[(0,_.jsx)(p,{checked:O,onCheckedChange:k,label:`Start immediately in terminal`}),(0,_.jsx)(d,{children:O?`Claude starts working as soon as the card is created.`:`The card is added to the backlog; start it later.`})]})]})})}export{b as default};
@@ -1 +0,0 @@
1
- import{d as e,m as t,t as n,u as r}from"./jsx-runtime-QmcfnBgR.js";import{B as i,Q as a,R as o,Y as s,ct as c,z as l}from"./index-gWSenOqD.js";var u=r(),d=t(e(),1),f=n(),p=5;function m({onComplete:e}){let{theme:t}=i(),n=l(t),[r,u]=(0,d.useState)(0),[m,y]=(0,d.useState)(null),[x,S]=(0,d.useState)(!1),[C,w]=(0,d.useState)(null);(0,d.useEffect)(()=>{T(),a().then(w).catch(console.error)},[]);let T=async()=>{S(!0);try{let e=await s();y(e)}catch(e){console.error(e)}finally{S(!1)}},E=()=>u(e=>Math.min(e+1,4)),D=()=>u(e=>Math.max(e-1,0)),O=async()=>{C&&await c({...C,hasCompletedOnboarding:!0}),e()},k=async()=>{let e=await o(`Select project folder`);if(!e||!C||C.projects.find(t=>t.path===e))return;let t={...C,projects:[...C.projects,{path:e}]};w(t),await c(t)},A=async e=>{if(!C)return;let t={...C,projects:C.projects.filter(t=>t.path!==e)};w(t),await c(t)};return(0,f.jsx)(`div`,{className:`fixed inset-0 z-[100] flex items-center justify-center`,style:{background:n.bg},children:(0,f.jsxs)(`div`,{className:`w-[560px] rounded-[34px] flex flex-col overflow-hidden`,style:{...n.mat.ultrathick,border:`1px solid ${n.borderBright}`},children:[(0,f.jsx)(`div`,{className:`flex items-center justify-center gap-2 pt-6 pb-3`,children:Array.from({length:p}).map((e,t)=>(0,f.jsx)(`div`,{className:`w-2 h-2 rounded-full transition-colors`,style:{background:t===r?`var(--ink)`:t<r?`#3fb950`:n.bgAccent(`0.10`)}},t))}),(0,f.jsx)(`div`,{style:{borderTop:`1px solid ${n.border}`}}),(0,f.jsxs)(`div`,{className:`flex-1 min-h-[320px] p-8`,children:[r===0&&(0,f.jsx)(h,{themeTokens:n}),r===1&&(0,f.jsx)(g,{deps:m,checking:x,onRecheck:T,themeTokens:n}),r===2&&(0,f.jsx)(_,{deps:m,checking:x,onRecheck:T,themeTokens:n}),r===3&&(0,f.jsx)(v,{settings:C,onAdd:k,onRemove:A,themeTokens:n}),r===4&&(0,f.jsx)(b,{deps:m,settings:C,themeTokens:n})]}),(0,f.jsx)(`div`,{style:{borderTop:`1px solid ${n.border}`}}),(0,f.jsxs)(`div`,{className:`flex items-center justify-between px-6 py-4`,children:[(0,f.jsx)(`div`,{children:r>0&&r<4&&(0,f.jsx)(`button`,{onClick:D,className:`px-4 py-2 rounded-lg text-[13px] transition-colors`,style:{color:n.textMuted},onMouseEnter:e=>{e.currentTarget.style.background=n.hoverBg,e.currentTarget.style.color=n.textPrimary},onMouseLeave:e=>{e.currentTarget.style.background=``,e.currentTarget.style.color=n.textMuted},children:`Back`})}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r>0&&r<4&&(0,f.jsx)(`button`,{onClick:E,className:`px-4 py-2 rounded-lg text-[13px] transition-colors`,style:{color:n.textMuted},onMouseEnter:e=>{e.currentTarget.style.color=n.textSecondary},onMouseLeave:e=>{e.currentTarget.style.color=n.textMuted},children:`Skip`}),r<4?(0,f.jsx)(`button`,{onClick:E,className:`px-5 py-2 rounded-lg tg-btn tg-btn--solid tg-btn--sm text-[13px] font-medium transition-colors`,children:r===0?`Get Started`:`Continue`}):(0,f.jsx)(`button`,{onClick:O,className:`px-5 py-2 rounded-lg tg-btn tg-btn--solid tg-btn--sm text-[13px] font-medium transition-colors`,children:`Done`})]})]})]})})}function h(e){let t=(0,u.c)(8),{themeTokens:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,f.jsx)(`div`,{className:`w-16 h-16 rounded-2xl bg-gradient-to-br from-[var(--mist-1)] to-[var(--mist-3)] flex items-center justify-center `,children:(0,f.jsx)(`svg`,{className:`w-8 h-8 text-white`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:1.5,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25a2.25 2.25 0 0 1-2.25-2.25v-2.25Z`})})}),t[0]=r):r=t[0];let i;t[1]===n.textPrimary?i=t[2]:(i=(0,f.jsx)(`h2`,{className:`text-xl font-medium mb-2`,style:{color:n.textPrimary},children:`Welcome to DevBoard`}),t[1]=n.textPrimary,t[2]=i);let a;t[3]===n.textMuted?a=t[4]:(a=(0,f.jsx)(`p`,{className:`text-[14px] max-w-[360px] leading-relaxed`,style:{color:n.textMuted},children:`Let's set up everything you need to manage your Claude Code sessions on a visual devboard board.`}),t[3]=n.textMuted,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,f.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full text-center gap-5`,children:[r,(0,f.jsxs)(`div`,{children:[i,a]})]}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function g(e){let t=(0,u.c)(29),{deps:n,checking:r,onRecheck:i,themeTokens:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,f.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:1.5,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z`})}),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=(0,f.jsx)(x,{themeTokens:a,icon:o,title:`Claude Code CLI`,description:`DevBoard manages sessions from Claude Code. Make sure it's installed globally.`}),t[1]=a,t[2]=s);let c=n?.claudeAvailable??!1,l;t[3]!==a||t[4]!==c?(l=(0,f.jsx)(S,{label:`Claude Code`,ok:c,themeTokens:a}),t[3]=a,t[4]=c,t[5]=l):l=t[5];let d;t[6]!==a||t[7]!==r||t[8]!==n?.claudeAvailable||t[9]!==i?(d=n?.claudeAvailable?(0,f.jsxs)(`div`,{className:`flex items-center gap-2 text-[#3fb950] text-[13px]`,children:[(0,f.jsx)(w,{}),`Claude Code is installed and ready`]}):(0,f.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,f.jsx)(`p`,{className:`text-[12px]`,style:{color:a.textMuted},children:`Install Claude Code:`}),(0,f.jsx)(T,{command:`npm install -g @anthropic-ai/claude-code`,themeTokens:a}),(0,f.jsx)(`p`,{className:`text-[11px]`,style:{color:a.textDim},children:`DevBoard works without it — columns will just be empty until sessions are created.`}),(0,f.jsx)(E,{checking:r,onRecheck:i,themeTokens:a})]}),t[6]=a,t[7]=r,t[8]=n?.claudeAvailable,t[9]=i,t[10]=d):d=t[10];let p;t[11]===a.textDim?p=t[12]:(p={color:a.textDim},t[11]=a.textDim,t[12]=p);let m;t[13]===a.textMuted?m=t[14]:(m=(0,f.jsx)(`code`,{className:`font-mono`,style:{color:a.textMuted},children:`cmd.exe`}),t[13]=a.textMuted,t[14]=m);let h;t[15]===a.textMuted?h=t[16]:(h=(0,f.jsx)(`code`,{className:`font-mono`,style:{color:a.textMuted},children:`wsl.exe`}),t[15]=a.textMuted,t[16]=h);let g;t[17]===a.textSecondary?g=t[18]:(g=(0,f.jsx)(`span`,{style:{color:a.textSecondary},children:`Settings → Terminal shell`}),t[17]=a.textSecondary,t[18]=g);let _;t[19]!==p||t[20]!==m||t[21]!==h||t[22]!==g?(_=(0,f.jsxs)(`p`,{className:`text-[11px] leading-relaxed`,style:p,children:[`Using WSL? The embedded terminal defaults to`,` `,m,`. If you installed Claude inside WSL, switch it to`,` `,h,` `,`in `,g,` after onboarding.`]}),t[19]=p,t[20]=m,t[21]=h,t[22]=g,t[23]=_):_=t[23];let v;return t[24]!==_||t[25]!==s||t[26]!==l||t[27]!==d?(v=(0,f.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[s,l,d,_]}),t[24]=_,t[25]=s,t[26]=l,t[27]=d,t[28]=v):v=t[28],v}function _(e){let t=(0,u.c)(30),{deps:n,checking:r,onRecheck:i,themeTokens:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,f.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:1.5,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9`})}),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=(0,f.jsx)(x,{themeTokens:a,icon:o,title:`Dependencies`,description:`Tools that DevBoard uses for session management and GitHub integration.`}),t[1]=a,t[2]=s);let c=n?.gitAvailable??!1,l;t[3]!==a||t[4]!==c?(l=(0,f.jsx)(S,{label:`Git`,ok:c,themeTokens:a}),t[3]=a,t[4]=c,t[5]=l):l=t[5];let d=n?.ghAvailable??!1,p;t[6]!==a||t[7]!==d?(p=(0,f.jsx)(S,{label:`GitHub CLI (gh)`,ok:d,themeTokens:a}),t[6]=a,t[7]=d,t[8]=p):p=t[8];let m;t[9]!==a||t[10]!==n?.ghAuthenticated||t[11]!==n?.ghAvailable?(m=n?.ghAvailable&&!n?.ghAuthenticated&&(0,f.jsxs)(`div`,{className:`ml-6 flex items-center gap-1.5 text-[12px] text-amber-500`,children:[(0,f.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z`})}),(0,f.jsxs)(`span`,{children:[`gh is installed but not logged in. Run`,` `,(0,f.jsx)(`code`,{className:`font-mono`,style:{color:a.textSecondary},children:`gh auth login`}),` `,`in a terminal.`]})]}),t[9]=a,t[10]=n?.ghAuthenticated,t[11]=n?.ghAvailable,t[12]=m):m=t[12];let h;t[13]!==l||t[14]!==p||t[15]!==m?(h=(0,f.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[l,p,m]}),t[13]=l,t[14]=p,t[15]=m,t[16]=h):h=t[16];let g;t[17]!==a||t[18]!==n?.ghAvailable||t[19]!==n?.gitAvailable?(g=(!n?.gitAvailable||!n?.ghAvailable)&&(0,f.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,f.jsx)(`p`,{className:`text-[12px]`,style:{color:a.textMuted},children:`Install missing tools:`}),!n?.gitAvailable&&(0,f.jsx)(T,{command:`winget install Git.Git`,themeTokens:a}),!n?.ghAvailable&&(0,f.jsx)(T,{command:`winget install GitHub.cli`,themeTokens:a})]}),t[17]=a,t[18]=n?.ghAvailable,t[19]=n?.gitAvailable,t[20]=g):g=t[20];let _;t[21]!==a||t[22]!==r||t[23]!==i?(_=(0,f.jsx)(E,{checking:r,onRecheck:i,themeTokens:a}),t[21]=a,t[22]=r,t[23]=i,t[24]=_):_=t[24];let v;return t[25]!==_||t[26]!==s||t[27]!==h||t[28]!==g?(v=(0,f.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[s,h,g,_]}),t[25]=_,t[26]=s,t[27]=h,t[28]=g,t[29]=v):v=t[29],v}function v(e){let t=(0,u.c)(18),{settings:n,onAdd:r,onRemove:i,themeTokens:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,f.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:1.5,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z`})}),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=(0,f.jsx)(x,{themeTokens:a,icon:o,title:`Add a Project`,description:`Select the folder(s) where you use Claude Code. Sessions and git worktrees in these folders will appear on the board.`}),t[1]=a,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,f.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 4.5v15m7.5-7.5h-15`})}),t[3]=c):c=t[3];let l;t[4]===r?l=t[5]:(l=(0,f.jsxs)(`button`,{onClick:r,className:`flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl tg-btn tg-btn--solid tg-btn--sm text-[13px] font-medium transition-all w-fit`,children:[c,`Add Project Folder`]}),t[4]=r,t[5]=l);let d;t[6]!==a||t[7]!==i||t[8]!==n?(d=n&&n.projects.length>0&&(0,f.jsx)(`div`,{className:`flex flex-col gap-1.5 max-h-[160px] overflow-y-auto`,children:n.projects.map(e=>(0,f.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2.5 rounded-xl`,style:{background:a.bgCard,border:`1px solid ${a.borderCard}`},children:[(0,f.jsxs)(`div`,{className:`min-w-0`,children:[(0,f.jsx)(`p`,{className:`text-[13px] truncate`,style:{color:a.textSecondary},children:e.name??e.path.split(/[/\\]/).pop()??e.path}),(0,f.jsx)(`p`,{className:`text-[11px] font-mono truncate`,style:{color:a.textMuted},children:e.path})]}),(0,f.jsx)(`button`,{onClick:()=>i(e.path),className:`ml-2 shrink-0 transition-colors`,style:{color:a.textDim},onMouseEnter:y,onMouseLeave:e=>{e.currentTarget.style.color=a.textDim},children:(0,f.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 18 18 6M6 6l12 12`})})})]},e.path))}),t[6]=a,t[7]=i,t[8]=n,t[9]=d):d=t[9];let p;t[10]!==a||t[11]!==n?(p=(!n||n.projects.length===0)&&(0,f.jsx)(`p`,{className:`text-[12px]`,style:{color:a.textDim},children:`No projects added yet. You can always add more later in Settings.`}),t[10]=a,t[11]=n,t[12]=p):p=t[12];let m;return t[13]!==s||t[14]!==l||t[15]!==d||t[16]!==p?(m=(0,f.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[s,l,d,p]}),t[13]=s,t[14]=l,t[15]=d,t[16]=p,t[17]=m):m=t[17],m}function y(e){e.currentTarget.style.color=`#f85149`}function b(e){let t=(0,u.c)(26),{deps:n,settings:r,themeTokens:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,f.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:1.5,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 0 1-1.043 3.296 3.745 3.745 0 0 1-3.296 1.043A3.745 3.745 0 0 1 12 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 0 1-3.296-1.043 3.746 3.746 0 0 1-1.043-3.296A3.745 3.745 0 0 1 3 12c0-1.268.63-2.39 1.593-3.068a3.746 3.746 0 0 1 1.043-3.296 3.746 3.746 0 0 1 3.296-1.043A3.746 3.746 0 0 1 12 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 0 1 3.296 1.043 3.746 3.746 0 0 1 1.043 3.296A3.745 3.745 0 0 1 21 12Z`})}),t[0]=a):a=t[0];let o;t[1]===i?o=t[2]:(o=(0,f.jsx)(x,{themeTokens:i,icon:a,title:`Setup Complete`,description:`Here's a summary of your configuration.`}),t[1]=i,t[2]=o);let s=n?.claudeAvailable??!1,c;t[3]!==i||t[4]!==s?(c=(0,f.jsx)(C,{label:`Claude Code`,ok:s,themeTokens:i}),t[3]=i,t[4]=s,t[5]=c):c=t[5];let l=n?.gitAvailable??!1,d;t[6]!==i||t[7]!==l?(d=(0,f.jsx)(C,{label:`Git`,ok:l,themeTokens:i}),t[6]=i,t[7]=l,t[8]=d):d=t[8];let p=n?.ghAuthenticated??!1,m;t[9]!==i||t[10]!==p?(m=(0,f.jsx)(C,{label:`GitHub CLI`,ok:p,themeTokens:i}),t[9]=i,t[10]=p,t[11]=m):m=t[11];let h=(r?.projects.length??0)>0,g;t[12]!==i||t[13]!==h?(g=(0,f.jsx)(C,{label:`Projects`,ok:h,themeTokens:i}),t[12]=i,t[13]=h,t[14]=g):g=t[14];let _;t[15]!==g||t[16]!==c||t[17]!==d||t[18]!==m?(_=(0,f.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[c,d,m,g]}),t[15]=g,t[16]=c,t[17]=d,t[18]=m,t[19]=_):_=t[19];let v;t[20]===i.textDim?v=t[21]:(v=(0,f.jsx)(`p`,{className:`text-[11px] mt-1`,style:{color:i.textDim},children:`You can always reopen this wizard or change settings later from the Settings page.`}),t[20]=i.textDim,t[21]=v);let y;return t[22]!==_||t[23]!==v||t[24]!==o?(y=(0,f.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[o,_,v]}),t[22]=_,t[23]=v,t[24]=o,t[25]=y):y=t[25],y}function x(e){let t=(0,u.c)(18),{icon:n,title:r,description:i,themeTokens:a}=e,o;t[0]===n?o=t[1]:(o=(0,f.jsx)(`span`,{className:`text-[color:var(--ink)]`,children:n}),t[0]=n,t[1]=o);let s;t[2]===a.textPrimary?s=t[3]:(s={color:a.textPrimary},t[2]=a.textPrimary,t[3]=s);let c;t[4]!==s||t[5]!==r?(c=(0,f.jsx)(`h3`,{className:`text-[16px] font-medium`,style:s,children:r}),t[4]=s,t[5]=r,t[6]=c):c=t[6];let l;t[7]!==o||t[8]!==c?(l=(0,f.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[o,c]}),t[7]=o,t[8]=c,t[9]=l):l=t[9];let d;t[10]===a.textMuted?d=t[11]:(d={color:a.textMuted},t[10]=a.textMuted,t[11]=d);let p;t[12]!==i||t[13]!==d?(p=(0,f.jsx)(`p`,{className:`text-[13px] leading-relaxed`,style:d,children:i}),t[12]=i,t[13]=d,t[14]=p):p=t[14];let m;return t[15]!==l||t[16]!==p?(m=(0,f.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[l,p]}),t[15]=l,t[16]=p,t[17]=m):m=t[17],m}function S(e){let t=(0,u.c)(17),{label:n,ok:r,themeTokens:i}=e,a;t[0]!==i.textDim||t[1]!==r?(a=r?(0,f.jsx)(`svg`,{className:`w-4 h-4 text-[#3fb950]`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{fillRule:`evenodd`,d:`M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z`,clipRule:`evenodd`})}):(0,f.jsx)(`div`,{className:`w-4 h-4 rounded-full`,style:{border:`1.5px solid ${i.textDim}`}}),t[0]=i.textDim,t[1]=r,t[2]=a):a=t[2];let o;t[3]===i.textSecondary?o=t[4]:(o={color:i.textSecondary},t[3]=i.textSecondary,t[4]=o);let s;t[5]!==n||t[6]!==o?(s=(0,f.jsx)(`span`,{className:`text-[13px]`,style:o,children:n}),t[5]=n,t[6]=o,t[7]=s):s=t[7];let c=r?`#3fb950`:`#d29922`,l;t[8]===c?l=t[9]:(l={color:c},t[8]=c,t[9]=l);let d=r?`Ready`:`Not found`,p;t[10]!==l||t[11]!==d?(p=(0,f.jsx)(`span`,{className:`ml-auto text-[11px]`,style:l,children:d}),t[10]=l,t[11]=d,t[12]=p):p=t[12];let m;return t[13]!==a||t[14]!==s||t[15]!==p?(m=(0,f.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[a,s,p]}),t[13]=a,t[14]=s,t[15]=p,t[16]=m):m=t[16],m}function C(e){let t=(0,u.c)(10),{label:n,ok:r,themeTokens:i}=e,a;t[0]===r?a=t[1]:(a=r?(0,f.jsx)(`svg`,{className:`w-4 h-4 text-[#3fb950]`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{fillRule:`evenodd`,d:`M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z`,clipRule:`evenodd`})}):(0,f.jsx)(`svg`,{className:`w-4 h-4 text-amber-500`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:1.5,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z`})}),t[0]=r,t[1]=a);let o;t[2]===i.textSecondary?o=t[3]:(o={color:i.textSecondary},t[2]=i.textSecondary,t[3]=o);let s;t[4]!==n||t[5]!==o?(s=(0,f.jsx)(`span`,{className:`text-[13px]`,style:o,children:n}),t[4]=n,t[5]=o,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==s?(c=(0,f.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function w(){let e=(0,u.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,f.jsx)(`svg`,{className:`w-4 h-4`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{fillRule:`evenodd`,d:`M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z`,clipRule:`evenodd`})}),e[0]=t):t=e[0],t}function T(e){let t=(0,u.c)(28),{command:n,themeTokens:r}=e,[i,a]=(0,d.useState)(!1),o;t[0]===n?o=t[1]:(o=()=>{navigator.clipboard.writeText(n),a(!0),setTimeout(()=>a(!1),1500)},t[0]=n,t[1]=o);let s=o,c;t[2]===r?c=t[3]:(c=r.bgAccent(`0.03`),t[2]=r,t[3]=c);let l=`1px solid ${r.border}`,p;t[4]!==r.textSecondary||t[5]!==c||t[6]!==l?(p={background:c,border:l,color:r.textSecondary},t[4]=r.textSecondary,t[5]=c,t[6]=l,t[7]=p):p=t[7];let m;t[8]!==n||t[9]!==p?(m=(0,f.jsx)(`code`,{className:`flex-1 rounded-lg px-3 py-2 text-[12px] font-mono select-all`,style:p,children:n}),t[8]=n,t[9]=p,t[10]=m):m=t[10];let h;t[11]===r.textMuted?h=t[12]:(h={color:r.textMuted},t[11]=r.textMuted,t[12]=h);let g;t[13]===r.textPrimary?g=t[14]:(g=e=>{e.currentTarget.style.color=r.textPrimary},t[13]=r.textPrimary,t[14]=g);let _;t[15]===r.textMuted?_=t[16]:(_=e=>{e.currentTarget.style.color=r.textMuted},t[15]=r.textMuted,t[16]=_);let v;t[17]===i?v=t[18]:(v=i?(0,f.jsx)(`svg`,{className:`w-4 h-4 text-[#3fb950]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m4.5 12.75 6 6 9-13.5`})}):(0,f.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:1.5,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75`})}),t[17]=i,t[18]=v);let y;t[19]!==s||t[20]!==h||t[21]!==g||t[22]!==_||t[23]!==v?(y=(0,f.jsx)(`button`,{onClick:s,className:`transition-colors shrink-0`,style:h,onMouseEnter:g,onMouseLeave:_,title:`Copy to clipboard`,children:v}),t[19]=s,t[20]=h,t[21]=g,t[22]=_,t[23]=v,t[24]=y):y=t[24];let b;return t[25]!==y||t[26]!==m?(b=(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m,y]}),t[25]=y,t[26]=m,t[27]=b):b=t[27],b}function E(e){let t=(0,u.c)(19),{checking:n,onRecheck:r,themeTokens:i}=e,a;t[0]===i?a=t[1]:(a=i.bgAccent(`0.04`),t[0]=i,t[1]=a);let o;t[2]!==i.textMuted||t[3]!==a?(o={background:a,color:i.textMuted},t[2]=i.textMuted,t[3]=a,t[4]=o):o=t[4];let s,c;t[5]!==i||t[6]!==n?(s=e=>{n||(e.currentTarget.style.background=i.bgAccent(`0.08`),e.currentTarget.style.color=i.textPrimary)},c=e=>{n||(e.currentTarget.style.background=i.bgAccent(`0.04`),e.currentTarget.style.color=i.textMuted)},t[5]=i,t[6]=n,t[7]=s,t[8]=c):(s=t[7],c=t[8]);let l;t[9]!==i.textMuted||t[10]!==n?(l=n&&(0,f.jsx)(`div`,{className:`w-3 h-3 border-[1.5px] border-t-transparent rounded-full animate-spin`,style:{borderColor:i.textMuted,borderTopColor:`transparent`}}),t[9]=i.textMuted,t[10]=n,t[11]=l):l=t[11];let d;return t[12]!==n||t[13]!==r||t[14]!==o||t[15]!==s||t[16]!==c||t[17]!==l?(d=(0,f.jsxs)(`button`,{onClick:r,disabled:n,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[12px] transition-colors disabled:opacity-50 w-fit`,style:o,onMouseEnter:s,onMouseLeave:c,children:[l,`Re-check`]}),t[12]=n,t[13]=r,t[14]=o,t[15]=s,t[16]=c,t[17]=l,t[18]=d):d=t[18],d}export{m as default};
@@ -1 +0,0 @@
1
- import{d as e,i as t,m as n,t as r,u as i}from"./jsx-runtime-QmcfnBgR.js";import{a,c as o,d as s,o as c,s as l,u}from"./Surface-BQKeigoq.js";import{T as d,_ as f,g as p,h as m,m as h,pt as g,x as _}from"./index-gWSenOqD.js";var v=n(e(),1),y=i(),b=r(),x=(e,t)=>e.title===t.title&&e.summary===t.summary&&e.body===t.body;function S(e){let t=(0,y.c)(40),{id:n,value:r,onChange:i}=e,a=`${n}-t`,o;t[0]===a?o=t[1]:(o=(0,b.jsx)(f,{htmlFor:a,children:`Title`}),t[0]=a,t[1]=o);let s=`${n}-t`,c;t[2]!==i||t[3]!==r?(c=e=>i({...r,title:e.target.value}),t[2]=i,t[3]=r,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==c||t[7]!==r.title?(l=(0,b.jsx)(p,{id:s,value:r.title,onChange:c}),t[5]=s,t[6]=c,t[7]=r.title,t[8]=l):l=t[8];let u;t[9]!==o||t[10]!==l?(u=(0,b.jsxs)(h,{children:[o,l]}),t[9]=o,t[10]=l,t[11]=u):u=t[11];let d=`${n}-s`,m;t[12]===d?m=t[13]:(m=(0,b.jsx)(f,{htmlFor:d,children:`Summary`}),t[12]=d,t[13]=m);let g=`${n}-s`,v;t[14]!==i||t[15]!==r?(v=e=>i({...r,summary:e.target.value}),t[14]=i,t[15]=r,t[16]=v):v=t[16];let x;t[17]!==v||t[18]!==g||t[19]!==r.summary?(x=(0,b.jsx)(p,{id:g,value:r.summary,onChange:v}),t[17]=v,t[18]=g,t[19]=r.summary,t[20]=x):x=t[20];let S;t[21]!==x||t[22]!==m?(S=(0,b.jsxs)(h,{children:[m,x]}),t[21]=x,t[22]=m,t[23]=S):S=t[23];let C=`${n}-b`,w;t[24]===C?w=t[25]:(w=(0,b.jsx)(f,{htmlFor:C,children:`Body`}),t[24]=C,t[25]=w);let T=`${n}-b`,E;t[26]!==i||t[27]!==r?(E=e=>i({...r,body:e.target.value}),t[26]=i,t[27]=r,t[28]=E):E=t[28];let D;t[29]!==T||t[30]!==E||t[31]!==r.body?(D=(0,b.jsx)(_,{id:T,rows:6,value:r.body,onChange:E}),t[29]=T,t[30]=E,t[31]=r.body,t[32]=D):D=t[32];let O;t[33]!==w||t[34]!==D?(O=(0,b.jsxs)(h,{children:[w,D]}),t[33]=w,t[34]=D,t[35]=O):O=t[35];let k;return t[36]!==S||t[37]!==O||t[38]!==u?(k=(0,b.jsxs)(b.Fragment,{children:[u,S,O]}),t[36]=S,t[37]=O,t[38]=u,t[39]=k):k=t[39],k}var C=(e,t,n)=>`${e} ${e===1?t:n}`,w=e=>{d({title:e instanceof Error?e.message:String(e),tone:`danger`,duration:6e3})},T={librarian:`From a session`,bootstrap:`From project docs`,manual:`Written by hand`};function E({proposal:e,onChanged:n,showSourceCard:r=!0,onOpenCard:i}){let[f,h]=(0,v.useState)(!1),[_,y]=(0,v.useState)({title:e.title,summary:e.summary,body:e.body}),[x,C]=(0,v.useState)(``),[E,D]=(0,v.useState)(!1),O=g(e=>e.selectCard),k=g(t=>t.cards.find(t=>t.id===e.source?.cardId)),A=e.status===`pending`;return(0,b.jsxs)(l,{material:`thin`,children:[(0,b.jsxs)(u,{children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(s,{children:f?`Editing proposal`:e.title}),(0,b.jsxs)(o,{children:[(0,b.jsx)(a,{children:e.type}),` `,!A&&(0,b.jsx)(a,{tone:e.status===`approved`?`success`:`outline`,children:e.status}),` `,T[e.origin],` · `,e.kbId,e.scope.length?` · about ${e.scope.join(`, `)}`:``,e.supersedes?.length?` · replaces ${e.supersedes.join(`, `)}`:``]})]}),(0,b.jsxs)(`div`,{className:`bd-kb-actions`,style:{marginTop:0},children:[r&&k&&(0,b.jsx)(c,{variant:`ghost`,size:`sm`,onClick:()=>{O(k.id),i?.()},children:`Open task`}),A&&(0,b.jsx)(c,{variant:`ghost`,size:`sm`,onClick:()=>h(e=>!e),children:f?`Done editing`:`Edit`})]})]}),f?(0,b.jsx)(S,{id:`p-${e.id}`,value:_,onChange:y}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`p`,{className:`bd-kb-summary`,children:e.summary}),(0,b.jsx)(`pre`,{className:`bd-kb-body-text`,children:e.body}),e.reason&&(0,b.jsxs)(m,{children:[`Why it was proposed: `,e.reason]})]}),A?(0,b.jsxs)(`div`,{className:`bd-kb-actions`,children:[(0,b.jsx)(c,{variant:`solid`,loading:E,onClick:async()=>{D(!0);try{let r=await t(`kb_proposal_approve`,{id:e.id,edits:f?_:void 0});d({title:`Entry approved`,description:r.prUrl?.startsWith(`http`)?`Pull request: ${r.prUrl}`:r.prUrl,tone:`success`}),n()}catch(e){w(e)}finally{D(!1)}},children:`Approve and open PR`}),(0,b.jsx)(p,{"aria-label":`Reason for rejecting`,placeholder:`Reason (optional)`,value:x,onChange:e=>C(e.target.value)}),(0,b.jsx)(c,{variant:`danger`,disabled:E,onClick:async()=>{D(!0);try{await t(`kb_proposal_reject`,{id:e.id,note:x}),n()}catch(e){w(e)}finally{D(!1)}},children:`Reject`})]}):(0,b.jsxs)(`div`,{className:`bd-kb-actions`,children:[(0,b.jsx)(m,{children:e.status===`approved`&&e.prUrl?.startsWith(`http`)?(0,b.jsx)(`a`,{href:e.prUrl,target:`_blank`,rel:`noopener noreferrer`,children:`Pull request`}):e.prUrl??e.decisionNote??``}),e.status===`approved`&&e.entryId&&(0,b.jsx)(c,{size:`sm`,disabled:E,onClick:async()=>{D(!0);try{let r=await t(`kb_proposal_undo`,{id:e.id});d({title:`Approval undone`,description:r.revertUrl?`It was already merged. Merge this revert to remove it: ${r.revertUrl}`:`The proposal is back in the review queue.`,tone:`success`}),n()}catch(e){w(e)}finally{D(!1)}},children:`Undo approval`})]})]})}export{x as a,S as i,w as n,C as r,E as t};
@@ -1 +0,0 @@
1
- import{d as e,i as t,m as n,t as r,u as i}from"./jsx-runtime-QmcfnBgR.js";import{t as a}from"./chevron-right-BsVThPz4.js";import{t as o}from"./plus-XSPxArj5.js";import{t as s}from"./x-CdEDbLMR.js";import{o as c}from"./Surface-BQKeigoq.js";import{C as l,H as u,Q as d,R as f,T as p,X as m,ct as h,g,gt as _,ht as v,pt as y,v as b,y as x,yt as S}from"./index-gWSenOqD.js";var C={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};C.node;var w=S(C),T={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};T.node;var E=S(T),D=i(),O=n(e(),1),k=r(),A=[{id:`general`,label:`General`,blurb:`Text sizes, terminal sessions and the context guard.`,icon:v},{id:`projects`,label:`Projects`,blurb:`Folders DevBoard tracks, with per-project overrides.`,icon:_},{id:`notifications`,label:`Notifications`,blurb:`Get pulled in only when an agent needs you.`,icon:w},{id:`apis`,label:`API services`,blurb:`Route assistants through a launcher, model or custom endpoint.`,icon:E}];function j(){let e=y(e=>e.setSettingsOpen),[t,n]=(0,O.useState)(null),r=(0,O.useRef)(``),[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(`general`),u=(0,O.useRef)(null);(0,O.useEffect)(()=>{d().then(e=>{r.current=JSON.stringify(e),n(e)}).catch(e=>p({title:`Could not load settings: ${String(e)}`,tone:`danger`}))},[]);let f=(0,O.useMemo)(()=>t!==null&&JSON.stringify(t)!==r.current,[t]),m=()=>e(!1),g=async()=>{if(t){a(!0);try{await h(t),p({title:`Settings saved`,tone:`success`}),m()}catch(e){p({title:`Could not save settings: ${String(e)}`,tone:`danger`,duration:6e3})}finally{a(!1)}}},_=e=>{s(e),u.current?.scrollTo({top:0})},v=e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=A[(A.findIndex(e=>e.id===o)+(e.key===`ArrowDown`?1:A.length-1))%A.length];_(t.id),document.getElementById(`bd-set-tab-${t.id}`)?.focus()},b=A.find(e=>e.id===o);return(0,k.jsx)(l,{open:!0,onOpenChange:e=>!e&&m(),title:`Settings`,width:920,className:`bd-settings`,footer:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{className:`bd-set-dirty`,"aria-live":`polite`,children:f?`Unsaved changes`:``}),(0,k.jsx)(c,{variant:`ghost`,onClick:m,children:`Cancel`}),(0,k.jsx)(c,{variant:`solid`,onClick:g,loading:i,disabled:!f||i,children:`Save changes`})]}),children:(0,k.jsxs)(`div`,{className:`bd-set-body`,children:[(0,k.jsx)(`nav`,{className:`bd-set-nav`,"aria-label":`Settings sections`,role:`tablist`,"aria-orientation":`vertical`,onKeyDown:v,children:A.map(e=>(0,k.jsxs)(`button`,{id:`bd-set-tab-${e.id}`,type:`button`,role:`tab`,"aria-selected":o===e.id,"aria-controls":`bd-set-panel`,tabIndex:o===e.id?0:-1,className:`bd-set-tab`,onClick:()=>_(e.id),children:[(0,k.jsx)(e.icon,{size:18,strokeWidth:1.75,"aria-hidden":`true`}),e.label]},e.id))}),(0,k.jsxs)(`div`,{className:`bd-set-pane`,id:`bd-set-panel`,role:`tabpanel`,"aria-labelledby":`bd-set-tab-${o}`,ref:u,children:[(0,k.jsxs)(`header`,{className:`bd-set-pane-head`,children:[(0,k.jsx)(`h3`,{children:b.label}),(0,k.jsx)(`p`,{children:b.blurb})]}),t?(0,k.jsxs)(`div`,{className:`bd-set-content`,children:[o===`general`&&(0,k.jsx)(R,{settings:t,onChange:n}),o===`projects`&&(0,k.jsx)(B,{settings:t,onChange:n}),o===`notifications`&&(0,k.jsx)(U,{settings:t,onChange:n}),o===`apis`&&(0,k.jsx)(W,{settings:t,onChange:n})]},o):(0,k.jsx)(`div`,{className:`bd-set-loading`,children:`Loading settings…`})]})]})})}function M(e){let t=(0,D.c)(14),{label:n,help:r,children:i}=e,a=(0,O.useId)(),o;t[0]!==a||t[1]!==n?(o=(0,k.jsx)(`span`,{id:a,className:`bd-set-label`,children:n}),t[0]=a,t[1]=n,t[2]=o):o=t[2];let s;t[3]===r?s=t[4]:(s=r&&(0,k.jsx)(`span`,{className:`bd-set-help`,children:r}),t[3]=r,t[4]=s);let c;t[5]!==o||t[6]!==s?(c=(0,k.jsxs)(`div`,{className:`bd-set-row-text`,children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;t[8]===i?l=t[9]:(l=(0,k.jsx)(`div`,{className:`bd-set-row-control`,children:i}),t[8]=i,t[9]=l);let u;return t[10]!==a||t[11]!==c||t[12]!==l?(u=(0,k.jsxs)(`div`,{className:`bd-set-row`,role:`group`,"aria-labelledby":a,children:[c,l]}),t[10]=a,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function N(e){let t=(0,D.c)(10),{label:n,help:r,children:i}=e,a=(0,O.useId)(),o;t[0]!==a||t[1]!==n?(o=(0,k.jsx)(`span`,{id:a,className:`bd-set-label`,children:n}),t[0]=a,t[1]=n,t[2]=o):o=t[2];let s;t[3]===r?s=t[4]:(s=r&&(0,k.jsx)(`span`,{className:`bd-set-help`,children:r}),t[3]=r,t[4]=s);let c;return t[5]!==i||t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,k.jsxs)(`div`,{className:`bd-set-stack`,role:`group`,"aria-labelledby":a,children:[o,i,s]}),t[5]=i,t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function P(e){let t=(0,D.c)(8),{checked:n,onChange:r,label:i,help:a}=e,o;t[0]!==n||t[1]!==i||t[2]!==r?(o=(0,k.jsx)(x,{checked:n,onCheckedChange:r,"aria-label":i}),t[0]=n,t[1]=i,t[2]=r,t[3]=o):o=t[3];let s;return t[4]!==a||t[5]!==i||t[6]!==o?(s=(0,k.jsx)(M,{label:i,help:a,children:o}),t[4]=a,t[5]=i,t[6]=o,t[7]=s):s=t[7],s}function F(e){let t=(0,D.c)(16),{value:n,onChange:r,unit:i,label:a,min:o,max:s,fallback:c}=e,l=o===void 0?0:o,u=c===void 0?l:c,d=`${a}, in ${i}`,f;t[0]!==u||t[1]!==s||t[2]!==l||t[3]!==r?(f=e=>{let t=parseInt(e.target.value);if(Number.isNaN(t))return r(u);r(Math.min(s??1/0,Math.max(l,t)))},t[0]=u,t[1]=s,t[2]=l,t[3]=r,t[4]=f):f=t[4];let p;t[5]!==s||t[6]!==l||t[7]!==d||t[8]!==f||t[9]!==n?(p=(0,k.jsx)(g,{type:`number`,inputMode:`numeric`,min:l,max:s,className:`bd-set-num`,value:n,"aria-label":d,onChange:f}),t[5]=s,t[6]=l,t[7]=d,t[8]=f,t[9]=n,t[10]=p):p=t[10];let m;t[11]===i?m=t[12]:(m=(0,k.jsx)(`span`,{className:`bd-set-unit`,"aria-hidden":!0,children:i}),t[11]=i,t[12]=m);let h;return t[13]!==p||t[14]!==m?(h=(0,k.jsxs)(`span`,{className:`bd-set-numfield`,children:[p,m]}),t[13]=p,t[14]=m,t[15]=h):h=t[15],h}function I(e){let t=(0,D.c)(5),{title:n,children:r}=e,i;t[0]===n?i=t[1]:(i=n&&(0,k.jsx)(`h4`,{children:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,k.jsxs)(`section`,{className:`bd-set-group`,children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function L(e){let t=(0,D.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,k.jsx)(`code`,{className:`bd-set-code`,children:n}),t[0]=n,t[1]=r),r}function R(e){let t=(0,D.c)(45),{settings:n,onChange:r}=e,i=n.cardDetailMode??`popup`,a;t[0]!==r||t[1]!==n?(a=e=>r({...n,cardDetailMode:e}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=[{value:`popup`,label:`Popup`},{value:`drawer`,label:`Drawer`}],t[3]=o):o=t[3];let s;t[4]!==i||t[5]!==a?(s=(0,k.jsx)(I,{title:`Card view`,children:(0,k.jsx)(M,{label:`Open cards as`,help:`A popup grows out of the card you click; a drawer slides in from the right.`,children:(0,k.jsx)(b,{"aria-label":`Card view`,value:i,onValueChange:a,options:o})})}),t[4]=i,t[5]=a,t[6]=s):s=t[6];let c=n.terminalFontSize||15,l;t[7]!==r||t[8]!==n?(l=e=>r({...n,terminalFontSize:e}),t[7]=r,t[8]=n,t[9]=l):l=t[9];let u;t[10]!==c||t[11]!==l?(u=(0,k.jsx)(M,{label:`Terminal`,help:`Applies to terminals opened from now on.`,children:(0,k.jsx)(F,{label:`Terminal text size`,unit:`pt`,min:8,max:24,fallback:15,value:c,onChange:l})}),t[10]=c,t[11]=l,t[12]=u):u=t[12];let d=n.sessionDetailFontSize||12,f;t[13]!==r||t[14]!==n?(f=e=>r({...n,sessionDetailFontSize:e}),t[13]=r,t[14]=n,t[15]=f):f=t[15];let p;t[16]!==d||t[17]!==f?(p=(0,k.jsx)(M,{label:`Transcript`,help:`The Trace tab’s session transcript.`,children:(0,k.jsx)(F,{label:`Transcript text size`,unit:`pt`,min:8,max:20,fallback:12,value:d,onChange:f})}),t[16]=d,t[17]=f,t[18]=p):p=t[18];let m;t[19]!==p||t[20]!==u?(m=(0,k.jsxs)(I,{title:`Text size`,children:[u,p]}),t[19]=p,t[20]=u,t[21]=m):m=t[21];let h=n.terminalSessions?.idleMinutes??30,g;t[22]!==r||t[23]!==n?(g=e=>r({...n,terminalSessions:{maxSessions:8,...n.terminalSessions,idleMinutes:e}}),t[22]=r,t[23]=n,t[24]=g):g=t[24];let _;t[25]!==h||t[26]!==g?(_=(0,k.jsx)(M,{label:`Close idle sessions after`,help:`Closes a terminal nobody is attached to once Claude has been idle this long. It resumes from history when reopened. 0 = never.`,children:(0,k.jsx)(F,{label:`Close idle sessions after`,unit:`min`,value:h,onChange:g})}),t[25]=h,t[26]=g,t[27]=_):_=t[27];let v=n.terminalSessions?.maxSessions??8,y;t[28]!==r||t[29]!==n?(y=e=>r({...n,terminalSessions:{idleMinutes:30,...n.terminalSessions,maxSessions:e}}),t[28]=r,t[29]=n,t[30]=y):y=t[30];let x;t[31]!==v||t[32]!==y?(x=(0,k.jsx)(M,{label:`Keep at most`,help:`Past this many live terminals, the longest-idle are closed first. Sessions in use are never closed. 0 = no limit.`,children:(0,k.jsx)(F,{label:`Maximum live sessions`,unit:`sessions`,value:v,onChange:y})}),t[31]=v,t[32]=y,t[33]=x):x=t[33];let S;t[34]!==_||t[35]!==x?(S=(0,k.jsxs)(I,{title:`Terminal sessions`,children:[_,x]}),t[34]=_,t[35]=x,t[36]=S):S=t[36];let C;t[37]!==r||t[38]!==n?(C=(0,k.jsx)(z,{settings:n,onChange:r}),t[37]=r,t[38]=n,t[39]=C):C=t[39];let w;return t[40]!==m||t[41]!==S||t[42]!==C||t[43]!==s?(w=(0,k.jsxs)(k.Fragment,{children:[s,m,S,C]}),t[40]=m,t[41]=S,t[42]=C,t[43]=s,t[44]=w):w=t[44],w}function z({settings:e,onChange:n}){let r=e.selfCompact??{enabled:!1,pollIntervalSeconds:30,rules:[]},[i,a]=(0,O.useState)(null),[o,s]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{t(`self_compact_statusline_installed`).then(a).catch(()=>a(null))},[]),(0,k.jsxs)(I,{title:`Context guard`,children:[(0,k.jsx)(P,{checked:r.enabled,onChange:t=>n({...e,selfCompact:{...r,enabled:t}}),label:`Auto self-compact`,help:`Watches each session’s context usage and queues a nudge when it crosses a threshold. Stale nudges are dropped once the model compacts.`}),r.enabled&&i===!1&&(0,k.jsx)(`div`,{className:`bd-set-error`,role:`alert`,children:`Auto self-compact is on but the Claude Code statusline isn’t installed, so no context usage is collected and nothing will trigger. Install it below.`}),(0,k.jsx)(M,{label:`Claude Code statusline`,help:i===null?`Checking installation…`:i?`Installed in ~/.claude/settings.json. Each turn snapshots context usage for the guard.`:`Not installed. Without it the guard has no usage data to act on.`,children:(0,k.jsx)(c,{size:`sm`,variant:i?`danger`:`default`,onClick:async()=>{s(!0);try{i?await t(`uninstall_self_compact_statusline`):await t(`install_self_compact_statusline`);let e=await t(`self_compact_statusline_installed`);a(e)}catch(e){y.setState({error:String(e)})}finally{s(!1)}},loading:o,disabled:o||i===null,children:i?`Uninstall`:`Install`})}),r.enabled&&r.rules.length>0&&(0,k.jsx)(`ul`,{className:`bd-set-rules`,"aria-label":`Configured thresholds`,children:r.rules.map(e=>(0,k.jsxs)(`li`,{children:[(0,k.jsxs)(`span`,{className:`bd-set-mono`,children:[(e.thresholdTokens/1e3).toFixed(0),`k tokens`]}),(0,k.jsx)(`span`,{children:e.action===`compactNow`?`Compact now`:`Queue a prompt`})]},e.id))})]})}function B(e){let t=(0,D.c)(48),{settings:n,onChange:r}=e,[i,l]=(0,O.useState)(``),[u,d]=(0,O.useState)(null),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],t[0]=p):p=t[0];let[h,_]=(0,O.useState)(p),v,y;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>{m().then(_).catch(()=>_([]))},y=[],t[1]=v,t[2]=y):(v=t[1],y=t[2]),(0,O.useEffect)(v,y);let b;t[3]===n.projects?b=t[4]:(b=new Set(n.projects.map(H)),t[3]=n.projects,t[4]=b);let x=b,S;if(t[5]!==x||t[6]!==h||t[7]!==u||t[8]!==r||t[9]!==n||t[10]!==i){let e;t[12]===x?e=t[13]:(e=e=>!x.has(e),t[12]=x,t[13]=e);let p=h.filter(e).slice(0,8),m;t[14]!==x||t[15]!==r||t[16]!==n?(m=(e,t)=>{let i=t===void 0||t;e&&!x.has(e)&&(r({...n,projects:[...n.projects,{path:e}]}),i&&d(e))},t[14]=x,t[15]=r,t[16]=n,t[17]=m):m=t[17];let _=m,v;t[18]===_?v=t[19]:(v=async()=>{let e=await f(`Select project folder`);e&&_(e,!1)},t[18]=_,t[19]=v);let y=v,b;t[20]!==_||t[21]!==i?(b=()=>{_(i.trim()),l(``)},t[20]=_,t[21]=i,t[22]=b):b=t[22];let C=b,w;t[23]!==r||t[24]!==n?(w=(e,t)=>{r({...n,projects:n.projects.map(n=>n.path===e?{...n,...t}:n)})},t[23]=r,t[24]=n,t[25]=w):w=t[25];let T=w,E;t[26]!==u||t[27]!==r||t[28]!==n?(E=e=>{r({...n,projects:n.projects.filter(t=>t.path!==e)}),u===e&&d(null)},t[26]=u,t[27]=r,t[28]=n,t[29]=E):E=t[29];let D=E,O=V,A;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,k.jsx)(o,{size:16,"aria-hidden":`true`}),t[30]=A):A=t[30];let j;t[31]===y?j=t[32]:(j=(0,k.jsxs)(c,{onClick:y,children:[A,`Browse…`]}),t[31]=y,t[32]=j);let M;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>l(e.target.value),t[33]=M):M=t[33];let P;t[34]===C?P=t[35]:(P=e=>{e.key===`Enter`&&C()},t[34]=C,t[35]=P);let F;t[36]!==P||t[37]!==i?(F=(0,k.jsx)(g,{value:i,onChange:M,onKeyDown:P,placeholder:`…or paste a path and press Enter`,"aria-label":`Project path`,spellCheck:!1,className:`bd-set-mono`}),t[36]=P,t[37]=i,t[38]=F):F=t[38];let L;t[39]!==j||t[40]!==F?(L=(0,k.jsxs)(`div`,{className:`bd-set-add`,children:[j,F]}),t[39]=j,t[40]=F,t[41]=L):L=t[41];let R;t[42]!==u||t[43]!==D||t[44]!==n.github||t[45]!==n.projects||t[46]!==T?(R=n.projects.length===0?(0,k.jsxs)(`div`,{className:`bd-set-empty`,children:[(0,k.jsx)(`strong`,{children:`No projects yet`}),(0,k.jsx)(`span`,{children:`Add the folders you run agents in. They appear in the project switcher.`})]}):(0,k.jsx)(`ul`,{className:`bd-set-list`,children:n.projects.map(e=>{let t=u===e.path,r=`bd-proj-${e.path.replace(/[^a-z0-9]/gi,`-`)}`;return(0,k.jsxs)(`li`,{className:`bd-set-item`,"data-open":t||void 0,children:[(0,k.jsxs)(`div`,{className:`bd-set-item-head`,children:[(0,k.jsxs)(`button`,{type:`button`,className:`bd-set-item-toggle`,"aria-expanded":t,"aria-controls":r,onClick:()=>d(t?null:e.path),children:[(0,k.jsx)(a,{className:`bd-set-chevron`,"aria-hidden":`true`}),(0,k.jsxs)(`span`,{className:`bd-set-item-text`,children:[(0,k.jsx)(`span`,{className:`bd-set-item-name`,children:O(e)}),(0,k.jsx)(`span`,{className:`bd-set-item-sub bd-set-mono`,title:e.path,children:e.path})]})]}),(0,k.jsx)(c,{variant:`ghost`,size:`sm`,icon:!0,className:`bd-set-remove`,"aria-label":`Remove ${O(e)}`,onClick:()=>D(e.path),children:(0,k.jsx)(s,{size:16,"aria-hidden":`true`})})]}),t&&(0,k.jsxs)(`div`,{className:`bd-set-item-body`,id:r,children:[(0,k.jsx)(N,{label:`Display name`,children:(0,k.jsx)(g,{value:e.name??``,onChange:t=>T(e.path,{name:t.target.value||void 0}),placeholder:e.path.split(/[/\\]/).pop()??e.path})}),(0,k.jsx)(N,{label:`Repo root`,help:`Set this when the project is a sub-folder of its git repo. Used for git remote, gh and worktrees.`,children:(0,k.jsx)(g,{value:e.repoRoot??``,onChange:t=>T(e.path,{repoRoot:t.target.value||void 0}),placeholder:e.path,spellCheck:!1,className:`bd-set-mono`})}),(0,k.jsx)(N,{label:`GitHub issue filter`,help:`Falls back to the filter in GitHub settings when empty.`,children:(0,k.jsx)(g,{value:e.githubFilter??``,onChange:t=>T(e.path,{githubFilter:t.target.value||void 0}),placeholder:n.github.defaultFilter||`assignee:@me is:open`})})]})]},e.path)})}),t[42]=u,t[43]=D,t[44]=n.github,t[45]=n.projects,t[46]=T,t[47]=R):R=t[47],S=(0,k.jsxs)(k.Fragment,{children:[L,R,p.length>0&&(0,k.jsx)(I,{title:`Found in your sessions`,children:(0,k.jsx)(`ul`,{className:`bd-set-suggest`,children:p.map(e=>(0,k.jsxs)(`li`,{children:[(0,k.jsx)(`span`,{className:`bd-set-mono`,title:e,children:e}),(0,k.jsx)(c,{size:`sm`,onClick:()=>_(e),children:`Add`})]},e))})})]}),t[5]=x,t[6]=h,t[7]=u,t[8]=r,t[9]=n,t[10]=i,t[11]=S}else S=t[11];return S}function V(e){return e.name??e.path.split(/[/\\]/).pop()??e.path}function H(e){return e.path}function U(e){let t=(0,D.c)(9),{settings:n,onChange:r}=e,i=n.notifications,a;t[0]!==i||t[1]!==r||t[2]!==n?(a=e=>r({...n,notifications:{...i,...e}}),t[0]=i,t[1]=r,t[2]=n,t[3]=a):a=t[3];let o=a,s;t[4]===o?s=t[5]:(s=e=>o({notificationsEnabled:e}),t[4]=o,t[5]=s);let c;return t[6]!==i.notificationsEnabled||t[7]!==s?(c=(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(I,{title:`On this computer`,children:(0,k.jsx)(P,{checked:i.notificationsEnabled,onChange:s,label:`System notifications`,help:`Notify when Claude finishes a turn and needs your input.`})})}),t[6]=i.notificationsEnabled,t[7]=s,t[8]=c):c=t[8],c}function W(e){let t=(0,D.c)(36),{settings:n,onChange:r}=e,i;t[0]===n.apiServices?i=t[1]:(i=n.apiServices??[],t[0]=n.apiServices,t[1]=i);let a=i,o;t[2]===n.defaultAPIServiceIds?o=t[3]:(o=n.defaultAPIServiceIds??{},t[2]=n.defaultAPIServiceIds,t[3]=o);let l=o,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`claude`],t[4]=d):d=t[4];let f=d,p;t[5]!==l||t[6]!==r||t[7]!==n?(p=(e,t)=>{r({...n,apiServices:e,defaultAPIServiceIds:t??l})},t[5]=l,t[6]=r,t[7]=n,t[8]=p):p=t[8];let m=p,h;t[9]!==a||t[10]!==m?(h=()=>{let e={id:`svc_${Date.now().toString(36)}`,name:`New service`,assistant:`claude`};m([...a,e])},t[9]=a,t[10]=m,t[11]=h):h=t[11];let _=h,v;t[12]!==a||t[13]!==m?(v=(e,t)=>{m(a.map((n,r)=>r===e?{...n,...t}:n))},t[12]=a,t[13]=m,t[14]=v):v=t[14];let y=v,x;t[15]!==l||t[16]!==a||t[17]!==m?(x=e=>{let t=a[e],n=a.filter((t,n)=>n!==e),r={...l};for(let e of Object.keys(r))r[e]===t.id&&delete r[e];m(n,r)},t[15]=l,t[16]=a,t[17]=m,t[18]=x):x=t[18];let S=x,C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,k.jsxs)(`p`,{className:`bd-set-note`,children:[`A service wraps the Claude Code CLI with a launcher prefix, a model override or a custom base URL, for example to route Claude through Ollama or a self-hosted proxy. API keys are stored as plaintext in`,` `,(0,k.jsx)(L,{children:`settings.json`}),` for now.`]}),t[19]=C):C=t[19];let w;t[20]!==l||t[21]!==a||t[22]!==m?(w=(0,k.jsx)(I,{title:`Default service`,children:f.map(e=>{let t=a.filter(t=>t.assistant===e);return(0,k.jsx)(M,{label:u[e]??e,help:`Used when a card has no override.`,children:(0,k.jsx)(b,{"aria-label":`Default service for ${u[e]??e}`,value:l[e]??``,onValueChange:t=>{let n={...l};t?n[e]=t:delete n[e],m(a,n)},options:[{value:``,label:`None (bare ${e} CLI)`},...t.map(G)]})},e)})}),t[20]=l,t[21]=a,t[22]=m,t[23]=w):w=t[23];let T;t[24]!==S||t[25]!==a||t[26]!==y?(T=a.length===0?(0,k.jsxs)(`div`,{className:`bd-set-empty`,children:[(0,k.jsx)(`strong`,{children:`No API services yet`}),(0,k.jsx)(`span`,{children:`Add one to point Claude Code at a different launcher, model or endpoint.`})]}):(0,k.jsx)(`ul`,{className:`bd-set-list`,children:a.map((e,t)=>(0,k.jsxs)(`li`,{className:`bd-set-item bd-set-service`,children:[(0,k.jsxs)(`div`,{className:`bd-set-service-top`,children:[(0,k.jsx)(g,{value:e.name,onChange:e=>y(t,{name:e.target.value}),placeholder:`Service name`,"aria-label":`Service name`}),(0,k.jsx)(c,{variant:`ghost`,size:`sm`,icon:!0,className:`bd-set-remove`,"aria-label":`Remove ${e.name||`service`}`,onClick:()=>S(t),children:(0,k.jsx)(s,{size:16,"aria-hidden":`true`})})]}),(0,k.jsxs)(`div`,{className:`bd-set-service-grid`,children:[(0,k.jsx)(g,{value:e.launcherPrefix??``,onChange:e=>y(t,{launcherPrefix:e.target.value||void 0}),placeholder:`Launcher prefix, e.g. ollama launch`,"aria-label":`Launcher prefix`,spellCheck:!1,className:`bd-set-mono`}),(0,k.jsx)(g,{value:e.modelFlag??``,onChange:e=>y(t,{modelFlag:e.target.value||void 0}),placeholder:`Model, e.g. qwen3-coder`,"aria-label":`Model`,spellCheck:!1,className:`bd-set-mono`})]}),(0,k.jsx)(g,{value:e.baseURL??``,onChange:e=>y(t,{baseURL:e.target.value||void 0}),placeholder:`Base URL, e.g. http://localhost:11434/v1`,"aria-label":`Base URL`,spellCheck:!1,className:`bd-set-mono`})]},e.id))}),t[24]=S,t[25]=a,t[26]=y,t[27]=T):T=t[27];let E;t[28]===_?E=t[29]:(E=(0,k.jsx)(`div`,{children:(0,k.jsx)(c,{size:`sm`,onClick:_,children:`Add service`})}),t[28]=_,t[29]=E);let O;t[30]!==T||t[31]!==E?(O=(0,k.jsxs)(I,{title:`Services`,children:[T,E]}),t[30]=T,t[31]=E,t[32]=O):O=t[32];let A;return t[33]!==O||t[34]!==w?(A=(0,k.jsxs)(k.Fragment,{children:[C,w,O]}),t[33]=O,t[34]=w,t[35]=A):A=t[35],A}function G(e){return{value:e.id,label:e.name}}export{j as default};
@@ -1 +0,0 @@
1
- import{d as e,m as t,t as n}from"./jsx-runtime-QmcfnBgR.js";import{t as r}from"./plus-XSPxArj5.js";import{o as i}from"./Surface-BQKeigoq.js";import{Q as a,R as o,T as s,X as c,_t as l,ct as u,g as d}from"./index-gWSenOqD.js";var f=t(e(),1),p=n(),m=e=>e.replace(/[/\\]+$/,``).split(/[/\\]/).pop()||e;function h(){let[e,t]=(0,f.useState)(``),[n,h]=(0,f.useState)(!1),[g,_]=(0,f.useState)([]);(0,f.useEffect)(()=>{c().then(e=>_(e.slice(0,6))).catch(()=>_([]))},[]);let v=async e=>{let t=e.trim();if(t&&!n){h(!0);try{let e=await a();e.projects.some(e=>e.path===t)||await u({...e,projects:[...e.projects,{path:t}]}),s({title:`Added ${m(t)}`,tone:`success`})}catch(e){s({title:`Could not add project: ${String(e)}`,tone:`danger`,duration:6e3})}finally{h(!1)}}};return(0,p.jsx)(`div`,{className:`bd-setup`,children:(0,p.jsxs)(`div`,{className:`bd-setup-panel`,children:[(0,p.jsx)(`h1`,{children:`Add a project to get started`}),(0,p.jsx)(`p`,{className:`bd-setup-lead`,children:`DevBoard only shows work from folders you choose. Add a project and its Claude sessions, branches and pull requests land on the board.`}),(0,p.jsxs)(i,{variant:`solid`,size:`lg`,onClick:async()=>{let e=await o(`Select project folder`);e&&await v(e)},disabled:n,"data-autofocus":!0,children:[(0,p.jsx)(l,{size:18,"aria-hidden":`true`}),`Choose project folder`]}),(0,p.jsxs)(`form`,{className:`bd-setup-path`,onSubmit:n=>{n.preventDefault(),v(e).then(()=>t(``))},children:[(0,p.jsx)(d,{value:e,onChange:e=>t(e.target.value),placeholder:`Or paste a folder path`,"aria-label":`Project folder path`,spellCheck:!1}),(0,p.jsxs)(i,{type:`submit`,disabled:!e.trim()||n,children:[(0,p.jsx)(r,{size:16,"aria-hidden":`true`}),`Add`]})]}),g.length>0&&(0,p.jsxs)(`section`,{className:`bd-setup-found`,"aria-labelledby":`bd-setup-found-h`,children:[(0,p.jsx)(`h2`,{id:`bd-setup-found-h`,children:`Found in your Claude sessions`}),(0,p.jsx)(`ul`,{children:g.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsxs)(`span`,{className:`bd-setup-found-text`,children:[(0,p.jsx)(`b`,{children:m(e)}),(0,p.jsx)(`span`,{title:e,children:e})]}),(0,p.jsx)(i,{size:`sm`,onClick:()=>v(e),disabled:n,"aria-label":`Add ${m(e)}`,children:`Add`})]},e))})]})]})})}export{h as default};