@taskforcehq/taskforce 0.3.330 → 0.3.332
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/README.md +7 -2
- package/dist/components/features/agentCapabilities/AgentCapabilitiesPrototype.d.ts +2 -2
- package/dist/components/features/agentCapabilities/AgentCapabilitiesPrototype.js +2 -2
- package/dist/components/features/planning/PlanningModule.js +15 -3
- package/dist/components/features/planning/planningMetadata.d.ts +10 -0
- package/dist/components/features/planning/planningMetadata.js +8 -0
- package/dist/components/views/StandaloneLayout.js +35 -1
- package/dist/components/views/panels/PlanningDrawer.d.ts +2 -1
- package/dist/components/views/panels/PlanningDrawer.js +12 -8
- package/dist/config/envSchema.js +7 -0
- package/dist/core/McpTokenService.d.ts +2 -0
- package/dist/core/McpTokenService.js +13 -5
- package/dist/core/Taskforce.d.ts +11 -3
- package/dist/core/Taskforce.js +33 -3
- package/dist/core/types.d.ts +1 -0
- package/dist/documentReviews/DocumentReviewCommentStore.d.ts +2 -0
- package/dist/documentReviews/DocumentReviewCommentStore.js +28 -9
- package/dist/mcp/httpProtocolRouting.d.ts +1 -0
- package/dist/mcp/httpProtocolRouting.js +8 -5
- package/dist/mcp/runtime.js +24 -5
- package/dist/mcp/taskPlanningRegistrar.js +2 -2
- package/dist/mcp/toolProfiles.js +1 -0
- package/dist/mcp/toolRegistry.js +8 -8
- package/dist/server/buildInfo.d.ts +1 -0
- package/dist/server/buildInfo.js +5 -1
- package/dist/server/cloudMcpCapacityTelemetry.d.ts +68 -0
- package/dist/server/cloudMcpCapacityTelemetry.js +221 -0
- package/dist/server/localWorkspaceSyncServerRuntime.js +13 -5
- package/dist/server/routes/admin.js +14 -2
- package/dist/server/routes/shared.d.ts +3 -0
- package/dist/server/routes/shared.js +280 -240
- package/dist/service/localServiceCli.d.ts +2 -2
- package/dist/service/localServiceCli.js +4 -3
- package/dist/services/executorPhaseAIssuerCore.d.ts +13 -0
- package/dist/services/executorPhaseAIssuerCore.js +107 -0
- package/dist/services/taskforceAgentMcpBridge.d.ts +1 -1
- package/dist/services/taskforceAgentMcpBridge.js +35 -5
- package/dist/shared/executorPhaseASchemaValidation.js +1 -1
- package/dist/storage/postgresAdapter.js +3 -1
- package/dist/storage/postgresRequestDiagnostics.d.ts +9 -1
- package/dist/storage/postgresRequestDiagnostics.js +15 -2
- package/dist/storage/postgresWorker.js +13 -3
- package/dist/storage/postgresWorkerProtocol.d.ts +6 -0
- package/dist/storage/workflowStore.d.ts +2 -0
- package/dist/storage/workflowStore.js +39 -2
- package/dist/sync/cloudSyncApi.js +4 -2
- package/dist/sync/collaborationSyncState.js +5 -0
- package/dist/sync/coordinator/localWorkspaceSyncRunner.d.ts +3 -1
- package/dist/sync/coordinator/localWorkspaceSyncRunner.js +18 -0
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.js +2 -0
- package/dist/sync/syncApplyHandlers.d.ts +1 -0
- package/dist/sync/syncApplyHandlers.js +72 -15
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.d.ts +7 -7
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.js +50 -13
- package/dist/sync/v3/localOutboxRecoveryPreparationService.js +8 -2
- package/dist/sync/v3/localTaskCreateOutboxService.d.ts +3 -1
- package/dist/sync/v3/localTaskCreateOutboxService.js +6 -1
- package/dist/sync/v3/localTaskDeleteOutboxService.js +1 -0
- package/dist/sync/v3/localTaskLifecycleOutboxService.d.ts +2 -1
- package/dist/sync/v3/localTaskLifecycleOutboxService.js +5 -1
- package/dist/sync/v3/localTaskMetadataOutboxService.d.ts +2 -1
- package/dist/sync/v3/localTaskMetadataOutboxService.js +6 -2
- package/dist/sync/v3/localTaskStatusOutboxService.d.ts +2 -1
- package/dist/sync/v3/localTaskStatusOutboxService.js +20 -5
- package/dist/sync/v3/syncDurabilityStore.d.ts +2 -1
- package/dist/sync/v3/syncDurabilityStore.js +34 -6
- package/dist/sync/v3/workflowRuntimeMutationService.d.ts +5 -0
- package/dist/sync/v3/workflowRuntimeMutationService.js +124 -71
- package/dist/sync/v3/workspaceSyncV3CombinedLocalApply.js +25 -3
- package/dist/sync/v3/workspaceSyncV3Feed.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3Feed.js +6 -1
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.d.ts +2 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.js +49 -18
- package/dist/sync/v3/workspaceSyncV3WorkflowRuntimeApply.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowRuntimeApply.js +50 -5
- package/dist/ui/assets/{AiIdentityRosterCard-OcSz1PkK.js → AiIdentityRosterCard-CDMPtnbC.js} +1 -1
- package/dist/ui/assets/{AiProfilesModule-ByhYW5Xi.js → AiProfilesModule-Cww85C4E.js} +1 -1
- package/dist/ui/assets/{AnnotatedAttachmentWorkspace-BTM6nIg_.js → AnnotatedAttachmentWorkspace-Dt9TKYSH.js} +1 -1
- package/dist/ui/assets/{AssetTraySortControl-DabEG8L4.js → AssetTraySortControl-CKgapnxu.js} +1 -1
- package/dist/ui/assets/{ContextAttachmentManager-Coa8yVGM.js → ContextAttachmentManager-T-cEVcOZ.js} +2 -2
- package/dist/ui/assets/{DocumentWorkspace-BB0qhdix.js → DocumentWorkspace-HD4MUjAZ.js} +1 -1
- package/dist/ui/assets/{EntityActivityTimeline-CZ8x4UJE.js → EntityActivityTimeline-_V0zfMuh.js} +1 -1
- package/dist/ui/assets/PlanningModule-mTkBygsB.js +1 -0
- package/dist/ui/assets/{PlansPage-D86pZSSl.js → PlansPage-Btiq06VO.js} +1 -1
- package/dist/ui/assets/{TaskContextUpload-BVIkU9yT.js → TaskContextUpload-C00NVUpn.js} +1 -1
- package/dist/ui/assets/{TaskSettings-Cv1mNhv_.js → TaskSettings-Cp-L-4xh.js} +1 -1
- package/dist/ui/assets/{TaskforceAgentsModule-gmH-PD2q.js → TaskforceAgentsModule-Coq9-PUp.js} +2 -2
- package/dist/ui/assets/{WorkflowManagerModule-DbfnHJ-f.js → WorkflowManagerModule-CuqRzMmM.js} +1 -1
- package/dist/ui/assets/index-DSQINwt9.js +7 -0
- package/dist/ui/index.html +1 -1
- package/package.json +3 -1
- package/dist/ui/assets/PlanningModule-pRPjR7v5.js +0 -1
- package/dist/ui/assets/index-CTsDBaef.js +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as ue,j as e,r as s,s as Ds}from"./vendor-react-CKJs5o3c.js";import{j as vn,k as et,m as tt,o as Gn,f as U,t as me,p as Jn,q as Qn,s as $s,u as Ms,v as Bs,R as Ls,w as Lt,M as Fs,x as Yn,y as Xn,z as Zn}from"./index-CTsDBaef.js";import{A as Ps,a as zs}from"./AssetTraySortControl-DabEG8L4.js";import{a0 as Os,ak as Hs,S as Ws,a_ as Vs,R as dn,aW as Us,a$ as Ks,g as qs,a9 as un,N as Gs,au as mn,X as hn,b0 as es,s as Ft,y as ht,b1 as Js,b2 as Qs,a as Ys,x as Xs,b3 as Zs,b4 as er,b5 as tr,a7 as ut,b6 as nr,aZ as Bt,a6 as sr,a5 as rr,b7 as ts,a1 as ar,b8 as or,r as ns,t as ir,A as lr,O as cr,J as dr,K as ur,b9 as mr}from"./vendor-icons-Bsq-mcEn.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";const hr="_index_1ya8h_1",fr="_header_1ya8h_8",pr="_title_1ya8h_23",vr="_search_1ya8h_35",wr="_searchIcon_1ya8h_41",gr="_searchInput_1ya8h_50",yr="_sortControlRow_1ya8h_67",br="_filters_1ya8h_74",_r="_filtersHeader_1ya8h_83",xr="_filtersTitle_1ya8h_90",Cr="_filterControls_1ya8h_102",kr="_list_1ya8h_114",Sr="_state_1ya8h_126",Rr="_stateError_1ya8h_134",jr="_item_1ya8h_141",Nr="_itemActive_1ya8h_163",Tr="_itemIcon_1ya8h_173",Er="_pinButton_1ya8h_183",Ar="_pinButtonActive_1ya8h_205",Ir="_itemBody_1ya8h_209",Dr="_itemTitle_1ya8h_217",$r="_itemTask_1ya8h_229",Mr="_itemBadge_1ya8h_240",Br="_itemMeta_1ya8h_253",Lr="_itemMetaDetails_1ya8h_264",Fr="_itemMetaReference_1ya8h_271",E={index:hr,header:fr,title:pr,search:vr,searchIcon:wr,searchInput:gr,sortControlRow:yr,filters:br,filtersHeader:_r,filtersTitle:xr,filterControls:Cr,list:kr,state:Sr,stateError:Rr,item:jr,itemActive:Nr,itemIcon:Tr,pinButton:Er,pinButtonActive:Ar,itemBody:Ir,itemTitle:Dr,itemTask:$r,itemBadge:Mr,itemMeta:Br,itemMetaDetails:Lr,itemMetaReference:Fr};function fn(n){let l=n;try{l=decodeURIComponent(n)}catch{l=n}return l.trim().replace(/\\/g,"/").replace(/^\/+/,"").replace(/^\.\//,"").replace(/^\.taskforce\//,"")}function Xe(n,l){const h=String(l||"").trim();if(!h)return n;const i=n.includes("?")?"&":"?";return`${n}${i}workspaceId=${encodeURIComponent(h)}`}function Pr(n,l){return!!(n===l||n.endsWith(`/${l}`)||l.endsWith(`/${n}`))}function ss(n){const l=fn(String(n||""));if(!l)return null;const h=l.match(/(^|\/)(asset-[a-f0-9]{32})(?=[^/]*$)/i);return h?.[2]?h[2].toLowerCase():null}function is(n){return Array.isArray(n.targets)?n.targets.length:typeof n.attachmentCount=="number"&&Number.isFinite(n.attachmentCount)?Math.max(0,Math.floor(n.attachmentCount)):n.taskId?1:0}function wn(n){return Array.isArray(n.targets)?n.targets.length>0?"attached":"unattached":n.attachmentState==="attached"||n.attachmentState==="unattached"?n.attachmentState:is(n)>0?"attached":"unattached"}function zr(n,l,h,i){const d=l.trim().toLowerCase();return n.filter(c=>{const b=[vn(c),c.title,c.originalFilename,c.referenceLabel,c.referenceNumber].filter(j=>j!=null).join(" ").toLowerCase(),k=d.length===0||b.includes(d),S=h.length===0||h.includes(c.docType),I=wn(c),T=i.length===0||i.includes(I);return k&&S&&T})}function Or({docType:n}){switch(n){case"implementation-plan":return e.jsx(Gs,{size:13});case"review":return e.jsx(un,{size:13});case"walkthrough":return e.jsx(qs,{size:13});default:return e.jsx(Ks,{size:13})}}function Hr(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function Wr(n){if(!n)return"";const l=new Date(n),i=new Date().getTime()-l.getTime(),d=Math.floor(i/(1e3*60*60*24));return d===0?"Today":d===1?"Yesterday":d<7?`${d}d ago`:d<30?`${Math.floor(d/7)}w ago`:l.toLocaleDateString()}function Vr(n,l){n.key!=="Enter"&&n.key!==" "||(n.preventDefault(),l())}function an(n,l=!1){return n==="initiative"?l?"initiatives":"initiative":n==="workstream"?l?"workstreams":"workstream":l?"tasks":"task"}function Ur(n,l){const h=n.targets;if(Array.isArray(h)){if(h.length===0)return null;const c=[...new Map(h.map(b=>[`${b.targetType}:${b.targetId}`,b])).values()];if(h.length!==c.length){if(c.length===1){const b=c[0],k=b.title||b.referenceLabel||an(b.targetType);return`${h.length} links to ${k}`}return`${h.length} links across ${c.length} items`}if(c.length===1){const b=c[0];return b.title||b.referenceLabel||`1 ${an(b.targetType)} linked`}return new Set(c.map(b=>b.targetType)).size===1?`${c.length} ${an(c[0].targetType,!0)} linked`:`${c.length} items linked`}const i=is(n),d=n.taskId?l.get(n.taskId):null;return i>1?`${i} tasks linked`:i===1?d?.title||"1 task linked":null}function Kr({documents:n,selectedDocId:l,loading:h,error:i,searchQuery:d,sortField:c,sortOrder:p,pinnedDocIds:b=[],onTogglePinnedDoc:k,taskById:S,onSearchChange:I,onSelect:T,onCloseTray:j,onSortFieldChange:J,onSortOrderChange:Q,hasActiveFilters:$,typeFilters:ie,attachmentFilters:z,onTypeFiltersChange:N,onAttachmentFiltersChange:H,listScrollTop:Y=0,onListScrollChange:X}){const L=ue.useRef(null),x=ue.useRef(null),R=ue.useRef(null),O=ue.useRef(X);ue.useEffect(()=>{O.current=X},[X]),ue.useEffect(()=>{const w=L.current;if(!w)return;const re=Math.max(0,Math.round(Y));Math.abs(w.scrollTop-re)<=1||(w.scrollTop=re)},[n.length,i,Y,h]),ue.useEffect(()=>()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[]);const W=ue.useCallback(()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null);const w=x.current;x.current=null,w!==null&&O.current?.(w)},[]),K=ue.useCallback(w=>{x.current=Math.max(0,Math.round(w)),R.current===null&&(R.current=window.setTimeout(W,200))},[W]),le=+(ie.length!==et.length)+ +(z.length!==tt.length),Ne=`${le} active document ${le===1?"filter":"filters"}`,we=()=>{N(et.map(w=>w.value)),H(tt.map(w=>w.value))};return e.jsxs("div",{className:E.index,children:[e.jsxs("div",{className:E.header,children:[e.jsxs("span",{className:E.title,children:[e.jsx(Os,{size:14}),"Documents"]}),j?e.jsx("button",{type:"button",className:"tf-control-icon",onClick:j,title:"Collapse document tray","aria-label":"Collapse document tray",children:e.jsx(Hs,{size:16})}):null]}),e.jsxs("div",{className:E.search,children:[e.jsx(Ws,{size:12,className:E.searchIcon}),e.jsx("input",{type:"text",placeholder:"Search documents…",value:d,onChange:w=>I(w.target.value),className:E.searchInput})]}),e.jsx("div",{className:E.sortControlRow,children:e.jsx(Ps,{field:c,order:p,onFieldChange:J,onOrderChange:Q})}),e.jsxs("section",{className:E.filters,"aria-label":"Document filters",children:[e.jsxs("div",{className:E.filtersHeader,children:[e.jsxs("span",{className:E.filtersTitle,children:[e.jsx(Vs,{size:12,"aria-hidden":"true"}),"Filters",le>0?e.jsx("span",{className:"tf-chip-count","aria-label":Ne,children:le}):null]}),e.jsx("button",{type:"button",className:"tf-control-icon",onClick:we,disabled:le===0,"aria-label":"Reset document filters",title:"Reset document filters",children:e.jsx(dn,{size:13,"aria-hidden":"true"})})]}),e.jsxs("div",{className:E.filterControls,children:[e.jsx(Gn,{label:"Attachment",options:tt,selected:z,onChange:w=>H(w),variant:"value",containerStyle:{minWidth:0}}),e.jsx(Gn,{label:"Type",options:et,selected:ie,onChange:w=>N(w),variant:"value",containerStyle:{minWidth:0}})]})]}),e.jsxs("div",{ref:L,className:`${E.list} tf-scrollbar tf-tray-scroll-viewport`,"data-testid":"doc-index-list",onScroll:w=>K(w.currentTarget.scrollTop),children:[h&&e.jsx("div",{className:E.state,children:"Loading documents…"}),!h&&i&&e.jsx("div",{className:E.stateError,children:i}),!h&&!i&&n.length===0&&e.jsx("div",{className:E.state,children:$?"No documents match your filters.":"No documents found. Documents added as task attachments will appear here."}),!h&&n.map(w=>{const re=w.assetId===l,A=b.includes(w.assetId),M=vn(w),q=wn(w),Ce=Ur(w,S);return e.jsxs("div",{role:"button",tabIndex:0,className:`${E.item} ${re?E.itemActive:""}`,onClick:()=>T(w),onKeyDown:fe=>Vr(fe,()=>T(w)),children:[e.jsx("div",{className:E.itemIcon,children:e.jsx(Or,{docType:w.docType})}),e.jsxs("div",{className:E.itemBody,children:[e.jsx("span",{className:E.itemTitle,title:M,children:M}),q==="unattached"&&e.jsx("span",{className:E.itemBadge,children:"Unattached"}),Ce&&e.jsx("span",{className:E.itemTask,title:Ce,children:Ce}),e.jsxs("span",{className:E.itemMeta,children:[e.jsxs("span",{className:E.itemMetaDetails,children:[Hr(w.sizeBytes),w.updatedAt&&e.jsxs(e.Fragment,{children:[" · ",Wr(w.updatedAt)]})]}),w.referenceLabel&&e.jsx("span",{className:E.itemMetaReference,children:w.referenceLabel})]})]}),k?e.jsx("button",{type:"button",className:`${E.pinButton} ${A?E.pinButtonActive:""}`.trim(),"aria-label":A?"Unpin document":"Pin document",title:A?`Unpin ${M}`:`Pin ${M}`,"aria-pressed":A,onClick:fe=>{fe.stopPropagation(),k(w.assetId)},onKeyDown:fe=>fe.stopPropagation(),children:e.jsx(Us,{size:14,fill:A?"currentColor":"none"})}):null]},w.assetId)})]})]})}const qr="_viewer_1glbl_1",Gr="_viewerMonochrome_1glbl_10",Jr="_metaDocumentName_1glbl_10",Qr="_viewerEditMode_1glbl_14",Yr="_meta_1glbl_10",Xr="_metaLeft_1glbl_30",Zr="_metaRenameRow_1glbl_49",ea="_typeBadge_1glbl_56",ta="_typeBadgeImplementationPlan_1glbl_71",na="_typeBadgeReview_1glbl_77",sa="_typeBadgeWalkthrough_1glbl_83",ra="_metaTaskName_1glbl_89",aa="_statusBadge_1glbl_98",oa="_metaDate_1glbl_113",ia="_metaSize_1glbl_114",la="_actions_1glbl_122",ca="_actionBtn_1glbl_129",da="_dangerBtn_1glbl_156",ua="_generateBtn_1glbl_167",ma="_editBtn_1glbl_178",ha="_saveBtn_1glbl_189",fa="_layoutToggle_1glbl_205",pa="_layoutBtn_1glbl_213",va="_layoutBtnActive_1glbl_229",wa="_saveStatus_1glbl_234",ga="_saveStatusSaved_1glbl_241",ya="_saveStatusError_1glbl_245",ba="_unsaved_1glbl_250",_a="_viewerContent_1glbl_256",xa="_viewerBody_1glbl_265",Ca="_viewerBodyFullWidth_1glbl_274",ka="_viewerMain_1glbl_278",Sa="_reviewRail_1glbl_286",Ra="_reviewSection_1glbl_292",ja="_reviewHeader_1glbl_299",Na="_reviewHeaderTop_1glbl_309",Ta="_reviewHeaderActions_1glbl_316",Ea="_reviewCloseButton_1glbl_322",Aa="_reviewEyebrow_1glbl_326",Ia="_reviewSubtitle_1glbl_334",Da="_reviewMetadataRow_1glbl_341",$a="_reviewMetadata_1glbl_341",Ma="_reviewSessionTitle_1glbl_355",Ba="_reviewEmptyHeading_1glbl_356",La="_reviewSessionDetails_1glbl_366",Fa="_reviewVersionDetails_1glbl_375",Pa="_reviewDraftNotice_1glbl_383",za="_reviewVersionNotice_1glbl_384",Oa="_reviewControls_1glbl_406",Ha="_reviewCreateButton_1glbl_415",Wa="_reviewResolutionAction_1glbl_416",Va="_reviewSelect_1glbl_431",Ua="_reviewTitleEditRow_1glbl_438",Ka="_reviewTitleInput_1glbl_444",qa="_reviewWorkspace_1glbl_451",Ga="_reviewThread_1glbl_459",Ja="_reviewNewCommentsBar_1glbl_469",Qa="_reviewEmptyState_1glbl_477",Ya="_reviewComment_1glbl_490",Xa="_reviewCommentThread_1glbl_511",Za="_reviewReplies_1glbl_517",eo="_reviewReply_1glbl_526",to="_reviewThreadActions_1glbl_531",no="_reviewReplyComposer_1glbl_540",so="_reviewReplyInput_1glbl_548",ro="_reviewReplyComposerActions_1glbl_553",ao="_reviewCommentHeader_1glbl_559",oo="_reviewCommentAvatar_1glbl_566",io="_reviewCommentAuthor_1glbl_578",lo="_reviewCommentTime_1glbl_588",co="_reviewCommentActions_1glbl_594",uo="_reviewCommentHeaderControls_1glbl_600",mo="_reviewCommentAction_1glbl_594",ho="_reviewCommentDeleteAction_1glbl_616",fo="_reviewAnchorLabel_1glbl_622",po="_reviewAnchorRow_1glbl_637",vo="_reviewAnchorMoved_1glbl_645",wo="_reviewAnchorUnresolved_1glbl_646",go="_reviewAnchorUnknown_1glbl_647",yo="_reviewCommentBody_1glbl_675",bo="_reviewCommentEditor_1glbl_691",_o="_reviewCommentEditInput_1glbl_698",xo="_reviewComposerArea_1glbl_703",Co="_reviewComposerRow_1glbl_713",ko="_reviewComposerInput_1glbl_719",So="_reviewSendButton_1glbl_728",Ro="_reviewComposerHint_1glbl_735",jo="_reviewResolvedComposer_1glbl_740",No="_reviewResolvedIcon_1glbl_751",To="_reviewResolvedCopy_1glbl_762",Eo="_reviewAnchorChip_1glbl_776",Ao="_reviewAnchorSnippet_1glbl_789",Io="_reviewAnchorClear_1glbl_799",Do="_viewerState_1glbl_814",$o="_viewerStateError_1glbl_821",Mo="_editorArea_1glbl_828",Bo="_editorPane_1glbl_834",Lo="_editorLayoutSplit_1glbl_842",Fo="_previewPane_1glbl_843",Po="_editorLayoutEditor_1glbl_847",zo="_editorLayoutPreview_1glbl_848",Oo="_editorPaneLabel_1glbl_852",Ho="_editorTextarea_1glbl_864",Wo="_markdownSurface_1glbl_906",Vo="_readerSurface_1glbl_911",Uo="_attachModalBody_1glbl_1040",Ko="_attachModalCopy_1glbl_1047",qo="_attachModalError_1glbl_1054",Go="_attachTaskList_1glbl_1067",Jo="_attachTaskRow_1glbl_1076",Qo="_attachTaskTitle_1glbl_1103",Yo="_attachTaskInfo_1glbl_1109",Xo="_attachTaskReference_1glbl_1117",Zo="_attachTaskMeta_1glbl_1124",ei="_attachEmptyState_1glbl_1131",a={viewer:qr,viewerMonochrome:Gr,metaDocumentName:Jr,viewerEditMode:Qr,meta:Yr,metaLeft:Xr,metaRenameRow:Zr,typeBadge:ea,typeBadgeImplementationPlan:ta,typeBadgeReview:na,typeBadgeWalkthrough:sa,metaTaskName:ra,statusBadge:aa,metaDate:oa,metaSize:ia,actions:la,actionBtn:ca,dangerBtn:da,generateBtn:ua,editBtn:ma,saveBtn:ha,layoutToggle:fa,layoutBtn:pa,layoutBtnActive:va,saveStatus:wa,saveStatusSaved:ga,saveStatusError:ya,unsaved:ba,viewerContent:_a,viewerBody:xa,viewerBodyFullWidth:Ca,viewerMain:ka,reviewRail:Sa,reviewSection:Ra,reviewHeader:ja,reviewHeaderTop:Na,reviewHeaderActions:Ta,reviewCloseButton:Ea,reviewEyebrow:Aa,reviewSubtitle:Ia,reviewMetadataRow:Da,reviewMetadata:$a,reviewSessionTitle:Ma,reviewEmptyHeading:Ba,reviewSessionDetails:La,reviewVersionDetails:Fa,reviewDraftNotice:Pa,reviewVersionNotice:za,reviewControls:Oa,reviewCreateButton:Ha,reviewResolutionAction:Wa,reviewSelect:Va,reviewTitleEditRow:Ua,reviewTitleInput:Ka,reviewWorkspace:qa,reviewThread:Ga,reviewNewCommentsBar:Ja,reviewEmptyState:Qa,reviewComment:Ya,reviewCommentThread:Xa,reviewReplies:Za,reviewReply:eo,reviewThreadActions:to,reviewReplyComposer:no,reviewReplyInput:so,reviewReplyComposerActions:ro,reviewCommentHeader:ao,reviewCommentAvatar:oo,reviewCommentAuthor:io,reviewCommentTime:lo,reviewCommentActions:co,reviewCommentHeaderControls:uo,reviewCommentAction:mo,reviewCommentDeleteAction:ho,reviewAnchorLabel:fo,reviewAnchorRow:po,reviewAnchorMoved:vo,reviewAnchorUnresolved:wo,reviewAnchorUnknown:go,reviewCommentBody:yo,reviewCommentEditor:bo,reviewCommentEditInput:_o,reviewComposerArea:xo,reviewComposerRow:Co,reviewComposerInput:ko,reviewSendButton:So,reviewComposerHint:Ro,reviewResolvedComposer:jo,reviewResolvedIcon:No,reviewResolvedCopy:To,reviewAnchorChip:Eo,reviewAnchorSnippet:Ao,reviewAnchorClear:Io,viewerState:Do,viewerStateError:$o,editorArea:Mo,editorPane:Bo,editorLayoutSplit:Lo,previewPane:Fo,editorLayoutEditor:Po,editorLayoutPreview:zo,editorPaneLabel:Oo,editorTextarea:Ho,markdownSurface:Wo,readerSurface:Vo,attachModalBody:Uo,attachModalCopy:Ko,attachModalError:qo,attachTaskList:Go,attachTaskRow:Jo,attachTaskTitle:Qo,attachTaskInfo:Yo,attachTaskReference:Xo,attachTaskMeta:Zo,attachEmptyState:ei},ti="_overlay_1unik_1",ni="_modal_1unik_12",si="_header_1unik_16",ri="_title_1unik_20",ai="_docName_1unik_24",oi="_body_1unik_34",ii="_state_1unik_41",li="_stateError_1unik_52",ci="_stateDone_1unik_63",di="_toolbar_1unik_84",ui="_toolbarCount_1unik_95",mi="_toolbarActions_1unik_100",hi="_tree_1unik_105",fi="_taskRow_1unik_113",pi="_taskRowDimmed_1unik_126",vi="_taskCheck_1unik_130",wi="_taskExpandBtn_1unik_139",gi="_taskExpandSpacer_1unik_155",yi="_taskTitle_1unik_160",bi="_taskBadge_1unik_169",_i="_footer_1unik_179",D={overlay:ti,modal:ni,header:si,title:ri,docName:ai,body:oi,state:ii,stateError:li,stateDone:ci,toolbar:di,toolbarCount:ui,toolbarActions:mi,tree:hi,taskRow:fi,taskRowDimmed:pi,taskCheck:vi,taskExpandBtn:wi,taskExpandSpacer:gi,taskTitle:yi,taskBadge:bi,footer:_i},xi={1:"Low",2:"Medium",3:"High"};function ft(n,l){return n.map(h=>({...h,selected:l,children:ft(h.children,l)}))}function ls(n,l,h){return n.map(i=>i.idempotencyKey===l?{...i,selected:h,children:ft(i.children,h)}:{...i,children:ls(i.children,l,h)})}function pn(n){let l=0;for(const h of n)h.selected&&l++,l+=pn(h.children);return l}function cs({node:n,depth:l,onToggle:h}){const[i,d]=s.useState(!0),c=n.children.length>0,p=l*20;return e.jsxs("div",{children:[e.jsxs("div",{className:`${D.taskRow} ${n.selected?"":D.taskRowDimmed}`,style:{paddingLeft:`${12+p}px`},children:[e.jsx("button",{className:D.taskCheck,onClick:()=>h(n.idempotencyKey,!n.selected),title:n.selected?"Deselect":"Select",children:n.selected?e.jsx(Js,{size:14,style:{color:"var(--brand-primary-strong)"}}):e.jsx(Qs,{size:14,style:{color:"var(--text-muted)"}})}),c?e.jsx("button",{className:D.taskExpandBtn,onClick:()=>d(b=>!b),children:i?e.jsx(Ys,{size:12}):e.jsx(Xs,{size:12})}):e.jsx("span",{className:D.taskExpandSpacer}),e.jsx("span",{className:D.taskTitle,title:n.description||void 0,children:n.title}),e.jsx("span",{className:D.taskBadge,style:{color:Jn(n.type),borderColor:Jn(n.type)},children:n.type}),e.jsx("span",{className:D.taskBadge,style:{color:Qn(n.priority),borderColor:Qn(n.priority)},children:xi[n.priority]})]}),c&&i&&e.jsx("div",{children:n.children.map(b=>e.jsx(cs,{node:b,depth:l+1,onToggle:h},b.idempotencyKey))})]})}function Ci({content:n,docTitle:l,apiBaseUrl:h="",onClose:i,onGenerated:d}){const[c,p]=s.useState("preview"),[b,k]=s.useState(null),[S,I]=s.useState([]),[T,j]=s.useState(!0),[J,Q]=s.useState(0),[$,ie]=s.useState(null),z=s.useRef(null);s.useEffect(()=>{let x=!1;return j(!0),k(null),U("/api/taskforce/documents/generate-tasks/preview",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n})},h).then(R=>R.json()).then(R=>{if(!x){if(R.error)throw new Error(R.error);I(R.tasks||[]),p("preview")}}).catch(R=>{x||(k(R?.message||"Failed to parse plan"),p("error"))}).finally(()=>{x||j(!1)}),()=>{x=!0}},[n,h]);const N=s.useCallback((x,R)=>{I(O=>ls(O,x,R))},[]),H=()=>I(x=>ft(x,!0)),Y=()=>I(x=>ft(x,!1)),X=pn(S),L=async()=>{p("generating"),ie(null);try{const x=JSON.stringify({tasks:S});z.current?.requestBody!==x&&(z.current={requestBody:x,operationId:$s()});const O={method:"POST",credentials:"include",headers:{"Content-Type":"application/json","x-taskforce-operation-id":z.current.operationId},body:x};let W;try{W=await U("/api/taskforce/documents/generate-tasks/commit",O,h)}catch{W=await U("/api/taskforce/documents/generate-tasks/commit",O,h)}const K=await W.json().catch(()=>({}));if(!W.ok)throw new Error(K.error||`Generation failed (${W.status})`);z.current=null,Q(K.created??0),p("done"),d(K.created??0)}catch(x){ie(x?.message||"Generation failed"),p("error")}};return e.jsx("div",{className:D.overlay,onClick:x=>{x.target===x.currentTarget&&i()},children:e.jsxs("div",{className:`tf-surface-modal tf-modal-shell ${D.modal}`,children:[e.jsxs("div",{className:`tf-modal-header ${D.header}`,children:[e.jsxs("div",{className:`tf-modal-title ${D.title}`,children:[e.jsx(mn,{size:16,style:{color:"var(--brand-primary-strong)"}}),"Generate Tasks from Plan"]}),e.jsx("span",{className:D.docName,children:l}),e.jsx("button",{className:"tf-control-icon",onClick:i,title:"Close",children:e.jsx(hn,{size:16})})]}),e.jsxs("div",{className:D.body,children:[T&&e.jsxs("div",{className:D.state,children:[e.jsx(es,{size:20,className:me.docSpinning}),"Parsing plan…"]}),!T&&c==="error"&&e.jsxs("div",{className:D.stateError,children:[e.jsx(Ft,{size:16}),b||$||"An error occurred"]}),!T&&c==="done"&&e.jsxs("div",{className:D.stateDone,children:[e.jsx(ht,{size:24,style:{color:"var(--status-success)"}}),e.jsxs("strong",{children:[J," task",J!==1?"s":""," created"]}),e.jsx("p",{children:"Tasks are now in your board. Switch to the Kanban or Hierarchy view to see them."})]}),!T&&(c==="preview"||c==="confirm"||c==="generating")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:D.toolbar,children:[e.jsxs("span",{className:D.toolbarCount,children:[X," of ",pn(ft(S,!0))," tasks selected"]}),e.jsxs("div",{className:D.toolbarActions,children:[e.jsx("button",{className:"tf-control-icon",onClick:H,children:"Select all"}),e.jsx("button",{className:"tf-control-icon",onClick:Y,children:"Deselect all"})]})]}),S.length===0?e.jsx("div",{className:D.state,children:"No tasks could be parsed from this document. Make sure the document uses ## H2 headings for phases and bullet points for tasks."}):e.jsx("div",{className:`${D.tree} tf-scrollbar`,children:S.map(x=>e.jsx(cs,{node:x,depth:0,onToggle:N},x.idempotencyKey))})]})]}),!T&&c!=="done"&&c!=="error"&&e.jsxs("div",{className:D.footer,children:[e.jsx("button",{className:"tf-button-secondary",onClick:i,children:"Cancel"}),e.jsx("button",{className:"tf-button-primary",onClick:L,disabled:X===0||c==="generating",children:c==="generating"?e.jsxs(e.Fragment,{children:[e.jsx(es,{size:13,className:me.docSpinning})," Generating…"]}):e.jsxs(e.Fragment,{children:[e.jsx(mn,{size:13})," Generate ",X," task",X!==1?"s":""]})})]}),!T&&c==="done"&&e.jsx("div",{className:D.footer,children:e.jsx("button",{className:"tf-button-primary",onClick:i,children:"Done"})})]})})}const ki={"implementation-plan":"Implementation Plan",review:"Review",walkthrough:"Walkthrough",planning:"Planning",other:"Document"},Si={"implementation-plan":a.typeBadgeImplementationPlan,review:a.typeBadgeReview,walkthrough:a.typeBadgeWalkthrough,planning:void 0,other:void 0},Ri={editor:a.editorLayoutEditor,split:a.editorLayoutSplit,preview:a.editorLayoutPreview},ji=1500,Ni=80,on="Document refresh failed; showing the previous saved version.",ln="A newer saved version is available. Cancel editing to reload it before saving.",cn="__new-review__",Ti=`
|
|
1
|
+
import{R as ue,j as e,r as s,s as Ds}from"./vendor-react-CKJs5o3c.js";import{j as vn,k as et,m as tt,o as Gn,f as U,t as me,p as Jn,q as Qn,s as $s,u as Ms,v as Bs,R as Ls,w as Lt,M as Fs,x as Yn,y as Xn,z as Zn}from"./index-DSQINwt9.js";import{A as Ps,a as zs}from"./AssetTraySortControl-CKgapnxu.js";import{a0 as Os,ak as Hs,S as Ws,a_ as Vs,R as dn,aW as Us,a$ as Ks,g as qs,a9 as un,N as Gs,au as mn,X as hn,b0 as es,s as Ft,y as ht,b1 as Js,b2 as Qs,a as Ys,x as Xs,b3 as Zs,b4 as er,b5 as tr,a7 as ut,b6 as nr,aZ as Bt,a6 as sr,a5 as rr,b7 as ts,a1 as ar,b8 as or,r as ns,t as ir,A as lr,O as cr,J as dr,K as ur,b9 as mr}from"./vendor-icons-Bsq-mcEn.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";const hr="_index_1ya8h_1",fr="_header_1ya8h_8",pr="_title_1ya8h_23",vr="_search_1ya8h_35",wr="_searchIcon_1ya8h_41",gr="_searchInput_1ya8h_50",yr="_sortControlRow_1ya8h_67",br="_filters_1ya8h_74",_r="_filtersHeader_1ya8h_83",xr="_filtersTitle_1ya8h_90",Cr="_filterControls_1ya8h_102",kr="_list_1ya8h_114",Sr="_state_1ya8h_126",Rr="_stateError_1ya8h_134",jr="_item_1ya8h_141",Nr="_itemActive_1ya8h_163",Tr="_itemIcon_1ya8h_173",Er="_pinButton_1ya8h_183",Ar="_pinButtonActive_1ya8h_205",Ir="_itemBody_1ya8h_209",Dr="_itemTitle_1ya8h_217",$r="_itemTask_1ya8h_229",Mr="_itemBadge_1ya8h_240",Br="_itemMeta_1ya8h_253",Lr="_itemMetaDetails_1ya8h_264",Fr="_itemMetaReference_1ya8h_271",E={index:hr,header:fr,title:pr,search:vr,searchIcon:wr,searchInput:gr,sortControlRow:yr,filters:br,filtersHeader:_r,filtersTitle:xr,filterControls:Cr,list:kr,state:Sr,stateError:Rr,item:jr,itemActive:Nr,itemIcon:Tr,pinButton:Er,pinButtonActive:Ar,itemBody:Ir,itemTitle:Dr,itemTask:$r,itemBadge:Mr,itemMeta:Br,itemMetaDetails:Lr,itemMetaReference:Fr};function fn(n){let l=n;try{l=decodeURIComponent(n)}catch{l=n}return l.trim().replace(/\\/g,"/").replace(/^\/+/,"").replace(/^\.\//,"").replace(/^\.taskforce\//,"")}function Xe(n,l){const h=String(l||"").trim();if(!h)return n;const i=n.includes("?")?"&":"?";return`${n}${i}workspaceId=${encodeURIComponent(h)}`}function Pr(n,l){return!!(n===l||n.endsWith(`/${l}`)||l.endsWith(`/${n}`))}function ss(n){const l=fn(String(n||""));if(!l)return null;const h=l.match(/(^|\/)(asset-[a-f0-9]{32})(?=[^/]*$)/i);return h?.[2]?h[2].toLowerCase():null}function is(n){return Array.isArray(n.targets)?n.targets.length:typeof n.attachmentCount=="number"&&Number.isFinite(n.attachmentCount)?Math.max(0,Math.floor(n.attachmentCount)):n.taskId?1:0}function wn(n){return Array.isArray(n.targets)?n.targets.length>0?"attached":"unattached":n.attachmentState==="attached"||n.attachmentState==="unattached"?n.attachmentState:is(n)>0?"attached":"unattached"}function zr(n,l,h,i){const d=l.trim().toLowerCase();return n.filter(c=>{const b=[vn(c),c.title,c.originalFilename,c.referenceLabel,c.referenceNumber].filter(j=>j!=null).join(" ").toLowerCase(),k=d.length===0||b.includes(d),S=h.length===0||h.includes(c.docType),I=wn(c),T=i.length===0||i.includes(I);return k&&S&&T})}function Or({docType:n}){switch(n){case"implementation-plan":return e.jsx(Gs,{size:13});case"review":return e.jsx(un,{size:13});case"walkthrough":return e.jsx(qs,{size:13});default:return e.jsx(Ks,{size:13})}}function Hr(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function Wr(n){if(!n)return"";const l=new Date(n),i=new Date().getTime()-l.getTime(),d=Math.floor(i/(1e3*60*60*24));return d===0?"Today":d===1?"Yesterday":d<7?`${d}d ago`:d<30?`${Math.floor(d/7)}w ago`:l.toLocaleDateString()}function Vr(n,l){n.key!=="Enter"&&n.key!==" "||(n.preventDefault(),l())}function an(n,l=!1){return n==="initiative"?l?"initiatives":"initiative":n==="workstream"?l?"workstreams":"workstream":l?"tasks":"task"}function Ur(n,l){const h=n.targets;if(Array.isArray(h)){if(h.length===0)return null;const c=[...new Map(h.map(b=>[`${b.targetType}:${b.targetId}`,b])).values()];if(h.length!==c.length){if(c.length===1){const b=c[0],k=b.title||b.referenceLabel||an(b.targetType);return`${h.length} links to ${k}`}return`${h.length} links across ${c.length} items`}if(c.length===1){const b=c[0];return b.title||b.referenceLabel||`1 ${an(b.targetType)} linked`}return new Set(c.map(b=>b.targetType)).size===1?`${c.length} ${an(c[0].targetType,!0)} linked`:`${c.length} items linked`}const i=is(n),d=n.taskId?l.get(n.taskId):null;return i>1?`${i} tasks linked`:i===1?d?.title||"1 task linked":null}function Kr({documents:n,selectedDocId:l,loading:h,error:i,searchQuery:d,sortField:c,sortOrder:p,pinnedDocIds:b=[],onTogglePinnedDoc:k,taskById:S,onSearchChange:I,onSelect:T,onCloseTray:j,onSortFieldChange:J,onSortOrderChange:Q,hasActiveFilters:$,typeFilters:ie,attachmentFilters:z,onTypeFiltersChange:N,onAttachmentFiltersChange:H,listScrollTop:Y=0,onListScrollChange:X}){const L=ue.useRef(null),x=ue.useRef(null),R=ue.useRef(null),O=ue.useRef(X);ue.useEffect(()=>{O.current=X},[X]),ue.useEffect(()=>{const w=L.current;if(!w)return;const re=Math.max(0,Math.round(Y));Math.abs(w.scrollTop-re)<=1||(w.scrollTop=re)},[n.length,i,Y,h]),ue.useEffect(()=>()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[]);const W=ue.useCallback(()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null);const w=x.current;x.current=null,w!==null&&O.current?.(w)},[]),K=ue.useCallback(w=>{x.current=Math.max(0,Math.round(w)),R.current===null&&(R.current=window.setTimeout(W,200))},[W]),le=+(ie.length!==et.length)+ +(z.length!==tt.length),Ne=`${le} active document ${le===1?"filter":"filters"}`,we=()=>{N(et.map(w=>w.value)),H(tt.map(w=>w.value))};return e.jsxs("div",{className:E.index,children:[e.jsxs("div",{className:E.header,children:[e.jsxs("span",{className:E.title,children:[e.jsx(Os,{size:14}),"Documents"]}),j?e.jsx("button",{type:"button",className:"tf-control-icon",onClick:j,title:"Collapse document tray","aria-label":"Collapse document tray",children:e.jsx(Hs,{size:16})}):null]}),e.jsxs("div",{className:E.search,children:[e.jsx(Ws,{size:12,className:E.searchIcon}),e.jsx("input",{type:"text",placeholder:"Search documents…",value:d,onChange:w=>I(w.target.value),className:E.searchInput})]}),e.jsx("div",{className:E.sortControlRow,children:e.jsx(Ps,{field:c,order:p,onFieldChange:J,onOrderChange:Q})}),e.jsxs("section",{className:E.filters,"aria-label":"Document filters",children:[e.jsxs("div",{className:E.filtersHeader,children:[e.jsxs("span",{className:E.filtersTitle,children:[e.jsx(Vs,{size:12,"aria-hidden":"true"}),"Filters",le>0?e.jsx("span",{className:"tf-chip-count","aria-label":Ne,children:le}):null]}),e.jsx("button",{type:"button",className:"tf-control-icon",onClick:we,disabled:le===0,"aria-label":"Reset document filters",title:"Reset document filters",children:e.jsx(dn,{size:13,"aria-hidden":"true"})})]}),e.jsxs("div",{className:E.filterControls,children:[e.jsx(Gn,{label:"Attachment",options:tt,selected:z,onChange:w=>H(w),variant:"value",containerStyle:{minWidth:0}}),e.jsx(Gn,{label:"Type",options:et,selected:ie,onChange:w=>N(w),variant:"value",containerStyle:{minWidth:0}})]})]}),e.jsxs("div",{ref:L,className:`${E.list} tf-scrollbar tf-tray-scroll-viewport`,"data-testid":"doc-index-list",onScroll:w=>K(w.currentTarget.scrollTop),children:[h&&e.jsx("div",{className:E.state,children:"Loading documents…"}),!h&&i&&e.jsx("div",{className:E.stateError,children:i}),!h&&!i&&n.length===0&&e.jsx("div",{className:E.state,children:$?"No documents match your filters.":"No documents found. Documents added as task attachments will appear here."}),!h&&n.map(w=>{const re=w.assetId===l,A=b.includes(w.assetId),M=vn(w),q=wn(w),Ce=Ur(w,S);return e.jsxs("div",{role:"button",tabIndex:0,className:`${E.item} ${re?E.itemActive:""}`,onClick:()=>T(w),onKeyDown:fe=>Vr(fe,()=>T(w)),children:[e.jsx("div",{className:E.itemIcon,children:e.jsx(Or,{docType:w.docType})}),e.jsxs("div",{className:E.itemBody,children:[e.jsx("span",{className:E.itemTitle,title:M,children:M}),q==="unattached"&&e.jsx("span",{className:E.itemBadge,children:"Unattached"}),Ce&&e.jsx("span",{className:E.itemTask,title:Ce,children:Ce}),e.jsxs("span",{className:E.itemMeta,children:[e.jsxs("span",{className:E.itemMetaDetails,children:[Hr(w.sizeBytes),w.updatedAt&&e.jsxs(e.Fragment,{children:[" · ",Wr(w.updatedAt)]})]}),w.referenceLabel&&e.jsx("span",{className:E.itemMetaReference,children:w.referenceLabel})]})]}),k?e.jsx("button",{type:"button",className:`${E.pinButton} ${A?E.pinButtonActive:""}`.trim(),"aria-label":A?"Unpin document":"Pin document",title:A?`Unpin ${M}`:`Pin ${M}`,"aria-pressed":A,onClick:fe=>{fe.stopPropagation(),k(w.assetId)},onKeyDown:fe=>fe.stopPropagation(),children:e.jsx(Us,{size:14,fill:A?"currentColor":"none"})}):null]},w.assetId)})]})]})}const qr="_viewer_1glbl_1",Gr="_viewerMonochrome_1glbl_10",Jr="_metaDocumentName_1glbl_10",Qr="_viewerEditMode_1glbl_14",Yr="_meta_1glbl_10",Xr="_metaLeft_1glbl_30",Zr="_metaRenameRow_1glbl_49",ea="_typeBadge_1glbl_56",ta="_typeBadgeImplementationPlan_1glbl_71",na="_typeBadgeReview_1glbl_77",sa="_typeBadgeWalkthrough_1glbl_83",ra="_metaTaskName_1glbl_89",aa="_statusBadge_1glbl_98",oa="_metaDate_1glbl_113",ia="_metaSize_1glbl_114",la="_actions_1glbl_122",ca="_actionBtn_1glbl_129",da="_dangerBtn_1glbl_156",ua="_generateBtn_1glbl_167",ma="_editBtn_1glbl_178",ha="_saveBtn_1glbl_189",fa="_layoutToggle_1glbl_205",pa="_layoutBtn_1glbl_213",va="_layoutBtnActive_1glbl_229",wa="_saveStatus_1glbl_234",ga="_saveStatusSaved_1glbl_241",ya="_saveStatusError_1glbl_245",ba="_unsaved_1glbl_250",_a="_viewerContent_1glbl_256",xa="_viewerBody_1glbl_265",Ca="_viewerBodyFullWidth_1glbl_274",ka="_viewerMain_1glbl_278",Sa="_reviewRail_1glbl_286",Ra="_reviewSection_1glbl_292",ja="_reviewHeader_1glbl_299",Na="_reviewHeaderTop_1glbl_309",Ta="_reviewHeaderActions_1glbl_316",Ea="_reviewCloseButton_1glbl_322",Aa="_reviewEyebrow_1glbl_326",Ia="_reviewSubtitle_1glbl_334",Da="_reviewMetadataRow_1glbl_341",$a="_reviewMetadata_1glbl_341",Ma="_reviewSessionTitle_1glbl_355",Ba="_reviewEmptyHeading_1glbl_356",La="_reviewSessionDetails_1glbl_366",Fa="_reviewVersionDetails_1glbl_375",Pa="_reviewDraftNotice_1glbl_383",za="_reviewVersionNotice_1glbl_384",Oa="_reviewControls_1glbl_406",Ha="_reviewCreateButton_1glbl_415",Wa="_reviewResolutionAction_1glbl_416",Va="_reviewSelect_1glbl_431",Ua="_reviewTitleEditRow_1glbl_438",Ka="_reviewTitleInput_1glbl_444",qa="_reviewWorkspace_1glbl_451",Ga="_reviewThread_1glbl_459",Ja="_reviewNewCommentsBar_1glbl_469",Qa="_reviewEmptyState_1glbl_477",Ya="_reviewComment_1glbl_490",Xa="_reviewCommentThread_1glbl_511",Za="_reviewReplies_1glbl_517",eo="_reviewReply_1glbl_526",to="_reviewThreadActions_1glbl_531",no="_reviewReplyComposer_1glbl_540",so="_reviewReplyInput_1glbl_548",ro="_reviewReplyComposerActions_1glbl_553",ao="_reviewCommentHeader_1glbl_559",oo="_reviewCommentAvatar_1glbl_566",io="_reviewCommentAuthor_1glbl_578",lo="_reviewCommentTime_1glbl_588",co="_reviewCommentActions_1glbl_594",uo="_reviewCommentHeaderControls_1glbl_600",mo="_reviewCommentAction_1glbl_594",ho="_reviewCommentDeleteAction_1glbl_616",fo="_reviewAnchorLabel_1glbl_622",po="_reviewAnchorRow_1glbl_637",vo="_reviewAnchorMoved_1glbl_645",wo="_reviewAnchorUnresolved_1glbl_646",go="_reviewAnchorUnknown_1glbl_647",yo="_reviewCommentBody_1glbl_675",bo="_reviewCommentEditor_1glbl_691",_o="_reviewCommentEditInput_1glbl_698",xo="_reviewComposerArea_1glbl_703",Co="_reviewComposerRow_1glbl_713",ko="_reviewComposerInput_1glbl_719",So="_reviewSendButton_1glbl_728",Ro="_reviewComposerHint_1glbl_735",jo="_reviewResolvedComposer_1glbl_740",No="_reviewResolvedIcon_1glbl_751",To="_reviewResolvedCopy_1glbl_762",Eo="_reviewAnchorChip_1glbl_776",Ao="_reviewAnchorSnippet_1glbl_789",Io="_reviewAnchorClear_1glbl_799",Do="_viewerState_1glbl_814",$o="_viewerStateError_1glbl_821",Mo="_editorArea_1glbl_828",Bo="_editorPane_1glbl_834",Lo="_editorLayoutSplit_1glbl_842",Fo="_previewPane_1glbl_843",Po="_editorLayoutEditor_1glbl_847",zo="_editorLayoutPreview_1glbl_848",Oo="_editorPaneLabel_1glbl_852",Ho="_editorTextarea_1glbl_864",Wo="_markdownSurface_1glbl_906",Vo="_readerSurface_1glbl_911",Uo="_attachModalBody_1glbl_1040",Ko="_attachModalCopy_1glbl_1047",qo="_attachModalError_1glbl_1054",Go="_attachTaskList_1glbl_1067",Jo="_attachTaskRow_1glbl_1076",Qo="_attachTaskTitle_1glbl_1103",Yo="_attachTaskInfo_1glbl_1109",Xo="_attachTaskReference_1glbl_1117",Zo="_attachTaskMeta_1glbl_1124",ei="_attachEmptyState_1glbl_1131",a={viewer:qr,viewerMonochrome:Gr,metaDocumentName:Jr,viewerEditMode:Qr,meta:Yr,metaLeft:Xr,metaRenameRow:Zr,typeBadge:ea,typeBadgeImplementationPlan:ta,typeBadgeReview:na,typeBadgeWalkthrough:sa,metaTaskName:ra,statusBadge:aa,metaDate:oa,metaSize:ia,actions:la,actionBtn:ca,dangerBtn:da,generateBtn:ua,editBtn:ma,saveBtn:ha,layoutToggle:fa,layoutBtn:pa,layoutBtnActive:va,saveStatus:wa,saveStatusSaved:ga,saveStatusError:ya,unsaved:ba,viewerContent:_a,viewerBody:xa,viewerBodyFullWidth:Ca,viewerMain:ka,reviewRail:Sa,reviewSection:Ra,reviewHeader:ja,reviewHeaderTop:Na,reviewHeaderActions:Ta,reviewCloseButton:Ea,reviewEyebrow:Aa,reviewSubtitle:Ia,reviewMetadataRow:Da,reviewMetadata:$a,reviewSessionTitle:Ma,reviewEmptyHeading:Ba,reviewSessionDetails:La,reviewVersionDetails:Fa,reviewDraftNotice:Pa,reviewVersionNotice:za,reviewControls:Oa,reviewCreateButton:Ha,reviewResolutionAction:Wa,reviewSelect:Va,reviewTitleEditRow:Ua,reviewTitleInput:Ka,reviewWorkspace:qa,reviewThread:Ga,reviewNewCommentsBar:Ja,reviewEmptyState:Qa,reviewComment:Ya,reviewCommentThread:Xa,reviewReplies:Za,reviewReply:eo,reviewThreadActions:to,reviewReplyComposer:no,reviewReplyInput:so,reviewReplyComposerActions:ro,reviewCommentHeader:ao,reviewCommentAvatar:oo,reviewCommentAuthor:io,reviewCommentTime:lo,reviewCommentActions:co,reviewCommentHeaderControls:uo,reviewCommentAction:mo,reviewCommentDeleteAction:ho,reviewAnchorLabel:fo,reviewAnchorRow:po,reviewAnchorMoved:vo,reviewAnchorUnresolved:wo,reviewAnchorUnknown:go,reviewCommentBody:yo,reviewCommentEditor:bo,reviewCommentEditInput:_o,reviewComposerArea:xo,reviewComposerRow:Co,reviewComposerInput:ko,reviewSendButton:So,reviewComposerHint:Ro,reviewResolvedComposer:jo,reviewResolvedIcon:No,reviewResolvedCopy:To,reviewAnchorChip:Eo,reviewAnchorSnippet:Ao,reviewAnchorClear:Io,viewerState:Do,viewerStateError:$o,editorArea:Mo,editorPane:Bo,editorLayoutSplit:Lo,previewPane:Fo,editorLayoutEditor:Po,editorLayoutPreview:zo,editorPaneLabel:Oo,editorTextarea:Ho,markdownSurface:Wo,readerSurface:Vo,attachModalBody:Uo,attachModalCopy:Ko,attachModalError:qo,attachTaskList:Go,attachTaskRow:Jo,attachTaskTitle:Qo,attachTaskInfo:Yo,attachTaskReference:Xo,attachTaskMeta:Zo,attachEmptyState:ei},ti="_overlay_1unik_1",ni="_modal_1unik_12",si="_header_1unik_16",ri="_title_1unik_20",ai="_docName_1unik_24",oi="_body_1unik_34",ii="_state_1unik_41",li="_stateError_1unik_52",ci="_stateDone_1unik_63",di="_toolbar_1unik_84",ui="_toolbarCount_1unik_95",mi="_toolbarActions_1unik_100",hi="_tree_1unik_105",fi="_taskRow_1unik_113",pi="_taskRowDimmed_1unik_126",vi="_taskCheck_1unik_130",wi="_taskExpandBtn_1unik_139",gi="_taskExpandSpacer_1unik_155",yi="_taskTitle_1unik_160",bi="_taskBadge_1unik_169",_i="_footer_1unik_179",D={overlay:ti,modal:ni,header:si,title:ri,docName:ai,body:oi,state:ii,stateError:li,stateDone:ci,toolbar:di,toolbarCount:ui,toolbarActions:mi,tree:hi,taskRow:fi,taskRowDimmed:pi,taskCheck:vi,taskExpandBtn:wi,taskExpandSpacer:gi,taskTitle:yi,taskBadge:bi,footer:_i},xi={1:"Low",2:"Medium",3:"High"};function ft(n,l){return n.map(h=>({...h,selected:l,children:ft(h.children,l)}))}function ls(n,l,h){return n.map(i=>i.idempotencyKey===l?{...i,selected:h,children:ft(i.children,h)}:{...i,children:ls(i.children,l,h)})}function pn(n){let l=0;for(const h of n)h.selected&&l++,l+=pn(h.children);return l}function cs({node:n,depth:l,onToggle:h}){const[i,d]=s.useState(!0),c=n.children.length>0,p=l*20;return e.jsxs("div",{children:[e.jsxs("div",{className:`${D.taskRow} ${n.selected?"":D.taskRowDimmed}`,style:{paddingLeft:`${12+p}px`},children:[e.jsx("button",{className:D.taskCheck,onClick:()=>h(n.idempotencyKey,!n.selected),title:n.selected?"Deselect":"Select",children:n.selected?e.jsx(Js,{size:14,style:{color:"var(--brand-primary-strong)"}}):e.jsx(Qs,{size:14,style:{color:"var(--text-muted)"}})}),c?e.jsx("button",{className:D.taskExpandBtn,onClick:()=>d(b=>!b),children:i?e.jsx(Ys,{size:12}):e.jsx(Xs,{size:12})}):e.jsx("span",{className:D.taskExpandSpacer}),e.jsx("span",{className:D.taskTitle,title:n.description||void 0,children:n.title}),e.jsx("span",{className:D.taskBadge,style:{color:Jn(n.type),borderColor:Jn(n.type)},children:n.type}),e.jsx("span",{className:D.taskBadge,style:{color:Qn(n.priority),borderColor:Qn(n.priority)},children:xi[n.priority]})]}),c&&i&&e.jsx("div",{children:n.children.map(b=>e.jsx(cs,{node:b,depth:l+1,onToggle:h},b.idempotencyKey))})]})}function Ci({content:n,docTitle:l,apiBaseUrl:h="",onClose:i,onGenerated:d}){const[c,p]=s.useState("preview"),[b,k]=s.useState(null),[S,I]=s.useState([]),[T,j]=s.useState(!0),[J,Q]=s.useState(0),[$,ie]=s.useState(null),z=s.useRef(null);s.useEffect(()=>{let x=!1;return j(!0),k(null),U("/api/taskforce/documents/generate-tasks/preview",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n})},h).then(R=>R.json()).then(R=>{if(!x){if(R.error)throw new Error(R.error);I(R.tasks||[]),p("preview")}}).catch(R=>{x||(k(R?.message||"Failed to parse plan"),p("error"))}).finally(()=>{x||j(!1)}),()=>{x=!0}},[n,h]);const N=s.useCallback((x,R)=>{I(O=>ls(O,x,R))},[]),H=()=>I(x=>ft(x,!0)),Y=()=>I(x=>ft(x,!1)),X=pn(S),L=async()=>{p("generating"),ie(null);try{const x=JSON.stringify({tasks:S});z.current?.requestBody!==x&&(z.current={requestBody:x,operationId:$s()});const O={method:"POST",credentials:"include",headers:{"Content-Type":"application/json","x-taskforce-operation-id":z.current.operationId},body:x};let W;try{W=await U("/api/taskforce/documents/generate-tasks/commit",O,h)}catch{W=await U("/api/taskforce/documents/generate-tasks/commit",O,h)}const K=await W.json().catch(()=>({}));if(!W.ok)throw new Error(K.error||`Generation failed (${W.status})`);z.current=null,Q(K.created??0),p("done"),d(K.created??0)}catch(x){ie(x?.message||"Generation failed"),p("error")}};return e.jsx("div",{className:D.overlay,onClick:x=>{x.target===x.currentTarget&&i()},children:e.jsxs("div",{className:`tf-surface-modal tf-modal-shell ${D.modal}`,children:[e.jsxs("div",{className:`tf-modal-header ${D.header}`,children:[e.jsxs("div",{className:`tf-modal-title ${D.title}`,children:[e.jsx(mn,{size:16,style:{color:"var(--brand-primary-strong)"}}),"Generate Tasks from Plan"]}),e.jsx("span",{className:D.docName,children:l}),e.jsx("button",{className:"tf-control-icon",onClick:i,title:"Close",children:e.jsx(hn,{size:16})})]}),e.jsxs("div",{className:D.body,children:[T&&e.jsxs("div",{className:D.state,children:[e.jsx(es,{size:20,className:me.docSpinning}),"Parsing plan…"]}),!T&&c==="error"&&e.jsxs("div",{className:D.stateError,children:[e.jsx(Ft,{size:16}),b||$||"An error occurred"]}),!T&&c==="done"&&e.jsxs("div",{className:D.stateDone,children:[e.jsx(ht,{size:24,style:{color:"var(--status-success)"}}),e.jsxs("strong",{children:[J," task",J!==1?"s":""," created"]}),e.jsx("p",{children:"Tasks are now in your board. Switch to the Kanban or Hierarchy view to see them."})]}),!T&&(c==="preview"||c==="confirm"||c==="generating")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:D.toolbar,children:[e.jsxs("span",{className:D.toolbarCount,children:[X," of ",pn(ft(S,!0))," tasks selected"]}),e.jsxs("div",{className:D.toolbarActions,children:[e.jsx("button",{className:"tf-control-icon",onClick:H,children:"Select all"}),e.jsx("button",{className:"tf-control-icon",onClick:Y,children:"Deselect all"})]})]}),S.length===0?e.jsx("div",{className:D.state,children:"No tasks could be parsed from this document. Make sure the document uses ## H2 headings for phases and bullet points for tasks."}):e.jsx("div",{className:`${D.tree} tf-scrollbar`,children:S.map(x=>e.jsx(cs,{node:x,depth:0,onToggle:N},x.idempotencyKey))})]})]}),!T&&c!=="done"&&c!=="error"&&e.jsxs("div",{className:D.footer,children:[e.jsx("button",{className:"tf-button-secondary",onClick:i,children:"Cancel"}),e.jsx("button",{className:"tf-button-primary",onClick:L,disabled:X===0||c==="generating",children:c==="generating"?e.jsxs(e.Fragment,{children:[e.jsx(es,{size:13,className:me.docSpinning})," Generating…"]}):e.jsxs(e.Fragment,{children:[e.jsx(mn,{size:13})," Generate ",X," task",X!==1?"s":""]})})]}),!T&&c==="done"&&e.jsx("div",{className:D.footer,children:e.jsx("button",{className:"tf-button-primary",onClick:i,children:"Done"})})]})})}const ki={"implementation-plan":"Implementation Plan",review:"Review",walkthrough:"Walkthrough",planning:"Planning",other:"Document"},Si={"implementation-plan":a.typeBadgeImplementationPlan,review:a.typeBadgeReview,walkthrough:a.typeBadgeWalkthrough,planning:void 0,other:void 0},Ri={editor:a.editorLayoutEditor,split:a.editorLayoutSplit,preview:a.editorLayoutPreview},ji=1500,Ni=80,on="Document refresh failed; showing the previous saved version.",ln="A newer saved version is available. Cancel editing to reload it before saving.",cn="__new-review__",Ti=`
|
|
2
2
|
@page {
|
|
3
3
|
margin: 0.94in 1.02in 1in;
|
|
4
4
|
}
|
package/dist/ui/assets/{EntityActivityTimeline-CZ8x4UJE.js → EntityActivityTimeline-_V0zfMuh.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as x,j as n}from"./vendor-react-CKJs5o3c.js";import{
|
|
1
|
+
import{R as x,j as n}from"./vendor-react-CKJs5o3c.js";import{aV as Y,aW as z,w as Z,aX as q,aY as G,aZ as J}from"./index-DSQINwt9.js";import"./vendor-icons-Bsq-mcEn.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";const Q="_thread_1di31_1",V="_empty_1di31_7",tt="_item_1di31_17",et="_comment_1di31_24",nt="_event_1di31_31",ot="_eventSystem_1di31_39",rt="_header_1di31_43",at="_eventMain_1di31_57",st="_author_1di31_64",it="_time_1di31_79",ct="_commentText_1di31_86",mt="_commentOtherActor_1di31_97",dt="_commentSystem_1di31_112",lt="_commentCurrentActor_1di31_125",ht="_eventText_1di31_140",ut="_eventChanges_1di31_148",vt="_eventChange_1di31_148",e={thread:Q,empty:V,item:tt,comment:et,event:nt,eventSystem:ot,header:rt,eventMain:at,author:st,time:it,commentText:ct,commentOtherActor:mt,commentSystem:dt,commentCurrentActor:lt,eventText:ht,eventChanges:ut,eventChange:vt};function At({activity:p,comments:j,formatFieldValue:A,resolveActorPresentation:i,currentActorId:_,taskReferences:w,emptyMessage:B="No activity yet.",listClassName:M,emptyClassName:O,listRef:P,endRef:K,onScroll:W,targetEntryId:H,targetEntryRef:b}){const T=x.useMemo(()=>Y({activity:p,comments:j}),[p,j]),c=String(_||"").trim().toLowerCase(),m=String(H||"").trim(),g=c!==""&&c!=="anonymous",f=x.useMemo(()=>g?i({actorId:_,actorType:"human",fallbackKind:"member"}):null,[_,g,i]),d=String(f?.label||"").trim(),l=d.toLowerCase(),S=!!(f?.kind==="member"&&d&&l!=="you"&&l!=="user"&&l!=="human"&&l!==c),L=x.useCallback(t=>{const r=String(t.label||"").trim().toLowerCase(),a=r==="you"||r==="user"||r==="human";return t.isCurrentActorHint===!0&&S&&a?d:t.label},[d,S]);return n.jsxs("div",{ref:P,className:[e.thread,M].filter(Boolean).join(" "),onScroll:W,children:[T.length===0?n.jsx("div",{className:[e.empty,O].filter(Boolean).join(" "),children:B}):null,T.map(t=>{const r=!!(m&&(t.id===m||t.type==="comment"&&t.comment.id===m||t.type==="event"&&t.event.id===m));if(t.type==="comment"){const o=i({actorId:t.comment.author,actorType:t.comment.actor?.kind==="ai"?"ai":t.comment.actor?.kind==="human"?"human":null,actorProfile:t.comment.actor||null}),s=o.kind==="agent"?"agent":o.kind==="system"?"system":"member",u=String(t.comment.author||"").trim().toLowerCase(),v=String(t.comment.actor?.id||"").trim().toLowerCase(),D=[u,v].map(X=>String(X||"").trim().toLowerCase()).filter(Boolean),C=g?!!(v&&v!=="user"&&v!=="human"||u&&u!=="user"&&u!=="human")?D.includes(c):o.isCurrentActorHint===!0:s==="member",E=C?L(o):o.label,{ActorIcon:F}=o,y=o.kind==="system"?void 0:o.color,U=y?{"--conversation-accent":y}:void 0;return n.jsxs("div",{ref:r?b:void 0,tabIndex:r?-1:void 0,"data-activity-entry-id":t.id,"data-activity-targeted":r?"true":void 0,"data-conversation-role":s==="agent"?"assistant":s==="system"?"system":"user","data-conversation-side":C?"outgoing":"incoming",style:U,className:[e.item,e.comment,s==="system"?e.commentSystem:"",C?e.commentCurrentActor:e.commentOtherActor].join(" "),children:[n.jsxs("div",{className:e.header,children:[n.jsxs("span",{className:e.author,style:y?{color:y}:void 0,title:o.description,"aria-label":o.description?`${E}. ${o.description}`:void 0,children:[n.jsx(F,{size:12,strokeWidth:1.5}),E]}),n.jsx("time",{className:e.time,dateTime:t.comment.timestamp,children:z(t.comment.timestamp,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),n.jsx("div",{className:e.commentText,children:n.jsx(Z,{variant:"conversation",taskReferences:w,children:t.comment.text})})]},t.id)}const a=i({actorId:t.event.actor,actorType:t.event.actorType,actorProfile:t.event.actorProfile||null,fallbackKind:"system"}),R=L(a),{ActorIcon:$}=a,N=a.color,h=Object.entries(t.event.details?.changes||{}),k=q(t.event),I=h.length>1&&k?h.filter(([o])=>o!==k):h.length>1?h:[];return n.jsx("div",{ref:r?b:void 0,tabIndex:r?-1:void 0,"data-activity-entry-id":t.id,"data-activity-targeted":r?"true":void 0,className:[e.item,e.event,a.kind==="system"?e.eventSystem:""].filter(Boolean).join(" "),children:n.jsxs("div",{className:e.eventMain,children:[n.jsxs("span",{className:e.author,style:N?{color:N}:void 0,children:[n.jsx($,{size:12,strokeWidth:1.5}),R]}),n.jsxs("div",{className:e.eventText,children:[n.jsx("div",{children:G(t.event,A)}),I.length>0?n.jsx("div",{className:e.eventChanges,children:I.map(([o,s])=>n.jsx("div",{className:e.eventChange,children:J(o,s,A)},o))}):null]}),n.jsx("time",{className:e.time,dateTime:t.event.createdAt,children:z(t.event.createdAt,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})},t.id)}),n.jsx("div",{ref:K})]})}export{At as EntityActivityTimeline};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as s,j as t}from"./vendor-react-CKJs5o3c.js";import{an as ze,ao as $e,ap as Le,aq as We,ar as ye,as as le,T as Pe,at as ge,au as ne,av as ie,aw as G,ax as J,ay as De,az as Fe,aA as He,aB as Be,aC as Me,aD as Ue,aE as Ge,aF as be,aG as _e,aH as ce,aI as je,aJ as Ve,aK as Ke,aL as qe,aM as Qe,aN as Je}from"./index-DSQINwt9.js";import{w as re,Z as ke,R as oe,a8 as Xe,a9 as Ye,S as Ze,X as et,al as tt,aj as nt,t as se,ak as me,V as ae,Y as it,a7 as st}from"./vendor-icons-Bsq-mcEn.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";const at="_module_3zich_1",rt="_columns_3zich_15",ot="_column_3zich_15",lt="_columnHeader_3zich_36",ct="_columnHeadingGroup_3zich_49",dt="_paneHeading_3zich_56",ut="_responsiveBack_3zich_60",ht="_sectionLabel_3zich_64",vt="_sectionHeadingRow_3zich_68",pt="_headerActions_3zich_81",ft="_portfolioControls_3zich_87",yt="_searchRow_3zich_95",gt="_searchShell_3zich_101",kt="_clearSearch_3zich_139",mt="_controlActive_3zich_160",wt="_filterPanel_3zich_166",xt="_filterField_3zich_177",bt="_filterLabel_3zich_184",_t="_filterDropdown_3zich_190",jt="_sortTrigger_3zich_204",Ct="_scrollRegion_3zich_217",Et="_selectedEntityContext_3zich_227",St="_selectedEntityContextArchived_3zich_237",It="_selectedEntityReferenceRow_3zich_242",Nt="_selectedEntityReferenceIdentity_3zich_257",At="_selectedEntityReferenceActions_3zich_264",Rt="_workspaceEditor_3zich_278",Ot="_workspaceEditorField_3zich_294",Tt="_workspaceEditorActions_3zich_337",zt="_selectedEntityDescription_3zich_348",$t="_selectedEntityDescriptionMarkdown_3zich_355",Lt="_selectedEntityOwnerField_3zich_361",Wt="_selectedEntityOwnerDropdown_3zich_373",Pt="_selectedEntityDetailsSection_3zich_377",Dt="_activityTimelineList_3zich_382",Ft="_activityTimelineEmpty_3zich_389",Ht="_visuallyHidden_3zich_393",Bt="_entityCard_3zich_405",Mt="_entityCardTopRow_3zich_426",Ut="_entityCardBody_3zich_433",Gt="_entityCardContentButton_3zich_437",Vt="_entityCardSelected_3zich_447",Kt="_entityCardArchived_3zich_455",qt="_relationshipRecovery_3zich_466",Qt="_empty_3zich_488",Jt="_centerState_3zich_495",Xt="_inlineError_3zich_509",Yt="_spinner_3zich_524",Zt="_columnPortfolio_3zich_543",en="_columnActive_3zich_544",tn="_columnWorkstreams_3zich_545",nn="_columnTasks_3zich_550",sn="_workspaceEditorIdentity_3zich_592",i={module:at,columns:rt,column:ot,columnHeader:lt,columnHeadingGroup:ct,paneHeading:dt,responsiveBack:ut,sectionLabel:ht,sectionHeadingRow:vt,headerActions:pt,portfolioControls:ft,searchRow:yt,searchShell:gt,clearSearch:kt,controlActive:mt,filterPanel:wt,filterField:xt,filterLabel:bt,filterDropdown:_t,sortTrigger:jt,scrollRegion:Ct,selectedEntityContext:Et,selectedEntityContextArchived:St,selectedEntityReferenceRow:It,selectedEntityReferenceIdentity:Nt,selectedEntityReferenceActions:At,workspaceEditor:Rt,workspaceEditorField:Ot,workspaceEditorActions:Tt,selectedEntityDescription:zt,selectedEntityDescriptionMarkdown:$t,selectedEntityOwnerField:Lt,selectedEntityOwnerDropdown:Wt,selectedEntityDetailsSection:Pt,activityTimelineList:Dt,activityTimelineEmpty:Ft,visuallyHidden:Ht,entityCard:Bt,entityCardTopRow:Mt,entityCardBody:Ut,entityCardContentButton:Gt,entityCardSelected:Vt,entityCardArchived:Kt,relationshipRecovery:qt,empty:Qt,centerState:Jt,inlineError:Xt,spinner:Yt,columnPortfolio:Zt,columnActive:en,columnWorkstreams:tn,columnTasks:nn,workspaceEditorIdentity:sn};function ee({entityType:e,mode:l,initialTitle:m="",initialDescription:p="",ownerOptions:f,fixedInitiativeId:y,formId:j,showActions:C=!0,onSavingChange:b,onDirtyChange:N,onCancel:A,onSave:z}){const E=e==="initiative"?"Initiative":"Workstream",W=s.useId(),P=s.useId(),k=s.useId(),V=s.useRef(null),[D,S]=s.useState(m),[u,_]=s.useState(p),[I,R]=s.useState(""),[O,h]=s.useState(null),[g,$]=s.useState(null),[T,F]=s.useState(null),[H,L]=s.useState(null),[w,U]=s.useState(!1),x=l==="create"||Ge({title:m,description:p},{title:D,description:u});s.useEffect(()=>{N?.(x)},[x,N]),s.useEffect(()=>{V.current?.focus()},[]);const B=async c=>{if(c.preventDefault(),w)return;const a=D.trim();if(!a){F(`${E} title is required.`),V.current?.focus();return}if(x){F(null),L(null),U(!0),b?.(!0);try{await z({title:a,description:u.trim()||null,...l==="create"?{ownerId:I.trim()||null}:{},...e==="workstream"&&l==="create"?{initiativeId:y||null}:{},...l==="create"&&(O||g)?{icon:O,color:g}:{}})}catch(M){L(M instanceof Error?M.message:`Failed to save ${E.toLowerCase()}.`)}finally{U(!1),b?.(!1)}}};return t.jsxs("form",{id:j,className:i.workspaceEditor,onSubmit:c=>{B(c)},onKeyDown:c=>{c.key!=="Escape"||w||(c.preventDefault(),A())},noValidate:!0,children:[l==="create"?t.jsxs("div",{className:i.workspaceEditorIdentity,children:[t.jsx(be,{entityType:e,entityId:"create-preview",icon:O,color:g||"blue",size:"detail",onChange:c=>{Object.prototype.hasOwnProperty.call(c,"icon")&&h(c.icon??null),Object.prototype.hasOwnProperty.call(c,"color")&&$(c.color??null)}}),t.jsx("span",{children:"Choose an icon and color"})]}):null,t.jsxs("div",{className:i.workspaceEditorField,children:[t.jsxs("label",{htmlFor:W,children:[E," title"]}),t.jsx("input",{ref:V,id:W,value:D,disabled:w,required:!0,"aria-invalid":T?"true":void 0,"aria-describedby":T?P:void 0,onChange:c=>{S(c.target.value),T&&F(null)},placeholder:e==="initiative"?"Enter initiative title":"Enter workstream title"}),T?t.jsx("p",{id:P,className:"tf-text-error",children:T}):null]}),t.jsxs("div",{className:i.workspaceEditorField,children:[t.jsxs("label",{htmlFor:k,children:[E," description"]}),t.jsx("textarea",{id:k,value:u,disabled:w,rows:5,onChange:c=>_(c.target.value),placeholder:e==="initiative"?"Describe the broader outcome this initiative is meant to achieve.":"Describe the lane of work this workstream will coordinate."})]}),l==="create"&&f?t.jsxs("div",{className:i.workspaceEditorField,children:[t.jsxs("span",{children:[E," owner"]}),t.jsx(le,{value:I,options:f,onChange:R,disabled:w,ariaLabel:`${E} owner`,className:`${_e.control} ${i.selectedEntityOwnerDropdown}`})]}):null,H?t.jsx("p",{className:"tf-text-error",role:"alert",children:H}):null,C?t.jsxs("div",{className:i.workspaceEditorActions,children:[t.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:A,disabled:w,children:"Cancel"}),t.jsxs("button",{type:"submit",className:"tf-button-primary tf-button-compact",disabled:w||!x,children:[w?t.jsx(re,{size:14,className:i.spinner,"aria-hidden":"true"}):null,l==="create"?`Create ${E}`:"Save"]})]}):null]})}function an({initiative:e,ownerOption:l,ownerOptions:m,workstreamCount:p,selected:f,onSelect:y,onChangeOwner:j,onChangeIdentity:C}){return t.jsxs("div",{className:`${i.entityCard} ${e.isArchived?i.entityCardArchived:""} ${f?i.entityCardSelected:""}`.trim(),children:[t.jsx(ce,{label:J(e),entityType:"initiative",entityName:e.title,interactive:!1}),t.jsx("div",{className:i.entityCardBody,children:t.jsx("div",{role:"button",tabIndex:0,className:i.entityCardContentButton,onClick:y,onKeyDown:b=>{b.key!=="Enter"&&b.key!==" "||(b.preventDefault(),y())},"aria-pressed":f,children:t.jsx(je,{item:e,entityType:"initiative",workstreamCount:p,ownerOption:l,ownerOptions:m,onChangeOwner:j,onChangeIdentity:C})})})]})}function we({workstream:e,ownerOption:l,ownerOptions:m,selected:p,onSelect:f,onChangeOwner:y,onChangeIdentity:j,referenceAction:C,feedback:b}){const N=G(e);return t.jsxs("div",{className:`${i.entityCard} ${e.isArchived?i.entityCardArchived:""} ${p?i.entityCardSelected:""}`.trim(),children:[t.jsxs("div",{className:i.entityCardTopRow,children:[C,t.jsx(ce,{label:N||"Reference pending",entityType:"workstream",entityName:e.title,interactive:!1,pending:!N})]}),b,t.jsx("div",{className:i.entityCardBody,children:t.jsx("div",{role:"button",tabIndex:0,className:i.entityCardContentButton,onClick:f,onKeyDown:A=>{A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),f())},"aria-pressed":p,children:t.jsx(je,{item:e,entityType:"workstream",ownerOption:l,ownerOptions:m,onChangeOwner:y,onChangeIdentity:j})})})]})}function xe({item:e,entityType:l,ownerOptions:m,onChangeOwner:p,onChangeIdentity:f,workspaceId:y,currentActorId:j,taskReferences:C,hydrationState:b,onRetryHydration:N,onAddContextFile:A,onRemoveContextFile:z,onUpdateContextCaption:E,onUpdate:W,onArchive:P,onUnarchive:k,referenceAction:V,relationshipActions:D,relationshipContent:S}){const u=l==="initiative"?"Initiative":"Workstream",_=l==="initiative"?J(e):G(e),[I,R]=s.useState(String(e.ownerId||"")),[O,h]=s.useState(!1),[g,$]=s.useState(!1),[T,F]=s.useState(!1),[H,L]=s.useState(!1),[w,U]=s.useState(!1),[x,B]=s.useState(!1),c=s.useId(),a=Ve({entityType:l,isArchived:e.isArchived,taskCount:e.taskCount,completedTaskCount:e.completedTaskCount,archiveReady:e.archiveReady,activeWorkstreamCount:e.archiveActiveWorkstreamCount}),M=a.mode==="archived"?`Unarchive ${u.toLowerCase()}`:a.mode==="blocked"?`Archive unavailable — active ${a.remainingKind==="task"?"tasks":"workstreams"} remain`:a.mode==="checking"?"Archive availability is still loading":`Archive ${u.toLowerCase()}`;s.useEffect(()=>{R(String(e.ownerId||"")),h(!1)},[e.id,e.ownerId]),s.useEffect(()=>{$(!1),F(!1),L(!1),U(!1),B(!1)},[e.id]);const r=async d=>{if(!p||e.isArchived||O||d===I)return;const K=I;R(d),h(!0);try{await p(d)}catch{R(K)}finally{h(!1)}},X=async()=>{if(x)return;if(a.mode==="ready"){U(!0);return}const d=a.mode==="archived"?k:P;if(!(!d||a.mode==="blocked"||a.mode==="checking")){B(!0);try{await d()}finally{B(!1)}}},Y=async()=>{if(!(!P||x)){B(!0);try{await P()!==!1&&U(!1)}finally{B(!1)}}};return t.jsxs("section",{className:`${i.selectedEntityContext} ${e.isArchived?i.selectedEntityContextArchived:""}`.trim(),"aria-label":`Selected ${u.toLowerCase()}`,"aria-busy":b?.status==="loading",children:[t.jsxs("div",{className:i.selectedEntityReferenceRow,children:[t.jsxs("div",{className:i.selectedEntityReferenceIdentity,children:[t.jsx(be,{entityType:l,entityId:e.id,icon:e.icon,color:e.color,size:"detail",disabled:!!e.isArchived,onChange:f?d=>f(l,e.id,d):void 0}),V,t.jsx(ce,{label:_||"Reference pending",entityType:l,entityName:e.title,interactive:!1,pending:!_})]}),t.jsxs("div",{className:i.selectedEntityReferenceActions,children:[t.jsx("span",{children:u}),D,!g&&(P||k)?t.jsx("button",{type:"button",className:"tf-control-icon",disabled:x||a.mode==="blocked"||a.mode==="checking"||(a.mode==="archived"?!k:!P),onClick:()=>{X()},"aria-label":M,title:M,"aria-expanded":a.mode==="ready"?w:void 0,children:a.mode==="archived"?t.jsx(oe,{size:14,"aria-hidden":"true"}):t.jsx(it,{size:14,"aria-hidden":"true"})}):null,!g&&!e.isArchived&&W?t.jsx("button",{type:"button",className:"tf-control-icon",onClick:()=>{L(!1),$(!0)},"aria-label":`Edit ${u.toLowerCase()}`,title:`Edit ${u.toLowerCase()}`,children:t.jsx(st,{size:14,"aria-hidden":"true"})}):null,g?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:()=>$(!1),disabled:T,children:"Cancel"}),t.jsx("button",{type:"submit",form:c,className:"tf-button-primary tf-button-compact",disabled:T||!H,children:"Save"})]}):null]})]}),w&&a.mode==="ready"?t.jsx(Ke,{entityType:l,title:e.title,activeTaskCount:e.archiveActiveTaskCount,activeWorkstreamCount:e.archiveActiveWorkstreamCount,busy:x,onCancel:()=>U(!1),onConfirm:()=>{Y()}}):null,S,g&&W?t.jsx(ee,{entityType:l,mode:"edit",formId:c,showActions:!1,onSavingChange:F,onDirtyChange:L,initialTitle:e.title,initialDescription:e.description||"",onCancel:()=>$(!1),onSave:async d=>{await W(d),$(!1)}},`${l}:${e.id}`):t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"tf-heading-card",children:e.title}),t.jsx(qe,{description:e.description,label:u,taskReferences:C,className:`${i.selectedEntityDescription} tf-scrollbar`.trim(),markdownClassName:i.selectedEntityDescriptionMarkdown})]}),t.jsxs("div",{className:i.selectedEntityOwnerField,children:[t.jsx("span",{children:"Owner"}),t.jsx(le,{value:I,options:m,onChange:d=>{r(d)},disabled:!p||!!e.isArchived||O,ariaLabel:`${u} owner`,className:`${_e.control} ${i.selectedEntityOwnerDropdown}`})]}),t.jsx("div",{className:i.selectedEntityDetailsSection,children:t.jsx(Qe,{entityType:l,entityId:e.id,referenceLabel:l==="initiative"?J(e):G(e),workspaceId:y,attachments:e.attachments,readOnly:!!e.isArchived,defaultExpanded:!1,onAddAttachment:!e.isArchived&&A?d=>A(l,e.id,d):void 0,onRemoveAttachment:!e.isArchived&&z?d=>z(l,e.id,d):void 0,onUpdateAttachmentCaption:!e.isArchived&&E?(d,K)=>E(l,e.id,d,K):void 0})}),t.jsx("div",{className:i.selectedEntityDetailsSection,children:t.jsx(Je,{entityType:l,item:e,assigneeOptions:m,currentActorId:j,taskReferences:C,defaultExpanded:!1,listClassName:i.activityTimelineList,emptyClassName:i.activityTimelineEmpty,hydrationState:b,onRetryHydration:N})})]})}function hn({model:e}){const[l,m]=s.useState(null),[p,f]=s.useState(null),[y,j]=s.useState("portfolio"),[C,b]=s.useState(""),[N,A]=s.useState("all"),[z,E]=s.useState("default"),[W,P]=s.useState(!1),[k,V]=s.useState(!1),D=e.taskArrangeMode||"execution",[S,u]=s.useState(null),[_,I]=s.useState(null),[R,O]=s.useState(null),[h,g]=s.useState(!1),$=s.useRef(null),T=s.useRef(null),F=s.useRef(null),H=s.useRef(null),L=s.useRef(null),w=s.useMemo(()=>new Map(e.assigneeOptions.filter(n=>!String(n.archivedAt||"").trim()).map(n=>[String(n.value),n])),[e.assigneeOptions]),U=s.useMemo(()=>{const n=String(e.currentOwnerId||"").trim(),o=n?ze(e.assigneeOptions,n).find(v=>v.value===n):void 0;return[{value:"all",label:"All owners",icon:"Users",color:"var(--text-secondary)",kind:"unassigned"},...n?[{...o,value:"mine",label:"Owned by me",icon:o?.icon||"User",color:o?.color||"var(--text-secondary)",kind:o?.kind||"member"}]:[],{value:"unassigned",label:"Unassigned",icon:Le,color:$e,kind:"unassigned"}]},[e.assigneeOptions,e.currentOwnerId]),x=s.useMemo(()=>We({initiatives:e.initiatives,standaloneWorkstreams:e.standaloneWorkstreams,showArchivedPlanning:k,searchQuery:C,ownerFilter:N,currentOwnerId:String(e.currentOwnerId||""),sort:z}),[e.currentOwnerId,e.initiatives,e.standaloneWorkstreams,N,C,k,z]),B=s.useMemo(()=>x.initiatives.map(({initiative:n})=>n),[x.initiatives]),c=x.standaloneWorkstreams,a=s.useMemo(()=>e.initiatives.find(n=>n.id===l)??null,[e.initiatives,l]),M=s.useMemo(()=>[...e.initiatives.flatMap(n=>n.allWorkstreams??n.workstreams),...e.standaloneWorkstreams],[e.initiatives,e.standaloneWorkstreams]),r=s.useMemo(()=>M.find(n=>n.id===p)??null,[M,p]),X=a?(a.allWorkstreams??a.workstreams).filter(n=>k||!n.isArchived):r&&!r.initiativeId?[r]:[],Y=s.useMemo(()=>ye((r?.tasks??[]).filter(n=>k||!n.isArchived),D),[r?.tasks,k,D]),d=s.useMemo(()=>new Set((a?.allWorkstreams??a?.workstreams??[]).map(n=>n.id)),[a]),K=s.useMemo(()=>new Set((r?.tasks??[]).map(n=>n.id)),[r]),Ce=s.useMemo(()=>e.linkOptions.workstreams.filter(n=>!d.has(n.id)),[d,e.linkOptions.workstreams]),Ee=s.useMemo(()=>e.linkOptions.tasks.filter(n=>!K.has(n.id)),[K,e.linkOptions.tasks]),q=r?"workstream":a?"initiative":null,Q=r?.id||a?.id||null,de=q&&Q?e.hydrationStateByEntity?.[`${q}:${Q}`]:void 0,ue=s.useMemo(()=>e.initiatives.some(o=>o.isArchived)?!0:[...e.initiatives.flatMap(o=>o.allWorkstreams??o.workstreams),...e.standaloneWorkstreams].some(o=>o.isArchived||(o.tasks??[]).some(v=>v.isArchived)),[e.initiatives,e.standaloneWorkstreams]);s.useEffect(()=>{const n=L.current;if(n){if(n.entityType==="initiative"){if(!e.initiatives.some(o=>o.id===n.entityId))return;L.current=null,m(n.entityId),f(null),H.current="workstreams",j("workstreams");return}M.some(o=>o.id===n.entityId)&&(L.current=null,m(n.initiativeId||null),f(n.entityId),H.current="tasks",j("tasks"))}},[M,e.initiatives]),s.useEffect(()=>{l&&!a&&(m(null),f(null),j("portfolio"))},[a,l]),s.useEffect(()=>{p&&!r&&(f(null),j(a?"workstreams":"portfolio"))},[a,r,p]),s.useEffect(()=>{!e.hydrateEntity||!q||!Q||e.hydrateEntity(q,Q)},[e.hydrateEntity,Q,q]),s.useEffect(()=>{I(null),O(null),g(!1)},[Q,q]),s.useLayoutEffect(()=>{if(H.current!==y)return;(y==="portfolio"?$.current:y==="workstreams"?T.current:F.current)?.focus({preventScroll:!0}),H.current=null},[y]);const Z=n=>{if(n===y){(n==="portfolio"?$.current:n==="workstreams"?T.current:F.current)?.focus({preventScroll:!0});return}H.current=n,j(n)},Se=n=>{m(n),f(null),Z("workstreams")},he=n=>{n.initiativeId||m(null),f(n.id),Z("tasks")},Ie=()=>{Z(a?"workstreams":"portfolio")},Ne=x.hasCriteria||z!=="default",Ae=()=>{b(""),A("all"),E("default")},te=async n=>{if(!S||!e.createEntity)return;const o=await e.createEntity(S.entityType,n);L.current={entityType:S.entityType,entityId:o.id,initiativeId:S.initiativeId},u(null)},ve=async(n,o)=>{if(h)return;const v=n==="workstream"?e.attachWorkstreamToInitiative:e.attachTaskToWorkstream,fe=n==="workstream"?a?.id:r?.id;if(!(!v||!fe)){g(!0);try{await v(fe,o.referenceLabel)}finally{g(!1)}}},Re=async n=>{if(!(!r||!e.assignWorkstreamToInitiative||h)){g(!0);try{await e.assignWorkstreamToInitiative(r.id,n.referenceLabel)!==!1&&m(n.id)}finally{g(!1)}}},Oe=async()=>{if(!(!_||h)){g(!0);try{if(_.entityType==="workstream"){if(!e.assignWorkstreamToInitiative)return;const n=a?J(a):null;if(await e.assignWorkstreamToInitiative(_.id,null)===!1)return;O({pane:_.id===r?.id?"tasks":"workstreams",message:`${_.referenceLabel} removed from its initiative.`,onUndo:async()=>{if(!n)return;await e.assignWorkstreamToInitiative?.(_.id,n)!==!1&&O(null)}})}else{if(!e.assignTaskToWorkstream||!r)return;const n=r.id;if(await e.assignTaskToWorkstream(_.id,null)===!1)return;O({pane:"tasks",message:`${_.referenceLabel} removed from this workstream.`,onUndo:async()=>{await e.assignTaskToWorkstream?.(_.id,n)!==!1&&O(null)}})}I(null)}finally{g(!1)}}},Te=async()=>{if(!(!R||h)){g(!0);try{await R.onUndo()}finally{g(!1)}}},pe=R?t.jsxs("div",{className:i.relationshipRecovery,role:"status",children:[t.jsx("span",{children:R.message}),t.jsx("button",{type:"button",className:"tf-button-ghost tf-button-compact",disabled:h,onClick:()=>{Te()},children:h?"Restoring…":"Undo"})]}):null;return e.loadState.status==="loading"&&e.initiatives.length===0&&e.standaloneWorkstreams.length===0?t.jsxs("main",{className:i.centerState,"aria-busy":"true","aria-label":"Loading planning workspace",children:[t.jsx(re,{size:22,className:i.spinner}),t.jsx("span",{children:"Loading planning…"})]}):e.loadState.status==="error"&&e.initiatives.length===0&&e.standaloneWorkstreams.length===0?t.jsxs("main",{className:i.centerState,role:"alert",children:[t.jsx(ke,{size:22}),t.jsx("strong",{children:"Planning could not be loaded."}),t.jsx("span",{children:e.loadState.error}),t.jsxs("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:e.retry,disabled:e.loadState.isRefreshing,children:[e.loadState.isRefreshing?t.jsx(re,{size:15,className:i.spinner}):t.jsx(oe,{size:15}),"Retry"]})]}):t.jsxs("main",{className:i.module,"aria-label":"Planning workspace","aria-busy":e.loadState.isRefreshing,children:[e.loadState.isRefreshing?t.jsx("span",{className:i.visuallyHidden,role:"status","aria-live":"polite",children:"Refreshing planning"}):null,(e.loadState.status==="partial"||e.loadState.status==="error")&&t.jsxs("div",{className:i.inlineError,role:"alert",children:[t.jsx(ke,{size:16}),t.jsx("span",{children:e.loadState.error||"Some planning information could not be loaded."}),t.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:e.retry,children:"Retry"})]}),t.jsxs("div",{className:i.columns,"data-active-pane":y,children:[t.jsxs("section",{className:`${i.column} ${i.columnPortfolio} ${y==="portfolio"?i.columnActive:""}`.trim(),"aria-labelledby":"planning-portfolio-heading",children:[t.jsxs("div",{className:i.columnHeader,children:[t.jsx("h2",{ref:$,id:"planning-portfolio-heading",className:`tf-heading-section ${i.paneHeading}`,tabIndex:-1,children:"Portfolio"}),t.jsxs("div",{className:i.headerActions,children:[t.jsx("span",{children:B.length+c.length}),t.jsx("button",{type:"button",className:`tf-control-icon ${k?i.controlActive:""}`.trim(),onClick:()=>V(n=>!n),disabled:!ue,"aria-label":k?"Hide archived planning items":"Show archived planning items","aria-pressed":k,title:ue?k?"Hide archived planning items":"Show archived planning items":"No archived planning items",children:k?t.jsx(Xe,{size:15,"aria-hidden":"true"}):t.jsx(Ye,{size:15,"aria-hidden":"true"})})]})]}),t.jsxs("div",{className:i.portfolioControls,children:[t.jsxs("div",{className:i.searchRow,children:[t.jsxs("div",{className:i.searchShell,children:[t.jsx(Ze,{size:14,"aria-hidden":"true"}),t.jsx("input",{type:"search",value:C,onChange:n=>b(n.target.value),placeholder:"Search initiatives and workstreams","aria-label":"Search planning"}),C?t.jsx("button",{type:"button",className:i.clearSearch,onClick:()=>b(""),"aria-label":"Clear planning search",title:"Clear search",children:t.jsx(et,{size:13,"aria-hidden":"true"})}):null]}),t.jsx("button",{type:"button",className:`tf-control-icon ${W||N!=="all"||z!=="default"?i.controlActive:""}`.trim(),"aria-label":"Filter and sort planning",title:"Filter and sort planning","aria-expanded":W,"aria-controls":"planning-workspace-navigator-options",onClick:()=>P(n=>!n),children:t.jsx(tt,{size:15,"aria-hidden":"true"})})]}),W?t.jsxs("div",{id:"planning-workspace-navigator-options",className:i.filterPanel,children:[t.jsxs("div",{className:i.filterField,children:[t.jsx("span",{className:i.filterLabel,children:"Owner"}),t.jsx(le,{value:N,options:e.assigneeOptions,leadingOptions:U,includeUnassigned:!1,onChange:A,disabled:!1,ariaLabel:"Filter planning by owner",className:i.filterDropdown})]}),t.jsxs("div",{className:i.filterField,children:[t.jsx("span",{className:i.filterLabel,children:"Sort"}),t.jsx(Pe,{value:z,options:ge,onChange:n=>E(String(n)),ariaLabel:"Sort planning",className:i.filterDropdown,portalPanel:!0,panelAlign:"start",triggerContent:t.jsxs("span",{className:i.sortTrigger,children:[t.jsx(nt,{size:14,"aria-hidden":"true"}),t.jsx("span",{children:ge.find(n=>n.value===z)?.label})]}),renderOptionContent:n=>n.label})]}),t.jsx("button",{type:"button",className:"tf-control-icon",onClick:Ae,disabled:!Ne,"aria-label":"Reset planning filters and sort",title:"Reset planning filters and sort",children:t.jsx(oe,{size:14,"aria-hidden":"true"})})]}):null]}),t.jsxs("div",{className:i.scrollRegion,children:[t.jsxs("div",{className:i.sectionHeadingRow,children:[t.jsx("h3",{className:`tf-heading-section ${i.sectionLabel}`,children:"Initiatives"}),e.createEntity?t.jsx("button",{type:"button",className:"tf-control-icon",onClick:()=>u({entityType:"initiative"}),"aria-label":"Create initiative",title:"Create initiative",children:t.jsx(se,{size:15,"aria-hidden":"true"})}):null]}),S?.entityType==="initiative"?t.jsx(ee,{entityType:"initiative",mode:"create",ownerOptions:e.assigneeOptions,onCancel:()=>u(null),onSave:te}):null,x.initiatives.map(({initiative:n,workstreams:o})=>t.jsx(an,{initiative:n,workstreamCount:o.length,ownerOption:n.ownerId?w.get(n.ownerId):void 0,ownerOptions:e.assigneeOptions,selected:l===n.id,onSelect:()=>Se(n.id),onChangeOwner:e.changeOwner?v=>e.changeOwner?.("initiative",n.id,v==="unassigned"?"":v):void 0,onChangeIdentity:e.changeIdentity?v=>e.changeIdentity?.("initiative",n.id,v):void 0},n.id)),t.jsxs("div",{className:i.sectionHeadingRow,children:[t.jsx("h3",{className:`tf-heading-section ${i.sectionLabel}`,children:"Standalone workstreams"}),e.createEntity?t.jsx("button",{type:"button",className:"tf-control-icon",onClick:()=>u({entityType:"workstream",initiativeId:null}),"aria-label":"Create standalone workstream",title:"Create standalone workstream",children:t.jsx(se,{size:15,"aria-hidden":"true"})}):null]}),S?.entityType==="workstream"&&!S.initiativeId?t.jsx(ee,{entityType:"workstream",mode:"create",ownerOptions:e.assigneeOptions,fixedInitiativeId:null,onCancel:()=>u(null),onSave:te}):null,c.map(n=>t.jsx(we,{workstream:n,ownerOption:n.ownerId?w.get(n.ownerId):void 0,ownerOptions:e.assigneeOptions,selected:p===n.id,onSelect:()=>he(n),onChangeOwner:e.changeOwner?o=>e.changeOwner?.("workstream",n.id,o==="unassigned"?"":o):void 0,onChangeIdentity:e.changeIdentity?o=>e.changeIdentity?.("workstream",n.id,o):void 0},n.id)),B.length===0&&c.length===0&&t.jsx("p",{className:`tf-text-helper ${i.empty}`,children:x.hasCriteria?"No planning matches.":"No planning items yet."})]})]}),t.jsxs("section",{className:`${i.column} ${i.columnWorkstreams} ${y==="workstreams"?i.columnActive:""}`.trim(),"aria-labelledby":"planning-workstreams-heading",children:[t.jsxs("div",{className:i.columnHeader,children:[t.jsxs("div",{className:i.columnHeadingGroup,children:[t.jsx("button",{type:"button",className:`tf-control-icon ${i.responsiveBack}`.trim(),onClick:()=>Z("portfolio"),"aria-label":"Back to Portfolio",title:"Back to Portfolio",children:t.jsx(me,{size:15,"aria-hidden":"true"})}),t.jsxs("h2",{ref:T,id:"planning-workstreams-heading",className:`tf-heading-section ${i.paneHeading}`,tabIndex:-1,children:["Workstreams (",X.length,")"]})]}),t.jsx("div",{className:i.headerActions,children:a&&e.createEntity?t.jsx("button",{type:"button",className:"tf-control-icon",onClick:()=>u({entityType:"workstream",initiativeId:a.id}),"aria-label":`Create workstream in ${a.title}`,title:"Create workstream",children:t.jsx(se,{size:15,"aria-hidden":"true"})}):null})]}),t.jsxs("div",{className:i.scrollRegion,children:[a?t.jsxs(t.Fragment,{children:[t.jsx(xe,{item:a,entityType:"initiative",ownerOptions:e.assigneeOptions,onChangeOwner:e.changeOwner?n=>e.changeOwner?.("initiative",a.id,n):void 0,onChangeIdentity:e.changeIdentity,workspaceId:e.currentWorkspaceId,currentActorId:e.currentOwnerId,taskReferences:e.taskReferences,hydrationState:r?void 0:de,onRetryHydration:e.hydrateEntity?()=>{e.hydrateEntity?.("initiative",a.id)}:void 0,onAddContextFile:e.addContextFile,onRemoveContextFile:e.removeContextFile,onUpdateContextCaption:e.updateContextCaption,onUpdate:e.updateEntity?n=>e.updateEntity("initiative",a.id,n):void 0,onArchive:e.archiveEntity?()=>e.archiveEntity("initiative",a.id):void 0,onUnarchive:e.unarchiveEntity?()=>e.unarchiveEntity("initiative",a.id):void 0}),t.jsx(ne,{options:Ce,entityLabel:"workstream",onSelect:n=>ve("workstream",n),disabled:!e.attachWorkstreamToInitiative||h})]}):null,S?.entityType==="workstream"&&S.initiativeId===a?.id?t.jsx(ee,{entityType:"workstream",mode:"create",ownerOptions:e.assigneeOptions,fixedInitiativeId:a.id,onCancel:()=>u(null),onSave:te}):null,X.map(n=>t.jsx(we,{workstream:n,ownerOption:n.ownerId?w.get(n.ownerId):void 0,ownerOptions:e.assigneeOptions,selected:p===n.id,onSelect:()=>he(n),onChangeOwner:e.changeOwner?o=>e.changeOwner?.("workstream",n.id,o==="unassigned"?"":o):void 0,onChangeIdentity:e.changeIdentity?o=>e.changeIdentity?.("workstream",n.id,o):void 0,referenceAction:a?t.jsx(ie,{disabled:!e.assignWorkstreamToInitiative||h,onClick:()=>I({entityType:"workstream",id:n.id,referenceLabel:G(n),title:n.title,parentLabel:a?`${J(a)} ${a.title}`.trim():"its initiative"}),title:`Unlink ${G(n)||n.title} from initiative`,ariaLabel:`Unlink ${G(n)||n.title} from initiative`,children:t.jsx(ae,{size:14,"aria-hidden":"true"})}):void 0},n.id)),a&&R?.pane==="workstreams"?pe:null,X.length===0&&t.jsx("p",{className:`tf-text-helper ${i.empty}`,children:"Select an initiative or standalone workstream."})]})]}),t.jsxs("section",{className:`${i.column} ${i.columnTasks} ${y==="tasks"?i.columnActive:""}`.trim(),"aria-labelledby":"planning-tasks-heading",children:[t.jsx("div",{className:i.columnHeader,children:t.jsxs("div",{className:i.columnHeadingGroup,children:[t.jsx("button",{type:"button",className:`tf-control-icon ${i.responsiveBack}`.trim(),onClick:Ie,"aria-label":a?"Back to Workstreams":"Back to Portfolio",title:a?"Back to Workstreams":"Back to Portfolio",children:t.jsx(me,{size:15,"aria-hidden":"true"})}),t.jsxs("h2",{ref:F,id:"planning-tasks-heading",className:`tf-heading-section ${i.paneHeading}`,tabIndex:-1,children:["Tasks (",Y.length,")"]})]})}),t.jsxs("div",{className:i.scrollRegion,children:[r?t.jsxs(t.Fragment,{children:[t.jsx(xe,{item:r,entityType:"workstream",ownerOptions:e.assigneeOptions,onChangeOwner:e.changeOwner?n=>e.changeOwner?.("workstream",r.id,n):void 0,workspaceId:e.currentWorkspaceId,currentActorId:e.currentOwnerId,taskReferences:e.taskReferences,hydrationState:de,onRetryHydration:e.hydrateEntity?()=>{e.hydrateEntity?.("workstream",r.id)}:void 0,onAddContextFile:e.addContextFile,onRemoveContextFile:e.removeContextFile,onUpdateContextCaption:e.updateContextCaption,onUpdate:e.updateEntity?n=>e.updateEntity("workstream",r.id,n):void 0,onArchive:e.archiveEntity?()=>e.archiveEntity("workstream",r.id):void 0,onUnarchive:e.unarchiveEntity?()=>e.unarchiveEntity("workstream",r.id):void 0,referenceAction:r.initiativeId?t.jsx(ie,{disabled:!e.assignWorkstreamToInitiative||h,onClick:()=>{I({entityType:"workstream",id:r.id,referenceLabel:G(r),title:r.title,parentLabel:a?`${J(a)} ${a.title}`.trim():"its initiative"})},title:"Unlink workstream from initiative",ariaLabel:"Unlink workstream from initiative",children:t.jsx(ae,{size:14,"aria-hidden":"true"})}):t.jsx(ne,{options:e.linkOptions.initiatives,entityLabel:"initiative",onSelect:Re,disabled:!e.assignWorkstreamToInitiative||h,iconTrigger:!0,triggerTitle:"Link initiative"})}),t.jsx(ne,{options:Ee,entityLabel:"task",onSelect:n=>ve("task",n),disabled:!e.attachTaskToWorkstream||h}),e.setTaskArrangeMode?t.jsx(De,{value:D,onChange:e.setTaskArrangeMode}):null]}):null,t.jsx(Fe,{tasks:Y,mode:D,onReorder:r&&e.reorderWorkstreamTasks?n=>e.reorderWorkstreamTasks?.(r.id,Me(ye(r.tasks??[],"execution"),n)):void 0,children:n=>{const o=He(n);return t.jsx(Be,{task:n,assigneeOption:n.assignee?w.get(n.assignee):void 0,assigneeOptions:e.assigneeOptions,showStatusLabel:e.showTaskCardStatusLabel,onOpen:()=>e.openTask(n.id),onAssigneeChange:e.setTaskAssignee?v=>e.setTaskAssignee?.(n.id,v):void 0,onStatusChange:e.setTaskStatus?v=>e.setTaskStatus?.(n.id,v):void 0,referenceInteractive:!1,referenceAction:t.jsx(ie,{disabled:!e.assignTaskToWorkstream||h,onClick:v=>{v.stopPropagation(),I({entityType:"task",id:n.id,referenceLabel:o||n.id,title:n.title,parentLabel:r?`${G(r)} ${r.title}`.trim():"its workstream"})},title:`Unlink ${o||n.title} from workstream`,ariaLabel:`Unlink ${o||n.title} from workstream`,children:t.jsx(ae,{size:14,"aria-hidden":"true"})})},n.id)}}),r&&R?.pane==="tasks"?pe:null,!r&&t.jsx("p",{className:`tf-text-helper ${i.empty}`,children:"Select a workstream."}),r&&Y.length===0&&t.jsx("p",{className:`tf-text-helper ${i.empty}`,children:"No tasks are linked to this workstream."})]})]})]}),t.jsx(Ue,{item:_,busy:h,theme:e.theme,onCancel:()=>I(null),onConfirm:()=>{Oe()}})]})}export{hn as PlanningModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,j as e}from"./vendor-react-CKJs5o3c.js";import{aN as ye,t as Oe,aO as Ke,aP as ke,aQ as ge,aR as he,aS as He,aT as qe}from"./index-CTsDBaef.js";import{bn as ze,w as Ye,K as We}from"./vendor-icons-Bsq-mcEn.js";import{u as Ge,a as Qe}from"./vendor-router-AqJMU8Lz.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";const Je="_plansWrapper_ojftl_1",Xe="_contentFrame_ojftl_24",Ze="_shellOwnsScroll_ojftl_32",et="_withChrome_ojftl_38",tt="_siteVariant_ojftl_42",nt="_title_ojftl_56",rt="_subtitle_ojftl_71",at="_header_ojftl_78",it="_planCard_ojftl_93",st="_grid_ojftl_106",ot="_pricingNotes_ojftl_114",ct="_planName_ojftl_123",lt="_featureText_ojftl_130",ut="_currentBadge_ojftl_134",dt="_navAction_ojftl_138",mt="_backBtn_ojftl_139",pt="_priceRows_ojftl_150",ft="_foundingBeta_ojftl_154",gt="_cloudCapacityNote_ojftl_176",ht="_headerBar_ojftl_258",yt="_headerActions_ojftl_267",_t="_debugMeta_ojftl_318",Ct="_planNoticeCard_ojftl_381",bt="_planDescription_ojftl_392",St="_teamComingSoonCard_ojftl_397",jt="_clickablePlanCard_ojftl_416",wt="_activePlanCard_ojftl_431",vt="_callToAction_ojftl_495",xt="_primaryCta_ojftl_507",Nt="_secondaryCta_ojftl_518",kt="_currentCta_ojftl_530",Pt="_featuresList_ojftl_544",It="_priceRow_ojftl_150",At="_regularPriceLine_ojftl_568",Tt="_campaignPriceLine_ojftl_569",Lt="_priceRowWithCampaign_ojftl_576",Rt="_priceRowAmount_ojftl_580",Et="_regularPriceDiscounted_ojftl_586",Bt="_priceRowInterval_ojftl_592",$t="_campaignPriceLabel_ojftl_601",Mt="_campaignPriceAmount_ojftl_606",Ut="_campaignPriceInterval_ojftl_612",Dt="_ctaRow_ojftl_617",Ft="_featureItem_ojftl_623",Vt="_featureIcon_ojftl_629",Ot="_featureLimitAccent_ojftl_643",Kt="_featureLimitUnit_ojftl_654",Ht="_featureTextBlock_ojftl_660",qt="_featureDescription_ojftl_666",zt="_emptyState_ojftl_672",Yt="_marketingEmptyState_ojftl_681",Wt="_emptyBadge_ojftl_715",Gt="_emptyHighlights_ojftl_730",Qt="_loader_ojftl_752",Jt="_spinner_ojftl_762",Xt="_statusBanner_ojftl_815",Zt="_successBanner_ojftl_823",en="_infoBanner_ojftl_829",tn="_errorBanner_ojftl_835",r={plansWrapper:Je,contentFrame:Xe,shellOwnsScroll:Ze,withChrome:et,siteVariant:tt,title:nt,subtitle:rt,header:at,planCard:it,grid:st,pricingNotes:ot,planName:ct,featureText:lt,currentBadge:ut,navAction:dt,backBtn:mt,priceRows:pt,foundingBeta:ft,cloudCapacityNote:gt,headerBar:ht,headerActions:yt,debugMeta:_t,planNoticeCard:Ct,planDescription:bt,teamComingSoonCard:St,clickablePlanCard:jt,activePlanCard:wt,callToAction:vt,primaryCta:xt,secondaryCta:Nt,currentCta:kt,featuresList:Pt,priceRow:It,regularPriceLine:At,campaignPriceLine:Tt,priceRowWithCampaign:Lt,priceRowAmount:Rt,regularPriceDiscounted:Et,priceRowInterval:Bt,campaignPriceLabel:$t,campaignPriceAmount:Mt,campaignPriceInterval:Ut,ctaRow:Dt,featureItem:Ft,featureIcon:Vt,featureLimitAccent:Ot,featureLimitUnit:Kt,featureTextBlock:Ht,featureDescription:qt,emptyState:zt,marketingEmptyState:Yt,emptyBadge:Wt,emptyHighlights:Gt,loader:Qt,spinner:Jt,statusBanner:Xt,successBanner:Zt,infoBanner:en,errorBanner:tn};function nn(){const t=globalThis.__DEBUG_MODE__;return typeof t=="boolean"?t:!1}function rn(t){const a=String(t?.environment||"").trim(),c=String(t?.runtimeMode||"").trim();return!a&&!c?null:a&&c?`${a} (${c})`:a||c||null}const an=new Set(["a","b","br","em","i","li","ol","p","strong","u","ul"]);function sn(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function on(t){const a=String(t||"").trim();if(!a)return"";if(typeof document>"u")return sn(a);const c=document.createElement("template");c.innerHTML=a;const p=document.createElement("div"),l=C=>{if(C.nodeType===Node.TEXT_NODE)return document.createTextNode(C.textContent||"");if(C.nodeType!==Node.ELEMENT_NODE)return null;const E=C,P=E.tagName.toLowerCase();if(P==="script"||P==="style")return null;const $=Array.from(E.childNodes).map(l).filter(h=>!!h);if(!an.has(P)){const h=document.createDocumentFragment();for(const W of $)h.appendChild(W);return h}const v=document.createElement(P);if(P==="a"){const h=String(E.getAttribute("href")||"").trim();/^(https?:|mailto:|\/|#)/i.test(h)&&(v.setAttribute("href",h),v.setAttribute("rel","noopener noreferrer"))}for(const h of $)v.appendChild(h);return v};for(const C of Array.from(c.content.childNodes)){const E=l(C);E&&p.appendChild(E)}return p.innerHTML}function cn(t,a){if(t==null||!a)return"Contact Sales";try{return new Intl.NumberFormat("en-US",{style:"currency",currency:a.toUpperCase(),minimumFractionDigits:0}).format(t/100)}catch{return`${a.toUpperCase()} ${t/100}`}}function ln(){return"$0"}function O(t){return t?t.pricingType==="free"?!0:t.unitAmount!=null&&t.currency!=null:!1}function Te(t){return t?t.pricingType==="free"?ln():cn(t.unitAmount,t.currency):"Unavailable"}function Le(t,a){return O(a)?{price:a,pricingAudience:"campaign"}:{price:t,pricingAudience:"public"}}function un(t,a,c,p){const l=O(t)||O(c),C=O(a)||O(p);if(!l&&!C)return null;const E=(P,$,v)=>{if(!O(P)&&!O($))return null;const h=O($),W=v==="year"?"year":"month";return e.jsxs("div",{className:`${r.priceRow} ${h?r.priceRowWithCampaign:""}`,children:[O(P)?e.jsxs("div",{className:r.regularPriceLine,children:[e.jsx("span",{className:`${r.priceRowAmount} ${h?r.regularPriceDiscounted:""}`,children:Te(P)}),e.jsxs("span",{className:r.priceRowInterval,children:["/ ",W]})]}):null,h?e.jsxs("div",{className:r.campaignPriceLine,children:[e.jsx("span",{className:r.campaignPriceLabel,children:"Founding Offer:"}),e.jsx("span",{className:r.campaignPriceAmount,children:Te($)}),e.jsxs("span",{className:r.campaignPriceInterval,children:["/ ",W]})]}):null]},v)};return e.jsxs("div",{className:r.priceRows,children:[E(t,c,"month"),E(a,p,"year")]})}function Re(t){const a=[t.pricing.month,t.pricing.year].filter(Boolean);if(a.some(p=>p.pricingType==="free"))return 0;const c=a.map(p=>p.pricingType==="stripe"&&typeof p.unitAmount=="number"?p.unitAmount:null).filter(p=>p!=null);return c.length>0?Math.min(...c):Number.POSITIVE_INFINITY}function dn(t){return String(t||"").replace(/[_\-.]+/g," ").replace(/\b\w/g,a=>a.toUpperCase())}function Pe(t,a){const c=t?.[a],p=Number(c);return Number.isFinite(p)?Math.max(1,Math.floor(p)):null}const Ee="Unlimited";function we(t,a){return a!==1?t:t.replace(/\b([A-Za-z]+)ies\b$/,"$1y").replace(/\b([A-Za-z]+[^s\s])s\b$/,"$1")}function mn(t){return t<=1e3?{value:String(t),unit:"MB"}:{value:String(Math.round(t/1e3)),unit:"GB"}}function pn(t,a){const c=String(t.publicLabel||t.label||"").trim()||dn(t.featureKey),p=t.config&&typeof t.config=="object"?t.config:{};if(t.featureKey==="context.uploads"){const l=Pe(p,"storageLimitMb");if(l!==null){const C=mn(l);return{limitValue:C.value,limitUnit:C.unit,baseLabel:we(c,l)}}}if(t.featureKey==="workspace.workspaces"){const l=Pe(p,"maxWorkspaces");if(l!==null)return{limitValue:String(l),limitUnit:null,baseLabel:we(c,l)};if(t.access!=="disabled")return{limitValue:Ee,limitUnit:null,baseLabel:c}}if(t.featureKey==="collaboration.ai_profiles"){const l=Pe(p,"maxAiProfiles");if(l!==null)return{limitValue:String(l),limitUnit:null,baseLabel:we(c,l)};if(t.access!=="disabled")return{limitValue:Ee,limitUnit:null,baseLabel:c}}if(t.featureKey==="collaboration.team_management"){const l=Number(a);if(Number.isFinite(l)&&l>0){const C=Math.floor(l);return{limitValue:String(C),limitUnit:null,baseLabel:we(c,C)}}}return{limitValue:null,limitUnit:null,baseLabel:c}}function fn({heading:t,subtitle:a,variant:c="app",theme:p="dark",chrome:l,footer:C,isAuthenticated:E,authSessionResolved:P=!0,currentPlanId:$,currentPlanVersionId:v,currentEntitlementState:h,markCurrentPlan:W,canManageCurrentPlan:G=!0,pricingEndpoint:I,statusBanner:H,onBack:A,backLabel:T,backDisabled:M=!1,topActions:se,shellOwnsScroll:_e=!1,showPageBackButton:X=!0,showHeaderBarWithChrome:re=!1,preferPricingPageTitle:Ce=!0,currentPlanCardActionMode:be="manage",fallbackPricingSource:g=null,onSelectPlan:q}){const[Z,Q]=s.useState([]),[oe,F]=s.useState(null),[x,L]=s.useState({pageTitle:null,pageDescription:null}),[ce,z]=s.useState(!0),[le,ue]=s.useState(null),[Se,ee]=s.useState(0);s.useEffect(()=>{let i=!0;return(async()=>{const D=String(I||"/api/taskforce/public/pricing").trim()||"/api/taskforce/public/pricing";i&&(z(!0),ue(null));try{const w=await fetch(D,{method:"GET",credentials:"include"}),u=await w.json().catch(()=>({}));if(w.ok){i&&(Q(Array.isArray(u?.plans)?u.plans:[]),F(u?.pricingSource&&typeof u.pricingSource=="object"?u.pricingSource:null),L({pageTitle:typeof u?.pageTitle=="string"&&u.pageTitle.trim()||null,pageDescription:typeof u?.pageDescription=="string"&&u.pageDescription.trim()||null}));return}throw new Error(String(u?.error||`Failed to load pricing (${w.status})`))}catch(w){if(i){const u=w instanceof Error?w.message:"Failed to load pricing";ue(u||"Failed to load pricing"),F(null),L({pageTitle:null,pageDescription:null})}}finally{i&&z(!1)}})(),()=>{i=!1}},[I,Se]);const J=s.useMemo(()=>[...Z].sort((i,U)=>{const D=Re(i),w=Re(U);if(D!==w)return D-w;const u=i.defaultVersion?.versionNumber||0,V=U.defaultVersion?.versionNumber||0;return u!==V?u-V:String(i.displayName||i.planId).localeCompare(String(U.displayName||U.planId))}),[Z]),de=s.useMemo(()=>rn(oe||g),[g,oe]),ve=String((Ce?x.pageTitle:null)||t).trim()||t,me=String(x.pageDescription||a||"").trim(),j=s.useMemo(()=>on(me),[me]),te=P,pe=`${r.plansWrapper} ${_e?r.shellOwnsScroll:"tf-scrollbar"} ${c==="site"?r.siteVariant:""} ${l?r.withChrome:""}`.trim(),B=i=>_e?e.jsxs(e.Fragment,{children:[l,i,C]}):e.jsxs("div",{className:Oe.standaloneWrapper,"data-theme":p,children:[l,i,C]});return B(ce?e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsx("div",{className:r.contentFrame,children:e.jsxs("div",{className:r.loader,children:[e.jsx(Ye,{size:48,className:r.spinner}),e.jsx("p",{children:"Loading plans..."})]})})})}):le?e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsx("div",{className:r.contentFrame,children:e.jsxs("div",{className:r.emptyState,children:[e.jsx("h2",{children:"Connecting to plan pricing..."}),e.jsx("p",{children:le}),e.jsx("button",{className:r.backBtn,onClick:()=>ee(i=>i+1),children:"Retry"})]})})})}):e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsxs("div",{className:r.contentFrame,children:[e.jsxs("div",{className:r.header,children:[(!l||re)&&(X||se)&&e.jsxs("div",{className:r.headerBar,children:[e.jsx("div",{children:X?e.jsx("button",{className:r.backBtn,onClick:A,disabled:M,children:T}):null}),e.jsx("div",{className:r.headerActions,children:se})]}),e.jsx("h1",{className:r.title,children:ve}),j&&e.jsx("div",{className:r.subtitle,dangerouslySetInnerHTML:{__html:j}}),nn()&&de?e.jsxs("p",{className:r.debugMeta,children:["Pricing source: ",de]}):null,H&&e.jsx("div",{className:`${r.statusBanner} ${H.type==="success"?r.successBanner:H.type==="info"?r.infoBanner:r.errorBanner}`,children:H.message})]}),e.jsxs("section",{className:r.foundingBeta,"aria-labelledby":"founding-beta-heading",children:[e.jsx("h2",{id:"founding-beta-heading",children:"Founding beta"}),e.jsx("p",{children:"Taskforce is in founding beta. You may run into rough edges while we improve cloud workspaces and agent workflows. Early members get access while the product is still forming, plus a direct role in shaping what comes next."})]}),J.length===0?e.jsxs("div",{className:`${r.emptyState} ${r.marketingEmptyState}`,children:[e.jsx("span",{className:r.emptyBadge,children:"Coming Soon"}),e.jsx("h2",{children:"Paid plans are getting their final polish."}),e.jsx("p",{children:"Taskforce pricing is on the way with flexible options for solo operators, teams, and larger rollouts. Check back soon for launch tiers, feature bundles, and early access details."}),e.jsxs("div",{className:r.emptyHighlights,"aria-label":"Upcoming pricing highlights",children:[e.jsx("span",{children:"Launch-ready tiers"}),e.jsx("span",{children:"Team billing controls"}),e.jsx("span",{children:"Feature-based packaging"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:r.grid,children:J.map(i=>{const U=i.pricing.month,D=i.pricing.year,w=i.campaignPricing?.month||null,u=i.campaignPricing?.year||null,V=Le(U,w),K=Le(D,u),Y=O(V.price),ae=O(K.price),ie=Y&&ae,N=String(i.defaultVersion?.planVersionId||"").trim(),xe=ye(h),fe=W??xe,Ne=!!(N&&v&&v===N)||!!(!v&&($&&$===i.planId)),ne=fe&&Ne&&h!=="canceled",n=Y?"month":ae?"year":null,o=n==="year"?K:V,_=be==="manage",f=be==="indicator",y=te&&!!N&&(ne?_&&G:!!n),m=()=>{if(N){if(ne){if(!_||!G)return;q({planId:i.planId,planVersionId:N,interval:n||"month",pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!0});return}n&&q({planId:i.planId,planVersionId:N,interval:n,pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!1})}};return e.jsxs("div",{className:`${r.planCard} ${ne?r.activePlanCard:""} ${y?r.clickablePlanCard:""}`,"data-testid":`plan-card-${i.planId}`,role:y?"button":void 0,tabIndex:y?0:void 0,onClick:y?m:void 0,onKeyDown:y?d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),m())}:void 0,children:[ne&&e.jsx("span",{className:r.currentBadge,children:"Current Plan"}),e.jsx("h3",{className:r.planName,children:i.displayName}),un(U,D,w,u),String(i.description||"").trim()&&e.jsx("p",{className:r.planDescription,children:String(i.description||"").trim()}),e.jsx("div",{className:r.featuresList,children:Array.isArray(i.features)&&i.features.length>0?i.features.map((d,S)=>e.jsxs("div",{className:r.featureItem,children:[e.jsx(ze,{className:r.featureIcon}),e.jsxs("div",{className:r.featureTextBlock,children:[(()=>{const{limitValue:k,limitUnit:b,baseLabel:R}=pn(d,i.defaultVersion?.seatLimit);return e.jsxs("span",{className:r.featureText,children:[k&&e.jsxs("span",{className:r.featureLimitAccent,children:[e.jsx("span",{children:k}),b?e.jsx("span",{className:r.featureLimitUnit,children:b}):null]}),e.jsx("span",{children:k?` ${R}`:R})]})})(),d.publicDescriptionVisible!==!1&&String(d.publicDescription||d.description||"").trim()&&e.jsx("span",{className:r.featureDescription,children:String(d.publicDescription||d.description||"").trim()})]})]},`${d.featureKey}-${S}`)):e.jsx("span",{className:r.featureText,children:"No additional features included"})}),ne?_?e.jsx("button",{className:`${r.callToAction} ${r.currentCta}`,"data-testid":`plan-manage-${i.planId}`,onClick:d=>{d.stopPropagation(),G&&q({planId:i.planId,planVersionId:N,interval:n||"month",pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!0})},disabled:!N||!G||!te,children:E&&G?"Manage Plan":"Current Plan"}):f?e.jsx("button",{className:`${r.callToAction} ${r.currentCta}`,"data-testid":`plan-current-${i.planId}`,disabled:!0,children:"Current Plan"}):null:e.jsxs("div",{className:r.ctaRow,children:[Y?e.jsx("button",{className:`${r.callToAction} ${r.secondaryCta}`,"data-testid":`plan-select-${i.planId}-month`,onClick:d=>{d.stopPropagation(),q({planId:i.planId,planVersionId:N,interval:"month",pricingType:V.price?.pricingType||"stripe",pricingAudience:V.pricingAudience,isCurrentPlan:!1})},disabled:!N||!te,children:ie?"Start Monthly":"Get Started"}):null,ae?e.jsx("button",{className:`${r.callToAction} ${r.primaryCta}`,"data-testid":`plan-select-${i.planId}-year`,onClick:d=>{d.stopPropagation(),q({planId:i.planId,planVersionId:N,interval:"year",pricingType:K.price?.pricingType||"stripe",pricingAudience:K.pricingAudience,isCurrentPlan:!1})},disabled:!N||!te,children:ie?"Start Yearly":"Get Started"}):null]})]},i.planId)})}),e.jsxs("div",{className:r.pricingNotes,children:[e.jsx("p",{children:"Prices are listed in USD. Taxes may apply."}),e.jsx("p",{children:"Local install is free on every plan. Cloud limits apply only to hosted workspaces."})]}),e.jsxs("section",{className:`${r.foundingBeta} ${r.cloudCapacityNote}`,"aria-labelledby":"cloud-capacity-heading",children:[e.jsx("h2",{id:"cloud-capacity-heading",children:"Need more cloud capacity?"}),e.jsx("p",{children:"Pro users can request expanded limits for cloud workspaces, AI agents, and storage."}),e.jsxs("p",{children:["Contact ",e.jsx("a",{href:"mailto:support@taskforcehq.ai",children:"support@taskforcehq.ai"})," to discuss capacity needs."]})]}),e.jsxs("div",{className:`${r.planCard} ${r.planNoticeCard} ${r.teamComingSoonCard}`,children:[e.jsx("h2",{className:r.planName,children:"Team workspaces are coming soon."}),e.jsx("p",{className:r.planDescription,children:"Shared workspaces, collaborators, team agent rosters, admin controls, and larger cloud limits are in development."})]})]})]})})}))}const gn=1600,Be=[0,500,1e3,2e3],hn=5e3,yn=45e3,_n="Choose a plan to continue.";function Cn(t,a){if(t===401)return!0;const c=String(a||"").trim().toUpperCase();return c==="CHECKOUT_SESSION_INCOMPLETE"||c==="CHECKOUT_PLAN_VERSION_UNRESOLVED"}function bn(t){return t==="year"?"year":"month"}function Sn(t){return t==="campaign"?"campaign":"public"}function Ie(t){const a=String(t||"").trim().toLowerCase();return a==="year"?"year":a==="month"?"month":null}function $e(t){const a=String(t||"").trim();return a?a.replace(/\/+$/,""):""}function Ae(t={}){const a=new URLSearchParams;a.set("screen","plans");for(const[c,p]of Object.entries(t)){const l=String(p||"").trim();l&&a.set(c,l)}return`/?${a.toString()}`}function Tn({isAuthenticated:t,authUserId:a,runtimeMode:c,authSessionResolved:p,currentTheme:l="dark",projectName:C,currentWorkspaceId:E,apiBaseUrl:P,connectedEnvironmentSource:$,resolveCloudAuthUrl:v,embedded:h=!1,shellOwnsScroll:W=!1,onAccountProfileSummaryChange:G,onContinueToTaskforce:I,continueBusy:H=!1}){const A=Ge(),T=Qe(),[M,se]=s.useState(null),[_e,X]=s.useState(!1),[re,Ce]=s.useState(!1),[be,g]=s.useState(null),q=s.useRef(!1),Z=s.useRef(null),Q=s.useRef(null),oe=s.useRef(I),F=s.useMemo(()=>new URLSearchParams(T.search),[T.search]),x=String(F.get("checkout")||"").trim().toLowerCase(),L=String(F.get("gate")||"").trim().toLowerCase(),ce=String(F.get("planId")||"").trim(),z=String(F.get("planVersionId")||"").trim(),le=bn(F.get("interval")),ue=Sn(F.get("pricingAudience")),Se=Ie(F.get("interval")),ee=String(F.get("session_id")||"").trim(),J=s.useMemo(()=>$e(P),[P]),de=s.useMemo(()=>$e($),[$]),ve=s.useMemo(()=>({environment:Ke(de||J),runtimeMode:c==="cloud"?"cloud":"local"}),[J,de,c]),me=s.useCallback(n=>{const o=String(n||"").trim();return J?`${J}${o.startsWith("/")?o:`/${o}`}`:o},[J]),j=s.useCallback(n=>v?v(n):me(n),[me,v]),te=s.useCallback(()=>{const n=new URLSearchParams(T.search);n.delete("screen"),n.delete("gate"),n.delete("checkout"),n.delete("planId"),n.delete("planVersionId"),n.delete("interval"),n.delete("pricingAudience");const o=n.toString();A(`/${o?`?${o}`:""}${T.hash||""}`)},[T.hash,T.search,A]),pe=s.useMemo(()=>j("/api/taskforce/public/pricing"),[j]),B=s.useMemo(()=>ke(M,L),[M,L]),i=s.useMemo(()=>B.allowReturnToApp,[B.allowReturnToApp]),U=s.useMemo(()=>{const n=String(B.message||"").trim();return!n||n===_n?null:n},[B.message]),D=s.useCallback(()=>{const n=new URLSearchParams(T.search);n.delete("checkout"),n.delete("session_id"),n.delete("gate"),n.delete("planId"),n.delete("planVersionId"),n.delete("interval");const o=n.toString();A(`${T.pathname}${o?`?${o}`:""}${T.hash||""}`,{replace:!0})},[T.hash,T.pathname,T.search,A]),w=s.useCallback(()=>{Q.current!=null&&window.clearTimeout(Q.current),Q.current=window.setTimeout(()=>{D(),Q.current=null},gn)},[D]);s.useEffect(()=>{oe.current=I},[I]);const u=s.useCallback(async n=>{const o=j(ge);if(!t)return se(null),he(o,{identityKey:a}),null;try{const _=await He(o,{identityKey:a,force:n?.force===!0});return se(_),G?.(_),_}catch{return null}},[a,j,t,G]),V=s.useCallback((n,o,_)=>{const f=String(o||"").trim();if(_?.preferFallback&&f)return f;const y=ke(n,L).message;return y||f||"Unable to confirm checkout completion."},[L]),K=s.useCallback((n,o)=>!ke(n,o).allowReturnToApp,[]),Y=s.useCallback(async(n,o,_="public",f)=>{if(!n){g({type:"error",message:"Selected plan is missing a default plan version."});return}X(!0),g(null);try{const y=await fetch(j("/api/taskforce/billing/checkout-session"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({planVersionId:n,interval:o,pricingAudience:_})}),m=await y.json().catch(()=>({}));if(!y.ok){g({type:"error",message:String(m?.error||"Unable to start checkout for selected plan.")});return}const d=String(m?.checkoutState||"").trim().toLowerCase();if(d==="free"){g({type:"success",message:"Plan selected. Your access is ready."}),he(j(ge),{identityKey:a});const b=await u({force:!0}),R=String(b?.entitlementState||"").trim().toLowerCase();f?.autoContinueOnActivation===!0&&ye(R)&&await I?.();return}if(d==="updated"){g({type:"success",message:String(m?.message||"Your subscription was updated successfully.")}),he(j(ge),{identityKey:a});const b=await u({force:!0}),R=String(b?.entitlementState||"").trim().toLowerCase();f?.autoContinueOnActivation===!0&&ye(R)&&await I?.();return}if(d==="already_current_plan"){g({type:"success",message:String(m?.message||"You are already on this plan.")}),he(j(ge),{identityKey:a}),await u();return}const S=String(m?.returnBaseUrl||"").trim();if(c==="local"&&S)try{const b=window.location.origin,R=new URL(S,b).origin;if(R!==b){g({type:"error",message:`Checkout return is misconfigured for this runtime. Expected ${b} but got ${R}.`});return}}catch{g({type:"error",message:"Checkout return URL is invalid for this runtime."});return}const k=String(m?.url||"").trim();if(!k){g({type:"error",message:"Checkout did not return a redirect URL."});return}window.location.assign(k)}catch{g({type:"error",message:"Unable to start checkout for selected plan."})}finally{X(!1)}},[a,j,u,I,c]),ae=s.useCallback(async(n,o)=>{if(!n)return{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1};const _=async()=>{he(j(ge),{identityKey:a});const f=await u({force:!0}),y=String(f?.entitlementState||"").trim().toLowerCase();if(!ye(y))return!1;const m=ce,d=z,S=Se,k=String(f?.planId||"").trim(),b=String(f?.planVersionId||"").trim(),R=Ie(f?.billingInterval??null),je=o?.preConfirmationSummary??null,Me=String(je?.entitlementState||"").trim().toLowerCase(),Ue=ye(Me),De=String(je?.planId||"").trim(),Fe=String(je?.planVersionId||"").trim(),Ve=Ie(je?.billingInterval??null);return m&&k&&k!==m||d&&b&&b!==d||S&&R&&R!==S||Ue&&!(!!m&&k===m&&De!==k)&&!(!!d&&b===d&&Fe!==b)&&!(!!S&&R===S&&Ve!==R)?!1:(o?.autoContinueOnActivation===!0&&await oe.current?.(),!0)};try{const f=await fetch(j("/api/taskforce/billing/checkout-session/confirm"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n})}),y=await f.json().catch(()=>({}));if(!f.ok){const m=String(y?.code||"").trim(),d=Cn(f.status,m);return d&&await _()?{confirmed:!0}:{confirmed:!1,errorMessage:String(y?.error||"Unable to confirm checkout completion."),retryable:d}}return await _()?{confirmed:!0}:{confirmed:!0}}catch{return{confirmed:!1,errorMessage:"Unable to confirm checkout completion.",retryable:!0}}},[a,j,u,Se,ce,z]),ie=s.useCallback(async()=>{if(!t){A(`/login?mode=login&next=${encodeURIComponent(Ae())}`);return}X(!0),g({type:"info",message:"Opening billing portal..."});try{const n=await fetch(j("/api/taskforce/billing/portal-session"),{method:"POST",credentials:"include"}),o=await n.json().catch(()=>({}));if(!n.ok){g({type:"error",message:String(o?.error||"Failed to open billing portal.")});return}const _=String(o?.url||"").trim();if(!_){g({type:"error",message:"Portal session did not return a redirect URL."});return}window.location.assign(_)}catch{g({type:"error",message:"Failed to open billing portal."})}finally{X(!1)}},[j,t,A]),N=s.useCallback(async()=>{if(!(!I||re||H)){Ce(!0);try{await I()}finally{Ce(!1)}}},[re,H,I]);s.useEffect(()=>{u()},[u]),s.useEffect(()=>{i&&L==="missing_entitlement"&&D()},[D,L,i]),s.useEffect(()=>()=>{Q.current!=null&&window.clearTimeout(Q.current)},[]),s.useEffect(()=>{x!=="success"&&(Z.current=null)},[x]),s.useEffect(()=>{let n=!1;const o=new Set,_=async f=>{f<=0||await new Promise(y=>{const m=window.setTimeout(()=>{o.delete(m),y()},f);o.add(m)})};if(x==="success"){if(q.current=!0,g({type:"success",message:"Checkout completed successfully. Finalizing your plan..."}),!t&&!p)return()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()};if(!t)return g({type:"error",message:"Sign in to finish activating your plan."}),()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()};const y=ee||"__missing_session__";return Z.current===y?()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()}:((async()=>{const m=Date.now(),d=await u({force:!0});if(n)return;let S=ee?{confirmed:!1,errorMessage:"Unable to confirm checkout completion.",retryable:!0}:{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1},k=0;for(;;){const b=k<Be.length?Be[k]:hn;if(k+=1,await _(b),n||(S=ee?await ae(ee,{autoContinueOnActivation:K(d,L),preConfirmationSummary:d}):{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1},n))return;if(S.confirmed){Z.current=y,g({type:"success",message:"Checkout completed successfully."}),w();return}if(!S.retryable||Date.now()-m>=yn)break}if(!n&&!S.confirmed){const b=await u({force:!0});if(n)return;S.retryable||(Z.current=y),g({type:"error",message:V(b,S.errorMessage,{preferFallback:!S.retryable})}),S.retryable||w();return}})(),()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()})}if(x==="cancel"){(async()=>{const f=await u({force:!0});g({type:"error",message:V(f,"Checkout was canceled. No charge was made.")}),w()})();return}if((x==="start"||x==="free")&&t&&z&&!q.current){q.current=!0,(async()=>{const f=await u({force:!0});await Y(z,le,ue,{autoContinueOnActivation:K(f,L)})})();return}},[p,x,ae,L,t,u,le,z,ue,ee,V,w,K,Y]),s.useEffect(()=>{if(!(x==="success"||x==="cancel"||x==="start"||x==="free")){if(U){g({type:B.statusTone,message:U});return}g(n=>!n||n.type!=="error"?n:n.message===B.message?null:n)}},[x,U,B.message,B.statusTone]);const xe=s.useCallback(async n=>{if(!t){const _=n.pricingType==="free"?"free":"start",f=Ae({checkout:_,planId:n.planId,planVersionId:n.planVersionId,interval:n.interval,pricingAudience:n.pricingAudience});A(`/login?mode=register&planId=${encodeURIComponent(n.planId)}&planVersionId=${encodeURIComponent(n.planVersionId)}&interval=${encodeURIComponent(n.interval)}&pricingAudience=${encodeURIComponent(n.pricingAudience)}&next=${encodeURIComponent(f)}`);return}if(n.isCurrentPlan){if(!M?.stripeCustomerId){g({type:"success",message:"Your current plan does not use Stripe billing."});return}await ie();return}const o=K(M,L);if(n.pricingType==="free"){await Y(n.planVersionId,n.interval,n.pricingAudience,{autoContinueOnActivation:o});return}await Y(n.planVersionId,n.interval,n.pricingAudience,{autoContinueOnActivation:o})},[M,L,t,A,ie,K,Y]),fe=s.useCallback(()=>{if(i&&I){N();return}if(h){te();return}if(window.history.length>1){A(-1);return}A("/")},[te,h,N,i,A,I]),Ne=h?null:e.jsxs(e.Fragment,{children:[e.jsx("button",{className:r.navAction,onClick:fe,disabled:H||re||t&&!i,children:i?"Take Me to Taskforce":"Back"}),t&&M?.stripeCustomerId&&e.jsx("button",{className:r.navAction,onClick:()=>{ie()},disabled:_e,children:"Manage billing"}),!t&&e.jsxs("button",{className:r.navAction,onClick:()=>A(`/login?mode=login&next=${encodeURIComponent(Ae())}`),children:[e.jsx(We,{size:16,style:{marginRight:"8px",verticalAlign:"text-bottom"}}),"Sign In"]})]}),ne=h?null:e.jsx(qe,{projectName:C,currentWorkspaceId:E,runtimeMode:c==="cloud"?"cloud":"local",theme:l,onBrandClick:fe,actions:Ne});return e.jsx(fn,{chrome:ne,heading:"Subscription Plans",subtitle:"Manage your subscription and explore available features. Your current plan is highlighted below.",variant:"site",theme:l,isAuthenticated:t,authSessionResolved:p,currentPlanId:String(M?.planId||ce||"").trim()||null,currentPlanVersionId:String(M?.planVersionId||z||"").trim()||null,currentEntitlementState:String(M?.entitlementState||"").trim()||null,markCurrentPlan:B.markCurrentPlan,canManageCurrentPlan:!!M?.stripeCustomerId,pricingEndpoint:pe,statusBanner:be,onBack:fe,backLabel:i?"Take Me to Taskforce":h?"Back to Board":"Back to App",backDisabled:H||re||t&&!i,topActions:null,shellOwnsScroll:W,showPageBackButton:!1,showHeaderBarWithChrome:!1,currentPlanCardActionMode:"manage",fallbackPricingSource:ve,onSelectPlan:xe})}export{Tn as PlansPage};
|
|
1
|
+
import{r as s,j as e}from"./vendor-react-CKJs5o3c.js";import{aO as ye,t as Oe,aP as Ke,aQ as ke,aR as ge,aS as he,aT as He,aU as qe}from"./index-DSQINwt9.js";import{bn as ze,w as Ye,K as We}from"./vendor-icons-Bsq-mcEn.js";import{u as Ge,a as Qe}from"./vendor-router-AqJMU8Lz.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";const Je="_plansWrapper_ojftl_1",Xe="_contentFrame_ojftl_24",Ze="_shellOwnsScroll_ojftl_32",et="_withChrome_ojftl_38",tt="_siteVariant_ojftl_42",nt="_title_ojftl_56",rt="_subtitle_ojftl_71",at="_header_ojftl_78",it="_planCard_ojftl_93",st="_grid_ojftl_106",ot="_pricingNotes_ojftl_114",ct="_planName_ojftl_123",lt="_featureText_ojftl_130",ut="_currentBadge_ojftl_134",dt="_navAction_ojftl_138",mt="_backBtn_ojftl_139",pt="_priceRows_ojftl_150",ft="_foundingBeta_ojftl_154",gt="_cloudCapacityNote_ojftl_176",ht="_headerBar_ojftl_258",yt="_headerActions_ojftl_267",_t="_debugMeta_ojftl_318",Ct="_planNoticeCard_ojftl_381",bt="_planDescription_ojftl_392",St="_teamComingSoonCard_ojftl_397",jt="_clickablePlanCard_ojftl_416",wt="_activePlanCard_ojftl_431",vt="_callToAction_ojftl_495",xt="_primaryCta_ojftl_507",Nt="_secondaryCta_ojftl_518",kt="_currentCta_ojftl_530",Pt="_featuresList_ojftl_544",It="_priceRow_ojftl_150",At="_regularPriceLine_ojftl_568",Tt="_campaignPriceLine_ojftl_569",Lt="_priceRowWithCampaign_ojftl_576",Rt="_priceRowAmount_ojftl_580",Et="_regularPriceDiscounted_ojftl_586",Bt="_priceRowInterval_ojftl_592",$t="_campaignPriceLabel_ojftl_601",Mt="_campaignPriceAmount_ojftl_606",Ut="_campaignPriceInterval_ojftl_612",Dt="_ctaRow_ojftl_617",Ft="_featureItem_ojftl_623",Vt="_featureIcon_ojftl_629",Ot="_featureLimitAccent_ojftl_643",Kt="_featureLimitUnit_ojftl_654",Ht="_featureTextBlock_ojftl_660",qt="_featureDescription_ojftl_666",zt="_emptyState_ojftl_672",Yt="_marketingEmptyState_ojftl_681",Wt="_emptyBadge_ojftl_715",Gt="_emptyHighlights_ojftl_730",Qt="_loader_ojftl_752",Jt="_spinner_ojftl_762",Xt="_statusBanner_ojftl_815",Zt="_successBanner_ojftl_823",en="_infoBanner_ojftl_829",tn="_errorBanner_ojftl_835",r={plansWrapper:Je,contentFrame:Xe,shellOwnsScroll:Ze,withChrome:et,siteVariant:tt,title:nt,subtitle:rt,header:at,planCard:it,grid:st,pricingNotes:ot,planName:ct,featureText:lt,currentBadge:ut,navAction:dt,backBtn:mt,priceRows:pt,foundingBeta:ft,cloudCapacityNote:gt,headerBar:ht,headerActions:yt,debugMeta:_t,planNoticeCard:Ct,planDescription:bt,teamComingSoonCard:St,clickablePlanCard:jt,activePlanCard:wt,callToAction:vt,primaryCta:xt,secondaryCta:Nt,currentCta:kt,featuresList:Pt,priceRow:It,regularPriceLine:At,campaignPriceLine:Tt,priceRowWithCampaign:Lt,priceRowAmount:Rt,regularPriceDiscounted:Et,priceRowInterval:Bt,campaignPriceLabel:$t,campaignPriceAmount:Mt,campaignPriceInterval:Ut,ctaRow:Dt,featureItem:Ft,featureIcon:Vt,featureLimitAccent:Ot,featureLimitUnit:Kt,featureTextBlock:Ht,featureDescription:qt,emptyState:zt,marketingEmptyState:Yt,emptyBadge:Wt,emptyHighlights:Gt,loader:Qt,spinner:Jt,statusBanner:Xt,successBanner:Zt,infoBanner:en,errorBanner:tn};function nn(){const t=globalThis.__DEBUG_MODE__;return typeof t=="boolean"?t:!1}function rn(t){const a=String(t?.environment||"").trim(),c=String(t?.runtimeMode||"").trim();return!a&&!c?null:a&&c?`${a} (${c})`:a||c||null}const an=new Set(["a","b","br","em","i","li","ol","p","strong","u","ul"]);function sn(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function on(t){const a=String(t||"").trim();if(!a)return"";if(typeof document>"u")return sn(a);const c=document.createElement("template");c.innerHTML=a;const p=document.createElement("div"),l=C=>{if(C.nodeType===Node.TEXT_NODE)return document.createTextNode(C.textContent||"");if(C.nodeType!==Node.ELEMENT_NODE)return null;const E=C,P=E.tagName.toLowerCase();if(P==="script"||P==="style")return null;const $=Array.from(E.childNodes).map(l).filter(h=>!!h);if(!an.has(P)){const h=document.createDocumentFragment();for(const W of $)h.appendChild(W);return h}const v=document.createElement(P);if(P==="a"){const h=String(E.getAttribute("href")||"").trim();/^(https?:|mailto:|\/|#)/i.test(h)&&(v.setAttribute("href",h),v.setAttribute("rel","noopener noreferrer"))}for(const h of $)v.appendChild(h);return v};for(const C of Array.from(c.content.childNodes)){const E=l(C);E&&p.appendChild(E)}return p.innerHTML}function cn(t,a){if(t==null||!a)return"Contact Sales";try{return new Intl.NumberFormat("en-US",{style:"currency",currency:a.toUpperCase(),minimumFractionDigits:0}).format(t/100)}catch{return`${a.toUpperCase()} ${t/100}`}}function ln(){return"$0"}function O(t){return t?t.pricingType==="free"?!0:t.unitAmount!=null&&t.currency!=null:!1}function Te(t){return t?t.pricingType==="free"?ln():cn(t.unitAmount,t.currency):"Unavailable"}function Le(t,a){return O(a)?{price:a,pricingAudience:"campaign"}:{price:t,pricingAudience:"public"}}function un(t,a,c,p){const l=O(t)||O(c),C=O(a)||O(p);if(!l&&!C)return null;const E=(P,$,v)=>{if(!O(P)&&!O($))return null;const h=O($),W=v==="year"?"year":"month";return e.jsxs("div",{className:`${r.priceRow} ${h?r.priceRowWithCampaign:""}`,children:[O(P)?e.jsxs("div",{className:r.regularPriceLine,children:[e.jsx("span",{className:`${r.priceRowAmount} ${h?r.regularPriceDiscounted:""}`,children:Te(P)}),e.jsxs("span",{className:r.priceRowInterval,children:["/ ",W]})]}):null,h?e.jsxs("div",{className:r.campaignPriceLine,children:[e.jsx("span",{className:r.campaignPriceLabel,children:"Founding Offer:"}),e.jsx("span",{className:r.campaignPriceAmount,children:Te($)}),e.jsxs("span",{className:r.campaignPriceInterval,children:["/ ",W]})]}):null]},v)};return e.jsxs("div",{className:r.priceRows,children:[E(t,c,"month"),E(a,p,"year")]})}function Re(t){const a=[t.pricing.month,t.pricing.year].filter(Boolean);if(a.some(p=>p.pricingType==="free"))return 0;const c=a.map(p=>p.pricingType==="stripe"&&typeof p.unitAmount=="number"?p.unitAmount:null).filter(p=>p!=null);return c.length>0?Math.min(...c):Number.POSITIVE_INFINITY}function dn(t){return String(t||"").replace(/[_\-.]+/g," ").replace(/\b\w/g,a=>a.toUpperCase())}function Pe(t,a){const c=t?.[a],p=Number(c);return Number.isFinite(p)?Math.max(1,Math.floor(p)):null}const Ee="Unlimited";function we(t,a){return a!==1?t:t.replace(/\b([A-Za-z]+)ies\b$/,"$1y").replace(/\b([A-Za-z]+[^s\s])s\b$/,"$1")}function mn(t){return t<=1e3?{value:String(t),unit:"MB"}:{value:String(Math.round(t/1e3)),unit:"GB"}}function pn(t,a){const c=String(t.publicLabel||t.label||"").trim()||dn(t.featureKey),p=t.config&&typeof t.config=="object"?t.config:{};if(t.featureKey==="context.uploads"){const l=Pe(p,"storageLimitMb");if(l!==null){const C=mn(l);return{limitValue:C.value,limitUnit:C.unit,baseLabel:we(c,l)}}}if(t.featureKey==="workspace.workspaces"){const l=Pe(p,"maxWorkspaces");if(l!==null)return{limitValue:String(l),limitUnit:null,baseLabel:we(c,l)};if(t.access!=="disabled")return{limitValue:Ee,limitUnit:null,baseLabel:c}}if(t.featureKey==="collaboration.ai_profiles"){const l=Pe(p,"maxAiProfiles");if(l!==null)return{limitValue:String(l),limitUnit:null,baseLabel:we(c,l)};if(t.access!=="disabled")return{limitValue:Ee,limitUnit:null,baseLabel:c}}if(t.featureKey==="collaboration.team_management"){const l=Number(a);if(Number.isFinite(l)&&l>0){const C=Math.floor(l);return{limitValue:String(C),limitUnit:null,baseLabel:we(c,C)}}}return{limitValue:null,limitUnit:null,baseLabel:c}}function fn({heading:t,subtitle:a,variant:c="app",theme:p="dark",chrome:l,footer:C,isAuthenticated:E,authSessionResolved:P=!0,currentPlanId:$,currentPlanVersionId:v,currentEntitlementState:h,markCurrentPlan:W,canManageCurrentPlan:G=!0,pricingEndpoint:I,statusBanner:H,onBack:A,backLabel:T,backDisabled:M=!1,topActions:se,shellOwnsScroll:_e=!1,showPageBackButton:X=!0,showHeaderBarWithChrome:re=!1,preferPricingPageTitle:Ce=!0,currentPlanCardActionMode:be="manage",fallbackPricingSource:g=null,onSelectPlan:q}){const[Z,Q]=s.useState([]),[oe,F]=s.useState(null),[x,L]=s.useState({pageTitle:null,pageDescription:null}),[ce,z]=s.useState(!0),[le,ue]=s.useState(null),[Se,ee]=s.useState(0);s.useEffect(()=>{let i=!0;return(async()=>{const D=String(I||"/api/taskforce/public/pricing").trim()||"/api/taskforce/public/pricing";i&&(z(!0),ue(null));try{const w=await fetch(D,{method:"GET",credentials:"include"}),u=await w.json().catch(()=>({}));if(w.ok){i&&(Q(Array.isArray(u?.plans)?u.plans:[]),F(u?.pricingSource&&typeof u.pricingSource=="object"?u.pricingSource:null),L({pageTitle:typeof u?.pageTitle=="string"&&u.pageTitle.trim()||null,pageDescription:typeof u?.pageDescription=="string"&&u.pageDescription.trim()||null}));return}throw new Error(String(u?.error||`Failed to load pricing (${w.status})`))}catch(w){if(i){const u=w instanceof Error?w.message:"Failed to load pricing";ue(u||"Failed to load pricing"),F(null),L({pageTitle:null,pageDescription:null})}}finally{i&&z(!1)}})(),()=>{i=!1}},[I,Se]);const J=s.useMemo(()=>[...Z].sort((i,U)=>{const D=Re(i),w=Re(U);if(D!==w)return D-w;const u=i.defaultVersion?.versionNumber||0,V=U.defaultVersion?.versionNumber||0;return u!==V?u-V:String(i.displayName||i.planId).localeCompare(String(U.displayName||U.planId))}),[Z]),de=s.useMemo(()=>rn(oe||g),[g,oe]),ve=String((Ce?x.pageTitle:null)||t).trim()||t,me=String(x.pageDescription||a||"").trim(),j=s.useMemo(()=>on(me),[me]),te=P,pe=`${r.plansWrapper} ${_e?r.shellOwnsScroll:"tf-scrollbar"} ${c==="site"?r.siteVariant:""} ${l?r.withChrome:""}`.trim(),B=i=>_e?e.jsxs(e.Fragment,{children:[l,i,C]}):e.jsxs("div",{className:Oe.standaloneWrapper,"data-theme":p,children:[l,i,C]});return B(ce?e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsx("div",{className:r.contentFrame,children:e.jsxs("div",{className:r.loader,children:[e.jsx(Ye,{size:48,className:r.spinner}),e.jsx("p",{children:"Loading plans..."})]})})})}):le?e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsx("div",{className:r.contentFrame,children:e.jsxs("div",{className:r.emptyState,children:[e.jsx("h2",{children:"Connecting to plan pricing..."}),e.jsx("p",{children:le}),e.jsx("button",{className:r.backBtn,onClick:()=>ee(i=>i+1),children:"Retry"})]})})})}):e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsxs("div",{className:r.contentFrame,children:[e.jsxs("div",{className:r.header,children:[(!l||re)&&(X||se)&&e.jsxs("div",{className:r.headerBar,children:[e.jsx("div",{children:X?e.jsx("button",{className:r.backBtn,onClick:A,disabled:M,children:T}):null}),e.jsx("div",{className:r.headerActions,children:se})]}),e.jsx("h1",{className:r.title,children:ve}),j&&e.jsx("div",{className:r.subtitle,dangerouslySetInnerHTML:{__html:j}}),nn()&&de?e.jsxs("p",{className:r.debugMeta,children:["Pricing source: ",de]}):null,H&&e.jsx("div",{className:`${r.statusBanner} ${H.type==="success"?r.successBanner:H.type==="info"?r.infoBanner:r.errorBanner}`,children:H.message})]}),e.jsxs("section",{className:r.foundingBeta,"aria-labelledby":"founding-beta-heading",children:[e.jsx("h2",{id:"founding-beta-heading",children:"Founding beta"}),e.jsx("p",{children:"Taskforce is in founding beta. You may run into rough edges while we improve cloud workspaces and agent workflows. Early members get access while the product is still forming, plus a direct role in shaping what comes next."})]}),J.length===0?e.jsxs("div",{className:`${r.emptyState} ${r.marketingEmptyState}`,children:[e.jsx("span",{className:r.emptyBadge,children:"Coming Soon"}),e.jsx("h2",{children:"Paid plans are getting their final polish."}),e.jsx("p",{children:"Taskforce pricing is on the way with flexible options for solo operators, teams, and larger rollouts. Check back soon for launch tiers, feature bundles, and early access details."}),e.jsxs("div",{className:r.emptyHighlights,"aria-label":"Upcoming pricing highlights",children:[e.jsx("span",{children:"Launch-ready tiers"}),e.jsx("span",{children:"Team billing controls"}),e.jsx("span",{children:"Feature-based packaging"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:r.grid,children:J.map(i=>{const U=i.pricing.month,D=i.pricing.year,w=i.campaignPricing?.month||null,u=i.campaignPricing?.year||null,V=Le(U,w),K=Le(D,u),Y=O(V.price),ae=O(K.price),ie=Y&&ae,N=String(i.defaultVersion?.planVersionId||"").trim(),xe=ye(h),fe=W??xe,Ne=!!(N&&v&&v===N)||!!(!v&&($&&$===i.planId)),ne=fe&&Ne&&h!=="canceled",n=Y?"month":ae?"year":null,o=n==="year"?K:V,_=be==="manage",f=be==="indicator",y=te&&!!N&&(ne?_&&G:!!n),m=()=>{if(N){if(ne){if(!_||!G)return;q({planId:i.planId,planVersionId:N,interval:n||"month",pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!0});return}n&&q({planId:i.planId,planVersionId:N,interval:n,pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!1})}};return e.jsxs("div",{className:`${r.planCard} ${ne?r.activePlanCard:""} ${y?r.clickablePlanCard:""}`,"data-testid":`plan-card-${i.planId}`,role:y?"button":void 0,tabIndex:y?0:void 0,onClick:y?m:void 0,onKeyDown:y?d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),m())}:void 0,children:[ne&&e.jsx("span",{className:r.currentBadge,children:"Current Plan"}),e.jsx("h3",{className:r.planName,children:i.displayName}),un(U,D,w,u),String(i.description||"").trim()&&e.jsx("p",{className:r.planDescription,children:String(i.description||"").trim()}),e.jsx("div",{className:r.featuresList,children:Array.isArray(i.features)&&i.features.length>0?i.features.map((d,S)=>e.jsxs("div",{className:r.featureItem,children:[e.jsx(ze,{className:r.featureIcon}),e.jsxs("div",{className:r.featureTextBlock,children:[(()=>{const{limitValue:k,limitUnit:b,baseLabel:R}=pn(d,i.defaultVersion?.seatLimit);return e.jsxs("span",{className:r.featureText,children:[k&&e.jsxs("span",{className:r.featureLimitAccent,children:[e.jsx("span",{children:k}),b?e.jsx("span",{className:r.featureLimitUnit,children:b}):null]}),e.jsx("span",{children:k?` ${R}`:R})]})})(),d.publicDescriptionVisible!==!1&&String(d.publicDescription||d.description||"").trim()&&e.jsx("span",{className:r.featureDescription,children:String(d.publicDescription||d.description||"").trim()})]})]},`${d.featureKey}-${S}`)):e.jsx("span",{className:r.featureText,children:"No additional features included"})}),ne?_?e.jsx("button",{className:`${r.callToAction} ${r.currentCta}`,"data-testid":`plan-manage-${i.planId}`,onClick:d=>{d.stopPropagation(),G&&q({planId:i.planId,planVersionId:N,interval:n||"month",pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!0})},disabled:!N||!G||!te,children:E&&G?"Manage Plan":"Current Plan"}):f?e.jsx("button",{className:`${r.callToAction} ${r.currentCta}`,"data-testid":`plan-current-${i.planId}`,disabled:!0,children:"Current Plan"}):null:e.jsxs("div",{className:r.ctaRow,children:[Y?e.jsx("button",{className:`${r.callToAction} ${r.secondaryCta}`,"data-testid":`plan-select-${i.planId}-month`,onClick:d=>{d.stopPropagation(),q({planId:i.planId,planVersionId:N,interval:"month",pricingType:V.price?.pricingType||"stripe",pricingAudience:V.pricingAudience,isCurrentPlan:!1})},disabled:!N||!te,children:ie?"Start Monthly":"Get Started"}):null,ae?e.jsx("button",{className:`${r.callToAction} ${r.primaryCta}`,"data-testid":`plan-select-${i.planId}-year`,onClick:d=>{d.stopPropagation(),q({planId:i.planId,planVersionId:N,interval:"year",pricingType:K.price?.pricingType||"stripe",pricingAudience:K.pricingAudience,isCurrentPlan:!1})},disabled:!N||!te,children:ie?"Start Yearly":"Get Started"}):null]})]},i.planId)})}),e.jsxs("div",{className:r.pricingNotes,children:[e.jsx("p",{children:"Prices are listed in USD. Taxes may apply."}),e.jsx("p",{children:"Local install is free on every plan. Cloud limits apply only to hosted workspaces."})]}),e.jsxs("section",{className:`${r.foundingBeta} ${r.cloudCapacityNote}`,"aria-labelledby":"cloud-capacity-heading",children:[e.jsx("h2",{id:"cloud-capacity-heading",children:"Need more cloud capacity?"}),e.jsx("p",{children:"Pro users can request expanded limits for cloud workspaces, AI agents, and storage."}),e.jsxs("p",{children:["Contact ",e.jsx("a",{href:"mailto:support@taskforcehq.ai",children:"support@taskforcehq.ai"})," to discuss capacity needs."]})]}),e.jsxs("div",{className:`${r.planCard} ${r.planNoticeCard} ${r.teamComingSoonCard}`,children:[e.jsx("h2",{className:r.planName,children:"Team workspaces are coming soon."}),e.jsx("p",{className:r.planDescription,children:"Shared workspaces, collaborators, team agent rosters, admin controls, and larger cloud limits are in development."})]})]})]})})}))}const gn=1600,Be=[0,500,1e3,2e3],hn=5e3,yn=45e3,_n="Choose a plan to continue.";function Cn(t,a){if(t===401)return!0;const c=String(a||"").trim().toUpperCase();return c==="CHECKOUT_SESSION_INCOMPLETE"||c==="CHECKOUT_PLAN_VERSION_UNRESOLVED"}function bn(t){return t==="year"?"year":"month"}function Sn(t){return t==="campaign"?"campaign":"public"}function Ie(t){const a=String(t||"").trim().toLowerCase();return a==="year"?"year":a==="month"?"month":null}function $e(t){const a=String(t||"").trim();return a?a.replace(/\/+$/,""):""}function Ae(t={}){const a=new URLSearchParams;a.set("screen","plans");for(const[c,p]of Object.entries(t)){const l=String(p||"").trim();l&&a.set(c,l)}return`/?${a.toString()}`}function Tn({isAuthenticated:t,authUserId:a,runtimeMode:c,authSessionResolved:p,currentTheme:l="dark",projectName:C,currentWorkspaceId:E,apiBaseUrl:P,connectedEnvironmentSource:$,resolveCloudAuthUrl:v,embedded:h=!1,shellOwnsScroll:W=!1,onAccountProfileSummaryChange:G,onContinueToTaskforce:I,continueBusy:H=!1}){const A=Ge(),T=Qe(),[M,se]=s.useState(null),[_e,X]=s.useState(!1),[re,Ce]=s.useState(!1),[be,g]=s.useState(null),q=s.useRef(!1),Z=s.useRef(null),Q=s.useRef(null),oe=s.useRef(I),F=s.useMemo(()=>new URLSearchParams(T.search),[T.search]),x=String(F.get("checkout")||"").trim().toLowerCase(),L=String(F.get("gate")||"").trim().toLowerCase(),ce=String(F.get("planId")||"").trim(),z=String(F.get("planVersionId")||"").trim(),le=bn(F.get("interval")),ue=Sn(F.get("pricingAudience")),Se=Ie(F.get("interval")),ee=String(F.get("session_id")||"").trim(),J=s.useMemo(()=>$e(P),[P]),de=s.useMemo(()=>$e($),[$]),ve=s.useMemo(()=>({environment:Ke(de||J),runtimeMode:c==="cloud"?"cloud":"local"}),[J,de,c]),me=s.useCallback(n=>{const o=String(n||"").trim();return J?`${J}${o.startsWith("/")?o:`/${o}`}`:o},[J]),j=s.useCallback(n=>v?v(n):me(n),[me,v]),te=s.useCallback(()=>{const n=new URLSearchParams(T.search);n.delete("screen"),n.delete("gate"),n.delete("checkout"),n.delete("planId"),n.delete("planVersionId"),n.delete("interval"),n.delete("pricingAudience");const o=n.toString();A(`/${o?`?${o}`:""}${T.hash||""}`)},[T.hash,T.search,A]),pe=s.useMemo(()=>j("/api/taskforce/public/pricing"),[j]),B=s.useMemo(()=>ke(M,L),[M,L]),i=s.useMemo(()=>B.allowReturnToApp,[B.allowReturnToApp]),U=s.useMemo(()=>{const n=String(B.message||"").trim();return!n||n===_n?null:n},[B.message]),D=s.useCallback(()=>{const n=new URLSearchParams(T.search);n.delete("checkout"),n.delete("session_id"),n.delete("gate"),n.delete("planId"),n.delete("planVersionId"),n.delete("interval");const o=n.toString();A(`${T.pathname}${o?`?${o}`:""}${T.hash||""}`,{replace:!0})},[T.hash,T.pathname,T.search,A]),w=s.useCallback(()=>{Q.current!=null&&window.clearTimeout(Q.current),Q.current=window.setTimeout(()=>{D(),Q.current=null},gn)},[D]);s.useEffect(()=>{oe.current=I},[I]);const u=s.useCallback(async n=>{const o=j(ge);if(!t)return se(null),he(o,{identityKey:a}),null;try{const _=await He(o,{identityKey:a,force:n?.force===!0});return se(_),G?.(_),_}catch{return null}},[a,j,t,G]),V=s.useCallback((n,o,_)=>{const f=String(o||"").trim();if(_?.preferFallback&&f)return f;const y=ke(n,L).message;return y||f||"Unable to confirm checkout completion."},[L]),K=s.useCallback((n,o)=>!ke(n,o).allowReturnToApp,[]),Y=s.useCallback(async(n,o,_="public",f)=>{if(!n){g({type:"error",message:"Selected plan is missing a default plan version."});return}X(!0),g(null);try{const y=await fetch(j("/api/taskforce/billing/checkout-session"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({planVersionId:n,interval:o,pricingAudience:_})}),m=await y.json().catch(()=>({}));if(!y.ok){g({type:"error",message:String(m?.error||"Unable to start checkout for selected plan.")});return}const d=String(m?.checkoutState||"").trim().toLowerCase();if(d==="free"){g({type:"success",message:"Plan selected. Your access is ready."}),he(j(ge),{identityKey:a});const b=await u({force:!0}),R=String(b?.entitlementState||"").trim().toLowerCase();f?.autoContinueOnActivation===!0&&ye(R)&&await I?.();return}if(d==="updated"){g({type:"success",message:String(m?.message||"Your subscription was updated successfully.")}),he(j(ge),{identityKey:a});const b=await u({force:!0}),R=String(b?.entitlementState||"").trim().toLowerCase();f?.autoContinueOnActivation===!0&&ye(R)&&await I?.();return}if(d==="already_current_plan"){g({type:"success",message:String(m?.message||"You are already on this plan.")}),he(j(ge),{identityKey:a}),await u();return}const S=String(m?.returnBaseUrl||"").trim();if(c==="local"&&S)try{const b=window.location.origin,R=new URL(S,b).origin;if(R!==b){g({type:"error",message:`Checkout return is misconfigured for this runtime. Expected ${b} but got ${R}.`});return}}catch{g({type:"error",message:"Checkout return URL is invalid for this runtime."});return}const k=String(m?.url||"").trim();if(!k){g({type:"error",message:"Checkout did not return a redirect URL."});return}window.location.assign(k)}catch{g({type:"error",message:"Unable to start checkout for selected plan."})}finally{X(!1)}},[a,j,u,I,c]),ae=s.useCallback(async(n,o)=>{if(!n)return{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1};const _=async()=>{he(j(ge),{identityKey:a});const f=await u({force:!0}),y=String(f?.entitlementState||"").trim().toLowerCase();if(!ye(y))return!1;const m=ce,d=z,S=Se,k=String(f?.planId||"").trim(),b=String(f?.planVersionId||"").trim(),R=Ie(f?.billingInterval??null),je=o?.preConfirmationSummary??null,Me=String(je?.entitlementState||"").trim().toLowerCase(),Ue=ye(Me),De=String(je?.planId||"").trim(),Fe=String(je?.planVersionId||"").trim(),Ve=Ie(je?.billingInterval??null);return m&&k&&k!==m||d&&b&&b!==d||S&&R&&R!==S||Ue&&!(!!m&&k===m&&De!==k)&&!(!!d&&b===d&&Fe!==b)&&!(!!S&&R===S&&Ve!==R)?!1:(o?.autoContinueOnActivation===!0&&await oe.current?.(),!0)};try{const f=await fetch(j("/api/taskforce/billing/checkout-session/confirm"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n})}),y=await f.json().catch(()=>({}));if(!f.ok){const m=String(y?.code||"").trim(),d=Cn(f.status,m);return d&&await _()?{confirmed:!0}:{confirmed:!1,errorMessage:String(y?.error||"Unable to confirm checkout completion."),retryable:d}}return await _()?{confirmed:!0}:{confirmed:!0}}catch{return{confirmed:!1,errorMessage:"Unable to confirm checkout completion.",retryable:!0}}},[a,j,u,Se,ce,z]),ie=s.useCallback(async()=>{if(!t){A(`/login?mode=login&next=${encodeURIComponent(Ae())}`);return}X(!0),g({type:"info",message:"Opening billing portal..."});try{const n=await fetch(j("/api/taskforce/billing/portal-session"),{method:"POST",credentials:"include"}),o=await n.json().catch(()=>({}));if(!n.ok){g({type:"error",message:String(o?.error||"Failed to open billing portal.")});return}const _=String(o?.url||"").trim();if(!_){g({type:"error",message:"Portal session did not return a redirect URL."});return}window.location.assign(_)}catch{g({type:"error",message:"Failed to open billing portal."})}finally{X(!1)}},[j,t,A]),N=s.useCallback(async()=>{if(!(!I||re||H)){Ce(!0);try{await I()}finally{Ce(!1)}}},[re,H,I]);s.useEffect(()=>{u()},[u]),s.useEffect(()=>{i&&L==="missing_entitlement"&&D()},[D,L,i]),s.useEffect(()=>()=>{Q.current!=null&&window.clearTimeout(Q.current)},[]),s.useEffect(()=>{x!=="success"&&(Z.current=null)},[x]),s.useEffect(()=>{let n=!1;const o=new Set,_=async f=>{f<=0||await new Promise(y=>{const m=window.setTimeout(()=>{o.delete(m),y()},f);o.add(m)})};if(x==="success"){if(q.current=!0,g({type:"success",message:"Checkout completed successfully. Finalizing your plan..."}),!t&&!p)return()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()};if(!t)return g({type:"error",message:"Sign in to finish activating your plan."}),()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()};const y=ee||"__missing_session__";return Z.current===y?()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()}:((async()=>{const m=Date.now(),d=await u({force:!0});if(n)return;let S=ee?{confirmed:!1,errorMessage:"Unable to confirm checkout completion.",retryable:!0}:{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1},k=0;for(;;){const b=k<Be.length?Be[k]:hn;if(k+=1,await _(b),n||(S=ee?await ae(ee,{autoContinueOnActivation:K(d,L),preConfirmationSummary:d}):{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1},n))return;if(S.confirmed){Z.current=y,g({type:"success",message:"Checkout completed successfully."}),w();return}if(!S.retryable||Date.now()-m>=yn)break}if(!n&&!S.confirmed){const b=await u({force:!0});if(n)return;S.retryable||(Z.current=y),g({type:"error",message:V(b,S.errorMessage,{preferFallback:!S.retryable})}),S.retryable||w();return}})(),()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()})}if(x==="cancel"){(async()=>{const f=await u({force:!0});g({type:"error",message:V(f,"Checkout was canceled. No charge was made.")}),w()})();return}if((x==="start"||x==="free")&&t&&z&&!q.current){q.current=!0,(async()=>{const f=await u({force:!0});await Y(z,le,ue,{autoContinueOnActivation:K(f,L)})})();return}},[p,x,ae,L,t,u,le,z,ue,ee,V,w,K,Y]),s.useEffect(()=>{if(!(x==="success"||x==="cancel"||x==="start"||x==="free")){if(U){g({type:B.statusTone,message:U});return}g(n=>!n||n.type!=="error"?n:n.message===B.message?null:n)}},[x,U,B.message,B.statusTone]);const xe=s.useCallback(async n=>{if(!t){const _=n.pricingType==="free"?"free":"start",f=Ae({checkout:_,planId:n.planId,planVersionId:n.planVersionId,interval:n.interval,pricingAudience:n.pricingAudience});A(`/login?mode=register&planId=${encodeURIComponent(n.planId)}&planVersionId=${encodeURIComponent(n.planVersionId)}&interval=${encodeURIComponent(n.interval)}&pricingAudience=${encodeURIComponent(n.pricingAudience)}&next=${encodeURIComponent(f)}`);return}if(n.isCurrentPlan){if(!M?.stripeCustomerId){g({type:"success",message:"Your current plan does not use Stripe billing."});return}await ie();return}const o=K(M,L);if(n.pricingType==="free"){await Y(n.planVersionId,n.interval,n.pricingAudience,{autoContinueOnActivation:o});return}await Y(n.planVersionId,n.interval,n.pricingAudience,{autoContinueOnActivation:o})},[M,L,t,A,ie,K,Y]),fe=s.useCallback(()=>{if(i&&I){N();return}if(h){te();return}if(window.history.length>1){A(-1);return}A("/")},[te,h,N,i,A,I]),Ne=h?null:e.jsxs(e.Fragment,{children:[e.jsx("button",{className:r.navAction,onClick:fe,disabled:H||re||t&&!i,children:i?"Take Me to Taskforce":"Back"}),t&&M?.stripeCustomerId&&e.jsx("button",{className:r.navAction,onClick:()=>{ie()},disabled:_e,children:"Manage billing"}),!t&&e.jsxs("button",{className:r.navAction,onClick:()=>A(`/login?mode=login&next=${encodeURIComponent(Ae())}`),children:[e.jsx(We,{size:16,style:{marginRight:"8px",verticalAlign:"text-bottom"}}),"Sign In"]})]}),ne=h?null:e.jsx(qe,{projectName:C,currentWorkspaceId:E,runtimeMode:c==="cloud"?"cloud":"local",theme:l,onBrandClick:fe,actions:Ne});return e.jsx(fn,{chrome:ne,heading:"Subscription Plans",subtitle:"Manage your subscription and explore available features. Your current plan is highlighted below.",variant:"site",theme:l,isAuthenticated:t,authSessionResolved:p,currentPlanId:String(M?.planId||ce||"").trim()||null,currentPlanVersionId:String(M?.planVersionId||z||"").trim()||null,currentEntitlementState:String(M?.entitlementState||"").trim()||null,markCurrentPlan:B.markCurrentPlan,canManageCurrentPlan:!!M?.stripeCustomerId,pricingEndpoint:pe,statusBanner:be,onBack:fe,backLabel:i?"Take Me to Taskforce":h?"Back to Board":"Back to App",backDisabled:H||re||t&&!i,topActions:null,shellOwnsScroll:W,showPageBackButton:!1,showHeaderBarWithChrome:!1,currentPlanCardActionMode:"manage",fallbackPricingSource:ve,onSelectPlan:xe})}export{Tn as PlansPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as h,j as e}from"./vendor-react-CKJs5o3c.js";import{ContextAttachmentManager as g}from"./ContextAttachmentManager-
|
|
1
|
+
import{r as h,j as e}from"./vendor-react-CKJs5o3c.js";import{ContextAttachmentManager as g}from"./ContextAttachmentManager-T-cEVcOZ.js";import{f as v,aW as x,a_ as _}from"./index-DSQINwt9.js";import{w as y,$ as j,aZ as w}from"./vendor-icons-Bsq-mcEn.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";const I="_group_1y2qv_1",N="_list_1y2qv_9",b="_review_1y2qv_15",C="_icon_1y2qv_43",k="_openIcon_1y2qv_43",A="_copy_1y2qv_44",L="_kindLabel_1y2qv_45",q="_title_1y2qv_53",R="_loading_1y2qv_54",n={group:I,list:N,review:b,icon:C,openIcon:k,copy:A,kindLabel:L,title:q,loading:R};function U(o){return String(o.title||"").trim()||o.image?.displayName||"Image review"}function S({taskId:o,taskReferenceLabel:l,workspaceId:c,apiBaseUrl:r}){const[i,d]=h.useState(null),[m,p]=h.useState(!1);return h.useEffect(()=>{let a=!0;d(null),p(!1);const t=new URLSearchParams({workspaceId:c,taskId:o});return v(`/api/taskforce/annotated-attachments/sessions?${t.toString()}`,{credentials:"include"},r).then(async s=>{if(!s.ok)throw new Error("Failed to load image reviews.");return s.json()}).then(s=>{a&&d(Array.isArray(s?.sessions)?s.sessions:[])}).catch(()=>{a&&(d([]),p(!0))}),()=>{a=!1}},[r,o,c]),i!==null&&i.length===0&&!m?null:e.jsx("section",{className:n.group,"aria-label":"Image reviews",children:i===null?e.jsxs("div",{className:n.loading,"aria-live":"polite",children:[e.jsx(y,{size:14})," Loading image reviews"]}):m?e.jsx("div",{className:n.loading,role:"status",children:"Unable to load image reviews."}):e.jsx("div",{className:n.list,children:i.map(a=>{const t=a.image,s=a.annotations.length,u=!!(t?.assetId&&t.apiUrl);return e.jsxs("button",{type:"button",className:n.review,disabled:!u,onClick:()=>{t&&_({assetId:t.assetId,path:t.apiUrl,displayName:t.displayName,referenceLabel:t.referenceLabel||void 0},{taskId:o,taskReferenceLabel:l,sessionId:a.id})},children:[e.jsx("span",{className:n.icon,children:e.jsx(j,{size:14})}),e.jsxs("span",{className:n.copy,children:[e.jsx("span",{className:n.kindLabel,children:"Image review session"}),e.jsx("span",{className:`${n.title} tf-heading-card`,children:U(a)}),e.jsxs("span",{className:"tf-text-meta",children:[[t?.referenceLabel,t?.displayName].filter(Boolean).join(" · ")||"Image",a.updatedAt?` · Updated ${x(a.updatedAt,{month:"short",day:"numeric",year:"numeric"})}`:""]}),e.jsxs("span",{className:"tf-text-meta",children:[s," ",s===1?"marker":"markers"]})]}),e.jsx(w,{className:n.openIcon,size:14,"aria-hidden":"true"})]},a.id)})})})}function M(o){const{taskId:l,taskReferenceLabel:c,workspaceId:r,apiBaseUrl:i,showImageReviews:d=!1,contextFiles:m,onAddContextFile:p,onRemoveContextFile:a,onUpdateContextCaption:t,cardCoverAssetId:s,onSetCardCover:u,cardCoverDisabled:f}=o;return e.jsx(g,{ownerType:"task",ownerId:l,ownerReferenceLabel:c,workspaceId:r,apiBaseUrl:i,attachments:m,onAddAttachment:p,onRemoveAttachment:a,onUpdateAttachmentCaption:t,cardCoverAssetId:s,onSetCardCover:u,cardCoverDisabled:f,supplementalContent:d&&l&&r?e.jsx(S,{taskId:l,taskReferenceLabel:c,workspaceId:r,apiBaseUrl:i}):null})}export{M as TaskContextUpload};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o,j as e,R as Us}from"./vendor-react-CKJs5o3c.js";import{g as Hn,t as s,T as qs,P as is,A as Js,I as be,r as ae,D as Wn,a as za,b as Vn,l as Xa,c as Kn,d as qn,M as Jn,n as Yn,e as Ga}from"./index-
|
|
1
|
+
import{r as o,j as e,R as Us}from"./vendor-react-CKJs5o3c.js";import{g as Hn,t as s,T as qs,P as is,A as Js,I as be,r as ae,D as Wn,a as za,b as Vn,l as Xa,c as Kn,d as qn,M as Jn,n as Yn,e as Ga}from"./index-DSQINwt9.js";import{r as os,t as Cs,X as Vs,v as en,A as sn,I as At,aD as Et,_ as Zn,w as Pe,a0 as Qn,aE as Oa,Z as Y,l as Xn,aF as Fa,aG as Ua,aH as Rt,k as tn,aI as ei,u as te,x as Ae,aJ as si,aK as ti,a5 as ai,d as an,a as Bt,ah as Fe,aL as ni,au as Dt,ad as ii,a4 as oi,ay as Ha,aM as li,aN as ri,aO as ci}from"./vendor-icons-Bsq-mcEn.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";function di(i){return i==="general"?{}:{TASKFORCE_MCP_CLIENT_ID:i}}function pi(...i){const l=i.map(g=>String(g||"").trim().toLowerCase()).join("|");let p=2166136261,m=3339675911;for(let g=0;g<l.length;g+=1){const C=l.charCodeAt(g);p=Math.imul(p^C,16777619),m=Math.imul(m^C,2246822519)}return`mcp-${(p>>>0).toString(16).padStart(8,"0")}${(m>>>0).toString(16).padStart(8,"0")}`}const Hs=Hn();function zt(i,l){return String(i||"").toLowerCase().replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^[-_]+|[-_]+$/g,"")||l.toLowerCase()}function ui(i,l){const m=zt(i||l||"workspace","workspace").slice(0,25)||"workspace";return zt(`taskforce-${m}`,"taskforce-workspace")}function mi(i){return{Authorization:`Bearer ${i.tokenValue}`,...i.clientId==="general"?{}:{"X-Taskforce-MCP-Client-ID":i.clientId}}}function ge(i,l){return`${i} Use the generated config exactly as shown. Resolve your AI profile before the first write; stateless clients should keep the returned profileToken only in private client state.`}function xe(i){return`${i} Use the generated config exactly as shown. No connection token is required for local stdio MCP. Resolve your AI profile before the first write; stateless clients should keep the returned profileToken only in private client state.`}function Ks(i){return JSON.stringify(i)}function Wa(i){return`[${i.map(l=>Ks(l)).join(", ")}]`}function Va(i){return!i||Object.keys(i).length===0?[]:[`env = { ${Object.entries(i).map(([l,p])=>`${l} = ${Ks(p)}`).join(", ")} }`]}function Ka(i){return/^[A-Za-z0-9_./:@%+=,-]+$/.test(i)?i:`'${i.replace(/'/g,`'"'"'`)}'`}function hi(i){const{clientId:l,endpoint:p,tokenValue:m,serverId:g}=i,C=mi(i);C.Authorization;const w=Object.entries(C).filter(([S])=>S!=="Authorization").map(([S,I])=>` --header "${S}: ${I}"`).join("");switch(l){case"general":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:{url:p,headers:C},instructionLabel:"General MCP Configuration Instructions",instructionText:ge("Add this server to your MCP client using its standard remote HTTP configuration format.")};case"cursor":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:{url:p,headers:C},instructionLabel:"Cursor Configuration Instructions",instructionText:ge("Open Cursor settings, find MCP servers, and paste this config.")};case"cline":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:{url:p,type:"streamableHttp",headers:C},instructionLabel:"Cline Configuration Instructions",instructionText:ge("Open Cline MCP Servers, add a remote server, or paste this into the Cline MCP config with Streamable HTTP selected.")};case"vscode":return{clientId:l,kind:"json",rootKey:"servers",serverConfig:{type:"http",url:p,headers:C},instructionLabel:"VS Code Configuration Instructions",instructionText:ge("Open .vscode/mcp.json or MCP: Open User Configuration and add this server under the servers object.")};case"kiro":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:{url:p,headers:C},instructionLabel:"Kiro Configuration Instructions",instructionText:ge("Open .kiro/settings/mcp.json in your workspace (or ~/.kiro/settings/mcp.json for user-level config) and add this server under mcpServers.")};case"windsurf":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:{serverUrl:p,headers:C},instructionLabel:"Windsurf Configuration Instructions",instructionText:ge("Open Windsurf MCP settings, add a server, and paste this config.")};case"antigravity":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:{serverUrl:p,headers:C},instructionLabel:"Antigravity Configuration Instructions",instructionText:ge("Open Antigravity MCP settings, view the raw config, and paste this Antigravity-specific configuration.")};case"openclaw":return{clientId:l,kind:"json",rootKey:"servers",wrapperKeys:["mcp"],serverConfig:{transport:"streamable-http",url:p,headers:C},instructionLabel:"OpenClaw Configuration Instructions",instructionText:ge("Open ~/.openclaw/openclaw.json and add this server under mcp.servers.")};case"codex":return{clientId:l,kind:"text",renderedText:[`[mcp_servers.${g}]`,`url = "${p}"`,`http_headers = { ${Object.entries(C).map(([S,I])=>`${S} = "${I}"`).join(", ")} }`].join(`
|
|
2
2
|
`),instructionLabel:"Codex Configuration Instructions",instructionText:ge("Open ~/.codex/config.toml and add this Codex MCP entry.")};case"grok":return{clientId:l,kind:"text",renderedText:[`[mcp_servers.${g}]`,`url = "${p}"`,`headers = { ${Object.entries(C).map(([S,I])=>`${S} = "${I}"`).join(", ")} }`].join(`
|
|
3
3
|
`),instructionLabel:"Grok CLI Configuration Instructions",instructionText:ge("Open ~/.grok/config.toml (or .grok/config.toml in your project for project-scoped config) and add this Grok CLI MCP entry.")};case"claude-code":return{clientId:l,kind:"text",renderedText:`claude mcp add --transport http ${g} ${p} --header "Authorization: Bearer ${m}"${w}`,instructionLabel:"Claude Code Configuration Instructions",instructionText:ge("Run this Claude Code command in your terminal to add the remote Taskforce MCP server.")};case"gemini-cli":return{clientId:l,kind:"text",renderedText:`gemini mcp add ${g} ${p} --transport http --header "Authorization: Bearer ${m}"${w}`,instructionLabel:"Gemini CLI Configuration Instructions",instructionText:ge("Run this Gemini CLI command in your terminal to add the remote Taskforce MCP server. Add --scope user if you want it available across all projects.")};case"claude-chat":return{clientId:l,kind:"text",renderedText:p,instructionLabel:"Claude Chat Configuration Instructions",instructionText:"Open Claude Settings > Connectors, paste this MCP server URL, and complete the Taskforce OAuth flow to authorize one workspace."};case"grok-chat":return{clientId:l,kind:"text",renderedText:p,instructionLabel:"Grok Configuration Instructions",instructionText:"Go to grok.com/connectors, create a custom connector with this MCP server URL, and complete the Taskforce OAuth flow to authorize one workspace."};case"gemini-chat":return{clientId:l,kind:"text",renderedText:p,instructionLabel:"Gemini Spark Configuration Instructions",instructionText:"Open Gemini Settings & help > Connected Apps, add a custom app for Spark with this MCP server URL, and complete the Taskforce OAuth flow to authorize one workspace."};case"mistral-chat":return{clientId:l,kind:"text",renderedText:p,instructionLabel:"Mistral Vibe Configuration Instructions",instructionText:"Open Mistral Vibe (formerly Le Chat) > Intelligence > Connectors, add a custom connector with this MCP server URL, and complete the Taskforce OAuth flow to authorize one workspace."};case"perplexity-chat":return{clientId:l,kind:"text",renderedText:p,instructionLabel:"Perplexity Configuration Instructions",instructionText:"Open Perplexity Settings > Connectors, add a custom remote connector with this MCP server URL, choose OAuth, and complete the Taskforce authorization flow for one workspace."};case"chatgpt-desktop":return{clientId:l,kind:"text",renderedText:p,instructionLabel:"ChatGPT Desktop Configuration Instructions",instructionText:"Open ChatGPT Apps & Connectors / developer mode, paste this MCP server URL, and complete the Taskforce OAuth authorize flow when ChatGPT opens it."};default:{const S=l;throw new Error(`Unsupported MCP client: ${S}`)}}}function gi(i){const{clientId:l,serverId:p,serverConfig:m}=i,g={command:m.command,args:m.args,...m.env&&Object.keys(m.env).length>0?{env:m.env}:{}},C=Object.entries(m.env||{}).map(([S,I])=>` --env ${Ka(`${S}=${I}`)}`).join(""),w=[m.command,...m.args].map(S=>Ka(S)).join(" ");switch(l){case"general":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"General MCP Configuration Instructions",instructionText:xe("Add this server to your MCP client using its standard local stdio configuration format.")};case"cursor":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Cursor Configuration Instructions",instructionText:xe("Open Cursor settings, find MCP servers, and paste this local stdio config.")};case"cline":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Cline Configuration Instructions",instructionText:xe("Open Cline MCP Servers and paste this local stdio server config.")};case"vscode":return{clientId:l,kind:"json",rootKey:"servers",serverConfig:{type:"stdio",...g},instructionLabel:"VS Code Configuration Instructions",instructionText:xe("Open .vscode/mcp.json or MCP: Open User Configuration and add this server under the servers object.")};case"kiro":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Kiro Configuration Instructions",instructionText:xe("Open .kiro/settings/mcp.json in your workspace (or ~/.kiro/settings/mcp.json for user-level config) and add this server under mcpServers.")};case"windsurf":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Windsurf Configuration Instructions",instructionText:xe("Open Windsurf MCP settings and paste this local stdio config.")};case"antigravity":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Antigravity Configuration Instructions",instructionText:xe("Open Antigravity MCP settings, view the raw config, and paste this local stdio configuration.")};case"openclaw":return{clientId:l,kind:"json",rootKey:"servers",wrapperKeys:["mcp"],serverConfig:{transport:"stdio",...g},instructionLabel:"OpenClaw Configuration Instructions",instructionText:xe("Open ~/.openclaw/openclaw.json and add this local stdio server under mcp.servers.")};case"codex":return{clientId:l,kind:"text",renderedText:[`[mcp_servers.${p}]`,`command = ${Ks(m.command)}`,`args = ${Wa(m.args)}`,...Va(m.env)].join(`
|
|
4
4
|
`),instructionLabel:"Codex Configuration Instructions",instructionText:xe("Open ~/.codex/config.toml and add this local MCP entry.")};case"grok":return{clientId:l,kind:"text",renderedText:[`[mcp_servers.${p}]`,`command = ${Ks(m.command)}`,`args = ${Wa(m.args)}`,...Va(m.env)].join(`
|