@tickernelz/paperclip-pro-ui 2026.1025.6 → 2026.1025.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AgentAvatar-CznfLCi0.js → AgentAvatar-D886s7b1.js} +1 -1
- package/dist/assets/{Agents.production-BQtnSGUW.js → Agents.production-CTacW9QH.js} +2 -2
- package/dist/assets/{BreadcrumbContext-Dk7w7UfX.js → BreadcrumbContext-YFBsb1eF.js} +1 -1
- package/dist/assets/{CompanyActivity.production-BS9BSQMl.js → CompanyActivity.production-CzEOSBzg.js} +1 -1
- package/dist/assets/{CompanyExport-C8GwwZu4.js → CompanyExport-B7M7A8CV.js} +1 -1
- package/dist/assets/{CompanySkills.production-MIQ--cmS.js → CompanySkills.production-Md5bdvfu.js} +1 -1
- package/dist/assets/{EmptyState-uVSuq85X.js → EmptyState-Cdh3GOJG.js} +1 -1
- package/dist/assets/{MarkdownBody-CpPZvU2j.js → MarkdownBody-hzf52hYP.js} +1 -1
- package/dist/assets/{MarkdownEditor-B2V6J23i.js → MarkdownEditor-TeZtHH3E.js} +1 -1
- package/dist/assets/{OrgChart.production-Bu2lB5Nt.js → OrgChart.production-qQsiK1Cf.js} +1 -1
- package/dist/assets/{PageSkeleton-O1LpCSKM.js → PageSkeleton-lBEhkJYF.js} +1 -1
- package/dist/assets/{RoutineDetail.production-DsjJ5PBE.js → RoutineDetail.production-Bsa6AEv0.js} +1 -1
- package/dist/assets/{RoutineRunVariablesDialog-D4NQOKZC.js → RoutineRunVariablesDialog-Dg9B-C0u.js} +1 -1
- package/dist/assets/{Routines.production-BchMRZZh.js → Routines.production-CX3CwCgi.js} +1 -1
- package/dist/assets/{SearchableSelect-CnTyh784.js → SearchableSelect-DQD01xVG.js} +1 -1
- package/dist/assets/{StatusIcon-DoTF968D.js → StatusIcon-DTQdc51O.js} +1 -1
- package/dist/assets/{Terminal-CyaS5BqC.js → Terminal-BSP-TZ7T.js} +1 -1
- package/dist/assets/{ToastContext-Dnp-VBke.js → ToastContext-BoCOA6uW.js} +1 -1
- package/dist/assets/{access-CHF92G8Y.js → access-D05zD04o.js} +1 -1
- package/dist/assets/agent-avatar-url-N18gY2pF.js +1 -0
- package/dist/assets/{agents-Ctc0TQeI.js → agents-CZRBkVLt.js} +1 -1
- package/dist/assets/{alert-dialog-F9frgcFY.js → alert-dialog-CWzV3zo2.js} +1 -1
- package/dist/assets/{arrow-right-CtxxobUD.js → arrow-right-AA-rmcnS.js} +1 -1
- package/dist/assets/{badge-B1VgJan1.js → badge-C-rbIvdW.js} +1 -1
- package/dist/assets/{bot-B58bWuGB.js → bot-cT3HQzOs.js} +1 -1
- package/dist/assets/{boxes-ge7fUaKz.js → boxes-D_jBxmFh.js} +23 -23
- package/dist/assets/{card-C9f4MgJN.js → card-DWBuAsvl.js} +1 -1
- package/dist/assets/{check-DcqI_udI.js → check-BxpiJ7RJ.js} +1 -1
- package/dist/assets/{checkbox-DijH5oep.js → checkbox-DIJHqeW0.js} +1 -1
- package/dist/assets/{chevron-down-BFeNNuce.js → chevron-down-DNwAOF6s.js} +1 -1
- package/dist/assets/{clipboard-BopVKvCn.js → clipboard-qMoH9LBU.js} +1 -1
- package/dist/assets/{definition-1GISBrkr.js → definition-Cw0xJ6re.js} +1 -1
- package/dist/assets/{dialog-B-LXe7Vu.js → dialog-DjwDIuGh.js} +1 -1
- package/dist/assets/{dist-715Bo9Zm.js → dist-BAAKC5Nd.js} +1 -1
- package/dist/assets/{dist-Bf5HGeCZ.js → dist-BntviyDG.js} +1 -1
- package/dist/assets/{dist-BYajtAok.js → dist-Ck17A0lN.js} +1 -1
- package/dist/assets/{dist-DqfjZb00.js → dist-CoTZcmGs.js} +1 -1
- package/dist/assets/{dist-BvCFD8lr.js → dist-DhbiIwLJ.js} +1 -1
- package/dist/assets/{environments-6ISvtKIm.js → environments-9T907scB.js} +1 -1
- package/dist/assets/{external-link-C53p48pQ.js → external-link-B5nRAEdU.js} +1 -1
- package/dist/assets/{file-text-OFPVSsQC.js → file-text-weiGzqbg.js} +1 -1
- package/dist/assets/{health-CdlH8jEn.js → health-BX-qvpy-.js} +1 -1
- package/dist/assets/{heartbeats-B7eLHCaD.js → heartbeats-BPUSohxP.js} +1 -1
- package/dist/assets/{index-fiYETCbm.js → index-CJ3HfyaI.js} +5 -5
- package/dist/assets/{input-BSRWlgGq.js → input-BvMWG1qq.js} +1 -1
- package/dist/assets/{instanceSettings-BLnw5WLA.js → instanceSettings-BUopEpWC.js} +1 -1
- package/dist/assets/{label-CnUKBG5B.js → label-CQPDvZCa.js} +1 -1
- package/dist/assets/{mention-chips-UvixYAt_.js → mention-chips-DpGh4t29.js} +1 -1
- package/dist/assets/{rotate-ccw-BUbLu8I6.js → rotate-ccw-CKRNJfyN.js} +1 -1
- package/dist/assets/{save-qnjWmD_f.js → save-DOI3xZRr.js} +1 -1
- package/dist/assets/{select-CZGZxSBZ.js → select-C-xKsktX.js} +1 -1
- package/dist/assets/{sheet-BEbdXn7z.js → sheet-BCC6X3p_.js} +1 -1
- package/dist/assets/{skeleton-CZeQoM8O.js → skeleton-C4kyd_vV.js} +1 -1
- package/dist/assets/{tabs-B78VQmVJ.js → tabs-CN7fGVFF.js} +1 -1
- package/dist/assets/{use-adapter-capabilities-D6iQZSJh.js → use-adapter-capabilities-6CN-Uka0.js} +1 -1
- package/dist/assets/{useHiddenSettings-CG4zjJEL.js → useHiddenSettings-DegRKYY7.js} +1 -1
- package/dist/assets/{usePrefersReducedMotion-D83g8PIz.js → usePrefersReducedMotion-CPVSqZjQ.js} +1 -1
- package/dist/assets/{x-skJFDzLW.js → x-C1wDgmBG.js} +1 -1
- package/dist/downloads/local-browser-chromium.zip +0 -0
- package/dist/downloads/local-browser-firefox-unsigned.zip +0 -0
- package/dist/downloads/local-browser-firefox.xpi +0 -0
- package/dist/index.html +49 -49
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/dist/assets/agent-avatar-url-BzWpZy3t.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var E=Object.defineProperty;var o=(a,e)=>E(a,"name",{value:e,configurable:!0});import{i as C}from"./rolldown-runtime-ZpX3ckPj.js";import{G as v,Ja as L,Ka as w,M as A,T as k,bn as h,j as N,k as I,wn as R}from"./boxes-
|
|
1
|
+
var E=Object.defineProperty;var o=(a,e)=>E(a,"name",{value:e,configurable:!0});import{i as C}from"./rolldown-runtime-ZpX3ckPj.js";import{G as v,Ja as L,Ka as w,M as A,T as k,bn as h,j as N,k as I,wn as R}from"./boxes-D_jBxmFh.js";import"./agent-avatar-url-N18gY2pF.js";var m=C(L(),1),i=C(w(),1),y=Object.defineProperty,g=o((a,e)=>y(a,"name",{value:e,configurable:!0}),"__name"),z="Avatar",[T,Y]=N(z),M=[0,()=>{}],[P,_]=T(z),F=m.forwardRef(g(o(function(e,t){const{__scopeAvatar:s,...n}=e,[r,l]=m.useState("idle"),[d,u]=S();return(0,i.jsx)(P,{scope:s,imageLoadingStatus:r,setImageLoadingStatus:l,imageCount:d,setImageCount:u,children:(0,i.jsx)(A.span,{...n,ref:t})})},"Avatar2"),"Avatar")),U="AvatarImage",q=m.forwardRef(g(o(function(e,t){const{__scopeAvatar:s,src:n,onLoadingStatusChange:r,...l}=e,d=_(U,s);d.setImageCount;const u=j(n,{referrerPolicy:l.referrerPolicy,crossOrigin:l.crossOrigin,loadingStatus:d.imageLoadingStatus,setLoadingStatus:d.setImageLoadingStatus}),c=k(f=>{r?.(f)}),p=m.useRef(u);return I(()=>{const f=p.current;p.current=u,u!==f&&c(u)},[u,c]),u==="loaded"?(0,i.jsx)(A.img,{...l,ref:t,src:n}):null},"AvatarImage2"),"AvatarImage")),G="AvatarFallback",O=m.forwardRef(g(o(function(e,t){const{__scopeAvatar:s,delayMs:n,...r}=e,l=_(G,s),[d,u]=m.useState(n===void 0);return m.useEffect(()=>{if(n!==void 0){const c=window.setTimeout(()=>u(!0),n);return()=>window.clearTimeout(c)}},[n]),d&&l.imageLoadingStatus!=="loaded"?(0,i.jsx)(A.span,{...r,ref:t}):null},"AvatarFallback2"),"AvatarFallback"));function j(a,{loadingStatus:e,setLoadingStatus:t,referrerPolicy:s,crossOrigin:n}){return I(()=>{if(!a){t("error");return}const r=new window.Image,l=g(u=>{const c=u.currentTarget;t(x(c))},"handleLoad"),d=g(()=>t("error"),"handleError");return r.addEventListener("load",l),r.addEventListener("error",d),s&&(r.referrerPolicy=s),r.crossOrigin=n??null,r.src=a,t(x(r)),()=>{r.removeEventListener("load",l),r.removeEventListener("error",d),t("idle")}},[a,n,s,t]),e}o(j,"useImageLoadingStatus");g(j,"useImageLoadingStatus");function x(a){return a.complete?a.naturalWidth>0?"loaded":"error":"loading"}o(x,"getImageLoadingStatus");g(x,"getImageLoadingStatus");function S(){return M}o(S,"useImageCount");g(S,"useImageCount");function W(a){}o(W,"useUpdateImageCount");g(W,"useUpdateImageCount");function $({className:a,size:e="default",shape:t="circle",...s}){return(0,i.jsx)(F,{"data-slot":"avatar","data-size":e,"data-shape":t,className:v("group/avatar relative flex size-8 shrink-0 overflow-hidden select-none data-[size=lg]:size-10 data-[size=sm]:size-6 data-[size=xs]:size-5",t==="square"?"rounded-md":"rounded-full",a),...s})}o($,"Avatar");function K({className:a,...e}){return(0,i.jsx)(q,{"data-slot":"avatar-image",className:v("aspect-square size-full object-cover",a),...e})}o(K,"AvatarImage");function B({className:a,...e}){return(0,i.jsx)(O,{"data-slot":"avatar-fallback",className:v("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[shape=square]/avatar:rounded-md group-data-[size=sm]/avatar:text-xs group-data-[size=xs]/avatar:text-(length:--text-nano)",a),...e})}o(B,"AvatarFallback");function Z({className:a,...e}){return(0,i.jsx)("div",{"data-slot":"avatar-group",className:v("*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2",a),...e})}o(Z,"AvatarGroup");function aa({className:a,...e}){return(0,i.jsx)("div",{"data-slot":"avatar-group-count",className:v("bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",a),...e})}o(aa,"AvatarGroupCount");function b(a){const e=a.trim().split(/\s+/);return e.length>=2?(e[0][0]+e[e.length-1][0]).toUpperCase():a.slice(0,2).toUpperCase()}o(b,"deriveInitials");var J={xs:"text-sm",sm:"text-xs",default:"text-sm",lg:"text-sm"};function ea({name:a,avatarUrl:e,initials:t,size:s="default",shape:n="circle",className:r}){const l=t??b(a);return(0,i.jsxs)("span",{className:v("inline-flex min-w-0 gap-1.5 items-center",s==="xs"&&"gap-1",s==="lg"&&"gap-2",r),title:a,children:[(0,i.jsxs)($,{size:s,shape:n,"aria-hidden":"true",children:[e&&(0,i.jsx)(K,{src:e,alt:""}),(0,i.jsx)(B,{children:l})]}),(0,i.jsx)("span",{className:v("truncate",J[s]),children:a})]})}o(ea,"Identity");var V={16:"size-4",20:"size-5",24:"size-6",32:"size-8",40:"size-10",48:"size-12",64:"size-16",96:"size-24",128:"size-32",256:"size-64",512:"size-128"};function ta({agent:a,appearance:e,size:t=24,name:s,label:n,pose:r="rest",muted:l=!1,className:d}){const u=R(e??a?.appearance,a?.id),c=h(u,t,1,r,l),[p,f]=(0,m.useState)(null);return(0,i.jsx)("span",{"data-slot":"agent-avatar",className:v("relative inline-flex shrink-0 items-center justify-center align-middle",V[t],d),role:n?"img":void 0,"aria-label":n,"aria-hidden":n?void 0:!0,children:p===c?(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:b(s??a?.name??"Agent")}):(0,i.jsx)("img",{src:c,srcSet:u.customAvatarAssetId?void 0:`${h(u,t,2,r,l)} 2x`,alt:"",width:t,height:t,decoding:"async",loading:"lazy",className:"size-full object-contain",onError:o(()=>f(c),"onError")})})}o(ta,"AgentAvatar");export{$ as a,aa as c,b as i,K as l,V as n,B as o,ea as r,Z as s,ta as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
var Ie=Object.defineProperty;var a=(e,n)=>Ie(e,"name",{value:n,configurable:!0});import{i as ae}from"./rolldown-runtime-ZpX3ckPj.js";import{B as re,Ci as Ce,G as T,Ja as Ae,Ka as Se,St as b,fa as j,ht as Ee,ut as _e,z as R}from"./boxes-ge7fUaKz.js";import{t as Le}from"./preload-helper-CceJXRIF.js";import{In as Me,d as Te,n as ke,o as ie,r as K,st as qe,vt as Pe}from"./BreadcrumbContext-Dk7w7UfX.js";import{m as le}from"./alert-dialog-F9frgcFY.js";import{t as oe}from"./AgentAvatar-CznfLCi0.js";import{t as Be}from"./tabs-B78VQmVJ.js";import{t as ee}from"./bot-B58bWuGB.js";import{i as Fe,o as $e,t as Re}from"./heartbeats-B7eLHCaD.js";import{r as Ke,t as Oe}from"./instanceSettings-BLnw5WLA.js";import{t as te}from"./agents-Ctc0TQeI.js";import{t as se}from"./environments-6ISvtKIm.js";import{t as ne}from"./EmptyState-uVSuq85X.js";import{t as De}from"./PageSkeleton-O1LpCSKM.js";import{$t as ze,Ft as Ue,Kt as Ve,Ut as O,Xt as Ge,an as He,en as Qe,in as ce,nn as Je,on as Xe,qt as We,tn as ue}from"./index-fiYETCbm.js";var d=ae(Ae(),1),t=ae(Se(),1),de=Ce,Ye=(0,d.lazy)(()=>Le(()=>import("./index-fiYETCbm.js").then(e=>e.wt).then(e=>({default:e.ConfigureBuiltInAgentModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53]))),Ze=["all","active","paused","error","builtin"],et=[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"paused",label:"Paused"},{value:"error",label:"Error"},{value:"builtin",label:"Built-in"}];function tt(e){return Ze.includes(e)}a(tt,"isFilterTab");var z={label:"Local",detail:"Paperclip host",title:"Local - Paperclip host"},me={label:"—",detail:"Loading environment",title:"Loading environment"},pe=new Set(["terminated","pending_approval"]);function xe(e,n){return n==="all"?!0:n==="active"?e==="active"||e==="running"||e==="idle":n==="paused"?e==="paused":n==="error"?e==="error":!0}a(xe,"matchesFilter");function st(e,n,i){return e.filter(r=>pe.has(r.status)?!1:n==="builtin"?i.has(r.id):xe(r.status,n)).sort((r,o)=>r.name.localeCompare(o.name))}a(st,"filterAgents");function nt(e){const n=e.adapterConfig?.model;if(typeof n!="string")return null;const i=n.trim();return i.length>0?i:null}a(nt,"getConfiguredModel");function at(e){return e==="ssh"?"SSH":e.charAt(0).toUpperCase()+e.slice(1)}a(at,"formatEnvironmentDriver");function rt(e,n){const i=typeof e.config.provider=="string"?e.config.provider.trim():"";return i?n?.sandboxProviders?.[i]?.displayName??i:"Sandbox"}a(rt,"getSandboxProviderLabel");function it(e,n){const i=Ve(e)?"Managed by Paperclip":e.driver==="sandbox"?`${rt(e,n)} sandbox provider`:e.driver==="local"?"Paperclip host":at(e.driver);return{label:e.name,detail:i,title:`${e.name} - ${i}`}}a(it,"describeEnvironment");function lt(e){return{label:"Unknown environment",detail:e.slice(0,8),title:`Unknown environment - ${e}`}}a(lt,"describeMissingEnvironment");function ot(e,n,i,r){const o=e.defaultEnvironmentId??i;if(!o)return z;const m=n.get(o);return m?it(m,r):lt(o)}a(ot,"resolveAgentEnvironment");function ge(e,n,i){return e.reduce((r,o)=>{const m=ge(o.reports,n,i);return pe.has(o.status)?(r.push(...m),r):(((n==="builtin"?i.has(o.id):xe(o.status,n))||m.length>0)&&r.push({...o,reports:m}),r)},[]).sort((r,o)=>r.name.localeCompare(o.name))}a(ge,"filterOrgTree");function Ct(){const{selectedCompanyId:e}=Ee(),{openNewAgent:n}=Fe(),{setBreadcrumbs:i}=ke(),r=Te(),o=Me(),{isMobile:m}=Ke(),N=o.pathname.split("/").pop()??"all",v=tt(N)?N:"all",[S,w]=(0,d.useState)("org"),I=m,l=I?"list":S,{data:u}=j({queryKey:b.instance.settings,queryFn:a(()=>Oe.get(),"queryFn"),enabled:!!e}),p=u?.experimental.enableBuiltInAgents===!0,f=v==="builtin"&&!p?"all":v,k=(0,d.useMemo)(()=>et.filter(s=>s.value!=="builtin"||p),[p]),{data:h}=j({queryKey:b.builtInAgents.list(e),queryFn:a(()=>He.list(e),"queryFn"),enabled:!!e&&p}),E=(0,d.useMemo)(()=>{const s=new Map;if(!p)return s;for(const c of h??[])c.agentId&&s.set(c.agentId,c);return s},[h,p]),U=(0,d.useMemo)(()=>new Set(E.keys()),[E]),[q,P]=(0,d.useState)(null),{data:x,isLoading:ve,error:V}=j({queryKey:b.agents.list(e),queryFn:a(()=>te.list(e),"queryFn"),enabled:!!e}),{data:C}=j({queryKey:b.org(e),queryFn:a(()=>te.org(e),"queryFn"),enabled:!!e&&l==="org"}),_=u?.experimental.enableEnvironments===!0,{data:A}=j({queryKey:b.environments.list(e),queryFn:a(()=>se.list(e),"queryFn"),enabled:!!e&&_}),{data:G}=j({queryKey:b.environments.capabilities(e),queryFn:a(()=>se.capabilities(e),"queryFn"),enabled:!!e&&_}),H=[...b.liveRuns(e),"agents-page"],B=Qe({companyId:e,resourceKey:"live-runs:agents-page",queryKey:H,enabled:!!e,refetchInterval:15e3,leaderOnly:!0}),{data:F,dataUpdatedAt:be}=j({queryKey:H,queryFn:a(()=>Re.liveRunsForCompany(e),"queryFn"),enabled:B.enabled,refetchInterval:B.refetchInterval});ze(B,F,be);const Q=Je(e),L=(0,d.useMemo)(()=>{const s=new Map;for(const c of F??[]){if(c.status!=="running"&&c.status!=="queued")continue;const g=s.get(c.agentId);if(g){g.liveCount+=1;continue}s.set(c.agentId,{runId:c.id,liveCount:1})}return s},[F]),je=(0,d.useMemo)(()=>{const s=new Map;for(const c of x??[])s.set(c.id,c);return s},[x]),J=(0,d.useMemo)(()=>{const s=new Map;for(const c of A??[])s.set(c.id,c);return s},[A]),X=(0,d.useMemo)(()=>{const s=new Map;for(const c of x??[])s.set(c.id,ot(c,J,u?.defaultEnvironmentId??null,G));return s},[x,J,G,u?.defaultEnvironmentId]);if((0,d.useEffect)(()=>{i([{label:"Agents"}])},[i]),(0,d.useEffect)(()=>{e&&v==="builtin"&&u&&!p&&r("/agents/all",{replace:!0})},[p,u,r,v,e]),!e)return(0,t.jsx)(ne,{icon:ee,message:"Select a company to view agents."});if(ve)return(0,t.jsx)(De,{variant:"list"});const y=st(x??[],f,U),$=ge(C??[],f,U),W=_&&A===void 0,Y=_&&(A===void 0||A.length>1),ye=a(s=>W?me:X.get(s)??z,"resolveRenderedEnvironment"),Ne=a(s=>{const c=s.orgChainHealth?.status==="invalid_org_chain",g=E.get(s.id),we=g?.status==="needs_setup"||g?.status==="pending_approval",M=g&&we?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ce,{status:g.status}),g.status==="needs_setup"&&(0,t.jsx)("span",{onClick:a(Z=>{Z.preventDefault(),Z.stopPropagation()},"onClick"),children:(0,t.jsx)(K,{size:"xs",variant:"outline",onClick:a(()=>P(g),"onClick"),children:"Set up"})})]}):null;return(0,t.jsx)(Ue,{title:s.name,titleAccessory:(0,t.jsx)(Xe,{agentId:s.id,companyId:s.companyId}),titleClassName:"flex-1 xl:flex-none xl:w-56",titleTextClassName:"whitespace-normal break-words xl:truncate xl:whitespace-nowrap",subtitleClassName:"whitespace-normal break-words xl:truncate xl:whitespace-nowrap",subtitle:`${de[s.role]??s.role}${s.title?` - ${s.title}`:""}`,to:re(s),className:T("group",s.pausedAt&&f!=="paused"?"opacity-50":"",ue(Q.data,"agent",s.id)==="left"?"sm:text-foreground/55":""),leading:c?(0,t.jsx)(le,{className:"h-3.5 w-3.5 text-amber-500","aria-label":"Invalid reporting chain"}):(0,t.jsx)(oe,{agent:s,size:32}),secondaryRow:M?(0,t.jsx)("div",{className:"xl:hidden flex flex-wrap items-center gap-1.5",children:M}):void 0,meta:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[M&&(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-1.5",children:M}),(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-3",children:(0,t.jsx)(he,{agent:s,environment:ye(s.id),showEnvironment:Y})})]}),metaSpacerClassName:"hidden xl:block",trailing:(0,t.jsx)("div",{className:"flex items-center gap-3",children:(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-3",children:[L.has(s.id)&&(0,t.jsx)(D,{agentRef:R(s),runId:L.get(s.id).runId,liveCount:L.get(s.id).liveCount}),(0,t.jsx)("span",{className:"w-20 flex justify-end",children:(0,t.jsx)(O,{status:s.status})})]})})},s.id)},"renderAgentRow");return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsx)(Be,{value:f,onValueChange:a(s=>r(`/agents/${s}`),"onValueChange"),children:(0,t.jsx)(Ge,{items:k,value:f,onValueChange:a(s=>r(`/agents/${s}`),"onValueChange")})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[!I&&(0,t.jsxs)("div",{className:"flex items-center border border-border",role:"group","aria-label":"View mode",children:[(0,t.jsx)("button",{className:T("p-1.5 transition-colors",l==="list"?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),onClick:a(()=>w("list"),"onClick"),title:"List view","aria-label":"List view","aria-pressed":l==="list",children:(0,t.jsx)($e,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{className:T("p-1.5 transition-colors",l==="org"?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),onClick:a(()=>w("org"),"onClick"),title:"Org chart view","aria-label":"Org chart view","aria-pressed":l==="org",children:(0,t.jsx)(Pe,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)(K,{size:"sm",variant:"outline",onClick:n,children:[(0,t.jsx)(qe,{className:"h-3.5 w-3.5 mr-1.5"}),"New Agent"]})]})]}),y.length>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[y.length," agent",y.length!==1?"s":""]}),V&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:V.message}),x&&x.length===0&&(0,t.jsx)(ne,{icon:ee,message:"Create your first agent to get started.",action:"New Agent",onAction:n}),l==="list"&&y.length>0&&(0,t.jsx)("div",{children:y.map(Ne)}),l==="list"&&x&&x.length>0&&y.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No agents match the selected status."}),l==="org"&&$.length>0&&(0,t.jsx)("div",{className:"py-1",children:$.map(s=>(0,t.jsx)(fe,{node:s,depth:0,agentMap:je,liveRunByAgent:L,environmentByAgentId:X,environmentDataLoading:W,showEnvironment:Y,tab:f,memberships:Q.data,builtInByAgentId:E,onConfigureBuiltIn:P},s.id))}),l==="org"&&C&&C.length>0&&$.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No agents match the selected status."}),l==="org"&&C&&C.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No organizational hierarchy defined."}),q&&e&&(0,t.jsx)(d.Suspense,{fallback:null,children:(0,t.jsx)(Ye,{companyId:e,state:q,open:q!==null,onOpenChange:a(s=>{s||P(null)},"onOpenChange")})})]})}a(Ct,"Agents");function fe({node:e,depth:n,agentMap:i,liveRunByAgent:r,environmentByAgentId:o,environmentDataLoading:m,showEnvironment:N,tab:v,memberships:S,builtInByAgentId:w,onConfigureBuiltIn:I}){const l=i.get(e.id),u=w.get(e.id),p=u?.status==="needs_setup"||u?.status==="pending_approval",f=!!(l&&l.orgChainHealth?.status==="invalid_org_chain"),k=ue(S,"agent",e.id);return(0,t.jsxs)("div",{style:{paddingLeft:n*24},children:[(0,t.jsxs)(ie,{to:l?re(l):`/agents/${e.id}`,className:T("group flex items-center gap-3 rounded-lg px-3 py-2 hover:bg-accent/50 transition-colors w-full text-left no-underline text-inherit",l?.pausedAt&&v!=="paused"&&"opacity-50",k==="left"&&"sm:text-foreground/55"),children:[f?(0,t.jsx)(le,{className:"h-3.5 w-3.5 shrink-0 text-amber-500","aria-label":"Invalid reporting chain"}):(0,t.jsx)(oe,{agent:l??e,size:24}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("div",{className:"min-w-(--sz-7rem) truncate",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground ml-2",children:[de[e.role]??e.role,l?.title?` - ${l.title}`:""]})]}),u&&p&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,t.jsx)(ce,{status:u.status}),u.status==="needs_setup"&&(0,t.jsx)("span",{onClick:a(h=>{h.preventDefault(),h.stopPropagation()},"onClick"),children:(0,t.jsx)(K,{size:"xs",variant:"outline",onClick:a(()=>I(u),"onClick"),children:"Set up"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[(0,t.jsx)("span",{className:"sm:hidden",children:r.has(e.id)?(0,t.jsx)(D,{agentRef:l?R(l):e.id,runId:r.get(e.id).runId,liveCount:r.get(e.id).liveCount}):(0,t.jsx)(O,{status:e.status})}),(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-3",children:[r.has(e.id)&&(0,t.jsx)(D,{agentRef:l?R(l):e.id,runId:r.get(e.id).runId,liveCount:r.get(e.id).liveCount}),l&&(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-3",children:(0,t.jsx)(he,{agent:l,environment:m?me:o.get(l.id)??z,showEnvironment:N})}),(0,t.jsx)("span",{className:"w-20 flex justify-end",children:(0,t.jsx)(O,{status:e.status})})]})]})]}),e.reports&&e.reports.length>0&&(0,t.jsx)("div",{className:"border-l border-border ml-4",children:e.reports.map(h=>(0,t.jsx)(fe,{node:h,depth:n+1,agentMap:i,liveRunByAgent:r,environmentByAgentId:o,environmentDataLoading:m,showEnvironment:N,tab:v,memberships:S,builtInByAgentId:w,onConfigureBuiltIn:I},h.id))})]})}a(fe,"OrgTreeNode");function he({agent:e,environment:n,showEnvironment:i}){const r=nt(e),o=We(e.adapterType);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"w-44 min-w-0 leading-tight",children:[(0,t.jsx)("div",{className:"truncate font-mono text-xs text-muted-foreground",title:r??void 0,children:r??"—"}),(0,t.jsx)("div",{className:"truncate font-mono text-(length:--text-micro) text-muted-foreground/70",title:o,children:o})]}),i&&(0,t.jsxs)("div",{className:"w-44 min-w-0 leading-tight",children:[(0,t.jsx)("div",{className:"truncate text-xs text-muted-foreground",title:n.title,children:n.label}),(0,t.jsx)("div",{className:"truncate text-(length:--text-micro) text-muted-foreground/70",children:n.detail})]}),(0,t.jsx)("span",{className:"w-24 whitespace-nowrap text-right text-xs text-muted-foreground",children:e.lastHeartbeatAt?_e(e.lastHeartbeatAt):"—"})]})}a(he,"AgentMetaColumns");function D({agentRef:e,runId:n,liveCount:i}){return(0,t.jsxs)(ie,{to:`/agents/${e}/runs/${n}`,className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-blue-500/10 hover:bg-blue-500/20 transition-colors no-underline",onClick:a(r=>r.stopPropagation(),"onClick"),children:[(0,t.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,t.jsx)("span",{className:"animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]}),(0,t.jsxs)("span",{className:"text-(length:--text-micro) font-medium text-blue-600 dark:text-blue-400",children:["Live",i>1?` (${i})`:""]})]})}a(D,"LiveRunIndicator");export{Ct as Agents};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CJ3HfyaI.js","assets/rolldown-runtime-ZpX3ckPj.js","assets/boxes-D_jBxmFh.js","assets/preload-helper-CceJXRIF.js","assets/BreadcrumbContext-YFBsb1eF.js","assets/SearchableSelect-DQD01xVG.js","assets/dist-DhbiIwLJ.js","assets/dialog-DjwDIuGh.js","assets/dist-Ck17A0lN.js","assets/check-BxpiJ7RJ.js","assets/clipboard-qMoH9LBU.js","assets/x-C1wDgmBG.js","assets/RoutineRunVariablesDialog-Dg9B-C0u.js","assets/mention-chips-DpGh4t29.js","assets/agent-avatar-url-N18gY2pF.js","assets/alert-dialog-CWzV3zo2.js","assets/dist-BntviyDG.js","assets/dist-CoTZcmGs.js","assets/AgentAvatar-D886s7b1.js","assets/checkbox-DIJHqeW0.js","assets/label-CQPDvZCa.js","assets/MarkdownEditor-TeZtHH3E.js","assets/dist-BAAKC5Nd.js","assets/dist-BhxPxuMy.js","assets/StatusIcon-DTQdc51O.js","assets/usePrefersReducedMotion-CPVSqZjQ.js","assets/badge-C-rbIvdW.js","assets/bot-cT3HQzOs.js","assets/select-C-xKsktX.js","assets/chevron-down-DNwAOF6s.js","assets/sheet-BCC6X3p_.js","assets/heartbeats-BPUSohxP.js","assets/useHiddenSettings-DegRKYY7.js","assets/health-BX-qvpy-.js","assets/rotate-ccw-CKRNJfyN.js","assets/instanceSettings-BUopEpWC.js","assets/input-BvMWG1qq.js","assets/access-D05zD04o.js","assets/company-members-Duugb3uG.js","assets/environments-9T907scB.js","assets/card-DWBuAsvl.js","assets/EmptyState-Cdh3GOJG.js","assets/PageSkeleton-lBEhkJYF.js","assets/skeleton-C4kyd_vV.js","assets/tabs-CN7fGVFF.js","assets/use-adapter-capabilities-6CN-Uka0.js","assets/save-DOI3xZRr.js","assets/arrow-right-AA-rmcnS.js","assets/external-link-B5nRAEdU.js","assets/MarkdownBody-hzf52hYP.js","assets/agents-CZRBkVLt.js","assets/file-text-weiGzqbg.js","assets/ToastContext-BoCOA6uW.js","assets/index-CARV3Pdj.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Ie=Object.defineProperty;var a=(e,n)=>Ie(e,"name",{value:n,configurable:!0});import{i as ae}from"./rolldown-runtime-ZpX3ckPj.js";import{B as re,Ci as Ce,G as T,Ja as Ae,Ka as Se,St as b,fa as j,ht as Ee,ut as _e,z as R}from"./boxes-D_jBxmFh.js";import{t as Le}from"./preload-helper-CceJXRIF.js";import{In as Me,d as Te,n as ke,o as ie,r as K,st as qe,vt as Pe}from"./BreadcrumbContext-YFBsb1eF.js";import{m as le}from"./alert-dialog-CWzV3zo2.js";import{t as oe}from"./AgentAvatar-D886s7b1.js";import{t as Be}from"./tabs-CN7fGVFF.js";import{t as ee}from"./bot-cT3HQzOs.js";import{i as Fe,o as $e,t as Re}from"./heartbeats-BPUSohxP.js";import{r as Ke,t as Oe}from"./instanceSettings-BUopEpWC.js";import{t as te}from"./agents-CZRBkVLt.js";import{t as se}from"./environments-9T907scB.js";import{t as ne}from"./EmptyState-Cdh3GOJG.js";import{t as De}from"./PageSkeleton-lBEhkJYF.js";import{$t as ze,Ft as Ue,Kt as Ve,Ut as O,Xt as Ge,an as He,en as Qe,in as ce,nn as Je,on as Xe,qt as We,tn as ue}from"./index-CJ3HfyaI.js";var d=ae(Ae(),1),t=ae(Se(),1),de=Ce,Ye=(0,d.lazy)(()=>Le(()=>import("./index-CJ3HfyaI.js").then(e=>e.wt).then(e=>({default:e.ConfigureBuiltInAgentModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53]))),Ze=["all","active","paused","error","builtin"],et=[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"paused",label:"Paused"},{value:"error",label:"Error"},{value:"builtin",label:"Built-in"}];function tt(e){return Ze.includes(e)}a(tt,"isFilterTab");var z={label:"Local",detail:"Paperclip host",title:"Local - Paperclip host"},me={label:"—",detail:"Loading environment",title:"Loading environment"},pe=new Set(["terminated","pending_approval"]);function xe(e,n){return n==="all"?!0:n==="active"?e==="active"||e==="running"||e==="idle":n==="paused"?e==="paused":n==="error"?e==="error":!0}a(xe,"matchesFilter");function st(e,n,i){return e.filter(r=>pe.has(r.status)?!1:n==="builtin"?i.has(r.id):xe(r.status,n)).sort((r,o)=>r.name.localeCompare(o.name))}a(st,"filterAgents");function nt(e){const n=e.adapterConfig?.model;if(typeof n!="string")return null;const i=n.trim();return i.length>0?i:null}a(nt,"getConfiguredModel");function at(e){return e==="ssh"?"SSH":e.charAt(0).toUpperCase()+e.slice(1)}a(at,"formatEnvironmentDriver");function rt(e,n){const i=typeof e.config.provider=="string"?e.config.provider.trim():"";return i?n?.sandboxProviders?.[i]?.displayName??i:"Sandbox"}a(rt,"getSandboxProviderLabel");function it(e,n){const i=Ve(e)?"Managed by Paperclip":e.driver==="sandbox"?`${rt(e,n)} sandbox provider`:e.driver==="local"?"Paperclip host":at(e.driver);return{label:e.name,detail:i,title:`${e.name} - ${i}`}}a(it,"describeEnvironment");function lt(e){return{label:"Unknown environment",detail:e.slice(0,8),title:`Unknown environment - ${e}`}}a(lt,"describeMissingEnvironment");function ot(e,n,i,r){const o=e.defaultEnvironmentId??i;if(!o)return z;const m=n.get(o);return m?it(m,r):lt(o)}a(ot,"resolveAgentEnvironment");function ge(e,n,i){return e.reduce((r,o)=>{const m=ge(o.reports,n,i);return pe.has(o.status)?(r.push(...m),r):(((n==="builtin"?i.has(o.id):xe(o.status,n))||m.length>0)&&r.push({...o,reports:m}),r)},[]).sort((r,o)=>r.name.localeCompare(o.name))}a(ge,"filterOrgTree");function Ct(){const{selectedCompanyId:e}=Ee(),{openNewAgent:n}=Fe(),{setBreadcrumbs:i}=ke(),r=Te(),o=Me(),{isMobile:m}=Ke(),N=o.pathname.split("/").pop()??"all",v=tt(N)?N:"all",[S,w]=(0,d.useState)("org"),I=m,l=I?"list":S,{data:u}=j({queryKey:b.instance.settings,queryFn:a(()=>Oe.get(),"queryFn"),enabled:!!e}),p=u?.experimental.enableBuiltInAgents===!0,f=v==="builtin"&&!p?"all":v,k=(0,d.useMemo)(()=>et.filter(s=>s.value!=="builtin"||p),[p]),{data:h}=j({queryKey:b.builtInAgents.list(e),queryFn:a(()=>He.list(e),"queryFn"),enabled:!!e&&p}),E=(0,d.useMemo)(()=>{const s=new Map;if(!p)return s;for(const c of h??[])c.agentId&&s.set(c.agentId,c);return s},[h,p]),U=(0,d.useMemo)(()=>new Set(E.keys()),[E]),[q,P]=(0,d.useState)(null),{data:x,isLoading:ve,error:V}=j({queryKey:b.agents.list(e),queryFn:a(()=>te.list(e),"queryFn"),enabled:!!e}),{data:C}=j({queryKey:b.org(e),queryFn:a(()=>te.org(e),"queryFn"),enabled:!!e&&l==="org"}),_=u?.experimental.enableEnvironments===!0,{data:A}=j({queryKey:b.environments.list(e),queryFn:a(()=>se.list(e),"queryFn"),enabled:!!e&&_}),{data:G}=j({queryKey:b.environments.capabilities(e),queryFn:a(()=>se.capabilities(e),"queryFn"),enabled:!!e&&_}),H=[...b.liveRuns(e),"agents-page"],B=Qe({companyId:e,resourceKey:"live-runs:agents-page",queryKey:H,enabled:!!e,refetchInterval:15e3,leaderOnly:!0}),{data:F,dataUpdatedAt:be}=j({queryKey:H,queryFn:a(()=>Re.liveRunsForCompany(e),"queryFn"),enabled:B.enabled,refetchInterval:B.refetchInterval});ze(B,F,be);const Q=Je(e),L=(0,d.useMemo)(()=>{const s=new Map;for(const c of F??[]){if(c.status!=="running"&&c.status!=="queued")continue;const g=s.get(c.agentId);if(g){g.liveCount+=1;continue}s.set(c.agentId,{runId:c.id,liveCount:1})}return s},[F]),je=(0,d.useMemo)(()=>{const s=new Map;for(const c of x??[])s.set(c.id,c);return s},[x]),J=(0,d.useMemo)(()=>{const s=new Map;for(const c of A??[])s.set(c.id,c);return s},[A]),X=(0,d.useMemo)(()=>{const s=new Map;for(const c of x??[])s.set(c.id,ot(c,J,u?.defaultEnvironmentId??null,G));return s},[x,J,G,u?.defaultEnvironmentId]);if((0,d.useEffect)(()=>{i([{label:"Agents"}])},[i]),(0,d.useEffect)(()=>{e&&v==="builtin"&&u&&!p&&r("/agents/all",{replace:!0})},[p,u,r,v,e]),!e)return(0,t.jsx)(ne,{icon:ee,message:"Select a company to view agents."});if(ve)return(0,t.jsx)(De,{variant:"list"});const y=st(x??[],f,U),$=ge(C??[],f,U),W=_&&A===void 0,Y=_&&(A===void 0||A.length>1),ye=a(s=>W?me:X.get(s)??z,"resolveRenderedEnvironment"),Ne=a(s=>{const c=s.orgChainHealth?.status==="invalid_org_chain",g=E.get(s.id),we=g?.status==="needs_setup"||g?.status==="pending_approval",M=g&&we?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ce,{status:g.status}),g.status==="needs_setup"&&(0,t.jsx)("span",{onClick:a(Z=>{Z.preventDefault(),Z.stopPropagation()},"onClick"),children:(0,t.jsx)(K,{size:"xs",variant:"outline",onClick:a(()=>P(g),"onClick"),children:"Set up"})})]}):null;return(0,t.jsx)(Ue,{title:s.name,titleAccessory:(0,t.jsx)(Xe,{agentId:s.id,companyId:s.companyId}),titleClassName:"flex-1 xl:flex-none xl:w-56",titleTextClassName:"whitespace-normal break-words xl:truncate xl:whitespace-nowrap",subtitleClassName:"whitespace-normal break-words xl:truncate xl:whitespace-nowrap",subtitle:`${de[s.role]??s.role}${s.title?` - ${s.title}`:""}`,to:re(s),className:T("group",s.pausedAt&&f!=="paused"?"opacity-50":"",ue(Q.data,"agent",s.id)==="left"?"sm:text-foreground/55":""),leading:c?(0,t.jsx)(le,{className:"h-3.5 w-3.5 text-amber-500","aria-label":"Invalid reporting chain"}):(0,t.jsx)(oe,{agent:s,size:32}),secondaryRow:M?(0,t.jsx)("div",{className:"xl:hidden flex flex-wrap items-center gap-1.5",children:M}):void 0,meta:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[M&&(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-1.5",children:M}),(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-3",children:(0,t.jsx)(he,{agent:s,environment:ye(s.id),showEnvironment:Y})})]}),metaSpacerClassName:"hidden xl:block",trailing:(0,t.jsx)("div",{className:"flex items-center gap-3",children:(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-3",children:[L.has(s.id)&&(0,t.jsx)(D,{agentRef:R(s),runId:L.get(s.id).runId,liveCount:L.get(s.id).liveCount}),(0,t.jsx)("span",{className:"w-20 flex justify-end",children:(0,t.jsx)(O,{status:s.status})})]})})},s.id)},"renderAgentRow");return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsx)(Be,{value:f,onValueChange:a(s=>r(`/agents/${s}`),"onValueChange"),children:(0,t.jsx)(Ge,{items:k,value:f,onValueChange:a(s=>r(`/agents/${s}`),"onValueChange")})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[!I&&(0,t.jsxs)("div",{className:"flex items-center border border-border",role:"group","aria-label":"View mode",children:[(0,t.jsx)("button",{className:T("p-1.5 transition-colors",l==="list"?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),onClick:a(()=>w("list"),"onClick"),title:"List view","aria-label":"List view","aria-pressed":l==="list",children:(0,t.jsx)($e,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{className:T("p-1.5 transition-colors",l==="org"?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),onClick:a(()=>w("org"),"onClick"),title:"Org chart view","aria-label":"Org chart view","aria-pressed":l==="org",children:(0,t.jsx)(Pe,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)(K,{size:"sm",variant:"outline",onClick:n,children:[(0,t.jsx)(qe,{className:"h-3.5 w-3.5 mr-1.5"}),"New Agent"]})]})]}),y.length>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[y.length," agent",y.length!==1?"s":""]}),V&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:V.message}),x&&x.length===0&&(0,t.jsx)(ne,{icon:ee,message:"Create your first agent to get started.",action:"New Agent",onAction:n}),l==="list"&&y.length>0&&(0,t.jsx)("div",{children:y.map(Ne)}),l==="list"&&x&&x.length>0&&y.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No agents match the selected status."}),l==="org"&&$.length>0&&(0,t.jsx)("div",{className:"py-1",children:$.map(s=>(0,t.jsx)(fe,{node:s,depth:0,agentMap:je,liveRunByAgent:L,environmentByAgentId:X,environmentDataLoading:W,showEnvironment:Y,tab:f,memberships:Q.data,builtInByAgentId:E,onConfigureBuiltIn:P},s.id))}),l==="org"&&C&&C.length>0&&$.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No agents match the selected status."}),l==="org"&&C&&C.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No organizational hierarchy defined."}),q&&e&&(0,t.jsx)(d.Suspense,{fallback:null,children:(0,t.jsx)(Ye,{companyId:e,state:q,open:q!==null,onOpenChange:a(s=>{s||P(null)},"onOpenChange")})})]})}a(Ct,"Agents");function fe({node:e,depth:n,agentMap:i,liveRunByAgent:r,environmentByAgentId:o,environmentDataLoading:m,showEnvironment:N,tab:v,memberships:S,builtInByAgentId:w,onConfigureBuiltIn:I}){const l=i.get(e.id),u=w.get(e.id),p=u?.status==="needs_setup"||u?.status==="pending_approval",f=!!(l&&l.orgChainHealth?.status==="invalid_org_chain"),k=ue(S,"agent",e.id);return(0,t.jsxs)("div",{style:{paddingLeft:n*24},children:[(0,t.jsxs)(ie,{to:l?re(l):`/agents/${e.id}`,className:T("group flex items-center gap-3 rounded-lg px-3 py-2 hover:bg-accent/50 transition-colors w-full text-left no-underline text-inherit",l?.pausedAt&&v!=="paused"&&"opacity-50",k==="left"&&"sm:text-foreground/55"),children:[f?(0,t.jsx)(le,{className:"h-3.5 w-3.5 shrink-0 text-amber-500","aria-label":"Invalid reporting chain"}):(0,t.jsx)(oe,{agent:l??e,size:24}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("div",{className:"min-w-(--sz-7rem) truncate",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground ml-2",children:[de[e.role]??e.role,l?.title?` - ${l.title}`:""]})]}),u&&p&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,t.jsx)(ce,{status:u.status}),u.status==="needs_setup"&&(0,t.jsx)("span",{onClick:a(h=>{h.preventDefault(),h.stopPropagation()},"onClick"),children:(0,t.jsx)(K,{size:"xs",variant:"outline",onClick:a(()=>I(u),"onClick"),children:"Set up"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[(0,t.jsx)("span",{className:"sm:hidden",children:r.has(e.id)?(0,t.jsx)(D,{agentRef:l?R(l):e.id,runId:r.get(e.id).runId,liveCount:r.get(e.id).liveCount}):(0,t.jsx)(O,{status:e.status})}),(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-3",children:[r.has(e.id)&&(0,t.jsx)(D,{agentRef:l?R(l):e.id,runId:r.get(e.id).runId,liveCount:r.get(e.id).liveCount}),l&&(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-3",children:(0,t.jsx)(he,{agent:l,environment:m?me:o.get(l.id)??z,showEnvironment:N})}),(0,t.jsx)("span",{className:"w-20 flex justify-end",children:(0,t.jsx)(O,{status:e.status})})]})]})]}),e.reports&&e.reports.length>0&&(0,t.jsx)("div",{className:"border-l border-border ml-4",children:e.reports.map(h=>(0,t.jsx)(fe,{node:h,depth:n+1,agentMap:i,liveRunByAgent:r,environmentByAgentId:o,environmentDataLoading:m,showEnvironment:N,tab:v,memberships:S,builtInByAgentId:w,onConfigureBuiltIn:I},h.id))})]})}a(fe,"OrgTreeNode");function he({agent:e,environment:n,showEnvironment:i}){const r=nt(e),o=We(e.adapterType);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"w-44 min-w-0 leading-tight",children:[(0,t.jsx)("div",{className:"truncate font-mono text-xs text-muted-foreground",title:r??void 0,children:r??"—"}),(0,t.jsx)("div",{className:"truncate font-mono text-(length:--text-micro) text-muted-foreground/70",title:o,children:o})]}),i&&(0,t.jsxs)("div",{className:"w-44 min-w-0 leading-tight",children:[(0,t.jsx)("div",{className:"truncate text-xs text-muted-foreground",title:n.title,children:n.label}),(0,t.jsx)("div",{className:"truncate text-(length:--text-micro) text-muted-foreground/70",children:n.detail})]}),(0,t.jsx)("span",{className:"w-24 whitespace-nowrap text-right text-xs text-muted-foreground",children:e.lastHeartbeatAt?_e(e.lastHeartbeatAt):"—"})]})}a(he,"AgentMetaColumns");function D({agentRef:e,runId:n,liveCount:i}){return(0,t.jsxs)(ie,{to:`/agents/${e}/runs/${n}`,className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-blue-500/10 hover:bg-blue-500/20 transition-colors no-underline",onClick:a(r=>r.stopPropagation(),"onClick"),children:[(0,t.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,t.jsx)("span",{className:"animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]}),(0,t.jsxs)("span",{className:"text-(length:--text-micro) font-medium text-blue-600 dark:text-blue-400",children:["Live",i>1?` (${i})`:""]})]})}a(D,"LiveRunIndicator");export{Ct as Agents};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Mn=Object.defineProperty;var a=(e,t)=>Mn(e,"name",{value:t,configurable:!0});import{i as Ot}from"./rolldown-runtime-ZpX3ckPj.js";import{$i as Ln,G as V,Ga as Tn,Ja as On,Ka as jn,P as Nn,Qi as h,St as ce,Vi as Bn,Zi as Un,a as zn,c as Fn,ea as qn,fa as Hn,ht as Wn,l as Vn,n as k,pt as Qn,r as Kn,t as Jn,u as Gn}from"./boxes-ge7fUaKz.js";import{t as Yn}from"./preload-helper-CceJXRIF.js";var l=Ot(On(),1),He=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,jt=/^[\\/]{2}/;function Zn(e,t){return t+e.replace(/\\/g,"/")}a(Zn,"normalizeProtocolRelativeUrl");var ot="popstate";function st(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}a(st,"isLocation");function Xn(e={}){function t(n,o){let s=o.state?.masked,{pathname:i,search:u,hash:c}=s||n.location;return Oe("",{pathname:i,search:u,hash:c},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}a(t,"createBrowserLocation");function r(n,o){return typeof o=="string"?o:Q(o)}return a(r,"createBrowserHref"),ta(t,r,null,e)}a(Xn,"createBrowserHistory");function C(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}a(C,"invariant");function M(e,t){if(!e)try{throw new Error(t)}catch{}}a(M,"warning");function ea(){return Math.random().toString(36).substring(2,10)}a(ea,"createKey");function it(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}a(it,"getHistoryState");function Oe(e,t,r=null,n,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ee(t):t,state:r,key:t&&t.key||n||ea(),mask:o}}a(Oe,"createLocation");function Q({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}a(Q,"createPath");function ee(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}a(ee,"parsePath");function ta(e,t,r,n={}){let{window:o=document.defaultView,v5Compat:s=!1}=n,i=o.history,u="POP",c=null,d=m();d==null&&(d=0,i.replaceState({...i.state,idx:d},""));function m(){return(i.state||{idx:null}).idx}a(m,"getIndex");function f(){u="POP";let p=m(),x=p==null?null:p-d;d=p,c&&c({action:u,location:y.location,delta:x})}a(f,"handlePop");function g(p,x){u="PUSH";let w=st(p)?p:Oe(y.location,p,x);r&&r(w,p),d=m()+1;let S=it(w,d),$=y.createHref(w.mask||w);try{i.pushState(S,"",$)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;o.location.assign($)}s&&c&&c({action:u,location:y.location,delta:1})}a(g,"push");function b(p,x){u="REPLACE";let w=st(p)?p:Oe(y.location,p,x);r&&r(w,p),d=m();let S=it(w,d),$=y.createHref(w.mask||w);i.replaceState(S,"",$),s&&c&&c({action:u,location:y.location,delta:0})}a(b,"replace2");function v(p){return ra(o,p)}a(v,"createURL");let y={get action(){return u},get location(){return e(o,i)},listen(p){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(ot,f),c=p,()=>{o.removeEventListener(ot,f),c=null}},createHref(p){return t(o,p)},createURL:v,encodeLocation(p){let x=v(p);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:g,replace:b,go(p){return i.go(p)}};return y}a(ta,"getUrlBasedHistory");function ra(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),C(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Q(t);return o=o.replace(/ $/,"%20"),!r&&jt.test(o)&&(o=n+o),new URL(o,n)}a(ra,"createBrowserURLImpl");var na;na=new WeakMap;function Nt(e,t,r="/"){return Bt(e,t,r,!1)}a(Nt,"matchRoutes");function Bt(e,t,r,n,o){let s=F((typeof t=="string"?ee(t):t).pathname||"/",r);if(s==null)return null;let i=o??oa(e),u=null,c=ga(s);for(let d=0;u==null&&d<i.length;++d)u=pa(i[d],c,n);return u}a(Bt,"matchRoutesImpl");function aa(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],loaderData:t[r.id],handle:r.handle}}a(aa,"convertRouteMatchToUiMatch");function oa(e){let t=Ut(e);return sa(t),t}a(oa,"flattenAndRankRoutes");function Ut(e,t=[],r=[],n="",o=!1){let s=a((i,u,c=o,d)=>{let m={relativePath:d===void 0?i.path||"":d,caseSensitive:i.caseSensitive===!0,childrenIndex:u,route:i};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(n)&&c)return;C(m.relativePath.startsWith(n),`Absolute route path "${m.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(n.length)}let f=N([n,m.relativePath]),g=r.concat(m);i.children&&i.children.length>0&&(C(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Ut(i.children,t,g,f,c)),!(i.path==null&&!i.index)&&t.push({path:f,score:ma(f,i.index),routesMeta:g.map((b,v)=>{let[y,p]=qt(b.relativePath,b.caseSensitive,v===g.length-1);return{...b,matcher:y,compiledParams:p}})})},"flattenRoute");return e.forEach((i,u)=>{if(i.path===""||!i.path?.includes("?"))s(i,u);else for(let c of zt(i.path))s(i,u,!0,c)}),t}a(Ut,"flattenRoutes");function zt(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return o?[s,""]:[s];let i=zt(n.join("/")),u=[];return u.push(...i.map(c=>c===""?s:[s,c].join("/"))),o&&u.push(...i),u.map(c=>e.startsWith("/")&&c===""?"/":c)}a(zt,"explodeOptionalSegments");function sa(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ha(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}a(sa,"rankRouteBranches");var ia=/^:[\w-]+$/,la=3,ua=2,ca=1,da=10,fa=-2,lt=a(e=>e==="*","isSplat");function ma(e,t){let r=e.split("/"),n=r.length;return r.some(lt)&&(n+=fa),t&&(n+=ua),r.filter(o=>!lt(o)).reduce((o,s)=>o+(ia.test(s)?la:s===""?ca:da),n)}a(ma,"computeScore");function ha(e,t){return e.length===t.length&&e.slice(0,-1).every((r,n)=>r===t[n])?e[e.length-1]-t[t.length-1]:0}a(ha,"compareIndexes");function pa(e,t,r=!1){let{routesMeta:n}=e,o={},s="/",i=[];for(let u=0;u<n.length;++u){let c=n[u],d=u===n.length-1,m=s==="/"?t:t.slice(s.length)||"/",f={path:c.relativePath,caseSensitive:c.caseSensitive,end:d},g=c.matcher&&c.compiledParams?Ft(f,m,c.matcher,c.compiledParams):ke(f,m),b=c.route;if(!g&&d&&r&&!n[n.length-1].route.index&&(g=ke({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},m)),!g)return null;Object.assign(o,g.params),i.push({params:o,pathname:N([s,g.pathname]),pathnameBase:ba(N([s,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(s=N([s,g.pathnameBase]))}return i}a(pa,"matchRouteBranch");function ke(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=qt(e.path,e.caseSensitive,e.end);return Ft(e,t,r,n)}a(ke,"matchPath");function Ft(e,t,r,n){let o=t.match(r);if(!o)return null;let s=o[0],i=Z(s,1),u=o.slice(1);return{params:n.reduce((c,{paramName:d,isOptional:m},f)=>{if(d==="*"){let b=u[f]||"";i=Z(s.slice(0,s.length-b.length),1)}const g=u[f];return m&&!g?c[d]=void 0:c[d]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:i,pattern:e}}a(Ft,"matchPathImpl");function qt(e,t=!1,r=!0){M(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,i,u,c,d)=>{if(n.push({paramName:i,isOptional:u!=null}),u){let m=d.charAt(c+s.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}a(qt,"compilePath");function ga(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return M(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}a(ga,"decodePath");function F(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}a(F,"stripBasename");function ya(e,t="/"){let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?ee(e):e,s;return r?(r=Ht(r),r.startsWith("/")||r.startsWith("\\")?s=ut(r.substring(1),"/"):s=ut(r,t)):s=t,{pathname:s,search:ka(n),hash:xa(o)}}a(ya,"resolvePath");function ut(e,t){let r=Z(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}a(ut,"resolvePathname");function Pe(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}a(Pe,"getInvalidPathError");function va(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}a(va,"getPathContributingMatches");function We(e){let t=va(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}a(We,"getResolveToMatches");function Ie(e,t,r,n=!1){let o;typeof e=="string"?o=ee(e):(o={...e},C(!o.pathname||!o.pathname.includes("?"),Pe("?","pathname","search",o)),C(!o.pathname||!o.pathname.includes("#"),Pe("#","pathname","hash",o)),C(!o.search||!o.search.includes("#"),Pe("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,u;if(i==null)u=r;else{let f=t.length-1;if(!n&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),f-=1;o.pathname=g.join("/")}u=f>=0?t[f]:"/"}let c=ya(o,u),d=i&&i!=="/"&&i.endsWith("/"),m=(s||i===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||m)&&(c.pathname+="/"),c}a(Ie,"resolveTo$1");var Ht=a(e=>e.replace(/[\\/]{2,}/g,"/"),"removeDoubleSlashes"),N=a(e=>Ht(e.join("/")),"joinPaths");function Z(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}a(Z,"removeTrailingSlash");var ba=a(e=>Z(e).replace(/^\/*/,"/"),"normalizePathname"),ka=a(e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,"normalizeSearch"),xa=a(e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,"normalizeHash"),wa=class{static{a(this,"ErrorResponseImpl")}constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Wt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}a(Wt,"isRouteErrorResponse");function Sa(e){return N(e.map(t=>t.route.path).filter(Boolean))||"/"}a(Sa,"getRoutePattern");var Vt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Qt(e,t){let r=e;if(typeof r!="string"||!He.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,o=!1;if(Vt)try{let s=new URL(window.location.href),i=jt.test(r)?new URL(Zn(r,s.protocol)):new URL(r),u=F(i.pathname,t);i.origin===s.origin&&u!=null?r=u+i.search+i.hash:o=!0}catch{M(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:o,to:r}}a(Qt,"parseToInfo");var Wi=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),ct=new URL("http://localhost");function Ve(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),ct)}catch{return ct}}a(Ve,"getNavigatorCurrentUrl");function Me(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}a(Me,"isSameOrigin");function Ia(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}a(Ia,"isExplicitUrl");function Qe(e,t,r,n){let o=null;try{o=e==null?null:new URL(e,r)}catch{}let s=new URL(t,r),i=o!=null&&!Me(o,r),u=!Me(s,r);if(n==="reject"){if(i||u)throw new Error("External navigation is not allowed")}else if(u&&(o==null||!Ia(e,o)||!Me(o,s)))throw new Error("External navigation is not allowed")}a(Qe,"validateNavigationTarget");var Kt=["POST","PUT","PATCH","DELETE"],Vi=new Set(Kt),Ea=["GET",...Kt],Qi=new Set(Ea),Ra,Ca,$a,_a;Ra=new WeakMap;Ca=new WeakMap;$a=new WeakMap;_a=new WeakMap;var Da=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Aa(e){try{return Da.includes(new URL(e).protocol)}catch{return!1}}a(Aa,"hasInvalidProtocol");var te=l.createContext(null);te.displayName="DataRouter";var de=l.createContext(null);de.displayName="DataRouterState";var Jt=l.createContext(!1);function Gt(){return l.useContext(Jt)}a(Gt,"useIsRSCRouterContext");var Yt=l.createContext({isTransitioning:!1});Yt.displayName="ViewTransition";var Pa=l.createContext(new Map);Pa.displayName="Fetchers";var je=l.createContext(null);je.displayName="Await";var A=l.createContext(null);A.displayName="Navigation";var re=l.createContext(null);re.displayName="Location";var O=l.createContext({outlet:null,matches:[],isDataRoute:!1});O.displayName="Route";var Ke=l.createContext(null);Ke.displayName="RouteError";var Zt="REACT_ROUTER_ERROR",Ma="REDIRECT",La="ROUTE_ERROR_RESPONSE";function Ta(e){if(e.startsWith(`${Zt}:${Ma}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}a(Ta,"decodeRedirectErrorDigest");function Oa(e){if(e.startsWith(`${Zt}:${La}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new wa(t.status,t.statusText,t.data)}catch{}}a(Oa,"decodeRouteErrorResponseDigest");function ja(e,{relative:t}={}){C(ne(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=l.useContext(A),{hash:o,pathname:s,search:i}=fe(e,{relative:t}),u=s;return r!=="/"&&(u=s==="/"?r:N([r,s])),n.createHref({pathname:u,search:i,hash:o})}a(ja,"useHref");function ne(){return l.useContext(re)!=null}a(ne,"useInRouterContext");function L(){return C(ne(),"useLocation() may be used only in the context of a <Router> component."),l.useContext(re).location}a(L,"useLocation");function Ki(){return l.useContext(re).navigationType}a(Ki,"useNavigationType");var Xt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function er(e){l.useContext(A).static||l.useLayoutEffect(e)}a(er,"useIsomorphicLayoutEffect");function Ee(){let{isDataRoute:e}=l.useContext(O);return e?Xa():Na()}a(Ee,"useNavigate$1");function Na(){C(ne(),"useNavigate() may be used only in the context of a <Router> component.");let e=l.useContext(te),{basename:t,navigator:r}=l.useContext(A),{matches:n}=l.useContext(O),{pathname:o}=L(),s=JSON.stringify(We(n)),i=l.useRef(!1);return er(()=>{i.current=!0}),l.useCallback((u,c={})=>{if(M(i.current,Xt),!i.current)return;if(typeof u=="number"){r.go(u);return}let d=Ie(u,JSON.parse(s),o,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:N([t,d.pathname])),Qe(typeof u=="string"?u:Q(u),r.createHref(d),Ve(r),"reject"),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,s,o,e])}a(Na,"useNavigateUnstable");var Ba=l.createContext(null);function Ua(e){let t=l.useContext(O).outlet;return l.useMemo(()=>t&&l.createElement(Ba.Provider,{value:e},t),[t,e])}a(Ua,"useOutlet");function za(){let{matches:e}=l.useContext(O);return e[e.length-1]?.params??{}}a(za,"useParams");function fe(e,{relative:t}={}){let{matches:r}=l.useContext(O),{pathname:n}=L(),o=JSON.stringify(We(r));return l.useMemo(()=>Ie(e,JSON.parse(o),n,t==="path"),[e,o,n,t])}a(fe,"useResolvedPath");function Fa(e,t){return tr(e,t)}a(Fa,"useRoutes");function tr(e,t,r){C(ne(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=l.useContext(A),{matches:o}=l.useContext(O),s=o[o.length-1],i=s?s.params:{},u=s?s.pathname:"/",c=s?s.pathnameBase:"/",d=s&&s.route;{let p=d&&d.path||"";ar(u,!d||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${p}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1
|
+
var Mn=Object.defineProperty;var a=(e,t)=>Mn(e,"name",{value:t,configurable:!0});import{i as Ot}from"./rolldown-runtime-ZpX3ckPj.js";import{$i as Ln,G as V,Ga as Tn,Ja as On,Ka as jn,P as Nn,Qi as h,St as ce,Vi as Bn,Zi as Un,a as zn,c as Fn,ea as qn,fa as Hn,ht as Wn,l as Vn,n as k,pt as Qn,r as Kn,t as Jn,u as Gn}from"./boxes-D_jBxmFh.js";import{t as Yn}from"./preload-helper-CceJXRIF.js";var l=Ot(On(),1),He=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,jt=/^[\\/]{2}/;function Zn(e,t){return t+e.replace(/\\/g,"/")}a(Zn,"normalizeProtocolRelativeUrl");var ot="popstate";function st(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}a(st,"isLocation");function Xn(e={}){function t(n,o){let s=o.state?.masked,{pathname:i,search:u,hash:c}=s||n.location;return Oe("",{pathname:i,search:u,hash:c},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}a(t,"createBrowserLocation");function r(n,o){return typeof o=="string"?o:Q(o)}return a(r,"createBrowserHref"),ta(t,r,null,e)}a(Xn,"createBrowserHistory");function C(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}a(C,"invariant");function M(e,t){if(!e)try{throw new Error(t)}catch{}}a(M,"warning");function ea(){return Math.random().toString(36).substring(2,10)}a(ea,"createKey");function it(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}a(it,"getHistoryState");function Oe(e,t,r=null,n,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ee(t):t,state:r,key:t&&t.key||n||ea(),mask:o}}a(Oe,"createLocation");function Q({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}a(Q,"createPath");function ee(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}a(ee,"parsePath");function ta(e,t,r,n={}){let{window:o=document.defaultView,v5Compat:s=!1}=n,i=o.history,u="POP",c=null,d=m();d==null&&(d=0,i.replaceState({...i.state,idx:d},""));function m(){return(i.state||{idx:null}).idx}a(m,"getIndex");function f(){u="POP";let p=m(),x=p==null?null:p-d;d=p,c&&c({action:u,location:y.location,delta:x})}a(f,"handlePop");function g(p,x){u="PUSH";let w=st(p)?p:Oe(y.location,p,x);r&&r(w,p),d=m()+1;let S=it(w,d),$=y.createHref(w.mask||w);try{i.pushState(S,"",$)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;o.location.assign($)}s&&c&&c({action:u,location:y.location,delta:1})}a(g,"push");function b(p,x){u="REPLACE";let w=st(p)?p:Oe(y.location,p,x);r&&r(w,p),d=m();let S=it(w,d),$=y.createHref(w.mask||w);i.replaceState(S,"",$),s&&c&&c({action:u,location:y.location,delta:0})}a(b,"replace2");function v(p){return ra(o,p)}a(v,"createURL");let y={get action(){return u},get location(){return e(o,i)},listen(p){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(ot,f),c=p,()=>{o.removeEventListener(ot,f),c=null}},createHref(p){return t(o,p)},createURL:v,encodeLocation(p){let x=v(p);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:g,replace:b,go(p){return i.go(p)}};return y}a(ta,"getUrlBasedHistory");function ra(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),C(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Q(t);return o=o.replace(/ $/,"%20"),!r&&jt.test(o)&&(o=n+o),new URL(o,n)}a(ra,"createBrowserURLImpl");var na;na=new WeakMap;function Nt(e,t,r="/"){return Bt(e,t,r,!1)}a(Nt,"matchRoutes");function Bt(e,t,r,n,o){let s=F((typeof t=="string"?ee(t):t).pathname||"/",r);if(s==null)return null;let i=o??oa(e),u=null,c=ga(s);for(let d=0;u==null&&d<i.length;++d)u=pa(i[d],c,n);return u}a(Bt,"matchRoutesImpl");function aa(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],loaderData:t[r.id],handle:r.handle}}a(aa,"convertRouteMatchToUiMatch");function oa(e){let t=Ut(e);return sa(t),t}a(oa,"flattenAndRankRoutes");function Ut(e,t=[],r=[],n="",o=!1){let s=a((i,u,c=o,d)=>{let m={relativePath:d===void 0?i.path||"":d,caseSensitive:i.caseSensitive===!0,childrenIndex:u,route:i};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(n)&&c)return;C(m.relativePath.startsWith(n),`Absolute route path "${m.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(n.length)}let f=N([n,m.relativePath]),g=r.concat(m);i.children&&i.children.length>0&&(C(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Ut(i.children,t,g,f,c)),!(i.path==null&&!i.index)&&t.push({path:f,score:ma(f,i.index),routesMeta:g.map((b,v)=>{let[y,p]=qt(b.relativePath,b.caseSensitive,v===g.length-1);return{...b,matcher:y,compiledParams:p}})})},"flattenRoute");return e.forEach((i,u)=>{if(i.path===""||!i.path?.includes("?"))s(i,u);else for(let c of zt(i.path))s(i,u,!0,c)}),t}a(Ut,"flattenRoutes");function zt(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return o?[s,""]:[s];let i=zt(n.join("/")),u=[];return u.push(...i.map(c=>c===""?s:[s,c].join("/"))),o&&u.push(...i),u.map(c=>e.startsWith("/")&&c===""?"/":c)}a(zt,"explodeOptionalSegments");function sa(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ha(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}a(sa,"rankRouteBranches");var ia=/^:[\w-]+$/,la=3,ua=2,ca=1,da=10,fa=-2,lt=a(e=>e==="*","isSplat");function ma(e,t){let r=e.split("/"),n=r.length;return r.some(lt)&&(n+=fa),t&&(n+=ua),r.filter(o=>!lt(o)).reduce((o,s)=>o+(ia.test(s)?la:s===""?ca:da),n)}a(ma,"computeScore");function ha(e,t){return e.length===t.length&&e.slice(0,-1).every((r,n)=>r===t[n])?e[e.length-1]-t[t.length-1]:0}a(ha,"compareIndexes");function pa(e,t,r=!1){let{routesMeta:n}=e,o={},s="/",i=[];for(let u=0;u<n.length;++u){let c=n[u],d=u===n.length-1,m=s==="/"?t:t.slice(s.length)||"/",f={path:c.relativePath,caseSensitive:c.caseSensitive,end:d},g=c.matcher&&c.compiledParams?Ft(f,m,c.matcher,c.compiledParams):ke(f,m),b=c.route;if(!g&&d&&r&&!n[n.length-1].route.index&&(g=ke({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},m)),!g)return null;Object.assign(o,g.params),i.push({params:o,pathname:N([s,g.pathname]),pathnameBase:ba(N([s,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(s=N([s,g.pathnameBase]))}return i}a(pa,"matchRouteBranch");function ke(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=qt(e.path,e.caseSensitive,e.end);return Ft(e,t,r,n)}a(ke,"matchPath");function Ft(e,t,r,n){let o=t.match(r);if(!o)return null;let s=o[0],i=Z(s,1),u=o.slice(1);return{params:n.reduce((c,{paramName:d,isOptional:m},f)=>{if(d==="*"){let b=u[f]||"";i=Z(s.slice(0,s.length-b.length),1)}const g=u[f];return m&&!g?c[d]=void 0:c[d]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:i,pattern:e}}a(Ft,"matchPathImpl");function qt(e,t=!1,r=!0){M(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,i,u,c,d)=>{if(n.push({paramName:i,isOptional:u!=null}),u){let m=d.charAt(c+s.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}a(qt,"compilePath");function ga(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return M(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}a(ga,"decodePath");function F(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}a(F,"stripBasename");function ya(e,t="/"){let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?ee(e):e,s;return r?(r=Ht(r),r.startsWith("/")||r.startsWith("\\")?s=ut(r.substring(1),"/"):s=ut(r,t)):s=t,{pathname:s,search:ka(n),hash:xa(o)}}a(ya,"resolvePath");function ut(e,t){let r=Z(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}a(ut,"resolvePathname");function Pe(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}a(Pe,"getInvalidPathError");function va(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}a(va,"getPathContributingMatches");function We(e){let t=va(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}a(We,"getResolveToMatches");function Ie(e,t,r,n=!1){let o;typeof e=="string"?o=ee(e):(o={...e},C(!o.pathname||!o.pathname.includes("?"),Pe("?","pathname","search",o)),C(!o.pathname||!o.pathname.includes("#"),Pe("#","pathname","hash",o)),C(!o.search||!o.search.includes("#"),Pe("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,u;if(i==null)u=r;else{let f=t.length-1;if(!n&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),f-=1;o.pathname=g.join("/")}u=f>=0?t[f]:"/"}let c=ya(o,u),d=i&&i!=="/"&&i.endsWith("/"),m=(s||i===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||m)&&(c.pathname+="/"),c}a(Ie,"resolveTo$1");var Ht=a(e=>e.replace(/[\\/]{2,}/g,"/"),"removeDoubleSlashes"),N=a(e=>Ht(e.join("/")),"joinPaths");function Z(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}a(Z,"removeTrailingSlash");var ba=a(e=>Z(e).replace(/^\/*/,"/"),"normalizePathname"),ka=a(e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,"normalizeSearch"),xa=a(e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,"normalizeHash"),wa=class{static{a(this,"ErrorResponseImpl")}constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Wt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}a(Wt,"isRouteErrorResponse");function Sa(e){return N(e.map(t=>t.route.path).filter(Boolean))||"/"}a(Sa,"getRoutePattern");var Vt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Qt(e,t){let r=e;if(typeof r!="string"||!He.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,o=!1;if(Vt)try{let s=new URL(window.location.href),i=jt.test(r)?new URL(Zn(r,s.protocol)):new URL(r),u=F(i.pathname,t);i.origin===s.origin&&u!=null?r=u+i.search+i.hash:o=!0}catch{M(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:o,to:r}}a(Qt,"parseToInfo");var Wi=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),ct=new URL("http://localhost");function Ve(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),ct)}catch{return ct}}a(Ve,"getNavigatorCurrentUrl");function Me(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}a(Me,"isSameOrigin");function Ia(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}a(Ia,"isExplicitUrl");function Qe(e,t,r,n){let o=null;try{o=e==null?null:new URL(e,r)}catch{}let s=new URL(t,r),i=o!=null&&!Me(o,r),u=!Me(s,r);if(n==="reject"){if(i||u)throw new Error("External navigation is not allowed")}else if(u&&(o==null||!Ia(e,o)||!Me(o,s)))throw new Error("External navigation is not allowed")}a(Qe,"validateNavigationTarget");var Kt=["POST","PUT","PATCH","DELETE"],Vi=new Set(Kt),Ea=["GET",...Kt],Qi=new Set(Ea),Ra,Ca,$a,_a;Ra=new WeakMap;Ca=new WeakMap;$a=new WeakMap;_a=new WeakMap;var Da=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Aa(e){try{return Da.includes(new URL(e).protocol)}catch{return!1}}a(Aa,"hasInvalidProtocol");var te=l.createContext(null);te.displayName="DataRouter";var de=l.createContext(null);de.displayName="DataRouterState";var Jt=l.createContext(!1);function Gt(){return l.useContext(Jt)}a(Gt,"useIsRSCRouterContext");var Yt=l.createContext({isTransitioning:!1});Yt.displayName="ViewTransition";var Pa=l.createContext(new Map);Pa.displayName="Fetchers";var je=l.createContext(null);je.displayName="Await";var A=l.createContext(null);A.displayName="Navigation";var re=l.createContext(null);re.displayName="Location";var O=l.createContext({outlet:null,matches:[],isDataRoute:!1});O.displayName="Route";var Ke=l.createContext(null);Ke.displayName="RouteError";var Zt="REACT_ROUTER_ERROR",Ma="REDIRECT",La="ROUTE_ERROR_RESPONSE";function Ta(e){if(e.startsWith(`${Zt}:${Ma}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}a(Ta,"decodeRedirectErrorDigest");function Oa(e){if(e.startsWith(`${Zt}:${La}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new wa(t.status,t.statusText,t.data)}catch{}}a(Oa,"decodeRouteErrorResponseDigest");function ja(e,{relative:t}={}){C(ne(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=l.useContext(A),{hash:o,pathname:s,search:i}=fe(e,{relative:t}),u=s;return r!=="/"&&(u=s==="/"?r:N([r,s])),n.createHref({pathname:u,search:i,hash:o})}a(ja,"useHref");function ne(){return l.useContext(re)!=null}a(ne,"useInRouterContext");function L(){return C(ne(),"useLocation() may be used only in the context of a <Router> component."),l.useContext(re).location}a(L,"useLocation");function Ki(){return l.useContext(re).navigationType}a(Ki,"useNavigationType");var Xt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function er(e){l.useContext(A).static||l.useLayoutEffect(e)}a(er,"useIsomorphicLayoutEffect");function Ee(){let{isDataRoute:e}=l.useContext(O);return e?Xa():Na()}a(Ee,"useNavigate$1");function Na(){C(ne(),"useNavigate() may be used only in the context of a <Router> component.");let e=l.useContext(te),{basename:t,navigator:r}=l.useContext(A),{matches:n}=l.useContext(O),{pathname:o}=L(),s=JSON.stringify(We(n)),i=l.useRef(!1);return er(()=>{i.current=!0}),l.useCallback((u,c={})=>{if(M(i.current,Xt),!i.current)return;if(typeof u=="number"){r.go(u);return}let d=Ie(u,JSON.parse(s),o,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:N([t,d.pathname])),Qe(typeof u=="string"?u:Q(u),r.createHref(d),Ve(r),"reject"),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,s,o,e])}a(Na,"useNavigateUnstable");var Ba=l.createContext(null);function Ua(e){let t=l.useContext(O).outlet;return l.useMemo(()=>t&&l.createElement(Ba.Provider,{value:e},t),[t,e])}a(Ua,"useOutlet");function za(){let{matches:e}=l.useContext(O);return e[e.length-1]?.params??{}}a(za,"useParams");function fe(e,{relative:t}={}){let{matches:r}=l.useContext(O),{pathname:n}=L(),o=JSON.stringify(We(r));return l.useMemo(()=>Ie(e,JSON.parse(o),n,t==="path"),[e,o,n,t])}a(fe,"useResolvedPath");function Fa(e,t){return tr(e,t)}a(Fa,"useRoutes");function tr(e,t,r){C(ne(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=l.useContext(A),{matches:o}=l.useContext(O),s=o[o.length-1],i=s?s.params:{},u=s?s.pathname:"/",c=s?s.pathnameBase:"/",d=s&&s.route;{let p=d&&d.path||"";ar(u,!d||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${p}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
2
|
|
|
3
3
|
Please change the parent <Route path="${p}"> to <Route path="${p==="/"?"*":`${p}/*`}">.`)}let m=L(),f;if(t){let p=typeof t=="string"?ee(t):t;C(c==="/"||p.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${p.pathname}" was given in the \`location\` prop.`),f=p}else f=m;let g=f.pathname||"/",b=g;if(c!=="/"){let p=c.replace(/^\//,"").split("/");b="/"+g.replace(/^\//,"").split("/").slice(p.length).join("/")}let v=r&&r.state.matches.length?r.state.matches.map(p=>Object.assign(p,{route:r.manifest[p.route.id]||p.route})):Nt(e,{pathname:b});M(d||v!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),M(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=Qa(v&&v.map(p=>Object.assign({},p,{params:Object.assign({},i,p.params),pathname:N([c,n.encodeLocation?n.encodeLocation(p.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?c:N([c,n.encodeLocation?n.encodeLocation(p.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),o,r);return t&&y?l.createElement(re.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},y):y}a(tr,"useRoutesImpl");function qa(){let e=Za(),t=Wt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n},s={padding:"2px 4px",backgroundColor:n},i=null;return i=l.createElement(l.Fragment,null,l.createElement("p",null,"💿 Hey developer 👋"),l.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",l.createElement("code",{style:s},"ErrorBoundary")," or"," ",l.createElement("code",{style:s},"errorElement")," prop on your route.")),l.createElement(l.Fragment,null,l.createElement("h2",null,"Unexpected Application Error!"),l.createElement("h3",{style:{fontStyle:"italic"}},t),r?l.createElement("pre",{style:o},r):null,i)}a(qa,"DefaultErrorComponent");var Ha=l.createElement(qa,null),rr=class extends l.Component{static{a(this,"RenderErrorBoundary")}constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError&&this.props.onError(e,t)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=Oa(e.digest);r&&(e=r)}let t=e!==void 0?l.createElement(O.Provider,{value:this.props.routeContext},l.createElement(Ke.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?l.createElement(Wa,{error:e},t):t}};rr.contextType=Jt;var Le=new WeakMap;function Wa({children:e,error:t}){let{basename:r,navigator:n}=l.useContext(A);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=Ta(t.digest);if(o){let s=Le.get(t);if(s)throw s;let i=Qt(o.location,r),u=i.absoluteURL||i.to;if(Qe(o.location,u,Ve(n),"allow-explicit"),Aa(u))throw new Error("Invalid redirect location");if(Vt&&!Le.get(t))if(i.isExternal||o.reloadDocument)window.location.href=u;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:o.replace}));throw Le.set(t,c),c}return l.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return e}a(Wa,"RSCErrorHandler");function Va({routeContext:e,match:t,children:r}){let n=l.useContext(te);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),l.createElement(O.Provider,{value:e},r)}a(Va,"RenderedRoute");function Qa(e,t=[],r){let n=r?.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,s=n?.errors;if(s!=null){let m=o.findIndex(f=>f.route.id&&s?.[f.route.id]!==void 0);C(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let i=!1,u=-1;if(r&&n){i=n.renderFallback;for(let m=0;m<o.length;m++){let f=o[m];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=m),f.route.id){let{loaderData:g,errors:b}=n,v=f.route.loader&&!g.hasOwnProperty(f.route.id)&&(!b||b[f.route.id]===void 0);if(f.route.lazy||v){r.isStatic&&(i=!0),u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}}let c=r?.onError,d=n&&c?(m,f)=>{c(m,{location:n.location,params:n.matches?.[0]?.params??{},pattern:Sa(n.matches),errorInfo:f})}:void 0;return o.reduceRight((m,f,g)=>{let b,v=!1,y=null,p=null;n&&(b=s&&f.route.id?s[f.route.id]:void 0,y=f.route.errorElement||Ha,i&&(u<0&&g===0?(ar("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,p=null):u===g&&(v=!0,p=f.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,g+1)),w=a(()=>{let S;return b?S=y:v?S=p:f.route.Component?S=l.createElement(f.route.Component,null):f.route.element?S=f.route.element:S=m,l.createElement(Va,{match:f,routeContext:{outlet:m,matches:x,isDataRoute:n!=null},children:S})},"getChildren");return n&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?l.createElement(rr,{location:n.location,revalidation:n.revalidation,component:y,error:b,children:w(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:d}):w()},null)}a(Qa,"_renderMatches");function Je(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}a(Je,"getDataRouterConsoleError");function Ka(e){let t=l.useContext(te);return C(t,Je(e)),t}a(Ka,"useDataRouterContext");function Ge(e){let t=l.useContext(de);return C(t,Je(e)),t}a(Ge,"useDataRouterState");function Ja(e){let t=l.useContext(O);return C(t,Je(e)),t}a(Ja,"useRouteContext");function Ye(e){let t=Ja(e),r=t.matches[t.matches.length-1];return C(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}a(Ye,"useCurrentRouteId");function Ga(){return Ye("useRouteId")}a(Ga,"useRouteId");function Ya(){let e=Ge("useNavigation");return l.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}a(Ya,"useNavigation");function nr(){let{matches:e,loaderData:t}=Ge("useMatches");return l.useMemo(()=>e.map(r=>aa(r,t)),[e,t])}a(nr,"useMatches");function Za(){let e=l.useContext(Ke),t=Ge("useRouteError"),r=Ye("useRouteError");return e!==void 0?e:t.errors?.[r]}a(Za,"useRouteError");function Xa(){let{router:e}=Ka("useNavigate"),t=Ye("useNavigate"),r=l.useRef(!1);return er(()=>{r.current=!0}),l.useCallback(async(n,o={})=>{M(r.current,Xt),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}a(Xa,"useNavigateStable");var dt={};function ar(e,t,r){!t&&!dt[e]&&(dt[e]=!0,M(!1,r))}a(ar,"warningOnce");var ft={};function eo(e,t){!e&&!ft[t]&&(ft[t]=!0)}a(eo,"warnOnce");var Ji=l.memo(to);function to({routes:e,manifest:t,future:r,state:n,isStatic:o,onError:s}){return tr(e,void 0,{manifest:t,state:n,isStatic:o,onError:s,future:r})}a(to,"DataRoutes2");function ro({to:e,replace:t,state:r,relative:n}){C(ne(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:s}=l.useContext(A);M(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=l.useContext(O),{pathname:u}=L(),c=Ee(),d=Ie(e,We(i),u,n==="path");Qe(typeof e=="string"?e:Q(e),s.createHref(d),Ve(s),"reject");let m=JSON.stringify(d);return l.useEffect(()=>{c(JSON.parse(m),{replace:t,state:r,relative:n})},[c,m,n,t,r]),null}a(ro,"Navigate$1");function Gi(e){return Ua(e.context)}a(Gi,"Outlet");function no(e){C(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}a(no,"Route");function or({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:s=!1,useTransitions:i}){C(!ne(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),c=l.useMemo(()=>({basename:u,navigator:o,static:s,useTransitions:i,future:{}}),[u,o,s,i]);typeof r=="string"&&(r=ee(r));let{pathname:d="/",search:m="",hash:f="",state:g=null,key:b="default",mask:v}=r,y=l.useMemo(()=>{let p=F(d,u);return p==null?null:{location:{pathname:p,search:m,hash:f,state:g,key:b,mask:v},navigationType:n}},[u,d,m,f,g,b,n,v]);return M(y!=null,`<Router basename="${u}"> is not able to match the URL "${d}${m}${f}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:l.createElement(A.Provider,{value:c},l.createElement(re.Provider,{children:t,value:y}))}a(or,"Router");function Yi({children:e,location:t}){return Fa(Ne(e),t)}a(Yi,"Routes");var Zi=class extends l.Component{static{a(this,"AwaitErrorBoundary")}constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError&&this.props.onError(e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,o=0;if(!(r instanceof Promise))o=1,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:a(()=>!0,"get")}),Object.defineProperty(n,"_data",{get:a(()=>r,"get")});else if(this.state.error){o=2;let s=this.state.error;n=Promise.reject().catch(()=>{}),Object.defineProperty(n,"_tracked",{get:a(()=>!0,"get")}),Object.defineProperty(n,"_error",{get:a(()=>s,"get")})}else r._tracked?(n=r,o="_error"in n?2:"_data"in n?1:0):(o=0,Object.defineProperty(r,"_tracked",{get:a(()=>!0,"get")}),n=r.then(s=>Object.defineProperty(r,"_data",{get:a(()=>s,"get")}),s=>{this.props.onError?.(s),Object.defineProperty(r,"_error",{get:a(()=>s,"get")})}));if(o===2&&!t)throw n._error;if(o===2)return l.createElement(je.Provider,{value:n,children:t});if(o===1)return l.createElement(je.Provider,{value:n,children:e});throw n}};function Ne(e,t=[]){let r=[];return l.Children.forEach(e,(n,o)=>{if(!l.isValidElement(n))return;let s=[...t,o];if(n.type===l.Fragment){r.push.apply(r,Ne(n.props.children,s));return}C(n.type===no,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),C(!n.props.index||!n.props.children,"An index route cannot have child routes.");let i={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(i.children=Ne(n.props.children,s)),r.push(i)}),r}a(Ne,"createRoutesFromChildren");var ve="get",be="application/x-www-form-urlencoded";function Re(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}a(Re,"isHtmlElement");function ao(e){return Re(e)&&e.tagName.toLowerCase()==="button"}a(ao,"isButtonElement");function oo(e){return Re(e)&&e.tagName.toLowerCase()==="form"}a(oo,"isFormElement");function so(e){return Re(e)&&e.tagName.toLowerCase()==="input"}a(so,"isInputElement");function io(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}a(io,"isModifiedEvent");function lo(e,t){return e.button===0&&(!t||t==="_self")&&!io(e)}a(lo,"shouldProcessLinkClick");function Be(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}a(Be,"createSearchParams");function uo(e,t){let r=Be(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(s=>{r.append(o,s)})}),r}a(uo,"getSearchParamsForLocation");var pe=null;function co(){if(pe===null)try{new FormData(document.createElement("form"),0),pe=!1}catch{pe=!0}return pe}a(co,"isFormDataSubmitterSupported");var fo=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Te(e){return e!=null&&!fo.has(e)?(M(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${be}"`),null):e}a(Te,"getFormEncType");function mo(e,t){let r,n,o,s,i;if(oo(e)){let u=e.getAttribute("action");n=u?F(u,t):null,r=e.getAttribute("method")||ve,o=Te(e.getAttribute("enctype"))||be,s=new FormData(e)}else if(ao(e)||so(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||u.getAttribute("action");if(n=c?F(c,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||ve,o=Te(e.getAttribute("formenctype"))||Te(u.getAttribute("enctype"))||be,s=new FormData(u,e),!co()){let{name:d,type:m,value:f}=e;if(m==="image"){let g=d?`${d}.`:"";s.append(`${g}x`,"0"),s.append(`${g}y`,"0")}else d&&s.append(d,f)}}else{if(Re(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ve,n=null,o=be,i=e}return s&&o==="text/plain"&&(i=s,s=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:s,body:i}}a(mo,"getFormSubmissionInfo");var Xi=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),ho={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},po=/[&><\u2028\u2029]/g;function mt(e){return e.replace(po,t=>ho[t])}a(mt,"escapeHtml");function Ce(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}a(Ce,"invariant2");function sr(e,t,r,n){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${n}`:o.pathname=`${o.pathname}.${n}`:o.pathname==="/"?o.pathname=`_root.${n}`:t&&F(o.pathname,t)==="/"?o.pathname=`${Z(t)}/_root.${n}`:o.pathname=`${Z(o.pathname)}.${n}`,o}a(sr,"singleFetchUrl");async function go(e,t){if(e.id in t)return t[e.id];try{let r=await Yn(()=>import(e.module),[]);return t[e.id]=r,r}catch{return window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}a(go,"loadRouteModule");function yo(e){return e!=null&&typeof e.page=="string"}a(yo,"isPageLinkDescriptor");function vo(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}a(vo,"isHtmlLinkDescriptor");async function bo(e,t,r){return wo((await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let s=await go(o,r);return s.links?s.links():[]}return[]}))).flat(1).filter(vo).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}a(bo,"getKeyedPrefetchLinks");function ht(e,t,r,n,o,s){let i=a((c,d)=>r[d]?c.route.id!==r[d].route.id:!0,"isNew"),u=a((c,d)=>r[d].pathname!==c.pathname||r[d].route.path?.endsWith("*")&&r[d].params["*"]!==c.params["*"],"matchPathChanged");return s==="assets"?t.filter((c,d)=>i(c,d)||u(c,d)):s==="data"?t.filter((c,d)=>{let m=n.routes[c.route.id];if(!m||!m.hasLoader)return!1;if(i(c,d)||u(c,d))return!0;if(c.route.shouldRevalidate){let f=c.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}a(ht,"getNewMatchesForLinks");function ir(e,t,{includeHydrateFallback:r}={}){return ko(e.map(n=>{let o=t.routes[n.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}a(ir,"getModuleLinkHrefs");function ko(e){return[...new Set(e)]}a(ko,"dedupeHrefs");function xo(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}a(xo,"sortKeys");function wo(e,t){let r=new Set,n=new Set(t);return e.reduce((o,s)=>{if(t&&!yo(s)&&s.as==="script"&&s.href&&n.has(s.href))return o;let i=JSON.stringify(xo(s));return r.has(i)||(r.add(i),o.push({key:i,link:s})),o},[])}a(wo,"dedupeLinkDescriptors");function So(e,t){return e.mode==="lazy"&&t===!0}a(So,"isFogOfWarEnabled");function Io({sri:e,...t},r){let n=new Set(r.state.matches.map(u=>u.route.id)),o=r.state.location.pathname.split("/").filter(Boolean),s=["/"];for(o.pop();o.length>0;)s.push(`/${o.join("/")}`),o.pop();s.forEach(u=>{let c=Bt(r.routes,u,r.basename||"/",!1,r.branches);c&&c.forEach(d=>n.add(d.route.id))});let i=[...n].reduce((u,c)=>Object.assign(u,{[c]:t.routes[c]}),{});return{...t,routes:i,sri:e?!0:void 0}}a(Io,"getPartialManifest");function $e(){let e=l.useContext(te);return Ce(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}a($e,"useDataRouterContext2");function lr(){let e=l.useContext(de);return Ce(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}a(lr,"useDataRouterStateContext");var _e=l.createContext(void 0);_e.displayName="FrameworkContext";function K(){let e=l.useContext(_e);return Ce(e,"You must render this element inside a <HydratedRouter> element"),e}a(K,"useFrameworkContext");function Eo(e,t){let r=l.useContext(_e),[n,o]=l.useState(!1),[s,i]=l.useState(!1),{onFocus:u,onBlur:c,onMouseEnter:d,onMouseLeave:m,onTouchStart:f}=t,g=l.useRef(null);l.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let y=a(x=>{x.forEach(w=>{i(w.isIntersecting)})},"callback"),p=new IntersectionObserver(y,{threshold:.5});return g.current&&p.observe(g.current),()=>{p.disconnect()}}},[e]),l.useEffect(()=>{if(n){let y=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(y)}}},[n]);let b=a(()=>{o(!0)},"setIntent"),v=a(()=>{o(!1),i(!1)},"cancelIntent");return r?e!=="intent"?[s,g,{}]:[s,g,{onFocus:se(u,b),onBlur:se(c,v),onMouseEnter:se(d,b),onMouseLeave:se(m,v),onTouchStart:se(f,b)}]:[!1,g,{}]}a(Eo,"usePrefetchBehavior");function se(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}a(se,"composeEventHandlers");function Ro(e,t,r){if(r&&!xe)return[e[0]];if(t){let n=e.findIndex(o=>t[o.route.id]!==void 0);return e.slice(0,n+1)}return e}a(Ro,"getActiveMatches");function Co({page:e,...t}){let r=Gt(),{nonce:n}=K(),{router:o}=$e(),s=l.useMemo(()=>Nt(o.routes,e,o.basename),[o.routes,e,o.basename]);return s?(t.nonce==null&&n&&(t={...t,nonce:n}),r?l.createElement(_o,{page:e,matches:s,...t}):l.createElement(Do,{page:e,matches:s,...t})):null}a(Co,"PrefetchPageLinks");function $o(e){let{manifest:t,routeModules:r}=K(),[n,o]=l.useState([]);return l.useEffect(()=>{let s=!1;return bo(e,t,r).then(i=>{s||o(i)}),()=>{s=!0}},[e,t,r]),n}a($o,"useKeyedPrefetchLinks");function _o({page:e,matches:t,...r}){let n=L(),{future:o}=K(),{basename:s}=$e(),i=l.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let u=sr(e,s,o.v8_trailingSlashAwareDataRequests,"rsc"),c=!1,d=[];for(let m of t)typeof m.route.shouldRevalidate=="function"?c=!0:d.push(m.route.id);return c&&d.length>0&&u.searchParams.set("_routes",d.join(",")),[u.pathname+u.search]},[s,o.v8_trailingSlashAwareDataRequests,e,n,t]);return l.createElement(l.Fragment,null,i.map(u=>l.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...r})))}a(_o,"RSCPrefetchPageLinksImpl");function Do({page:e,matches:t,...r}){let n=L(),{future:o,manifest:s,routeModules:i}=K(),{basename:u}=$e(),{loaderData:c,matches:d}=lr(),m=l.useMemo(()=>ht(e,t,d,s,n,"data"),[e,t,d,s,n]),f=l.useMemo(()=>ht(e,t,d,s,n,"assets"),[e,t,d,s,n]),g=l.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let y=new Set,p=!1;if(t.forEach(w=>{let S=s.routes[w.route.id];!S||!S.hasLoader||(!m.some($=>$.route.id===w.route.id)&&w.route.id in c&&i[w.route.id]?.shouldRevalidate||S.hasClientLoader?p=!0:y.add(w.route.id))}),y.size===0)return[];let x=sr(e,u,o.v8_trailingSlashAwareDataRequests,"data");return p&&y.size>0&&x.searchParams.set("_routes",t.filter(w=>y.has(w.route.id)).map(w=>w.route.id).join(",")),[x.pathname+x.search]},[u,o.v8_trailingSlashAwareDataRequests,c,n,s,m,t,e,i]),b=l.useMemo(()=>ir(f,s),[f,s]),v=$o(f);return l.createElement(l.Fragment,null,g.map(y=>l.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...r})),b.map(y=>l.createElement("link",{key:y,rel:"modulepreload",href:y,...r})),v.map(({key:y,link:p})=>l.createElement("link",{key:y,nonce:r.nonce,...p,crossOrigin:p.crossOrigin??r.crossOrigin})))}a(Do,"PrefetchPageLinksImpl");var xe=!1;function Ao(){xe=!0}a(Ao,"setIsHydrated");function Po(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:o,routeDiscovery:s,ssr:i,nonce:u}=K(),{router:c,static:d,staticContext:m}=$e(),{matches:f}=lr(),g=Gt(),b=So(s,i);e.nonce==null&&u&&(e={...e,nonce:u}),o&&(o.didRenderScripts=!0);let v=Ro(f,null,n);l.useEffect(()=>{Ao()},[]);let y=l.useMemo(()=>{if(g)return null;let w=m?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",S=d?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${b?"":`import ${JSON.stringify(t.url)}`};
|
|
4
4
|
${v.map(($,E)=>{let _=`route${E}`,P=t.routes[$.route.id];Ce(P,`Route ${$.route.id} not found in manifest`);let{clientActionModule:j,clientLoaderModule:D,clientMiddlewareModule:B,hydrateFallbackModule:J,module:T}=P,q=[...j?[{module:j,varName:`${_}_clientAction`}]:[],...D?[{module:D,varName:`${_}_clientLoader`}]:[],...B?[{module:B,varName:`${_}_clientMiddleware`}]:[],...J?[{module:J,varName:`${_}_HydrateFallback`}]:[],{module:T,varName:`${_}_main`}];return q.length===1?`import * as ${_} from ${JSON.stringify(T)};`:[q.map(U=>`import * as ${U.varName} from "${U.module}";`).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var xe=Object.defineProperty;var r=(t,a)=>xe(t,"name",{value:a,configurable:!0});import{i as ne}from"./rolldown-runtime-ZpX3ckPj.js";import{G as pe,Ja as he,Ka as ge,St as Z,Zi as W,fa as X,ht as fe,ut as ye}from"./boxes-ge7fUaKz.js";import{Bn as ve,n as je,o as re,r as T}from"./BreadcrumbContext-Dk7w7UfX.js";import{r as ee,t as be}from"./AgentAvatar-CznfLCi0.js";import{i as te,r as Ne,t as we}from"./tabs-B78VQmVJ.js";import{a as y,c as R,l as _,n as F,r as B}from"./select-CZGZxSBZ.js";import{a as Ae}from"./ToastContext-Dnp-VBke.js";import{t as Te}from"./agents-Ctc0TQeI.js";import{t as se}from"./input-BSRWlgGq.js";import{t as Se}from"./access-CHF92G8Y.js";import{r as Ce}from"./company-members-Duugb3uG.js";import{r as v,t as j}from"./card-C9f4MgJN.js";import{t as Ee}from"./EmptyState-uVSuq85X.js";import{C as ae,En as Ie,It as Ue,Mn as Pe,dn as De,hn as Le,mn as Re}from"./index-fiYETCbm.js";var l=ne(he(),1),e=ne(ge(),1),_e=50,n="__all",Fe=[{value:n,label:"All actions"},{value:"issue.",label:"Tasks"},{value:"agent.",label:"Agents"},{value:"heartbeat.",label:"Runs"},{value:"approval.",label:"Approvals"},{value:"project.",label:"Projects"},{value:"goal.",label:"Goals"},{value:"tool_gateway.",label:"Tools"},{value:"cost.",label:"Costs"},{value:"company.",label:"Company"}],Be=[{value:n,label:"All entities"},{value:"issue",label:"Task"},{value:"agent",label:"Agent"},{value:"project",label:"Project"},{value:"goal",label:"Goal"},{value:"company",label:"Company"}];function ke(t){if(!t)return;const a=new Date(`${t}T00:00:00.000Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(ke,"toStartIso");function Ve(t){if(!t)return;const a=new Date(`${t}T23:59:59.999Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(Ve,"toEndIso");function $e({record:t,agentMap:a,userProfileMap:d}){const u=t.agentId??(t.actorType==="agent"?t.actorId:null),c=u?a.get(u):null;if(c)return(0,e.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1.5",title:c.name,children:[(0,e.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,e.jsx)(be,{agent:c,size:16,className:"h-3 w-3"})}),(0,e.jsx)("span",{className:"truncate font-medium text-foreground",children:c.name})]});if(t.actorType==="user"&&t.actorId){const m=d.get(t.actorId);return(0,e.jsx)(ee,{name:m?.label??"User",avatarUrl:m?.image??null,size:"sm",className:"font-medium text-foreground"})}const h=t.actorType==="plugin"?"Plugin":t.actorType==="agent"?"Agent":t.actorType==="user"?"User":"System";return(0,e.jsx)(ee,{name:h,size:"sm",className:"font-medium text-foreground"})}r($e,"AuditActor");function qe({record:t}){const{issue:a,document:d}=t.entity,u=a?.identifier??a?.id??null;return u?(0,e.jsx)(re,{to:`/issues/${u}`,className:"font-medium text-primary hover:underline",children:a?.identifier?`${a.identifier}${a.title?` · ${a.title}`:""}`:"the task"}):d?(0,e.jsx)("span",{className:"font-medium text-foreground",children:d.key}):(0,e.jsx)("span",{className:"text-muted-foreground",children:t.entityType})}r(qe,"AuditEntityNode");function Me({record:t,agentMap:a,userProfileMap:d}){const u=Ue(t.action,t.details,{agentMap:a,userProfileMap:d}),c=t.responsibleUserId?d.get(t.responsibleUserId):null,h=!!(t.responsibleUserId&&!(t.actorType==="user"&&t.actorId===t.responsibleUserId)),m=c?.label??(t.responsibleUserId?"a user":null),g=t.entity.comment?.excerpt?.trim(),x=t.entity.issue&&t.entity.document?t.entity.document.key:null;return(0,e.jsx)("li",{className:"px-4 py-3 text-sm",children:(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1 text-foreground",children:[(0,e.jsx)($e,{record:t,agentMap:a,userProfileMap:d}),(0,e.jsx)("span",{className:"text-muted-foreground",children:u}),(0,e.jsx)(qe,{record:t})]}),g?(0,e.jsxs)("p",{className:"line-clamp-2 border-l-2 border-border pl-2 text-muted-foreground",children:["“",g,"”"]}):null,x?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Document ",(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro)",children:x})]}):null,(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[h&&m?(0,e.jsxs)("span",{className:"inline-flex items-center rounded-full bg-muted px-2 py-0.5",children:["on behalf of ",m]}):null,t.runId&&t.agentId?(0,e.jsx)(re,{to:`/agents/${t.agentId}/runs/${t.runId}`,className:"text-primary hover:underline",children:"View run"}):null,(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro) opacity-70",children:t.action})]})]}),(0,e.jsx)("time",{className:"shrink-0 whitespace-nowrap text-xs text-muted-foreground",dateTime:t.createdAt,title:new Date(t.createdAt).toLocaleString(),children:ye(t.createdAt)})]})})}r(Me,"AuditRow");function ze(){return(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)(De,{className:"h-10 w-10 text-muted-foreground/50"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Agent audit is a Paperclip Enterprise view"}),(0,e.jsxs)("p",{className:"mx-auto mt-1 max-w-md text-sm text-muted-foreground",children:["The agent audit log gives you a searchable, exportable record of everything your agents did — every comment, task change, approval, and run — with the responsible person for each action. Ask an administrator to grant you the"," ",(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro)",children:"audit:view_agent_actions"})," ","permission to view it."]})]})]})})}r(ze,"AuditUpsell");function Oe({companyId:t,lockedAgentId:a,hideHeader:d,mode:u,onModeChange:c}){const{pushToast:h}=Ae(),[m,g]=(0,l.useState)(n),[x,k]=(0,l.useState)(n),[S,V]=(0,l.useState)(n),[C,$]=(0,l.useState)(n),[E,q]=(0,l.useState)(""),[I,M]=(0,l.useState)(""),[Y,Q]=(0,l.useState)(!1),[U,J]=(0,l.useState)(!1),z=X({queryKey:Z.agents.list(t),queryFn:r(()=>Te.list(t),"queryFn")}),O=X({queryKey:Z.access.companyUserDirectory(t),queryFn:r(()=>Se.listUserDirectory(t),"queryFn"),retry:!1}),ie=(0,l.useMemo)(()=>new Map((z.data??[]).map(s=>[s.id,s])),[z.data]),le=(0,l.useMemo)(()=>Ce(O.data?.users),[O.data]),f=a?"agents":u??"all",o={actorScope:f,agentId:a??(m===n?void 0:m),responsibleUserId:x===n?void 0:x,action:S===n?void 0:S,entityType:C===n?void 0:C,from:ke(E),to:Ve(I)},b=!!(!a&&m!==n||x!==n||S!==n||C!==n||E||I),i=Pe({queryKey:Z.audit.agentActions(t,{actorScope:o.actorScope,agentId:o.agentId,responsibleUserId:o.responsibleUserId,action:o.action,entityType:o.entityType,from:o.from,to:o.to}),queryFn:r(({pageParam:s})=>ae.listAgentActions(t,{...o,limit:_e,cursor:s??void 0}),"queryFn"),initialPageParam:null,getNextPageParam:r(s=>s.nextCursor??void 0,"getNextPageParam"),retry:r((s,p)=>!(p instanceof W&&p.status===403)&&s<2,"retry")}),K=i.error instanceof W&&i.error.status===403,P=i.data?.pages.some(s=>s.accessTier==="basic")??!1,oe=i.data?.pages.some(s=>s.accessTier==="full")??!1,G=(0,l.useMemo)(()=>{const s=i.data?.pages??[];return(P?s.filter(p=>p.accessTier!=="full"):s).flatMap(p=>p.items)},[i.data,P]),D=P?"basic":i.data?.pages[0]?.accessTier,N=P&&oe,ce=a?!0:D==="full",de=!!(N&&U&&!i.isFetching),L=!!(!a&&!de&&(K&&b||N)),w=!!(K&&!a&&f==="agents"&&c),ue=!!(!a&&c&&!w&&(f==="agents"||D==="full"));(0,l.useEffect)(()=>{w&&c?.("all")},[w,c]),(0,l.useEffect)(()=>{!a&&(D==="basic"||L)&&(g(n),k(n),V(n),$(n),q(""),M(""))},[D,N,a,L]),(0,l.useEffect)(()=>{if(!N){U&&J(!1);return}U||(J(!0),i.refetch())},[U,i,N]);const H=r(()=>{g(n),k(n),V(n),$(n),q(""),M("")},"clearFilters"),me=r(async()=>{Q(!0);try{const s=await ae.exportAgentActionsCsv(t,{actorScope:o.actorScope,agentId:o.agentId,responsibleUserId:o.responsibleUserId,action:o.action,entityType:o.entityType,from:o.from,to:o.to}),p=URL.createObjectURL(s),A=document.createElement("a");A.href=p,A.download=`${f==="agents"?"agent-audit":"activity"}-${t}.csv`,document.body.appendChild(A),A.click(),A.remove(),window.setTimeout(()=>URL.revokeObjectURL(p),5e3),h({title:"Audit exported",body:"Your CSV download has started.",tone:"success"})}catch(s){h({title:"Export failed",body:s instanceof Error?s.message:"Could not export the audit log.",tone:"error"})}finally{Q(!1)}},"handleExport");return K&&!L&&!w?(0,e.jsx)(ze,{}):(0,e.jsxs)("div",{className:"space-y-4",children:[d?null:(0,e.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:"Activity"}),(0,e.jsx)("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:f==="agents"?"Every recorded agent action, newest first — with the responsible person and run behind each one.":"Everything happening in your company, newest first — people, agents, and the system. Each line is one recorded action."})]})}),ue?(0,e.jsx)(we,{value:f,onValueChange:r(s=>c?.(s),"onValueChange"),children:(0,e.jsxs)(Ne,{"aria-label":"Activity scope",children:[(0,e.jsx)(te,{value:"all",children:"All activity"}),(0,e.jsx)(te,{value:"agents",children:"Agent actions"})]})}):null,ce?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a?null:(0,e.jsxs)(F,{value:m,onValueChange:g,children:[(0,e.jsx)(R,{className:"w-40",children:(0,e.jsx)(_,{placeholder:"Agent"})}),(0,e.jsxs)(B,{children:[(0,e.jsx)(y,{value:n,children:"All agents"}),(z.data??[]).map(s=>(0,e.jsx)(y,{value:s.id,children:s.name},s.id))]})]}),(0,e.jsxs)(F,{value:x,onValueChange:k,children:[(0,e.jsx)(R,{className:"w-52",children:(0,e.jsx)(_,{placeholder:"Responsible user"})}),(0,e.jsxs)(B,{children:[(0,e.jsx)(y,{value:n,children:"All responsible users"}),(O.data?.users??[]).map(s=>(0,e.jsx)(y,{value:s.principalId,children:s.user?.name??s.user?.email??s.principalId.slice(0,8)},s.principalId))]})]}),(0,e.jsxs)(F,{value:S,onValueChange:V,children:[(0,e.jsx)(R,{className:"w-36",children:(0,e.jsx)(_,{placeholder:"Action"})}),(0,e.jsx)(B,{children:Fe.map(s=>(0,e.jsx)(y,{value:s.value,children:s.label},s.value))})]}),(0,e.jsxs)(F,{value:C,onValueChange:$,children:[(0,e.jsx)(R,{className:"w-36",children:(0,e.jsx)(_,{placeholder:"Entity"})}),(0,e.jsx)(B,{children:Be.map(s=>(0,e.jsx)(y,{value:s.value,children:s.label},s.value))})]}),(0,e.jsx)(se,{type:"date","aria-label":"From date",value:E,max:I||void 0,onChange:r(s=>q(s.target.value),"onChange"),className:"w-36"}),(0,e.jsx)(se,{type:"date","aria-label":"To date",value:I,min:E||void 0,onChange:r(s=>M(s.target.value),"onChange"),className:"w-36"}),b?(0,e.jsx)(T,{variant:"ghost",size:"sm",onClick:H,children:"Clear filters"}):null,(0,e.jsxs)(T,{variant:"outline",size:"sm",className:"ml-auto",onClick:me,disabled:Y||i.isLoading||G.length===0,children:[(0,e.jsx)(Ie,{className:"mr-1.5 h-4 w-4"}),Y?"Exporting…":"Export CSV"]})]}):null,L||w?(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"py-14 text-center text-sm text-muted-foreground",children:"Refreshing audit access…"})}):i.isLoading?(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"py-14 text-center text-sm text-muted-foreground",children:"Loading…"})}):i.error?(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:i.error instanceof Error?i.error.message:"Failed to load the audit log."}),(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:r(()=>i.refetch(),"onClick"),children:"Try again"})]})}):G.length===0?(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)(Re,{className:"h-10 w-10 text-muted-foreground/40"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:b?"No actions match these filters":"Nothing here yet"}),(0,e.jsx)("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:b?"Try a wider date range or different filters.":f==="agents"?"As soon as your agents start doing things, their actions show up here.":"As soon as anyone in your company does something, it shows up here."})]}),b?(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:H,children:"Clear filters"}):null]})}):(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"px-0 py-0",children:(0,e.jsx)("ul",{className:pe("divide-y divide-border"),children:G.map(s=>(0,e.jsx)(Me,{record:s,agentMap:ie,userProfileMap:le},s.id))})})}),i.hasNextPage?(0,e.jsx)("div",{className:"flex justify-center",children:(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:r(()=>i.fetchNextPage(),"onClick"),disabled:i.isFetchingNextPage,children:i.isFetchingNextPage?"Loading…":"Load more"})}):null,(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Recorded by Paperclip — entries can't be edited. Sensitive values are never stored."})]})}r(Oe,"AuditFeed");function it(){const{selectedCompanyId:t}=fe(),{setBreadcrumbs:a}=je(),[d,u]=ve(),c=d.get("mode")==="agents"?"agents":"all";(0,l.useEffect)(()=>{a([{label:"Activity"}])},[a]);const h=(0,l.useCallback)(m=>{u(g=>{const x=new URLSearchParams(g);return m==="agents"?x.set("mode","agents"):x.delete("mode"),x},{replace:!0})},[u]);return t?(0,e.jsx)(Oe,{companyId:t,mode:c,onModeChange:h}):(0,e.jsx)(Ee,{icon:Le,message:"Select a company to view activity."})}r(it,"CompanyActivity");export{it as CompanyActivity};
|
|
1
|
+
var xe=Object.defineProperty;var r=(t,a)=>xe(t,"name",{value:a,configurable:!0});import{i as ne}from"./rolldown-runtime-ZpX3ckPj.js";import{G as pe,Ja as he,Ka as ge,St as Z,Zi as W,fa as X,ht as fe,ut as ye}from"./boxes-D_jBxmFh.js";import{Bn as ve,n as je,o as re,r as T}from"./BreadcrumbContext-YFBsb1eF.js";import{r as ee,t as be}from"./AgentAvatar-D886s7b1.js";import{i as te,r as Ne,t as we}from"./tabs-CN7fGVFF.js";import{a as y,c as R,l as _,n as F,r as B}from"./select-C-xKsktX.js";import{a as Ae}from"./ToastContext-BoCOA6uW.js";import{t as Te}from"./agents-CZRBkVLt.js";import{t as se}from"./input-BvMWG1qq.js";import{t as Se}from"./access-D05zD04o.js";import{r as Ce}from"./company-members-Duugb3uG.js";import{r as v,t as j}from"./card-DWBuAsvl.js";import{t as Ee}from"./EmptyState-Cdh3GOJG.js";import{C as ae,En as Ie,It as Ue,Mn as Pe,dn as De,hn as Le,mn as Re}from"./index-CJ3HfyaI.js";var l=ne(he(),1),e=ne(ge(),1),_e=50,n="__all",Fe=[{value:n,label:"All actions"},{value:"issue.",label:"Tasks"},{value:"agent.",label:"Agents"},{value:"heartbeat.",label:"Runs"},{value:"approval.",label:"Approvals"},{value:"project.",label:"Projects"},{value:"goal.",label:"Goals"},{value:"tool_gateway.",label:"Tools"},{value:"cost.",label:"Costs"},{value:"company.",label:"Company"}],Be=[{value:n,label:"All entities"},{value:"issue",label:"Task"},{value:"agent",label:"Agent"},{value:"project",label:"Project"},{value:"goal",label:"Goal"},{value:"company",label:"Company"}];function ke(t){if(!t)return;const a=new Date(`${t}T00:00:00.000Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(ke,"toStartIso");function Ve(t){if(!t)return;const a=new Date(`${t}T23:59:59.999Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(Ve,"toEndIso");function $e({record:t,agentMap:a,userProfileMap:d}){const u=t.agentId??(t.actorType==="agent"?t.actorId:null),c=u?a.get(u):null;if(c)return(0,e.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1.5",title:c.name,children:[(0,e.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,e.jsx)(be,{agent:c,size:16,className:"h-3 w-3"})}),(0,e.jsx)("span",{className:"truncate font-medium text-foreground",children:c.name})]});if(t.actorType==="user"&&t.actorId){const m=d.get(t.actorId);return(0,e.jsx)(ee,{name:m?.label??"User",avatarUrl:m?.image??null,size:"sm",className:"font-medium text-foreground"})}const h=t.actorType==="plugin"?"Plugin":t.actorType==="agent"?"Agent":t.actorType==="user"?"User":"System";return(0,e.jsx)(ee,{name:h,size:"sm",className:"font-medium text-foreground"})}r($e,"AuditActor");function qe({record:t}){const{issue:a,document:d}=t.entity,u=a?.identifier??a?.id??null;return u?(0,e.jsx)(re,{to:`/issues/${u}`,className:"font-medium text-primary hover:underline",children:a?.identifier?`${a.identifier}${a.title?` · ${a.title}`:""}`:"the task"}):d?(0,e.jsx)("span",{className:"font-medium text-foreground",children:d.key}):(0,e.jsx)("span",{className:"text-muted-foreground",children:t.entityType})}r(qe,"AuditEntityNode");function Me({record:t,agentMap:a,userProfileMap:d}){const u=Ue(t.action,t.details,{agentMap:a,userProfileMap:d}),c=t.responsibleUserId?d.get(t.responsibleUserId):null,h=!!(t.responsibleUserId&&!(t.actorType==="user"&&t.actorId===t.responsibleUserId)),m=c?.label??(t.responsibleUserId?"a user":null),g=t.entity.comment?.excerpt?.trim(),x=t.entity.issue&&t.entity.document?t.entity.document.key:null;return(0,e.jsx)("li",{className:"px-4 py-3 text-sm",children:(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1 text-foreground",children:[(0,e.jsx)($e,{record:t,agentMap:a,userProfileMap:d}),(0,e.jsx)("span",{className:"text-muted-foreground",children:u}),(0,e.jsx)(qe,{record:t})]}),g?(0,e.jsxs)("p",{className:"line-clamp-2 border-l-2 border-border pl-2 text-muted-foreground",children:["“",g,"”"]}):null,x?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Document ",(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro)",children:x})]}):null,(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[h&&m?(0,e.jsxs)("span",{className:"inline-flex items-center rounded-full bg-muted px-2 py-0.5",children:["on behalf of ",m]}):null,t.runId&&t.agentId?(0,e.jsx)(re,{to:`/agents/${t.agentId}/runs/${t.runId}`,className:"text-primary hover:underline",children:"View run"}):null,(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro) opacity-70",children:t.action})]})]}),(0,e.jsx)("time",{className:"shrink-0 whitespace-nowrap text-xs text-muted-foreground",dateTime:t.createdAt,title:new Date(t.createdAt).toLocaleString(),children:ye(t.createdAt)})]})})}r(Me,"AuditRow");function ze(){return(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)(De,{className:"h-10 w-10 text-muted-foreground/50"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Agent audit is a Paperclip Enterprise view"}),(0,e.jsxs)("p",{className:"mx-auto mt-1 max-w-md text-sm text-muted-foreground",children:["The agent audit log gives you a searchable, exportable record of everything your agents did — every comment, task change, approval, and run — with the responsible person for each action. Ask an administrator to grant you the"," ",(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro)",children:"audit:view_agent_actions"})," ","permission to view it."]})]})]})})}r(ze,"AuditUpsell");function Oe({companyId:t,lockedAgentId:a,hideHeader:d,mode:u,onModeChange:c}){const{pushToast:h}=Ae(),[m,g]=(0,l.useState)(n),[x,k]=(0,l.useState)(n),[S,V]=(0,l.useState)(n),[C,$]=(0,l.useState)(n),[E,q]=(0,l.useState)(""),[I,M]=(0,l.useState)(""),[Y,Q]=(0,l.useState)(!1),[U,J]=(0,l.useState)(!1),z=X({queryKey:Z.agents.list(t),queryFn:r(()=>Te.list(t),"queryFn")}),O=X({queryKey:Z.access.companyUserDirectory(t),queryFn:r(()=>Se.listUserDirectory(t),"queryFn"),retry:!1}),ie=(0,l.useMemo)(()=>new Map((z.data??[]).map(s=>[s.id,s])),[z.data]),le=(0,l.useMemo)(()=>Ce(O.data?.users),[O.data]),f=a?"agents":u??"all",o={actorScope:f,agentId:a??(m===n?void 0:m),responsibleUserId:x===n?void 0:x,action:S===n?void 0:S,entityType:C===n?void 0:C,from:ke(E),to:Ve(I)},b=!!(!a&&m!==n||x!==n||S!==n||C!==n||E||I),i=Pe({queryKey:Z.audit.agentActions(t,{actorScope:o.actorScope,agentId:o.agentId,responsibleUserId:o.responsibleUserId,action:o.action,entityType:o.entityType,from:o.from,to:o.to}),queryFn:r(({pageParam:s})=>ae.listAgentActions(t,{...o,limit:_e,cursor:s??void 0}),"queryFn"),initialPageParam:null,getNextPageParam:r(s=>s.nextCursor??void 0,"getNextPageParam"),retry:r((s,p)=>!(p instanceof W&&p.status===403)&&s<2,"retry")}),K=i.error instanceof W&&i.error.status===403,P=i.data?.pages.some(s=>s.accessTier==="basic")??!1,oe=i.data?.pages.some(s=>s.accessTier==="full")??!1,G=(0,l.useMemo)(()=>{const s=i.data?.pages??[];return(P?s.filter(p=>p.accessTier!=="full"):s).flatMap(p=>p.items)},[i.data,P]),D=P?"basic":i.data?.pages[0]?.accessTier,N=P&&oe,ce=a?!0:D==="full",de=!!(N&&U&&!i.isFetching),L=!!(!a&&!de&&(K&&b||N)),w=!!(K&&!a&&f==="agents"&&c),ue=!!(!a&&c&&!w&&(f==="agents"||D==="full"));(0,l.useEffect)(()=>{w&&c?.("all")},[w,c]),(0,l.useEffect)(()=>{!a&&(D==="basic"||L)&&(g(n),k(n),V(n),$(n),q(""),M(""))},[D,N,a,L]),(0,l.useEffect)(()=>{if(!N){U&&J(!1);return}U||(J(!0),i.refetch())},[U,i,N]);const H=r(()=>{g(n),k(n),V(n),$(n),q(""),M("")},"clearFilters"),me=r(async()=>{Q(!0);try{const s=await ae.exportAgentActionsCsv(t,{actorScope:o.actorScope,agentId:o.agentId,responsibleUserId:o.responsibleUserId,action:o.action,entityType:o.entityType,from:o.from,to:o.to}),p=URL.createObjectURL(s),A=document.createElement("a");A.href=p,A.download=`${f==="agents"?"agent-audit":"activity"}-${t}.csv`,document.body.appendChild(A),A.click(),A.remove(),window.setTimeout(()=>URL.revokeObjectURL(p),5e3),h({title:"Audit exported",body:"Your CSV download has started.",tone:"success"})}catch(s){h({title:"Export failed",body:s instanceof Error?s.message:"Could not export the audit log.",tone:"error"})}finally{Q(!1)}},"handleExport");return K&&!L&&!w?(0,e.jsx)(ze,{}):(0,e.jsxs)("div",{className:"space-y-4",children:[d?null:(0,e.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:"Activity"}),(0,e.jsx)("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:f==="agents"?"Every recorded agent action, newest first — with the responsible person and run behind each one.":"Everything happening in your company, newest first — people, agents, and the system. Each line is one recorded action."})]})}),ue?(0,e.jsx)(we,{value:f,onValueChange:r(s=>c?.(s),"onValueChange"),children:(0,e.jsxs)(Ne,{"aria-label":"Activity scope",children:[(0,e.jsx)(te,{value:"all",children:"All activity"}),(0,e.jsx)(te,{value:"agents",children:"Agent actions"})]})}):null,ce?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a?null:(0,e.jsxs)(F,{value:m,onValueChange:g,children:[(0,e.jsx)(R,{className:"w-40",children:(0,e.jsx)(_,{placeholder:"Agent"})}),(0,e.jsxs)(B,{children:[(0,e.jsx)(y,{value:n,children:"All agents"}),(z.data??[]).map(s=>(0,e.jsx)(y,{value:s.id,children:s.name},s.id))]})]}),(0,e.jsxs)(F,{value:x,onValueChange:k,children:[(0,e.jsx)(R,{className:"w-52",children:(0,e.jsx)(_,{placeholder:"Responsible user"})}),(0,e.jsxs)(B,{children:[(0,e.jsx)(y,{value:n,children:"All responsible users"}),(O.data?.users??[]).map(s=>(0,e.jsx)(y,{value:s.principalId,children:s.user?.name??s.user?.email??s.principalId.slice(0,8)},s.principalId))]})]}),(0,e.jsxs)(F,{value:S,onValueChange:V,children:[(0,e.jsx)(R,{className:"w-36",children:(0,e.jsx)(_,{placeholder:"Action"})}),(0,e.jsx)(B,{children:Fe.map(s=>(0,e.jsx)(y,{value:s.value,children:s.label},s.value))})]}),(0,e.jsxs)(F,{value:C,onValueChange:$,children:[(0,e.jsx)(R,{className:"w-36",children:(0,e.jsx)(_,{placeholder:"Entity"})}),(0,e.jsx)(B,{children:Be.map(s=>(0,e.jsx)(y,{value:s.value,children:s.label},s.value))})]}),(0,e.jsx)(se,{type:"date","aria-label":"From date",value:E,max:I||void 0,onChange:r(s=>q(s.target.value),"onChange"),className:"w-36"}),(0,e.jsx)(se,{type:"date","aria-label":"To date",value:I,min:E||void 0,onChange:r(s=>M(s.target.value),"onChange"),className:"w-36"}),b?(0,e.jsx)(T,{variant:"ghost",size:"sm",onClick:H,children:"Clear filters"}):null,(0,e.jsxs)(T,{variant:"outline",size:"sm",className:"ml-auto",onClick:me,disabled:Y||i.isLoading||G.length===0,children:[(0,e.jsx)(Ie,{className:"mr-1.5 h-4 w-4"}),Y?"Exporting…":"Export CSV"]})]}):null,L||w?(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"py-14 text-center text-sm text-muted-foreground",children:"Refreshing audit access…"})}):i.isLoading?(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"py-14 text-center text-sm text-muted-foreground",children:"Loading…"})}):i.error?(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:i.error instanceof Error?i.error.message:"Failed to load the audit log."}),(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:r(()=>i.refetch(),"onClick"),children:"Try again"})]})}):G.length===0?(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)(Re,{className:"h-10 w-10 text-muted-foreground/40"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:b?"No actions match these filters":"Nothing here yet"}),(0,e.jsx)("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:b?"Try a wider date range or different filters.":f==="agents"?"As soon as your agents start doing things, their actions show up here.":"As soon as anyone in your company does something, it shows up here."})]}),b?(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:H,children:"Clear filters"}):null]})}):(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"px-0 py-0",children:(0,e.jsx)("ul",{className:pe("divide-y divide-border"),children:G.map(s=>(0,e.jsx)(Me,{record:s,agentMap:ie,userProfileMap:le},s.id))})})}),i.hasNextPage?(0,e.jsx)("div",{className:"flex justify-center",children:(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:r(()=>i.fetchNextPage(),"onClick"),disabled:i.isFetchingNextPage,children:i.isFetchingNextPage?"Loading…":"Load more"})}):null,(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Recorded by Paperclip — entries can't be edited. Sensitive values are never stored."})]})}r(Oe,"AuditFeed");function it(){const{selectedCompanyId:t}=fe(),{setBreadcrumbs:a}=je(),[d,u]=ve(),c=d.get("mode")==="agents"?"agents":"all";(0,l.useEffect)(()=>{a([{label:"Activity"}])},[a]);const h=(0,l.useCallback)(m=>{u(g=>{const x=new URLSearchParams(g);return m==="agents"?x.set("mode","agents"):x.delete("mode"),x},{replace:!0})},[u]);return t?(0,e.jsx)(Oe,{companyId:t,mode:c,onModeChange:h}):(0,e.jsx)(Ee,{icon:Le,message:"Select a company to view activity."})}r(it,"CompanyActivity");export{it as CompanyActivity};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ze=Object.defineProperty;var d=(e,r)=>ze(e,"name",{value:r,configurable:!0});import{i as we}from"./rolldown-runtime-ZpX3ckPj.js";import{Ct as De,G as ne,Ja as _e,Ka as Ue,Pr as We,St as Z,Xi as te,da as pe,fa as X,ht as qe,in as Ke}from"./boxes-
|
|
1
|
+
var ze=Object.defineProperty;var d=(e,r)=>ze(e,"name",{value:r,configurable:!0});import{i as we}from"./rolldown-runtime-ZpX3ckPj.js";import{Ct as De,G as ne,Ja as _e,Ka as Ue,Pr as We,St as Z,Xi as te,da as pe,fa as X,ht as qe,in as Ke}from"./boxes-D_jBxmFh.js";import{In as Ye,ct as z,d as Ge,n as Ze,r as H,rt as Xe,v as He}from"./BreadcrumbContext-YFBsb1eF.js";import{h as Je}from"./StatusIcon-DTQdc51O.js";import{t as fe}from"./MarkdownBody-hzf52hYP.js";import{r as Qe}from"./badge-C-rbIvdW.js";import{t as me}from"./rotate-ccw-CKRNJfyN.js";import{t as Ve}from"./x-C1wDgmBG.js";import{a as et}from"./ToastContext-BoCOA6uW.js";import{t as tt}from"./agents-CZRBkVLt.js";import{t as D}from"./EmptyState-Cdh3GOJG.js";import{t as st}from"./PageSkeleton-lBEhkJYF.js";import{Ct as nt,En as rt,Ht as ot,Qt as at,St as it,a as ct,bt as he,i as lt,n as dt,r as ut,rn as pt,t as je,vt as ft,xt as mt,yt as ht}from"./index-CJ3HfyaI.js";var h=we(_e(),1),xt=["agents","projects","skills","routines","tasks","attachments"],gt={agents:"Agents",projects:"Projects",skills:"Skills",routines:"Routines",tasks:"Tasks",attachments:"Attachments"};function bt(){return{agents:!0,projects:!0,skills:!0,routines:!0,tasks:!0,attachments:!0}}d(bt,"buildDefaultExportCategorySelection");function ye(e){return e.tasks||e.routines}d(ye,"isAttachmentsCategoryEnabled");function ve(e){const r=new Set;for(const a of e){if(!a.recurring)continue;const n=a.path.trim();if(!n)continue;r.add(n);const o=n.lastIndexOf("/");o>=0&&r.add(`${n.slice(0,o+1)}`)}return r}d(ve,"buildRecurringTaskPrefixes");function wt(e,r){for(const a of r)if(e===a||e.startsWith(a))return!0;return!1}d(wt,"isRecurringTaskFile");function jt(e){const r=new Set,a=new Set;for(const n of e)for(const o of n.attachments??[]){const c=o.sha256.trim().toLowerCase();c&&(n.recurring?r:a).add(c)}return{recurring:r,oneOff:a}}d(jt,"buildAttachmentShaOwnership");var yt=new Set(["agents","projects","skills","routines","tasks"]);function vt(e){const r=new Map;for(const a of e){const n=a.sha256.trim().toLowerCase();if(!n)continue;const o=r.get(n)??new Set,c=a.ownedBy&&a.ownedBy.length>0?a.ownedBy:["always"];for(const p of c)o.add(p);r.set(n,o)}return r}d(vt,"buildEmbeddedAssetShaOwnership");function kt(e,r){for(const a of e)if(!yt.has(a)||r[a])return!0;return!1}d(kt,"isEmbeddedAssetBlobIncluded");function ke(e,r){return e.startsWith("agents/")?"agents":e.startsWith("projects/")?"projects":e.startsWith("skills/")?"skills":e.startsWith("tasks/")?wt(e,r)?"routines":"tasks":e.startsWith("blobs/")?"attachments":null}d(ke,"categorizeExportFile");function St(e,r){const a=ve(r),n={agents:0,projects:0,skills:0,routines:0,tasks:0,attachments:0};for(const o of e){const c=ke(o,a);c&&(n[c]+=1)}return n}d(St,"countExportFilesByCategory");function Ct(e){const{filePaths:r,issues:a,categories:n}=e,o=ve(a),c=jt(a),p=vt(e.embeddedAssets??[]),f=n.attachments&&ye(n),x=new Set;for(const l of r){const b=ke(l,o);if(b===null){x.add(l);continue}if(b==="attachments"){const i=l.slice(6).trim().toLowerCase(),g=p.get(i);if(g&&kt(g,n)){x.add(l);continue}if(!f)continue;const j=c.recurring.has(i),y=c.oneOff.has(i);!j&&!y?g||x.add(l):(y&&n.tasks||j&&n.routines)&&x.add(l);continue}n[b]&&x.add(l)}return x}d(Ct,"buildExportCheckedFiles");function Se(e,r){if(!r.has(e))return r.add(e),e;let a=2;for(;;){const n=`${e}-${a}`;if(!r.has(n))return r.add(n),n;a+=1}}d(Se,"uniqueSlug");function Et(e){const r=new Set,a=new Map,n=[...e].sort((o,c)=>o.name.localeCompare(c.name));for(const o of n){const c=We(o.name)??"agent";a.set(o.id,Se(c,r))}return a}d(Et,"buildPortableAgentSlugMap");function Nt(e){const r=new Set,a=new Map,n=[...e].sort((o,c)=>o.name.localeCompare(c.name));for(const o of n){const c=Ke(o.name,o.name);a.set(o.id,Se(c,r))}return a}d(Nt,"buildPortableProjectSlugMap");function At(e){const r=Et(e.agents),a=Nt(e.projects),n={agents:e.orderedAgents.map(o=>r.get(o.id)).filter(o=>!!o),projects:e.orderedProjects.map(o=>a.get(o.id)).filter(o=>!!o)};return n.agents.length>0||n.projects.length>0?n:void 0}d(At,"buildPortableSidebarOrder");var t=we(Ue(),1);function Ce(e){const r=new Set,a=new Set,n=new Set;for(const o of e){const c=o.match(/^agents\/([^/]+)\//);c&&r.add(c[1]);const p=o.match(/^projects\/([^/]+)\//);p&&a.add(p[1]);const f=o.match(/^tasks\/([^/]+)\//);f&&n.add(f[1])}return{agents:r,projects:a,tasks:n,routines:new Set(n)}}d(Ce,"checkedSlugs");function Pt(e,r){const a=Ce(r),n=e.split(`
|
|
2
2
|
`),o=[],c=new Set(["agents","projects","tasks","routines"]),p=new Set(["agents","projects"]);let f=null,x=null,l=!0,b=null,i=null,g=[],j=null,y=[];function T(){i!==null&&g.length>0&&(y.push(i),y.push(...g)),i=null,g=[]}d(T,"flushSidebarSection");function N(){T(),j!==null&&y.length>0&&(o.push(j),o.push(...y)),j=null,y=[]}d(N,"flushSection");for(const w of n){const U=w.match(/^([a-zA-Z_][\w-]*):\s*(.*)$/);if(U&&!w.startsWith(" ")){N(),x=null,l=!0;const E=U[0].split(":")[0];if(c.has(E)){f=E,j=w;continue}else if(E==="sidebar"){f=E,b=null,j=w;continue}else{f=null,o.push(w);continue}}if(f==="sidebar"){const E=w.match(/^ ([\w-]+):\s*$/);if(E&&!w.startsWith(" ")){T();const A=E[1];b=A&&p.has(A)?A:null,i=b?w:null;continue}const L=w.match(/^ - ["']?([^"'\n]+)["']?\s*$/);if(L&&b){const A=L[1],W=a[b];A&&W.has(A)&&g.push(w);continue}if(b){g.push(w);continue}}if(f&&c.has(f)){const E=w.match(/^ ([\w][\w-]*):\s*(.*)$/);if(E&&!w.startsWith(" ")){const L=E[1];x=L,l=a[f].has(L),l&&y.push(w);continue}if(x!==null){l&&y.push(w);continue}y.push(w);continue}o.push(w)}N();let C=o.join(`
|
|
3
3
|
`);const _=C.match(/^\s{2}logoPath:\s*["']?([^"'\n]+)["']?\s*$/m);return _&&!r.has(_[1])&&(C=C.replace(/^\s{2}logoPath:\s*["']?([^"'\n]+)["']?\s*\n?/m,"")),C}d(Pt,"filterPaperclipYaml");function Ee(e,r){if(!r)return e;const a=r.toLowerCase();return e.map(n=>{if(n.kind==="file")return n.name.toLowerCase().includes(a)||n.path.toLowerCase().includes(a)?n:null;const o=Ee(n.children,r);return o.length>0?{...n,children:o}:null}).filter(n=>n!==null)}d(Ee,"filterTree");function Rt(e,r){const a=new Set,n=r.toLowerCase();function o(c,p){if(c.kind==="file"){if(c.name.toLowerCase().includes(n)||c.path.toLowerCase().includes(n))for(const f of p)a.add(f)}else for(const f of c.children)o(f,[...p,c.path])}d(o,"walk");for(const c of e)o(c,[]);return a}d(Rt,"collectMatchedParentDirs");var xe=10;function Tt(e,r,a,n){let o=0,c=0;return{nodes:e.map(p=>{if(p.kind==="dir"&&p.name==="tasks"){o=p.children.length;const f=[],x=[],l=a.toLowerCase();for(const g of p.children){const j=mt([g],"file"),y=n!==null&&j.has(n),T=a&&(g.name.toLowerCase().includes(l)||g.path.toLowerCase().includes(l)||[...j].some(N=>N.toLowerCase().includes(l)));y||T?f.push(g):x.push(g)}const b=Math.max(0,r-f.length),i=[...f,...x.slice(0,b)];return c=i.length,{...p,children:i}}return p}),totalTaskChildren:o,visibleTaskChildren:c}}d(Tt,"paginateTaskNodes");function Ne(e,r,a){const n={};for(const o of Object.keys(e))r.has(o)&&(n[o]=a[o]??e[o]);return n}d(Ne,"filterExportForDownload");function Lt(e,r,a){const n=Ne(e.files,r,a),o=lt(n,e.rootPath),c=new ArrayBuffer(o.byteLength);new Uint8Array(c).set(o);const p=new Blob([c],{type:"application/zip"}),f=URL.createObjectURL(p),x=document.createElement("a");x.href=f,x.download=`${e.rootPath}.zip`,document.body.appendChild(x),x.click(),x.remove(),window.setTimeout(()=>URL.revokeObjectURL(f),1e3)}d(Lt,"downloadZip");function Ot({data:e,onSkillClick:r}){return(0,t.jsx)("div",{className:"rounded-md border border-border bg-accent/20 px-4 py-3 mb-4",children:(0,t.jsx)("dl",{className:"grid grid-cols-(--gtc-5) gap-x-4 gap-y-1.5 text-sm",children:Object.entries(e).map(([a,n])=>(0,t.jsxs)("div",{className:"contents",children:[(0,t.jsx)("dt",{className:"text-muted-foreground whitespace-nowrap py-0.5",children:ft[a]??a}),(0,t.jsx)("dd",{className:"py-0.5",children:Array.isArray(n)?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:n.map(o=>(0,t.jsx)("button",{type:"button",className:ne("inline-flex items-center rounded-md border border-border bg-background px-2 py-0.5 text-xs",a==="skills"&&r&&"cursor-pointer hover:bg-accent/50 hover:border-foreground/30 transition-colors"),onClick:d(()=>a==="skills"&&r?.(o),"onClick"),children:o},o))}):(0,t.jsx)("span",{children:n})})]},a))})})}d(Ot,"FrontmatterCard");var Mt={ceo:"CEO",cto:"CTO",cmo:"CMO",cfo:"CFO",coo:"COO",vp:"VP",manager:"Manager",engineer:"Engineer",agent:"Agent"};function Ft(e,r,a,n){const o=Ce(r),c=e.agents.filter(i=>o.agents.has(i.slug)),p=e.projects.filter(i=>o.projects.has(i.slug)),f=e.issues.filter(i=>o.tasks.has(i.slug)),x=e.skills.filter(i=>[...r].some(g=>g.startsWith(`skills/${i.key}/`)||g.startsWith("skills/")&&g.includes(`/${i.slug}/`))),l=[];l.push(`# ${a}`),l.push(""),n&&(l.push(`> ${n}`),l.push("")),c.length>0&&(l.push(""),l.push("")),l.push("## What's Inside"),l.push(""),l.push("This is an [Agent Company](https://paperclip.ing) package."),l.push("");const b=[];if(c.length>0&&b.push(["Agents",c.length]),p.length>0&&b.push(["Projects",p.length]),x.length>0&&b.push(["Skills",x.length]),f.length>0&&b.push(["Tasks",f.length]),b.length>0){l.push("| Content | Count |"),l.push("|---------|-------|");for(const[i,g]of b)l.push(`| ${i} | ${g} |`);l.push("")}if(c.length>0){l.push("### Agents"),l.push(""),l.push("| Agent | Role | Reports To |"),l.push("|-------|------|------------|");for(const i of c){const g=Mt[i.role]??i.role,j=i.reportsToSlug??"—";l.push(`| ${i.name} | ${g} | ${j} |`)}l.push("")}if(p.length>0){l.push("### Projects"),l.push("");for(const i of p){const g=i.description?` — ${i.description}`:"";l.push(`- **${i.name}**${g}`)}l.push("")}return l.push("## Getting Started"),l.push(""),l.push("```bash"),l.push("npx @tickernelz/paperclip-pro company import this-github-url-or-folder"),l.push("```"),l.push(""),l.push("See [Paperclip](https://paperclip.ing) for more information."),l.push(""),l.push("---"),l.push(`Exported from [Paperclip](https://paperclip.ing) on ${new Date().toISOString().split("T")[0]}`),l.push(""),l.join(`
|
|
4
4
|
`)}d(Ft,"generateReadmeFromSelection");function It(e){const{src:r,selectedFile:a,allFiles:n,orgChartPreviewUrl:o}=e;if(/^(?:https?:|data:)/i.test(r))return null;if(r.replace(/^\.\//,"")==="images/org-chart.png"&&o)return o;const c=(a.includes("/")?a.slice(0,a.lastIndexOf("/")+1):"")+r,p=n[c]??n[r];return p?je(c in n?c:r,p):null}d(It,"resolveExportPreviewImageSrc");function $t({selectedFile:e,content:r,allFiles:a,orgChartPreviewUrl:n,onSkillClick:o}){if(!e||r===null)return(0,t.jsx)(D,{icon:z,message:"Select a file to preview its contents."});const c=dt(r),p=e.endsWith(".md")&&c!==null,f=p&&c?nt(c):null,x=ut(e,r)?je(e,r):null,l=p?b=>It({src:b,selectedFile:e,allFiles:a,orgChartPreviewUrl:n}):void 0;return(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"border-b border-border px-5 py-3",children:(0,t.jsx)("div",{className:"truncate font-mono text-sm",children:e})}),(0,t.jsx)("div",{className:"min-h-(--sz-560px) px-5 py-5",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Ot,{data:f.data,onSkillClick:o}),f.body.trim()&&(0,t.jsx)(fe,{resolveImageSrc:l,softBreaks:!1,linkIssueReferences:!1,children:f.body})]}):p?(0,t.jsx)(fe,{resolveImageSrc:l,softBreaks:!1,linkIssueReferences:!1,children:c??""}):x?(0,t.jsx)("div",{className:"flex min-h-(--sz-520px) items-center justify-center rounded-lg border border-border bg-accent/10 p-6",children:(0,t.jsx)("img",{src:x,alt:e,className:"max-h-(--sz-480px) max-w-full object-contain"})}):c!==null?(0,t.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words border-0 bg-transparent p-0 font-mono text-sm text-foreground",children:(0,t.jsx)("code",{children:c})}):(0,t.jsx)("div",{className:"rounded-lg border border-border bg-accent/10 px-4 py-3 text-sm text-muted-foreground",children:"Binary asset preview is not available for this file type."})})]})}d($t,"ExportPreviewPane");function ge(e){const r="/company/export/files/",a=He(e),n=a.indexOf(r);return n===-1?null:decodeURIComponent(a.slice(n+22))||null}d(ge,"filePathFromLocation");function be(e){const r=e.split("/").slice(0,-1),a=[];let n="";for(const o of r)n=n?`${n}/${o}`:o,a.push(n);return a}d(be,"expandAncestors");function Bt(e){return(e instanceof DOMException||e instanceof Error)&&e.name==="AbortError"}d(Bt,"isAbortError");function se(e){return e instanceof Error?e.message:"Failed to load export data."}d(se,"previewErrorMessage");function Vt(){const{selectedCompanyId:e,selectedCompany:r}=qe(),{setBreadcrumbs:a}=Ze(),{pushToast:n}=et(),o=Ge(),c=Ye(),p=(0,h.useRef)(ge(c.pathname)),{data:f}=X({queryKey:Z.auth.session,queryFn:d(()=>De.getSession(),"queryFn")}),{data:x=[]}=X({queryKey:Z.agents.list(e),queryFn:d(()=>tt.list(e),"queryFn"),enabled:!!e}),{data:l=[]}=X({queryKey:Z.projects.list(e),queryFn:d(()=>Je.list(e),"queryFn"),enabled:!!e}),{data:b}=X({queryKey:Z.companies.exportFidelity(e),queryFn:d(()=>te.exportFidelity(e),"queryFn"),enabled:!!e}),[i,g]=(0,h.useState)(null),[j,y]=(0,h.useState)(null),[T,N]=(0,h.useState)(new Set),[C,_]=(0,h.useState)(()=>({...bt(),tasks:!1,routines:!1,attachments:!1})),[w,U]=(0,h.useState)(""),[E,L]=(0,h.useState)(xe),[A,W]=(0,h.useState)(!1),q=(0,h.useRef)(null),I=(0,h.useRef)(null),M=(0,h.useRef)(0),re=(0,h.useRef)(null),oe=f?.user?.id??f?.session?.userId??null,J=(0,h.useMemo)(()=>x.filter(s=>s.status!=="terminated"),[x]),Q=(0,h.useMemo)(()=>l,[l]),{orderedAgents:ae}=pt({agents:J,companyId:e,userId:oe}),{orderedProjects:ie}=at({projects:Q,companyId:e,userId:oe}),ce=(0,h.useMemo)(()=>At({agents:J,orderedAgents:ae,projects:Q,orderedProjects:ie}),[ae,ie,J,Q]),V=C.tasks||C.routines,ee=(0,h.useCallback)((s,u=!1)=>{y(s),s?o(`/company/export/files/${encodeURI(s)}`,{replace:u}):o("/company/export",{replace:u})},[o]);(0,h.useEffect)(()=>{if(!i)return;const s=ge(c.pathname);s&&s in i.files&&s!==j?(y(s),N(u=>{const m=new Set(u);for(const v of be(s))m.add(v);return m})):!s&&j&&y(null)},[c.pathname,i]),(0,h.useEffect)(()=>{a([{label:r?.name??"Organization",href:"/dashboard"},{label:"Settings",href:"/company/settings"},{label:"Export"}])},[r?.name,a]);const P=pe({mutationFn:d(({includeIssues:s,includeSkills:u,signal:m})=>te.exportPreview(e,{include:{company:!0,agents:!0,projects:!0,issues:s,skills:u},sidebarOrder:ce},{signal:m}),"mutationFn"),onSuccess:d((s,u)=>{if(u.requestId!==M.current)return;g(s);const m=he(s.files),v=new Set;for(const k of m)k.kind==="dir"&&k.name!=="tasks"&&v.add(k.path);const S=p.current;if(S&&S in s.files){y(S);const k=be(S);N(new Set([...v,...k]))}else{const k="README.md"in s.files?"README.md":Object.keys(s.files)[0];k&&ee(k,!0),N(v)}},"onSuccess"),onError:d((s,u)=>{u.requestId!==M.current||Bt(s)||n({tone:"error",title:"Export failed",body:se(s)})},"onError")});function F(){if(!e)return;I.current?.abort();const s=new AbortController,u=M.current+1;M.current=u,I.current=s,W(!1),P.mutate({includeIssues:V,includeSkills:C.skills,requestId:u,signal:s.signal})}d(F,"startPreviewRequest");const K=pe({mutationFn:d(()=>te.exportBundle(e,{include:{company:!0,agents:!0,projects:!0,issues:V,skills:C.skills},selectedFiles:Array.from(R).sort(),sidebarOrder:ce}),"mutationFn"),onSuccess:d(s=>{const u=new Set(Object.keys(s.files));Lt(s,u,s.files),n({tone:"success",title:"Export downloaded",body:`${u.size} file${u.size===1?"":"s"} exported as ${s.rootPath}.zip`})},"onSuccess"),onError:d(s=>{n({tone:"error",title:"Export failed",body:s instanceof Error?s.message:"Failed to build export package."})},"onError")});(0,h.useEffect)(()=>{e&&(re.current!==e&&(re.current=e,g(null),y(null)),F())},[e,V,C.skills]),(0,h.useEffect)(()=>()=>{M.current+=1,I.current?.abort()},[]);const O=(0,h.useMemo)(()=>i?he(i.files):[],[i]),R=(0,h.useMemo)(()=>i?Ct({filePaths:Object.keys(i.files),issues:i.manifest.issues,categories:C,embeddedAssets:i.manifest.embeddedAssets??[]}):new Set,[i,C]),Ae=(0,h.useMemo)(()=>i?St(Object.keys(i.files),i.manifest.issues):null,[i]),{displayTree:Pe,totalTaskChildren:le,visibleTaskChildren:de}=(0,h.useMemo)(()=>{let s=O;w&&(s=Ee(s,w));const u=Tt(s,E,w,j);return{displayTree:u.nodes,totalTaskChildren:u.totalTaskChildren,visibleTaskChildren:u.visibleTaskChildren}},[O,w,E,j]),Re=(0,h.useMemo)(()=>{const s={};function u(m){if(m.kind==="file"){const S=R.has(m.path);return S||(s[m.path]="muted"),S}let v=!1;for(const S of m.children)u(S)&&(v=!0);return v||(s[m.path]="muted"),v}d(u,"walk");for(const m of O)u(m);return s},[O,R]),Y=(0,h.useMemo)(()=>{if(!i)return{};const s={...i.files},u=i.paperclipExtensionPath;if(u&&typeof i.files[u]=="string"&&(s[u]=Pt(i.files[u],R)),typeof i.files["README.md"]=="string"){const m=i.manifest.company?.name??r?.name??"Company",v=i.manifest.company?.description??null;s["README.md"]=Ft(i.manifest,R,m,v)}return s},[i,R,r?.name]),Te=(0,h.useMemo)(()=>i?ct(Ne(i.files,R,Y),i.rootPath):0,[i,R,Y]),ue=(0,h.useMemo)(()=>it(O),[O]),$=R.size,B=(0,h.useMemo)(()=>i?i.warnings.filter(s=>!/terminated agent/i.test(s)):[],[i]);function Le(s){N(u=>{const m=new Set(u);return m.has(s)?m.delete(s):m.add(s),m})}d(Le,"handleToggleDir");function Oe(s){_(u=>({...u,[s]:!u[s]}))}d(Oe,"handleToggleCategory");function Me(s){const u=w.length>0,m=s.length>0;if(m&&!u&&(q.current=new Set(T)),U(s),m){const v=Rt(O,s);N(S=>{const k=new Set(S);for(const G of v)k.add(G);return k})}else u&&q.current&&(N(q.current),q.current=null)}d(Me,"handleSearchChange");function Fe(s){if(!i)return;const u=i.manifest.skills.find(m=>m.key===s||m.slug===s)?.path??`skills/${s}/SKILL.md`;u in i.files&&(ee(u),N(m=>{const v=new Set(m);v.add("skills");const S=u.split("/").slice(0,-1);let k="";for(const G of S)k=k?`${k}/${G}`:G,v.add(k);return v}))}d(Fe,"handleSkillClick");function Ie(){!i||R.size===0||K.isPending||K.mutate()}d(Ie,"handleDownload");function $e(){M.current+=1,I.current?.abort(),I.current=null,P.reset(),W(!0)}if(d($e,"handleCancelPreview"),!e)return(0,t.jsx)(D,{icon:z,message:"Select an organization to export."});if(P.isPending&&!i)return(0,t.jsx)(st,{variant:"detail"});if(A&&!i)return(0,t.jsx)(D,{icon:z,title:"Export preview cancelled",message:"The preview request was cancelled. Your export settings are unchanged.",action:"Retry preview",onAction:F,hideActionIcon:!0});if(P.isError&&!i)return(0,t.jsx)(D,{icon:z,title:"Export preview failed",message:se(P.error),description:"Retry the preview. You do not need to reload this page.",action:"Retry preview",onAction:F,hideActionIcon:!0});if(!i)return(0,t.jsx)(D,{icon:z,title:"Export preview unavailable",message:"No export preview is loaded.",action:"Load preview",onAction:F,hideActionIcon:!0});const Be=j?Y[j]??null:null;return(0,t.jsxs)("div",{className:"max-w-6xl",children:[(0,t.jsx)("div",{className:"sticky top-0 z-10 border-b border-border bg-background px-5 py-3",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-4 text-sm",children:[(0,t.jsxs)("span",{className:"font-medium",children:[r?.name??"Organization"," export"]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["Exporting ",$.toLocaleString()," of ",ue.toLocaleString()," file",ue===1?"":"s",$>0&&` (~${ot(Te)})`]}),B.length>0&&(0,t.jsxs)("span",{className:"text-amber-500",children:[B.length," warning",B.length===1?"":"s"]})]}),(0,t.jsxs)(H,{size:"sm",onClick:Ie,disabled:$===0||K.isPending||P.isPending||P.isError||A,children:[(0,t.jsx)(rt,{className:"mr-1.5 h-3.5 w-3.5"}),K.isPending?"Building export...":`Export ${$.toLocaleString()} file${$===1?"":"s"}`]})]})}),B.length>0&&(0,t.jsx)("div",{className:"mx-5 mt-3 rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:B.map(s=>(0,t.jsx)("div",{className:"text-xs text-amber-500",children:s},s))}),b&&b.warnings.length>0&&(0,t.jsxs)("div",{className:"mx-5 mt-3 rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:[(0,t.jsx)("h3",{className:"mb-1.5 text-xs font-medium",children:"Not included in this export"}),b.warnings.map(s=>(0,t.jsx)("div",{className:ne("text-xs",s.severity==="blocker"?"font-medium text-destructive":"text-amber-500"),children:s.message},s.code))]}),(0,t.jsxs)("div",{className:"grid gap-4 xl:h-(--sz-calc-30) xl:grid-cols-(--gtc-25) xl:gap-0",children:[(0,t.jsxs)("aside",{className:"flex max-h-(--sz-24rem) flex-col overflow-hidden border-b border-border xl:max-h-none xl:border-b-0 xl:border-r",children:[(0,t.jsx)("div",{className:"border-b border-border px-4 py-3 shrink-0",children:(0,t.jsx)("h2",{className:"text-base font-semibold",children:"Package files"})}),(0,t.jsxs)("div",{className:"border-b border-border px-4 py-3 shrink-0",children:[(0,t.jsx)("h3",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"What to include"}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5",role:"group","aria-label":"What to include",children:xt.map(s=>{const u=s==="attachments"&&!ye(C),m=C[s]&&!u,v=Ae?.[s]??0,S=i.manifest.includes.issues||s!=="tasks"&&s!=="routines"&&s!=="attachments";return(0,t.jsxs)("label",{className:ne("flex items-center gap-2 text-sm",u?"cursor-not-allowed opacity-50":"cursor-pointer"),title:u?"Attachments travel with tasks and routines; re-enable one of them to include attachments.":void 0,children:[(0,t.jsx)("input",{type:"checkbox",checked:m,disabled:u,onChange:d(()=>Oe(s),"onChange"),className:"accent-foreground","data-export-category":s}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:gt[s]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:S?v.toLocaleString():"—"})]},s)})}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Task and routine history is opt-in because it can be large."})]}),(0,t.jsx)("div",{className:"border-b border-border px-3 py-2 shrink-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border px-2 py-1",children:[(0,t.jsx)(Xe,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,t.jsx)("input",{type:"text",value:w,onChange:d(s=>Me(s.target.value),"onChange"),placeholder:"Search files...",className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground","data-page-search-target":"true"})]})}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,t.jsx)(ht,{nodes:Pe,selectedFile:j,expandedDirs:T,onToggleDir:Le,onSelectFile:ee,fileTones:Re,showCheckboxes:!1,wrapLabels:!1}),le>de&&!w&&(0,t.jsx)("div",{className:"px-4 py-2",children:(0,t.jsxs)("button",{type:"button",onClick:d(()=>L(s=>s+xe),"onClick"),className:"w-full rounded-md border border-border px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/30 hover:text-foreground transition-colors",children:["Show more tasks (",de," of ",le,")"]})})]})]}),(0,t.jsxs)("div",{className:"relative min-w-0 overflow-y-auto xl:pl-6",children:[(0,t.jsx)($t,{selectedFile:j,content:Be,allFiles:Y,orgChartPreviewUrl:`/api/companies/${encodeURIComponent(e)}/org.svg`,onSkillClick:Fe}),P.isPending?(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex min-h-(--sz-520px) items-center justify-center bg-background/90 px-6 text-center",role:"status","aria-live":"polite","aria-busy":"true","data-export-preview-state":"loading",children:(0,t.jsxs)("div",{className:"flex max-w-md flex-col items-center gap-3",children:[(0,t.jsx)(Qe,{className:"h-6 w-6 animate-spin text-muted-foreground"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:"Updating export preview…"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Large task histories can take a minute. You can untick Tasks or cancel this update."})]}),(0,t.jsxs)(H,{type:"button",variant:"outline",size:"sm",onClick:$e,children:[(0,t.jsx)(Ve,{}),"Cancel update"]})]})}):A?(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex min-h-(--sz-520px) items-center justify-center bg-background/90 px-6 text-center","data-export-preview-state":"cancelled",children:(0,t.jsxs)("div",{className:"flex max-w-md flex-col items-center gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:"Preview update cancelled"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"The previous preview remains available. Retry when you are ready."})]}),(0,t.jsxs)(H,{type:"button",variant:"outline",size:"sm",onClick:F,children:[(0,t.jsx)(me,{}),"Retry preview"]})]})}):P.isError?(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex min-h-(--sz-520px) items-center justify-center bg-background/90 px-6 text-center",role:"alert","data-export-preview-state":"error",children:(0,t.jsxs)("div",{className:"flex max-w-md flex-col items-center gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-destructive",children:"Export preview failed"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:se(P.error)})]}),(0,t.jsxs)(H,{type:"button",variant:"outline",size:"sm",onClick:F,children:[(0,t.jsx)(me,{}),"Retry preview"]})]})}):null]})]})]})}d(Vt,"CompanyExport");export{Vt as CompanyExport};
|
package/dist/assets/{CompanySkills.production-MIQ--cmS.js → CompanySkills.production-Md5bdvfu.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var gr=Object.defineProperty;var n=(t,l)=>gr(t,"name",{value:l,configurable:!0});import{i as yn}from"./rolldown-runtime-ZpX3ckPj.js";import{G as M,Ga as fr,Ja as br,Ka as jr,St as f,da as Y,fa as xe,ht as vr,t as ge,ut as yr}from"./boxes-
|
|
1
|
+
var gr=Object.defineProperty;var n=(t,l)=>gr(t,"name",{value:l,configurable:!0});import{i as yn}from"./rolldown-runtime-ZpX3ckPj.js";import{G as M,Ga as fr,Ja as br,Ka as jr,St as f,da as Y,fa as xe,ht as vr,t as ge,ut as yr}from"./boxes-D_jBxmFh.js";import{Bn as kr,_t as Nr,bt as Ft,d as wr,dt as Sr,et as kn,n as Cr,o as pe,r as y,rt as Fr,st as jt,zn as Ir}from"./BreadcrumbContext-YFBsb1eF.js";import{d as Re,m as Nn,p as $e,u as ze}from"./alert-dialog-CWzV3zo2.js";import{t as rn}from"./AgentAvatar-D886s7b1.js";import{a as Dr,i as Lr,n as vt,r as Ws,t as Br}from"./checkbox-DIJHqeW0.js";import{C as Pr,S as Bs,_ as Er,a as yt,c as bs,f as Ps,g as Ls,h as xt,i as As,o as js,p as Je,r as vs,t as ys,u as Es}from"./dialog-DjwDIuGh.js";import{c as _,f as Tr,t as Ar}from"./MarkdownEditor-TeZtHH3E.js";import{i as Ts,r as wn,t as Sn}from"./tabs-CN7fGVFF.js";import{p as It}from"./StatusIcon-DTQdc51O.js";import{l as Cn,o as Kr,r as Fn,s as Mr,t as qr}from"./use-adapter-capabilities-6CN-Uka0.js";import{t as In}from"./check-BxpiJ7RJ.js";import{t as gs}from"./chevron-down-DNwAOF6s.js";import{a as Dn,i as Ln}from"./clipboard-qMoH9LBU.js";import{t as ht}from"./save-DOI3xZRr.js";import{n as Rr,t as fs}from"./external-link-B5nRAEdU.js";import{r as Dt}from"./usePrefersReducedMotion-CPVSqZjQ.js";import{E as $r,t as kt}from"./MarkdownBody-hzf52hYP.js";import{t as Lt}from"./file-text-weiGzqbg.js";import{d as zr,u as Bn}from"./sheet-BCC6X3p_.js";import{t as le}from"./badge-C-rbIvdW.js";import{t as _r}from"./x-C1wDgmBG.js";import{a as Ur}from"./ToastContext-BoCOA6uW.js";import{t as Hs}from"./agents-CZRBkVLt.js";import{t as qe}from"./input-BvMWG1qq.js";import{t as es}from"./EmptyState-Cdh3GOJG.js";import{t as Be}from"./PageSkeleton-lBEhkJYF.js";import{$ as Or,An as an,At as Gs,Cn as Vr,Dn as Qr,Dt as Hr,En as Nt,Et as Bt,G as Gr,J as Wr,K as Yr,Lt as Xr,Mt as Jr,Nt as Pn,Ot as pt,Pt as En,Q as Zr,S as ea,Tn,Wt as sa,Y as ta,Z as na,_ as An,at as ra,b as aa,bn as la,cn as ia,ct as ln,d as oa,et as da,f as ca,fn as ua,ft as he,g as gt,gn as ma,h as Ks,hn as Kn,it as xa,jt as ft,kn as wt,kt as ha,l as pa,lt as Ze,m as ga,ot as fa,p as ba,q as ja,rt as va,st as Mn,tt as ya,u as ka,v as Na,vn as St,wn as ks,x as wa,y as Sa,yn as Ca,zt as Fa}from"./index-CJ3HfyaI.js";var c=yn(br(),1),e=yn(jr(),1),on=16,dn=24,cn="min-h-9";function un(t){return(0,e.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...t,children:(0,e.jsx)("path",{d:"M12 4 21 19H3z"})})}n(un,"VercelMark");function qn(t){const l=t.replace(/\r\n/g,`
|
|
2
2
|
`);if(!l.startsWith(`---
|
|
3
3
|
`))return l.trim();const a=l.indexOf(`
|
|
4
4
|
---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var l=Object.defineProperty;var n=(t,s)=>l(t,"name",{value:s,configurable:!0});import{i as o}from"./rolldown-runtime-ZpX3ckPj.js";import{Ka as c}from"./boxes-
|
|
1
|
+
var l=Object.defineProperty;var n=(t,s)=>l(t,"name",{value:s,configurable:!0});import{i as o}from"./rolldown-runtime-ZpX3ckPj.js";import{Ka as c}from"./boxes-D_jBxmFh.js";import{r as i,st as u}from"./BreadcrumbContext-YFBsb1eF.js";var e=o(c(),1);function b({icon:t,title:s,message:m,description:r,action:a,onAction:x,hideActionIcon:d=!1}){return(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,e.jsx)("div",{className:"bg-muted/50 p-4 mb-4",children:(0,e.jsx)(t,{className:"h-10 w-10 text-muted-foreground/50"})}),s?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"text-base font-semibold text-foreground mb-1.5",children:s}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground mb-4 max-w-md",children:m})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:m}),r&&(0,e.jsx)("p",{className:"max-w-md text-sm text-muted-foreground mb-4",children:r})]}),a&&x&&(0,e.jsxs)(i,{onClick:x,children:[!d&&(0,e.jsx)(u,{className:"h-4 w-4 mr-1.5"}),a]})]})}n(b,"EmptyState");export{b as t};
|