1import{d as $,c4 as X,q as l,u as t,bu as U,w as d,a as e,m as Z,t as x,b as u,bw as ee,e as f,_ as w,c5 as se,c6 as te,f as _,ai as W,c7 as B,o as n,c as k,F as O,b1 as oe,ca as ne,y as I,n as L,c8 as ae,I as ie,cb as re,z as v,br as le,aP as ce,T as P,U as D,Y as C}from"./index-44DxmEFA.js";import{_ as de}from"./SectionPage.vue_vue_type_script_setup_true_lang-cUsvsIMX.js";import{_ as F}from"./ConnectionBanner.vue_vue_type_script_setup_true_lang-BmGt92zu.js";import{_ as ue}from"./Input.vue_vue_type_script_setup_true_lang-DWM0zgxr.js";import{_ as V}from"./EmptyState.vue_vue_type_script_setup_true_lang-DfiPYrW4.js";import{_ as M}from"./ListSkeleton.vue_vue_type_script_setup_true_lang-DTAEdAch.js";import"./Loader.vue_vue_type_script_setup_true_lang-DxGl7QtU.js";import"./AlertTitle.vue_vue_type_script_setup_true_lang-Dxf4ZPw7.js";const pe={class:"text-base font-semibold text-foreground"},fe={class:"space-y-2"},me={class:"relative"},ke={class:"flex items-center justify-between border-t pt-4"},ge={class:"flex items-center gap-3"},xe=$({__name:"ClickUpConnectForm",props:B({isConfigured:{type:Boolean},loading:{type:Boolean},error:{},testResult:{},showApiToken:{type:Boolean}},{apiToken:{required:!0},apiTokenModifiers:{}}),emits:B(["test","submit","disconnect","toggle-token"],["update:apiToken"]),setup(y){const s=y,r=X(y,"apiToken");function m(a){var o;return a.connected?`Connection successful! Logged in as ${(o=a.user)==null?void 0:o.username}`:a.error??"Connection failed."}return(a,o)=>(n(),l(t(U),{class:"rounded-md shadow-none"},{default:d(()=>[e("form",{class:"space-y-4 p-4",onSubmit:o[4]||(o[4]=Z(i=>a.$emit("submit"),["prevent"]))},[e("div",null,[e("h3",pe,x(s.isConfigured?"Update Configuration":"Connect to ClickUp"),1),o[5]||(o[5]=e("p",{class:"mt-1 text-sm text-muted-foreground"}," Create ClickUp tasks with evidence bundles and AI summaries. ",-1))]),e("div",fe,[u(t(ee),{for:"api_token"},{default:d(()=>[...o[6]||(o[6]=[f("API Token",-1)])]),_:1}),e("div",me,[u(t(ue),{id:"api_token",modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=i=>r.value=i),type:s.showApiToken?"text":"password",required:!s.isConfigured,placeholder:s.isConfigured?"â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢":"pk_xxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",class:"w-full pr-10"},null,8,["modelValue","type","required","placeholder"]),u(t(w),{type:"button",variant:"ghost",size:"sm",class:"absolute right-0 top-0 h-full px-3",onClick:o[1]||(o[1]=i=>a.$emit("toggle-token"))},{default:d(()=>[s.showApiToken?(n(),l(t(se),{key:0,class:"size-4"})):(n(),l(t(te),{key:1,class:"size-4"}))]),_:1})]),o[7]||(o[7]=e("p",{class:"text-xs text-muted-foreground"},[f(" Get your API token from "),e("a",{href:"https://app.clickup.com/settings/apps",target:"_blank",rel:"noopener noreferrer",class:"text-primary hover:underline"}," ClickUp Settings â Apps ")],-1))]),s.error?(n(),l(F,{key:0,tone:"error",message:s.error},null,8,["message"])):_("",!0),s.testResult?(n(),l(F,{key:1,tone:s.testResult.connected?"success":"error",message:m(s.testResult)},null,8,["tone","message"])):_("",!0),e("div",ke,[e("div",ge,[u(t(w),{size:"sm",type:"button",variant:"outline",disabled:s.loading||!r.value&&!s.isConfigured,onClick:o[2]||(o[2]=i=>a.$emit("test"))},{default:d(()=>[s.loading?(n(),l(t(W),{key:0,class:"mr-2 size-4 animate-spin"})):_("",!0),o[8]||(o[8]=f(" Test Connection ",-1))]),_:1},8,["disabled"]),s.isConfigured?(n(),l(t(w),{key:0,size:"sm",type:"button",variant:"destructive-ghost",onClick:o[3]||(o[3]=i=>a.$emit("disconnect"))},{default:d(()=>[...o[9]||(o[9]=[f(" Disconnect ",-1)])]),_:1})):_("",!0)]),u(t(w),{size:"sm",type:"submit",disabled:s.loading||!r.value&&!s.isConfigured},{default:d(()=>[s.loading?(n(),l(t(W),{key:0,class:"mr-2 size-4 animate-spin"})):_("",!0),f(" "+x(s.isConfigured?"Update":"Connect"),1)]),_:1},8,["disabled"])])],32)]),_:1}))}}),_e=$({__name:"ClickUpSetupGuide",setup(y){return(s,r)=>(n(),k(O,null,[u(t(U),{class:"rounded-md p-4 shadow-none"},{default:d(()=>[...r[0]||(r[0]=[e("h3",{class:"mb-3 text-base font-semibold text-foreground"},"How to use",-1),e("ol",{class:"list-inside list-decimal space-y-2 text-sm text-muted-foreground"},[e("li",null,[f(" Go to "),e("a",{href:"https://app.clickup.com/settings/apps",target:"_blank",rel:"noopener noreferrer",class:"text-primary hover:underline"},"ClickUp Settings â Apps")]),e("li",null,[f(" Generate a personal API token (starts with "),e("code",{class:"rounded bg-muted px-1"},"pk_"),f(") ")]),e("li",null,"Paste the token above and test the connection"),e("li",null," Once connected, you can create ClickUp tasks directly from session recordings ")],-1)])]),_:1}),u(t(U),{class:"rounded-md p-4 shadow-none"},{default:d(()=>[...r[1]||(r[1]=[e("h3",{class:"mb-3 text-base font-semibold text-foreground"}," Security & access ",-1),e("ul",{class:"space-y-2 text-sm text-muted-foreground"},[e("li",null,"Tokens are encrypted and scoped to your workspace."),e("li",null,"Used only to create and link ClickUp tasks."),e("li",null,"Revoke anytime in ClickUp Settings.")],-1)])]),_:1})],64))}}),ve="#7B68EE",ye="#6fddff",Ce={class:"flex items-center justify-between border-b px-4 py-3"},we={key:0,class:"p-4"},be={key:2,class:"max-h-96 divide-y overflow-y-auto"},he={class:"flex items-center gap-4"},Ue={class:"min-w-0 flex-1"},$e={class:"truncate text-sm font-medium text-foreground"},Te={class:"text-xs tabular-nums text-muted-foreground"},Se={key:0,class:"mt-4 pl-14"},Ae={key:1,class:"space-y-2"},Ee={class:"text-sm text-foreground"},ze={key:0,class:"text-xs text-muted-foreground"},Re=$({__name:"ClickUpWorkspaceList",props:{workspaces:{}
1,loadingWorkspaces:{type:Boolean},loadingSpaces:{type:Boolean},expandedWorkspace:{},workspaceSpaces:{}},emits:["refresh","toggle-spaces"],setup(y){const s=y;return(r,m)=>(n(),l(t(U),{class:"rounded-md shadow-none"},{default:d(()=>[e("div",Ce,[m[2]||(m[2]=e("h3",{class:"text-base font-semibold text-foreground"}," Available Workspaces ",-1)),u(t(w),{type:"button",variant:"ghost",size:"sm",disabled:s.loadingWorkspaces,onClick:m[0]||(m[0]=a=>r.$emit("refresh"))},{default:d(()=>[s.loadingWorkspaces?(n(),l(t(W),{key:0,class:"size-4 animate-spin"})):(n(),l(t(oe),{key:1,class:"size-4"})),m[1]||(m[1]=f(" Refresh ",-1))]),_:1},8,["disabled"])]),s.loadingWorkspaces?(n(),k("div",we,[u(M,{rows:3,"row-class":"h-16"})])):s.workspaces.length===0?(n(),l(V,{key:1,icon:t(ne),tone:"muted",compact:"",title:"No workspaces found",description:"Make sure your API token has access to workspaces."},null,8,["icon"])):(n(),k("ul",be,[(n(!0),k(O,null,I(s.workspaces,a=>{var o;return n(),k("li",{key:a.id,class:"px-4 py-3 transition-colors hover:bg-muted/50"},[e("div",he,[e("div",{class:"flex size-10 items-center justify-center rounded-lg font-bold text-white",style:L({backgroundColor:a.color||t(ve)})},x(a.name.charAt(0).toUpperCase()),5),e("div",Ue,[e("p",$e,x(a.name),1),e("p",Te,x(((o=a.members)==null?void 0:o.length)||0)+" members ",1)]),u(t(w),{type:"button",variant:"ghost",size:"sm",class:"text-primary hover:text-primary",onClick:i=>r.$emit("toggle-spaces",a.id)},{default:d(()=>[f(x(s.expandedWorkspace===a.id?"Hide":"Show")+" Spaces ",1)]),_:2},1032,["onClick"])]),s.expandedWorkspace===a.id?(n(),k("div",Se,[s.loadingSpaces?(n(),l(M,{key:0,rows:3,"row-class":"h-8"})):s.workspaceSpaces.length>0?(n(),k("ul",Ae,[(n(!0),k(O,null,I(s.workspaceSpaces,i=>(n(),k("li",{key:i.id,class:"flex items-center gap-2 rounded-md p-2 transition-colors hover:bg-muted/50"},[e("div",{class:"flex size-6 items-center justify-center rounded text-xs font-bold text-white",style:L({backgroundColor:i.color||t(ye)})},x(i.name.charAt(0)),5),e("span",Ee,x(i.name),1),i.private?(n(),k("span",ze,"(Private)")):_("",!0)]))),128))])):(n(),l(V,{key:2,icon:t(ae),tone:"muted",compact:"",title:"No spaces found"},null,8,["icon"]))])):_("",!0)])}),128))]))]),_:1}))}}),Ne={class:"mx-auto w-full max-w-5xl px-4 py-5 sm:px-6 lg:px-8"},We={class:"grid grid-cols-12 gap-4"},Oe={class:"col-span-12 space-y-4 lg:col-span-8"},Be={class:"col-span-12 h-fit space-y-4 lg:col-span-4"},je=$({__name:"ClickUpIntegration",setup(y){const{config:s,connectionStatus:r,workspaces:m,loading:a,error:o,isConfigured:i,loadConfig:G,saveConfig:j,testConnection:T,loadWorkspaces:q,getSpaces:K}=re(),b=ce({api_token:""}),S=v(!1),H=v(!1),A=v(!1),E=v(!1),z=v(null),h=v(null),R=v([]);ie(async()=>{await G(),s.value&&(await T(),r.value.connected&&await N())});async function J(){var c;z.value=null;const g={organization_id:"",api_token:b.api_token||((c=s.value)==null?void 0:c.api_token)||"",is_active:!0};try{const p=await T(g);z.value=p,p.connected?(P(D.INTEGRATION_TEST_RUN,{provider:"clickup",success:!0}),C.success("ClickUp connection verified.")):C.error("ClickUp connection failed.",{description:p.error??"Unknown error"})}catch(p){C.error("ClickUp connection failed.",{description:p instanceof Error?p.message:"Unknown error"})}}async function Y(){var g;try{const c=i.value;await j({api_token:b.api_token||((g=s.value)==null?void 0:g.api_token)||"",is_active:!0})?(await T(),r.value.connected&&await N(),b.api_token="",P(D.INTEGRATION_CONNECTED,{provider:"clickup",first_time:!c}),C.success(c?"ClickUp configuration updated.":"ClickUp connected.")):C.error("Failed to save ClickUp configuration.",{description:o.value??"Unknown error"})}catch(c){C.error("Failed to save ClickUp configuration.",{description:c instanceof Error?c.message:"Unknown error"})}}async function N(){A.value=!0,await q(),A.value=!1}async function Q(g){if(h.value===g){h.value=null,R.value=[];return}h.value=g,E.value=!0,R.value=await K(g),E.value=!1}return(g,c)=>(n(),l(de,{title:t(i)?"Update Configuration":"Connect to ClickUp","show-back-button":"",subtitle:"Connect your ClickUp account to create tasks directly from session recordings.","show-loader":!1},{"header-actions":d(()=>[u(t(le),{variant:t(i)?"success":"metadata"},{default:d(()=>[f(x(t(i)?"Active":"Not Connected"),1)]),_:1},8,["variant"])]),default:d(()=>[e("div",Ne,[e("div",We,[e("main",Oe,[u(xe,{"api-token":b.api_token,"onUpdate:apiToken":c[0]||(c[0]=p=>b.api_token=p),"is-configured":t(i),loading:t(a),error:t(o),"test-result":z.value,"show-api-token":S.value,onToggleToken:c[1]||(c[1]=p=>S.value=!S.value),onTest:J,onSubmit:Y,onDisconnect:c[2]||(c[2]=p=>H.value=!0)},null,8,["api-token","is-configured","loading","error","test-result","show-api-token"]),t(r).connected?(n(),l(Re,{key:0,workspaces:t(m),"loading-workspaces":A.value,"loading-spaces":E.value,"expanded-workspace":h.value,"workspace-spaces":R.value,onRefresh:N,onToggleSpaces:Q},null,8,["workspaces","loading-workspaces","loading-spaces","expanded-workspace","workspace-spaces"])):_("",!0)]),e("aside",Be,[u(_e)])])])]),_:1},8,["title"]))}});
1export{je as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.