@shepai/cli 1.86.1 → 1.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/presentation/web/app/actions/get-feature-plan.d.ts +10 -0
- package/dist/src/presentation/web/app/actions/get-feature-plan.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/get-feature-plan.js +8 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/plan-tab.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/plan-tab.js +3 -20
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/plan-tab.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/plan-tab.stories.js +74 -0
- package/dist/src/presentation/web/components/common/task-progress-view/index.d.ts +3 -0
- package/dist/src/presentation/web/components/common/task-progress-view/index.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/task-progress-view/index.js +1 -0
- package/dist/src/presentation/web/components/common/task-progress-view/task-progress-view.d.ts +6 -0
- package/dist/src/presentation/web/components/common/task-progress-view/task-progress-view.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/task-progress-view/task-progress-view.js +84 -0
- package/dist/src/presentation/web/components/common/task-progress-view/task-progress-view.stories.d.ts +16 -0
- package/dist/src/presentation/web/components/common/task-progress-view/task-progress-view.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/task-progress-view/task-progress-view.stories.js +194 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +1 -1
- package/web/.next/required-server-files.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +21 -21
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +14 -14
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +21 -21
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +14 -14
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +14 -14
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_da7eef33.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_da7eef33.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_0a9251aa.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_0a9251aa.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__17143953._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__17143953._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4be9a9bb._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9de266fa._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9de266fa._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b3a4cef4._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b3a4cef4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f0d8d054._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_752e01fd._.js +1 -1
- package/web/.next/server/chunks/ssr/_752e01fd._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_61480424._.js → _b29b7044._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_61480424._.js.map → _b29b7044._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_021a05f2.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_021a05f2.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_c4348b8a._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_c4348b8a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_e4510d10._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_e4510d10._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +28 -28
- package/web/.next/static/chunks/{866566643c6aaecf.js → 07c448f82a47be9b.js} +1 -1
- package/web/.next/static/chunks/13b44f31bc42c75f.js +1 -0
- package/web/.next/static/chunks/{f46a0078f2ee9c44.js → 291ca11b0444a406.js} +1 -1
- package/web/.next/static/chunks/{dd6cd59c8f439583.js → 370ff313c8ecbf40.js} +1 -1
- package/web/.next/static/chunks/3e8082bdb91101cd.js +1 -0
- package/web/.next/static/chunks/{dd6c69087923da49.js → 4e793015b0080efb.js} +2 -2
- package/web/.next/static/chunks/{9d59d178a1e154b2.js → 553ebb57e23539a0.js} +1 -1
- package/web/.next/static/chunks/{0b3852464455cb56.js → 6297253706a181d9.js} +1 -1
- package/web/.next/static/chunks/91d63f8e429f5900.css +2 -0
- package/web/.next/static/chunks/a4c011f21bb06fe3.js +1 -0
- package/web/.next/static/chunks/{c7a4303d3cf08477.js → a7b53fdf8b1142dd.js} +1 -1
- package/web/.next/static/chunks/177579b39fd0f63a.js +0 -1
- package/web/.next/static/chunks/50f89c3112f6dd23.css +0 -2
- package/web/.next/static/chunks/8d82ff1402dcf377.js +0 -1
- package/web/.next/static/chunks/e1edce9ef55b5824.js +0 -1
- /package/web/.next/static/{T8HBuz_VR2eZQbNRNSohp → 8io5aUA9fyFtLguGngwMV}/_buildManifest.js +0 -0
- /package/web/.next/static/{T8HBuz_VR2eZQbNRNSohp → 8io5aUA9fyFtLguGngwMV}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{T8HBuz_VR2eZQbNRNSohp → 8io5aUA9fyFtLguGngwMV}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(20314),n=e.i(79054),a=e.i(87889),o=e.i(3645);let l=(0,o.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var r=e.i(23925);let i=(0,o.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var s=e.i(38573),d=e.i(49228);let c=(0,o.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),u=(0,o.default)("bell",[["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"}]]),p=(0,o.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),h=(0,o.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var m=e.i(61569),m=m,f=e.i(3214),g=e.i(30702);let x=(0,o.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var v=e.i(60112),w=e.i(31777),b=e.i(41957),y=e.i(98127),j=e.i(35364),k=e.i(51911),C=e.i(2828),S=e.i(26036),N=e.i(27069),I=e.i(91967),P=e.i(87342),M=e.i(5978),E=e.i(22528),T=e.i(66033),A=e.i(53532),R=e.i(41687),D=e.i(56720),L=e.i(13123),F=e.i(52740),H=e.i(39979),B=e.i(87620),V=e.i(86874),_=e.i(29297),O=e.i(36589),W=e.i(5192),z=e.i(23405),U=e.i(1693),K=e.i(73772),G=e.i(13044),q=[" ","Enter","ArrowUp","ArrowDown"],Y=[" ","Enter"],Z="Select",[Q,X,$]=(0,P.createCollection)(Z),[J,ee]=(0,E.createContextScope)(Z,[$,F.createPopperScope]),et=(0,F.createPopperScope)(),[en,ea]=J(Z),[eo,el]=J(Z),er=e=>{let{__scopeSelect:a,children:o,open:l,defaultOpen:r,onOpenChange:i,value:s,defaultValue:d,onValueChange:c,dir:u,name:p,autoComplete:h,disabled:m,required:f,form:g}=e,x=et(a),[v,w]=n.useState(null),[b,y]=n.useState(null),[j,k]=n.useState(!1),C=(0,T.useDirection)(u),[S,N]=(0,O.useControllableState)({prop:l,defaultProp:r??!1,onChange:i,caller:Z}),[I,P]=(0,O.useControllableState)({prop:s,defaultProp:d,onChange:c,caller:Z}),M=n.useRef(null),E=!v||g||!!v.closest("form"),[A,R]=n.useState(new Set),D=Array.from(A).map(e=>e.props.value).join(";");return(0,t.jsx)(F.Root,{...x,children:(0,t.jsxs)(en,{required:f,scope:a,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:k,contentId:(0,L.useId)(),value:I,onValueChange:P,open:S,onOpenChange:N,dir:C,triggerPointerDownPosRef:M,disabled:m,children:[(0,t.jsx)(Q.Provider,{scope:a,children:(0,t.jsx)(eo,{scope:e.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{R(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{R(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:o})}),E?(0,t.jsxs)(eq,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:h,value:I,onChange:e=>P(e.target.value),disabled:m,form:g,children:[void 0===I?(0,t.jsx)("option",{value:""}):null,Array.from(A)]},D):null]})})};er.displayName=Z;var ei="SelectTrigger",es=n.forwardRef((e,a)=>{let{__scopeSelect:o,disabled:l=!1,...r}=e,i=et(o),s=ea(ei,o),d=s.disabled||l,c=(0,M.useComposedRefs)(a,s.onTriggerChange),u=X(o),p=n.useRef("touch"),[h,m,f]=eZ(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),a=eQ(t,e,n);void 0!==a&&s.onValueChange(a.value)}),g=e=>{d||(s.onOpenChange(!0),f()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(F.Anchor,{asChild:!0,...i,children:(0,t.jsx)(B.Primitive.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":eY(s.value)?"":void 0,...r,ref:c,onClick:(0,I.composeEventHandlers)(r.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:(0,I.composeEventHandlers)(r.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:(0,I.composeEventHandlers)(r.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&q.includes(e.key)&&(g(),e.preventDefault())})})})});es.displayName=ei;var ed="SelectValue",ec=n.forwardRef((e,n)=>{let{__scopeSelect:a,className:o,style:l,children:r,placeholder:i="",...s}=e,d=ea(ed,a),{onValueNodeHasChildrenChange:c}=d,u=void 0!==r,p=(0,M.useComposedRefs)(n,d.onValueNodeChange);return(0,W.useLayoutEffect)(()=>{c(u)},[c,u]),(0,t.jsx)(B.Primitive.span,{...s,ref:p,style:{pointerEvents:"none"},children:eY(d.value)?(0,t.jsx)(t.Fragment,{children:i}):r})});ec.displayName=ed;var eu=n.forwardRef((e,n)=>{let{__scopeSelect:a,children:o,...l}=e;return(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...l,ref:n,children:o||"▼"})});eu.displayName="SelectIcon";var ep=e=>(0,t.jsx)(H.Portal,{asChild:!0,...e});ep.displayName="SelectPortal";var eh="SelectContent",em=n.forwardRef((e,a)=>{let o=ea(eh,e.__scopeSelect),[l,r]=n.useState();return((0,W.useLayoutEffect)(()=>{r(new DocumentFragment)},[]),o.open)?(0,t.jsx)(ev,{...e,ref:a}):l?S.createPortal((0,t.jsx)(ef,{scope:e.__scopeSelect,children:(0,t.jsx)(Q.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),l):null});em.displayName=eh;var[ef,eg]=J(eh),ex=(0,V.createSlot)("SelectContent.RemoveScroll"),ev=n.forwardRef((e,a)=>{let{__scopeSelect:o,position:l="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v,...w}=e,b=ea(eh,o),[y,j]=n.useState(null),[k,C]=n.useState(null),S=(0,M.useComposedRefs)(a,e=>j(e)),[N,P]=n.useState(null),[E,T]=n.useState(null),L=X(o),[F,H]=n.useState(!1),B=n.useRef(!1);n.useEffect(()=>{if(y)return(0,K.hideOthers)(y)},[y]),(0,R.useFocusGuards)();let V=n.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[a]=n.slice(-1),o=document.activeElement;for(let n of e)if(n===o||(n?.scrollIntoView({block:"nearest"}),n===t&&k&&(k.scrollTop=0),n===a&&k&&(k.scrollTop=k.scrollHeight),n?.focus(),document.activeElement!==o))return},[L,k]),_=n.useCallback(()=>V([N,y]),[V,N,y]);n.useEffect(()=>{F&&_()},[F,_]);let{onOpenChange:O,triggerPointerDownPosRef:W}=b;n.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||O(!1),document.removeEventListener("pointermove",t),W.current=null};return null!==W.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[y,O,W]),n.useEffect(()=>{let e=()=>O(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[O]);let[z,U]=eZ(e=>{let t=L().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),a=eQ(t,e,n);a&&setTimeout(()=>a.ref.current.focus())}),q=n.useCallback((e,t,n)=>{let a=!B.current&&!n;(void 0!==b.value&&b.value===t||a)&&(P(e),a&&(B.current=!0))},[b.value]),Y=n.useCallback(()=>y?.focus(),[y]),Z=n.useCallback((e,t,n)=>{let a=!B.current&&!n;(void 0!==b.value&&b.value===t||a)&&T(e)},[b.value]),Q="popper"===l?eb:ew,$=Q===eb?{side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v}:{};return(0,t.jsx)(ef,{scope:o,content:y,viewport:k,onViewportChange:C,itemRefCallback:q,selectedItem:N,onItemLeave:Y,itemTextRefCallback:Z,focusSelectedItem:_,selectedItemText:E,position:l,isPositioned:F,searchRef:z,children:(0,t.jsx)(G.RemoveScroll,{as:ex,allowPinchZoom:!0,children:(0,t.jsx)(D.FocusScope,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,I.composeEventHandlers)(r,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(A.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,t.jsx)(Q,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...w,...$,onPlaced:()=>H(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:(0,I.composeEventHandlers)(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,a=t.indexOf(n);t=t.slice(a+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});ev.displayName="SelectContentImpl";var ew=n.forwardRef((e,a)=>{let{__scopeSelect:o,onPlaced:l,...r}=e,i=ea(eh,o),s=eg(eh,o),[d,c]=n.useState(null),[u,p]=n.useState(null),h=(0,M.useComposedRefs)(a,e=>p(e)),m=X(o),f=n.useRef(!1),g=n.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=s,y=n.useCallback(()=>{if(i.trigger&&i.valueNode&&d&&u&&x&&v&&w){let e=i.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=i.valueNode.getBoundingClientRect(),a=w.getBoundingClientRect();if("rtl"!==i.dir){let o=a.left-t.left,l=n.left-o,r=e.left-l,i=e.width+r,s=Math.max(i,t.width),c=window.innerWidth-10,u=(0,N.clamp)(l,[10,Math.max(10,c-s)]);d.style.minWidth=i+"px",d.style.left=u+"px"}else{let o=t.right-a.right,l=window.innerWidth-n.right-o,r=window.innerWidth-e.right-l,i=e.width+r,s=Math.max(i,t.width),c=window.innerWidth-10,u=(0,N.clamp)(l,[10,Math.max(10,c-s)]);d.style.minWidth=i+"px",d.style.right=u+"px"}let o=m(),r=window.innerHeight-20,s=x.scrollHeight,c=window.getComputedStyle(u),p=parseInt(c.borderTopWidth,10),h=parseInt(c.paddingTop,10),g=parseInt(c.borderBottomWidth,10),b=p+h+s+parseInt(c.paddingBottom,10)+g,y=Math.min(5*v.offsetHeight,b),j=window.getComputedStyle(x),k=parseInt(j.paddingTop,10),C=parseInt(j.paddingBottom,10),S=e.top+e.height/2-10,I=v.offsetHeight/2,P=p+h+(v.offsetTop+I);if(P<=S){let e=o.length>0&&v===o[o.length-1].ref.current;d.style.bottom="0px";let t=Math.max(r-S,I+(e?C:0)+(u.clientHeight-x.offsetTop-x.offsetHeight)+g);d.style.height=P+t+"px"}else{let e=o.length>0&&v===o[0].ref.current;d.style.top="0px";let t=Math.max(S,p+x.offsetTop+(e?k:0)+I);d.style.height=t+(b-P)+"px",x.scrollTop=P-S+x.offsetTop}d.style.margin="10px 0",d.style.minHeight=y+"px",d.style.maxHeight=r+"px",l?.(),requestAnimationFrame(()=>f.current=!0)}},[m,i.trigger,i.valueNode,d,u,x,v,w,i.dir,l]);(0,W.useLayoutEffect)(()=>y(),[y]);let[j,k]=n.useState();(0,W.useLayoutEffect)(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);let C=n.useCallback(e=>{e&&!0===g.current&&(y(),b?.(),g.current=!1)},[y,b]);return(0,t.jsx)(ey,{scope:o,contentWrapper:d,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:(0,t.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:(0,t.jsx)(B.Primitive.div,{...r,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ew.displayName="SelectItemAlignedPosition";var eb=n.forwardRef((e,n)=>{let{__scopeSelect:a,align:o="start",collisionPadding:l=10,...r}=e,i=et(a);return(0,t.jsx)(F.Content,{...i,...r,ref:n,align:o,collisionPadding:l,style:{boxSizing:"border-box",...r.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});eb.displayName="SelectPopperPosition";var[ey,ej]=J(eh,{}),ek="SelectViewport",eC=n.forwardRef((e,a)=>{let{__scopeSelect:o,nonce:l,...r}=e,i=eg(ek,o),s=ej(ek,o),d=(0,M.useComposedRefs)(a,i.onViewportChange),c=n.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),(0,t.jsx)(Q.Slot,{scope:o,children:(0,t.jsx)(B.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:(0,I.composeEventHandlers)(r.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:a}=s;if(a?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let a=window.innerHeight-20,o=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(o<a){let l=o+e,r=Math.min(a,l),i=l-r;n.style.height=r+"px","0px"===n.style.bottom&&(t.scrollTop=i>0?i:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});eC.displayName=ek;var eS="SelectGroup",[eN,eI]=J(eS),eP=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e,l=(0,L.useId)();return(0,t.jsx)(eN,{scope:a,id:l,children:(0,t.jsx)(B.Primitive.div,{role:"group","aria-labelledby":l,...o,ref:n})})});eP.displayName=eS;var eM="SelectLabel",eE=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e,l=eI(eM,a);return(0,t.jsx)(B.Primitive.div,{id:l.id,...o,ref:n})});eE.displayName=eM;var eT="SelectItem",[eA,eR]=J(eT),eD=n.forwardRef((e,a)=>{let{__scopeSelect:o,value:l,disabled:r=!1,textValue:i,...s}=e,d=ea(eT,o),c=eg(eT,o),u=d.value===l,[p,h]=n.useState(i??""),[m,f]=n.useState(!1),g=(0,M.useComposedRefs)(a,e=>c.itemRefCallback?.(e,l,r)),x=(0,L.useId)(),v=n.useRef("touch"),w=()=>{r||(d.onValueChange(l),d.onOpenChange(!1))};if(""===l)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(eA,{scope:o,value:l,disabled:r,textId:x,isSelected:u,onItemTextChange:n.useCallback(e=>{h(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(Q.ItemSlot,{scope:o,value:l,disabled:r,textValue:p,children:(0,t.jsx)(B.Primitive.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:g,onFocus:(0,I.composeEventHandlers)(s.onFocus,()=>f(!0)),onBlur:(0,I.composeEventHandlers)(s.onBlur,()=>f(!1)),onClick:(0,I.composeEventHandlers)(s.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:(0,I.composeEventHandlers)(s.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:(0,I.composeEventHandlers)(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:(0,I.composeEventHandlers)(s.onPointerMove,e=>{v.current=e.pointerType,r?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,I.composeEventHandlers)(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:(0,I.composeEventHandlers)(s.onKeyDown,e=>{(c.searchRef?.current===""||" "!==e.key)&&(Y.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});eD.displayName=eT;var eL="SelectItemText",eF=n.forwardRef((e,a)=>{let{__scopeSelect:o,className:l,style:r,...i}=e,s=ea(eL,o),d=eg(eL,o),c=eR(eL,o),u=el(eL,o),[p,h]=n.useState(null),m=(0,M.useComposedRefs)(a,e=>h(e),c.onItemTextChange,e=>d.itemTextRefCallback?.(e,c.value,c.disabled)),f=p?.textContent,g=n.useMemo(()=>(0,t.jsx)("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return(0,W.useLayoutEffect)(()=>(x(g),()=>v(g)),[x,v,g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Primitive.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?S.createPortal(i.children,s.valueNode):null]})});eF.displayName=eL;var eH="SelectItemIndicator",eB=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e;return eR(eH,a).isSelected?(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...o,ref:n}):null});eB.displayName=eH;var eV="SelectScrollUpButton",e_=n.forwardRef((e,a)=>{let o=eg(eV,e.__scopeSelect),l=ej(eV,e.__scopeSelect),[r,i]=n.useState(!1),s=(0,M.useComposedRefs)(a,l.onScrollButtonChange);return(0,W.useLayoutEffect)(()=>{if(o.viewport&&o.isPositioned){let e=function(){i(t.scrollTop>0)},t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),r?(0,t.jsx)(ez,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});e_.displayName=eV;var eO="SelectScrollDownButton",eW=n.forwardRef((e,a)=>{let o=eg(eO,e.__scopeSelect),l=ej(eO,e.__scopeSelect),[r,i]=n.useState(!1),s=(0,M.useComposedRefs)(a,l.onScrollButtonChange);return(0,W.useLayoutEffect)(()=>{if(o.viewport&&o.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;i(Math.ceil(t.scrollTop)<e)},t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),r?(0,t.jsx)(ez,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});eW.displayName=eO;var ez=n.forwardRef((e,a)=>{let{__scopeSelect:o,onAutoScroll:l,...r}=e,i=eg("SelectScrollButton",o),s=n.useRef(null),d=X(o),c=n.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),(0,W.useLayoutEffect)(()=>{let e=d().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[d]),(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...r,ref:a,style:{flexShrink:0,...r.style},onPointerDown:(0,I.composeEventHandlers)(r.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(l,50))}),onPointerMove:(0,I.composeEventHandlers)(r.onPointerMove,()=>{i.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(l,50))}),onPointerLeave:(0,I.composeEventHandlers)(r.onPointerLeave,()=>{c()})})}),eU=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e;return(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...o,ref:n})});eU.displayName="SelectSeparator";var eK="SelectArrow",eG=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e,l=et(a),r=ea(eK,a),i=eg(eK,a);return r.open&&"popper"===i.position?(0,t.jsx)(F.Arrow,{...l,...o,ref:n}):null});eG.displayName=eK;var eq=n.forwardRef(({__scopeSelect:e,value:a,...o},l)=>{let r=n.useRef(null),i=(0,M.useComposedRefs)(l,r),s=(0,z.usePrevious)(a);return n.useEffect(()=>{let e=r.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(s!==a&&t){let n=new Event("change",{bubbles:!0});t.call(e,a),e.dispatchEvent(n)}},[s,a]),(0,t.jsx)(B.Primitive.select,{...o,style:{...U.VISUALLY_HIDDEN_STYLES,...o.style},ref:i,defaultValue:a})});function eY(e){return""===e||void 0===e}function eZ(e){let t=(0,_.useCallbackRef)(e),a=n.useRef(""),o=n.useRef(0),l=n.useCallback(e=>{let n=a.current+e;t(n),function e(t){a.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),r=n.useCallback(()=>{a.current="",window.clearTimeout(o.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(o.current),[]),[a,l,r]}function eQ(e,t,n){var a,o;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1,i=(a=e,o=Math.max(r,0),a.map((e,t)=>a[(o+t)%a.length]));1===l.length&&(i=i.filter(e=>e!==n));let s=i.find(e=>e.textValue.toLowerCase().startsWith(l.toLowerCase()));return s!==n?s:void 0}eq.displayName="SelectBubbleInput",e.s(["Arrow",()=>eG,"Content",()=>em,"Group",()=>eP,"Icon",()=>eu,"Item",()=>eD,"ItemIndicator",()=>eB,"ItemText",()=>eF,"Label",()=>eE,"Portal",()=>ep,"Root",()=>er,"ScrollDownButton",()=>eW,"ScrollUpButton",()=>e_,"Select",()=>er,"SelectArrow",()=>eG,"SelectContent",()=>em,"SelectGroup",()=>eP,"SelectIcon",()=>eu,"SelectItem",()=>eD,"SelectItemIndicator",()=>eB,"SelectItemText",()=>eF,"SelectLabel",()=>eE,"SelectPortal",()=>ep,"SelectScrollDownButton",()=>eW,"SelectScrollUpButton",()=>e_,"SelectSeparator",()=>eU,"SelectTrigger",()=>es,"SelectValue",()=>ec,"SelectViewport",()=>eC,"Separator",()=>eU,"Trigger",()=>es,"Value",()=>ec,"Viewport",()=>eC,"createSelectScope",()=>ee],83830);var eX=e.i(83830),eX=eX,e$=e.i(99105);let eJ=(0,o.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),e0=eX.Root;eX.Group;let e1=eX.Value,e2=n.forwardRef(({className:e,children:n,...a},o)=>(0,t.jsxs)(eX.Trigger,{ref:o,className:(0,w.cn)("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...a,children:[n,(0,t.jsx)(eX.Icon,{asChild:!0,children:(0,t.jsx)(e$.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));e2.displayName=eX.Trigger.displayName;let e4=n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.ScrollUpButton,{ref:a,className:(0,w.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(eJ,{className:"h-4 w-4"})}));e4.displayName=eX.ScrollUpButton.displayName;let e3=n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.ScrollDownButton,{ref:a,className:(0,w.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(e$.ChevronDown,{className:"h-4 w-4"})}));e3.displayName=eX.ScrollDownButton.displayName;let e5=n.forwardRef(({className:e,children:n,position:a="popper",...o},l)=>(0,t.jsx)(eX.Portal,{children:(0,t.jsxs)(eX.Content,{ref:l,className:(0,w.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...o,children:[(0,t.jsx)(e4,{}),(0,t.jsx)(eX.Viewport,{className:(0,w.cn)("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),(0,t.jsx)(e3,{})]})}));e5.displayName=eX.Content.displayName,n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.Label,{ref:a,className:(0,w.cn)("px-2 py-1.5 text-sm font-semibold",e),...n})).displayName=eX.Label.displayName;let e8=n.forwardRef(({className:e,children:n,...a},o)=>(0,t.jsxs)(eX.Item,{ref:o,className:(0,w.cn)("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,t.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eX.ItemIndicator,{children:(0,t.jsx)(r.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eX.ItemText,{children:n})]}));e8.displayName=eX.Item.displayName,n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.Separator,{ref:a,className:(0,w.cn)("bg-muted -mx-1 my-1 h-px",e),...n})).displayName=eX.Separator.displayName;var e6=e.i(21023);let e9=(0,e6.createServerReference)("40c184002faee44db8cd788e54ce974c1ae204dd14",e6.callServer,void 0,e6.findSourceMapURL,"updateSettingsAction");var e7=e.i(17406),te=e.i(98804),tt=e.i(93752),tt=tt,tn=e.i(83902);function ta(e){return(0,t.jsx)(tt.default,{className:(0,w.cn)("h-4 w-4",e.className),...e})}function to({className:e}){return(0,t.jsx)(te.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function tl({className:e}){return(0,t.jsx)(te.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function tr({className:e}){return(0,t.jsx)(te.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function ti({className:e}){return(0,t.jsx)(te.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function ts({className:e,...n}){return(0,t.jsx)(tn.Rocket,{className:(0,w.cn)("h-4 w-4",e),...n})}to.displayName="VsCodeIcon",tl.displayName="CursorEditorIcon",tr.displayName="WindsurfIcon",ti.displayName="ZedIcon",ts.displayName="AntigravityIcon";let td={vscode:to,cursor:tl,windsurf:tr,zed:ti,antigravity:ts};var tc=e.i(41413);let tu=[{value:e7.AgentAuthMethod.Session,label:"Session"},{value:e7.AgentAuthMethod.Token,label:"Token"}],tp=[{value:e7.EditorType.VsCode,label:"VS Code"},{value:e7.EditorType.Cursor,label:"Cursor"},{value:e7.EditorType.Windsurf,label:"Windsurf"},{value:e7.EditorType.Zed,label:"Zed"},{value:e7.EditorType.Antigravity,label:"Antigravity"}],th=[{id:"agent",label:"Agent",icon:i},{id:"environment",label:"Environment",icon:s.Terminal},{id:"workflow",label:"Workflow",icon:d.GitBranch},{id:"ci",label:"CI",icon:c},{id:"notifications",label:"Notifications",icon:u},{id:"feature-flags",label:"Flags",icon:p},{id:"database",label:"Database",icon:h}];function tm({label:e,description:n,htmlFor:a,children:o}){return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(b.Label,{htmlFor:a,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),n?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:n}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:o})]})}function tf({label:e,description:n,id:a,testId:o,checked:l,onChange:r}){return(0,t.jsx)(tm,{label:e,description:n,htmlFor:a,children:(0,t.jsx)(k.Switch,{id:a,"data-testid":o,checked:l,onCheckedChange:r,className:"cursor-pointer"})})}function tg({icon:e,title:n,description:a,badge:o,testId:l,children:r}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":l,children:[(0,t.jsxs)("div",{className:"bg-muted/30 border-b px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("h2",{className:"text-sm font-semibold",children:n}),o?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase",children:o}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:a})]}),(0,t.jsx)("div",{className:"px-4",children:r})]})}function tx({id:e,testId:n,value:a,onChange:o,onBlur:l,placeholder:r,min:i=1,max:s,step:d=1,suffix:c}){let u=""===a?void 0:parseInt(a,10);return(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center overflow-hidden rounded-md border",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{o(String(Math.max(i,(u??parseInt(r,10))-d)))},onMouseUp:l,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors","aria-label":"Decrease",children:(0,t.jsx)(m.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":n,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:a,placeholder:r,onChange:e=>{o(e.target.value.replace(/[^0-9]/g,""))},onBlur:l,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=u??parseInt(r,10),o(String(null!=s?Math.min(s,e+d):e+d))},onMouseUp:l,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors","aria-label":"Increase",children:(0,t.jsx)(f.Plus,{className:"h-3 w-3"})})]}),c?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:c}):null]})}function tv({children:e}){return(0,t.jsx)("div",{className:"border-b pt-3 pb-1",children:(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase",children:e})})}function tw({children:e,links:n}){return(0,t.jsxs)("div",{className:"hidden pt-2 lg:block",children:[(0,t.jsx)("p",{className:"text-muted-foreground/70 text-[11px] leading-relaxed",children:e}),null!=n&&n.length>0?(0,t.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:n.map(e=>(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-[10px] transition-colors",children:[(0,t.jsx)(g.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function tb({settings:e,shepHome:o,dbFileSize:m}){let{showSaving:f,showSaved:g,save:b}=function(){let[e,t]=(0,n.useTransition)(),[a,o]=(0,n.useState)(!1),[l,r]=(0,n.useState)(!1),i=(0,n.useRef)(null),s=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{e&&!a&&(o(!0),s.current=!1,i.current=setTimeout(()=>{i.current=null,s.current&&(o(!1),r(!0),setTimeout(()=>r(!1),2e3))},350)),!e&&a&&(s.current=!0,i.current||(o(!1),r(!0),setTimeout(()=>r(!1),2e3)))},[e,a]),{showSaving:a,showSaved:l,save:(0,n.useCallback)(e=>{t(async()=>{let t=await e9(e);t.success||v.toast.error(t.error??"Failed to save settings")})},[t])}}(),k=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1},[S,N]=(0,n.useState)(e.agent.type),I=e.agent.authMethod,[P,M]=(0,n.useState)(e.agent.token??""),[E,T]=(0,n.useState)(!1),[A,R]=(0,n.useState)(e.environment.defaultEditor),D=e.environment.shellPreference,[L,F]=(0,n.useState)(e.workflow.openPrOnImplementationComplete),[H,B]=(0,n.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[V,_]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPrd),[O,W]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPlan),[z,U]=(0,n.useState)(e.workflow.approvalGateDefaults.allowMerge),[K,G]=(0,n.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[q,Y]=(0,n.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[Z,Q]=(0,n.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[X,$]=(0,n.useState)(e.notifications.inApp.enabled),[J,ee]=(0,n.useState)(e.notifications.browser.enabled),[et,en]=(0,n.useState)(e.notifications.desktop.enabled),[ea,eo]=(0,n.useState)({...e.notifications.events}),[el,er]=(0,n.useState)({...k}),ei=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",es=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",ed=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"";function ec(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function eu(e={}){let t=ec(e.ciTimeout??q);return{workflow:{openPrOnImplementationComplete:e.openPr??L,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??H,allowPrd:e.allowPrd??V,allowPlan:e.allowPlan??O,allowMerge:e.allowMerge??z},ciMaxFixAttempts:ec(e.ciMaxFix??K),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:ec(e.ciLogMax??Z)}}}function ep(e={}){return{notifications:{inApp:{enabled:e.inApp??X},browser:{enabled:e.browser??J},desktop:{enabled:e.desktop??et},events:e.events??ea}}}let[eh,em]=(0,n.useState)("agent");(0,n.useEffect)(()=>{let e=th.map(e=>document.getElementById(`section-${e.id}`)).filter(Boolean);if(0===e.length)return;let t=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&em(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let n of e)t.observe(n);return()=>t.disconnect()},[]);let ef=(0,n.useCallback)(e=>{let t=document.getElementById(`section-${e}`);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),t.style.animation="none",t.offsetHeight,t.style.animation="section-flash 1s ease-out")},[]);return(0,t.jsxs)("div",{"data-testid":"settings-page-client",className:"max-w-5xl",children:[(0,t.jsx)("div",{className:"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 grid grid-cols-1 gap-x-5 pt-6 pb-4 backdrop-blur lg:grid-cols-[1fr_280px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Settings"}),(0,t.jsxs)("span",{className:"relative h-4 w-16",children:[(0,t.jsx)("span",{className:(0,w.cn)("text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300",f?"opacity-100":"opacity-0"),children:"Saving..."}),(0,t.jsxs)("span",{className:(0,w.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",g&&!f?"opacity-100":"opacity-0"),children:[(0,t.jsx)(r.Check,{className:"h-3 w-3"}),"Saved"]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:th.map(e=>{let n=e.icon,a=eh===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>ef(e.id),className:(0,w.cn)("flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all",a?"bg-accent text-foreground font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(n,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:e.label})]},e.id)})})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{id:"section-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:i,title:"Agent",description:"AI coding agent and authentication",testId:"agent-settings-section",children:[(0,t.jsx)(tm,{label:"Agent & Model",description:"Provider and model for all operations",htmlFor:"agent-model-picker",children:(0,t.jsx)(tc.AgentModelPicker,{initialAgentType:S,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>N(e),className:"w-55"})}),(0,t.jsx)(tm,{label:"Authentication",description:"How the agent authenticates",htmlFor:"auth-method",children:(0,t.jsx)(C.TooltipProvider,{children:(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsxs)(e0,{value:I,disabled:!0,children:[(0,t.jsx)(e2,{id:"auth-method","data-testid":"auth-method-select",className:"w-55 cursor-not-allowed text-xs opacity-60",children:(0,t.jsx)(e1,{})}),(0,t.jsx)(e5,{children:tu.map(e=>(0,t.jsx)(e8,{value:e.value,children:e.label},e.value))})]})})}),(0,t.jsx)(C.TooltipContent,{children:"Coming soon"})]})})}),I===e7.AgentAuthMethod.Token&&(0,t.jsx)(tm,{label:"API Token",htmlFor:"agent-token",children:(0,t.jsxs)("div",{className:"relative w-45",children:[(0,t.jsx)(y.Input,{id:"agent-token","data-testid":"agent-token-input",type:E?"text":"password",value:P,onChange:e=>M(e.target.value),onBlur:()=>{P!==(e.agent.token??"")&&b(function(e={}){let t={type:S,authMethod:I,...e},n={type:t.type,authMethod:t.authMethod};return t.authMethod===e7.AgentAuthMethod.Token&&(n.token=e.token??P),{agent:n}}({token:P}))},placeholder:"Enter token",className:"pr-8"}),(0,t.jsx)(j.Button,{type:"button",variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-full px-2 hover:bg-transparent",onClick:()=>T(!E),"data-testid":"toggle-token-visibility","aria-label":E?"Hide token":"Show token",children:E?(0,t.jsx)(l,{className:"h-3 w-3"}):(0,t.jsx)(a.Eye,{className:"h-3 w-3"})})]})})]}),(0,t.jsx)(tw,{links:[{label:"Agent system",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/agent-system.md"},{label:"Adding agents",href:"https://github.com/shep-ai/cli/blob/main/docs/development/adding-agents.md"},{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Choose which AI coding agent powers your features. Each agent supports different models and capabilities. Authentication is resolved automatically via your active session."})]}),(0,t.jsxs)("div",{id:"section-environment",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(tg,{icon:s.Terminal,title:"Environment",description:"Editor and shell preferences",testId:"environment-settings-section",children:(0,t.jsx)(tm,{label:"Default Editor",description:"Editor launched for file operations",htmlFor:"default-editor",children:(0,t.jsxs)(e0,{value:A,onValueChange:e=>{R(e),b({environment:{defaultEditor:e,shellPreference:D}})},children:[(0,t.jsx)(e2,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e1,{})}),(0,t.jsx)(e5,{children:tp.map(e=>{var n;let a=(n=e.value)&&n in td?td[n]:ta;return(0,t.jsx)(e8,{value:e.value,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(a,{className:"h-4 w-4 shrink-0"}),e.label]})},e.value)})})]})})}),(0,t.jsx)(tw,{links:[{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Your preferred editor is used when opening files for review or editing during the development workflow."})]}),(0,t.jsxs)("div",{id:"section-workflow",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:d.GitBranch,title:"Workflow",description:"Automation behavior after implementation",testId:"workflow-settings-section",children:[(0,t.jsx)(tf,{label:"Auto-approve PRD",description:"Skip manual review of requirements",id:"allow-prd",testId:"switch-allow-prd",checked:V,onChange:e=>{_(e),b(eu({allowPrd:e}))}}),(0,t.jsx)(tf,{label:"Auto-approve Plan",description:"Skip manual review of implementation plan",id:"allow-plan",testId:"switch-allow-plan",checked:O,onChange:e=>{W(e),b(eu({allowPlan:e}))}}),(0,t.jsx)(tf,{label:"Auto-approve Merge",description:"Merge without manual review",id:"allow-merge",testId:"switch-allow-merge",checked:z,onChange:e=>{U(e),b(eu({allowMerge:e}))}}),(0,t.jsx)(tf,{label:"Push on complete",description:"Push to remote when implementation finishes",id:"push-on-complete",testId:"switch-push-on-complete",checked:H,onChange:e=>{B(e),b(eu({pushOnComplete:e}))}}),(0,t.jsx)(tf,{label:"Open PR on complete",description:"Create a pull request when done",id:"open-pr",testId:"switch-open-pr",checked:L,onChange:e=>{F(e),b(eu({openPr:e}))}})]}),(0,t.jsx)(tw,{links:[{label:"Approval gates",href:"https://github.com/shep-ai/cli/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:"Push & PR flags",href:"https://github.com/shep-ai/cli/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:"Control how autonomous each feature run is. Auto-approve skips the human review pause at each phase. Push and PR options control what happens after successful implementation."})]}),(0,t.jsxs)("div",{id:"section-ci",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:c,title:"Continuous Integration",description:"Limits and timeouts for CI monitoring",testId:"ci-settings-section",children:[(0,t.jsx)(tm,{label:"Max fix attempts",description:"Agent retries on failing CI",htmlFor:"ci-max-fix",children:(0,t.jsx)(tx,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:K,onChange:G,onBlur:()=>{K!==ei&&b(eu({ciMaxFix:K}))},min:1,max:10})}),(0,t.jsx)(tm,{label:"Watch timeout",description:"Max wait for CI completion",htmlFor:"ci-timeout",children:(0,t.jsx)(tx,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:q,onChange:Y,onBlur:()=>{q!==es&&b(eu({ciTimeout:q}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(tm,{label:"Max log size",description:"Truncate CI logs beyond this limit",htmlFor:"ci-log-max",children:(0,t.jsx)(tx,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:Z,onChange:Q,onBlur:()=>{Z!==ed&&b(eu({ciLogMax:Z}))},min:1e3,step:5e3,suffix:"chars"})})]}),(0,t.jsx)(tw,{links:[{label:"CI/CD pipeline",href:"https://github.com/shep-ai/cli/blob/main/docs/development/cicd.md"},{label:"CI security gates",href:"https://github.com/shep-ai/cli/blob/main/specs/003-cicd-security-gates/spec.md"}],children:"When a feature completes, the agent can watch CI and auto-fix failures. These limits prevent runaway retries and control how much log output is sent to the agent for analysis."})]}),(0,t.jsxs)("div",{id:"section-notifications",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:u,title:"Notifications",description:"How and when you get notified",testId:"notification-settings-section",children:[(0,t.jsx)(tv,{children:"Channels"}),(0,t.jsx)(tf,{label:"In-app",description:"Notifications inside the Shep UI",id:"notif-in-app",testId:"switch-in-app",checked:X,onChange:e=>{$(e),b(ep({inApp:e}))}}),(0,t.jsx)(tf,{label:"Browser",description:"Push notifications via the browser",id:"notif-browser",testId:"switch-browser",checked:J,onChange:e=>{ee(e),b(ep({browser:e}))}}),(0,t.jsx)(tf,{label:"Desktop",description:"Native OS notifications",id:"notif-desktop",testId:"switch-desktop",checked:et,onChange:e=>{en(e),b(ep({desktop:e}))}}),(0,t.jsx)(tv,{children:"Agent Events"}),(0,t.jsx)(tf,{label:"Agent started",id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:ea.agentStarted,onChange:e=>{let t={...ea,agentStarted:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"Phase completed",id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:ea.phaseCompleted,onChange:e=>{let t={...ea,phaseCompleted:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"Waiting approval",id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:ea.waitingApproval,onChange:e=>{let t={...ea,waitingApproval:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"Agent completed",id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:ea.agentCompleted,onChange:e=>{let t={...ea,agentCompleted:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"Agent failed",id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:ea.agentFailed,onChange:e=>{let t={...ea,agentFailed:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tv,{children:"Pull Request Events"}),(0,t.jsx)(tf,{label:"PR merged",id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:ea.prMerged,onChange:e=>{let t={...ea,prMerged:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"PR closed",id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:ea.prClosed,onChange:e=>{let t={...ea,prClosed:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"PR checks passed",id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:ea.prChecksPassed,onChange:e=>{let t={...ea,prChecksPassed:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"PR checks failed",id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:ea.prChecksFailed,onChange:e=>{let t={...ea,prChecksFailed:e};eo(t),b(ep({events:t}))}})]}),(0,t.jsx)(tw,{links:[{label:"Notification system",href:"https://github.com/shep-ai/cli/blob/main/specs/021-agent-notifications/spec.yaml"}],children:"Three notification channels keep you in the loop: in-app toasts, browser push notifications, and native desktop alerts. Fine-tune which agent lifecycle events trigger a notification."})]}),(0,t.jsxs)("div",{id:"section-feature-flags",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:p,title:"Feature Flags",description:"Enable or disable experimental features",badge:"Experimental",testId:"feature-flags-settings-section",children:[(0,t.jsx)(tf,{label:"Skills",description:"Enable the skills system for agent capabilities",id:"flag-skills",testId:"switch-flag-skills",checked:el.skills,onChange:e=>{let t={...el,skills:e};er(t),b({featureFlags:t})}}),(0,t.jsx)(tf,{label:"Deployments",description:"Enable environment deployment workflows",id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:el.envDeploy,onChange:e=>{let t={...el,envDeploy:e};er(t),b({featureFlags:t})}}),(0,t.jsx)(tf,{label:"Debug",description:"Show debug panels and verbose logging",id:"flag-debug",testId:"switch-flag-debug",checked:el.debug,onChange:e=>{let t={...el,debug:e};er(t),b({featureFlags:t})}})]}),(0,t.jsx)(tw,{children:"Experimental features that are still under development. Enable at your own risk — they may change or be removed in future versions. Debug mode adds verbose logging useful for troubleshooting."})]}),(0,t.jsxs)("div",{id:"section-database",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:h,title:"Database",description:"Local storage information",testId:"database-settings-section",children:[(0,t.jsx)(tm,{label:"Location",description:"Path to the local SQLite database",children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shep-home-path",children:o})}),(0,t.jsx)(tm,{label:"Size",children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:m})})]}),(0,t.jsx)(tw,{links:[{label:"Settings service",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/settings-service.md"},{label:"Settings spec",href:"https://github.com/shep-ai/cli/blob/main/specs/005-global-settings-service/spec.md"}],children:"All settings are stored in a local SQLite database at ~/.shep/data. The database uses a singleton record pattern with automatic migrations on startup."})]})]})]})}e.s(["SettingsPageClient",()=>tb],41952)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(20314),n=e.i(79054),a=e.i(87889),o=e.i(3645);let l=(0,o.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var r=e.i(23925);let i=(0,o.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var s=e.i(38573),d=e.i(49228);let c=(0,o.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),u=(0,o.default)("bell",[["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"}]]),p=(0,o.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),h=(0,o.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var m=e.i(61569),m=m,f=e.i(3214),g=e.i(30702);let x=(0,o.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var v=e.i(60112),w=e.i(31777),b=e.i(41957),y=e.i(98127),j=e.i(35364),k=e.i(51911),C=e.i(2828),S=e.i(26036),N=e.i(27069),I=e.i(91967),P=e.i(87342),M=e.i(5978),E=e.i(22528),T=e.i(66033),A=e.i(53532),R=e.i(41687),D=e.i(56720),L=e.i(13123),F=e.i(52740),H=e.i(39979),B=e.i(87620),V=e.i(86874),_=e.i(29297),O=e.i(36589),W=e.i(5192),z=e.i(23405),U=e.i(1693),K=e.i(73772),G=e.i(13044),q=[" ","Enter","ArrowUp","ArrowDown"],Y=[" ","Enter"],Z="Select",[Q,X,$]=(0,P.createCollection)(Z),[J,ee]=(0,E.createContextScope)(Z,[$,F.createPopperScope]),et=(0,F.createPopperScope)(),[en,ea]=J(Z),[eo,el]=J(Z),er=e=>{let{__scopeSelect:a,children:o,open:l,defaultOpen:r,onOpenChange:i,value:s,defaultValue:d,onValueChange:c,dir:u,name:p,autoComplete:h,disabled:m,required:f,form:g}=e,x=et(a),[v,w]=n.useState(null),[b,y]=n.useState(null),[j,k]=n.useState(!1),C=(0,T.useDirection)(u),[S,N]=(0,O.useControllableState)({prop:l,defaultProp:r??!1,onChange:i,caller:Z}),[I,P]=(0,O.useControllableState)({prop:s,defaultProp:d,onChange:c,caller:Z}),M=n.useRef(null),E=!v||g||!!v.closest("form"),[A,R]=n.useState(new Set),D=Array.from(A).map(e=>e.props.value).join(";");return(0,t.jsx)(F.Root,{...x,children:(0,t.jsxs)(en,{required:f,scope:a,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:k,contentId:(0,L.useId)(),value:I,onValueChange:P,open:S,onOpenChange:N,dir:C,triggerPointerDownPosRef:M,disabled:m,children:[(0,t.jsx)(Q.Provider,{scope:a,children:(0,t.jsx)(eo,{scope:e.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{R(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{R(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:o})}),E?(0,t.jsxs)(eq,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:h,value:I,onChange:e=>P(e.target.value),disabled:m,form:g,children:[void 0===I?(0,t.jsx)("option",{value:""}):null,Array.from(A)]},D):null]})})};er.displayName=Z;var ei="SelectTrigger",es=n.forwardRef((e,a)=>{let{__scopeSelect:o,disabled:l=!1,...r}=e,i=et(o),s=ea(ei,o),d=s.disabled||l,c=(0,M.useComposedRefs)(a,s.onTriggerChange),u=X(o),p=n.useRef("touch"),[h,m,f]=eZ(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),a=eQ(t,e,n);void 0!==a&&s.onValueChange(a.value)}),g=e=>{d||(s.onOpenChange(!0),f()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(F.Anchor,{asChild:!0,...i,children:(0,t.jsx)(B.Primitive.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":eY(s.value)?"":void 0,...r,ref:c,onClick:(0,I.composeEventHandlers)(r.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:(0,I.composeEventHandlers)(r.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:(0,I.composeEventHandlers)(r.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&q.includes(e.key)&&(g(),e.preventDefault())})})})});es.displayName=ei;var ed="SelectValue",ec=n.forwardRef((e,n)=>{let{__scopeSelect:a,className:o,style:l,children:r,placeholder:i="",...s}=e,d=ea(ed,a),{onValueNodeHasChildrenChange:c}=d,u=void 0!==r,p=(0,M.useComposedRefs)(n,d.onValueNodeChange);return(0,W.useLayoutEffect)(()=>{c(u)},[c,u]),(0,t.jsx)(B.Primitive.span,{...s,ref:p,style:{pointerEvents:"none"},children:eY(d.value)?(0,t.jsx)(t.Fragment,{children:i}):r})});ec.displayName=ed;var eu=n.forwardRef((e,n)=>{let{__scopeSelect:a,children:o,...l}=e;return(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...l,ref:n,children:o||"▼"})});eu.displayName="SelectIcon";var ep=e=>(0,t.jsx)(H.Portal,{asChild:!0,...e});ep.displayName="SelectPortal";var eh="SelectContent",em=n.forwardRef((e,a)=>{let o=ea(eh,e.__scopeSelect),[l,r]=n.useState();return((0,W.useLayoutEffect)(()=>{r(new DocumentFragment)},[]),o.open)?(0,t.jsx)(ev,{...e,ref:a}):l?S.createPortal((0,t.jsx)(ef,{scope:e.__scopeSelect,children:(0,t.jsx)(Q.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),l):null});em.displayName=eh;var[ef,eg]=J(eh),ex=(0,V.createSlot)("SelectContent.RemoveScroll"),ev=n.forwardRef((e,a)=>{let{__scopeSelect:o,position:l="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v,...w}=e,b=ea(eh,o),[y,j]=n.useState(null),[k,C]=n.useState(null),S=(0,M.useComposedRefs)(a,e=>j(e)),[N,P]=n.useState(null),[E,T]=n.useState(null),L=X(o),[F,H]=n.useState(!1),B=n.useRef(!1);n.useEffect(()=>{if(y)return(0,K.hideOthers)(y)},[y]),(0,R.useFocusGuards)();let V=n.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[a]=n.slice(-1),o=document.activeElement;for(let n of e)if(n===o||(n?.scrollIntoView({block:"nearest"}),n===t&&k&&(k.scrollTop=0),n===a&&k&&(k.scrollTop=k.scrollHeight),n?.focus(),document.activeElement!==o))return},[L,k]),_=n.useCallback(()=>V([N,y]),[V,N,y]);n.useEffect(()=>{F&&_()},[F,_]);let{onOpenChange:O,triggerPointerDownPosRef:W}=b;n.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||O(!1),document.removeEventListener("pointermove",t),W.current=null};return null!==W.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[y,O,W]),n.useEffect(()=>{let e=()=>O(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[O]);let[z,U]=eZ(e=>{let t=L().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),a=eQ(t,e,n);a&&setTimeout(()=>a.ref.current.focus())}),q=n.useCallback((e,t,n)=>{let a=!B.current&&!n;(void 0!==b.value&&b.value===t||a)&&(P(e),a&&(B.current=!0))},[b.value]),Y=n.useCallback(()=>y?.focus(),[y]),Z=n.useCallback((e,t,n)=>{let a=!B.current&&!n;(void 0!==b.value&&b.value===t||a)&&T(e)},[b.value]),Q="popper"===l?eb:ew,$=Q===eb?{side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v}:{};return(0,t.jsx)(ef,{scope:o,content:y,viewport:k,onViewportChange:C,itemRefCallback:q,selectedItem:N,onItemLeave:Y,itemTextRefCallback:Z,focusSelectedItem:_,selectedItemText:E,position:l,isPositioned:F,searchRef:z,children:(0,t.jsx)(G.RemoveScroll,{as:ex,allowPinchZoom:!0,children:(0,t.jsx)(D.FocusScope,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,I.composeEventHandlers)(r,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(A.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,t.jsx)(Q,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...w,...$,onPlaced:()=>H(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:(0,I.composeEventHandlers)(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,a=t.indexOf(n);t=t.slice(a+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});ev.displayName="SelectContentImpl";var ew=n.forwardRef((e,a)=>{let{__scopeSelect:o,onPlaced:l,...r}=e,i=ea(eh,o),s=eg(eh,o),[d,c]=n.useState(null),[u,p]=n.useState(null),h=(0,M.useComposedRefs)(a,e=>p(e)),m=X(o),f=n.useRef(!1),g=n.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=s,y=n.useCallback(()=>{if(i.trigger&&i.valueNode&&d&&u&&x&&v&&w){let e=i.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=i.valueNode.getBoundingClientRect(),a=w.getBoundingClientRect();if("rtl"!==i.dir){let o=a.left-t.left,l=n.left-o,r=e.left-l,i=e.width+r,s=Math.max(i,t.width),c=window.innerWidth-10,u=(0,N.clamp)(l,[10,Math.max(10,c-s)]);d.style.minWidth=i+"px",d.style.left=u+"px"}else{let o=t.right-a.right,l=window.innerWidth-n.right-o,r=window.innerWidth-e.right-l,i=e.width+r,s=Math.max(i,t.width),c=window.innerWidth-10,u=(0,N.clamp)(l,[10,Math.max(10,c-s)]);d.style.minWidth=i+"px",d.style.right=u+"px"}let o=m(),r=window.innerHeight-20,s=x.scrollHeight,c=window.getComputedStyle(u),p=parseInt(c.borderTopWidth,10),h=parseInt(c.paddingTop,10),g=parseInt(c.borderBottomWidth,10),b=p+h+s+parseInt(c.paddingBottom,10)+g,y=Math.min(5*v.offsetHeight,b),j=window.getComputedStyle(x),k=parseInt(j.paddingTop,10),C=parseInt(j.paddingBottom,10),S=e.top+e.height/2-10,I=v.offsetHeight/2,P=p+h+(v.offsetTop+I);if(P<=S){let e=o.length>0&&v===o[o.length-1].ref.current;d.style.bottom="0px";let t=Math.max(r-S,I+(e?C:0)+(u.clientHeight-x.offsetTop-x.offsetHeight)+g);d.style.height=P+t+"px"}else{let e=o.length>0&&v===o[0].ref.current;d.style.top="0px";let t=Math.max(S,p+x.offsetTop+(e?k:0)+I);d.style.height=t+(b-P)+"px",x.scrollTop=P-S+x.offsetTop}d.style.margin="10px 0",d.style.minHeight=y+"px",d.style.maxHeight=r+"px",l?.(),requestAnimationFrame(()=>f.current=!0)}},[m,i.trigger,i.valueNode,d,u,x,v,w,i.dir,l]);(0,W.useLayoutEffect)(()=>y(),[y]);let[j,k]=n.useState();(0,W.useLayoutEffect)(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);let C=n.useCallback(e=>{e&&!0===g.current&&(y(),b?.(),g.current=!1)},[y,b]);return(0,t.jsx)(ey,{scope:o,contentWrapper:d,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:(0,t.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:(0,t.jsx)(B.Primitive.div,{...r,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ew.displayName="SelectItemAlignedPosition";var eb=n.forwardRef((e,n)=>{let{__scopeSelect:a,align:o="start",collisionPadding:l=10,...r}=e,i=et(a);return(0,t.jsx)(F.Content,{...i,...r,ref:n,align:o,collisionPadding:l,style:{boxSizing:"border-box",...r.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});eb.displayName="SelectPopperPosition";var[ey,ej]=J(eh,{}),ek="SelectViewport",eC=n.forwardRef((e,a)=>{let{__scopeSelect:o,nonce:l,...r}=e,i=eg(ek,o),s=ej(ek,o),d=(0,M.useComposedRefs)(a,i.onViewportChange),c=n.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),(0,t.jsx)(Q.Slot,{scope:o,children:(0,t.jsx)(B.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:(0,I.composeEventHandlers)(r.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:a}=s;if(a?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let a=window.innerHeight-20,o=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(o<a){let l=o+e,r=Math.min(a,l),i=l-r;n.style.height=r+"px","0px"===n.style.bottom&&(t.scrollTop=i>0?i:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});eC.displayName=ek;var eS="SelectGroup",[eN,eI]=J(eS),eP=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e,l=(0,L.useId)();return(0,t.jsx)(eN,{scope:a,id:l,children:(0,t.jsx)(B.Primitive.div,{role:"group","aria-labelledby":l,...o,ref:n})})});eP.displayName=eS;var eM="SelectLabel",eE=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e,l=eI(eM,a);return(0,t.jsx)(B.Primitive.div,{id:l.id,...o,ref:n})});eE.displayName=eM;var eT="SelectItem",[eA,eR]=J(eT),eD=n.forwardRef((e,a)=>{let{__scopeSelect:o,value:l,disabled:r=!1,textValue:i,...s}=e,d=ea(eT,o),c=eg(eT,o),u=d.value===l,[p,h]=n.useState(i??""),[m,f]=n.useState(!1),g=(0,M.useComposedRefs)(a,e=>c.itemRefCallback?.(e,l,r)),x=(0,L.useId)(),v=n.useRef("touch"),w=()=>{r||(d.onValueChange(l),d.onOpenChange(!1))};if(""===l)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(eA,{scope:o,value:l,disabled:r,textId:x,isSelected:u,onItemTextChange:n.useCallback(e=>{h(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(Q.ItemSlot,{scope:o,value:l,disabled:r,textValue:p,children:(0,t.jsx)(B.Primitive.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:g,onFocus:(0,I.composeEventHandlers)(s.onFocus,()=>f(!0)),onBlur:(0,I.composeEventHandlers)(s.onBlur,()=>f(!1)),onClick:(0,I.composeEventHandlers)(s.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:(0,I.composeEventHandlers)(s.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:(0,I.composeEventHandlers)(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:(0,I.composeEventHandlers)(s.onPointerMove,e=>{v.current=e.pointerType,r?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,I.composeEventHandlers)(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:(0,I.composeEventHandlers)(s.onKeyDown,e=>{(c.searchRef?.current===""||" "!==e.key)&&(Y.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});eD.displayName=eT;var eL="SelectItemText",eF=n.forwardRef((e,a)=>{let{__scopeSelect:o,className:l,style:r,...i}=e,s=ea(eL,o),d=eg(eL,o),c=eR(eL,o),u=el(eL,o),[p,h]=n.useState(null),m=(0,M.useComposedRefs)(a,e=>h(e),c.onItemTextChange,e=>d.itemTextRefCallback?.(e,c.value,c.disabled)),f=p?.textContent,g=n.useMemo(()=>(0,t.jsx)("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return(0,W.useLayoutEffect)(()=>(x(g),()=>v(g)),[x,v,g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Primitive.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?S.createPortal(i.children,s.valueNode):null]})});eF.displayName=eL;var eH="SelectItemIndicator",eB=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e;return eR(eH,a).isSelected?(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...o,ref:n}):null});eB.displayName=eH;var eV="SelectScrollUpButton",e_=n.forwardRef((e,a)=>{let o=eg(eV,e.__scopeSelect),l=ej(eV,e.__scopeSelect),[r,i]=n.useState(!1),s=(0,M.useComposedRefs)(a,l.onScrollButtonChange);return(0,W.useLayoutEffect)(()=>{if(o.viewport&&o.isPositioned){let e=function(){i(t.scrollTop>0)},t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),r?(0,t.jsx)(ez,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});e_.displayName=eV;var eO="SelectScrollDownButton",eW=n.forwardRef((e,a)=>{let o=eg(eO,e.__scopeSelect),l=ej(eO,e.__scopeSelect),[r,i]=n.useState(!1),s=(0,M.useComposedRefs)(a,l.onScrollButtonChange);return(0,W.useLayoutEffect)(()=>{if(o.viewport&&o.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;i(Math.ceil(t.scrollTop)<e)},t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),r?(0,t.jsx)(ez,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});eW.displayName=eO;var ez=n.forwardRef((e,a)=>{let{__scopeSelect:o,onAutoScroll:l,...r}=e,i=eg("SelectScrollButton",o),s=n.useRef(null),d=X(o),c=n.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),(0,W.useLayoutEffect)(()=>{let e=d().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[d]),(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...r,ref:a,style:{flexShrink:0,...r.style},onPointerDown:(0,I.composeEventHandlers)(r.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(l,50))}),onPointerMove:(0,I.composeEventHandlers)(r.onPointerMove,()=>{i.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(l,50))}),onPointerLeave:(0,I.composeEventHandlers)(r.onPointerLeave,()=>{c()})})}),eU=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e;return(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...o,ref:n})});eU.displayName="SelectSeparator";var eK="SelectArrow",eG=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e,l=et(a),r=ea(eK,a),i=eg(eK,a);return r.open&&"popper"===i.position?(0,t.jsx)(F.Arrow,{...l,...o,ref:n}):null});eG.displayName=eK;var eq=n.forwardRef(({__scopeSelect:e,value:a,...o},l)=>{let r=n.useRef(null),i=(0,M.useComposedRefs)(l,r),s=(0,z.usePrevious)(a);return n.useEffect(()=>{let e=r.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(s!==a&&t){let n=new Event("change",{bubbles:!0});t.call(e,a),e.dispatchEvent(n)}},[s,a]),(0,t.jsx)(B.Primitive.select,{...o,style:{...U.VISUALLY_HIDDEN_STYLES,...o.style},ref:i,defaultValue:a})});function eY(e){return""===e||void 0===e}function eZ(e){let t=(0,_.useCallbackRef)(e),a=n.useRef(""),o=n.useRef(0),l=n.useCallback(e=>{let n=a.current+e;t(n),function e(t){a.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),r=n.useCallback(()=>{a.current="",window.clearTimeout(o.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(o.current),[]),[a,l,r]}function eQ(e,t,n){var a,o;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1,i=(a=e,o=Math.max(r,0),a.map((e,t)=>a[(o+t)%a.length]));1===l.length&&(i=i.filter(e=>e!==n));let s=i.find(e=>e.textValue.toLowerCase().startsWith(l.toLowerCase()));return s!==n?s:void 0}eq.displayName="SelectBubbleInput",e.s(["Arrow",()=>eG,"Content",()=>em,"Group",()=>eP,"Icon",()=>eu,"Item",()=>eD,"ItemIndicator",()=>eB,"ItemText",()=>eF,"Label",()=>eE,"Portal",()=>ep,"Root",()=>er,"ScrollDownButton",()=>eW,"ScrollUpButton",()=>e_,"Select",()=>er,"SelectArrow",()=>eG,"SelectContent",()=>em,"SelectGroup",()=>eP,"SelectIcon",()=>eu,"SelectItem",()=>eD,"SelectItemIndicator",()=>eB,"SelectItemText",()=>eF,"SelectLabel",()=>eE,"SelectPortal",()=>ep,"SelectScrollDownButton",()=>eW,"SelectScrollUpButton",()=>e_,"SelectSeparator",()=>eU,"SelectTrigger",()=>es,"SelectValue",()=>ec,"SelectViewport",()=>eC,"Separator",()=>eU,"Trigger",()=>es,"Value",()=>ec,"Viewport",()=>eC,"createSelectScope",()=>ee],83830);var eX=e.i(83830),eX=eX,e$=e.i(99105);let eJ=(0,o.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),e0=eX.Root;eX.Group;let e1=eX.Value,e2=n.forwardRef(({className:e,children:n,...a},o)=>(0,t.jsxs)(eX.Trigger,{ref:o,className:(0,w.cn)("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...a,children:[n,(0,t.jsx)(eX.Icon,{asChild:!0,children:(0,t.jsx)(e$.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));e2.displayName=eX.Trigger.displayName;let e4=n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.ScrollUpButton,{ref:a,className:(0,w.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(eJ,{className:"h-4 w-4"})}));e4.displayName=eX.ScrollUpButton.displayName;let e3=n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.ScrollDownButton,{ref:a,className:(0,w.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(e$.ChevronDown,{className:"h-4 w-4"})}));e3.displayName=eX.ScrollDownButton.displayName;let e5=n.forwardRef(({className:e,children:n,position:a="popper",...o},l)=>(0,t.jsx)(eX.Portal,{children:(0,t.jsxs)(eX.Content,{ref:l,className:(0,w.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...o,children:[(0,t.jsx)(e4,{}),(0,t.jsx)(eX.Viewport,{className:(0,w.cn)("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),(0,t.jsx)(e3,{})]})}));e5.displayName=eX.Content.displayName,n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.Label,{ref:a,className:(0,w.cn)("px-2 py-1.5 text-sm font-semibold",e),...n})).displayName=eX.Label.displayName;let e8=n.forwardRef(({className:e,children:n,...a},o)=>(0,t.jsxs)(eX.Item,{ref:o,className:(0,w.cn)("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,t.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eX.ItemIndicator,{children:(0,t.jsx)(r.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eX.ItemText,{children:n})]}));e8.displayName=eX.Item.displayName,n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.Separator,{ref:a,className:(0,w.cn)("bg-muted -mx-1 my-1 h-px",e),...n})).displayName=eX.Separator.displayName;var e6=e.i(21023);let e9=(0,e6.createServerReference)("400a8da0090852a1689c721666a40ae85348c01da5",e6.callServer,void 0,e6.findSourceMapURL,"updateSettingsAction");var e7=e.i(17406),te=e.i(98804),tt=e.i(93752),tt=tt,tn=e.i(83902);function ta(e){return(0,t.jsx)(tt.default,{className:(0,w.cn)("h-4 w-4",e.className),...e})}function to({className:e}){return(0,t.jsx)(te.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function tl({className:e}){return(0,t.jsx)(te.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function tr({className:e}){return(0,t.jsx)(te.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function ti({className:e}){return(0,t.jsx)(te.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function ts({className:e,...n}){return(0,t.jsx)(tn.Rocket,{className:(0,w.cn)("h-4 w-4",e),...n})}to.displayName="VsCodeIcon",tl.displayName="CursorEditorIcon",tr.displayName="WindsurfIcon",ti.displayName="ZedIcon",ts.displayName="AntigravityIcon";let td={vscode:to,cursor:tl,windsurf:tr,zed:ti,antigravity:ts};var tc=e.i(41413);let tu=[{value:e7.AgentAuthMethod.Session,label:"Session"},{value:e7.AgentAuthMethod.Token,label:"Token"}],tp=[{value:e7.EditorType.VsCode,label:"VS Code"},{value:e7.EditorType.Cursor,label:"Cursor"},{value:e7.EditorType.Windsurf,label:"Windsurf"},{value:e7.EditorType.Zed,label:"Zed"},{value:e7.EditorType.Antigravity,label:"Antigravity"}],th=[{id:"agent",label:"Agent",icon:i},{id:"environment",label:"Environment",icon:s.Terminal},{id:"workflow",label:"Workflow",icon:d.GitBranch},{id:"ci",label:"CI",icon:c},{id:"notifications",label:"Notifications",icon:u},{id:"feature-flags",label:"Flags",icon:p},{id:"database",label:"Database",icon:h}];function tm({label:e,description:n,htmlFor:a,children:o}){return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(b.Label,{htmlFor:a,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),n?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:n}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:o})]})}function tf({label:e,description:n,id:a,testId:o,checked:l,onChange:r}){return(0,t.jsx)(tm,{label:e,description:n,htmlFor:a,children:(0,t.jsx)(k.Switch,{id:a,"data-testid":o,checked:l,onCheckedChange:r,className:"cursor-pointer"})})}function tg({icon:e,title:n,description:a,badge:o,testId:l,children:r}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":l,children:[(0,t.jsxs)("div",{className:"bg-muted/30 border-b px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("h2",{className:"text-sm font-semibold",children:n}),o?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase",children:o}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:a})]}),(0,t.jsx)("div",{className:"px-4",children:r})]})}function tx({id:e,testId:n,value:a,onChange:o,onBlur:l,placeholder:r,min:i=1,max:s,step:d=1,suffix:c}){let u=""===a?void 0:parseInt(a,10);return(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center overflow-hidden rounded-md border",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{o(String(Math.max(i,(u??parseInt(r,10))-d)))},onMouseUp:l,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors","aria-label":"Decrease",children:(0,t.jsx)(m.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":n,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:a,placeholder:r,onChange:e=>{o(e.target.value.replace(/[^0-9]/g,""))},onBlur:l,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=u??parseInt(r,10),o(String(null!=s?Math.min(s,e+d):e+d))},onMouseUp:l,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors","aria-label":"Increase",children:(0,t.jsx)(f.Plus,{className:"h-3 w-3"})})]}),c?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:c}):null]})}function tv({children:e}){return(0,t.jsx)("div",{className:"border-b pt-3 pb-1",children:(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase",children:e})})}function tw({children:e,links:n}){return(0,t.jsxs)("div",{className:"hidden pt-2 lg:block",children:[(0,t.jsx)("p",{className:"text-muted-foreground/70 text-[11px] leading-relaxed",children:e}),null!=n&&n.length>0?(0,t.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:n.map(e=>(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-[10px] transition-colors",children:[(0,t.jsx)(g.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function tb({settings:e,shepHome:o,dbFileSize:m}){let{showSaving:f,showSaved:g,save:b}=function(){let[e,t]=(0,n.useTransition)(),[a,o]=(0,n.useState)(!1),[l,r]=(0,n.useState)(!1),i=(0,n.useRef)(null),s=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{e&&!a&&(o(!0),s.current=!1,i.current=setTimeout(()=>{i.current=null,s.current&&(o(!1),r(!0),setTimeout(()=>r(!1),2e3))},350)),!e&&a&&(s.current=!0,i.current||(o(!1),r(!0),setTimeout(()=>r(!1),2e3)))},[e,a]),{showSaving:a,showSaved:l,save:(0,n.useCallback)(e=>{t(async()=>{let t=await e9(e);t.success||v.toast.error(t.error??"Failed to save settings")})},[t])}}(),k=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1},[S,N]=(0,n.useState)(e.agent.type),I=e.agent.authMethod,[P,M]=(0,n.useState)(e.agent.token??""),[E,T]=(0,n.useState)(!1),[A,R]=(0,n.useState)(e.environment.defaultEditor),D=e.environment.shellPreference,[L,F]=(0,n.useState)(e.workflow.openPrOnImplementationComplete),[H,B]=(0,n.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[V,_]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPrd),[O,W]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPlan),[z,U]=(0,n.useState)(e.workflow.approvalGateDefaults.allowMerge),[K,G]=(0,n.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[q,Y]=(0,n.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[Z,Q]=(0,n.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[X,$]=(0,n.useState)(e.notifications.inApp.enabled),[J,ee]=(0,n.useState)(e.notifications.browser.enabled),[et,en]=(0,n.useState)(e.notifications.desktop.enabled),[ea,eo]=(0,n.useState)({...e.notifications.events}),[el,er]=(0,n.useState)({...k}),ei=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",es=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",ed=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"";function ec(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function eu(e={}){let t=ec(e.ciTimeout??q);return{workflow:{openPrOnImplementationComplete:e.openPr??L,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??H,allowPrd:e.allowPrd??V,allowPlan:e.allowPlan??O,allowMerge:e.allowMerge??z},ciMaxFixAttempts:ec(e.ciMaxFix??K),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:ec(e.ciLogMax??Z)}}}function ep(e={}){return{notifications:{inApp:{enabled:e.inApp??X},browser:{enabled:e.browser??J},desktop:{enabled:e.desktop??et},events:e.events??ea}}}let[eh,em]=(0,n.useState)("agent");(0,n.useEffect)(()=>{let e=th.map(e=>document.getElementById(`section-${e.id}`)).filter(Boolean);if(0===e.length)return;let t=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&em(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let n of e)t.observe(n);return()=>t.disconnect()},[]);let ef=(0,n.useCallback)(e=>{let t=document.getElementById(`section-${e}`);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),t.style.animation="none",t.offsetHeight,t.style.animation="section-flash 1s ease-out")},[]);return(0,t.jsxs)("div",{"data-testid":"settings-page-client",className:"max-w-5xl",children:[(0,t.jsx)("div",{className:"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 grid grid-cols-1 gap-x-5 pt-6 pb-4 backdrop-blur lg:grid-cols-[1fr_280px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Settings"}),(0,t.jsxs)("span",{className:"relative h-4 w-16",children:[(0,t.jsx)("span",{className:(0,w.cn)("text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300",f?"opacity-100":"opacity-0"),children:"Saving..."}),(0,t.jsxs)("span",{className:(0,w.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",g&&!f?"opacity-100":"opacity-0"),children:[(0,t.jsx)(r.Check,{className:"h-3 w-3"}),"Saved"]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:th.map(e=>{let n=e.icon,a=eh===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>ef(e.id),className:(0,w.cn)("flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all",a?"bg-accent text-foreground font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(n,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:e.label})]},e.id)})})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{id:"section-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:i,title:"Agent",description:"AI coding agent and authentication",testId:"agent-settings-section",children:[(0,t.jsx)(tm,{label:"Agent & Model",description:"Provider and model for all operations",htmlFor:"agent-model-picker",children:(0,t.jsx)(tc.AgentModelPicker,{initialAgentType:S,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>N(e),className:"w-55"})}),(0,t.jsx)(tm,{label:"Authentication",description:"How the agent authenticates",htmlFor:"auth-method",children:(0,t.jsx)(C.TooltipProvider,{children:(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsxs)(e0,{value:I,disabled:!0,children:[(0,t.jsx)(e2,{id:"auth-method","data-testid":"auth-method-select",className:"w-55 cursor-not-allowed text-xs opacity-60",children:(0,t.jsx)(e1,{})}),(0,t.jsx)(e5,{children:tu.map(e=>(0,t.jsx)(e8,{value:e.value,children:e.label},e.value))})]})})}),(0,t.jsx)(C.TooltipContent,{children:"Coming soon"})]})})}),I===e7.AgentAuthMethod.Token&&(0,t.jsx)(tm,{label:"API Token",htmlFor:"agent-token",children:(0,t.jsxs)("div",{className:"relative w-45",children:[(0,t.jsx)(y.Input,{id:"agent-token","data-testid":"agent-token-input",type:E?"text":"password",value:P,onChange:e=>M(e.target.value),onBlur:()=>{P!==(e.agent.token??"")&&b(function(e={}){let t={type:S,authMethod:I,...e},n={type:t.type,authMethod:t.authMethod};return t.authMethod===e7.AgentAuthMethod.Token&&(n.token=e.token??P),{agent:n}}({token:P}))},placeholder:"Enter token",className:"pr-8"}),(0,t.jsx)(j.Button,{type:"button",variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-full px-2 hover:bg-transparent",onClick:()=>T(!E),"data-testid":"toggle-token-visibility","aria-label":E?"Hide token":"Show token",children:E?(0,t.jsx)(l,{className:"h-3 w-3"}):(0,t.jsx)(a.Eye,{className:"h-3 w-3"})})]})})]}),(0,t.jsx)(tw,{links:[{label:"Agent system",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/agent-system.md"},{label:"Adding agents",href:"https://github.com/shep-ai/cli/blob/main/docs/development/adding-agents.md"},{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Choose which AI coding agent powers your features. Each agent supports different models and capabilities. Authentication is resolved automatically via your active session."})]}),(0,t.jsxs)("div",{id:"section-environment",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(tg,{icon:s.Terminal,title:"Environment",description:"Editor and shell preferences",testId:"environment-settings-section",children:(0,t.jsx)(tm,{label:"Default Editor",description:"Editor launched for file operations",htmlFor:"default-editor",children:(0,t.jsxs)(e0,{value:A,onValueChange:e=>{R(e),b({environment:{defaultEditor:e,shellPreference:D}})},children:[(0,t.jsx)(e2,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e1,{})}),(0,t.jsx)(e5,{children:tp.map(e=>{var n;let a=(n=e.value)&&n in td?td[n]:ta;return(0,t.jsx)(e8,{value:e.value,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(a,{className:"h-4 w-4 shrink-0"}),e.label]})},e.value)})})]})})}),(0,t.jsx)(tw,{links:[{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Your preferred editor is used when opening files for review or editing during the development workflow."})]}),(0,t.jsxs)("div",{id:"section-workflow",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:d.GitBranch,title:"Workflow",description:"Automation behavior after implementation",testId:"workflow-settings-section",children:[(0,t.jsx)(tf,{label:"Auto-approve PRD",description:"Skip manual review of requirements",id:"allow-prd",testId:"switch-allow-prd",checked:V,onChange:e=>{_(e),b(eu({allowPrd:e}))}}),(0,t.jsx)(tf,{label:"Auto-approve Plan",description:"Skip manual review of implementation plan",id:"allow-plan",testId:"switch-allow-plan",checked:O,onChange:e=>{W(e),b(eu({allowPlan:e}))}}),(0,t.jsx)(tf,{label:"Auto-approve Merge",description:"Merge without manual review",id:"allow-merge",testId:"switch-allow-merge",checked:z,onChange:e=>{U(e),b(eu({allowMerge:e}))}}),(0,t.jsx)(tf,{label:"Push on complete",description:"Push to remote when implementation finishes",id:"push-on-complete",testId:"switch-push-on-complete",checked:H,onChange:e=>{B(e),b(eu({pushOnComplete:e}))}}),(0,t.jsx)(tf,{label:"Open PR on complete",description:"Create a pull request when done",id:"open-pr",testId:"switch-open-pr",checked:L,onChange:e=>{F(e),b(eu({openPr:e}))}})]}),(0,t.jsx)(tw,{links:[{label:"Approval gates",href:"https://github.com/shep-ai/cli/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:"Push & PR flags",href:"https://github.com/shep-ai/cli/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:"Control how autonomous each feature run is. Auto-approve skips the human review pause at each phase. Push and PR options control what happens after successful implementation."})]}),(0,t.jsxs)("div",{id:"section-ci",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:c,title:"Continuous Integration",description:"Limits and timeouts for CI monitoring",testId:"ci-settings-section",children:[(0,t.jsx)(tm,{label:"Max fix attempts",description:"Agent retries on failing CI",htmlFor:"ci-max-fix",children:(0,t.jsx)(tx,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:K,onChange:G,onBlur:()=>{K!==ei&&b(eu({ciMaxFix:K}))},min:1,max:10})}),(0,t.jsx)(tm,{label:"Watch timeout",description:"Max wait for CI completion",htmlFor:"ci-timeout",children:(0,t.jsx)(tx,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:q,onChange:Y,onBlur:()=>{q!==es&&b(eu({ciTimeout:q}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(tm,{label:"Max log size",description:"Truncate CI logs beyond this limit",htmlFor:"ci-log-max",children:(0,t.jsx)(tx,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:Z,onChange:Q,onBlur:()=>{Z!==ed&&b(eu({ciLogMax:Z}))},min:1e3,step:5e3,suffix:"chars"})})]}),(0,t.jsx)(tw,{links:[{label:"CI/CD pipeline",href:"https://github.com/shep-ai/cli/blob/main/docs/development/cicd.md"},{label:"CI security gates",href:"https://github.com/shep-ai/cli/blob/main/specs/003-cicd-security-gates/spec.md"}],children:"When a feature completes, the agent can watch CI and auto-fix failures. These limits prevent runaway retries and control how much log output is sent to the agent for analysis."})]}),(0,t.jsxs)("div",{id:"section-notifications",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:u,title:"Notifications",description:"How and when you get notified",testId:"notification-settings-section",children:[(0,t.jsx)(tv,{children:"Channels"}),(0,t.jsx)(tf,{label:"In-app",description:"Notifications inside the Shep UI",id:"notif-in-app",testId:"switch-in-app",checked:X,onChange:e=>{$(e),b(ep({inApp:e}))}}),(0,t.jsx)(tf,{label:"Browser",description:"Push notifications via the browser",id:"notif-browser",testId:"switch-browser",checked:J,onChange:e=>{ee(e),b(ep({browser:e}))}}),(0,t.jsx)(tf,{label:"Desktop",description:"Native OS notifications",id:"notif-desktop",testId:"switch-desktop",checked:et,onChange:e=>{en(e),b(ep({desktop:e}))}}),(0,t.jsx)(tv,{children:"Agent Events"}),(0,t.jsx)(tf,{label:"Agent started",id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:ea.agentStarted,onChange:e=>{let t={...ea,agentStarted:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"Phase completed",id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:ea.phaseCompleted,onChange:e=>{let t={...ea,phaseCompleted:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"Waiting approval",id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:ea.waitingApproval,onChange:e=>{let t={...ea,waitingApproval:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"Agent completed",id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:ea.agentCompleted,onChange:e=>{let t={...ea,agentCompleted:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"Agent failed",id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:ea.agentFailed,onChange:e=>{let t={...ea,agentFailed:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tv,{children:"Pull Request Events"}),(0,t.jsx)(tf,{label:"PR merged",id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:ea.prMerged,onChange:e=>{let t={...ea,prMerged:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"PR closed",id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:ea.prClosed,onChange:e=>{let t={...ea,prClosed:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"PR checks passed",id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:ea.prChecksPassed,onChange:e=>{let t={...ea,prChecksPassed:e};eo(t),b(ep({events:t}))}}),(0,t.jsx)(tf,{label:"PR checks failed",id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:ea.prChecksFailed,onChange:e=>{let t={...ea,prChecksFailed:e};eo(t),b(ep({events:t}))}})]}),(0,t.jsx)(tw,{links:[{label:"Notification system",href:"https://github.com/shep-ai/cli/blob/main/specs/021-agent-notifications/spec.yaml"}],children:"Three notification channels keep you in the loop: in-app toasts, browser push notifications, and native desktop alerts. Fine-tune which agent lifecycle events trigger a notification."})]}),(0,t.jsxs)("div",{id:"section-feature-flags",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:p,title:"Feature Flags",description:"Enable or disable experimental features",badge:"Experimental",testId:"feature-flags-settings-section",children:[(0,t.jsx)(tf,{label:"Skills",description:"Enable the skills system for agent capabilities",id:"flag-skills",testId:"switch-flag-skills",checked:el.skills,onChange:e=>{let t={...el,skills:e};er(t),b({featureFlags:t})}}),(0,t.jsx)(tf,{label:"Deployments",description:"Enable environment deployment workflows",id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:el.envDeploy,onChange:e=>{let t={...el,envDeploy:e};er(t),b({featureFlags:t})}}),(0,t.jsx)(tf,{label:"Debug",description:"Show debug panels and verbose logging",id:"flag-debug",testId:"switch-flag-debug",checked:el.debug,onChange:e=>{let t={...el,debug:e};er(t),b({featureFlags:t})}})]}),(0,t.jsx)(tw,{children:"Experimental features that are still under development. Enable at your own risk — they may change or be removed in future versions. Debug mode adds verbose logging useful for troubleshooting."})]}),(0,t.jsxs)("div",{id:"section-database",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:h,title:"Database",description:"Local storage information",testId:"database-settings-section",children:[(0,t.jsx)(tm,{label:"Location",description:"Path to the local SQLite database",children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shep-home-path",children:o})}),(0,t.jsx)(tm,{label:"Size",children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:m})})]}),(0,t.jsx)(tw,{links:[{label:"Settings service",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/settings-service.md"},{label:"Settings spec",href:"https://github.com/shep-ai/cli/blob/main/specs/005-global-settings-service/spec.md"}],children:"All settings are stored in a local SQLite database at ~/.shep/data. The database uses a singleton record pattern with automatic migrations on startup."})]})]})]})}e.s(["SettingsPageClient",()=>tb],41952)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),o=e.i(5978),s=e.i(22528),n=e.i(53532),i=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),u=e.i(39979),p=e.i(85995),h=e.i(87620),f=e.i(86874),m=e.i(36589),x=e.i(73772),g=e.i(13044),b="Popover",[v,j]=(0,s.createContextScope)(b,[c.createPopperScope]),w=(0,c.createPopperScope)(),[y,C]=v(b),k=e=>{let{__scopePopover:a,children:o,open:s,defaultOpen:n,onOpenChange:i,modal:l=!1}=e,u=w(a),p=r.useRef(null),[h,f]=r.useState(!1),[x,g]=(0,m.useControllableState)({prop:s,defaultProp:n??!1,onChange:i,caller:b});return(0,t.jsx)(c.Root,{...u,children:(0,t.jsx)(y,{scope:a,contentId:(0,d.useId)(),triggerRef:p,open:x,onOpenChange:g,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>f(!0),[]),onCustomAnchorRemove:r.useCallback(()=>f(!1),[]),modal:l,children:o})})};k.displayName=b;var N="PopoverAnchor",P=r.forwardRef((e,a)=>{let{__scopePopover:o,...s}=e,n=C(N,o),i=w(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=n;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...i,...s,ref:a})});P.displayName=N;var T="PopoverTrigger",S=r.forwardRef((e,r)=>{let{__scopePopover:s,...n}=e,i=C(T,s),l=w(s),d=(0,o.useComposedRefs)(r,i.triggerRef),u=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":H(i.open),...n,ref:d,onClick:(0,a.composeEventHandlers)(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:u})});S.displayName=T;var R="PopoverPortal",[A,D]=v(R,{forceMount:void 0}),F=e=>{let{__scopePopover:r,forceMount:a,children:o,container:s}=e,n=C(R,r);return(0,t.jsx)(A,{scope:r,forceMount:a,children:(0,t.jsx)(p.Presence,{present:a||n.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:s,children:o})})})};F.displayName=R;var E="PopoverContent",M=r.forwardRef((e,r)=>{let a=D(E,e.__scopePopover),{forceMount:o=a.forceMount,...s}=e,n=C(E,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:o||n.open,children:n.modal?(0,t.jsx)(z,{...s,ref:r}):(0,t.jsx)(I,{...s,ref:r})})});M.displayName=E;var O=(0,f.createSlot)("PopoverContent.RemoveScroll"),z=r.forwardRef((e,s)=>{let n=C(E,e.__scopePopover),i=r.useRef(null),l=(0,o.useComposedRefs)(s,i),d=r.useRef(!1);return r.useEffect(()=>{let e=i.current;if(e)return(0,x.hideOthers)(e)},[]),(0,t.jsx)(g.RemoveScroll,{as:O,allowPinchZoom:!0,children:(0,t.jsx)(L,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,a.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,a.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),I=r.forwardRef((e,a)=>{let o=C(E,e.__scopePopover),s=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(L,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(s.current||o.triggerRef.current?.focus(),t.preventDefault()),s.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),L=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:d,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:m,...x}=e,g=C(E,a),b=w(a);return(0,i.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:d,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":H(g.open),role:"dialog",id:g.contentId,...b,...x,ref:r,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),U="PopoverClose",B=r.forwardRef((e,r)=>{let{__scopePopover:o,...s}=e,n=C(U,o);return(0,t.jsx)(h.Primitive.button,{type:"button",...s,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});B.displayName=U;var $=r.forwardRef((e,r)=>{let{__scopePopover:a,...o}=e,s=w(a);return(0,t.jsx)(c.Arrow,{...s,...o,ref:r})});function H(e){return e?"open":"closed"}$.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>$,"Close",()=>B,"Content",()=>M,"Popover",()=>k,"PopoverAnchor",()=>P,"PopoverArrow",()=>$,"PopoverClose",()=>B,"PopoverContent",()=>M,"PopoverPortal",()=>F,"PopoverTrigger",()=>S,"Portal",()=>F,"Root",()=>k,"Trigger",()=>S,"createPopoverScope",()=>j],89920);var q=e.i(89920),q=q,G=e.i(31777);let _=q.Root,K=q.Trigger;q.Anchor;let X=r.forwardRef(({className:e,align:r="center",sideOffset:a=4,...o},s)=>(0,t.jsx)(q.Portal,{children:(0,t.jsx)(q.Content,{ref:s,align:r,sideOffset:a,className:(0,G.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));X.displayName=q.Content.displayName,e.s(["Popover",()=>_,"PopoverContent",()=>X,"PopoverTrigger",()=>K],90382)},51911,93752,68418,26874,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),o=e.i(5978),s=e.i(22528),n=e.i(36589),i=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[u,p]=(0,s.createContextScope)(c),[h,f]=u(c),m=r.forwardRef((e,s)=>{let{__scopeSwitch:i,name:l,checked:u,defaultChecked:p,required:f,disabled:m,value:x="on",onCheckedChange:g,form:j,...w}=e,[y,C]=r.useState(null),k=(0,o.useComposedRefs)(s,e=>C(e)),N=r.useRef(!1),P=!y||j||!!y.closest("form"),[T,S]=(0,n.useControllableState)({prop:u,defaultProp:p??!1,onChange:g,caller:c});return(0,t.jsxs)(h,{scope:i,checked:T,disabled:m,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":T,"aria-required":f,"data-state":v(T),"data-disabled":m?"":void 0,disabled:m,value:x,...w,ref:k,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{S(e=>!e),P&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),P&&(0,t.jsx)(b,{control:y,bubbles:!N.current,name:l,value:x,checked:T,required:f,disabled:m,form:j,style:{transform:"translateX(-100%)"}})]})});m.displayName=c;var x="SwitchThumb",g=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...o}=e,s=f(x,a);return(0,t.jsx)(d.Primitive.span,{"data-state":v(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:r})});g.displayName=x;var b=r.forwardRef(({__scopeSwitch:e,control:a,checked:s,bubbles:n=!0,...d},c)=>{let u=r.useRef(null),p=(0,o.useComposedRefs)(u,c),h=(0,i.usePrevious)(s),f=(0,l.useSize)(a);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==s&&t){let r=new Event("click",{bubbles:n});t.call(e,s),e.dispatchEvent(r)}},[h,s,n]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...d,tabIndex:-1,ref:p,style:{...d.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function v(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>m,"Switch",()=>m,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>p],95291);var j=e.i(95291),j=j,w=e.i(31777);function y({className:e,size:r="default",...a}){return(0,t.jsx)(j.Root,{"data-slot":"switch","data-size":r,className:(0,w.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...a,children:(0,t.jsx)(j.Thumb,{"data-slot":"switch-thumb",className:(0,w.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>y],51911);let C=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>C],93752);var k=e.i(21023);let N=(0,k.createServerReference)("00de41473554f6ec7eefdb264045e909b53eb56d53",k.callServer,void 0,k.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>N],68418);let P=(0,k.createServerReference)("60c318b6ab876fc21e5d4dd25f7ee5f825a8b5a820",k.callServer,void 0,k.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>P],26874)},41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(23925),o=e.i(11345),s=e.i(76016),n=e.i(68418),i=e.i(26874),l=e.i(86782),d=e.i(29847),c=e.i(35364),u=e.i(90382),p=e.i(31777);function h({initialAgentType:e,initialModel:h,onAgentModelChange:f,disabled:m,className:x,mode:g}){let[b,v]=r.useState(!1),[j,w]=r.useState([]),[y,C]=r.useState(!0),[k,N]=r.useState(e),[P,T]=r.useState(h),[S,R]=r.useState(null),[A,D]=r.useState(0),[F,E]=r.useState(null);r.useEffect(()=>{(0,n.getAllAgentModels)().then(w).finally(()=>C(!1))},[]),r.useEffect(()=>{if(!b){let e=setTimeout(()=>{D(0),E(null)},150);return()=>clearTimeout(e)}},[b]);let M=async(e,t)=>{if(v(!1),e!==k||t!==P){if("override"===g){N(e),T(t),f?.(e,t);return}N(e),T(t),f?.(e,t),R(null);try{let r=await (0,i.updateAgentAndModel)(e,t||null);r.ok||(N(k),T(P),f?.(k,P),R(r.error??"Failed to save"))}catch{N(k),T(P),f?.(k,P),R("Failed to save")}}},O=(0,l.getAgentTypeIcon)(k),z=j.find(e=>e.agentType===k)?.label??k,I=P?(0,d.getModelMeta)(P).displayName||P:null,L=F?j.find(e=>e.agentType===F):null;return(0,t.jsxs)("div",{className:(0,p.cn)("flex flex-col gap-1",x),children:[(0,t.jsxs)(u.Popover,{open:b,onOpenChange:v,children:[(0,t.jsx)(u.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(c.Button,{variant:"outline",role:"combobox","aria-expanded":b,disabled:(m??!1)||y,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(O,{className:"h-4 w-4 shrink-0"}),y?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:z}),I?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:I})]}):null]})]})})}),(0,t.jsx)(u.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===A?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),j.map(e=>{let r=(0,l.getAgentTypeIcon)(e.agentType),o=k===e.agentType,n=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",o&&"bg-accent/50"),onClick:()=>{n?(E(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>D(1))})):M(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),o&&!n?(0,t.jsx)(a.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,n?(0,t.jsx)(s.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:L?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{D(0),setTimeout(()=>E(null),220)},children:[(0,t.jsx)(o.ChevronLeft,{className:"h-3.5 w-3.5"}),L.label]}),L.models.map(e=>{let r=k===L.agentType&&P===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>M(L.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(a.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!S&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:S})]})}e.s(["AgentModelPicker",()=>h])},15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),o=e.i(60112),s=e.i(21023);let n=(0,s.createServerReference)("405c587498fcf213184343b35e7dfe3abe03ac0633",s.callServer,void 0,s.findSourceMapURL,"createFeature");var i=e.i(3645);let l=(0,i.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),d=(0,i.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var c=e.i(97667),u=e.i(53360),p=e.i(31777),h=e.i(8361);e.i(1650);var f=e.i(11495),m=e.i(45811),x=e.i(35364),g=e.i(98127);function b({className:e,...r}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,p.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var v=e.i(41957),j=e.i(81846),w=e.i(90382),y=e.i(51911),C=e.i(2828),k=e.i(30153),N=e.i(60253),P=e.i(15506),P=P,T=e.i(95230),T=T,S=e.i(2287),R=e.i(1693),R=R;let A=(0,i.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);var D=e.i(16298),D=D;let F=(0,i.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var E=e.i(93752),E=E;let M=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),O=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function z(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let I=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function L(e,t){let r=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${r.toString()}`}function U({name:e,size:r,mimeType:a,path:o,onRemove:s,loading:n=!1,disabled:i=!1}){let l,d,c=(l=e.lastIndexOf("."))>=0?e.slice(l).toLowerCase():"",u=M.has(c)?F:".pdf"===c?D.default:O.has(c)?E.default:A,h=".pdf"===c?"bg-red-50 text-red-600":M.has(c)?"bg-blue-50 text-blue-600":O.has(c)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",f=(d=e.lastIndexOf("."))>=0&&I.has(e.slice(d).toLowerCase());return n?(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,t.jsx)(P.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):f?(0,t.jsxs)(S.Dialog,{children:[(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(S.DialogTrigger,{asChild:!0,children:(0,t.jsx)("img",{src:L(o,a),alt:e,title:e,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!i&&(0,t.jsx)("button",{type:"button",onClick:s,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(N.X,{className:"h-3 w-3"})})]}),(0,t.jsxs)(S.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(R.Root,{children:(0,t.jsxs)(S.DialogTitle,{children:["Preview: ",e]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:L(o,a),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:z(r)})]}),(0,t.jsx)("a",{href:L(o,a),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,t.jsx)(T.default,{className:"h-4 w-4"})})]})]})]}):(0,t.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,t.jsx)("div",{className:(0,p.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",h),children:(0,t.jsx)(u,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:z(r)}),!i&&(0,t.jsx)("button",{type:"button",onClick:s,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(N.X,{className:"h-3 w-3"})})]})}var B=e.i(41413);async function $(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}let H=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]),q=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],G={allowPrd:!1,allowPlan:!1,allowMerge:!1};function _({open:e,onClose:a,onSubmit:o,repositoryPath:s,isSubmitting:n=!1,workflowDefaults:i,features:d,initialParentId:c,currentAgentType:g,currentModel:w}){let N=(0,h.useSoundAction)("create"),P=i?.approvalGates??G,T=i?.push??!1,S=i?.openPr??!1,[R,A]=(0,r.useState)(""),[D,F]=(0,r.useState)([]),[E,M]=(0,r.useState)({...P}),[O,z]=(0,r.useState)(T),[I,L]=(0,r.useState)(S),[_,X]=(0,r.useState)(void 0),[V,W]=(0,r.useState)(!1),[Z,J]=(0,r.useState)(void 0),[Y,Q]=(0,r.useState)(void 0),[ee,et]=(0,r.useState)(!1),[er,ea]=(0,r.useState)(null),eo=(0,r.useRef)(crypto.randomUUID()),es=(0,r.useRef)(0);(0,r.useEffect)(()=>{i&&(M({...i.approvalGates}),z(i.push),L(i.openPr))},[i]),(0,r.useEffect)(()=>{e&&c&&X(c)},[e,c]);let en=(0,r.useCallback)(()=>{A(""),F([]),M({...P}),z(T),L(S),X(void 0),W(!1),J(void 0),Q(void 0),ea(null),es.current=0,et(!1)},[P,T,S]),ei=""!==R.trim()||D.length>0,{attemptClose:el}=(0,k.useGuardedDrawerClose)({open:e,isDirty:ei,onClose:a,onReset:en}),ed=(0,r.useCallback)(async e=>{for(let t of(ea(null),e)){if(t.size>0xa00000)return void ea(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!H.has(e))return void ea(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();F(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let r=new FormData;r.append("file",t),r.append("sessionId",eo.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),ea(t.error??"Upload failed");return}let o=await a.json();F(t=>t.some(t=>t.id!==e&&t.path===o.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...o,id:e,loading:!1}:t))}catch{F(t=>t.filter(t=>t.id!==e)),ea("Upload failed")}}},[]),ec=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),es.current+=1,1===es.current&&et(!0)},[]),eu=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),es.current-=1,0===es.current&&et(!1)},[]),ep=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eh=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),es.current=0,et(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&ed(t)},[ed]),ef=(0,r.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),ed(r))},[ed]),em=(0,r.useCallback)(e=>{e.preventDefault(),R.trim()&&(N.play(),o({description:R.trim(),attachments:D.filter(e=>!e.loading),repositoryPath:s,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:O||I,openPr:I,fast:V,...Z?{agentType:Z}:{},...Y?{model:Y}:{},..._?{parentId:_}:{},sessionId:eo.current}),en())},[R,D,E,s,o,O,I,V,Z,Y,_,N,en]),ex=(0,r.useCallback)(async()=>{try{let e=await $();if(!e)return;for(let t of e){let e=crypto.randomUUID();F(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let r=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:eo.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),ea(t.error??"Upload failed");return}let a=await r.json();F(t=>t.some(t=>t.id!==e&&t.path===a.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...a,id:e,loading:!1}:t))}catch{F(t=>t.filter(t=>t.id!==e)),ea("Upload failed")}}}catch{}},[]),eg=(0,r.useCallback)(e=>{F(t=>t.filter(t=>t.id!==e))},[]),eb=(0,r.useRef)(null),ev=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),eb.current?.requestSubmit())},[]),ej=d&&d.length>0;return(0,t.jsx)(f.BaseDrawer,{open:e,onClose:el,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(m.DrawerTitle,{children:"NEW FEATURE"})]}),n?(0,t.jsx)(m.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(j.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:el,disabled:n,children:"Cancel"}),(0,t.jsx)(x.Button,{type:"submit",form:"create-feature-form",disabled:!R.trim()||n,children:n?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(C.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:eb,id:"create-feature-form",onSubmit:em,className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":ee?"true":"false",onDragEnter:ec,onDragLeave:eu,onDragOver:ep,onDrop:eh,className:(0,p.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",ee&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(v.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,t.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,t.jsx)(b,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:R,onChange:e=>A(e.target.value),onKeyDown:ev,onPaste:ef,required:!0,disabled:n,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),D.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:D.map(e=>(0,t.jsx)(U,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>eg(e.id),disabled:n,loading:e.loading},e.id))}),er?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:er}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(B.AgentModelPicker,{initialAgentType:Z??g??"claude-code",initialModel:Y??w??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{J(e),Q(t)},disabled:n,className:"w-55"}),(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(y.Switch,{id:"fast-mode",checked:V,onCheckedChange:W,disabled:n}),(0,t.jsxs)(v.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(u.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,t.jsx)(C.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:ex,disabled:n,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(l,{className:"h-4 w-4"})})}),(0,t.jsx)(C.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),ej&&void 0!==c?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(v.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(K,{features:d,value:_,onChange:X,disabled:n})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"APPROVE"})}),(0,t.jsx)(C.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:q.map(e=>(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(y.Switch,{id:`approve-${e.id}`,size:"sm",checked:E[e.id]??!1,onCheckedChange:t=>M(r=>({...r,[e.id]:t})),disabled:n||V&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(v.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(C.TooltipContent,{side:"bottom",children:V&&("allowPrd"===e.id||"allowPlan"===e.id)?"Skipped in Fast Mode":e.description})]},e.id))}),(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=q.every(e=>E[e.id]),t={};for(let r of q)t[r.id]=!e;M(t)},disabled:n,className:(0,p.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",q.every(e=>E[e.id])&&"text-primary"),children:"All"})}),(0,t.jsx)(C.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(y.Switch,{id:"push",size:"sm",checked:O||I,onCheckedChange:e=>{z(e),!e&&I&&L(!1)},disabled:n}),(0,t.jsx)(v.Label,{htmlFor:"push",className:"cursor-pointer text-xs font-medium",children:"Push"})]})}),(0,t.jsx)(C.TooltipContent,{side:"bottom",children:"Push branch to remote after implementation."})]}),(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(y.Switch,{id:"open-pr",size:"sm",checked:I,onCheckedChange:L,disabled:n}),(0,t.jsx)(v.Label,{htmlFor:"open-pr",className:"cursor-pointer text-xs font-medium",children:"PR"})]})}),(0,t.jsx)(C.TooltipContent,{side:"bottom",children:"Open a pull request after pushing."})]})]})]})]})]})})})})}function K({features:e,value:a,onChange:o,disabled:s}){let[n,i]=(0,r.useState)(!1),[l,u]=(0,r.useState)(""),h=(0,r.useRef)(null),f=e.find(e=>e.id===a),m=l.trim()?e.filter(e=>e.name.toLowerCase().includes(l.toLowerCase())||e.id.toLowerCase().includes(l.toLowerCase())):e,x=(0,r.useCallback)(e=>{o(e),i(!1),u("")},[o]);return(0,r.useEffect)(()=>{n?setTimeout(()=>h.current?.focus(),0):u("")},[n]),(0,t.jsxs)(w.Popover,{open:n,onOpenChange:i,children:[(0,t.jsx)(w.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":n,"aria-label":"Parent Feature",disabled:s,"data-testid":"parent-feature-combobox",className:(0,p.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!f&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:f?`${f.name} (${f.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(d,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(w.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(g.Input,{ref:h,placeholder:"Search features...",value:l,onChange:e=>u(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>x(void 0),className:(0,p.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(c.CheckIcon,{className:(0,p.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===m.length&&l?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>x(e.id),className:(0,p.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(c.CheckIcon,{className:(0,p.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function X({repositoryPath:e,initialParentId:s,features:i,workflowDefaults:l,currentAgentType:d,currentModel:c}){let u=(0,a.useRouter)(),[p,h]=(0,r.useState)(!1),f=(0,a.usePathname)().startsWith("/create"),m=!p&&f;(0,r.useEffect)(()=>{!f&&p&&h(!1)},[f,p]);let x=(0,r.useCallback)(()=>{u.push("/")},[u]),g=(0,r.useCallback)(e=>{h(!0),u.push("/"),n(e).then(t=>{t.error?o.toast.error(t.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{o.toast.error("Failed to create feature"),h(!1)})},[u]);return(0,t.jsx)(_,{open:m,onClose:x,onSubmit:g,repositoryPath:e,features:i,workflowDefaults:l,initialParentId:s,isSubmitting:p,currentAgentType:d,currentModel:c})}e.s(["CreateDrawerClient",()=>X],15203)}]);
|