@tickernelz/paperclip-pro-ui 2026.1023.0 → 2026.1024.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AgentAvatar-CXBfQ6pz.js +1 -0
- package/dist/assets/Agents.production-B5XXJ2wN.js +2 -0
- package/dist/assets/BreadcrumbContext-CmzhWkn9.js +1 -0
- package/dist/assets/CompanyActivity.production-1GZhq-K5.js +1 -0
- package/dist/assets/{CompanyExport-iwRD6Ak0.js → CompanyExport-CNu_xL_7.js} +3 -3
- package/dist/assets/{CompanySkills.production-BNQwI1_u.js → CompanySkills.production-YrmJa9Vy.js} +2 -2
- package/dist/assets/EmptyState-B6HqDhhl.js +1 -0
- package/dist/assets/{MarkdownBody-Cweo3KGi.js → MarkdownBody-DXX_MrOZ.js} +5 -5
- package/dist/assets/{MarkdownEditor-B6u1nGzv.js → MarkdownEditor-C0MQKETk.js} +16 -16
- package/dist/assets/OrgChart.production-3TDu-rpn.js +1 -0
- package/dist/assets/{PageSkeleton-Bxzx6LdM.js → PageSkeleton-CzsquFSq.js} +1 -1
- package/dist/assets/RoutineDetail.production-Dbg7SxCr.js +1 -0
- package/dist/assets/{RoutineRunVariablesDialog-BTO1cGhY.js → RoutineRunVariablesDialog-R9R_pIYM.js} +2 -2
- package/dist/assets/Routines.production-wYPaLAXL.js +1 -0
- package/dist/assets/StatusIcon-D50dDCBL.js +1 -0
- package/dist/assets/Terminal-ByJxc__B.js +1 -0
- package/dist/assets/ToastContext-Dj6kHjBt.js +1 -0
- package/dist/assets/access-BP0uIEvm.js +1 -0
- package/dist/assets/agent-avatar-url-CKjwadh7.js +1 -0
- package/dist/assets/agents-BnTeL72d.js +15 -0
- package/dist/assets/{alert-dialog-CqvHCY2y.js → alert-dialog-BVgYDfs5.js} +1 -1
- package/dist/assets/arrow-right-yI8KLv06.js +1 -0
- package/dist/assets/arrow-up-DoquRvt-.js +1 -0
- package/dist/assets/{badge-6KBG4DJ9.js → badge-CZKC9uUT.js} +1 -1
- package/dist/assets/bot-DqtgSgxB.js +1 -0
- package/dist/assets/{card-Bz65aUPI.js → card-CLrZE3zB.js} +1 -1
- package/dist/assets/{check-C7890FPo.js → check-B8hWCPEY.js} +1 -1
- package/dist/assets/checkbox-9ullTWTl.js +1 -0
- package/dist/assets/chevron-down-CdGqWSzz.js +1 -0
- package/dist/assets/clipboard-D6M0E1wp.js +1 -0
- package/dist/assets/company-members-Duugb3uG.js +1 -0
- package/dist/assets/createLucideIcon-DwVwDVEQ.js +134 -0
- package/dist/assets/{definition-BHM7rMPG.js → definition-cSCCeU7R.js} +1 -1
- package/dist/assets/dist-94psnYQg.js +1 -0
- package/dist/assets/dist-BLg9eYEC.js +1 -0
- package/dist/assets/dist-DGt1Bt7m.js +1 -0
- package/dist/assets/dist-OejlA9DH.js +1 -0
- package/dist/assets/dropdown-menu-ByiK1BlD.js +1 -0
- package/dist/assets/environments-BQaMNey_.js +1 -0
- package/dist/assets/{external-link-DggAY2Qs.js → external-link-0PKOUbZP.js} +1 -1
- package/dist/assets/{file-text-BWHzh5pq.js → file-text-Daxr7tUE.js} +1 -1
- package/dist/assets/{health-I-sCu61_.js → health-Dm97GTVw.js} +1 -1
- package/dist/assets/{heartbeats-DTwjV2kl.js → heartbeats-CZVMH9s8.js} +1 -1
- package/dist/assets/{index-jaWIjVIN.css → index-BJUeQIKY.css} +1 -1
- package/dist/assets/{index-D4-wU1bZ.js → index-Bzln5Ksp.js} +346 -199
- package/dist/assets/{input-ConoHcjz.js → input-rJVxQSgj.js} +1 -1
- package/dist/assets/instanceSettings-DuE48Bn5.js +1 -0
- package/dist/assets/label-CvkHqiK_.js +5 -0
- package/dist/assets/{mention-chips--Lp_ENqh.js → mention-chips-BkED6NiN.js} +9 -9
- package/dist/assets/{rotate-ccw-BUHfDFfI.js → rotate-ccw-sgBZvjSw.js} +1 -1
- package/dist/assets/save-V2f8XCvd.js +1 -0
- package/dist/assets/{select-C35A5IGs.js → select-XFvlcP6w.js} +1 -1
- package/dist/assets/sheet-BNPM7z3e.js +1 -0
- package/dist/assets/{skeleton-5VMhNzFs.js → skeleton-BmxbZVmQ.js} +1 -1
- package/dist/assets/{tabs-BNIJaxKM.js → tabs-BC_ScIgQ.js} +1 -1
- package/dist/assets/use-adapter-capabilities-FfDsq8WI.js +1 -0
- package/dist/assets/useHiddenSettings-Dobu8_xG.js +1 -0
- package/dist/assets/usePrefersReducedMotion-CkujTZ1k.js +1 -0
- package/dist/assets/x-XhYFJqIj.js +1 -0
- package/dist/index.html +50 -40
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/dist/assets/AgentAvatar-CpQ88dwV.js +0 -1
- package/dist/assets/Agents.production-BbnOCG3N.js +0 -2
- package/dist/assets/BreadcrumbContext-c2KosyR8.js +0 -15
- package/dist/assets/CompanyActivity.production-tn4aIPJ7.js +0 -1
- package/dist/assets/EmptyState-DN8b4Qse.js +0 -1
- package/dist/assets/OrgChart.production-BJK4TNBI.js +0 -1
- package/dist/assets/RoutineDetail.production-DqgQQico.js +0 -1
- package/dist/assets/Routines.production-DQ5PjoiB.js +0 -1
- package/dist/assets/StatusIcon-BE5kFgZJ.js +0 -1
- package/dist/assets/ToastContext-FzmhiqZ4.js +0 -1
- package/dist/assets/agent-avatar-url-B_lUFC64.js +0 -134
- package/dist/assets/arrow-right-D3mUepq9.js +0 -1
- package/dist/assets/bot-Da_kJHpD.js +0 -1
- package/dist/assets/checkbox-Ds_3QqBB.js +0 -1
- package/dist/assets/clipboard-C4aDsmO8.js +0 -1
- package/dist/assets/company-members-BznLwAUd.js +0 -1
- package/dist/assets/dist-BXR8yTPD.js +0 -1
- package/dist/assets/dist-C4Rm-j8X.js +0 -1
- package/dist/assets/dist-CXUn2R-_.js +0 -1
- package/dist/assets/environments-B_qPdIBY.js +0 -1
- package/dist/assets/label-xpLcJrPL.js +0 -5
- package/dist/assets/sheet-TOBEGi0m.js +0 -1
- package/dist/assets/use-adapter-capabilities-KPGiuHeG.js +0 -1
- package/dist/assets/use-copy-action-DnjVh8kP.js +0 -1
- package/dist/assets/useHiddenSettings-CeQYvKer.js +0 -1
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var On=Object.defineProperty;var a=(e,t)=>On(e,"name",{value:t,configurable:!0});import{i as jt}from"./rolldown-runtime-ZpX3ckPj.js";import{Ar as st,G as K,Ha as jn,Ji as d,Li as Bn,P as Nn,St as de,Va as zn,Wa as Fn,Xi as qn,Yi as Hn,a as Wn,c as Vn,ca as Kn,ht as Qn,kr as Jn,l as Gn,n as k,pt as Yn,qi as Bt,r as Zn,t as Xn,u as ea}from"./agent-avatar-url-B_lUFC64.js";import{t as ta}from"./preload-helper-CceJXRIF.js";var l=jt(Fn(),1),We=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Nt=/^[\\/]{2}/;function ra(e,t){return t+e.replace(/\\/g,"/")}a(ra,"normalizeProtocolRelativeUrl");var it="popstate";function lt(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}a(lt,"isLocation");function na(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"),oa(t,r,null,e)}a(na,"createBrowserHistory");function $(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}a($,"invariant");function M(e,t){if(!e)try{throw new Error(t)}catch{}}a(M,"warning");function aa(){return Math.random().toString(36).substring(2,10)}a(aa,"createKey");function ut(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(ut,"getHistoryState");function Oe(e,t,r=null,n,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?te(t):t,state:r,key:t&&t.key||n||aa(),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 te(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(te,"parsePath");function oa(e,t,r,n={}){let{window:o=document.defaultView,v5Compat:s=!1}=n,i=o.history,u="POP",c=null,m=p();m==null&&(m=0,i.replaceState({...i.state,idx:m},""));function p(){return(i.state||{idx:null}).idx}a(p,"getIndex");function f(){u="POP";let h=p(),x=h==null?null:h-m;m=h,c&&c({action:u,location:y.location,delta:x})}a(f,"handlePop");function g(h,x){u="PUSH";let w=lt(h)?h:Oe(y.location,h,x);r&&r(w,h),m=p()+1;let I=ut(w,m),_=y.createHref(w.mask||w);try{i.pushState(I,"",_)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(_)}s&&c&&c({action:u,location:y.location,delta:1})}a(g,"push");function b(h,x){u="REPLACE";let w=lt(h)?h:Oe(y.location,h,x);r&&r(w,h),m=p();let I=ut(w,m),_=y.createHref(w.mask||w);i.replaceState(I,"",_),s&&c&&c({action:u,location:y.location,delta:0})}a(b,"replace2");function v(h){return sa(o,h)}a(v,"createURL");let y={get action(){return u},get location(){return e(o,i)},listen(h){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(it,f),c=h,()=>{o.removeEventListener(it,f),c=null}},createHref(h){return t(o,h)},createURL:v,encodeLocation(h){let x=v(h);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:g,replace:b,go(h){return i.go(h)}};return y}a(oa,"getUrlBasedHistory");function sa(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),$(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Q(t);return o=o.replace(/ $/,"%20"),!r&&Nt.test(o)&&(o=n+o),new URL(o,n)}a(sa,"createBrowserURLImpl");var ia;ia=new WeakMap;function zt(e,t,r="/"){return Ft(e,t,r,!1)}a(zt,"matchRoutes");function Ft(e,t,r,n,o){let s=q((typeof t=="string"?te(t):t).pathname||"/",r);if(s==null)return null;let i=o??ua(e),u=null,c=ka(s);for(let m=0;u==null&&m<i.length;++m)u=ba(i[m],c,n);return u}a(Ft,"matchRoutesImpl");function la(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(la,"convertRouteMatchToUiMatch");function ua(e){let t=qt(e);return ca(t),t}a(ua,"flattenAndRankRoutes");function qt(e,t=[],r=[],n="",o=!1){let s=a((i,u,c=o,m)=>{let p={relativePath:m===void 0?i.path||"":m,caseSensitive:i.caseSensitive===!0,childrenIndex:u,route:i};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(n)&&c)return;$(p.relativePath.startsWith(n),`Absolute route path "${p.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(n.length)}let f=B([n,p.relativePath]),g=r.concat(p);i.children&&i.children.length>0&&($(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),qt(i.children,t,g,f,c)),!(i.path==null&&!i.index)&&t.push({path:f,score:ya(f,i.index),routesMeta:g.map((b,v)=>{let[y,h]=Vt(b.relativePath,b.caseSensitive,v===g.length-1);return{...b,matcher:y,compiledParams:h}})})},"flattenRoute");return e.forEach((i,u)=>{if(i.path===""||!i.path?.includes("?"))s(i,u);else for(let c of Ht(i.path))s(i,u,!0,c)}),t}a(qt,"flattenRoutes");function Ht(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=Ht(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(Ht,"explodeOptionalSegments");function ca(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:va(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}a(ca,"rankRouteBranches");var da=/^:[\w-]+$/,ma=3,fa=2,pa=1,ha=10,ga=-2,ct=a(e=>e==="*","isSplat");function ya(e,t){let r=e.split("/"),n=r.length;return r.some(ct)&&(n+=ga),t&&(n+=fa),r.filter(o=>!ct(o)).reduce((o,s)=>o+(da.test(s)?ma:s===""?pa:ha),n)}a(ya,"computeScore");function va(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(va,"compareIndexes");function ba(e,t,r=!1){let{routesMeta:n}=e,o={},s="/",i=[];for(let u=0;u<n.length;++u){let c=n[u],m=u===n.length-1,p=s==="/"?t:t.slice(s.length)||"/",f={path:c.relativePath,caseSensitive:c.caseSensitive,end:m},g=c.matcher&&c.compiledParams?Wt(f,p,c.matcher,c.compiledParams):xe(f,p),b=c.route;if(!g&&m&&r&&!n[n.length-1].route.index&&(g=xe({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},p)),!g)return null;Object.assign(o,g.params),i.push({params:o,pathname:B([s,g.pathname]),pathnameBase:Ia(B([s,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(s=B([s,g.pathnameBase]))}return i}a(ba,"matchRouteBranch");function xe(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Vt(e.path,e.caseSensitive,e.end);return Wt(e,t,r,n)}a(xe,"matchPath");function Wt(e,t,r,n){let o=t.match(r);if(!o)return null;let s=o[0],i=X(s,1),u=o.slice(1);return{params:n.reduce((c,{paramName:m,isOptional:p},f)=>{if(m==="*"){let b=u[f]||"";i=X(s.slice(0,s.length-b.length),1)}const g=u[f];return p&&!g?c[m]=void 0:c[m]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:i,pattern:e}}a(Wt,"matchPathImpl");function Vt(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,m)=>{if(n.push({paramName:i,isOptional:u!=null}),u){let p=m.charAt(c+s.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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(Vt,"compilePath");function ka(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(ka,"decodePath");function q(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(q,"stripBasename");function xa(e,t="/"){let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?te(e):e,s;return r?(r=Kt(r),r.startsWith("/")||r.startsWith("\\")?s=dt(r.substring(1),"/"):s=dt(r,t)):s=t,{pathname:s,search:Sa(n),hash:Ra(o)}}a(xa,"resolvePath");function dt(e,t){let r=X(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}a(dt,"resolvePathname");function Le(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(Le,"getInvalidPathError");function wa(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}a(wa,"getPathContributingMatches");function Ve(e){let t=wa(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}a(Ve,"getResolveToMatches");function Re(e,t,r,n=!1){let o;typeof e=="string"?o=te(e):(o={...e},$(!o.pathname||!o.pathname.includes("?"),Le("?","pathname","search",o)),$(!o.pathname||!o.pathname.includes("#"),Le("#","pathname","hash",o)),$(!o.search||!o.search.includes("#"),Le("#","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=xa(o,u),m=i&&i!=="/"&&i.endsWith("/"),p=(s||i===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(m||p)&&(c.pathname+="/"),c}a(Re,"resolveTo$1");var Kt=a(e=>e.replace(/[\\/]{2,}/g,"/"),"removeDoubleSlashes"),B=a(e=>Kt(e.join("/")),"joinPaths");function X(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(X,"removeTrailingSlash");var Ia=a(e=>X(e).replace(/^\/*/,"/"),"normalizePathname"),Sa=a(e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,"normalizeSearch"),Ra=a(e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,"normalizeHash"),Ca=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 Qt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}a(Qt,"isRouteErrorResponse");function Ea(e){return B(e.map(t=>t.route.path).filter(Boolean))||"/"}a(Ea,"getRoutePattern");var Jt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gt(e,t){let r=e;if(typeof r!="string"||!We.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,o=!1;if(Jt)try{let s=new URL(window.location.href),i=Nt.test(r)?new URL(ra(r,s.protocol)):new URL(r),u=q(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(Gt,"parseToInfo");var Ji=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),mt=new URL("http://localhost");function Ke(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),mt)}catch{return mt}}a(Ke,"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 $a(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($a,"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||!$a(e,o)||!Me(o,s)))throw new Error("External navigation is not allowed")}a(Qe,"validateNavigationTarget");var Yt=["POST","PUT","PATCH","DELETE"],Gi=new Set(Yt),_a=["GET",...Yt],Yi=new Set(_a),Aa,Da,Pa,La;Aa=new WeakMap;Da=new WeakMap;Pa=new WeakMap;La=new WeakMap;var Ma=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Ta(e){try{return Ma.includes(new URL(e).protocol)}catch{return!1}}a(Ta,"hasInvalidProtocol");var re=l.createContext(null);re.displayName="DataRouter";var me=l.createContext(null);me.displayName="DataRouterState";var Zt=l.createContext(!1);function Xt(){return l.useContext(Zt)}a(Xt,"useIsRSCRouterContext");var er=l.createContext({isTransitioning:!1});er.displayName="ViewTransition";var Ua=l.createContext(new Map);Ua.displayName="Fetchers";var je=l.createContext(null);je.displayName="Await";var P=l.createContext(null);P.displayName="Navigation";var ne=l.createContext(null);ne.displayName="Location";var O=l.createContext({outlet:null,matches:[],isDataRoute:!1});O.displayName="Route";var Je=l.createContext(null);Je.displayName="RouteError";var tr="REACT_ROUTER_ERROR",Oa="REDIRECT",ja="ROUTE_ERROR_RESPONSE";function Ba(e){if(e.startsWith(`${tr}:${Oa}:{`))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(Ba,"decodeRedirectErrorDigest");function Na(e){if(e.startsWith(`${tr}:${ja}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ca(t.status,t.statusText,t.data)}catch{}}a(Na,"decodeRouteErrorResponseDigest");function za(e,{relative:t}={}){$(ae(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=l.useContext(P),{hash:o,pathname:s,search:i}=fe(e,{relative:t}),u=s;return r!=="/"&&(u=s==="/"?r:B([r,s])),n.createHref({pathname:u,search:i,hash:o})}a(za,"useHref");function ae(){return l.useContext(ne)!=null}a(ae,"useInRouterContext");function T(){return $(ae(),"useLocation() may be used only in the context of a <Router> component."),l.useContext(ne).location}a(T,"useLocation");function Zi(){return l.useContext(ne).navigationType}a(Zi,"useNavigationType");var rr="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nr(e){l.useContext(P).static||l.useLayoutEffect(e)}a(nr,"useIsomorphicLayoutEffect");function Ce(){let{isDataRoute:e}=l.useContext(O);return e?no():Fa()}a(Ce,"useNavigate$1");function Fa(){$(ae(),"useNavigate() may be used only in the context of a <Router> component.");let e=l.useContext(re),{basename:t,navigator:r}=l.useContext(P),{matches:n}=l.useContext(O),{pathname:o}=T(),s=JSON.stringify(Ve(n)),i=l.useRef(!1);return nr(()=>{i.current=!0}),l.useCallback((u,c={})=>{if(M(i.current,rr),!i.current)return;if(typeof u=="number"){r.go(u);return}let m=Re(u,JSON.parse(s),o,c.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:B([t,m.pathname])),Qe(typeof u=="string"?u:Q(u),r.createHref(m),Ke(r),"reject"),(c.replace?r.replace:r.push)(m,c.state,c)},[t,r,s,o,e])}a(Fa,"useNavigateUnstable");var qa=l.createContext(null);function Ha(e){let t=l.useContext(O).outlet;return l.useMemo(()=>t&&l.createElement(qa.Provider,{value:e},t),[t,e])}a(Ha,"useOutlet");function Wa(){let{matches:e}=l.useContext(O);return e[e.length-1]?.params??{}}a(Wa,"useParams");function fe(e,{relative:t}={}){let{matches:r}=l.useContext(O),{pathname:n}=T(),o=JSON.stringify(Ve(r));return l.useMemo(()=>Re(e,JSON.parse(o),n,t==="path"),[e,o,n,t])}a(fe,"useResolvedPath");function Va(e,t){return ar(e,t)}a(Va,"useRoutes");function ar(e,t,r){$(ae(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=l.useContext(P),{matches:o}=l.useContext(O),s=o[o.length-1],i=s?s.params:{},u=s?s.pathname:"/",c=s?s.pathnameBase:"/",m=s&&s.route;{let h=m&&m.path||"";ir(u,!m||h.endsWith("*")||h.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${h}">) 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
|
-
|
|
3
|
-
Please change the parent <Route path="${h}"> to <Route path="${h==="/"?"*":`${h}/*`}">.`)}let p=T(),f;if(t){let h=typeof t=="string"?te(t):t;$(c==="/"||h.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 "${h.pathname}" was given in the \`location\` prop.`),f=h}else f=p;let g=f.pathname||"/",b=g;if(c!=="/"){let h=c.replace(/^\//,"").split("/");b="/"+g.replace(/^\//,"").split("/").slice(h.length).join("/")}let v=r&&r.state.matches.length?r.state.matches.map(h=>Object.assign(h,{route:r.manifest[h.route.id]||h.route})):zt(e,{pathname:b});M(m||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=Ya(v&&v.map(h=>Object.assign({},h,{params:Object.assign({},i,h.params),pathname:B([c,n.encodeLocation?n.encodeLocation(h.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?c:B([c,n.encodeLocation?n.encodeLocation(h.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathnameBase])})),o,r);return t&&y?l.createElement(ne.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},y):y}a(ar,"useRoutesImpl");function Ka(){let e=ro(),t=Qt(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(Ka,"DefaultErrorComponent");var Qa=l.createElement(Ka,null),or=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=Na(e.digest);r&&(e=r)}let t=e!==void 0?l.createElement(O.Provider,{value:this.props.routeContext},l.createElement(Je.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?l.createElement(Ja,{error:e},t):t}};or.contextType=Zt;var Te=new WeakMap;function Ja({children:e,error:t}){let{basename:r,navigator:n}=l.useContext(P);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=Ba(t.digest);if(o){let s=Te.get(t);if(s)throw s;let i=Gt(o.location,r),u=i.absoluteURL||i.to;if(Qe(o.location,u,Ke(n),"allow-explicit"),Ta(u))throw new Error("Invalid redirect location");if(Jt&&!Te.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 Te.set(t,c),c}return l.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return e}a(Ja,"RSCErrorHandler");function Ga({routeContext:e,match:t,children:r}){let n=l.useContext(re);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(Ga,"RenderedRoute");function Ya(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 p=o.findIndex(f=>f.route.id&&s?.[f.route.id]!==void 0);$(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,p+1))}let i=!1,u=-1;if(r&&n){i=n.renderFallback;for(let p=0;p<o.length;p++){let f=o[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=p),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,m=n&&c?(p,f)=>{c(p,{location:n.location,params:n.matches?.[0]?.params??{},pattern:Ea(n.matches),errorInfo:f})}:void 0;return o.reduceRight((p,f,g)=>{let b,v=!1,y=null,h=null;n&&(b=s&&f.route.id?s[f.route.id]:void 0,y=f.route.errorElement||Qa,i&&(u<0&&g===0?(ir("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,h=null):u===g&&(v=!0,h=f.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,g+1)),w=a(()=>{let I;return b?I=y:v?I=h:f.route.Component?I=l.createElement(f.route.Component,null):f.route.element?I=f.route.element:I=p,l.createElement(Ga,{match:f,routeContext:{outlet:p,matches:x,isDataRoute:n!=null},children:I})},"getChildren");return n&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?l.createElement(or,{location:n.location,revalidation:n.revalidation,component:y,error:b,children:w(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:m}):w()},null)}a(Ya,"_renderMatches");function Ge(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}a(Ge,"getDataRouterConsoleError");function Za(e){let t=l.useContext(re);return $(t,Ge(e)),t}a(Za,"useDataRouterContext");function Ye(e){let t=l.useContext(me);return $(t,Ge(e)),t}a(Ye,"useDataRouterState");function Xa(e){let t=l.useContext(O);return $(t,Ge(e)),t}a(Xa,"useRouteContext");function Ze(e){let t=Xa(e),r=t.matches[t.matches.length-1];return $(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}a(Ze,"useCurrentRouteId");function eo(){return Ze("useRouteId")}a(eo,"useRouteId");function to(){let e=Ye("useNavigation");return l.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}a(to,"useNavigation");function sr(){let{matches:e,loaderData:t}=Ye("useMatches");return l.useMemo(()=>e.map(r=>la(r,t)),[e,t])}a(sr,"useMatches");function ro(){let e=l.useContext(Je),t=Ye("useRouteError"),r=Ze("useRouteError");return e!==void 0?e:t.errors?.[r]}a(ro,"useRouteError");function no(){let{router:e}=Za("useNavigate"),t=Ze("useNavigate"),r=l.useRef(!1);return nr(()=>{r.current=!0}),l.useCallback(async(n,o={})=>{M(r.current,rr),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}a(no,"useNavigateStable");var ft={};function ir(e,t,r){!t&&!ft[e]&&(ft[e]=!0,M(!1,r))}a(ir,"warningOnce");var pt={};function ao(e,t){!e&&!pt[t]&&(pt[t]=!0)}a(ao,"warnOnce");var Xi=l.memo(oo);function oo({routes:e,manifest:t,future:r,state:n,isStatic:o,onError:s}){return ar(e,void 0,{manifest:t,state:n,isStatic:o,onError:s,future:r})}a(oo,"DataRoutes2");function so({to:e,replace:t,state:r,relative:n}){$(ae(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:s}=l.useContext(P);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}=T(),c=Ce(),m=Re(e,Ve(i),u,n==="path");Qe(typeof e=="string"?e:Q(e),s.createHref(m),Ke(s),"reject");let p=JSON.stringify(m);return l.useEffect(()=>{c(JSON.parse(p),{replace:t,state:r,relative:n})},[c,p,n,t,r]),null}a(so,"Navigate$1");function el(e){return Ha(e.context)}a(el,"Outlet");function io(e){$(!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(io,"Route");function lr({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:s=!1,useTransitions:i}){$(!ae(),"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=te(r));let{pathname:m="/",search:p="",hash:f="",state:g=null,key:b="default",mask:v}=r,y=l.useMemo(()=>{let h=q(m,u);return h==null?null:{location:{pathname:h,search:p,hash:f,state:g,key:b,mask:v},navigationType:n}},[u,m,p,f,g,b,n,v]);return M(y!=null,`<Router basename="${u}"> is not able to match the URL "${m}${p}${f}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:l.createElement(P.Provider,{value:c},l.createElement(ne.Provider,{children:t,value:y}))}a(lr,"Router");function tl({children:e,location:t}){return Va(Be(e),t)}a(tl,"Routes");var rl=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 Be(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,Be(n.props.children,s));return}$(n.type===io,`[${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>`),$(!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=Be(n.props.children,s)),r.push(i)}),r}a(Be,"createRoutesFromChildren");var be="get",ke="application/x-www-form-urlencoded";function Ee(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}a(Ee,"isHtmlElement");function lo(e){return Ee(e)&&e.tagName.toLowerCase()==="button"}a(lo,"isButtonElement");function uo(e){return Ee(e)&&e.tagName.toLowerCase()==="form"}a(uo,"isFormElement");function co(e){return Ee(e)&&e.tagName.toLowerCase()==="input"}a(co,"isInputElement");function mo(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}a(mo,"isModifiedEvent");function fo(e,t){return e.button===0&&(!t||t==="_self")&&!mo(e)}a(fo,"shouldProcessLinkClick");function Ne(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(Ne,"createSearchParams");function po(e,t){let r=Ne(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(s=>{r.append(o,s)})}),r}a(po,"getSearchParamsForLocation");var ge=null;function ho(){if(ge===null)try{new FormData(document.createElement("form"),0),ge=!1}catch{ge=!0}return ge}a(ho,"isFormDataSubmitterSupported");var go=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ue(e){return e!=null&&!go.has(e)?(M(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ke}"`),null):e}a(Ue,"getFormEncType");function yo(e,t){let r,n,o,s,i;if(uo(e)){let u=e.getAttribute("action");n=u?q(u,t):null,r=e.getAttribute("method")||be,o=Ue(e.getAttribute("enctype"))||ke,s=new FormData(e)}else if(lo(e)||co(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?q(c,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||be,o=Ue(e.getAttribute("formenctype"))||Ue(u.getAttribute("enctype"))||ke,s=new FormData(u,e),!ho()){let{name:m,type:p,value:f}=e;if(p==="image"){let g=m?`${m}.`:"";s.append(`${g}x`,"0"),s.append(`${g}y`,"0")}else m&&s.append(m,f)}}else{if(Ee(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=be,n=null,o=ke,i=e}return s&&o==="text/plain"&&(i=s,s=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:s,body:i}}a(yo,"getFormSubmissionInfo");var nl=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),vo={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},bo=/[&><\u2028\u2029]/g;function ht(e){return e.replace(bo,t=>vo[t])}a(ht,"escapeHtml");function $e(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}a($e,"invariant2");function ur(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&&q(o.pathname,t)==="/"?o.pathname=`${X(t)}/_root.${n}`:o.pathname=`${X(o.pathname)}.${n}`,o}a(ur,"singleFetchUrl");async function ko(e,t){if(e.id in t)return t[e.id];try{let r=await ta(()=>import(e.module),[]);return t[e.id]=r,r}catch{return window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}a(ko,"loadRouteModule");function xo(e){return e!=null&&typeof e.page=="string"}a(xo,"isPageLinkDescriptor");function wo(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(wo,"isHtmlLinkDescriptor");async function Io(e,t,r){return Co((await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let s=await ko(o,r);return s.links?s.links():[]}return[]}))).flat(1).filter(wo).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}a(Io,"getKeyedPrefetchLinks");function gt(e,t,r,n,o,s){let i=a((c,m)=>r[m]?c.route.id!==r[m].route.id:!0,"isNew"),u=a((c,m)=>r[m].pathname!==c.pathname||r[m].route.path?.endsWith("*")&&r[m].params["*"]!==c.params["*"],"matchPathChanged");return s==="assets"?t.filter((c,m)=>i(c,m)||u(c,m)):s==="data"?t.filter((c,m)=>{let p=n.routes[c.route.id];if(!p||!p.hasLoader)return!1;if(i(c,m)||u(c,m))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(gt,"getNewMatchesForLinks");function cr(e,t,{includeHydrateFallback:r}={}){return So(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(cr,"getModuleLinkHrefs");function So(e){return[...new Set(e)]}a(So,"dedupeHrefs");function Ro(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}a(Ro,"sortKeys");function Co(e,t){let r=new Set,n=new Set(t);return e.reduce((o,s)=>{if(t&&!xo(s)&&s.as==="script"&&s.href&&n.has(s.href))return o;let i=JSON.stringify(Ro(s));return r.has(i)||(r.add(i),o.push({key:i,link:s})),o},[])}a(Co,"dedupeLinkDescriptors");function Eo(e,t){return e.mode==="lazy"&&t===!0}a(Eo,"isFogOfWarEnabled");function $o({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=Ft(r.routes,u,r.basename||"/",!1,r.branches);c&&c.forEach(m=>n.add(m.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($o,"getPartialManifest");function _e(){let e=l.useContext(re);return $e(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}a(_e,"useDataRouterContext2");function dr(){let e=l.useContext(me);return $e(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}a(dr,"useDataRouterStateContext");var Ae=l.createContext(void 0);Ae.displayName="FrameworkContext";function J(){let e=l.useContext(Ae);return $e(e,"You must render this element inside a <HydratedRouter> element"),e}a(J,"useFrameworkContext");function _o(e,t){let r=l.useContext(Ae),[n,o]=l.useState(!1),[s,i]=l.useState(!1),{onFocus:u,onBlur:c,onMouseEnter:m,onMouseLeave:p,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"),h=new IntersectionObserver(y,{threshold:.5});return g.current&&h.observe(g.current),()=>{h.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:ie(u,b),onBlur:ie(c,v),onMouseEnter:ie(m,b),onMouseLeave:ie(p,v),onTouchStart:ie(f,b)}]:[!1,g,{}]}a(_o,"usePrefetchBehavior");function ie(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}a(ie,"composeEventHandlers");function Ao(e,t,r){if(r&&!we)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(Ao,"getActiveMatches");function Do({page:e,...t}){let r=Xt(),{nonce:n}=J(),{router:o}=_e(),s=l.useMemo(()=>zt(o.routes,e,o.basename),[o.routes,e,o.basename]);return s?(t.nonce==null&&n&&(t={...t,nonce:n}),r?l.createElement(Lo,{page:e,matches:s,...t}):l.createElement(Mo,{page:e,matches:s,...t})):null}a(Do,"PrefetchPageLinks");function Po(e){let{manifest:t,routeModules:r}=J(),[n,o]=l.useState([]);return l.useEffect(()=>{let s=!1;return Io(e,t,r).then(i=>{s||o(i)}),()=>{s=!0}},[e,t,r]),n}a(Po,"useKeyedPrefetchLinks");function Lo({page:e,matches:t,...r}){let n=T(),{future:o}=J(),{basename:s}=_e(),i=l.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let u=ur(e,s,o.v8_trailingSlashAwareDataRequests,"rsc"),c=!1,m=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?c=!0:m.push(p.route.id);return c&&m.length>0&&u.searchParams.set("_routes",m.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(Lo,"RSCPrefetchPageLinksImpl");function Mo({page:e,matches:t,...r}){let n=T(),{future:o,manifest:s,routeModules:i}=J(),{basename:u}=_e(),{loaderData:c,matches:m}=dr(),p=l.useMemo(()=>gt(e,t,m,s,n,"data"),[e,t,m,s,n]),f=l.useMemo(()=>gt(e,t,m,s,n,"assets"),[e,t,m,s,n]),g=l.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let y=new Set,h=!1;if(t.forEach(w=>{let I=s.routes[w.route.id];!I||!I.hasLoader||(!p.some(_=>_.route.id===w.route.id)&&w.route.id in c&&i[w.route.id]?.shouldRevalidate||I.hasClientLoader?h=!0:y.add(w.route.id))}),y.size===0)return[];let x=ur(e,u,o.v8_trailingSlashAwareDataRequests,"data");return h&&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,p,t,e,i]),b=l.useMemo(()=>cr(f,s),[f,s]),v=Po(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:h})=>l.createElement("link",{key:y,nonce:r.nonce,...h,crossOrigin:h.crossOrigin??r.crossOrigin})))}a(Mo,"PrefetchPageLinksImpl");var we=!1;function To(){we=!0}a(To,"setIsHydrated");function Uo(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:o,routeDiscovery:s,ssr:i,nonce:u}=J(),{router:c,static:m,staticContext:p}=_e(),{matches:f}=dr(),g=Xt(),b=Eo(s,i);e.nonce==null&&u&&(e={...e,nonce:u}),o&&(o.didRenderScripts=!0);let v=Ao(f,null,n);l.useEffect(()=>{To()},[]);let y=l.useMemo(()=>{if(g)return null;let w=p?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",I=m?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${b?"":`import ${JSON.stringify(t.url)}`};
|
|
4
|
-
${v.map((_,C)=>{let A=`route${C}`,L=t.routes[_.route.id];$e(L,`Route ${_.route.id} not found in manifest`);let{clientActionModule:j,clientLoaderModule:D,clientMiddlewareModule:N,hydrateFallbackModule:G,module:U}=L,H=[...j?[{module:j,varName:`${A}_clientAction`}]:[],...D?[{module:D,varName:`${A}_clientLoader`}]:[],...N?[{module:N,varName:`${A}_clientMiddleware`}]:[],...G?[{module:G,varName:`${A}_HydrateFallback`}]:[],{module:U,varName:`${A}_main`}];return H.length===1?`import * as ${A} from ${JSON.stringify(U)};`:[H.map(z=>`import * as ${z.varName} from "${z.module}";`).join(`
|
|
5
|
-
`),`const ${A} = {${H.map(z=>`...${z.varName}`).join(",")}};`].join(`
|
|
6
|
-
`)}).join(`
|
|
7
|
-
`)}
|
|
8
|
-
${b?`window.__reactRouterManifest = ${JSON.stringify($o(t,c),null,2)};`:""}
|
|
9
|
-
window.__reactRouterRouteModules = {${v.map((_,C)=>`${JSON.stringify(_.route.id)}:route${C}`).join(",")}};
|
|
10
|
-
|
|
11
|
-
import(${JSON.stringify(t.entry.module)});`:" ";return l.createElement(l.Fragment,null,l.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:w},type:void 0}),l.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:I},type:"module",async:!0}))},[]),h=we||g?[]:[...new Set(t.entry.imports.concat(cr(v,t,{includeHydrateFallback:!0})))],x=typeof t.sri=="object"?t.sri:{};return ao(!g,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),we||g?null:l.createElement(l.Fragment,null,typeof t.sri=="object"?l.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:x})}}):null,b?null:l.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:x[t.url],nonce:e.nonce,suppressHydrationWarning:!0}),l.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:x[t.entry.module],nonce:e.nonce,suppressHydrationWarning:!0}),h.map(w=>l.createElement("link",{key:w,rel:"modulepreload",href:w,crossOrigin:e.crossOrigin,integrity:x[w],nonce:e.nonce,suppressHydrationWarning:!0})),y)}a(Uo,"Scripts");function Oo(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}a(Oo,"mergeRefs");var al=class extends l.Component{static{a(this,"RemixErrorBoundary")}constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?l.createElement(jo,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function jo({error:e,isOutsideRemixApp:t}){let{nonce:r}=J(),n=l.createElement("script",{nonce:r,dangerouslySetInnerHTML:{__html:`
|
|
12
|
-
console.log(
|
|
13
|
-
"💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
|
|
14
|
-
);
|
|
15
|
-
`}});if(Qt(e))return l.createElement(yt,{title:"Unhandled Thrown Response!"},l.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),n);let o;if(e instanceof Error)o=e;else{let s=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);o=new Error(s)}return l.createElement(yt,{title:"Application Error!",isOutsideRemixApp:t},l.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),l.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},o.stack),n)}a(jo,"RemixRootDefaultErrorBoundary");function yt({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:o}=J();return o.root?.Layout&&!r?n:l.createElement("html",{lang:"en"},l.createElement("head",null,l.createElement("meta",{charSet:"utf-8"}),l.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),l.createElement("title",null,e)),l.createElement("body",null,l.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?l.createElement(Uo,null):null)))}a(yt,"BoundaryShell");var Bo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Bo&&(window.__reactRouterVersion="7.18.4")}catch{}function ol({basename:e,children:t,useTransitions:r,window:n}){let o=l.useRef();o.current==null&&(o.current=na({window:n,v5Compat:!0}));let s=o.current,[i,u]=l.useState({action:s.action,location:s.location}),c=l.useCallback(m=>{r===!1?u(m):l.startTransition(()=>u(m))},[r]);return l.useLayoutEffect(()=>s.listen(c),[s,c]),l.createElement(lr,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:s,useTransitions:r})}a(ol,"BrowserRouter");function No({basename:e,children:t,history:r,useTransitions:n}){let[o,s]=l.useState({action:r.action,location:r.location}),i=l.useCallback(u=>{n===!1?s(u):l.startTransition(()=>s(u))},[n]);return l.useLayoutEffect(()=>r.listen(i),[r,i]),l.createElement(lr,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:r,useTransitions:n})}a(No,"HistoryRouter");No.displayName="unstable_HistoryRouter";var pe=l.forwardRef(a(function({onClick:t,discover:r="render",prefetch:n="none",relative:o,reloadDocument:s,replace:i,mask:u,state:c,target:m,to:p,preventScrollReset:f,viewTransition:g,defaultShouldRevalidate:b,...v},y){let{basename:h,navigator:x,useTransitions:w}=l.useContext(P),I=typeof p=="string"&&We.test(p),_=Gt(p,h);p=_.to;let C=za(p,{relative:o}),A=T(),L=null;if(u){let F=Re(u,[],A.mask?A.mask.pathname:"/",!0);h!=="/"&&(F.pathname=F.pathname==="/"?h:B([h,F.pathname])),L=x.createHref(F)}let[j,D,N]=_o(n,v),G=Ho(p,{replace:i,mask:u,state:c,target:m,preventScrollReset:f,relative:o,viewTransition:g,defaultShouldRevalidate:b,useTransitions:w});function U(F){t&&t(F),F.defaultPrevented||G(F)}a(U,"handleClick");let H=!(_.isExternal||s),z=l.createElement("a",{...v,...N,href:(H?L:void 0)||_.absoluteURL||C,onClick:H?U:t,ref:Oo(y,D),target:m,"data-discover":!I&&r==="render"?"true":void 0});return j&&!I?l.createElement(l.Fragment,null,z,l.createElement(Do,{page:C})):z},"LinkWithRef"));pe.displayName="Link";var mr=l.forwardRef(a(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:o=!1,style:s,to:i,viewTransition:u,children:c,...m},p){let f=fe(i,{relative:m.relative}),g=T(),b=l.useContext(me),{navigator:v,basename:y}=l.useContext(P),h=b!=null&&Yo(f)&&u===!0,x=v.encodeLocation?v.encodeLocation(f).pathname:f.pathname,w=g.pathname,I=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;r||(w=w.toLowerCase(),I=I?I.toLowerCase():null,x=x.toLowerCase()),I&&y&&(I=q(I,y)||I);const _=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let C=w===x||!o&&w.startsWith(x)&&w.charAt(_)==="/",A=I!=null&&(I===x||!o&&I.startsWith(x)&&I.charAt(x.length)==="/"),L={isActive:C,isPending:A,isTransitioning:h},j=C?t:void 0,D;typeof n=="function"?D=n(L):D=[n,C?"active":null,A?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let N=typeof s=="function"?s(L):s;return l.createElement(pe,{...m,"aria-current":j,className:D,ref:p,style:N,to:i,viewTransition:u},typeof c=="function"?c(L):c)},"NavLinkWithRef"));mr.displayName="NavLink";var zo=l.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:s,method:i=be,action:u,onSubmit:c,relative:m,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:g,...b},v)=>{let{useTransitions:y}=l.useContext(P),h=Ko(),x=Qo(u,{relative:m}),w=i.toLowerCase()==="get"?"get":"post",I=typeof u=="string"&&We.test(u),_=a(C=>{if(c&&c(C),C.defaultPrevented)return;C.preventDefault();let A=C.nativeEvent.submitter,L=A?.getAttribute("formmethod")||i,j=a(()=>h(A||C.currentTarget,{fetcherKey:t,method:L,navigate:r,replace:o,state:s,relative:m,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:g}),"doSubmit");y&&r!==!1?l.startTransition(()=>j()):j()},"submitHandler");return l.createElement("form",{ref:v,method:w,action:x,onSubmit:n?c:_,...b,"data-discover":!I&&e==="render"?"true":void 0})});zo.displayName="Form";function Fo({getKey:e,storageKey:t,...r}){let n=l.useContext(Ae),{basename:o}=l.useContext(P),s=T(),i=sr();Jo({getKey:e,storageKey:t});let u=l.useMemo(()=>{if(!n||!e)return null;let m=Fe(s,i,o,e);return m!==s.key?m:null},[]);if(!n||n.isSpaMode)return null;let c=((m,p)=>{if(!window.history.state||!window.history.state.key){let f=Math.random().toString(32).slice(2);window.history.replaceState({key:f},"")}try{let f=JSON.parse(sessionStorage.getItem(m)||"{}")[p||window.history.state.key];typeof f=="number"&&window.scrollTo(0,f)}catch{sessionStorage.removeItem(m)}}).toString();return r.nonce==null&&n?.nonce&&(r.nonce=n.nonce),l.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${ht(JSON.stringify(t||ze))}, ${ht(JSON.stringify(u))})`}})}a(Fo,"ScrollRestoration");Fo.displayName="ScrollRestoration";function fr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}a(fr,"getDataRouterConsoleError2");function Xe(e){let t=l.useContext(re);return $(t,fr(e)),t}a(Xe,"useDataRouterContext3");function qo(e){let t=l.useContext(me);return $(t,fr(e)),t}a(qo,"useDataRouterState2");function Ho(e,{target:t,replace:r,mask:n,state:o,preventScrollReset:s,relative:i,viewTransition:u,defaultShouldRevalidate:c,useTransitions:m}={}){let p=Ce(),f=T(),g=fe(e,{relative:i});return l.useCallback(b=>{if(fo(b,t)){b.preventDefault();let v=r!==void 0?r:Q(f)===Q(g),y=a(()=>p(e,{replace:v,mask:n,state:o,preventScrollReset:s,relative:i,viewTransition:u,defaultShouldRevalidate:c}),"doNavigate");m?l.startTransition(()=>y()):y()}},[f,p,g,r,n,o,t,e,s,i,u,c,m])}a(Ho,"useLinkClickHandler");function sl(e){M(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=l.useRef(Ne(e)),r=l.useRef(!1),n=T(),o=l.useMemo(()=>po(n.search,r.current?null:t.current),[n.search]),s=Ce();return[o,l.useCallback((i,u)=>{const c=Ne(typeof i=="function"?i(new URLSearchParams(o)):i);r.current=!0,s("?"+c,u)},[s,o])]}a(sl,"useSearchParams");var Wo=0,Vo=a(()=>`__${String(++Wo)}__`,"getUniqueFetcherId");function Ko(){let{router:e}=Xe("useSubmit"),{basename:t}=l.useContext(P),r=eo(),n=e.fetch,o=e.navigate;return l.useCallback(async(s,i={})=>{let{action:u,method:c,encType:m,formData:p,body:f}=yo(s,t);if(i.navigate===!1){let g=i.fetcherKey||Vo();await n(g,r,i.action||u,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:p,body:f,formMethod:i.method||c,formEncType:i.encType||m,flushSync:i.flushSync})}else await o(i.action||u,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:p,body:f,formMethod:i.method||c,formEncType:i.encType||m,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,o,t,r])}a(Ko,"useSubmit");function Qo(e,{relative:t}={}){let{basename:r}=l.useContext(P),n=l.useContext(O);$(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),s={...fe(e||".",{relative:t})},i=T();if(e==null){s.search=i.search;let u=new URLSearchParams(s.search),c=u.getAll("index");if(c.some(m=>m==="")){u.delete("index"),c.filter(p=>p).forEach(p=>u.append("index",p));let m=u.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:B([r,s.pathname])),Q(s)}a(Qo,"useFormAction");var ze="react-router-scroll-positions",ye={};function Fe(e,t,r,n){let o=null;return n&&(r!=="/"?o=n({...e,pathname:q(e.pathname,r)||e.pathname},t):o=n(e,t)),o==null&&(o=e.key),o}a(Fe,"getScrollRestorationKey");function Jo({getKey:e,storageKey:t}={}){let{router:r}=Xe("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:o}=qo("useScrollRestoration"),{basename:s}=l.useContext(P),i=T(),u=sr(),c=to();l.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Go(l.useCallback(()=>{if(c.state==="idle"){let m=Fe(i,u,s,e);ye[m]=window.scrollY}try{sessionStorage.setItem(t||ze,JSON.stringify(ye))}catch(m){M(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${m}).`)}window.history.scrollRestoration="auto"},[c.state,e,s,i,u,t])),typeof document<"u"&&(l.useLayoutEffect(()=>{try{let m=sessionStorage.getItem(t||ze);m&&(ye=JSON.parse(m))}catch{}},[t]),l.useLayoutEffect(()=>{let m=r?.enableScrollRestoration(ye,()=>window.scrollY,e?(p,f)=>Fe(p,f,s,e):void 0);return()=>m&&m()},[r,s,e]),l.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let m=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(m){m.scrollIntoView();return}}}catch{M(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}o!==!0&&window.scrollTo(0,0)}},[i,n,o]))}a(Jo,"useScrollRestoration");function il(e,t){let{capture:r}=t||{};l.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("beforeunload",e,n),()=>{window.removeEventListener("beforeunload",e,n)}},[e,r])}a(il,"useBeforeUnload");function Go(e,t){let{capture:r}=t||{};l.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}a(Go,"usePageHide");function Yo(e,{relative:t}={}){let r=l.useContext(er);$(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Xe("useViewTransitionState"),o=fe(e,{relative:t});if(!r.isTransitioning)return!1;let s=q(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=q(r.nextLocation.pathname,n)||r.nextLocation.pathname;return xe(o.pathname,i)!=null||xe(o.pathname,s)!=null}a(Yo,"useViewTransitionState");var vt=60,qe=3600,Ie=24*qe,bt=7*Ie,kt=30*Ie;function Zo(e){const t=Date.now(),r=new Date(e).getTime(),n=Math.round((t-r)/1e3);return n<vt?"just now":n<qe?`${Math.floor(n/vt)}m ago`:n<Ie?`${Math.floor(n/qe)}h ago`:n<bt?`${Math.floor(n/Ie)}d ago`:n<kt?`${Math.floor(n/bt)}w ago`:`${Math.floor(n/kt)}mo ago`}a(Zo,"timeAgo");var Xo=[{label:"My work",views:[{key:"mine",label:"Mine",surface:"inbox",inboxTab:"mine",hint:"Assigned to you or waiting on you"},{key:"unread",label:"Unread",surface:"inbox",inboxTab:"unread",hint:"Tasks you touched with new activity"},{key:"blocked",label:"Blocked",surface:"inbox",inboxTab:"blocked",hint:"Blocked tasks, grouped by blocker"},{key:"recent",label:"Recent",surface:"inbox",inboxTab:"recent",hint:"Everything you touched lately"},{key:"everything",label:"Everything",surface:"inbox",inboxTab:"all",hint:"Tasks, approvals, failed runs and join requests"}]},{label:"Organization",views:[{key:"all",label:"All tasks",surface:"issues",statuses:[],hint:"Every task in the organization"},{key:"active",label:"Active",surface:"issues",statuses:["todo","in_progress","in_review","blocked"],hint:"Open tasks, running or not"},{key:"backlog",label:"Backlog",surface:"issues",statuses:["backlog"],hint:"Not started yet"},{key:"done",label:"Done",surface:"issues",statuses:["done","cancelled"],hint:"Completed and cancelled"}]}],pr=new Map(Xo.flatMap(e=>e.views.map(t=>[t.key,t]))),hr="mine",es="view",ts="paperclip:tasks:last-view";function rs(e){return typeof e=="string"&&pr.has(e)}a(rs,"isTaskViewKey");function gr(e){return pr.get(e)}a(gr,"taskView");function et(e){return rs(e)?e:null}a(et,"normalizeTaskViewKey");var xt={mine:"mine",unread:"unread",blocked:"blocked",recent:"recent",all:"everything"};function ll(e){return e&&e in xt?xt[e]:hr}a(ll,"taskViewForInboxTab");function ul(){try{return et(window.localStorage.getItem("paperclip:tasks:last-view"))??"mine"}catch{return hr}}a(ul,"loadLastTaskView");function cl(e){try{window.localStorage.setItem(ts,e)}catch{}}a(cl,"saveLastTaskView");var dl=["assignee","workspace","participantAgentId","q"];function ml(e,t,r){const n=et(e);return t&&(!n||gr(n).surface==="inbox")?"all":n??r}a(ml,"resolveInitialTaskView");var yr="from",vr="fromHref",br="paperclip:issue-detail-breadcrumb:";function kr(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.label=="string"&&typeof t.href=="string"}a(kr,"isIssueDetailBreadcrumb");function xr(e){return e==="issues"||e==="inbox"}a(xr,"isIssueDetailSource");function wr(e){if(typeof e!="object"||e===null)return!1;const t=e,r=t.originKind===void 0||typeof t.originKind=="string",n=t.originId===void 0||t.originId===null||typeof t.originId=="string",o=t.blockerAttention===void 0||typeof t.blockerAttention=="object"&&t.blockerAttention!==null;return typeof t.id=="string"&&(t.identifier===null||typeof t.identifier=="string")&&typeof t.title=="string"&&typeof t.status=="string"&&o&&typeof t.priority=="string"&&(t.projectId===null||typeof t.projectId=="string")&&(t.projectName===null||typeof t.projectName=="string")&&r&&n}a(wr,"isIssueDetailHeaderSeed");function ns(e){return{id:e.id,identifier:e.identifier??null,title:e.title,status:e.status,blockerAttention:e.blockerAttention,priority:e.priority,projectId:e.projectId??null,projectName:e.project?.name??null,originKind:e.originKind,originId:e.originId??null}}a(ns,"createIssueDetailHeaderSeed");function Ir(e,t){const r=ns(t);return typeof e!="object"||e===null?{issueDetailHeaderSeed:r}:{...e,issueDetailHeaderSeed:r}}a(Ir,"withIssueDetailHeaderSeed");function as(e){if(typeof e!="object"||e===null)return null;const t=e.issueDetailHeaderSeed;return wr(t)?t:null}a(as,"readIssueDetailHeaderSeed");function os(e){if(!e)return null;const t=new URLSearchParams(e).get(yr);return xr(t)?t:null}a(os,"readIssueDetailSourceFromSearch");function ss(e){if(!e)return null;const t=new URLSearchParams(e).get(vr);return t&&t.startsWith("/")?t:null}a(ss,"readIssueDetailBreadcrumbHrefFromSearch");function is(e){const t=e.slice(e.indexOf("?")+1);if(!e.includes("?"))return!1;const r=new URLSearchParams(t).get(es),n=et(r);return n!==null&&gr(n).surface==="inbox"}a(is,"isInboxBackedTaskViewHref");function Sr(e,t){return xr(e?.issueDetailSource)?e.issueDetailSource:t?t.href.includes("/inbox")||is(t.href)||t.label==="Inbox"?"inbox":t.label==="Tasks"||t.href.includes("/issues")?"issues":null:null}a(Sr,"inferIssueDetailSource");function wt(e){return e==="inbox"?{label:"Inbox",href:"/inbox"}:{label:"Tasks",href:"/issues"}}a(wt,"breadcrumbForSource");function fl(e,t,r){return{issueDetailBreadcrumb:{label:e,href:t},issueDetailSource:r}}a(fl,"createIssueDetailLocationState");function pl(e){return typeof e!="object"||e===null?{issueDetailInboxQuickArchiveArmed:!0}:{...e,issueDetailInboxQuickArchiveArmed:!0}}a(pl,"armIssueDetailInboxQuickArchive");function ls(e){if(typeof window>"u"||!window.sessionStorage)return null;const t=window.sessionStorage.getItem(`${br}${e}`);if(!t)return null;try{const r=JSON.parse(t),n=kr(r.issueDetailBreadcrumb)?r.issueDetailBreadcrumb:null,o=Sr(r,n);if(!n||!o)return null;const s=wr(r.issueDetailHeaderSeed)?r.issueDetailHeaderSeed:void 0;return{issueDetailBreadcrumb:n,issueDetailSource:o,issueDetailInboxQuickArchiveArmed:r.issueDetailInboxQuickArchiveArmed===!0,issueDetailHeaderSeed:s}}catch{return null}}a(ls,"readStoredIssueDetailLocationState");function Rr(e,t){if(typeof e=="object"&&e!==null){const o=e.issueDetailBreadcrumb;if(kr(o)){const s=Sr(e,o);if(!s)return null;const i=as(e)??void 0;return{issueDetailBreadcrumb:o,issueDetailSource:s,issueDetailInboxQuickArchiveArmed:e.issueDetailInboxQuickArchiveArmed===!0,issueDetailHeaderSeed:i}}}const r=os(t),n=ss(t);return r?{issueDetailBreadcrumb:n?{...wt(r),href:n}:wt(r),issueDetailSource:r,issueDetailInboxQuickArchiveArmed:!1}:null}a(Rr,"normalizeIssueDetailLocationState");function hl(e,t,r){if(typeof window>"u"||!window.sessionStorage)return;const n=Rr(t,r);n&&window.sessionStorage.setItem(`${br}${e}`,JSON.stringify(n))}a(hl,"rememberIssueDetailLocationState");function us(e){return`/issues/${e}`}a(us,"createIssueDetailPath");function gl(e){if(!e)return!1;const t=new URLSearchParams(e);return t.has(yr)||t.has(vr)}a(gl,"hasLegacyIssueDetailQuery");function cs(e,t,r){const n=Rr(t,r);return n||(e?ls(e):null)}a(cs,"readIssueDetailLocationState");function yl(e,t,r){return cs(e,t,r)?.issueDetailBreadcrumb??null}a(yl,"readIssueDetailBreadcrumb");var It=class extends Error{static{a(this,"CommentSubmissionUnknownError")}constructor(){super("We couldn’t confirm whether this comment was saved. Review the conversation before starting another draft."),this.name="CommentSubmissionUnknownError"}};function St(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e,r=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;return typeof t.id=="string"&&r.test(t.id)&&typeof t.issueId=="string"&&r.test(t.issueId)&&typeof t.body=="string"}a(St,"hasCommentReceipt");async function Rt(e,t){try{const r=await e;if(!t(r))throw new It;return r}catch(r){throw r instanceof Bt&&r.status<500?r:new It}}a(Rt,"confirmedCommentResponse");function Ct(e){const t=new URLSearchParams;return e?.attention&&t.set("attention",e.attention),e?.status&&t.set("status",e.status),e?.priority&&t.set("priority",e.priority),e?.projectId&&t.set("projectId",e.projectId),e?.parentId&&t.set("parentId",e.parentId),e?.assigneeAgentId&&t.set("assigneeAgentId",e.assigneeAgentId),e?.participantAgentId&&t.set("participantAgentId",e.participantAgentId),e?.assigneeUserId&&t.set("assigneeUserId",e.assigneeUserId),e?.touchedByUserId&&t.set("touchedByUserId",e.touchedByUserId),e?.inboxArchivedByUserId&&t.set("inboxArchivedByUserId",e.inboxArchivedByUserId),e?.unreadForUserId&&t.set("unreadForUserId",e.unreadForUserId),e?.labelId&&t.set("labelId",e.labelId),e?.createdByAgentId&&t.set("createdByAgentId",e.createdByAgentId),e?.createdByUserId&&t.set("createdByUserId",e.createdByUserId),e?.updatedSince&&t.set("updatedSince",e.updatedSince),e?.workspaceId&&t.set("workspaceId",e.workspaceId),e?.executionWorkspaceId&&t.set("executionWorkspaceId",e.executionWorkspaceId),e?.originKind&&t.set("originKind",e.originKind),e?.originKindPrefix&&t.set("originKindPrefix",e.originKindPrefix),e?.originId&&t.set("originId",e.originId),e?.descendantOf&&t.set("descendantOf",e.descendantOf),e?.createdFromIssueId&&t.set("createdFromIssueId",e.createdFromIssueId),e?.includeRoutineExecutions&&t.set("includeRoutineExecutions","true"),e?.includeBlockedBy&&t.set("includeBlockedBy","true"),e?.includeBlockedInboxAttention&&t.set("includeBlockedInboxAttention","true"),e?.includeLiveDescendantSummary&&t.set("includeLiveDescendantSummary","true"),e?.hasPlanDocument!==void 0&&t.set("hasPlanDocument",e.hasPlanDocument?"true":"false"),e?.q&&t.set("q",e.q),e?.limit&&t.set("limit",String(e.limit)),e?.offset!==void 0&&t.set("offset",String(e.offset)),e?.sortField&&t.set("sortField",e.sortField),e?.sortDir&&t.set("sortDir",e.sortDir),e?.afterId&&t.set("afterId",e.afterId),t}a(Ct,"issueListSearchParams");var Z={listAll:a(async(e,t,r)=>{const o=new Map;let s;for(;;){const i=await Z.list(e,{...t,limit:500,sortField:"id",sortDir:"asc",afterId:s},r);for(const u of i)o.set(u.id,u);if(i.length<500)return[...o.values()];s=i[i.length-1].id}},"listAll"),list:a((e,t,r)=>{const n=Ct(t).toString(),o=`/companies/${e}/issues${n?`?${n}`:""}`;return r?d.get(o,r):d.get(o)},"list"),listCompact:a((e,t,r)=>{const n=Ct(t);n.set("view","compact");const o=`/companies/${e}/issues?${n.toString()}`;return r?d.get(o,r):d.get(o)},"listCompact"),count:a((e,t)=>{const r=new URLSearchParams;return r.set("attention",t.attention),t.status&&r.set("status",t.status),t.assigneeAgentId&&r.set("assigneeAgentId",t.assigneeAgentId),t.assigneeUserId&&r.set("assigneeUserId",t.assigneeUserId),t.projectId&&r.set("projectId",t.projectId),t.labelId&&r.set("labelId",t.labelId),t.q&&r.set("q",t.q),d.get(`/companies/${e}/issues/count?${r.toString()}`)},"count"),listLabels:a(e=>d.get(`/companies/${e}/labels`),"listLabels"),createLabel:a((e,t)=>d.post(`/companies/${e}/labels`,t),"createLabel"),deleteLabel:a(e=>d.delete(`/labels/${e}`),"deleteLabel"),get:a((e,t)=>t?d.get(`/issues/${e}`,t):d.get(`/issues/${e}`),"get"),refs:a((e,t)=>d.get(`/companies/${e}/issues/refs?ids=${encodeURIComponent(t.join(","))}`),"refs"),getRunnerGoal:a((e,t)=>{const r=t?`?agentId=${encodeURIComponent(t)}`:"";return d.get(`/issues/${e}/runner-goal${r}`)},"getRunnerGoal"),actOnRunnerGoal:a((e,t)=>d.post(`/issues/${e}/runner-goal/actions`,t),"actOnRunnerGoal"),getModelOverride:a(e=>d.get(`/issues/${e}/model-override`),"getModelOverride"),setModelOverride:a((e,t)=>d.put(`/issues/${e}/model-override`,t),"setModelOverride"),getWatchdog:a(e=>d.get(`/issues/${e}/watchdog`),"getWatchdog"),upsertWatchdog:a((e,t)=>d.put(`/issues/${e}/watchdog`,t),"upsertWatchdog"),deleteWatchdog:a(e=>d.delete(`/issues/${e}/watchdog`),"deleteWatchdog"),markRead:a(e=>d.post(`/issues/${e}/read`,{}),"markRead"),markUnread:a(e=>d.delete(`/issues/${e}/read`),"markUnread"),archiveFromInbox:a(e=>d.post(`/issues/${e}/inbox-archive`,{}),"archiveFromInbox"),unarchiveFromInbox:a(e=>d.delete(`/issues/${e}/inbox-archive`),"unarchiveFromInbox"),setTitle:a((e,t)=>d.put(`/issues/${e}/title`,t),"setTitle"),create:a((e,t)=>d.post(`/companies/${e}/issues`,t),"create"),update:a((e,t)=>{const r=d.patch(`/issues/${e}`,t);return typeof t.comment=="string"?Rt(r,n=>St(n?.comment)):r},"update"),decideStalledReview:a((e,t)=>d.post(`/issues/${e}/stalled-review-decision`,t),"decideStalledReview"),retryWorkspaceExport:a((e,t)=>d.post(`/issues/${e}/recovery-actions/retry-workspace-export`,t),"retryWorkspaceExport"),resolveRecoveryAction:a((e,t)=>d.post(`/issues/${e}/recovery-actions/resolve`,t),"resolveRecoveryAction"),previewTreeControl:a((e,t)=>d.post(`/issues/${e}/tree-control/preview`,t),"previewTreeControl"),createTreeHold:a((e,t)=>d.post(`/issues/${e}/tree-holds`,t),"createTreeHold"),getTreeHold:a((e,t)=>d.get(`/issues/${e}/tree-holds/${t}`),"getTreeHold"),listTreeHolds:a((e,t)=>{const r=new URLSearchParams;t?.status&&r.set("status",t.status),t?.mode&&r.set("mode",t.mode),t?.includeMembers&&r.set("includeMembers","true");const n=r.toString();return d.get(`/issues/${e}/tree-holds${n?`?${n}`:""}`)},"listTreeHolds"),getTreeControlState:a(e=>d.get(`/issues/${e}/tree-control/state`),"getTreeControlState"),releaseTreeHold:a((e,t,r)=>d.post(`/issues/${e}/tree-holds/${t}/release`,r),"releaseTreeHold"),checkMonitorNow:a(e=>d.post(`/issues/${e}/monitor/check-now`,{}),"checkMonitorNow"),retryScheduledRetryNow:a(e=>d.post(`/issues/${e}/scheduled-retry/retry-now`,{}),"retryScheduledRetryNow"),remove:a(e=>d.delete(`/issues/${e}`),"remove"),checkout:a((e,t)=>d.post(`/issues/${e}/checkout`,{agentId:t,expectedStatuses:["todo","backlog","blocked","in_review"]}),"checkout"),release:a(e=>d.post(`/issues/${e}/release`,{}),"release"),listComments:a((e,t)=>{const r=new URLSearchParams;t?.after&&r.set("after",t.after),t?.order&&r.set("order",t.order),t?.limit&&r.set("limit",String(t.limit));const n=r.toString();return d.get(`/issues/${e}/comments${n?`?${n}`:""}`)},"listComments"),getQueuedComments:a(e=>d.get(`/issues/${e}/queued-comments`),"getQueuedComments"),editQueuedComment:a((e,t,r)=>d.patch(`/issues/${e}/queued-comments/${t}`,r),"editQueuedComment"),reorderQueuedComments:a((e,t)=>d.put(`/issues/${e}/queued-comments/order`,t),"reorderQueuedComments"),interruptQueuedComments:a((e,t)=>d.post(`/issues/${e}/queued-comments/interrupt`,t),"interruptQueuedComments"),interruptLatestQueuedComments:a(async(e,t)=>{const r=await Z.getQueuedComments(e);if(!r.queueId||r.targetRunId&&r.targetRunId!==t)throw new Error("The queued messages changed. Refresh and try again.");return Z.interruptQueuedComments(e,{queueId:r.queueId,revision:r.revision,targetRunId:r.targetRunId})},"interruptLatestQueuedComments"),steerQueuedComment:a((e,t,r)=>d.post(`/issues/${e}/queued-comments/${t}/steer`,r),"steerQueuedComment"),discardQueuedComment:a((e,t,r)=>d.delete(`/issues/${e}/queued-comments/${t}`,r),"discardQueuedComment"),listInteractions:a(e=>d.get(`/issues/${e}/interactions`),"listInteractions"),listAcceptedPlanDecompositions:a(e=>d.get(`/issues/${e}/accepted-plan-decompositions`),"listAcceptedPlanDecompositions"),createInteraction:a((e,t)=>d.post(`/issues/${e}/interactions`,t),"createInteraction"),acceptInteraction:a((e,t,r)=>{const{note:n,...o}=r??{};return d.post(`/issues/${e}/interactions/${t}/accept`,n?.trim()?{...o,note:n}:o)},"acceptInteraction"),rejectInteraction:a((e,t,r,n)=>d.post(`/issues/${e}/interactions/${t}/reject`,{...r?{reason:r}:{},...n?.trim()?{note:n}:{}}),"rejectInteraction"),cancelInteraction:a((e,t,r)=>d.post(`/issues/${e}/interactions/${t}/cancel`,r?{reason:r}:{}),"cancelInteraction"),skipInteraction:a((e,t,r)=>d.post(`/issues/${e}/interactions/${t}/skip`,r?{reason:r}:{}),"skipInteraction"),respondToInteraction:a((e,t,r)=>d.post(`/issues/${e}/interactions/${t}/respond`,r),"respondToInteraction"),submitInteractionVerdicts:a((e,t,r)=>d.post(`/issues/${e}/interactions/${t}/verdicts`,{verdicts:r}),"submitInteractionVerdicts"),getComment:a((e,t)=>d.get(`/issues/${e}/comments/${t}`),"getComment"),listFeedbackVotes:a(e=>d.get(`/issues/${e}/feedback-votes`),"listFeedbackVotes"),getCostSummary:a((e,t={})=>{const r=t.excludeRoot?"?excludeRoot=true":"";return d.get(`/issues/${e}/cost-summary${r}`)},"getCostSummary"),listFeedbackTraces:a((e,t)=>{const r=new URLSearchParams;for(const[o,s]of Object.entries(t??{}))s!==void 0&&r.set(o,String(s));const n=r.toString();return d.get(`/issues/${e}/feedback-traces${n?`?${n}`:""}`)},"listFeedbackTraces"),upsertFeedbackVote:a((e,t)=>d.post(`/issues/${e}/feedback-votes`,t),"upsertFeedbackVote"),addComment:a((e,t,r,n,o,s,i)=>Rt(d.post(`/issues/${e}/comments`,{body:t,...s?{clientRequestId:s}:{},...r===void 0?{}:{reopen:r},...n===void 0?{}:{interrupt:n},...o?.length?{attachmentIds:o}:{},...i===void 0?{}:{deliver:i}}),St),"addComment"),cancelComment:a((e,t)=>d.delete(`/issues/${e}/comments/${t}?mode=cancel`),"cancelComment"),deleteComment:a((e,t)=>d.delete(`/issues/${e}/comments/${t}`),"deleteComment"),listDocuments:a((e,t)=>d.get(`/issues/${e}/documents${t?.includeSystem?"?includeSystem=true":""}`),"listDocuments"),getDocument:a((e,t)=>d.get(`/issues/${e}/documents/${encodeURIComponent(t)}`),"getDocument"),getDocumentPdf:a((e,t)=>d.getBlob(`/issues/${e}/documents/${encodeURIComponent(t)}/pdf`),"getDocumentPdf"),upsertDocument:a((e,t,r)=>d.put(`/issues/${e}/documents/${encodeURIComponent(t)}`,r),"upsertDocument"),lockDocument:a((e,t)=>d.post(`/issues/${e}/documents/${encodeURIComponent(t)}/lock`,{}),"lockDocument"),unlockDocument:a((e,t)=>d.post(`/issues/${e}/documents/${encodeURIComponent(t)}/unlock`,{}),"unlockDocument"),listDocumentRevisions:a((e,t)=>d.get(`/issues/${e}/documents/${encodeURIComponent(t)}/revisions`),"listDocumentRevisions"),restoreDocumentRevision:a((e,t,r)=>d.post(`/issues/${e}/documents/${encodeURIComponent(t)}/revisions/${r}/restore`,{}),"restoreDocumentRevision"),deleteDocument:a((e,t)=>d.delete(`/issues/${e}/documents/${encodeURIComponent(t)}`),"deleteDocument"),listAttachments:a(e=>d.get(`/issues/${e}/attachments`),"listAttachments"),uploadAttachment:a((e,t,r,n)=>{const o=qn(r);if(o)return Promise.reject(o);const s=new FormData;return s.append("file",r),n&&s.append("issueCommentId",n),d.postForm(`/companies/${e}/issues/${t}/attachments`,s)},"uploadAttachment"),deleteAttachment:a(e=>d.delete(`/attachments/${e}`),"deleteAttachment"),privacyConstraints:a(e=>d.get(`/issues/${e}/privacy-constraints`),"privacyConstraints"),listAccessGrants:a((e,t)=>t?d.get(`/issues/${e}/access-grants`,t):d.get(`/issues/${e}/access-grants`),"listAccessGrants"),createAccessGrant:a((e,t)=>d.post(`/issues/${e}/access-grants`,t),"createAccessGrant"),revokeAccessGrant:a((e,t)=>d.post(`/issues/${e}/access-grants/${t}/revoke`,{}),"revokeAccessGrant"),setVisibility:a((e,t)=>d.patch(`/issues/${e}`,{visibility:t}),"setVisibility"),listApprovals:a(e=>d.get(`/issues/${e}/approvals`),"listApprovals"),linkApproval:a((e,t)=>d.post(`/issues/${e}/approvals`,{approvalId:t}),"linkApproval"),unlinkApproval:a((e,t)=>d.delete(`/issues/${e}/approvals/${t}`),"unlinkApproval"),listWorkProducts:a((e,t)=>{const r=`/issues/${e}/work-products${t?.refreshPullRequests?"?refreshPullRequests=true":""}`;return t?.fresh&&Hn(r),d.get(r,{signal:t?.signal})},"listWorkProducts"),ensureWorkProductReviewDocument:a((e,t)=>d.post(`/issues/${e}/work-products/${t}/review-document`,{}),"ensureWorkProductReviewDocument"),createWorkProduct:a((e,t)=>d.post(`/issues/${e}/work-products`,t),"createWorkProduct"),updateWorkProduct:a((e,t)=>d.patch(`/work-products/${e}`,t),"updateWorkProduct"),deleteWorkProduct:a(e=>d.delete(`/work-products/${e}`),"deleteWorkProduct")};function ee(e){return new Date(e).getTime()}a(ee,"toTimestamp");function ds(){const e=globalThis.crypto?.randomUUID?.();return e?`optimistic-${e}`:`optimistic-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}a(ds,"createOptimisticCommentId");function tt(e){return[...e].sort((t,r)=>{const n=ee(t.createdAt)-ee(r.createdAt);return n!==0?n:t.id.localeCompare(r.id)})}a(tt,"sortIssueComments");function Et(e){return tt(e).reverse()}a(Et,"sortIssueCommentsDesc");function vl(e){const t=new Date,r=ds();return{id:r,clientId:r,companyId:e.companyId,issueId:e.issueId,authorType:"user",authorAgentId:null,authorUserId:e.authorUserId,body:e.body,presentation:null,metadata:null,clientStatus:e.clientStatus??"pending",queueTargetRunId:e.queueTargetRunId??null,createdAt:t,updatedAt:t}}a(vl,"createOptimisticIssueComment");function bl(e){return e.runId||e.interruptedRunId||e.comment.id&&(e.comment.id===e.activeRunWakeCommentId||e.comment.id===e.activeRunCommentId)||e.comment.authorAgentId&&e.activeRunAgentId&&e.comment.authorAgentId===e.activeRunAgentId?!1:e.comment.clientStatus==="queued"?!0:e.activeRunStartedAt?ee(e.comment.createdAt)>=ee(e.activeRunStartedAt):!1}a(bl,"isQueuedIssueComment");function kl(e,t){const r=t.queuedTargetRunId??null;return!r||!t.targetRunIsLive||t.runningRunId&&t.runningRunId!==r?e:{...e,clientStatus:"queued",queueState:"queued",queueTargetRunId:r}}a(kl,"applyLocalQueuedIssueCommentState");function xl(e,t){const r=e??[],n=[...r],o=new Set(n.map(i=>i.id)),s=new Set;for(const i of t){if(o.has(i.id))continue;const u=r.find(c=>!s.has(c.id)&&c.issueId===i.issueId&&c.authorType===i.authorType&&c.authorUserId===i.authorUserId&&c.body===i.body&&Math.abs(ee(c.createdAt)-ee(i.createdAt))<=6e4);if(u){s.add(u.id);const c={...u,clientId:i.clientId};n[n.findIndex(m=>m.id===u.id)]=c;continue}n.push(i)}return tt(n)}a(xl,"mergeIssueComments");function wl(e,t){const r=e.findIndex(n=>n.clientId===t);return r===-1?{comments:e,comment:null}:{comments:e.filter(n=>n.clientId!==t),comment:e[r]??null}}a(wl,"takeOptimisticIssueComment");function Il(e){return tt((e??[]).flatMap(t=>t))}a(Il,"flattenIssueCommentPages");function ms(e,t){if(!(!e||e.length<t))return e[e.length-1]?.id}a(ms,"getNextIssueCommentPageParam");function $t(e,t){if(!(!e||e.length<t))return e[e.length-1]?.id}a($t,"getNextPageCursor");async function Sl(e){const t=(e.pages??[]).map(i=>[...i]),r=e.pageParams?[...e.pageParams].slice(0,t.length):t.map(()=>null);for(;r.length<t.length;)r.push(null);if(e.pageSize<=0)return{pages:t,pageParams:r};let n=$t(t[t.length-1],e.pageSize);const o=Math.max(0,e.maxPages??Number.POSITIVE_INFINITY),s=new Set;for(;n&&!s.has(n)&&s.size<o;){s.add(n);const i=[...await e.fetchPage(n)];t.push(i),r.push(n),n=$t(i,e.pageSize)}return{pages:t,pageParams:r}}a(Sl,"loadRemainingIssueCommentPages");function Rl(e){return e.activeDetailTab!=="chat"||!e.hasOlderComments||e.initialPageLoading||e.olderPageLoading||e.loadedCommentCount===0?!1:e.loadedCommentCount<e.autoLoadLimit}a(Rl,"shouldAutoloadOlderIssueComments");function Cl(e,t){if(!e)return e;const r={...e};return t.reopen===!0&&(e.status==="done"||e.status==="cancelled"||e.status==="blocked")&&(r.status="todo"),t.reassignment&&(r.assigneeAgentId=t.reassignment.assigneeAgentId,r.assigneeUserId=t.reassignment.assigneeUserId),r}a(Cl,"applyOptimisticIssueCommentUpdate");function fs(e,t){if(!e)return e;const r={...e,updatedAt:new Date},n=a(s=>Object.prototype.hasOwnProperty.call(t,s),"hasOwn"),o=a(s=>{n(s)&&(r[s]=t[s])},"assign");if(o("status"),o("priority"),o("assigneeAgentId"),o("assigneeUserId"),o("projectId"),o("parentId"),o("projectWorkspaceId"),o("executionWorkspaceId"),o("executionWorkspacePreference"),o("executionWorkspaceSettings"),o("hiddenAt"),n("labelIds")&&Array.isArray(t.labelIds)){const s=t.labelIds.filter(i=>typeof i=="string");r.labelIds=s,e.labels&&(r.labels=e.labels.filter(i=>s.includes(i.id)))}if(n("blockedByIssueIds")&&Array.isArray(t.blockedByIssueIds)&&e.blockedBy){const s=new Set(t.blockedByIssueIds.filter(i=>typeof i=="string"));r.blockedBy=e.blockedBy.filter(i=>s.has(i.id))}return n("projectId")&&(r.project=e.project?.id===r.projectId?e.project:null),n("parentId")&&(r.ancestors=void 0),n("executionWorkspaceId")&&(r.currentExecutionWorkspace=e.currentExecutionWorkspace?.id===r.executionWorkspaceId?e.currentExecutionWorkspace:null),r}a(fs,"applyOptimisticIssueFieldUpdate");function ps(e,t){const r=t instanceof Set?t:new Set(t);return r.has(e.id)||!!e.identifier&&r.has(e.identifier)}a(ps,"matchesIssueRef$1");function El(e,t,r){if(!e)return e;let n=!1;const o=e.map(s=>ps(s,t)?(n=!0,fs(s,r)??s):s);return n?o:e}a(El,"applyOptimisticIssueFieldUpdateToCollection");function $l(e,t){if(!e||e.length===0)return[[t]];const r=e.map(n=>[...n]);for(let n=0;n<r.length;n+=1){const o=r[n].findIndex(s=>s.id===t.id);if(o!==-1)return r[n][o]=t,r[n]=Et(r[n]),r}return r[0]=Et([...r[0],t]),r}a($l,"upsertIssueCommentInPages");function _l(e,t){return!e||e.length===0?[]:e.map(r=>r.filter(n=>n.id!==t)).filter(r=>r.length>0)}a(_l,"removeIssueCommentFromPages");var hs=["issues","detail"],Cr=6e4,gs=3e4;function le(e){return typeof e=="string"&&e.length>0}a(le,"isNonEmptyString");function Er(e,t){const r=new Set;return le(e)&&r.add(e),le(t?.id)&&r.add(t.id),le(t?.identifier)&&r.add(t.identifier),Array.from(r)}a(Er,"collectIssueRefs");function ys(e,t){const r=t instanceof Set?t:new Set(t);return r.has(e.id)||!!e.identifier&&r.has(e.identifier)}a(ys,"matchesIssueRef");function Se(e){if(typeof e!="object"||e===null)return!1;const t=e;return le(t.id)&&le(t.companyId)&&typeof t.title=="string"&&typeof t.status=="string"&&typeof t.workMode=="string"&&typeof t.priority=="string"&&(t.projectId===null||typeof t.projectId=="string")&&(t.parentId===null||typeof t.parentId=="string")&&(t.identifier===null||typeof t.identifier=="string")&&(t.description===null||typeof t.description=="string")&&(t.assigneeAgentId===null||typeof t.assigneeAgentId=="string")&&(t.assigneeUserId===null||typeof t.assigneeUserId=="string")&&(t.executionRunId===null||typeof t.executionRunId=="string")&&(t.issueNumber===null||typeof t.issueNumber=="number")&&typeof t.requestDepth=="number"&&t.createdAt!=null&&t.updatedAt!=null}a(Se,"isCompleteIssueSnapshot");function _t(e,t){return e?{...e,...t}:t}a(_t,"mergeIssueSnapshots");function $r(e,t,r){const n=Er(t,r);for(const o of n){const s=e.getQueryData(de.issues.detail(o));if(Se(s))return s}return e.getQueriesData({queryKey:hs}).map(([,o])=>o).find(o=>Se(o)&&ys(o,n))}a($r,"getCachedIssueDetail");function _r(e,t,r){if(!Se(t))return t;const n=Er(r?.issueRef,t),o=_t($r(e,r?.issueRef,t),t);for(const s of n)e.setQueryData(de.issues.detail(s),i=>_t(i,o));return o}a(_r,"seedIssueDetailCache");async function Ar(e,t,r){return _r(e,r?await Z.get(t,r):await Z.get(t),{issueRef:t})}a(Ar,"fetchIssueDetail");function vs(e,t,r){return{queryKey:de.issues.detail(t),queryFn:a(({signal:n})=>Ar(e,t,{signal:n}),"queryFn"),placeholderData:$r(e,t,r?.placeholderIssue??void 0)}}a(vs,"getIssueDetailQueryOptions");function bs(e,t,r){return Se(r?.issue)&&_r(e,r.issue,{issueRef:t}),e.prefetchQuery({queryKey:de.issues.detail(t),queryFn:a(()=>Ar(e,t),"queryFn"),staleTime:Cr})}a(bs,"prefetchIssueDetail");function ks(e,t){return e.prefetchInfiniteQuery({queryKey:de.issues.comments(t),queryFn:a(({pageParam:r})=>Z.listComments(t,{order:"desc",limit:50,...r?{after:r}:{}}),"queryFn"),initialPageParam:null,getNextPageParam:a(r=>ms(r,50),"getNextPageParam"),staleTime:gs,pages:1})}a(ks,"prefetchIssueComments");function xs(e,t,r){return Promise.all([bs(e,t,r),ks(e,r?.issue?.id??t)])}a(xs,"prefetchIssueDetailForNavigation");var S=jt(jn(),1);function ws({...e}){return(0,S.jsx)(Gn,{"data-slot":"popover",...e})}a(ws,"Popover");function Is({...e}){return(0,S.jsx)(ea,{"data-slot":"popover-trigger",...e})}a(Is,"PopoverTrigger");function Ss({className:e,align:t="center",sideOffset:r=4,disablePortal:n=!1,...o}){const s=(0,S.jsx)(Wn,{"data-slot":"popover-content",align:t,sideOffset:r,className:K("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o});return n?s:(0,S.jsx)(Vn,{children:s})}a(Ss,"PopoverContent");function Al({...e}){return(0,S.jsx)(Zn,{"data-slot":"popover-anchor",...e})}a(Al,"PopoverAnchor");function Dl({className:e,...t}){return(0,S.jsx)("div",{"data-slot":"popover-title",className:K("font-medium",e),...t})}a(Dl,"PopoverTitle");function Pl({className:e,...t}){return(0,S.jsx)("p",{"data-slot":"popover-description",className:K("text-muted-foreground",e),...t})}a(Pl,"PopoverDescription");var Dr={name:"atom",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",key:"1l2ple"}],["path",{d:"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",key:"1wam0m"}]]};Dr.node;var Rs=k(Dr),Pr={name:"ban",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]};Pr.node;var Cs=k(Pr),Lr={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};Lr.node;var Es=k(Lr),Mr={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};Mr.node;var $s=k(Mr),Tr={name:"briefcase",size:24,node:[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]};Tr.node;var _s=k(Tr),Ur={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};Ur.node;var As=k(Ur),Or={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};Or.node;var Ds=k(Or),jr={name:"circle-dashed",size:24,node:[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]};jr.node;var Br=k(jr),Nr={name:"circle-dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};Nr.node;var Ps=k(Nr),zr={name:"circle-minus",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],aliases:["minus-circle"]};zr.node;var At=k(zr),Fr={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};Fr.node;var Dt=k(Fr),qr={name:"code",size:24,node:[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]};qr.node;var Ls=k(qr),Hr={name:"cog",size:24,node:[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]};Hr.node;var Ms=k(Hr),Wr={name:"compass",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]};Wr.node;var Ts=k(Wr),Vr={name:"cpu",size:24,node:[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]};Vr.node;var Us=k(Vr),Kr={name:"crown",size:24,node:[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]};Kr.node;var Os=k(Kr),Qr={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};Qr.node;var js=k(Qr),Jr={name:"file-code",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};Jr.node;var Bs=k(Jr),Gr={name:"flame",size:24,node:[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]]};Gr.node;var Ns=k(Gr),Yr={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};Yr.node;var zs=k(Yr),Zr={name:"gem",size:24,node:[["path",{d:"M10.5 3 8 9l4 13 4-13-2.5-6",key:"b3dvk1"}],["path",{d:"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z",key:"7w4byz"}],["path",{d:"M2 9h20",key:"16fsjt"}]]};Zr.node;var Fs=k(Zr),Xr={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};Xr.node;var qs=k(Xr),en={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};en.node;var Hs=k(en),tn={name:"hammer",size:24,node:[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]]};tn.node;var Ws=k(tn),rn={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};rn.node;var Vs=k(rn),nn={name:"hexagon",size:24,node:[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]]};nn.node;var Ks=k(nn),an={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};an.node;var Qs=k(an),on={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};on.node;var Js=k(on),sn={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};sn.node;var Gs=k(sn),ln={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};ln.node;var Ys=k(ln),un={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};un.node;var Zs=k(un),cn={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};cn.node;var Xs=k(cn),dn={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};dn.node;var Ll=k(dn),mn={name:"puzzle",size:24,node:[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]};mn.node;var ei=k(mn),fn={name:"radar",size:24,node:[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]};fn.node;var ti=k(fn),pn={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};pn.node;var ri=k(pn),hn={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};hn.node;var ni=k(hn),gn={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};gn.node;var ai=k(gn),yn={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};yn.node;var oi=k(yn),vn={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};vn.node;var si=k(vn),bn={name:"target",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};bn.node;var ii=k(bn),kn={name:"telescope",size:24,node:[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]]};kn.node;var li=k(kn),xn={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};xn.node;var ui=k(xn),wn={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};wn.node;var ci=k(wn),In={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};In.node;var di=k(In),Ml={backlog:"text-muted-foreground border-muted-foreground",todo:"text-amber-600 border-amber-600 dark:text-amber-400 dark:border-amber-400",in_progress:"text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400",in_review:"text-violet-600 border-violet-600 dark:text-violet-400 dark:border-violet-400",done:"text-green-600 border-green-600 dark:text-green-400 dark:border-green-400",cancelled:"text-neutral-500 border-neutral-500",blocked:"text-red-600 border-red-600 dark:text-red-400 dark:border-red-400"},Tl="text-muted-foreground border-muted-foreground",Ul={backlog:"text-muted-foreground",todo:"text-amber-600 dark:text-amber-400",in_progress:"text-blue-600 dark:text-blue-400",in_review:"text-violet-600 dark:text-violet-400",done:"text-green-600 dark:text-green-400",cancelled:"text-neutral-500",blocked:"text-red-600 dark:text-red-400"},Ol="text-muted-foreground",ve={gray:"bg-[#F5F3F0] text-[#52585D] border-[#A8AEB2] dark:bg-[#6e696024] dark:text-[#9A958A] dark:border-[#9e958a73]",blue:"bg-[#DBEAFE] text-[#1D4ED8] border-[#2563EB] dark:bg-[#2563eb2e] dark:text-[#2563EB] dark:border-[#2563eb73]",amber:"bg-[#FEF3C7] text-[#B45309] border-[#F59E0B] dark:bg-[#f59e0b24] dark:text-[#F59E0B] dark:border-[#f59e0b73]",green:"bg-[#DCFCE7] text-[#188A3C] border-[#22C55E] dark:bg-[#22c55e1f] dark:text-[#22C55E] dark:border-[#22c55e73]",violet:"bg-[#EDE9FE] text-[#5B21B6] border-[#7C3AED] dark:bg-[#7c3aed2e] dark:text-[#7C3AED] dark:border-[#7c3aed73]",red:"bg-[#FEE2E2] text-[#991B1B] border-[#DC2626] dark:bg-[#dc26262e] dark:text-[#DC2626] dark:border-[#dc262673]"},jl={active:`border ${ve.green}`,running:`border ${ve.blue}`,scheduled_retry:"bg-sky-100 text-sky-700 dark:bg-sky-900/50 dark:text-sky-300",paused:`border ${ve.amber}`,idle:`border ${ve.gray}`,archived:"bg-muted text-muted-foreground",planned:"bg-muted text-muted-foreground",achieved:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",completed:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",failed:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",timed_out:"bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",succeeded:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",ok:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",warning:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",error:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",info:"bg-sky-100 text-sky-700 dark:bg-sky-900/50 dark:text-sky-300",terminated:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",pending:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",queued:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",pending_approval:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",revision_requested:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",approved:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",rejected:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",draft:"bg-muted text-muted-foreground",backlog:"bg-muted text-muted-foreground",todo:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",in_progress:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",in_review:"bg-violet-100 text-violet-700 dark:bg-violet-900/50 dark:text-violet-300",blocked:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",done:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",cancelled:"bg-muted text-muted-foreground",allowed:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",denied:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",block:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300","require-approval":"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",redacted:"bg-violet-100 text-violet-700 dark:bg-violet-900/50 dark:text-violet-300","rate-limit":"bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",deferred:"bg-sky-100 text-sky-700 dark:bg-sky-900/50 dark:text-sky-300",hidden:"bg-muted text-muted-foreground",quarantined:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300","runtime-error":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",healthy:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",degraded:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",unchecked:"bg-muted text-muted-foreground"},Bl="bg-muted text-muted-foreground",Nl="text-[#1D4ED8] dark:text-[#2563EB]",zl="bg-blue-500/10 border-blue-500/30 text-blue-600 dark:text-blue-400",Fl={info:"border-[#2563EB]/40 bg-[#DBEAFE]/50 text-[#1D4ED8] dark:border-[#2563eb59] dark:bg-[#2563eb14] dark:text-[#93C5FD]",warning:"border-[#F59E0B]/50 bg-[#FEF3C7]/60 text-[#B45309] dark:border-[#f59e0b59] dark:bg-[#f59e0b12] dark:text-[#F59E0B]",danger:"border-destructive/40 bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300"},ql={idle:"--status-agent-idle",active:"--status-agent-idle",running:"--status-agent-running",paused:"--status-agent-paused",error:"--status-agent-error"},Hl="--status-agent-idle",Wl={idle:"--status-task-backlog",backlog:"--status-task-backlog",todo:"--status-task-todo",in_progress:"--status-task-in_progress",in_review:"--status-task-in_review",done:"--status-task-done",blocked:"--status-task-blocked",cancelled:"--status-task-cancelled"},Vl="--status-task-backlog",mi={idle:"--status-task-icon-backlog",backlog:"--status-task-icon-backlog",todo:"--status-task-icon-todo",in_progress:"--status-task-icon-in_progress",in_review:"--status-task-icon-in_review",done:"--status-task-icon-done",blocked:"--status-task-icon-blocked",cancelled:"--status-task-icon-cancelled",in_queue:"--status-task-icon-in_queue"};var Kl={running:"bg-blue-400 animate-pulse",active:"bg-green-400",paused:"bg-yellow-400",idle:"bg-yellow-400",pending_approval:"bg-amber-400",error:"bg-red-400",archived:"bg-neutral-400"},Ql="bg-neutral-400",Jl={critical:"text-red-600 dark:text-red-400",high:"text-orange-600 dark:text-orange-400",medium:"text-yellow-600 dark:text-yellow-400",low:"text-blue-600 dark:text-blue-400"},Gl="text-yellow-600 dark:text-yellow-400",Yl={unknown:"text-muted-foreground border-muted-foreground",open:"text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400",waiting:"text-amber-600 border-amber-600 dark:text-amber-400 dark:border-amber-400",running:"text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400",succeeded:"text-green-600 border-green-600 dark:text-green-400 dark:border-green-400",merged:"text-violet-600 border-violet-600 dark:text-violet-400 dark:border-violet-400",failed:"text-red-600 border-red-600 dark:text-red-400 dark:border-red-400",blocked:"text-red-600 border-red-600 dark:text-red-400 dark:border-red-400",closed:"text-neutral-500 border-neutral-500",archived:"text-neutral-500 border-neutral-500",auth_required:"text-amber-600 border-amber-600 dark:text-amber-400 dark:border-amber-400",unreachable:"text-red-600 border-red-600 dark:text-red-400 dark:border-red-400"},Zl="text-muted-foreground border-muted-foreground",Xl={unknown:"bg-muted text-muted-foreground",open:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",waiting:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",running:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",succeeded:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",failed:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",blocked:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",closed:"bg-muted text-muted-foreground",archived:"bg-muted text-muted-foreground",auth_required:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",unreachable:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300"},eu="bg-muted text-muted-foreground",tu={unknown:"",fresh:"",stale:"opacity-70 [border-style:dashed]",auth_required:"[border-style:dashed]",unreachable:"[border-style:dashed]"},fi={sm:14,md:16,lg:20},pi=k("TaskProgressSpinner",[["circle",{cx:"12",cy:"12",r:"10",pathLength:"100",strokeDasharray:"80 20",key:"progress"}]]),hi={idle:Dt,backlog:Br,todo:Dt,in_progress:pi,in_review:Ps,done:Ds,blocked:At,cancelled:Cs,in_queue:At},gi=Br;function yi({status:e,size:t="md",className:r,title:n}){const o=fi[t],s=hi[e]??gi,i=mi[e]??"--status-task-icon-backlog",u=n?{role:"img","aria-label":n}:{"aria-hidden":!0};return(0,S.jsx)(s,{size:o,className:K("inline-block shrink-0 align-middle",e==="in_progress"&&"motion-safe:animate-spin",r),style:{color:`var(${i})`},...u,children:n?(0,S.jsx)("title",{children:n}):null})}a(yi,"StatusGlyph");var Pt={folder:zs,rocket:ri,code:Ls,terminal:ui,database:js,globe:Hs,package:Xs,boxes:Xn,box:Es,layers:Qs,briefcase:_s,compass:Ts,target:ii,flame:Ns,zap:di,star:si,bug:As,wrench:ci,hammer:Ws,lightbulb:Js,sparkles:oi,shield:ai,lock:Gs,search:ni,cog:Ms,brain:$s,cpu:Us,"git-branch":qs,"file-code":Bs,puzzle:ei,gem:Fs,atom:Rs,heart:Vs,mail:Ys,"message-square":Zs,crown:Os,radar:ti,telescope:li,hexagon:Ks},vi="folder";function bi(e){return e&&Bn.includes(e)?Pt[e]:Pt[vi]}a(bi,"getProjectIcon");var ki={xs:{box:"h-4 w-4 rounded-sm",icon:"h-2.5 w-2.5"},sm:{box:"h-6 w-6 rounded-md",icon:"h-3.5 w-3.5"},md:{box:"h-7 w-7 rounded-lg",icon:"h-4 w-4"},lg:{box:"h-9 w-9 rounded-lg",icon:"h-5 w-5"}};function xi({color:e,icon:t,size:r="md",className:n}){const o=ki[r],s=!!e,i=bi(t);return(0,S.jsx)("span",{"aria-hidden":!0,className:K("inline-flex shrink-0 items-center justify-center",o.box,s?"text-white":"bg-muted text-muted-foreground",n),style:s?{backgroundColor:e??void 0}:void 0,children:(0,S.jsx)(i,{className:o.icon})})}a(xi,"ProjectTile");var ue=null,He=new Set;function Sn(){for(const e of He)e()}a(Sn,"emitQuicklookChange");function Lt(e){ue!==e&&(ue=e,Sn())}a(Lt,"openQuicklookId");function Mt(e){ue===e&&(ue=null,Sn())}a(Mt,"closeQuicklookId");function wi(e){return He.add(e),()=>{He.delete(e)}}a(wi,"subscribeQuicklook");function Ii(e){return l.useSyncExternalStore(wi,()=>ue===e,()=>!1)}a(Ii,"useIsQuicklookOpen");var Si=120,Ri=13,Ci="w-72 p-3";function Ei(e="start"){return e==="start"?-13:e==="end"?Ri:0}a(Ei,"quicklookAlignOffset");function $i(e){if(!e)return null;const t=e.replace(/!\[[^\]]*]\([^)]+\)/g," ").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[#>*_`~-]+/g," ").replace(/\s+/g," ").trim();return t?t.length>180?`${t.slice(0,177).trimEnd()}...`:t:null}a($i,"summarizeIssueDescription");function _i({className:e}){return(0,S.jsx)("span",{className:K("text-xs",e),"aria-hidden":!0,children:"·"})}a(_i,"QuicklookSeparator");function Ai(e){const t=e.replace(/_/g," ");return t.charAt(0).toUpperCase()+t.slice(1)}a(Ai,"statusLabel");function Di({issue:e,linkTo:t,linkState:r,compact:n=!1}){const o=(0,l.useMemo)(()=>$i(e.description),[e.description]),s=e.project?.name;return(0,S.jsxs)("div",{className:K("space-y-2",n&&"space-y-1.5"),children:[(0,S.jsxs)("div",{className:"flex items-center gap-1",children:[(0,S.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[(0,S.jsx)(yi,{status:e.status,size:"md",title:Ai(e.status)}),(0,S.jsx)("span",{className:"shrink-0 font-mono text-(length:--text-micro) text-muted-foreground",children:e.identifier??e.id.slice(0,8)}),s?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(_i,{className:"shrink-0 text-muted-foreground"}),(0,S.jsxs)("span",{className:"flex min-w-0 max-w-(--sz-12rem) flex-1 items-center gap-1 text-(length:--text-micro) text-muted-foreground",title:s,"data-testid":"quicklook-project",children:[(0,S.jsx)(xi,{size:"xs"}),(0,S.jsx)("span",{className:"truncate",children:s})]})]}):null]}),(0,S.jsx)("span",{className:"shrink-0 text-(length:--text-micro) text-muted-foreground",children:Zo(new Date(e.updatedAt))})]}),(0,S.jsx)(pe,{to:t,state:r??Ir(null,e),className:"block text-sm font-medium leading-snug hover:underline line-clamp-2",children:e.title}),o?(0,S.jsx)("p",{className:"text-xs leading-5 text-muted-foreground [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:4] overflow-hidden",children:o}):null]})}a(Di,"IssueQuicklookCard");var Pi=l.forwardRef(a(function({issuePathId:t,to:r,children:n,className:o,state:s,disableIssueQuicklook:i=!1,issuePrefetch:u=null,issueQuicklookSide:c="top",issueQuicklookAlign:m="start",onClick:p,onClickCapture:f,onMouseEnter:g,onFocus:b,onBlur:v,onTouchStart:y,...h},x){const w=zn(),I=l.useMemo(()=>Symbol("issue-quicklook"),[]),_=Ii(I),C=l.useRef(null),A=l.useRef(null),L=l.useRef(null),j=l.useCallback(E=>{A.current=E,typeof x=="function"?x(E):x&&(x.current=E)},[x]),D=l.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null)},[]),N=l.useCallback(()=>{D(),Lt(I)},[D,I]),G=l.useCallback(()=>{D(),C.current=setTimeout(()=>{C.current=null,Lt(I)},Si)},[D,I]),U=l.useCallback(()=>{D(),Mt(I)},[D,I]);l.useEffect(()=>()=>{D(),Mt(I)},[D,I]),l.useEffect(()=>{if(!_)return;const E=12,at=a((V,se,Y)=>{if(!V)return!1;const W=V.getBoundingClientRect();return se>=W.left-E&&se<=W.right+E&&Y>=W.top-E&&Y<=W.bottom+E},"nearBox"),Un=a((V,se)=>{const Y=A.current,W=L.current;if(Y?.matches(":hover")||W?.matches(":hover")||at(Y,V,se)||at(W,V,se))return!0;const Pe=document.activeElement;return Y===Pe||!!W&&!!Pe&&W.contains(Pe)},"stillEngaged"),ot=a(V=>{Un(V.clientX,V.clientY)||U()},"onPointerMove");return document.addEventListener("pointermove",ot,{passive:!0}),()=>document.removeEventListener("pointermove",ot)},[_,U]);const H=u?Ir(s,u):s,{data:z,isLoading:F}=Kn({...vs(w,t,{placeholderIssue:u??void 0}),enabled:_,staleTime:Cr}),Tn=us(t),oe=l.useCallback(()=>{xs(w,t,{issue:u})},[t,u,w]),nt=(0,S.jsx)(pe,{ref:j,to:r,state:H,className:o,onMouseEnter:a(E=>{oe(),g?.(E)},"onMouseEnter"),onFocus:a(E=>{oe(),N(),b?.(E)},"onFocus"),onBlur:a(E=>{setTimeout(()=>U(),0),v?.(E)},"onBlur"),onTouchStart:a(E=>{oe(),y?.(E)},"onTouchStart"),onClickCapture:a(E=>{oe(),f?.(E)},"onClickCapture"),onClick:a(E=>{U(),p?.(E)},"onClick"),...h,children:n});return i?nt:(0,S.jsxs)(ws,{open:_,onOpenChange:a(E=>E?N():U(),"onOpenChange"),children:[(0,S.jsx)(Is,{asChild:!0,onMouseEnter:a(()=>{oe(),G()},"onMouseEnter"),onMouseLeave:U,children:nt}),(0,S.jsx)(Ss,{ref:L,"data-quicklook":!0,className:Ci,side:c,align:m,alignOffset:Ei(m),onMouseEnter:N,onMouseLeave:U,onOpenAutoFocus:a(E=>E.preventDefault(),"onOpenAutoFocus"),onCloseAutoFocus:a(E=>E.preventDefault(),"onCloseAutoFocus"),children:z?(0,S.jsx)(Di,{issue:z,linkTo:Tn,linkState:H,compact:!0}):(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)("div",{className:"h-4 w-24 rounded bg-accent/50"}),(0,S.jsx)("div",{className:"h-4 w-full rounded bg-accent/40"}),(0,S.jsx)("div",{className:"h-4 w-3/4 rounded bg-accent/30"}),F?null:(0,S.jsx)("p",{className:"text-xs text-muted-foreground",children:"Unable to load task preview."})]})})]})},"IssueLinkQuicklookImpl")),Rn=new Set(["dashboard","companies","company","skills","teams-catalog","org","agents","chats","apps","projects","workspaces","execution-workspaces","issues","tasks","routines","goals","artifacts","tools","approvals","costs","usage","activity","audit","decisions","inbox","board-chat","artifacts","u","design-guide","search","settings","timeline"]),rt=new Set(["auth","invite","board-claim","cli-auth","mcp-connect","dot-connect","assistant-connections","docs","instance","s"]);function ce(e){return e.trim().toUpperCase()}a(ce,"normalizeCompanyPrefix");function Cn(e){const t=e.match(/^([^?#]*)(\?[^#]*)?(#.*)?$/);return{pathname:t?.[1]??e,search:t?.[2]??"",hash:t?.[3]??""}}a(Cn,"splitPath");function Li(e){return e.split("/").filter(Boolean)[0]??null}a(Li,"getRootSegment");function Mi(e){if(e==="/")return!0;const t=Li(e);return t?rt.has(t.toLowerCase()):!0}a(Mi,"isGlobalPath");function En(e){const t=e.split("/").filter(Boolean);if(t.length===0)return null;const r=t[0].toLowerCase();return rt.has(r)||Rn.has(r)?null:ce(t[0])}a(En,"extractCompanyPrefixFromPath");function Tt(e,t){const{pathname:r,search:n,hash:o}=Cn(e);if(!r.startsWith("/")||Mi(r)||!t)return e;const s=ce(t);return En(r)?e:`/${s}${r}${n}${o}`}a(Tt,"applyCompanyPrefix");function Ti(e,...t){const r=["cases",...t].filter(Boolean).join("/");return e?`/${ce(e)}/${r}`:`/${r}`}a(Ti,"caseHref");function ru(e){const{pathname:t,search:r,hash:n}=Cn(e),o=t.split("/").filter(Boolean);if(o.length>=2){const s=o[1].toLowerCase();if(!rt.has(o[0].toLowerCase())&&Rn.has(s))return`/${o.slice(1).join("/")}${r}${n}`}return`${t}${r}${n}`}a(ru,"toCompanyRelativePath");var $n=/^[A-Z][A-Z0-9]*-\d+$/i,Ui=/^issue:\/\/:?([^?#\s]+)([?#].*)?$/i,Oi=/issue:\/\/:?[^\s<>()]+|https?:\/\/[^\s<>()]+|\/(?:[^\s<>()/]+\/)*issues\/[A-Z][A-Z0-9]*-\d+(?=$|[\s<>)\],.;!?:])|\b[A-Z][A-Z0-9]*-\d+\b/gi;function _n(e){if(!e)return null;const t=e.trim();if(!t||/^https?:\/\//i.test(t))return null;const r=t.split(/[?#]/,1)[0].split("/").filter(Boolean),n=r.findIndex(s=>s==="issues");if(n===-1||n===r.length-1)return null;const o=decodeURIComponent(r[n+1]??"");return!o||o.startsWith(":")?null:$n.test(o)?o.toUpperCase():o}a(_n,"parseIssuePathIdFromPath");function An(e,t){if(!e)return null;const r=e.trim(),n=r.match(Ui);if(n?.[1]){const i=decodeURIComponent(n[1]);return{issuePathId:i,href:`/issues/${encodeURIComponent(i)}${n[2]??""}`}}const o=_n(e);if(o)return{issuePathId:o,href:`/issues/${encodeURIComponent(o)}${r.match(/[?#].*$/)?.[0]??""}`};if(!$n.test(r))return null;const s=r.toUpperCase();if(t&&t.size>0){const i=s.split("-")[0];if(!i||!t.has(i))return null}return{issuePathId:s,href:`/issues/${encodeURIComponent(s)}`}}a(An,"parseIssueReferenceFromHref");function ji(e){let t=e,r="";for(;t.length>0;){const n=t.at(-1);if(!n||!/[),.;!?:\]]/.test(n))break;if(n===")"){const o=(t.match(/\(/g)??[]).length;if((t.match(/\)/g)??[]).length<=o)break}if(n==="]"){const o=(t.match(/\[/g)??[]).length;if((t.match(/\]/g)??[]).length<=o)break}r=`${n}${r}`,t=t.slice(0,-1)}return{core:t,trailing:r}}a(ji,"splitTrailingPunctuation");function Dn(e,t,r="text"){return{type:"link",url:t,children:[{type:r,value:e}]}}a(Dn,"createIssueLinkNode");function Bi(e,t){const r=[];let n=0,o=!1;for(const s of e.matchAll(Oi)){const i=s[0];if(!i)continue;const u=s.index??0,c=u+i.length,{core:m,trailing:p}=ji(i),f=An(m,t);f&&(o=!0,u>n&&r.push({type:"text",value:e.slice(n,u)}),r.push(Dn(m,f.href)),p&&r.push({type:"text",value:p}),n=c)}return o?(n<e.length&&r.push({type:"text",value:e.slice(n)}),r):null}a(Bi,"linkifyIssueReferencesInText");function Pn(e,t){if(!Array.isArray(e.children)||e.children.length===0||e.type==="link"||e.type==="linkReference"||e.type==="code"||e.type==="definition"||e.type==="html")return;const r=[];for(const n of e.children){if(n.type==="inlineCode"&&typeof n.value=="string"){const o=An(n.value,t);if(o){r.push(Dn(n.value,o.href,"inlineCode"));continue}}if(n.type==="text"&&typeof n.value=="string"){const o=Bi(n.value,t);if(o){r.push(...o);continue}}Pn(n,t),r.push(n)}e.children=r}a(Pn,"rewriteMarkdownTree");function nu(e){const t=e?.knownPrefixes&&e.knownPrefixes.length>0?new Set(e.knownPrefixes.map(r=>r.toUpperCase())):void 0;return r=>{Pn(r,t)}}a(nu,"remarkLinkIssueReferences");function De(e,t){if(typeof e=="string")return Tt(e,t);if(e.pathname&&e.pathname.startsWith("/")){const r=Tt(e.pathname,t);if(r!==e.pathname)return{...e,pathname:r}}return e}a(De,"resolveTo");function he(){const{selectedCompany:e}=Qn(),t=Wa(),r=T();if(t.companyPrefix)return ce(t.companyPrefix);const n=En(r.pathname);return n||(e?ce(e.issuePrefix):null)}a(he,"useActiveCompanyPrefix");function au(){const e=he();return l.useCallback((...t)=>Ti(e,...t),[e])}a(au,"useCaseHref");var ou=l.forwardRef(a(function({to:t,disableIssueQuicklook:r=!1,issuePrefetch:n=null,issueQuicklookSide:o,issueQuicklookAlign:s,...i},u){const c=De(t,he()),m=_n(typeof c=="string"?c:c.pathname);return m?(0,S.jsx)(Pi,{ref:u,to:c,issuePathId:m,disableIssueQuicklook:r,issuePrefetch:n,issueQuicklookSide:o,issueQuicklookAlign:s,...i}):(0,S.jsx)(pe,{ref:u,to:c,...i})},"CompanyLink")),su=l.forwardRef(a(function({to:t,...r},n){const o=he();return(0,S.jsx)(mr,{ref:n,to:De(t,o),...r})},"CompanyNavLink"));function iu({to:e,...t}){const r=he();return(0,S.jsx)(so,{to:De(e,r),...t})}a(iu,"Navigate");function lu(){const e=Ce(),t=he();return l.useCallback(((r,n)=>{if(typeof r=="number"){e(r);return}e(De(r,t),n)}),[e,t])}a(lu,"useNavigate");var Ut=a(e=>typeof e=="boolean"?`${e}`:e===0?"0":e,"falsyToString"),Ot=Yn,Ni=a((e,t)=>r=>{var n;if(t?.variants==null)return Ot(e,r?.class,r?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(m=>{const p=r?.[m],f=s?.[m];if(p===null)return null;const g=Ut(p)||Ut(f);return o[m][g]}),u=r&&Object.entries(r).reduce((m,p)=>{let[f,g]=p;return g===void 0||(m[f]=g),m},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((m,p)=>{let{class:f,className:g,...b}=p;return Object.entries(b).every(v=>{let[y,h]=v;return Array.isArray(h)?h.includes({...s,...u}[y]):{...s,...u}[y]===h})?[...m,f,g]:m},[]);return Ot(e,i,c,r?.class,r?.className)},"cva"),zi=Ni("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-(--tp-color-background-color-border-color-box-shadow-opacity) disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-(length:--rad-3) aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",cta:"bg-foreground text-background hover:bg-foreground/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-9 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-10","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-9","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Fi=l.forwardRef(a(function({className:t,variant:r="default",size:n="default",asChild:o=!1,...s},i){const u=o?Nn:"button";return(0,S.jsx)(u,{ref:i,"data-slot":"button","data-variant":r,"data-size":n,className:K(zi({variant:r,size:n,className:t})),...s})},"Button"));Fi.displayName="Button";function Ln(e,t){return t?`${e}${e.includes("?")?"&":"?"}companyId=${encodeURIComponent(t)}`:e}a(Ln,"withCompanyScope");function R(e,t,r=""){return Ln(`/agents/${encodeURIComponent(e)}${r}`,t)}a(R,"agentPath");var uu={setAvatar:a((e,t,r)=>d.put(`/companies/${e}/agents/${t}/avatar`,{imageBase64:r}),"setAvatar"),getIdentity:a((e,t)=>d.get(R(e,t,"/identity")),"getIdentity"),adoptAiConnection:a((e,t,r,n)=>d.post(Ln(`/agents/${e}/connection-intents/${t}/adopt`,n),{connectionId:r}),"adoptAiConnection"),list:a(e=>d.get(`/companies/${e}/agents`),"list"),org:a(e=>d.get(`/companies/${e}/org`),"org"),listConfigurations:a(e=>d.get(`/companies/${e}/agent-configurations`),"listConfigurations"),get:a(async(e,t)=>{try{return await d.get(R(e,t))}catch(r){if(!(r instanceof Bt)||r.status!==409||!t||Jn(e))throw r;const n=st(e);if(!n)throw r;const o=(await d.get(`/companies/${t}/agents`)).filter(s=>s.status!=="terminated"&&st(s.urlKey)===n);if(o.length!==1)throw r;return d.get(R(o[0].id,t))}},"get"),getConfiguration:a((e,t)=>d.get(R(e,t,"/configuration")),"getConfiguration"),listConfigRevisions:a((e,t)=>d.get(R(e,t,"/config-revisions")),"listConfigRevisions"),getConfigRevision:a((e,t,r)=>d.get(R(e,r,`/config-revisions/${t}`)),"getConfigRevision"),rollbackConfigRevision:a((e,t,r)=>d.post(R(e,r,`/config-revisions/${t}/rollback`),{}),"rollbackConfigRevision"),create:a((e,t)=>d.post(`/companies/${e}/agents`,t),"create"),hire:a((e,t)=>d.post(`/companies/${e}/agent-hires`,t),"hire"),update:a((e,t,r)=>d.patch(R(e,r),t),"update"),updatePermissions:a((e,t,r)=>d.patch(R(e,r,"/permissions"),t),"updatePermissions"),batchAdapterConfigPreview:a(e=>d.post("/agents/batch/adapter-config/preview",{agentIds:e}),"batchAdapterConfigPreview"),batchAdapterConfig:a((e,t)=>d.post("/agents/batch/adapter-config",{agentIds:e,values:t}),"batchAdapterConfig"),instructionsBundle:a((e,t)=>d.get(R(e,t,"/instructions-bundle")),"instructionsBundle"),updateInstructionsBundle:a((e,t,r)=>d.patch(R(e,r,"/instructions-bundle"),t),"updateInstructionsBundle"),instructionsFile:a((e,t,r)=>d.get(R(e,r,`/instructions-bundle/file?path=${encodeURIComponent(t)}`)),"instructionsFile"),saveInstructionsFile:a((e,t,r)=>d.put(R(e,r,"/instructions-bundle/file"),t),"saveInstructionsFile"),instructionCandidates:a((e,t)=>d.get(R(e,t,"/instructions-bundle/candidates")),"instructionCandidates"),resolveInstructionCandidate:a((e,t,r,n)=>d.post(R(e,n,`/instructions-bundle/candidates/${t}/resolve`),r),"resolveInstructionCandidate"),instructionHistory:a((e,t,r,n)=>d.get(R(e,r,`/instructions-bundle/history?path=${encodeURIComponent(t)}${n?`&cursor=${encodeURIComponent(n)}`:""}`)),"instructionHistory"),instructionRevision:a((e,t,r,n)=>d.get(R(e,n,`/instructions-bundle/revision/${r}?path=${encodeURIComponent(t)}`)),"instructionRevision"),instructionDiff:a((e,t,r,n,o)=>d.get(R(e,o,`/instructions-bundle/diff?path=${encodeURIComponent(t)}&from=${encodeURIComponent(r)}&to=${encodeURIComponent(n)}`)),"instructionDiff"),restoreInstructions:a((e,t,r)=>d.post(R(e,r,"/instructions-bundle/restore"),t),"restoreInstructions"),downloadInstructionsFile:a((e,t,r)=>`/api${R(e,r,`/instructions-bundle/file?path=${encodeURIComponent(t)}&download=true`)}`,"downloadInstructionsFile"),deleteInstructionsFile:a((e,t,r,n)=>d.delete(R(e,r,`/instructions-bundle/file?path=${encodeURIComponent(t)}${n?`&baseHash=${n}`:""}`)),"deleteInstructionsFile"),retryLifecycle:a((e,t)=>d.post(R(e,t,"/lifecycle/retry"),{}),"retryLifecycle"),pause:a((e,t)=>d.post(R(e,t,"/pause"),{}),"pause"),resume:a((e,t)=>d.post(R(e,t,"/resume"),{}),"resume"),clearError:a((e,t)=>d.post(R(e,t,"/clear-error"),{}),"clearError"),approve:a((e,t)=>d.post(R(e,t,"/approve"),{}),"approve"),terminate:a((e,t)=>d.post(R(e,t,"/terminate"),{}),"terminate"),remove:a((e,t)=>d.delete(R(e,t)),"remove"),listKeys:a((e,t)=>d.get(R(e,t,"/keys")),"listKeys"),skills:a((e,t)=>d.get(R(e,t,"/skills")),"skills"),syncSkills:a((e,t,r,n)=>d.post(R(e,n,"/skills/sync"),{desiredSkills:t,mode:r}),"syncSkills"),createKey:a((e,t,r,n)=>d.post(R(e,r,"/keys"),{name:t,...n?{scope:n}:{}}),"createKey"),revokeKey:a((e,t,r)=>d.delete(R(e,r,`/keys/${encodeURIComponent(t)}`)),"revokeKey"),runtimeState:a((e,t)=>d.get(R(e,t,"/runtime-state")),"runtimeState"),taskSessions:a((e,t)=>d.get(R(e,t,"/task-sessions")),"taskSessions"),resetSession:a((e,t,r)=>d.post(R(e,r,"/runtime-state/reset-session"),{taskKey:t??null}),"resetSession"),adapterModels:a((e,t,r)=>{const n=new URLSearchParams;r?.refresh&&n.set("refresh","1"),r?.provider&&n.set("provider",r.provider),r?.poolId&&n.set("poolId",r.poolId),r?.environmentId&&n.set("environmentId",r.environmentId);const o=n.size>0?`?${n.toString()}`:"";return d.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/models${o}`)},"adapterModels"),detectModel:a((e,t)=>d.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/detect-model`),"detectModel"),testEnvironment:a((e,t,r)=>d.post(`/companies/${e}/adapters/${t}/test-environment`,r),"testEnvironment"),getAdapterAuthSignal:a((e,t,r)=>{const n=r?`?environmentId=${encodeURIComponent(r)}`:"";return d.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/auth-signal${n}`)},"getAdapterAuthSignal"),invoke:a((e,t,r={})=>d.post(R(e,t,"/heartbeat/invoke"),r),"invoke"),wakeup:a((e,t,r)=>d.post(R(e,r,"/wakeup"),t),"wakeup"),retryFailedRun:a(async(e,t,r)=>{const n=await d.post(R(e,r,"/wakeup"),{source:"on_demand",triggerDetail:"manual",reason:"retry_failed_run",failedRunId:t});if("id"in n){if(["failed","timed_out","cancelled","interrupted"].includes(n.status))throw new Error("The previous retry has already stopped. Refresh the task and retry its latest failed run.");return{runId:n.id,issueId:null}}if("actionId"in n){if(n.status==="failed"||n.status==="cancelled")throw new Error("This retry could not start. Open the task to review its current access and recovery state.");return{runId:n.runId,issueId:n.issueId}}throw new Error(n.message??"Retry was skipped.")},"retryFailedRun"),loginWithClaude:a((e,t)=>d.post(R(e,t,"/claude-login"),{}),"loginWithClaude"),startAdapterAuthLogin:a((e,t,r)=>d.post(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/login-sessions`,r),"startAdapterAuthLogin"),getAdapterAuthLoginStatus:a((e,t,r)=>d.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/login-sessions/${encodeURIComponent(r)}`,{cache:"no-store"}),"getAdapterAuthLoginStatus"),getActiveAdapterAuthLoginSession:a((e,t)=>d.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/login-sessions/active`,{cache:"no-store"}),"getActiveAdapterAuthLoginSession"),cancelAdapterAuthLogin:a((e,t,r)=>d.post(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/login-sessions/${encodeURIComponent(r)}/cancel`,{}),"cancelAdapterAuthLogin"),getClaudeOAuthTokenStatus:a(e=>d.get(`/companies/${encodeURIComponent(e)}/claude-oauth-token-status`),"getClaudeOAuthTokenStatus"),startClaudeSetupTokenLogin:a((e,t)=>d.post(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions`,{adapterType:"claude_local",...t}),"startClaudeSetupTokenLogin"),getClaudeSetupTokenLoginStatus:a((e,t)=>d.get(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}`),"getClaudeSetupTokenLoginStatus"),getActiveClaudeSetupTokenLoginSession:a(e=>d.get(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/active`,{cache:"no-store"}),"getActiveClaudeSetupTokenLoginSession"),getClaudeSetupTokenLoginPrompt:a((e,t)=>d.get(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}/prompt`),"getClaudeSetupTokenLoginPrompt"),submitClaudeSetupTokenBrowserCode:a((e,t,r)=>d.post(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}/code`,{browserCode:r}),"submitClaudeSetupTokenBrowserCode"),completeClaudeSetupTokenLogin:a((e,t)=>d.post(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}/completion`,{}),"completeClaudeSetupTokenLogin"),cancelClaudeSetupTokenLogin:a((e,t)=>d.post(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}/cancel`,{}),"cancelClaudeSetupTokenLogin"),availableSkills:a(()=>d.get("/skills/available"),"availableSkills")},Mn=(0,l.createContext)(null);function qi(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]?.label!==t[r]?.label||e[r]?.onClick!==t[r]?.onClick||e[r]?.href!==t[r]?.href||e[r]?.identifier!==t[r]?.identifier||e[r]?.leadingKey!==t[r]?.leadingKey||e[r]?.trailingKey!==t[r]?.trailingKey)return!1;return!0}a(qi,"breadcrumbsEqual");function Hi(e,t){const r=e.length===0?[]:[...e].reverse().map(o=>o.label),n=t?.trim()?[t.trim()]:[];return[...r,...n,"Paperclip"].join(" • ")}a(Hi,"buildDocumentTitle");function cu({children:e,companyName:t}){const[r,n]=(0,l.useState)([]),[o,s]=(0,l.useState)(null),[i,u]=(0,l.useState)(null),[c,m]=(0,l.useState)(null),p=(0,l.useCallback)(v=>{n(y=>qi(y,v)?y:v)},[]),f=(0,l.useCallback)(v=>{m(v)},[]),g=(0,l.useCallback)(v=>{s(v)},[]),b=(0,l.useCallback)(v=>{u(v)},[]);return(0,l.useEffect)(()=>{document.title=Hi(r,t)},[r,t]),(0,S.jsx)(Mn.Provider,{value:{breadcrumbs:r,setBreadcrumbs:p,breadcrumbToolbar:o,setBreadcrumbToolbar:g,breadcrumbPanelControl:i,setBreadcrumbPanelControl:b,mobileToolbar:c,setMobileToolbar:f},children:e})}a(cu,"BreadcrumbProvider");function du(){const e=(0,l.useContext)(Mn);if(!e)throw new Error("useBreadcrumbs must be used within BreadcrumbProvider");return e}a(du,"useBreadcrumbs");export{li as $,vl as $t,Hl as A,Zo as An,Dt as At,Ul as B,Wa as Bn,ws as Bt,Ei as C,es as Cn,Bs as Ct,Kl as D,cl as Dn,Ts as Dt,yi as E,ml as En,Us as Et,eu as F,tl as Fn,As as Ft,Nl as G,Is as Gt,zl as H,Ss as Ht,Yl as I,il as In,$s as It,Wl as J,xs as Jt,jl as K,$r as Kt,Zl as L,T as Ln,Es as Lt,ve as M,pe as Mn,Ps as Mt,tu as N,el as Nn,Br as Nt,Ql as O,gr as On,Ms as Ot,Xl as P,io as Pn,Ds as Pt,ui as Q,El as Qt,Ml as R,Ce as Rn,Cs as Rt,Ci as S,Xo as Sn,Ns as St,Pt as T,et as Tn,Os as Tt,Jl as U,Pl as Ut,Ol as V,sl as Vn,Al as Vt,Gl as W,Dl as Wt,di as X,Cl as Xt,Vl as Y,kl as Yt,ci as Z,fs as Zt,Mi as _,as as _n,Ws as _t,zi as a,xl as an,ri as at,Pi as b,Ir as bn,Fs as bt,su as c,wl as cn,Ll as ct,au as d,It as dn,Ys as dt,Il as en,ii as et,lu as f,pl as fn,Gs as ft,En as g,yl as gn,Vs as gt,Tt as h,gl as hn,Ks as ht,Fi as i,ps as in,ni as it,Fl as j,ol as jn,At as jt,ql as k,ll as kn,Ls as kt,iu as l,$l as ln,Xs as lt,nu as m,us as mn,Qs as mt,du as n,bl as nn,oi as nt,Ni as o,_l as on,ti as ot,An as p,fl as pn,Js as pt,Bl as q,vs as qt,uu as r,Sl as rn,ai as rt,ou as s,Rl as sn,ei as st,cu as t,ms as tn,si as tt,he as u,Z as un,Zs as ut,ce as v,cs as vn,Hs as vt,xi as w,ul as wn,js as wt,Di as x,dl as xn,zs as xt,ru as y,hl as yn,qs as yt,Tl as z,Zi as zn,Rs as zt};
|
|
@@ -1 +0,0 @@
|
|
|
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,Ha as he,St as Y,Wa as ge,ca as J,ht as fe,qi as X,ut as ye}from"./agent-avatar-url-B_lUFC64.js";import{Vn as ve,i as T,n as je,r as be,s as re}from"./BreadcrumbContext-c2KosyR8.js";import{r as ee,t as Ne}from"./AgentAvatar-CpQ88dwV.js";import{i as te,r as we,t as Ae}from"./tabs-BNIJaxKM.js";import{a as Te}from"./ToastContext-FzmhiqZ4.js";import{a as y,c as R,l as _,n as F,r as k}from"./select-C35A5IGs.js";import{t as se}from"./input-ConoHcjz.js";import{o as Se,r as Ce}from"./company-members-BznLwAUd.js";import{r as v,t as j}from"./card-Bz65aUPI.js";import{t as Ee}from"./EmptyState-DN8b4Qse.js";import{Ot as Ie,b as ae,hn as Ue,in as Pe,rn as De,tn as Le,xn as Re}from"./index-D4-wU1bZ.js";var l=ne(ge(),1),e=ne(he(),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"}],ke=[{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 Be(t){if(!t)return;const a=new Date(`${t}T00:00:00.000Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(Be,"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 qe({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)(Ne,{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(qe,"AuditActor");function $e({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($e,"AuditEntityNode");function ze({record:t,agentMap:a,userProfileMap:d}){const u=Ie(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)(qe,{record:t,agentMap:a,userProfileMap:d}),(0,e.jsx)("span",{className:"text-muted-foreground",children:u}),(0,e.jsx)($e,{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(ze,"AuditRow");function Me(){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)(Le,{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(Me,"AuditUpsell");function Oe({companyId:t,lockedAgentId:a,hideHeader:d,mode:u,onModeChange:c}){const{pushToast:h}=Te(),[m,g]=(0,l.useState)(n),[x,B]=(0,l.useState)(n),[S,V]=(0,l.useState)(n),[C,q]=(0,l.useState)(n),[E,$]=(0,l.useState)(""),[I,z]=(0,l.useState)(""),[Z,Q]=(0,l.useState)(!1),[U,H]=(0,l.useState)(!1),M=J({queryKey:Y.agents.list(t),queryFn:r(()=>be.list(t),"queryFn")}),O=J({queryKey:Y.access.companyUserDirectory(t),queryFn:r(()=>Se.listUserDirectory(t),"queryFn"),retry:!1}),ie=(0,l.useMemo)(()=>new Map((M.data??[]).map(s=>[s.id,s])),[M.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:Be(E),to:Ve(I)},b=!!(!a&&m!==n||x!==n||S!==n||C!==n||E||I),i=Re({queryKey:Y.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 X&&p.status===403)&&s<2,"retry")}),K=i.error instanceof X&&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),B(n),V(n),q(n),$(""),z(""))},[D,N,a,L]),(0,l.useEffect)(()=>{if(!N){U&&H(!1);return}U||(H(!0),i.refetch())},[U,i,N]);const W=r(()=>{g(n),B(n),V(n),q(n),$(""),z("")},"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)(Me,{}):(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)(Ae,{value:f,onValueChange:r(s=>c?.(s),"onValueChange"),children:(0,e.jsxs)(we,{"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)(k,{children:[(0,e.jsx)(y,{value:n,children:"All agents"}),(M.data??[]).map(s=>(0,e.jsx)(y,{value:s.id,children:s.name},s.id))]})]}),(0,e.jsxs)(F,{value:x,onValueChange:B,children:[(0,e.jsx)(R,{className:"w-52",children:(0,e.jsx)(_,{placeholder:"Responsible user"})}),(0,e.jsxs)(k,{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)(k,{children:Fe.map(s=>(0,e.jsx)(y,{value:s.value,children:s.label},s.value))})]}),(0,e.jsxs)(F,{value:C,onValueChange:q,children:[(0,e.jsx)(R,{className:"w-36",children:(0,e.jsx)(_,{placeholder:"Entity"})}),(0,e.jsx)(k,{children:ke.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=>$(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=>z(s.target.value),"onChange"),className:"w-36"}),b?(0,e.jsx)(T,{variant:"ghost",size:"sm",onClick:W,children:"Clear filters"}):null,(0,e.jsxs)(T,{variant:"outline",size:"sm",className:"ml-auto",onClick:me,disabled:Z||i.isLoading||G.length===0,children:[(0,e.jsx)(Ue,{className:"mr-1.5 h-4 w-4"}),Z?"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)(De,{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:W,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)(ze,{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 nt(){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:Pe,message:"Select a company to view activity."})}r(nt,"CompanyActivity");export{nt as CompanyActivity};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var l=Object.defineProperty;var n=(s,t)=>l(s,"name",{value:t,configurable:!0});import{i as o}from"./rolldown-runtime-ZpX3ckPj.js";import{Ha as c}from"./agent-avatar-url-B_lUFC64.js";import{ct as i,i as u}from"./BreadcrumbContext-c2KosyR8.js";var e=o(c(),1);function b({icon:s,title:t,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)(s,{className:"h-10 w-10 text-muted-foreground/50"})}),t?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"text-base font-semibold text-foreground mb-1.5",children:t}),(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)(u,{onClick:x,children:[!d&&(0,e.jsx)(i,{className:"h-4 w-4 mr-1.5"}),a]})]})}n(b,"EmptyState");export{b as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var pt=Object.defineProperty;var u=(e,a)=>pt(e,"name",{value:a,configurable:!0});import{i as ot}from"./rolldown-runtime-ZpX3ckPj.js";import{B as yt,Ha as bt,St as K,Wa as vt,ca as Q,ht as wt,yi as Ct}from"./agent-avatar-url-B_lUFC64.js";import{ct as jt,f as Mt,i as V,n as Nt,r as J,s as tt}from"./BreadcrumbContext-c2KosyR8.js";import{t as kt}from"./AgentAvatar-CpQ88dwV.js";import{n as Pt,t as Dt}from"./useHiddenSettings-CeQYvKer.js";import{t as Zt}from"./card-Bz65aUPI.js";import{t as et}from"./EmptyState-DN8b4Qse.js";import{t as Tt}from"./PageSkeleton-Bxzx6LdM.js";import{Ht as Yt,Rt as Et,dn as Xt,en as _t,hn as zt,un as rt}from"./index-D4-wU1bZ.js";var o=ot(vt(),1),n=ot(bt(),1),N=200,$=100,_=32,Wt=80,H=60,$t=.2,Ht=2,L=6;function T(e){if(e.reports.length===0)return N;const a=e.reports.reduce((i,x)=>i+T(x),0),d=(e.reports.length-1)*_;return Math.max(N,a+d)}u(T,"subtreeWidth");function at(e,a,d){const i=T(e),x=[];if(e.reports.length>0){const C=e.reports.reduce((k,P)=>k+T(P),0),S=(e.reports.length-1)*_;let j=a+(i-C-S)/2;for(const k of e.reports){const P=T(k);x.push(at(k,j,d+$+Wt)),j+=P+_}}return{id:e.id,name:e.name,role:e.role,status:e.status,x:a+(i-N)/2,y:d,children:x}}u(at,"layoutTree");function St(e){if(e.length===0)return[];e.reduce((x,C)=>x+T(C),0),(e.length-1)*_;let a=H;const d=H,i=[];for(const x of e){const C=T(x);i.push(at(x,a,d)),a+=C+_}return i}u(St,"layoutForest");function Rt(e){const a=[];function d(i){a.push(i),i.children.forEach(d)}return u(d,"walk"),e.forEach(d),a}u(Rt,"flattenLayout");function Lt(e){const a=[];function d(i){for(const x of i.children)a.push({parent:i,child:x}),d(x)}return u(d,"walk"),e.forEach(d),a}u(Lt,"collectEdges");function A(e){return Math.min(Math.max(e,$t),Ht)}u(A,"clampZoom");function At(e){return{x:e.clientX,y:e.clientY}}u(At,"touchPoint");function nt(e,a){const d=e.clientX-a.clientX,i=e.clientY-a.clientY;return Math.hypot(d,i)}u(nt,"touchDistance");function st(e,a,d){const i=d.getBoundingClientRect();return{x:(e.clientX+a.clientX)/2-i.left,y:(e.clientY+a.clientY)/2-i.top}}u(st,"touchCenter");var Ot={running:"var(--hex-22d3ee)",active:"var(--hex-4ade80)",paused:"var(--hex-facc15)",idle:"var(--hex-facc15)",error:"var(--hex-f87171)",terminated:"var(--hex-a3a3a3)"},Bt="var(--hex-a3a3a3)";function ne(){const{selectedCompanyId:e}=wt(),{setBreadcrumbs:a}=Nt(),d=Mt(),i=!!Yt(),{hidden:x}=Dt(),C=!i&&!x.has("company.import"),S=!x.has("company.export"),{data:j,isLoading:k}=Q({queryKey:K.org(e),queryFn:u(()=>J.org(e),"queryFn"),enabled:!!e}),{data:P}=Q({queryKey:K.agents.list(e),queryFn:u(()=>J.list(e),"queryFn"),enabled:!!e}),ct=(0,o.useMemo)(()=>{const t=new Map;for(const r of P??[])t.set(r.id,r);return t},[P]);(0,o.useEffect)(()=>{a([{label:"Org Chart"}])},[a]);const z=(0,o.useMemo)(()=>St(j??[]),[j]),D=(0,o.useMemo)(()=>Rt(z),[z]),it=(0,o.useMemo)(()=>Lt(z),[z]),v=(0,o.useMemo)(()=>{if(D.length===0)return{width:800,height:600};let t=0,r=0;for(const s of D)t=Math.max(t,s.x+N),r=Math.max(r,s.y+$);return{width:t+H,height:r+H}},[D]),p=(0,o.useRef)(null),[l,M]=(0,o.useState)({x:0,y:0}),[h,Y]=(0,o.useState)(1),[R,O]=(0,o.useState)(!1),E=(0,o.useRef)({x:0,y:0,panX:0,panY:0}),m=(0,o.useRef)({mode:null,startPoint:{x:0,y:0},startPan:{x:0,y:0},startZoom:1,startDistance:0,startCenter:{x:0,y:0},moved:!1}),W=(0,o.useRef)(!1),Z=(0,o.useRef)(null);(0,o.useEffect)(()=>()=>{Z.current!==null&&window.clearTimeout(Z.current)},[]);const B=(0,o.useRef)(!1);(0,o.useEffect)(()=>{if(B.current||D.length===0||!p.current)return;B.current=!0;const t=p.current,r=t.clientWidth,s=t.clientHeight,c=(r-40)/v.width,f=(s-40)/v.height,g=Math.min(c,f,1),y=v.width*g,w=v.height*g;Y(g),M({x:(r-y)/2,y:(s-w)/2})},[D,v]);const lt=(0,o.useCallback)(t=>{t.button===0&&(t.target.closest("[data-org-card]")||(O(!0),E.current={x:t.clientX,y:t.clientY,panX:l.x,panY:l.y}))},[l]),ut=(0,o.useCallback)(t=>{if(!R)return;const r=t.clientX-E.current.x,s=t.clientY-E.current.y;M({x:E.current.panX+r,y:E.current.panY+s})},[R]),q=(0,o.useCallback)(()=>{O(!1)},[]),dt=(0,o.useCallback)(t=>{t.preventDefault();const r=p.current;if(!r)return;const s=r.getBoundingClientRect(),c=t.clientX-s.left,f=t.clientY-s.top,g=t.deltaY<0?1.1:.9,y=A(h*g),w=y/h;M({x:c-w*(c-l.x),y:f-w*(f-l.y)}),Y(y)},[h,l]),I=(0,o.useCallback)((t,r)=>{const s=A(t),c=s/h;M({x:r.x-c*(r.x-l.x),y:r.y-c*(r.y-l.y)}),Y(s)},[h,l]),ht=(0,o.useCallback)(()=>{if(!p.current)return;const t=p.current.clientWidth,r=p.current.clientHeight,s=(t-40)/v.width,c=(r-40)/v.height,f=Math.min(s,c,1),g=v.width*f,y=v.height*f;Y(f),M({x:(t-g)/2,y:(r-y)/2})},[v]),mt=(0,o.useCallback)(t=>{if(t.touches.length>=2&&p.current){const[s,c]=[t.touches[0],t.touches[1]];m.current={mode:"pinch",startPoint:{x:0,y:0},startPan:l,startZoom:h,startDistance:nt(s,c),startCenter:st(s,c,p.current),moved:!1};return}const r=t.touches[0];r&&(m.current={mode:"pan",startPoint:At(r),startPan:l,startZoom:h,startDistance:0,startCenter:{x:0,y:0},moved:!1})},[l,h]),xt=(0,o.useCallback)(t=>{const r=p.current;if(!r||!m.current.mode)return;if(t.touches.length>=2){const[g,y]=[t.touches[0],t.touches[1]],w=nt(g,y),X=st(g,y,r);if(m.current.mode!=="pinch"||m.current.startDistance===0){m.current={mode:"pinch",startPoint:{x:0,y:0},startPan:l,startZoom:h,startDistance:w,startCenter:X,moved:!1};return}const b=m.current,G=A(b.startZoom*(w/b.startDistance)),U=G/b.startZoom,ft=X.x-b.startCenter.x,gt=X.y-b.startCenter.y;b.moved=b.moved||Math.abs(w-b.startDistance)>L||Math.hypot(ft,gt)>L,Y(G),M({x:X.x-U*(b.startCenter.x-b.startPan.x),y:X.y-U*(b.startCenter.y-b.startPan.y)});return}const s=t.touches[0];if(!s||m.current.mode!=="pan")return;const c=s.clientX-m.current.startPoint.x,f=s.clientY-m.current.startPoint.y;m.current.moved=m.current.moved||Math.hypot(c,f)>L,M({x:m.current.startPan.x+c,y:m.current.startPan.y+f})},[l,h]),F=(0,o.useCallback)(()=>{m.current.moved&&(W.current=!0,Z.current!==null&&window.clearTimeout(Z.current),Z.current=window.setTimeout(()=>{W.current=!1,Z.current=null},400)),m.current={mode:null,startPoint:{x:0,y:0},startPan:l,startZoom:h,startDistance:0,startCenter:{x:0,y:0},moved:!1}},[l,h]);return e?k?(0,n.jsx)(Tt,{variant:"org-chart"}):j&&j.length===0?(0,n.jsx)(et,{icon:rt,message:"No organizational hierarchy defined."}):(0,n.jsxs)("div",{className:"flex h-(--sz-calc-38) min-h-(--sz-420px) flex-col md:h-full md:min-h-0",children:[(0,n.jsxs)("div",{className:"mb-2 flex shrink-0 flex-wrap items-center justify-start gap-2",children:[C&&(0,n.jsx)(tt,{to:"/company/import",children:(0,n.jsxs)(V,{variant:"outline",size:"sm",children:[(0,n.jsx)(_t,{className:"mr-1.5 h-3.5 w-3.5"}),"Import company"]})}),S&&(0,n.jsx)(tt,{to:"/company/export",children:(0,n.jsxs)(V,{variant:"outline",size:"sm",children:[(0,n.jsx)(zt,{className:"mr-1.5 h-3.5 w-3.5"}),"Export company"]})})]}),(0,n.jsxs)("div",{ref:p,"data-testid":"org-chart-viewport",className:"w-full flex-1 min-h-0 overflow-hidden relative bg-muted/20 border border-border rounded-lg",style:{cursor:R?"grabbing":"grab",touchAction:"none",overscrollBehavior:"contain"},onMouseDown:lt,onMouseMove:ut,onMouseUp:q,onMouseLeave:q,onWheel:dt,onTouchStart:mt,onTouchMove:xt,onTouchEnd:F,onTouchCancel:F,children:[(0,n.jsxs)("div",{className:"absolute top-3 right-3 z-10 flex flex-col gap-1.5",children:[(0,n.jsx)("button",{className:"flex size-9 items-center justify-center rounded border border-border bg-background text-sm transition-colors hover:bg-accent sm:size-7",onClick:u(()=>{const t=p.current;t&&I(h*1.2,{x:t.clientWidth/2,y:t.clientHeight/2})},"onClick"),title:"Zoom in","aria-label":"Zoom in",children:(0,n.jsx)(jt,{className:"h-4 w-4 sm:h-3.5 sm:w-3.5"})}),(0,n.jsx)("button",{className:"flex size-9 items-center justify-center rounded border border-border bg-background text-sm transition-colors hover:bg-accent sm:size-7",onClick:u(()=>{const t=p.current;t&&I(h*.8,{x:t.clientWidth/2,y:t.clientHeight/2})},"onClick"),title:"Zoom out","aria-label":"Zoom out",children:(0,n.jsx)(Pt,{className:"h-4 w-4 sm:h-3.5 sm:w-3.5"})}),(0,n.jsx)("button",{className:"flex size-9 items-center justify-center rounded border border-border bg-background text-(length:--text-nano) transition-colors hover:bg-accent sm:size-7",onClick:ht,title:"Fit to screen","aria-label":"Fit chart to screen",children:(0,n.jsx)(Xt,{className:"h-4 w-4 sm:h-3.5 sm:w-3.5"})})]}),(0,n.jsx)("svg",{className:"absolute inset-0 pointer-events-none",style:{width:"100%",height:"100%"},children:(0,n.jsx)("g",{transform:`translate(${l.x}, ${l.y}) scale(${h})`,children:it.map(({parent:t,child:r})=>{const s=t.x+N/2,c=t.y+$,f=r.x+N/2,g=r.y,y=(c+g)/2;return(0,n.jsx)("path",{d:`M ${s} ${c} L ${s} ${y} L ${f} ${y} L ${f} ${g}`,fill:"none",stroke:"var(--border)",strokeWidth:1.5},`${t.id}-${r.id}`)})})}),(0,n.jsx)("div",{"data-testid":"org-chart-card-layer",className:"absolute inset-0",style:{transform:`translate(${l.x}px, ${l.y}px) scale(${h})`,transformOrigin:"0 0"},children:D.map(t=>{const r=ct.get(t.id),s=Ot[t.status]??Bt;return(0,n.jsx)(Zt,{"data-org-card":!0,className:"block absolute py-0 hover:shadow-md hover:border-foreground/20 transition-(--tp-box-shadow-border-color) duration-150 cursor-pointer select-none",style:{left:t.x,top:t.y,width:N,minHeight:$},onClick:u(()=>d(r?yt(r):`/agents/${t.id}`),"onClick"),onClickCapture:u(c=>{W.current&&(W.current=!1,c.preventDefault(),c.stopPropagation())},"onClickCapture"),children:(0,n.jsxs)("div",{className:"flex items-center px-4 py-3 gap-3",children:[(0,n.jsxs)("div",{className:"relative shrink-0",children:[(0,n.jsx)("div",{className:"w-9 h-9 rounded-full bg-muted flex items-center justify-center",children:(0,n.jsx)(kt,{agent:r,size:16,className:"h-4.5 w-4.5 text-foreground/70"})}),(0,n.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 h-3 w-3 rounded-full border-2 border-card",style:{backgroundColor:s}})]}),(0,n.jsxs)("div",{className:"flex flex-col items-start min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"text-sm font-semibold text-foreground leading-tight",children:t.name}),(0,n.jsx)("span",{className:"text-(length:--text-micro) text-muted-foreground leading-tight mt-0.5",children:r?.title??It(t.role)}),r&&(0,n.jsx)("span",{className:"text-(length:--text-nano) text-muted-foreground/60 font-mono leading-tight mt-1",children:Et(r.adapterType)}),r&&r.capabilities&&(0,n.jsx)("span",{className:"text-(length:--text-nano) text-muted-foreground/80 leading-tight mt-1 line-clamp-2",children:r.capabilities})]})]})},t.id)})})]})]}):(0,n.jsx)(et,{icon:rt,message:"Select a company to view the org chart."})}u(ne,"OrgChart");var qt=Ct;function It(e){return qt[e]??e}u(It,"roleLabel");export{ne as OrgChart};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var ot=Object.defineProperty;var i=(s,a)=>ot(s,"name",{value:a,configurable:!0});import{i as Le}from"./rolldown-runtime-ZpX3ckPj.js";import{G as ct,Ha as lt,St as p,Va as dt,Wa as ut,ca as L,ht as mt,qi as pt,sa as W}from"./agent-avatar-url-B_lUFC64.js";import{An as Ee,Bn as ht,X as gt,ct as xt,f as yt,i as E,l as oe,n as vt,nt as ft,r as bt}from"./BreadcrumbContext-c2KosyR8.js";import{c as jt,t as O,x as wt}from"./label-xpLcJrPL.js";import{Ft as Nt,It as kt,Mt as St,Nr as It,Nt as Ct,jt as At,t as Pt,wt as Oe}from"./RoutineRunVariablesDialog-BTO1cGhY.js";import{Z as Rt}from"./mention-chips--Lp_ENqh.js";import{t as De}from"./AgentAvatar-CpQ88dwV.js";import{E as Tt,T as Et}from"./checkbox-Ds_3QqBB.js";import{l as T,t as _e}from"./MarkdownEditor-B6u1nGzv.js";import{h as Ot}from"./StatusIcon-BE5kFgZJ.js";import{t as xe}from"./arrow-right-D3mUepq9.js";import{a as Dt}from"./ToastContext-FzmhiqZ4.js";import{r as _t,t as Mt}from"./clipboard-C4aDsmO8.js";import{a as de,c as ue,l as me,n as pe,r as he}from"./select-C35A5IGs.js";import{i as qt,r as Ft}from"./use-copy-action-DnjVh8kP.js";import{t as Kt}from"./heartbeats-DTwjV2kl.js";import{t as ye}from"./badge-6KBG4DJ9.js";import{t as V}from"./input-ConoHcjz.js";import{i as Lt,o as Wt}from"./company-members-BznLwAUd.js";import{r as Ut,t as $t}from"./card-Bz65aUPI.js";import{t as te}from"./EmptyState-DN8b4Qse.js";import{t as Vt}from"./PageSkeleton-Bxzx6LdM.js";import{A as Gt,B as We,Bt as Me,C as zt,D as Qt,E as Bt,F as Ht,I as qe,It as Jt,L as Ue,M as Zt,Mt as Xt,N as Yt,Nt as es,O as ts,P as ss,Qt as is,R as z,S as ns,T as as,V as rs,_n as ve,_t as os,bn as cs,j as ls,k as ds,on as us,w as $e,x as ms,z as ps,zt as Y}from"./index-D4-wU1bZ.js";var u=Le(ut(),1);function hs(s,a,n){const c={label:a.label.trim()||null};return s.kind==="schedule"&&(c.cronExpression=a.cronExpression.trim(),c.timezone=s.timezone??n),s.kind==="webhook"&&(c.signingMode=a.signingMode,c.replayWindowSec=Number(a.replayWindowSec||"300")),c}i(hs,"buildRoutineTriggerPatch");var e=Le(lt(),1),gs=["app_webhook","bearer","hmac_sha256","github_hmac","none"],xs=new Set(["app_webhook","bearer","github_hmac","fireflies_hmac","none"]);function ys(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}i(ys,"getLocalTimezone$1");function vs({trigger:s,onSave:a,onRotate:n,onDelete:c,disabled:r}){const[m,l]=(0,u.useState)({label:s.label??"",cronExpression:s.cronExpression??"",signingMode:s.signingMode??"bearer",replayWindowSec:String(s.replayWindowSec??300)});(0,u.useEffect)(()=>{l({label:s.label??"",cronExpression:s.cronExpression??"",signingMode:s.signingMode??"bearer",replayWindowSec:String(s.replayWindowSec??300)})},[s]);const k=s.kind==="schedule"?ve:s.kind==="webhook"?is:gt,I=s.kind==="schedule"?Bt(m.cronExpression):null,M=/fail|error/i.test(s.lastResult??""),C=s.lastResult?.startsWith("Created execution issue ")?"Task created":s.lastResult;return(0,e.jsxs)("form",{"aria-label":`Trigger: ${s.label??s.kind}`,className:"space-y-4 rounded-lg border border-border p-4",onSubmit:i(x=>x.preventDefault(),"onSubmit"),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 items-center gap-2 text-sm font-medium",children:[(0,e.jsx)(k,{className:"h-3.5 w-3.5 shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:s.label??s.kind})]}),I?(0,e.jsx)("p",{id:`cron-readable-${s.id}`,className:"text-xs text-muted-foreground",children:I}):null]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[s.lastResult?(0,e.jsx)(ye,{variant:M?"destructive":"secondary",children:C}):null,(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:s.kind==="schedule"&&s.nextRunAt?`Next: ${new Date(s.nextRunAt).toLocaleString()}`:s.kind==="webhook"?"Webhook":"API"})]})]}),s.kind==="webhook"&&s.webhookUrl&&(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(O,{htmlFor:`webhook-url-${s.id}`,className:"text-xs",children:"Webhook URL"}),(0,e.jsx)(V,{id:`webhook-url-${s.id}`,value:s.webhookUrl,readOnly:!0,onFocus:i(x=>x.target.select(),"onFocus")}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Send a POST request with Content-Type: application/json. Keep this URL private when signing is disabled."})]}),(0,e.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(O,{className:"text-xs",children:"Label"}),(0,e.jsx)(V,{value:m.label,disabled:r,onChange:i(x=>l(S=>({...S,label:x.target.value})),"onChange")})]}),s.kind==="schedule"&&(0,e.jsxs)("div",{className:"space-y-1.5 md:col-span-2",children:[(0,e.jsx)(O,{className:"text-xs",children:"Schedule"}),(0,e.jsx)($e,{value:m.cronExpression,onChange:i(x=>l(S=>({...S,cronExpression:x})),"onChange")})]}),s.kind==="webhook"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(O,{className:"text-xs",children:"Signing mode"}),(0,e.jsxs)(pe,{value:m.signingMode,onValueChange:i(x=>l(S=>({...S,signingMode:x})),"onValueChange"),disabled:r,children:[(0,e.jsx)(ue,{children:(0,e.jsx)(me,{})}),(0,e.jsx)(he,{children:gs.map(x=>(0,e.jsx)(de,{value:x,children:x},x))})]})]}),!xs.has(m.signingMode)&&(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(O,{className:"text-xs",children:"Replay window (seconds)"}),(0,e.jsx)(V,{value:m.replayWindowSec,disabled:r,onChange:i(x=>l(S=>({...S,replayWindowSec:x.target.value})),"onChange")})]})]})]}),!r&&(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[(0,e.jsxs)(E,{variant:"ghost",size:"sm",className:"mr-auto text-muted-foreground hover:text-destructive",onClick:i(()=>c(s.id),"onClick"),children:[(0,e.jsx)(Et,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.kind==="webhook"&&(0,e.jsxs)(E,{variant:"outline",size:"sm",onClick:i(()=>n(s.id),"onClick"),children:[(0,e.jsx)(Tt,{className:"mr-1.5 h-3.5 w-3.5"}),"Rotate secret"]}),(0,e.jsxs)(E,{variant:"outline",size:"sm",onClick:i(()=>a(s.id,hs(s,m,ys())),"onClick"),children:[(0,e.jsx)(Ft,{className:"mr-1.5 h-3.5 w-3.5"}),"Save trigger"]})]})]})}i(vs,"RoutineTriggerCard");var fs=[{value:"coalesce_if_active",title:"Coalesce if active",description:"Keep one follow-up run queued while an active run is still working."},{value:"always_enqueue",title:"Always enqueue",description:"Queue every trigger occurrence, even if several runs stack up."},{value:"skip_if_active",title:"Skip if active",description:"Drop overlapping trigger occurrences while the routine is already active."}],bs=[{value:"skip_missed",title:"Skip missed",description:"Ignore schedule windows that were missed while paused."},{value:"enqueue_missed_with_cap",title:"Enqueue missed with cap",description:"Catch up missed schedule windows after recovery; sub-hourly schedules are combined into one catch-up run, slower schedules replay each missed window up to a cap."}],js=[{value:"always",title:"Run on every scheduled tick",description:"Fire on the schedule no matter what — the default behavior."},{value:"require_external_activity",title:"Skip when there's been no activity since the last run",description:"On a scheduled tick, only run if something happened since the last run that finished. Lets a watcher-style routine stay asleep while the system is settled instead of burning tokens."}],ws=[{value:"company",title:"Company-wide",description:"Any activity across the company counts as a reason to run."},{value:"project",title:"This project",description:"Only activity in the routine's project counts as a reason to run."}],Ns=["schedule","webhook"],ks=["app_webhook","bearer","hmac_sha256","github_hmac","none"],Ss={bearer:"Send Authorization: Bearer <secret> with each request.",hmac_sha256:"Send X-Paperclip-Timestamp and X-Paperclip-Signature: sha256=<hex>, signing timestamp + a dot + the exact JSON body.",github_hmac:"Accept GitHub-style X-Hub-Signature-256 header (HMAC over raw body, no timestamp).",app_webhook:"Accept a bearer token or an HMAC-SHA256 signature over the exact request body in X-Hub-Signature or X-Hub-Signature-256.",fireflies_hmac:"Signed webhook (legacy).",none:"No authentication — the webhook URL itself acts as a shared secret."},Is=new Set(["app_webhook","bearer","github_hmac","fireflies_hmac","none"]);function Cs({defaultDescriptionAnnotationsOpen:s=!1}={}){const{routine:a,editDraft:n,setEditDraft:c,assigneeOptions:r,projectOptions:m,recentAssigneeIds:l,recentProjectIds:k,agentById:I,projectById:M,currentAssignee:C,currentProject:x,mentionOptions:S,assigneeSelectorRef:D,projectSelectorRef:q,descriptionEditorRef:A,routineRuns:g,activity:b,saveRoutine:w,saveConflict:se,isSectionDirty:v,navigateToSection:P}=z(),[j,_]=(0,u.useState)(s),o=a.triggers.length,Q=(0,u.useMemo)(()=>{const d=a.triggers.filter(y=>y.kind==="schedule"&&y.nextRunAt).map(y=>new Date(y.nextRunAt)).sort((y,G)=>y.getTime()-G.getTime())[0];return d?d.toLocaleString():null},[a.triggers]),U=n.env?Object.keys(n.env).length:0,R=(g??[])[0]??null,B=(b??[]).slice(0,5);return(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsx)("div",{className:"overflow-x-auto overscroll-x-contain",children:(0,e.jsxs)("div",{className:"inline-flex min-w-full flex-wrap items-center gap-2 text-sm text-muted-foreground sm:min-w-max sm:flex-nowrap",children:[(0,e.jsx)("span",{children:"For"}),(0,e.jsx)(Oe,{ref:D,value:n.assigneeAgentId,options:r,recentOptionIds:l,placeholder:"Responsible",noneLabel:"No responsible",searchPlaceholder:"Search responsible...",emptyMessage:"No responsible found.",onChange:i(d=>c(y=>({...y,assigneeAgentId:d})),"onChange"),onConfirm:i(()=>{n.projectId?A.current?.focus():q.current?.focus()},"onConfirm"),renderTriggerValue:i(d=>d?C?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(De,{agent:C,size:16,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"truncate",children:d.label})]}):(0,e.jsx)("span",{className:"truncate",children:d.label}):(0,e.jsx)("span",{className:"text-muted-foreground",children:"Responsible"}),"renderTriggerValue"),renderOption:i(d=>{if(!d.id)return(0,e.jsx)("span",{className:"truncate",children:d.label});const y=I.get(d.id);return(0,e.jsxs)(e.Fragment,{children:[y?(0,e.jsx)(De,{agent:y,size:16,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):null,(0,e.jsx)("span",{className:"truncate",children:d.label})]})},"renderOption")}),(0,e.jsx)("span",{children:"in"}),(0,e.jsx)(Oe,{ref:q,value:n.projectId,options:m,recentOptionIds:k,placeholder:"Project",noneLabel:"No project",searchPlaceholder:"Search projects...",emptyMessage:"No projects found.",onChange:i(d=>c(y=>({...y,projectId:d})),"onChange"),onConfirm:i(()=>A.current?.focus(),"onConfirm"),renderTriggerValue:i(d=>d&&x?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"h-3.5 w-3.5 shrink-0 rounded-sm",style:{backgroundColor:x.color??"var(--project-none)"}}),(0,e.jsx)("span",{className:"truncate",children:d.label})]}):(0,e.jsx)("span",{className:"text-muted-foreground",children:"Project"}),"renderTriggerValue"),renderOption:i(d=>{if(!d.id)return(0,e.jsx)("span",{className:"truncate",children:d.label});const y=M.get(d.id);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"h-3.5 w-3.5 shrink-0 rounded-sm",style:{backgroundColor:y?.color??"var(--project-none)"}}),(0,e.jsx)("span",{className:"truncate",children:d.label})]})},"renderOption")})]})}),a.assigneeAgentId?null:(0,e.jsx)("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-4 text-sm text-amber-900 dark:text-amber-200",children:"Default agent required. This routine can stay as a draft and still run manually, but automation stays paused until you assign a default agent."}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("div",{className:"flex items-center justify-end",children:a.descriptionDocument?(0,e.jsx)(Xt,{issueId:a.id,docKey:"description",target:{kind:"routine",routineId:a.id,documentKey:"description"},panelOpen:j,onToggle:i(()=>_(d=>!d),"onToggle")}):null}),a.descriptionDocument?(0,e.jsx)(es,{issueId:a.id,doc:a.descriptionDocument,target:{kind:"routine",routineId:a.id,documentKey:"description"},bodyMarkdown:n.description,draftDirty:v("overview")||w.isPending,draftConflicted:se,historicalPreview:!1,locationHash:typeof window>"u"?"":window.location.hash,panelOpen:j,onPanelOpenChange:_,children:(0,e.jsx)(_e,{ref:A,value:n.description,onChange:i(d=>c(y=>({...y,description:d})),"onChange"),placeholder:"Add instructions...",bordered:!1,contentClassName:"min-h-(--sz-120px) text-sm leading-7",mentions:S,onSubmit:i(()=>{!w.isPending&&n.title.trim()&&w.mutate()},"onSubmit")})}):(0,e.jsx)(_e,{ref:A,value:n.description,onChange:i(d=>c(y=>({...y,description:d})),"onChange"),placeholder:"Add instructions...",bordered:!1,contentClassName:"min-h-(--sz-120px) text-sm leading-7",mentions:S,onSubmit:i(()=>{!w.isPending&&n.title.trim()&&w.mutate()},"onSubmit")})]}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)(rs,{}),(0,e.jsx)(We,{title:n.title,description:n.description,value:n.variables,onChange:i(d=>c(y=>({...y,variables:d})),"onChange")})]}),(0,e.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,e.jsx)(ce,{icon:ve,label:"Triggers",value:o===0?"None":`${o} active`,hint:Q?`Next fire ${Q}`:"No schedule",to:i(()=>P("triggers"),"to"),ariaLabel:`${o} triggers. Open triggers.`}),(0,e.jsx)(ce,{icon:_t,label:"Secrets",value:U===0?"None":`${U} bound`,hint:"Manage bound secrets",to:i(()=>P("secrets"),"to"),ariaLabel:`${U} secrets bound. Open secrets.`}),(0,e.jsx)(ce,{icon:wt,label:"Last run",value:R?R.status.replaceAll("_"," "):"No runs",hint:R?Ee(R.triggeredAt):"Trigger a run",to:i(()=>P("runs"),"to"),ariaLabel:R?`Last run ${R.status}. Open runs.`:"No runs. Open runs."})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Recent activity"}),B.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"No activity yet."}):(0,e.jsxs)("div",{className:"divide-y divide-border/60",children:[B.map(d=>(0,e.jsxs)("div",{className:"flex items-center gap-2 py-1.5 text-xs",children:[(0,e.jsx)(ye,{variant:"outline",className:"shrink-0 font-mono",children:d.action}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-muted-foreground",children:d.details&&Object.keys(d.details).length>0?Object.keys(d.details).slice(0,3).join(" · "):""}),(0,e.jsx)("span",{className:"shrink-0 text-muted-foreground/60",children:Ee(d.createdAt)})]},d.id)),(0,e.jsxs)("button",{type:"button",onClick:i(()=>P("activity"),"onClick"),className:"flex items-center gap-1 pt-2 text-xs text-muted-foreground hover:text-foreground",children:["View all activity ",(0,e.jsx)(xe,{className:"h-3 w-3"})]})]})]})]})}i(Cs,"OverviewSection");function ce({icon:s,label:a,value:n,hint:c,to:r,ariaLabel:m}){return(0,e.jsx)("button",{type:"button",onClick:r,"aria-label":m,className:"text-left",children:(0,e.jsx)($t,{className:"gap-2 p-4 transition-colors hover:border-border hover:bg-accent/30",children:(0,e.jsxs)(Ut,{className:"space-y-1 p-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 text-xs uppercase tracking-wide text-muted-foreground",children:[(0,e.jsx)(s,{className:"h-3.5 w-3.5"}),a,(0,e.jsx)(xe,{className:"ml-auto h-3.5 w-3.5 text-muted-foreground/60"})]}),(0,e.jsx)("p",{className:"text-lg font-semibold",children:n}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:c})]})})})}i(ce,"SummaryCard");function As(){const{routine:s,newTrigger:a,setNewTrigger:n,createTrigger:c,updateTrigger:r,deleteTrigger:m,rotateTrigger:l,secretMessage:k,copySecretValue:I,setSecretMessage:M}=z(),[C,x]=(0,u.useState)(!1),[S,D]=(0,u.useState)(!0),q=(0,u.useMemo)(()=>a.kind==="schedule"?as(a.cronExpression):null,[a.cronExpression,a.kind]),A=c.isPending||(q?!q.valid||!S:!1);return(0,u.useEffect)(()=>{a.kind!=="schedule"&&D(!0)},[a.kind]),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:s.triggers.length===0?"No triggers yet":`${s.triggers.length} trigger${s.triggers.length===1?"":"s"}`}),(0,e.jsx)(E,{size:"sm",variant:C?"secondary":"default",onClick:i(()=>x(g=>!g),"onClick"),"aria-expanded":C,children:C?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Rt,{className:"mr-1.5 h-3.5 w-3.5"}),"Cancel"]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(xt,{className:"mr-1.5 h-3.5 w-3.5"}),"New trigger"]})})]}),C?(0,e.jsxs)("div",{className:"space-y-3 rounded-lg border border-border p-4",children:[(0,e.jsx)("p",{className:"text-sm font-medium",children:"Add trigger"}),(0,e.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(O,{className:"text-xs",children:"Kind"}),(0,e.jsxs)(pe,{value:a.kind,onValueChange:i(g=>n(b=>({...b,kind:g})),"onValueChange"),children:[(0,e.jsx)(ue,{children:(0,e.jsx)(me,{})}),(0,e.jsx)(he,{children:Ns.map(g=>(0,e.jsx)(de,{value:g,children:g},g))})]})]}),a.kind==="schedule"&&(0,e.jsxs)("div",{className:"space-y-1.5 md:col-span-2",children:[(0,e.jsx)(O,{className:"text-xs",children:"Schedule"}),(0,e.jsx)($e,{value:a.cronExpression,onChange:i(g=>n(b=>({...b,cronExpression:g})),"onChange"),onValidityChange:D})]}),a.kind==="webhook"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(O,{className:"text-xs",children:"Signing mode"}),(0,e.jsxs)(pe,{value:a.signingMode,onValueChange:i(g=>n(b=>({...b,signingMode:g})),"onValueChange"),children:[(0,e.jsx)(ue,{children:(0,e.jsx)(me,{})}),(0,e.jsx)(he,{children:ks.map(g=>(0,e.jsx)(de,{value:g,children:g},g))})]}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:Ss[a.signingMode]})]}),!Is.has(a.signingMode)&&(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(O,{className:"text-xs",children:"Replay window (seconds)"}),(0,e.jsx)(V,{value:a.replayWindowSec,onChange:i(g=>n(b=>({...b,replayWindowSec:g.target.value})),"onChange")})]})]})]}),(0,e.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,e.jsx)(E,{size:"sm",variant:"ghost",onClick:i(()=>x(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(E,{size:"sm",onClick:i(()=>c.mutate(void 0,{onSuccess:i(()=>{n(Ue()),x(!1)},"onSuccess")}),"onClick"),disabled:A,children:c.isPending?"Adding...":"Add trigger"})]})]}):null,k?(0,e.jsxs)("div",{className:"space-y-3 rounded-lg border border-border bg-muted/20 p-4 text-sm",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"font-medium",children:k.title}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Save this now. Paperclip will not show the secret value again."})]}),(0,e.jsx)("div",{className:"space-y-3",children:k.entries.map((g,b)=>(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(V,{"aria-label":"New webhook URL",value:g.webhookUrl,readOnly:!0,className:"flex-1"}),(0,e.jsx)(E,{variant:"outline",size:"sm",onClick:i(()=>I("Webhook URL",g.webhookUrl),"onClick"),children:"URL"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(V,{"aria-label":"New webhook secret",value:g.webhookSecret,readOnly:!0,className:"flex-1"}),(0,e.jsx)(E,{variant:"outline",size:"sm",onClick:i(()=>I("Webhook secret",g.webhookSecret),"onClick"),children:"Secret"})]})]},`${g.webhookUrl}-${b}`))}),(0,e.jsx)(E,{variant:"outline",size:"sm",onClick:i(()=>M(null),"onClick"),children:"Done"})]}):null,s.triggers.length===0?(0,e.jsx)(te,{icon:ve,message:"No triggers yet.",action:"Add a trigger",onAction:i(()=>x(!0),"onAction")}):(0,e.jsx)("div",{className:"space-y-3",children:s.triggers.map(g=>(0,e.jsx)(vs,{trigger:g,onSave:i((b,w)=>r.mutate({id:b,patch:w}),"onSave"),onRotate:i(b=>l.mutate(b),"onRotate"),onDelete:i(b=>m.mutate(b),"onDelete")},g.id))})]})}i(As,"TriggersSection");function Ps(){const{editDraft:s,setEditDraft:a,navigateToSection:n}=z(),c=s.variables.length>0;return(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 rounded-md border border-border bg-muted/20 px-4 py-3 text-xs",children:[(0,e.jsxs)("span",{className:"flex-1 text-muted-foreground",children:["Variables are auto-detected from ",(0,e.jsx)("code",{className:"font-mono",children:"{{placeholders}}"})," in the title & instructions. The variable name is read-only — rename by editing the placeholder."]}),(0,e.jsxs)(E,{variant:"secondary",size:"sm",onClick:i(()=>n("overview"),"onClick"),children:[(0,e.jsx)(us,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit instructions"]})]}),c?(0,e.jsx)(We,{title:s.title,description:s.description,value:s.variables,onChange:i(r=>a(m=>({...m,variables:r})),"onChange")}):(0,e.jsx)(te,{icon:cs,message:"No variables yet. Add a {{placeholder}} in the title or instructions to create one.",action:"Edit instructions",onAction:i(()=>n("overview"),"onAction")})]})}i(Ps,"VariablesSection");function Rs(){const{editDraft:s,setEditDraft:a,availableSecrets:n,createSecret:c}=z(),r=(0,u.useMemo)(()=>[...n].filter(m=>m.status==="active").sort((m,l)=>{const k=(l.referenceCount??0)-(m.referenceCount??0);return k!==0?k:new Date(l.updatedAt).getTime()-new Date(m.updatedAt).getTime()}).slice(0,8),[n]);return(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"rounded-md border border-border bg-muted/20 px-4 py-3 text-xs text-muted-foreground",children:["Routine secrets apply to every task this routine creates. They override matching keys in project and agent env. ",(0,e.jsx)("span",{className:"font-mono",children:"PAPERCLIP_*"})," names are reserved."]}),(0,e.jsx)(Jt,{value:s.env??{},secrets:n,recentlyUsedSecrets:r,onCreateSecret:i(async(m,l)=>c.mutateAsync({name:m,value:l}),"onCreateSecret"),onChange:i(m=>a(l=>({...l,env:m??null})),"onChange")})]})}i(Rs,"SecretsSection");function Ts(){const{editDraft:s,setEditDraft:a,routine:n}=z(),c=n.triggers.some(m=>m.kind==="schedule"),r=s.activityGatePolicy==="require_external_activity";return(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground",children:"Concurrency"}),(0,e.jsx)(Y,{ariaLabel:"Concurrency policy",value:s.concurrencyPolicy,onValueChange:i(m=>a(l=>({...l,concurrencyPolicy:m})),"onValueChange"),options:fs})]}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground",children:"Catch-up"}),(0,e.jsx)(Y,{ariaLabel:"Catch-up policy",value:s.catchUpPolicy,onValueChange:i(m=>a(l=>({...l,catchUpPolicy:m})),"onValueChange"),options:bs})]}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground",children:"Advanced run policy"}),(0,e.jsx)(Y,{ariaLabel:"Advanced run policy",value:s.activityGatePolicy,onValueChange:i(m=>a(l=>({...l,activityGatePolicy:m})),"onValueChange"),options:js,disabled:!c}),c?r?(0,e.jsxs)("div",{className:"space-y-2 rounded-lg border border-border p-3",children:[(0,e.jsx)(O,{className:"text-xs font-medium",children:"Activity scope"}),(0,e.jsx)(Y,{ariaLabel:"Activity gate scope",value:s.activityGateScope,onValueChange:i(m=>a(l=>({...l,activityGateScope:m})),"onValueChange"),options:ws})]}):null:(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add a schedule trigger to gate runs on activity. Webhook, manual, and API fires always run."})]}),(0,e.jsx)(Os,{triggers:n.triggers,concurrencyPolicy:s.concurrencyPolicy})]})}i(Ts,"DeliverySection");var Es={queued:"text-emerald-600 dark:text-emerald-400",coalesced:"text-amber-600 dark:text-amber-400",skipped:"text-muted-foreground"};function Os({triggers:s,concurrencyPolicy:a}){const n=(0,u.useMemo)(()=>{const c=s.filter(r=>r.kind==="schedule"&&r.enabled&&r.cronExpression).map(r=>({trigger:r,fires:Qt(r.cronExpression,5,{timeZone:r.timezone??"UTC"})})).filter(r=>r.fires.length>0).sort((r,m)=>r.fires[0].getTime()-m.fires[0].getTime())[0];return c?{timeZone:c.trigger.timezone??"UTC",entries:ts(c.fires,a)}:null},[s,a]);return(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground",children:"Next 5 fires"}),n?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"space-y-1.5 rounded-lg border border-border p-3 font-mono text-xs",children:n.entries.map((c,r)=>(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-muted-foreground/40",children:"·"}),(0,e.jsx)("span",{className:"tabular-nums",children:Ds(c.at,n.timeZone)}),(0,e.jsx)(xe,{className:"h-3 w-3 shrink-0 text-muted-foreground/50"}),(0,e.jsx)("span",{className:ct("font-medium",Es[c.disposition]),children:c.label}),c.note?(0,e.jsxs)("span",{className:"truncate text-muted-foreground/60",children:["(",c.note,")"]}):null]},r))}),(0,e.jsxs)("p",{className:"text-(length:--text-micro) text-muted-foreground/60",children:["Preview assumes the previous run is still in flight when the next fires. Times shown in"," ",n.timeZone,"."]})]}):(0,e.jsx)("p",{className:"rounded-lg border border-dashed border-border p-3 text-xs text-muted-foreground",children:"No enabled schedule trigger to preview. Add a schedule in Triggers to see how this policy treats upcoming fires."})]})}i(Os,"NextFiresPreview");function Ds(s,a){try{return new Intl.DateTimeFormat(void 0,{timeZone:a,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(s).replace(",","")}catch{return s.toISOString()}}i(Ds,"formatFireTime");var ge="paperclip.routineLastSection";function _s(s){return s.filter(a=>!a.archivedAt).map(a=>({id:a.id,label:a.name,searchText:a.description??""}))}i(_s,"buildRoutineProjectOptions");var Ms={overview:"Overview",triggers:"Triggers",variables:"Variables",secrets:"Secrets",delivery:"Delivery",runs:"Runs",activity:"Activity",history:"History"};function ee(s){return s!=null&&ss.includes(s)}i(ee,"isRoutineSection");function qs(s){try{const a=localStorage.getItem(ge);if(!a)return null;const n=JSON.parse(a)[s];return ee(n)?n:null}catch{return null}}i(qs,"readLastSection");function le(s,a){try{const n=localStorage.getItem(ge),c=n?JSON.parse(n):{};c[s]=a,localStorage.setItem(ge,JSON.stringify(c))}catch{}}i(le,"writeLastSection");var Fe={triggers:"triggers",runs:"runs",activity:"activity",secrets:"secrets",history:"history"};function Ke(s){s&&(s.style.height="auto",s.style.height=`${s.scrollHeight}px`)}i(Ke,"autoResizeTextarea");function Fs(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}i(Fs,"getLocalTimezone");function Ks(s){return{...s,description:s.description.trim()||null,projectId:s.projectId||null,assigneeAgentId:s.assigneeAgentId||null,env:s.env&&Object.keys(s.env).length>0?s.env:null}}i(Ks,"buildRoutineMutationPayload");function di(){const{routineId:s,section:a}=ht(),{selectedCompanyId:n}=mt(),{setBreadcrumbs:c}=vt(),r=dt(),m=yt(),{pushToast:l}=Dt(),k=(0,u.useRef)(null),I=(0,u.useRef)(null),M=(0,u.useRef)(null),C=(0,u.useRef)(null),x=(0,u.useRef)(null),[S,D]=(0,u.useState)(null),[q,A]=(0,u.useState)(!1),[g,b]=(0,u.useState)(!1),[w,se]=(0,u.useState)(Ue),[v,P]=(0,u.useState)({title:"",description:"",projectId:"",assigneeAgentId:"",priority:"medium",concurrencyPolicy:"coalesce_if_active",catchUpPolicy:"skip_missed",activityGatePolicy:"always",activityGateScope:"company",variables:[],env:null}),j=ee(a)?a:"overview",_=(0,u.useCallback)((t,h)=>{s&&(le(s,t),m(`/routines/${s}/${t}`,{replace:h?.replace??!0}))},[m,s]),{data:o,isLoading:Q,error:U}=L({queryKey:p.routines.detail(s),queryFn:i(()=>T.get(s),"queryFn"),enabled:!!s}),R=o?.activeIssue?.id,{data:B}=L({queryKey:p.issues.liveRuns(R),queryFn:i(()=>Kt.liveRunsForIssue(R),"queryFn"),enabled:!!R,refetchInterval:3e3}),d=(B??[]).length>0,{data:y}=L({queryKey:p.routines.runs(s),queryFn:i(()=>T.listRuns(s),"queryFn"),enabled:!!s,refetchInterval:d?3e3:!1}),G=(0,u.useMemo)(()=>({triggerIds:o?.triggers.map(t=>t.id)??[],runIds:y?.map(t=>t.id)??[]}),[o?.triggers,y]),{data:Ve}=L({queryKey:[...p.routines.activity(n,s),G.triggerIds.join(","),G.runIds.join(",")],queryFn:i(()=>T.activity(n,s,G),"queryFn"),enabled:!!n&&!!s&&!!o}),{data:F}=L({queryKey:p.agents.list(n),queryFn:i(()=>bt.list(n),"queryFn"),enabled:!!n}),{data:K}=L({queryKey:p.projects.list(n,{includeArchived:!0}),queryFn:i(()=>Ot.list(n,{includeArchived:!0}),"queryFn"),enabled:!!n}),{data:fe}=L({queryKey:p.access.companyUserDirectory(n),queryFn:i(()=>Wt.listUserDirectory(n),"queryFn"),enabled:!!n}),{data:Ge=[]}=L({queryKey:n?p.secrets.list(n):["secrets","none"],queryFn:i(()=>Me.list(n),"queryFn"),enabled:!!n}),ze=W({mutationFn:i(t=>{if(!n)throw new Error("Select a company to create secrets");return Me.create(n,t)},"mutationFn"),onSuccess:i(()=>{n&&r.invalidateQueries({queryKey:p.secrets.list(n)})},"onSuccess")}),f=(0,u.useMemo)(()=>o?{title:o.title,description:o.description??"",projectId:o.projectId??"",assigneeAgentId:o.assigneeAgentId??"",priority:o.priority,concurrencyPolicy:o.concurrencyPolicy,catchUpPolicy:o.catchUpPolicy,activityGatePolicy:o.activityGatePolicy,activityGateScope:o.activityGateScope,variables:o.variables,env:o.env??null}:null,[o]),H=(0,u.useMemo)(()=>{if(!f)return[];const t=[];return v.title!==f.title&&t.push({key:"title",label:"the title"}),v.description!==f.description&&t.push({key:"description",label:"the description"}),v.projectId!==f.projectId&&t.push({key:"projectId",label:"the project"}),v.assigneeAgentId!==f.assigneeAgentId&&t.push({key:"assigneeAgentId",label:"the default agent"}),v.priority!==f.priority&&t.push({key:"priority",label:"the priority"}),v.concurrencyPolicy!==f.concurrencyPolicy&&t.push({key:"concurrencyPolicy",label:"the concurrency policy"}),v.catchUpPolicy!==f.catchUpPolicy&&t.push({key:"catchUpPolicy",label:"the catch-up policy"}),v.activityGatePolicy!==f.activityGatePolicy&&t.push({key:"activityGatePolicy",label:"the advanced run policy"}),v.activityGateScope!==f.activityGateScope&&t.push({key:"activityGateScope",label:"the activity gate scope"}),JSON.stringify(v.variables)!==JSON.stringify(f.variables)&&t.push({key:"variables",label:"the variables"}),JSON.stringify(v.env??null)!==JSON.stringify(f.env??null)&&t.push({key:"env",label:"the secrets"}),t},[v,f]),ie=H.length>0,J=(0,u.useCallback)(t=>{const h=qe[t];return h?H.filter(N=>h.includes(N.key)):[]},[H]),ne=(0,u.useCallback)(t=>J(t).length>0,[J]),be=(0,u.useCallback)(t=>{if(!f)return;const h=qe[t];h&&P(N=>{const Re={...N};for(const Te of h)Re[Te]=f[Te];return Re})},[f]);(0,u.useEffect)(()=>{o&&(c([{label:"Routines",href:"/routines"},{label:o.title}]),f&&(k.current!==o.id||!ie)&&(P(f),k.current=o.id))},[o,f,ie,c]),(0,u.useEffect)(()=>{Ke(I.current)},[v.title,o?.id]),(0,u.useEffect)(()=>{s&&ee(a)&&le(s,a)},[s,a]);const Qe=(0,u.useCallback)(async(t,h)=>{try{await Mt(h),l({title:`${t} copied`,tone:"success"})}catch(N){l({title:`Failed to copy ${t.toLowerCase()}`,body:N instanceof Error?N.message:"Clipboard access was denied.",tone:"error"})}},[l]),Z=W({mutationFn:i(()=>{const t=Ks(v),h=o?.latestRevisionId??null;return T.update(s,{...t,...h?{baseRevisionId:h}:{}})},"mutationFn"),onSuccess:i(async()=>{A(!1),await Promise.all([r.invalidateQueries({queryKey:p.routines.detail(s)}),r.invalidateQueries({queryKey:p.routines.list(n)}),r.invalidateQueries({queryKey:p.routines.activity(n,s)}),r.invalidateQueries({queryKey:p.routines.revisions(s)})])},"onSuccess"),onError:i(t=>{if(t instanceof pt&&t.status===409){A(!0),l({title:"Routine changed",body:"Someone else updated this routine. Reload to see the latest revision.",tone:"warn"});return}l({title:"Failed to save routine",body:t instanceof Error?t.message:"Paperclip could not save the routine.",tone:"error"})},"onError")}),X=W({mutationFn:i(t=>T.run(s,{...t?.variables&&Object.keys(t.variables).length>0?{variables:t.variables}:{},...t?.assigneeAgentId!==void 0?{assigneeAgentId:t.assigneeAgentId}:{},...t?.projectId!==void 0?{projectId:t.projectId}:{},...t?.executionWorkspaceId!==void 0?{executionWorkspaceId:t.executionWorkspaceId}:{},...t?.executionWorkspacePreference!==void 0?{executionWorkspacePreference:t.executionWorkspacePreference}:{},...t?.executionWorkspaceSettings!==void 0?{executionWorkspaceSettings:t.executionWorkspaceSettings}:{}}),"mutationFn"),onSuccess:i(async()=>{l({title:"Routine run started",tone:"success"}),b(!1),_("runs"),await Promise.all([r.invalidateQueries({queryKey:p.routines.detail(s)}),r.invalidateQueries({queryKey:p.routines.runs(s)}),r.invalidateQueries({queryKey:p.routines.list(n)}),r.invalidateQueries({queryKey:p.routines.activity(n,s)})])},"onSuccess"),onError:i(t=>{l({title:"Routine run failed",body:t instanceof Error?t.message:"Paperclip could not start the routine run.",tone:"error"})},"onError")}),je=W({mutationFn:i(t=>T.update(s,{status:t}),"mutationFn"),onSuccess:i(async(t,h)=>{l({title:"Routine saved",body:h==="paused"?"Automation paused.":"Automation enabled.",tone:"success"}),await Promise.all([r.invalidateQueries({queryKey:p.routines.detail(s)}),r.invalidateQueries({queryKey:p.routines.list(n)})])},"onSuccess"),onError:i(t=>{l({title:"Failed to update routine",body:t instanceof Error?t.message:"Paperclip could not update the routine.",tone:"error"})},"onError")}),Be=W({mutationFn:i(async()=>{const t=(o?.triggers??[]).filter(N=>N.kind===w.kind).length,h=t>0?`${w.kind}-${t+1}`:w.kind;return T.createTrigger(s,{kind:w.kind,label:h,...w.kind==="schedule"?{cronExpression:w.cronExpression.trim(),timezone:Fs()}:{},...w.kind==="webhook"?{signingMode:w.signingMode,replayWindowSec:Number(w.replayWindowSec||"300")}:{}})},"mutationFn"),onSuccess:i(async t=>{t.secretMaterial?D({title:"Webhook trigger created",entries:[{webhookUrl:t.secretMaterial.webhookUrl,webhookSecret:t.secretMaterial.webhookSecret}]}):l({title:"Trigger added",body:"The routine schedule was saved.",tone:"success"}),await Promise.all([r.invalidateQueries({queryKey:p.routines.detail(s)}),r.invalidateQueries({queryKey:p.routines.list(n)}),r.invalidateQueries({queryKey:p.routines.activity(n,s)})])},"onSuccess"),onError:i(t=>{l({title:"Failed to add trigger",body:t instanceof Error?t.message:"Paperclip could not create the trigger.",tone:"error"})},"onError")}),He=W({mutationFn:i(({id:t,patch:h})=>T.updateTrigger(t,h),"mutationFn"),onSuccess:i(async()=>{l({title:"Trigger saved",body:"The routine cadence update was saved.",tone:"success"}),await Promise.all([r.invalidateQueries({queryKey:p.routines.detail(s)}),r.invalidateQueries({queryKey:p.routines.list(n)}),r.invalidateQueries({queryKey:p.routines.activity(n,s)})])},"onSuccess"),onError:i(t=>{l({title:"Failed to update trigger",body:t instanceof Error?t.message:"Paperclip could not update the trigger.",tone:"error"})},"onError")}),Je=W({mutationFn:i(t=>T.deleteTrigger(t),"mutationFn"),onSuccess:i(async()=>{l({title:"Trigger deleted",tone:"success"}),await Promise.all([r.invalidateQueries({queryKey:p.routines.detail(s)}),r.invalidateQueries({queryKey:p.routines.list(n)}),r.invalidateQueries({queryKey:p.routines.activity(n,s)})])},"onSuccess"),onError:i(t=>{l({title:"Failed to delete trigger",body:t instanceof Error?t.message:"Paperclip could not delete the trigger.",tone:"error"})},"onError")}),Ze=W({mutationFn:i(t=>T.rotateTriggerSecret(t),"mutationFn"),onSuccess:i(async t=>{D({title:"Webhook secret rotated",entries:[{webhookUrl:t.secretMaterial.webhookUrl,webhookSecret:t.secretMaterial.webhookSecret}]}),await Promise.all([r.invalidateQueries({queryKey:p.routines.detail(s)}),r.invalidateQueries({queryKey:p.routines.activity(n,s)})])},"onSuccess"),onError:i(t=>{l({title:"Failed to rotate webhook secret",body:t instanceof Error?t.message:"Paperclip could not rotate the webhook secret.",tone:"error"})},"onError")}),we=(0,u.useMemo)(()=>new Map((F??[]).map(t=>[t.id,t])),[F]),Ne=(0,u.useMemo)(()=>new Map((K??[]).map(t=>[t.id,t])),[K]),ae=(0,u.useMemo)(()=>Ct(),[o?.id]),Xe=(0,u.useMemo)(()=>At(),[o?.id]),Ye=(0,u.useMemo)(()=>Nt((F??[]).filter(t=>t.status!=="terminated"),ae).map(t=>({id:t.id,label:t.name,searchText:`${t.name} ${t.role} ${t.title??""}`})),[F,ae]),et=(0,u.useMemo)(()=>_s(K??[]),[K]),tt=(0,u.useMemo)(()=>Lt({agents:F,projects:(K??[]).filter(t=>!t.archivedAt),members:fe?.users}),[F,fe?.users,K]),st=(0,u.useCallback)(t=>{P(h=>{const N=typeof t=="function"?t(h):t;return N.assigneeAgentId&&N.assigneeAgentId!==h.assigneeAgentId&&kt(N.assigneeAgentId),N.projectId&&N.projectId!==h.projectId&&St(N.projectId),N})},[]),it=v.assigneeAgentId?we.get(v.assigneeAgentId)??null:null,nt=v.projectId?Ne.get(v.projectId)??null:null,ke=(0,u.useCallback)(()=>{A(!1),f&&P(f),r.invalidateQueries({queryKey:p.routines.detail(s)})},[r,f,s]),at=(0,u.useCallback)(t=>{t.secretMaterials.length>0&&(_("triggers"),D({title:t.secretMaterials.length===1?"Webhook trigger restored":`${t.secretMaterials.length} webhook triggers restored`,entries:t.secretMaterials.map(h=>({webhookUrl:h.webhookUrl,webhookSecret:h.webhookSecret}))}))},[_]),rt=(0,u.useCallback)(t=>{A(!1),r.setQueryData(p.routines.detail(s),h=>h&&{...h,...t.routine,latestRevisionId:t.revision.id,latestRevisionNumber:t.revision.revisionNumber}),P({title:t.routine.title,description:t.routine.description??"",projectId:t.routine.projectId??"",assigneeAgentId:t.routine.assigneeAgentId??"",priority:t.routine.priority,concurrencyPolicy:t.routine.concurrencyPolicy,catchUpPolicy:t.routine.catchUpPolicy,activityGatePolicy:t.routine.activityGatePolicy,activityGateScope:t.routine.activityGateScope,variables:t.routine.variables,env:t.routine.env??null}),k.current=t.routine.id},[r,s]);if(!n)return(0,e.jsx)(te,{icon:It,message:"Select a company to view routines."});const re=new URLSearchParams(window.location.search).get("tab");if(s&&re&&Fe[re])return(0,e.jsx)(oe,{to:`/routines/${s}/${Fe[re]}`,replace:!0});if(s&&!a){const t=qs(s)??"overview";return(0,e.jsx)(oe,{to:`/routines/${s}/${t}`,replace:!0})}if(s&&a&&!ee(a))return(0,e.jsx)(oe,{to:`/routines/${s}/overview`,replace:!0});if(Q)return(0,e.jsx)(Vt,{variant:"issues-list"});if(U||!o||!f)return(0,e.jsx)(te,{icon:qt,message:U instanceof Error?U.message:"We couldn't load this routine."});const $=o.status==="active",Se=je.isPending||o.status==="archived",Ie=o.status==="archived"?"Archived":o.assigneeAgentId?$?"Active":"Paused":"Draft",Ce=o.status==="archived"?"text-muted-foreground":$?"text-emerald-400":"text-muted-foreground",Ae={routine:o,routineId:s,companyId:o.companyId,editDraft:v,setEditDraft:st,routineDefaults:f,dirtyFields:H,isEditDirty:ie,sectionDirtyFields:J,isSectionDirty:ne,discardSection:be,saveRoutine:Z,saveConflict:q,reloadLatest:ke,automationEnabled:$,automationLabel:Ie,automationLabelClassName:Ce,automationToggleDisabled:Se,onToggleAutomation:i(()=>{if(!$&&!o.assigneeAgentId){l({title:"Default agent required",body:"Set a default agent before enabling routine automation.",tone:"warn"});return}je.mutate($?"paused":"active")},"onToggleAutomation"),onOpenRunDialog:i(()=>b(!0),"onOpenRunDialog"),runRoutinePending:X.isPending,newTrigger:w,setNewTrigger:se,createTrigger:Be,updateTrigger:He,deleteTrigger:Je,rotateTrigger:Ze,secretMessage:S,setSecretMessage:D,copySecretValue:Qe,availableSecrets:Ge,createSecret:ze,agents:F??[],projects:K??[],agentById:we,projectById:Ne,assigneeOptions:Ye,projectOptions:et,recentAssigneeIds:ae,recentProjectIds:Xe,mentionOptions:tt,currentAssignee:it,currentProject:nt,routineRuns:y,activity:Ve,hasLiveRun:d,activeIssueId:R,titleInputRef:I,descriptionEditorRef:M,assigneeSelectorRef:C,projectSelectorRef:x,onHistoryRestoreSecretMaterials:at,onHistoryRestored:rt,navigateToSection:_},Pe=Yt.includes(j);return(0,e.jsxs)(Ht.Provider,{value:Ae,children:[(0,e.jsx)("a",{href:"#routine-section",className:"sr-only focus:not-sr-only focus:absolute focus:left-2 focus:top-2 focus:z-20 focus:rounded focus:bg-background focus:px-3 focus:py-1.5 focus:text-sm",children:"Skip to section"}),(0,e.jsxs)("div",{className:"-m-4 flex h-full min-h-0 flex-col overflow-hidden md:-m-6",children:[(0,e.jsxs)("header",{className:"flex h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-6",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,e.jsx)("textarea",{ref:I,"data-autosize-title":!0,className:"min-w-0 flex-1 resize-none overflow-hidden bg-transparent text-base font-semibold leading-7 outline-none placeholder:text-muted-foreground/50",placeholder:"Routine title",rows:1,value:v.title,onChange:i(t=>{P(h=>({...h,title:t.target.value})),Ke(t.target)},"onChange"),onKeyDown:i(t=>{t.key==="Enter"&&!t.metaKey&&!t.ctrlKey&&!t.nativeEvent.isComposing&&(t.preventDefault(),j==="overview"?M.current?.focus():_("overview"))},"onKeyDown")}),o.managedByPlugin?(0,e.jsxs)(ye,{variant:"outline",className:"hidden shrink-0 gap-1.5 text-xs text-muted-foreground sm:inline-flex",children:[(0,e.jsx)(ft,{className:"h-3 w-3"}),o.managedByPlugin.pluginDisplayName,(0,e.jsx)("span",{className:"font-mono text-(length:--text-nano)",children:o.managedByPlugin.resourceKey})]}):null]}),(0,e.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-3",children:[(0,e.jsx)(os,{onClick:i(()=>b(!0),"onClick"),disabled:X.isPending}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(jt,{size:"default",checked:$,onCheckedChange:Ae.onToggleAutomation,disabled:Se,"aria-label":$?"Pause automatic triggers":"Enable automatic triggers"}),(0,e.jsx)("span",{className:`text-sm font-medium ${Ce}`,children:Ie})]})]})]}),(0,e.jsx)(Gt,{activeSection:j,onNavigate:_,isSectionDirty:ne}),(0,e.jsxs)("div",{className:"flex min-h-0 flex-1",children:[(0,e.jsx)(ls,{activeSection:j,hrefFor:i(t=>`/routines/${s}/${t}`,"hrefFor"),isSectionDirty:ne,hasLiveRun:d,onNavigate:i(t=>le(s,t),"onNavigate")}),(0,e.jsx)("main",{id:"routine-section",role:"main",className:"min-h-0 min-w-0 flex-1 overflow-y-auto px-4 pb-6 pt-10 md:px-8",children:(0,e.jsxs)("section",{"aria-labelledby":"routine-section-title",className:Pe?"mx-auto w-full max-w-3xl":"w-full",children:[(0,e.jsx)(Zt,{title:Ms[j],copyText:j==="overview"?ps({editing:!0,draft:v.description,saved:o.description}):null}),j==="overview"&&(0,e.jsx)(Cs,{}),j==="triggers"&&(0,e.jsx)(As,{}),j==="variables"&&(0,e.jsx)(Ps,{}),j==="secrets"&&(0,e.jsx)(Rs,{}),j==="delivery"&&(0,e.jsx)(Ts,{}),j==="runs"&&(0,e.jsx)(zt,{}),j==="activity"&&(0,e.jsx)(ms,{}),j==="history"&&(0,e.jsx)(ns,{}),Pe?(0,e.jsx)(ds,{dirtyFields:J(j),isSaving:Z.isPending,saveConflict:q,onSave:i(()=>{!Z.isPending&&v.title.trim()&&Z.mutate()},"onSave"),onDiscard:i(()=>be(j),"onDiscard"),onReload:ke}):null]})})]})]}),(0,e.jsx)(Pt,{open:g,onOpenChange:b,companyId:o.companyId,routineName:o.title,agents:F??[],projects:K??[],defaultProjectId:o.projectId,defaultAssigneeAgentId:o.assigneeAgentId,variables:o.variables??[],isPending:X.isPending,onSubmit:i(t=>X.mutate(t),"onSubmit")})]})}i(di,"RoutineDetail");export{di as RoutineDetail};
|