@exulu/frontend 1.9.0 → 1.10.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/.next/BUILD_ID +1 -1
- package/dist/.next/app-build-manifest.json +140 -140
- package/dist/.next/app-path-routes-manifest.json +1 -1
- package/dist/.next/build-manifest.json +2 -2
- package/dist/.next/prerender-manifest.json +1 -1
- package/dist/.next/server/app/(application)/agents/edit/[id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/agents/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js +7 -7
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/configuration/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/dashboard/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/data/[[...query]]/page.js +3 -3
- package/dist/.next/server/app/(application)/data/[[...query]]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/explorer/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/keys/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/projects/[project]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/projects/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/prompts/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/roles/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/token/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/users/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/create/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/workflows/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(authentication)/login/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found.html +1 -1
- package/dist/.next/server/app/_not-found.rsc +1 -1
- package/dist/.next/server/app-paths-manifest.json +6 -6
- package/dist/.next/server/chunks/2270.js +17 -6
- package/dist/.next/server/chunks/5485.js +1 -1
- package/dist/.next/server/chunks/5974.js +1 -1
- package/dist/.next/server/middleware-manifest.json +5 -5
- package/dist/.next/server/pages/404.html +1 -1
- package/dist/.next/server/pages/500.html +1 -1
- package/dist/.next/server/server-reference-manifest.json +1 -1
- package/dist/.next/static/chunks/3750-e3d1b2cccd265190.js +2 -0
- package/dist/.next/static/chunks/3750-e3d1b2cccd265190.js.map +1 -0
- package/dist/.next/static/chunks/{3832-417a5eeee712a793.js → 3832-d7782d6a2771ae6c.js} +1 -1
- package/dist/.next/static/chunks/{3832-417a5eeee712a793.js.map → 3832-d7782d6a2771ae6c.js.map} +1 -1
- package/dist/.next/static/chunks/6280-50b751f993f2fe4f.js +2 -0
- package/dist/.next/static/chunks/6280-50b751f993f2fe4f.js.map +1 -0
- package/dist/.next/static/chunks/{6373-601400fab8a3bb55.js → 6373-aef582adc575d3ca.js} +2 -2
- package/dist/.next/static/chunks/6373-aef582adc575d3ca.js.map +1 -0
- package/dist/.next/static/chunks/{8293-0e69d89d2dac7111.js → 8293-ba5cd36594e6fde1.js} +3 -3
- package/dist/.next/static/chunks/8293-ba5cd36594e6fde1.js.map +1 -0
- package/dist/.next/static/chunks/9105-d8ff41060f7ffc85.js +2 -0
- package/dist/.next/static/chunks/9105-d8ff41060f7ffc85.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/{page-7edb1c7c850f982c.js → page-d59534ca19eee51f.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/{page-7edb1c7c850f982c.js.map → page-d59534ca19eee51f.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-0c7c1b0e1713bf60.js +2 -0
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-0c7c1b0e1713bf60.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-7db6bfbf02606136.js +2 -0
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-7db6bfbf02606136.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/explorer/{page-1d676c9dfe3ed58b.js → page-e6b1c034c07776e2.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/explorer/{page-1d676c9dfe3ed58b.js.map → page-e6b1c034c07776e2.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/token/{page-3f74f711f3d04fce.js → page-3acc39cb8a718331.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/token/{page-3f74f711f3d04fce.js.map → page-3acc39cb8a718331.js.map} +1 -1
- package/dist/.next/static/chunks/ba12c10f-85ed008ce7746dbe.js +2 -0
- package/dist/.next/static/chunks/ba12c10f-85ed008ce7746dbe.js.map +1 -0
- package/dist/.next/static/css/9c08ae5d990a6b14.css +4 -0
- package/dist/.next/static/css/9c08ae5d990a6b14.css.map +1 -0
- package/dist/.next/static/css/e3f2a16ab7676b05.css.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/.next/static/chunks/3750-f45c59ef1cc79417.js +0 -2
- package/dist/.next/static/chunks/3750-f45c59ef1cc79417.js.map +0 -1
- package/dist/.next/static/chunks/572-2940a399da1e3a3b.js +0 -2
- package/dist/.next/static/chunks/572-2940a399da1e3a3b.js.map +0 -1
- package/dist/.next/static/chunks/6373-601400fab8a3bb55.js.map +0 -1
- package/dist/.next/static/chunks/8293-0e69d89d2dac7111.js.map +0 -1
- package/dist/.next/static/chunks/9105-dfbce1bad8e3e8dd.js +0 -2
- package/dist/.next/static/chunks/9105-dfbce1bad8e3e8dd.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-2d47be0ee80dd89d.js +0 -2
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-2d47be0ee80dd89d.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-8d2b3995cacfd832.js +0 -2
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-8d2b3995cacfd832.js.map +0 -1
- package/dist/.next/static/chunks/ba12c10f-aaafcb074f608624.js +0 -2
- package/dist/.next/static/chunks/ba12c10f-aaafcb074f608624.js.map +0 -1
- package/dist/.next/static/css/6f8c5212af8ef284.css +0 -4
- package/dist/.next/static/css/6f8c5212af8ef284.css.map +0 -1
- /package/dist/.next/static/{ls-syPkq9-MWp-VWWDEZJ → 3j63p6b3zZZB_v1Hn8Mxp}/_buildManifest.js +0 -0
- /package/dist/.next/static/{ls-syPkq9-MWp-VWWDEZJ → 3j63p6b3zZZB_v1Hn8Mxp}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9105],{8864:function(e,s,a){a.d(s,{R:function(){return S}});var l=a(57437),i=a(2265),n=a(7211),t=a(12199),r=a(27689),d=a(62869),c=a(66070),o=a(19060),u=a(73578),x=a(12339),h=a(37099),m=a(35974),j=a(15863),v=a(33276),g=a(89227),p=a(93609),b=a(18930),f=a(52636),N=a(92451),y=a(10407),w=a(77992),C=a(27107),P=a(68656),k=a(20653);function S(e){var s,a,S,Z,q,z,R,T,D,I,O,A;let{queueName:J,nameGenerator:Q,retryJob:L}=e,{toast:M}=(0,w.pm)(),[_,E]=(0,i.useState)(!1),[F,Y]=(0,i.useState)(!1),[$,G]=(0,i.useState)(!1),[W,X]=(0,i.useState)([]),[B,H]=(0,i.useState)(null),[V,K]=(0,i.useState)("completed"),[U,ee]=(0,i.useState)(1),[es,ea]=(0,i.useState)(20),[el,ei]=(0,i.useState)(new Set),{data:en,loading:et,refetch:er}=(0,n.aM)(r.k9,{variables:{queue:J},pollInterval:5e3}),{data:ed,loading:ec,refetch:eo,networkStatus:eu}=(0,n.aM)(r.Jq,{variables:{queue:J,statusses:V,page:U,limit:es},pollInterval:5e3}),[ex,{loading:eh}]=(0,t.D)(r.Wr,{onError:e=>{M({title:"Failed to delete job",description:e.message,variant:"destructive"})}}),[em,{loading:ej}]=(0,t.D)(r.fc,{onCompleted:()=>{M({title:"Queue paused",description:"The ".concat(J," queue has been paused.")}),er(),E(!1)},onError:e=>{M({title:"Failed to pause queue",description:e.message,variant:"destructive"})}}),[ev,{loading:eg}]=(0,t.D)(r.iC,{onCompleted:()=>{M({title:"Queue resumed",description:"The ".concat(J," queue has been resumed.")}),er(),G(!1)},onError:e=>{M({title:"Failed to resume queue",description:e.message,variant:"destructive"})}}),[ep,{loading:eb}]=(0,t.D)(r.QW,{onCompleted:()=>{M({title:"Queue drained",description:"All waiting and delayed jobs have been removed from the queue."}),er(),eo(),Y(!1)},onError:e=>{M({title:"Failed to drain queue",description:e.message,variant:"destructive"})}}),ef=e=>{X([e])},eN=e=>{H(e)},ey=e=>{let s=new Set(el);s.has(e)?s.delete(e):s.add(e),ei(s)},ew=async()=>{if(W.filter(e=>!e.id).length>0){M({title:"Failed to delete jobs",description:"Some jobs have no ID.",variant:"destructive"});return}try{await Promise.all(W.map(e=>ex({variables:{queue:J,id:e.id}}))),M({title:1===W.length?"Job deleted":"Jobs deleted",description:"Successfully deleted ".concat(W.length," job").concat(1===W.length?"":"s",".")}),eo(),er(),X([]),ei(new Set)}catch(e){}},eC=null==en?void 0:en.queue,eP=(null==ed?void 0:ed.jobs)||{items:[],pageInfo:{pageCount:0,itemCount:0,currentPage:1,hasPreviousPage:!1,hasNextPage:!1}},ek=e=>(0,l.jsx)(m.C,{variant:"outline",className:{active:"bg-blue-100 text-blue-800 border-blue-200",waiting:"bg-yellow-100 text-yellow-800 border-yellow-200",completed:"bg-green-100 text-green-800 border-green-200",failed:"bg-red-100 text-red-800 border-red-200",delayed:"bg-orange-100 text-orange-800 border-orange-200",paused:"bg-gray-100 text-gray-800 border-gray-200"}[e]||"bg-gray-100 text-gray-800",children:e});return et&&ec?(0,l.jsx)("div",{className:"space-y-4",children:(0,l.jsx)(c.Zb,{children:(0,l.jsx)(c.aY,{className:"pt-6",children:(0,l.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,l.jsx)(j.Z,{className:"h-6 w-6 animate-spin"})})})})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(c.Zb,{children:[(0,l.jsx)(c.Ol,{children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("div",{className:"flex items-center gap-3",children:(0,l.jsxs)("div",{children:[(0,l.jsxs)(c.ll,{children:["Queue: ",J]}),(0,l.jsxs)(c.SZ,{children:["Manage the ",J," job queue and view all jobs."]})]})}),eC&&(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsxs)(d.z,{variant:"outline",size:"sm",onClick:()=>(null==eC?void 0:eC.isPaused)?G(!0):E(!0),disabled:ej||eg,children:[(null==eC?void 0:eC.isPaused)?(0,l.jsx)(v.Z,{className:"mr-2 h-4 w-4"}):(0,l.jsx)(g.Z,{className:"mr-2 h-4 w-4"}),(null==eC?void 0:eC.isPaused)?"Resume queue":"Pause queue"]}),(0,l.jsxs)(d.z,{variant:"outline",size:"sm",onClick:()=>Y(!0),disabled:eb,children:[(0,l.jsx)(p.Z,{className:"mr-2 h-4 w-4"}),"Drain queue"]})]})]})}),(0,l.jsxs)(c.aY,{className:"space-y-6",children:[eC&&(0,l.jsxs)("div",{className:"flex items-center gap-8 p-4 bg-muted/50 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"text-sm text-muted-foreground",children:"Status:"}),(0,l.jsx)("div",{children:eC.isPaused?(0,l.jsx)(m.C,{variant:"outline",className:"bg-gray-100 text-gray-800",children:"Paused"}):eC.isMaxed?(0,l.jsx)(m.C,{variant:"outline",className:"bg-red-100 text-red-800",children:"Maxed"}):(0,l.jsx)(m.C,{variant:"outline",className:"bg-green-100 text-green-800",children:"Active"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"text-sm text-muted-foreground",children:"Concurrency:"}),(0,l.jsxs)("div",{className:"font-semibold",children:["Per queue global concurrency: ",(null===(s=eC.concurrency)||void 0===s?void 0:s.queue)||"None","Per worker concurrency: ",(null===(a=eC.concurrency)||void 0===a?void 0:a.worker)||"None","."]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"text-sm text-muted-foreground",children:"Rate Limit:"}),(0,l.jsx)("div",{className:"font-semibold",children:eC.ratelimit||"None"})]}),(0,l.jsx)(x.mQ,{value:V,onValueChange:e=>K(e),className:"w-auto",children:(0,l.jsxs)(x.dr,{children:[(0,l.jsxs)(x.SP,{value:"active",className:"gap-1.5",children:[(0,l.jsx)("span",{children:"Active"}),(0,l.jsx)(m.C,{variant:"secondary",className:"ml-1 bg-blue-100 text-blue-600 border-blue-200",children:(null===(S=eC.jobs)||void 0===S?void 0:S.active)||0})]}),(0,l.jsxs)(x.SP,{value:"waiting",className:"gap-1.5",children:[(0,l.jsx)("span",{children:"Waiting"}),(0,l.jsx)(m.C,{variant:"secondary",className:"ml-1 bg-yellow-100 text-yellow-600 border-yellow-200",children:(null===(Z=eC.jobs)||void 0===Z?void 0:Z.waiting)||0})]}),(0,l.jsxs)(x.SP,{value:"failed",className:"gap-1.5",children:[(0,l.jsx)("span",{children:"Failed"}),(0,l.jsx)(m.C,{variant:"secondary",className:"ml-1 bg-red-100 text-red-600 border-red-200",children:(null===(q=eC.jobs)||void 0===q?void 0:q.failed)||0})]}),(0,l.jsxs)(x.SP,{value:"completed",className:"gap-1.5",children:[(0,l.jsx)("span",{children:"Completed"}),(0,l.jsx)(m.C,{variant:"secondary",className:"ml-1 bg-green-100 text-green-600 border-green-200",children:(null===(z=eC.jobs)||void 0===z?void 0:z.completed)||0})]})]})})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-sm font-semibold",children:"Queue Jobs"}),(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:["All jobs currently in the ",J," queue"]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[el.size>0&&(0,l.jsxs)(d.z,{variant:"destructive",size:"sm",onClick:()=>{X(eP.items.filter(e=>el.has(e.id)))},disabled:eh,children:[(0,l.jsx)(b.Z,{className:"mr-2 h-4 w-4"}),"Delete ",el.size," job",1===el.size?"":"s"]}),(0,l.jsxs)(m.C,{variant:"outline",children:["Auto Refresh: ",(0,l.jsx)(j.Z,{className:"h-4 w-4 animate-spin text-muted-foreground ml-1"})]})]})]}),(0,l.jsxs)("div",{className:"border rounded-lg",children:[ec?(0,l.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,l.jsx)(j.Z,{className:"h-6 w-6 animate-spin"})}):(null===(R=eP.items)||void 0===R?void 0:R.length)===0?(0,l.jsx)("div",{className:"text-center pt-8 text-muted-foreground",children:"No jobs in queue"}):(0,l.jsxs)(u.iA,{children:[(0,l.jsx)(u.xD,{children:(0,l.jsxs)(u.SC,{children:[(0,l.jsx)(u.ss,{className:"w-12",children:(0,l.jsx)(o.X,{checked:eP.items.filter(e=>"active"!==e.state).length>0&&el.size===eP.items.filter(e=>"active"!==e.state).length,onCheckedChange:()=>{let e=eP.items.filter(e=>"active"!==e.state);el.size===e.length&&e.length>0?ei(new Set):ei(new Set(e.map(e=>e.id)))},"aria-label":"Select all jobs"})}),(0,l.jsx)(u.ss,{children:"Name"}),(0,l.jsx)(u.ss,{children:"ID"}),(0,l.jsx)(u.ss,{children:"State"}),(0,l.jsx)(u.ss,{children:"Timestamp"}),(0,l.jsx)(u.ss,{children:"Inputs"}),(0,l.jsx)(u.ss,{children:"Outputs"}),(0,l.jsx)(u.ss,{className:"text-right",children:"Actions"})]})}),(0,l.jsx)(u.RM,{children:null===(T=eP.items)||void 0===T?void 0:T.map((e,s)=>(0,l.jsxs)(u.SC,{children:[(0,l.jsx)(u.pj,{children:(0,l.jsx)(o.X,{checked:el.has(e.id),onCheckedChange:()=>ey(e.id),disabled:"active"===e.state,"aria-label":"Select job ".concat(Q(e))})}),(0,l.jsx)(u.pj,{className:"font-medium max-w-[200px] truncate",children:Q(e)}),(0,l.jsx)(u.pj,{children:e.id}),(0,l.jsx)(u.pj,{children:ek(e.state)}),(0,l.jsx)(u.pj,{children:e.timestamp?(0,C.WU)(new Date(e.timestamp),"MMM d, yyyy HH:mm:ss"):"N/A"}),(0,l.jsx)(u.pj,{children:e.data?(0,l.jsx)("div",{className:"text-xs max-w-[200px] truncate",children:(0,l.jsx)(P.J,{text:JSON.stringify(e.data)})}):null}),(0,l.jsx)(u.pj,{children:e.failedReason?(0,l.jsx)("div",{className:"text-xs text-red-600 max-w-[200px] truncate",children:(0,l.jsx)(P.J,{text:"Error: "+e.failedReason})}):(0,l.jsx)("div",{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:(0,l.jsx)(P.J,{text:JSON.stringify(e.returnvalue)})})}),(0,l.jsxs)(u.pj,{className:"text-right",children:["active"!==e.state&&(0,l.jsx)(d.z,{variant:"ghost",size:"sm",onClick:()=>ef(e),disabled:eh,children:(0,l.jsx)(b.Z,{className:"h-4 w-4 text-red-600"})}),"failed"===e.state&&(0,l.jsxs)(d.z,{variant:"ghost",size:"sm",onClick:()=>eN(e),children:[(0,l.jsx)(f.Z,{className:"h-4 w-4 text-blue-600"}),"Retry"]})]})]},s))})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between px-2 pb-2",children:[(0,l.jsxs)("div",{className:"flex-1 text-sm text-muted-foreground",children:["(",(null==eP?void 0:null===(D=eP.pageInfo)||void 0===D?void 0:D.itemCount)||0," total"," ","items)."]}),(0,l.jsx)("div",{className:"flex items-center space-x-6 lg:space-x-8",children:(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsxs)(d.z,{variant:"outline",className:"hidden size-8 p-0 lg:flex",onClick:()=>{ee(1),eo()},disabled:!(null==eP?void 0:null===(I=eP.pageInfo)||void 0===I?void 0:I.hasPreviousPage),children:[(0,l.jsx)("span",{className:"sr-only",children:"Go to first page"}),(0,l.jsx)(k.kRt,{className:"size-4"})]}),(0,l.jsxs)(d.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{var e,s,a;console.log("itemsData.data?.pageInfo.hasPreviousPage",null==eP?void 0:null===(e=eP.pageInfo)||void 0===e?void 0:e.hasPreviousPage),ee((null==eP?void 0:null===(s=eP.pageInfo)||void 0===s?void 0:s.hasPreviousPage)?(null==eP?void 0:null===(a=eP.pageInfo)||void 0===a?void 0:a.currentPage)-1:1),eo()},disabled:!(null==eP?void 0:null===(O=eP.pageInfo)||void 0===O?void 0:O.hasPreviousPage),children:[(0,l.jsx)("span",{className:"sr-only",children:"Go to previous page"}),(0,l.jsx)(N.Z,{className:"size-4"})]}),(0,l.jsxs)(d.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{var e,s;ee((null==eP?void 0:null===(e=eP.pageInfo)||void 0===e?void 0:e.hasNextPage)?(null==eP?void 0:null===(s=eP.pageInfo)||void 0===s?void 0:s.currentPage)+1:1),eo()},disabled:!(null==eP?void 0:eP.pageInfo.hasNextPage),children:[(0,l.jsx)("span",{className:"sr-only",children:"Go to next page"}),(0,l.jsx)(y.Z,{className:"size-4"})]})]})})]})]})]})]})]}),(0,l.jsx)(h.aR,{open:W.length>0,onOpenChange:e=>!e&&X([]),children:(0,l.jsxs)(h._T,{children:[(0,l.jsxs)(h.fY,{children:[(0,l.jsx)(h.f$,{children:1===W.length?"Delete Job?":"Delete ".concat(W.length," Jobs?")}),(0,l.jsx)(h.yT,{children:1===W.length?'Are you sure you want to delete the job "'.concat(null===(A=W[0])||void 0===A?void 0:A.name,'"? This action cannot be undone.'):"Are you sure you want to delete ".concat(W.length," jobs? This action cannot be undone.")})]}),(0,l.jsxs)(h.xo,{children:[(0,l.jsx)(h.le,{children:"Cancel"}),(0,l.jsxs)(h.OL,{onClick:ew,disabled:eh,children:[eh&&(0,l.jsx)(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Delete"]})]})]})}),(0,l.jsx)(h.aR,{open:!!B,onOpenChange:e=>!e&&H(null),children:(0,l.jsxs)(h._T,{children:[(0,l.jsxs)(h.fY,{children:[(0,l.jsx)(h.f$,{children:"Retry Job?"}),(0,l.jsxs)(h.yT,{children:['Are you sure you want to retry the job "',null==B?void 0:B.name,'"? This will schedule a new job with the same data.']})]}),(0,l.jsxs)(h.xo,{children:[(0,l.jsx)(h.le,{children:"Cancel"}),(0,l.jsx)(h.OL,{onClick:()=>{B&&L(B)},disabled:eh,children:"Retry"})]})]})}),(0,l.jsx)(h.aR,{open:_,onOpenChange:E,children:(0,l.jsxs)(h._T,{children:[(0,l.jsxs)(h.fY,{children:[(0,l.jsx)(h.f$,{children:"Pause Queue?"}),(0,l.jsxs)(h.yT,{children:["Are you sure you want to pause the ",J," queue? No jobs will be processed until the queue is resumed."]})]}),(0,l.jsxs)(h.xo,{children:[(0,l.jsx)(h.le,{children:"Cancel"}),(0,l.jsxs)(h.OL,{onClick:()=>{em({variables:{queue:J}})},disabled:ej,children:[ej&&(0,l.jsx)(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Pause Queue"]})]})]})}),(0,l.jsx)(h.aR,{open:$,onOpenChange:G,children:(0,l.jsxs)(h._T,{children:[(0,l.jsxs)(h.fY,{children:[(0,l.jsx)(h.f$,{children:"Resume Queue?"}),(0,l.jsxs)(h.yT,{children:["Are you sure you want to resume the ",J," queue?."]})]}),(0,l.jsxs)(h.xo,{children:[(0,l.jsx)(h.le,{children:"Cancel"}),(0,l.jsxs)(h.OL,{onClick:()=>{ev({variables:{queue:J}})},disabled:eg,children:[eg&&(0,l.jsx)(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Resume Queue"]})]})]})}),(0,l.jsx)(h.aR,{open:F,onOpenChange:Y,children:(0,l.jsxs)(h._T,{children:[(0,l.jsxs)(h.fY,{children:[(0,l.jsx)(h.f$,{children:"Drain Queue?"}),(0,l.jsxs)(h.yT,{children:["Are you sure you want to drain the ",J," queue? This will remove all jobs that are waiting or delayed, but not active, waiting-children, completed or failed. This action cannot be undone."]})]}),(0,l.jsxs)(h.xo,{children:[(0,l.jsx)(h.le,{children:"Cancel"}),(0,l.jsxs)(h.OL,{onClick:()=>{ep({variables:{queue:J}})},disabled:eb,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[eb&&(0,l.jsx)(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Drain Queue"]})]})]})})]})}},62910:function(e,s,a){a.d(s,{G:function(){return j}});var l=a(57437),i=a(29406),n=a(10842),t=a(38436),r=a(2265),d=a(42571),c=a(71558),o=a(69797),u=a(49712),x=a(26110),h=a(77992),m=a(94508);function j(e){let{className:s=null,code:a,language:c,slice:o=200}=e,{toast:j}=(0,h.pm)(),[v,g]=(0,r.useState)(null),p=async(e,s)=>{"string"!=typeof e&&(e=JSON.stringify(e,null,2)),g(await t.ZP.format(e,{parser:s,plugins:[i.Z,n.ZP]}))};return(0,r.useEffect)(()=>{"json"===c?p(a,"json"):"javascript"===c||"js"===c?p(a,"babel"):g(a)},[a,c]),(0,l.jsxs)(x.Vq,{children:[(0,l.jsx)(x.hg,{asChild:!0,children:(null==v?void 0:v.length)&&(0,l.jsx)(d.Z,{className:(0,m.cn)("cursor-pointer",s),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:c||"plaintext",style:u.Z,children:"".concat(null==v?void 0:v.slice(0,o||200)," ").concat((null==v?void 0:v.length)>(o||200)?"...":"")})}),(0,l.jsx)(x.cZ,{className:"sm:max-w-[800px] overflow-hidden max-h-[500px] overflow-y-scroll",children:(0,l.jsxs)(x.fK,{children:[(0,l.jsx)(x.$N,{children:"Code"}),(0,l.jsx)("div",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(null!=v?v:""),j({title:"Copied to clipboard"})},children:(0,l.jsx)(d.Z,{className:(0,m.cn)(s),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:c||"plaintext",style:u.Z,children:null!=v?v:""})})]})})]})}d.Z.registerLanguage("json",o.Z),d.Z.registerLanguage("javascript",c.Z)},19060:function(e,s,a){a.d(s,{X:function(){return d}});var l=a(57437),i=a(9270),n=a(30401),t=a(2265),r=a(94508);let d=t.forwardRef((e,s)=>{let{className:a,...t}=e;return(0,l.jsx)(i.fC,{ref:s,className:(0,r.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a),...t,children:(0,l.jsx)(i.z$,{className:(0,r.cn)("flex items-center justify-center text-current"),children:(0,l.jsx)(n.Z,{className:"size-4"})})})});d.displayName=i.fC.displayName}}]);
|
|
2
|
+
//# sourceMappingURL=9105-d8ff41060f7ffc85.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/chunks/9105-d8ff41060f7ffc85.js","mappings":"4YA0CO,SAASA,EAAgBC,CAA4D,MAmSdC,EACnCA,EAYpBA,EAMAA,EAMAA,EAMAA,EA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CAAiBA,CAACe,gBAAgB,CAAC,OAAQC,EAAAA,CAAIA,EAC/ChB,EAAAA,CAAiBA,CAACe,gBAAgB,CAAC,aAAcE,EAAAA,CAAUA,kHCf3D,IAAMlE,EAAWmE,EAAAA,UAAgB,CAG/B,CAAA5M,EAA0B6M,QAAzB,CAAE/G,UAAAA,CAAS,CAAE,GAAGgH,EAAO,CAAA9M,QACxB,GAAA2F,EAAAC,GAAA,EAACmH,EAAAA,EAAsB,EACrBF,IAAKA,EACL/G,UAAW6F,CAAAA,EAAAA,EAAAA,EAAAA,EACT,iTACA7F,GAED,GAAGgH,CAAK,UAET,GAAAnH,EAAAC,GAAA,EAACmH,EAAAA,EAA2B,EAC1BjH,UAAW6F,CAAAA,EAAAA,EAAAA,EAAAA,EAAG,0DAEd,GAAAhG,EAAAC,GAAA,EAACoH,EAAAA,CAAKA,CAAAA,CAAClH,UAAU,gBAIvB2C,CAAAA,EAASwE,WAAW,CAAGF,EAAAA,EAAsB,CAACE,WAAW","sources":["webpack://_N_E/./app/(application)/evals/[id]/runs/components/queue-management.tsx","webpack://_N_E/./components/custom/code-preview.tsx","webpack://_N_E/./components/ui/checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { useQuery, useMutation, NetworkStatus } from \"@apollo/client\";\nimport { GET_QUEUE, GET_JOBS, DELETE_JOB, PAUSE_QUEUE, DRAIN_QUEUE, RESUME_QUEUE } from \"@/queries/queries\";\nimport { QueueJob } from \"@/types/models/job\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from \"@/components/ui/table\";\nimport { Tabs, TabsList, TabsTrigger } from \"@/components/ui/tabs\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"@/components/ui/alert-dialog\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Loader2, Trash2, Pause, Droplet, Play, RefreshCcw, ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\nimport { useToast } from \"@/components/ui/use-toast\";\nimport { format } from \"date-fns\";\nimport { TextPreview } from \"@/components/custom/text-preview\";\nimport { DoubleArrowLeftIcon } from \"@radix-ui/react-icons\";\nimport { JobStatus } from \"@/types/models/job-result\";\n\ninterface QueueManagementProps {\n queueName: string;\n nameGenerator: (job: QueueJob) => string;\n retryJob: (job: QueueJob) => void;\n}\n\nexport function QueueManagement({ queueName, nameGenerator, retryJob }: QueueManagementProps) {\n const { toast } = useToast();\n const [pauseDialogOpen, setPauseDialogOpen] = useState(false);\n const [drainDialogOpen, setDrainDialogOpen] = useState(false);\n const [resumeDialogOpen, setResumeDialogOpen] = useState(false);\n const [jobsToDelete, setJobsToDelete] = useState<QueueJob[]>([]);\n const [jobToRetry, setJobToRetry] = useState<QueueJob | null>(null);\n const [status, setStatus] = useState<JobStatus>(\"completed\");\n const [page, setPage] = useState(1);\n const [limit, setLimit] = useState(20);\n const [selectedJobs, setSelectedJobs] = useState<Set<string>>(new Set());\n\n const { data: queueData, loading: loadingQueue, refetch: refetchQueue } = useQuery(GET_QUEUE, {\n variables: { queue: queueName },\n pollInterval: 5000, // Poll every 5 seconds\n });\n\n const { data: jobsData, loading: loadingJobs, refetch: refetchJobs, networkStatus: jobsNetworkStatus } = useQuery(GET_JOBS, {\n variables: {\n queue: queueName,\n statusses: status,\n page: page,\n limit: limit\n },\n pollInterval: 5000, // Poll every 5 seconds\n });\n\n const [deleteJob, { loading: deletingJob }] = useMutation(DELETE_JOB, {\n onError: (error) => {\n toast({\n title: \"Failed to delete job\",\n description: error.message,\n variant: \"destructive\",\n });\n },\n });\n\n const [pauseQueue, { loading: pausingQueue }] = useMutation(PAUSE_QUEUE, {\n onCompleted: () => {\n toast({\n title: \"Queue paused\",\n description: `The ${queueName} queue has been paused.`,\n });\n refetchQueue();\n setPauseDialogOpen(false);\n },\n onError: (error) => {\n toast({\n title: \"Failed to pause queue\",\n description: error.message,\n variant: \"destructive\",\n });\n },\n });\n\n const [resumeQueue, { loading: resumingQueue }] = useMutation(RESUME_QUEUE, {\n onCompleted: () => {\n toast({\n title: \"Queue resumed\",\n description: `The ${queueName} queue has been resumed.`,\n });\n refetchQueue();\n setResumeDialogOpen(false);\n },\n onError: (error) => {\n toast({\n title: \"Failed to resume queue\",\n description: error.message,\n variant: \"destructive\",\n });\n },\n });\n\n const [drainQueue, { loading: drainingQueue }] = useMutation(DRAIN_QUEUE, {\n onCompleted: () => {\n toast({\n title: \"Queue drained\",\n description: \"All waiting and delayed jobs have been removed from the queue.\",\n });\n refetchQueue();\n refetchJobs();\n setDrainDialogOpen(false);\n },\n onError: (error) => {\n toast({\n title: \"Failed to drain queue\",\n description: error.message,\n variant: \"destructive\",\n });\n },\n });\n\n const handleDeleteJob = (job: QueueJob) => {\n setJobsToDelete([job]);\n };\n\n const handleBulkDelete = () => {\n const jobsToDeleteArray = jobs.items.filter(job => selectedJobs.has(job.id));\n setJobsToDelete(jobsToDeleteArray);\n };\n\n const handleRetryJob = (job: QueueJob) => {\n setJobToRetry(job);\n };\n\n const toggleJobSelection = (jobId: string) => {\n const newSelection = new Set(selectedJobs);\n if (newSelection.has(jobId)) {\n newSelection.delete(jobId);\n } else {\n newSelection.add(jobId);\n }\n setSelectedJobs(newSelection);\n };\n\n const toggleAllJobs = () => {\n // Filter out active jobs since they can't be deleted\n const selectableJobs = jobs.items.filter(job => job.state !== \"active\");\n if (selectedJobs.size === selectableJobs.length && selectableJobs.length > 0) {\n setSelectedJobs(new Set());\n } else {\n setSelectedJobs(new Set(selectableJobs.map(job => job.id)));\n }\n };\n\n const confirmDeleteJobs = async () => {\n const jobsWithoutId = jobsToDelete.filter(job => !job.id);\n if (jobsWithoutId.length > 0) {\n toast({\n title: \"Failed to delete jobs\",\n description: \"Some jobs have no ID.\",\n variant: \"destructive\",\n });\n return;\n }\n\n try {\n // Delete all jobs in parallel\n await Promise.all(\n jobsToDelete.map(job =>\n deleteJob({\n variables: {\n queue: queueName,\n id: job.id,\n },\n })\n )\n );\n\n toast({\n title: jobsToDelete.length === 1 ? \"Job deleted\" : \"Jobs deleted\",\n description: `Successfully deleted ${jobsToDelete.length} job${jobsToDelete.length === 1 ? '' : 's'}.`,\n });\n\n refetchJobs();\n refetchQueue();\n setJobsToDelete([]);\n setSelectedJobs(new Set());\n } catch (error) {\n // Error toast already handled by mutation onError\n }\n };\n\n const handlePauseQueue = () => {\n pauseQueue({\n variables: { queue: queueName },\n });\n };\n\n const handleResumeQueue = () => {\n resumeQueue({\n variables: { queue: queueName },\n });\n };\n\n const handleDrainQueue = () => {\n drainQueue({\n variables: { queue: queueName },\n });\n };\n\n const queue = queueData?.queue;\n const jobs: {\n items: QueueJob[],\n pageInfo: {\n pageCount: number,\n itemCount: number,\n currentPage: number,\n hasPreviousPage: boolean,\n hasNextPage: boolean,\n }\n } = jobsData?.jobs || {\n items: [],\n pageInfo: {\n pageCount: 0,\n itemCount: 0,\n currentPage: 1,\n hasPreviousPage: false,\n hasNextPage: false,\n }\n };\n\n const getStatusBadge = (state: string) => {\n const statusColors: Record<string, string> = {\n active: \"bg-blue-100 text-blue-800 border-blue-200\",\n waiting: \"bg-yellow-100 text-yellow-800 border-yellow-200\",\n completed: \"bg-green-100 text-green-800 border-green-200\",\n failed: \"bg-red-100 text-red-800 border-red-200\",\n delayed: \"bg-orange-100 text-orange-800 border-orange-200\",\n paused: \"bg-gray-100 text-gray-800 border-gray-200\",\n };\n\n return (\n <Badge variant=\"outline\" className={statusColors[state] || \"bg-gray-100 text-gray-800\"}>\n {state}\n </Badge>\n );\n };\n\n if (loadingQueue && loadingJobs) {\n return (\n <div className=\"space-y-4\">\n <Card>\n <CardContent className=\"pt-6\">\n <div className=\"flex items-center justify-center py-8\">\n <Loader2 className=\"h-6 w-6 animate-spin\" />\n </div>\n </CardContent>\n </Card>\n </div>\n );\n }\n\n return (\n <>\n <Card>\n <CardHeader>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <div>\n <CardTitle>Queue: {queueName}</CardTitle>\n <CardDescription>Manage the {queueName} job queue and view all jobs.</CardDescription>\n </div>\n </div>\n {queue && <div className=\"flex gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => queue?.isPaused ? setResumeDialogOpen(true) : setPauseDialogOpen(true)}\n disabled={pausingQueue || resumingQueue}\n >\n {queue?.isPaused ? <Play className=\"mr-2 h-4 w-4\" /> : <Pause className=\"mr-2 h-4 w-4\" />}\n {queue?.isPaused ? \"Resume queue\" : \"Pause queue\"}\n </Button>\n\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => setDrainDialogOpen(true)}\n disabled={drainingQueue}\n >\n <Droplet className=\"mr-2 h-4 w-4\" />\n Drain queue\n </Button>\n </div>}\n </div>\n </CardHeader>\n <CardContent className=\"space-y-6\">\n {/* Queue Stats - Compact Layout */}\n {queue && (\n <div className=\"flex items-center gap-8 p-4 bg-muted/50 rounded-lg\">\n <div className=\"flex items-center gap-2\">\n <div className=\"text-sm text-muted-foreground\">Status:</div>\n <div>\n {queue.isPaused ? (\n <Badge variant=\"outline\" className=\"bg-gray-100 text-gray-800\">\n Paused\n </Badge>\n ) : queue.isMaxed ? (\n <Badge variant=\"outline\" className=\"bg-red-100 text-red-800\">\n Maxed\n </Badge>\n ) : (\n <Badge variant=\"outline\" className=\"bg-green-100 text-green-800\">\n Active\n </Badge>\n )}\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"text-sm text-muted-foreground\">Concurrency:</div>\n <div className=\"font-semibold\">Per queue global concurrency: {queue.concurrency?.queue || \"None\"}\n Per worker concurrency: {queue.concurrency?.worker || \"None\"}.\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"text-sm text-muted-foreground\">Rate Limit:</div>\n <div className=\"font-semibold\">{queue.ratelimit || \"None\"}</div>\n </div>\n <Tabs value={status} onValueChange={(value) => setStatus(value as JobStatus)} className=\"w-auto\">\n <TabsList>\n <TabsTrigger value=\"active\" className=\"gap-1.5\">\n <span>Active</span>\n <Badge variant=\"secondary\" className=\"ml-1 bg-blue-100 text-blue-600 border-blue-200\">\n {queue.jobs?.active || 0}\n </Badge>\n </TabsTrigger>\n <TabsTrigger value=\"waiting\" className=\"gap-1.5\">\n <span>Waiting</span>\n <Badge variant=\"secondary\" className=\"ml-1 bg-yellow-100 text-yellow-600 border-yellow-200\">\n {queue.jobs?.waiting || 0}\n </Badge>\n </TabsTrigger>\n <TabsTrigger value=\"failed\" className=\"gap-1.5\">\n <span>Failed</span>\n <Badge variant=\"secondary\" className=\"ml-1 bg-red-100 text-red-600 border-red-200\">\n {queue.jobs?.failed || 0}\n </Badge>\n </TabsTrigger>\n <TabsTrigger value=\"completed\" className=\"gap-1.5\">\n <span>Completed</span>\n <Badge variant=\"secondary\" className=\"ml-1 bg-green-100 text-green-600 border-green-200\">\n {queue.jobs?.completed || 0}\n </Badge>\n </TabsTrigger>\n </TabsList>\n </Tabs>\n </div>\n )}\n\n {/* Jobs Table */}\n <div>\n <div className=\"mb-3 flex items-center justify-between gap-2\">\n <div>\n <h3 className=\"text-sm font-semibold\">Queue Jobs</h3>\n <p className=\"text-xs text-muted-foreground\">All jobs currently in the {queueName} queue</p>\n </div>\n <div className=\"flex items-center gap-2\">\n {selectedJobs.size > 0 && (\n <Button\n variant=\"destructive\"\n size=\"sm\"\n onClick={handleBulkDelete}\n disabled={deletingJob}\n >\n <Trash2 className=\"mr-2 h-4 w-4\" />\n Delete {selectedJobs.size} job{selectedJobs.size === 1 ? '' : 's'}\n </Button>\n )}\n <Badge variant=\"outline\">\n Auto Refresh: <Loader2 className=\"h-4 w-4 animate-spin text-muted-foreground ml-1\" />\n </Badge>\n </div>\n </div>\n <div className=\"border rounded-lg\">\n {loadingJobs ? (\n <div className=\"flex items-center justify-center py-8\">\n <Loader2 className=\"h-6 w-6 animate-spin\" />\n </div>\n ) : jobs.items?.length === 0 ? (\n <div className=\"text-center pt-8 text-muted-foreground\">\n No jobs in queue\n </div>\n ) : (\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead className=\"w-12\">\n <Checkbox\n checked={\n jobs.items.filter(job => job.state !== \"active\").length > 0 &&\n selectedJobs.size === jobs.items.filter(job => job.state !== \"active\").length\n }\n onCheckedChange={toggleAllJobs}\n aria-label=\"Select all jobs\"\n />\n </TableHead>\n <TableHead>Name</TableHead>\n <TableHead>ID</TableHead>\n <TableHead>State</TableHead>\n <TableHead>Timestamp</TableHead>\n <TableHead>Inputs</TableHead>\n <TableHead>Outputs</TableHead>\n <TableHead className=\"text-right\">Actions</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {jobs.items?.map((job, index) => (\n <TableRow key={index}>\n <TableCell>\n <Checkbox\n checked={selectedJobs.has(job.id)}\n onCheckedChange={() => toggleJobSelection(job.id)}\n disabled={job.state === \"active\"}\n aria-label={`Select job ${nameGenerator(job)}`}\n />\n </TableCell>\n <TableCell className=\"font-medium max-w-[200px] truncate\">\n {nameGenerator(job)}\n </TableCell>\n <TableCell>{job.id}</TableCell>\n <TableCell>{getStatusBadge(job.state)}</TableCell>\n <TableCell>\n {job.timestamp ? format(new Date(job.timestamp), \"MMM d, yyyy HH:mm:ss\") : \"N/A\"}\n </TableCell>\n <TableCell>\n {job.data ? (\n <div className=\"text-xs max-w-[200px] truncate\">\n <TextPreview\n text={JSON.stringify(job.data)}\n />\n </div>\n ) : null}\n </TableCell>\n <TableCell>\n {job.failedReason ? (\n <div className=\"text-xs text-red-600 max-w-[200px] truncate\">\n <TextPreview\n text={\"Error: \" + job.failedReason}\n />\n </div>\n ) : (\n <div className=\"text-xs text-muted-foreground max-w-[200px] truncate\">\n <TextPreview\n text={JSON.stringify(job.returnvalue)}\n />\n </div>\n )}\n </TableCell>\n <TableCell className=\"text-right\">\n {job.state !== \"active\" && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => handleDeleteJob(job)}\n disabled={deletingJob}\n >\n <Trash2 className=\"h-4 w-4 text-red-600\" />\n </Button>\n )}\n {job.state === \"failed\" && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => handleRetryJob(job)}>\n <RefreshCcw className=\"h-4 w-4 text-blue-600\" />\n Retry\n </Button>\n )}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n )}\n\n <div className=\"flex items-center justify-between px-2 pb-2\">\n <div className=\"flex-1 text-sm text-muted-foreground\">\n ({jobs?.pageInfo?.itemCount || 0} total{\" \"}items).\n </div>\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n className=\"hidden size-8 p-0 lg:flex\"\n onClick={() => {\n setPage(1);\n refetchJobs();\n }}\n disabled={!jobs?.pageInfo?.hasPreviousPage}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n className=\"size-8 p-0\"\n onClick={() => {\n console.log(\n \"itemsData.data?.pageInfo.hasPreviousPage\",\n jobs?.pageInfo?.hasPreviousPage,\n );\n setPage(jobs?.pageInfo?.hasPreviousPage ? jobs?.pageInfo?.currentPage - 1 : 1);\n refetchJobs();\n }}\n disabled={!jobs?.pageInfo?.hasPreviousPage}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n className=\"size-8 p-0\"\n onClick={() => {\n setPage(jobs?.pageInfo?.hasNextPage ? jobs?.pageInfo?.currentPage + 1 : 1);\n refetchJobs();\n }}\n disabled={!jobs?.pageInfo.hasNextPage}>\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </CardContent>\n </Card>\n\n {/* Delete Job(s) Confirmation Dialog */}\n <AlertDialog open={jobsToDelete.length > 0} onOpenChange={(open) => !open && setJobsToDelete([])}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {jobsToDelete.length === 1 ? \"Delete Job?\" : `Delete ${jobsToDelete.length} Jobs?`}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {jobsToDelete.length === 1\n ? `Are you sure you want to delete the job \"${jobsToDelete[0]?.name}\"? This action cannot be undone.`\n : `Are you sure you want to delete ${jobsToDelete.length} jobs? This action cannot be undone.`\n }\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction onClick={confirmDeleteJobs} disabled={deletingJob}>\n {deletingJob && <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />}\n Delete\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n\n {/* Delete Job Confirmation Dialog */}\n <AlertDialog open={!!jobToRetry} onOpenChange={(open) => !open && setJobToRetry(null)}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Retry Job?</AlertDialogTitle>\n <AlertDialogDescription>\n Are you sure you want to retry the job \"{jobToRetry?.name}\"? This will schedule a new job with the same data.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction onClick={() => {\n if (!jobToRetry) {\n return;\n }\n retryJob(jobToRetry);\n }} disabled={deletingJob}>\n Retry\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n\n {/* Pause Queue Confirmation Dialog */}\n <AlertDialog open={pauseDialogOpen} onOpenChange={setPauseDialogOpen}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Pause Queue?</AlertDialogTitle>\n <AlertDialogDescription>\n Are you sure you want to pause the {queueName} queue? No jobs will be processed until the queue is resumed.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction onClick={handlePauseQueue} disabled={pausingQueue}>\n {pausingQueue && <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />}\n Pause Queue\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n\n {/* Resume Queue Confirmation Dialog */}\n <AlertDialog open={resumeDialogOpen} onOpenChange={setResumeDialogOpen}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Resume Queue?</AlertDialogTitle>\n <AlertDialogDescription>\n Are you sure you want to resume the {queueName} queue?.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction onClick={handleResumeQueue} disabled={resumingQueue}>\n {resumingQueue && <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />}\n Resume Queue\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n\n {/* Drain Queue Confirmation Dialog */}\n <AlertDialog open={drainDialogOpen} onOpenChange={setDrainDialogOpen}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Drain Queue?</AlertDialogTitle>\n <AlertDialogDescription>\n Are you sure you want to drain the {queueName} queue? This will remove all jobs that are waiting or delayed, but not active, waiting-children, completed or failed. This action cannot be undone.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={handleDrainQueue}\n disabled={drainingQueue}\n className=\"bg-destructive text-destructive-foreground hover:bg-destructive/90\"\n >\n {drainingQueue && <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />}\n Drain Queue\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </>\n );\n}\n","import babel from \"prettier/plugins/babel\";\nimport estree from \"prettier/plugins/estree\";\nimport prettier from \"prettier/standalone\";\nimport * as React from \"react\";\nimport { useEffect, useState } from \"react\";\nimport { Light as SyntaxHighlighter } from \"react-syntax-highlighter\";\nimport javascript from \"react-syntax-highlighter/dist/esm/languages/hljs/javascript\";\nimport json from \"react-syntax-highlighter/dist/esm/languages/hljs/json\";\nimport {\n a11yDark,\n dracula,\n} from \"react-syntax-highlighter/dist/esm/styles/prism\";\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"@/components/ui/dialog\";\nimport { useToast } from \"@/components/ui/use-toast\";\nimport { cn } from \"@/lib/utils\";\n\nSyntaxHighlighter.registerLanguage(\"json\", json);\nSyntaxHighlighter.registerLanguage(\"javascript\", javascript);\n\nexport function CodePreview({\n className = null,\n code: inputCode,\n language,\n slice = 200,\n }: {\n className?: string | null;\n code: string;\n language?: string;\n slice?: number | null;\n}) {\n const { toast } = useToast();\n const [code, setCode] = useState<string | null>(null);\n\n const format = async (code, language) => {\n if (typeof code !== \"string\") {\n code = JSON.stringify(code, null, 2);\n }\n const formattedCode = await prettier.format(code, {\n parser: language,\n plugins: [babel, estree],\n });\n setCode(formattedCode);\n };\n\n useEffect(() => {\n if (language === \"json\") {\n format(inputCode, \"json\");\n } else if (language === \"javascript\" || language === \"js\") {\n format(inputCode, \"babel\");\n } else {\n setCode(inputCode);\n }\n }, [inputCode, language]);\n\n return (\n <Dialog>\n <DialogTrigger asChild>\n {code?.length && (\n <SyntaxHighlighter\n className={cn(\"cursor-pointer\", className)}\n showLineNumbers={true}\n wrapLines={true}\n lineProps={{\n style: { wordBreak: \"break-all\", whiteSpace: \"pre-wrap\" },\n }}\n language={language ? language : \"plaintext\"}\n style={dracula}\n >\n {`${code?.slice(0, slice || 200)} ${code?.length > (slice || 200) ? \"...\" : \"\"}`}\n </SyntaxHighlighter>\n )}\n </DialogTrigger>\n <DialogContent className=\"sm:max-w-[800px] overflow-hidden max-h-[500px] overflow-y-scroll\">\n <DialogHeader>\n <DialogTitle>Code</DialogTitle>\n <div\n className=\"cursor-copy\"\n onClick={async () => {\n await navigator.clipboard.writeText(code ?? \"\");\n toast({ title: \"Copied to clipboard\" });\n }}\n >\n <SyntaxHighlighter\n className={cn(className)}\n showLineNumbers={true}\n wrapLines={true}\n lineProps={{\n style: { wordBreak: \"break-all\", whiteSpace: \"pre-wrap\" },\n }}\n language={language ? language : \"plaintext\"}\n style={dracula}\n >\n {code ?? \"\"}\n </SyntaxHighlighter>\n </div>\n </DialogHeader>\n </DialogContent>\n </Dialog>\n );\n}\n","\"use client\";\n\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { Check } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\"flex items-center justify-center text-current\")}\n >\n <Check className=\"size-4\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n"],"names":["QueueManagement","param","queue","jobs","jobsToDelete","queueName","nameGenerator","retryJob","toast","useToast","pauseDialogOpen","setPauseDialogOpen","useState","drainDialogOpen","setDrainDialogOpen","resumeDialogOpen","setResumeDialogOpen","setJobsToDelete","jobToRetry","setJobToRetry","status","setStatus","page","setPage","limit","setLimit","selectedJobs","setSelectedJobs","Set","data","queueData","loading","loadingQueue","refetch","refetchQueue","useQuery","GET_QUEUE","variables","pollInterval","jobsData","loadingJobs","refetchJobs","networkStatus","jobsNetworkStatus","GET_JOBS","statusses","deleteJob","deletingJob","useMutation","DELETE_JOB","onError","title","description","error","message","variant","pauseQueue","pausingQueue","PAUSE_QUEUE","onCompleted","concat","resumeQueue","resumingQueue","RESUME_QUEUE","drainQueue","drainingQueue","DRAIN_QUEUE","handleDeleteJob","job","handleRetryJob","toggleJobSelection","newSelection","has","jobId","delete","add","confirmDeleteJobs","jobsWithoutId","filter","id","length","Promise","all","map","items","pageInfo","pageCount","itemCount","currentPage","hasPreviousPage","hasNextPage","getStatusBadge","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsx","Badge","className","statusColors","active","waiting","completed","failed","delayed","paused","state","div","Card","CardContent","Loader2","jsxs","Fragment","CardHeader","CardTitle","CardDescription","Button","size","onClick","isPaused","disabled","Play","Pause","Droplet","isMaxed","concurrency","worker","ratelimit","Tabs","value","onValueChange","TabsList","TabsTrigger","span","h3","p","Trash2","Table","TableHeader","TableRow","TableHead","Checkbox","checked","onCheckedChange","selectableJobs","aria-label","TableBody","index","TableCell","timestamp","format","Date","TextPreview","text","JSON","stringify","failedReason","returnvalue","RefreshCcw","DoubleArrowLeftIcon","console","log","ChevronLeftIcon","ChevronRightIcon","AlertDialog","open","onOpenChange","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","name","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","CodePreview","code","inputCode","language","slice","setCode","prettier","parser","plugins","babel","estree","useEffect","Dialog","DialogTrigger","asChild","SyntaxHighlighter","cn","showLineNumbers","wrapLines","lineProps","style","wordBreak","whiteSpace","dracula","DialogContent","DialogHeader","DialogTitle","navigator","clipboard","writeText","registerLanguage","json","javascript","React","ref","props","CheckboxPrimitive","Check","displayName"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4709],{395:function(e,t,s){Promise.resolve().then(s.bind(s,18528))},18528:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return eE},dynamic:function(){return eU}});var n=s(57437),l=s(2265),a=s(99376),r=s(65613),i=s(7211),o=s(12199),d=s(41658),c=s(80834),u=s(13832),m=s(20653),x=s(94508);let p=e=>{let{size:t=16}=e;return(0,n.jsxs)("svg",{height:t,strokeLinejoin:"round",style:{color:"currentcolor"},viewBox:"0 0 16 16",width:t,children:[(0,n.jsx)("title",{children:"Loader"}),(0,n.jsxs)("g",{clipPath:"url(#clip0_2393_1490)",children:[(0,n.jsx)("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),(0,n.jsx)("defs",{children:(0,n.jsx)("clipPath",{id:"clip0_2393_1490",children:(0,n.jsx)("rect",{fill:"white",height:"16",width:"16"})})})]})},h=e=>{let{className:t,size:s=16,...l}=e;return(0,n.jsx)("div",{className:(0,x.cn)("inline-flex animate-spin items-center justify-center",t),...l,children:(0,n.jsx)(p,{size:s})})};var f=s(27315),v=s(81103),g=s(27689),j=s(6374),N=s(44045),y=s(48736),b=s(20265),w=s(24156),k=s(77992),C=s(27699),_=s(62869),T=s(1828),S=s(66070),z=s(27182),I=s(866),F=s(8014),P=s(74928),L=s(10492),R=s(35974),D=s(87393),Z=s(78361),M=s(23462);let U=M.fC,E=M.xz,A=l.forwardRef((e,t)=>{let{className:s,align:l="center",sideOffset:a=4,...r}=e;return(0,n.jsx)(M.VY,{ref:t,align:l,sideOffset:a,className:(0,x.cn)("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",s),...r})});A.displayName=M.VY.displayName;var B=s(60610);let O=l.forwardRef((e,t)=>{let{className:s,value:l,...a}=e;return(0,n.jsx)(B.fC,{ref:t,className:(0,x.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",s),...a,children:(0,n.jsx)(B.z$,{className:"size-full flex-1 bg-primary transition-all",style:{transform:"translateX(-".concat(100-(l||0),"%)")}})})});O.displayName=B.fC.displayName;var W=s(72543);let q=(0,l.createContext)(null),K=()=>{let e=(0,l.useContext)(q);if(!e)throw Error("Context components must be used within Context");return e},J=e=>{let{usedTokens:t,maxTokens:s,usage:l,modelId:a,...r}=e;return(0,n.jsx)(q.Provider,{value:{usedTokens:t,maxTokens:s,usage:l,modelId:a},children:(0,n.jsx)(U,{closeDelay:0,openDelay:0,...r})})},H=()=>{let{usedTokens:e,maxTokens:t}=K(),s=2*Math.PI*10;return(0,n.jsxs)("svg",{"aria-label":"Model context usage",height:"20",role:"img",style:{color:"currentcolor"},viewBox:"0 0 ".concat(24," ").concat(24),width:"20",children:[(0,n.jsx)("circle",{cx:12,cy:12,fill:"none",opacity:"0.25",r:10,stroke:"currentColor",strokeWidth:2}),(0,n.jsx)("circle",{cx:12,cy:12,fill:"none",opacity:"0.7",r:10,stroke:"currentColor",strokeDasharray:"".concat(s," ").concat(s),strokeDashoffset:s*(1-e/t),strokeLinecap:"round",strokeWidth:2,style:{transformOrigin:"center",transform:"rotate(-90deg)"}})]})},V=e=>{let{children:t,...s}=e,{usedTokens:l,maxTokens:a}=K(),r=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}).format(l/a);return(0,n.jsx)(E,{asChild:!0,children:null!=t?t:(0,n.jsxs)(_.z,{type:"button",variant:"ghost",...s,children:[(0,n.jsx)("span",{className:"font-medium text-muted-foreground",children:r}),(0,n.jsx)(H,{})]})})},Y=e=>{let{className:t,...s}=e;return(0,n.jsx)(A,{className:(0,x.cn)("min-w-[240px] divide-y overflow-hidden p-0",t),...s})},X=e=>{let{children:t,className:s,...l}=e,{usedTokens:a,maxTokens:r}=K(),i=a/r,o=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}).format(i),d=new Intl.NumberFormat("en-US",{notation:"compact"}).format(a),c=new Intl.NumberFormat("en-US",{notation:"compact"}).format(r);return(0,n.jsx)("div",{className:(0,x.cn)("w-full space-y-2 p-3",s),...l,children:null!=t?t:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3 text-xs",children:[(0,n.jsx)("p",{children:o}),(0,n.jsxs)("p",{className:"font-mono text-muted-foreground",children:[d," / ",c]})]}),(0,n.jsx)("div",{className:"space-y-2",children:(0,n.jsx)(O,{className:"bg-muted",value:100*i})})]})})},$=e=>{let{children:t,className:s,...l}=e;return(0,n.jsx)("div",{className:(0,x.cn)("w-full p-3",s),...l,children:t})},G=e=>{var t;let{className:s,children:l,...a}=e,{usage:r,modelId:i}=K(),o=null!==(t=null==r?void 0:r.inputTokens)&&void 0!==t?t:0;if(l)return l;if(!o)return null;let d=i?(0,W.Wn)({modelId:i,usage:{input:o,output:0}}).totalUSD:void 0,c=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(null!=d?d:0);return(0,n.jsxs)("div",{className:(0,x.cn)("flex items-center justify-between text-xs",s),...a,children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Input"}),(0,n.jsx)(es,{costText:c,tokens:o})]})},Q=e=>{var t;let{className:s,children:l,...a}=e,{usage:r,modelId:i}=K(),o=null!==(t=null==r?void 0:r.outputTokens)&&void 0!==t?t:0;if(l)return l;if(!o)return null;let d=i?(0,W.Wn)({modelId:i,usage:{input:0,output:o}}).totalUSD:void 0,c=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(null!=d?d:0);return(0,n.jsxs)("div",{className:(0,x.cn)("flex items-center justify-between text-xs",s),...a,children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Output"}),(0,n.jsx)(es,{costText:c,tokens:o})]})},ee=e=>{var t;let{className:s,children:l,...a}=e,{usage:r,modelId:i}=K(),o=null!==(t=null==r?void 0:r.reasoningTokens)&&void 0!==t?t:0;if(l)return l;if(!o)return null;let d=i?(0,W.Wn)({modelId:i,usage:{reasoningTokens:o}}).totalUSD:void 0,c=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(null!=d?d:0);return(0,n.jsxs)("div",{className:(0,x.cn)("flex items-center justify-between text-xs",s),...a,children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Reasoning"}),(0,n.jsx)(es,{costText:c,tokens:o})]})},et=e=>{var t;let{className:s,children:l,...a}=e,{usage:r,modelId:i}=K(),o=null!==(t=null==r?void 0:r.cachedInputTokens)&&void 0!==t?t:0;if(l)return l;if(!o)return null;let d=i?(0,W.Wn)({modelId:i,usage:{cacheReads:o,input:0,output:0}}).totalUSD:void 0,c=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(null!=d?d:0);return(0,n.jsxs)("div",{className:(0,x.cn)("flex items-center justify-between text-xs",s),...a,children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Cache"}),(0,n.jsx)(es,{costText:c,tokens:o})]})},es=e=>{let{tokens:t,costText:s}=e;return(0,n.jsxs)("span",{children:[void 0===t?"—":new Intl.NumberFormat("en-US",{notation:"compact"}).format(t),s?(0,n.jsxs)("span",{className:"ml-2 text-muted-foreground",children:["• ",s]}):null]})};var en=s(40519),el=s(91723),ea=s(65302),er=s(45131),ei=s(29525),eo=s(40875),ed=s(53245);let ec=e=>{let{className:t,...s}=e;return(0,n.jsx)(P.zF,{className:(0,x.cn)("not-prose mb-4 w-full rounded-md border",t),...s})},eu=e=>{let t={"input-streaming":(0,n.jsx)(en.Z,{className:"size-4 mr-2"}),"input-available":(0,n.jsx)(el.Z,{className:"size-4 animate-pulse mr-2"}),"output-available":(0,n.jsx)(ea.Z,{className:"size-4 text-green-600 mr-2"}),"output-error":(0,n.jsx)(er.Z,{className:"size-4 text-red-600 mr-2"})};return(0,n.jsxs)(R.C,{className:"rounded-full text-xs",variant:"secondary",children:[t[e],{"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"}[e]]})},em=e=>{let{className:t,type:s,state:l,...a}=e;return(0,n.jsxs)(P.wy,{className:(0,x.cn)("flex w-full items-center justify-between gap-4 p-3",t),...a,children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(ei.Z,{className:"size-4 text-muted-foreground"}),(0,n.jsx)("span",{className:"font-medium text-sm",children:s}),eu(l)]}),(0,n.jsx)(eo.Z,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})},ex=e=>{let{className:t,...s}=e;return(0,n.jsx)(P.Fw,{className:(0,x.cn)("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",t),...s})},ep=e=>{let{className:t,input:s,...l}=e;return(0,n.jsxs)("div",{className:(0,x.cn)("space-y-2 overflow-hidden p-4",t),...l,children:[(0,n.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,n.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,n.jsx)(ed.d,{code:JSON.stringify(s,null,2),language:"json"})})]})},eh=e=>{let{className:t,output:s,errorText:l,...a}=e;return s||l?(0,n.jsxs)("div",{className:(0,x.cn)("space-y-2 p-4",t),...a,children:[(0,n.jsx)("h4",{className:"font-medium text-muted-foreground text-xs tracking-wide",children:l?"Error":"Result"}),(0,n.jsxs)("div",{className:(0,x.cn)("overflow-x-auto rounded-md text-xs [&_table]:w-full p-5",l?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[l&&(0,n.jsx)("div",{children:l}),s&&(0,n.jsx)("div",{children:s})]})]}):(0,n.jsx)(n.Fragment,{})};var ef=s(93022),ev=s(77256),eg=s(35629),ej=s(92279),eN=s(78298),ey=s(21391),eb=s(26110),ew=s(95186),ek=s(73247),eC=s(31810),e_=s(42208),eT=s(12194),eS=s(84544),ez=s(19378);function eI(e){var t;let{open:s,onOpenChange:a,onSelectPrompt:r,agentId:i}=e,[o,d]=(0,l.useState)(""),c=[];o&&c.push({or:[{name:{contains:o}},{description:{contains:o}},{content:{contains:o}}]});let{data:u,loading:m}=(0,eT.Sh)({page:1,limit:50,filters:c,sort:{field:"favorite_count",direction:"DESC"}}),x=(null==u?void 0:null===(t=u.prompt_libraryPagination)||void 0===t?void 0:t.items)||[],p=i?x.filter(e=>e.assigned_agents&&e.assigned_agents.includes(i)):[],h=i?x.filter(e=>!e.assigned_agents||!e.assigned_agents.includes(i)):x,f=e=>{r(e),a(!1),d("")};return(0,n.jsx)(eb.Vq,{open:s,onOpenChange:a,children:(0,n.jsxs)(eb.cZ,{className:"max-w-2xl max-h-[80vh]",children:[(0,n.jsxs)(eb.fK,{children:[(0,n.jsx)(eb.$N,{children:"Select a Prompt"}),(0,n.jsx)(eb.Be,{children:"Choose a prompt template to insert into your message"})]}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)(ek.Z,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,n.jsx)(ew.I,{placeholder:"Search prompts...",value:o,onChange:e=>d(e.target.value),className:"pl-10"})]}),(0,n.jsx)(ez.x,{className:"h-[400px] pr-4",children:m?(0,n.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,n.jsx)(ef.O,{className:"h-24 w-full"},e))}):(0,n.jsxs)("div",{className:"space-y-4",children:[p.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,n.jsx)(eC.Z,{className:"h-4 w-4 text-yellow-500"}),(0,n.jsx)("h3",{className:"text-sm font-medium",children:"Recommended for this agent"})]}),(0,n.jsx)("div",{className:"space-y-2",children:p.map(e=>(0,n.jsx)(eF,{prompt:e,onSelect:f},e.id))})]}),h.length>0&&(0,n.jsxs)("div",{children:[p.length>0&&(0,n.jsx)("h3",{className:"text-sm font-medium mb-2",children:"All Prompts"}),(0,n.jsx)("div",{className:"space-y-2",children:h.map(e=>(0,n.jsx)(eF,{prompt:e,onSelect:f},e.id))})]}),0===x.length&&!m&&(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,n.jsx)(y.Z,{className:"h-12 w-12 text-muted-foreground mb-3"}),(0,n.jsx)("h3",{className:"text-lg font-medium",children:"No prompts found"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:o?"Try a different search term":"Create your first prompt in the Prompt Library"})]})]})})]})})}function eF(e){var t;let{prompt:s,onSelect:l}=e,a=(0,eS.H)(s.content);return(0,n.jsxs)("button",{onClick:()=>l(s),className:"w-full text-left p-3 rounded-lg border hover:bg-accent transition-colors",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-1",children:[(0,n.jsx)("h4",{className:"font-medium text-sm",children:s.name}),(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground flex-shrink-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,n.jsx)(eC.Z,{className:"h-3 w-3"}),(0,n.jsx)("span",{children:s.favorite_count||0})]}),(0,n.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,n.jsx)(e_.Z,{className:"h-3 w-3"}),(0,n.jsx)("span",{children:s.usage_count||0})]})]})]}),s.description&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:s.description}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-1",children:[a.length>0&&(0,n.jsxs)(R.C,{variant:"outline",className:"text-xs",children:[a.length," variable",1!==a.length?"s":""]}),null===(t=s.tags)||void 0===t?void 0:t.slice(0,2).map(e=>(0,n.jsx)(R.C,{variant:"secondary",className:"text-xs",children:e},e)),s.tags&&s.tags.length>2&&(0,n.jsxs)(R.C,{variant:"secondary",className:"text-xs",children:["+",s.tags.length-2]})]})]})}var eP=s(26815);function eL(e){return e?e.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function eR(e){let{open:t,onOpenChange:s,variables:a,promptName:r,onSubmit:i}=e,[o,d]=(0,l.useState)({});(0,l.useEffect)(()=>{let e={};a.forEach(t=>{e[t]=""}),d(e)},[a]);let c=(e,t)=>{d(s=>({...s,[e]:t}))},u=a.every(e=>{var t;return null===(t=o[e])||void 0===t?void 0:t.trim()});return(0,n.jsx)(eb.Vq,{open:t,onOpenChange:s,children:(0,n.jsxs)(eb.cZ,{className:"max-w-md",children:[(0,n.jsxs)(eb.fK,{children:[(0,n.jsx)(eb.$N,{children:"Fill in Variables"}),(0,n.jsxs)(eb.Be,{children:['Complete the following fields for "',r,'"']})]}),(0,n.jsx)("div",{className:"space-y-4 py-4",children:a.map(e=>(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(eP._,{htmlFor:e,children:eL(e)}),(0,n.jsx)(ew.I,{id:e,placeholder:"Enter ".concat(eL(e).toLowerCase(),"..."),value:o[e]||"",onChange:t=>c(e,t.target.value)})]},e))}),(0,n.jsxs)(eb.cN,{children:[(0,n.jsx)(_.z,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),(0,n.jsx)(_.z,{onClick:()=>{i(o),d({})},disabled:!u,children:"Insert Prompt"})]})]})})}var eD=s(27648);function eZ(e){var t,s,a,x,p,M,U,E,A,B,W;let{session:q,agent:K,initialPromptId:H}=e,[es,en]=(0,l.useState)(null),el=l.useContext(N.E);(0,I.d)();let{theme:ea}=(0,eN.F)(),[er,ei]=(0,l.useState)(null),[eo,ed]=(0,l.useState)(null),{user:ec}=(0,l.useContext)(u.S),[eu,em]=(0,l.useState)(null),[ex,ep]=(0,l.useState)(!1),[eh,ef]=(0,l.useState)(""),[eg,eb]=(0,l.useState)([]),ew=l.useRef(null),{toast:ek}=(0,k.pm)(),[eC,e_]=(0,l.useState)(!1),[ez,eF]=(0,l.useState)(!1),[eP,eL]=(0,l.useState)(null),[eZ]=(0,eT.VR)(),[eU,eE]=(0,l.useState)({rights_mode:(null==q?void 0:q.rights_mode)||"private",users:(null==q?void 0:null===(t=q.RBAC)||void 0===t?void 0:t.users)||[],roles:(null==q?void 0:null===(s=q.RBAC)||void 0===s?void 0:s.roles)||[]}),eA=(0,i.aM)(g.L5,{variables:{id:q.created_by},skip:!q.created_by}),eB=(0,i.aM)(g.jL,{variables:{id:q.project},skip:!q.project}),{data:eO}=(0,i.aM)(g.X0,{variables:{id:H},skip:!H}),[eW,eq]=(0,l.useState)(!1),[eK,eJ]=(0,o.D)(g.r1),[eH,eV]=(0,l.useState)({totalTokens:0,reasoningTokens:0,inputTokens:0,outputTokens:0,cachedInputTokens:0});(0,i.aM)(g.N,{returnPartialData:!0,fetchPolicy:"network-only",nextFetchPolicy:"network-only",variables:{page:1,limit:50,filters:{session:{eq:q.id}}},onCompleted:e=>{(null==e?void 0:e.agent_messagesPagination)&&e0(null==e?void 0:e.agent_messagesPagination.items.map(e=>JSON.parse(e.content)))}});let{messages:eY,sendMessage:eX,status:e$,stop:eG,regenerate:eQ,setMessages:e0,addToolResult:e1}=(0,c.RJ)({sendAutomaticallyWhen:d.l0,experimental_throttle:50,async onToolCall(e){let{toolCall:t}=e;if(!t.dynamic&&"getLocation"===t.toolName){let e=["New York","Los Angeles","Chicago","San Francisco"];e1({tool:"confirm-tool-call",toolCallId:t.toolCallId,output:e[Math.floor(Math.random()*e.length)]})}},onError:e=>{console.log("error!!",null==e?void 0:e.message);try{let{message:t}=JSON.parse(null==e?void 0:e.message);en(t)}catch(t){en(e.message)}},transport:new d.PD({api:"".concat(null==el?void 0:el.backend).concat(K.slug,"/").concat(K.id),prepareSendMessagesRequest:async e=>{let{messages:t,id:s,body:n}=e,l=await (0,j.LP)();if(!l)throw Error("No valid session token available.");return{body:{...n,message:t[t.length-1],id:s,session:q.id},headers:{User:ec.id,Session:q.id,Authorization:"Bearer ".concat(l),Stream:"true"}}}})});(0,l.useEffect)(()=>{let e=null==eY?void 0:eY.reduce((e,t)=>{let s=t.metadata;return e+((null==s?void 0:s.totalTokens)||0)},0),t=null==eY?void 0:eY.reduce((e,t)=>{let s=t.metadata;return e+((null==s?void 0:s.reasoningTokens)||0)},0);eV({totalTokens:e,reasoningTokens:t,inputTokens:null==eY?void 0:eY.reduce((e,t)=>{let s=t.metadata;return e+((null==s?void 0:s.inputTokens)||0)},0),outputTokens:null==eY?void 0:eY.reduce((e,t)=>{let s=t.metadata;return e+((null==s?void 0:s.outputTokens)||0)},0),cachedInputTokens:null==eY?void 0:eY.reduce((e,t)=>{let s=t.metadata;return e+((null==s?void 0:s.cachedInputTokens)||0)},0)})},[eY]),(0,l.useMemo)(()=>{let e=(null==eY?void 0:eY.filter(e=>"user"===e.role))||[],t=(null==eY?void 0:eY.filter(e=>"assistant"===e.role))||[];return e.length>=1&&t.length>=1},[eY]);let e2=e=>{(0,eS.H)(e.content).length>0?(eL(e),eF(!0)):(e3(e.content),eZ({variables:{id:e.id,usage_count:(e.usage_count||0)+1}}))},e3=e=>{var t;ef(t=>t?"".concat(t,"\n\n").concat(e):e),null===(t=ew.current)||void 0===t||t.focus()};(0,l.useEffect)(()=>{if((null==eO?void 0:eO.prompt_library_itemById)&&!eW){let e=eO.prompt_library_itemById;eq(!0),e2(e)}},[eO,eW]);let e5=async(e,t)=>{e.preventDefault(),eX({text:eh,files:er||[]},{body:{disabledTools:eg}}),ef(""),ei(null),ed(null)},e4=e=>{eb(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},e8=(0,D.I)(q,ec),e6=async e=>{ei(await Promise.all(e.map(async e=>{if(!e.s3key){let t="";return Object.entries(e).forEach(e=>{let[s,n]=e;t+="".concat(s,": ").concat(n,"\n")}),{type:"file",mediaType:e.type,filename:e.name,url:"data:text/plain;base64,".concat(btoa(t))}}return{type:"file",mediaType:e.type,filename:e.name,url:await (0,Z.NF)(e.s3key)}})))};return(0,l.useEffect)(()=>{if(!eo){ei(null);return}e6(eo.map(e=>({s3key:e,name:e,type:"file"})))},[eo]),(0,n.jsx)("div",{className:"flex flex-col w-full mx-auto relative size-full",children:(0,n.jsx)("div",{className:"mx-auto relative size-full",children:(0,n.jsxs)("div",{className:"flex h-full w-full max-h-[calc(100vh)] overflow-y-auto overflow-x-hidden",children:[(0,n.jsxs)("div",{className:"flex flex-col flex-1 pb-6",children:[(0,n.jsxs)(z.ri,{className:"overflow-y-hidden",children:[K.maxContextLength?(0,n.jsx)(v.pn,{children:(0,n.jsxs)(v.u,{children:[(0,n.jsx)(v.aJ,{asChild:!0,children:(0,n.jsxs)("div",{className:"absolute w-full ".concat("top-0"),children:[(0,n.jsx)(O,{className:"w-full rounded-none",value:eH.totalTokens/K.maxContextLength*100}),(0,n.jsxs)("div",{className:"justify-between flex felx-row",children:[(0,n.jsx)("div",{}),(0,n.jsxs)(J,{maxTokens:K.maxContextLength||0,usedTokens:eH.totalTokens,usage:{inputTokens:eH.inputTokens,outputTokens:eH.outputTokens,totalTokens:eH.totalTokens,cachedInputTokens:eH.cachedInputTokens,reasoningTokens:eH.reasoningTokens},children:[(0,n.jsx)(V,{}),(0,n.jsxs)(Y,{children:[(0,n.jsx)(X,{}),(0,n.jsxs)($,{children:[(0,n.jsx)(G,{}),(0,n.jsx)(Q,{}),(0,n.jsx)(ee,{}),(0,n.jsx)(et,{})]})]})]})]})]})}),(0,n.jsx)(v._v,{children:(0,n.jsxs)("p",{children:[Intl.NumberFormat("en-US").format(eH.totalTokens)," / ",Intl.NumberFormat("en-US").format(K.maxContextLength)," tokens in the context window used."]})})]})}):null,(null==eY?void 0:eY.length)===0?(0,n.jsx)("div",{className:"size-full flex justify-center items-center",children:(0,n.jsxs)("div",{className:"flex flex-col gap-4 items-center max-w-2xl w-full px-4 my-auto",children:[(0,n.jsx)(ey.default,{alt:"Logo",width:120,height:120,className:"h-30 w-40 object-contain"}),(0,n.jsx)("p",{className:"text-center text-lg text-muted-foreground",children:"How can I help you today?"}),(0,n.jsx)(ej.Z,{agent:K,status:e$,className:"w-80"})]})}):null,(0,n.jsxs)(z.iG,{className:"px-6",children:[(null==eY?void 0:eY.length)>0&&(0,n.jsx)(ev.K,{messages:eY,config:{marginTopFirstMessage:"mt-12"},status:e$,onRegenerate:eQ,onAddToolResult:e1,UntypedToolPartComponent:eM,addToContext:e=>{ed([...eo||[],e])},writeAccess:e8}),"streaming"===e$?(0,n.jsx)(h,{}):null]})]}),!e8&&(0,n.jsx)("div",{className:"px-6 mx-auto mt-3",children:(0,n.jsx)(R.C,{variant:"outline",children:"Read access only"})}),es&&(0,n.jsx)("div",{className:"mx-5",children:(0,n.jsxs)(r.bZ,{className:"mb-3",variant:"destructive",children:[(0,n.jsx)(m.LPM,{className:"size-4"}),(0,n.jsx)(r.Cd,{children:"Error"}),(0,n.jsx)(r.X,{children:es})]})}),e8&&(0,n.jsxs)("form",{onSubmit:e5,className:"px-6 border-input border rounded flex mx-5 p-5 flex-col gap-2",children:[(0,n.jsxs)("div",{className:"items-center flex relative gap-2 w-full",children:[(null==el?void 0:null===(a=el.fileUploads)||void 0===a?void 0:a.s3endpoint)&&(0,n.jsx)(Z.ZP,{id:"chat-".concat(q.id),selectionLimit:10,allowedFileTypes:[...(null===(x=K.capabilities)||void 0===x?void 0:x.audio)||[],...(null===(p=K.capabilities)||void 0===p?void 0:p.video)||[],...(null===(M=K.capabilities)||void 0===M?void 0:M.files)||[],...(null===(U=K.capabilities)||void 0===U?void 0:U.images)||[]],dependencies:[],onConfirm:e=>{ed(e)}}),(0,n.jsx)(v.pn,{children:(0,n.jsxs)(v.u,{children:[(0,n.jsx)(v.aJ,{asChild:!0,children:(0,n.jsx)(_.z,{type:"button",variant:"outline",size:"icon",className:"shrink-0",onClick:()=>e_(!0),children:(0,n.jsx)(y.Z,{className:"h-5 w-5 text-muted-foreground"})})}),(0,n.jsx)(v._v,{children:(0,n.jsx)("p",{children:"Insert prompt from library"})})]})}),(0,n.jsx)(f.Z,{autoComplete:"off",autoFocus:!0,minRows:1,value:eh,ref:ew,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),e5(e))},onChange:e=>ef(e.target.value),name:"message",placeholder:"Ask me anything...",className:"max-h-40 px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 w-full items-center h-28 resize-none overflow-hidden dark:bg-card/35"}),"streaming"!==e$?(0,n.jsx)(_.z,{className:"shrink-0",variant:"secondary",size:"icon",disabled:"submitted"===e$||!(null==eh?void 0:eh.trim()),children:(0,n.jsx)(b.Z,{className:" size-6 text-muted-foreground"})}):(0,n.jsx)(_.z,{className:"shrink-0",variant:"secondary",size:"icon",onClick:eG,children:(0,n.jsx)(m.wNq,{className:"size-6 text-muted-foreground"})})]}),(0,n.jsx)("div",{className:"grid grid-cols-3 sm:grid-cols-4 gap-3",children:null==eo?void 0:eo.map(e=>(0,n.jsx)(Z.jU,{s3Key:e,disabled:!0,active:!1,onRemove:()=>{ed(null==eo?void 0:eo.filter(t=>t!==e))}}))})]}),(0,n.jsx)(C.x,{isOpen:ex,onClose:()=>ep(!1),messages:eY||[],sessionTitle:q.title}),(0,n.jsx)(eI,{open:eC,onOpenChange:e_,onSelectPrompt:e2,agentId:K.id}),eP&&(0,n.jsx)(eR,{open:ez,onOpenChange:eF,variables:(0,eS.H)(eP.content),promptName:eP.name,onSubmit:e=>{eP&&(e3(function(e,t){if(!e)return"";if(!t||0===Object.keys(t).length)return e;let s=e;for(let[e,n]of Object.entries(t)){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=RegExp("\\{\\{".concat(t,"\\}\\}"),"g");s=s.replace(l,n||"")}return s}(eP.content,e)),eZ({variables:{id:eP.id,usage_count:(eP.usage_count||0)+1}}),eF(!1),eL(null))}})]}),e8&&(0,n.jsxs)("div",{className:"w-80 border-l bg-muted/20 p-4 space-y-4",children:[(null==eY?void 0:eY.length)>0&&(0,n.jsx)("div",{children:(0,n.jsx)(ej.Z,{agent:K,status:e$,className:"w-80"})}),(0,n.jsx)("div",{children:(0,n.jsx)("p",{className:"text-sm font-medium text-center",children:K.name})}),K.description&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:K.description}),(0,n.jsx)("hr",{className:"my-2"}),(0,n.jsx)("div",{className:"mt-1",children:(0,n.jsxs)("div",{className:"border rounded",children:[eA.loading&&(0,n.jsxs)("div",{className:"flex flex-row justify-between p-3",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"Session created by"}),(0,n.jsx)(L.g,{className:"ml-2"})]}),(null===(E=eA.data)||void 0===E?void 0:E.userById)&&!eA.loading&&(0,n.jsxs)("div",{className:"flex flex-row justify-between p-3",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"Session created by"}),(0,n.jsx)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:(0,n.jsx)("p",{className:"text-sm font-medium capitalize",children:eA.data.userById.name})})]})]})}),q.project&&(0,n.jsx)("div",{className:"mt-1",children:(0,n.jsxs)("div",{className:"border rounded",children:[eB.loading&&(0,n.jsxs)("div",{className:"flex flex-row justify-between p-3",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"This chat is part of a project:"}),(0,n.jsx)(L.g,{className:"ml-2"})]}),(null===(A=eB.data)||void 0===A?void 0:A.projectById)&&!eB.loading&&(0,n.jsxs)("div",{className:"flex flex-col p-3 gap-2",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"Project"}),(0,n.jsx)(eD.default,{href:"/projects/".concat(q.project),className:"text-sm text-primary hover:underline",children:eB.data.projectById.name}),eB.data.projectById.description&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:eB.data.projectById.description})]})]})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-xs font-medium text-muted-foreground pt-2",children:"You can disable tools for individual messages in this session by clicking the switch:"}),(0,n.jsx)(v.pn,{children:(0,n.jsx)("div",{className:"space-y-1 pt-2",children:K.tools&&K.tools.length>0?K.tools.map(e=>{let t=!eg.includes(e.id);return(0,n.jsxs)(v.u,{children:[(0,n.jsx)(v.aJ,{asChild:!0,children:(0,n.jsxs)("div",{className:"p-2 rounded-md border text-xs bg-background flex items-center justify-between",children:[(0,n.jsx)("p",{className:"font-medium flex items-center gap-2",children:e.name}),(0,n.jsx)(T.r,{checked:t,onCheckedChange:()=>e4(e.id)})]})}),(0,n.jsx)(v._v,{children:(0,n.jsx)("p",{className:"max-w-[200px] text-wrap",children:e.description})})]},e.name)}):(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"No tools enabled."})})})]}),(0,n.jsx)("div",{className:"mt-1",children:(0,n.jsxs)(P.zF,{className:"border rounded",children:[(0,n.jsx)(S.Ol,{className:"px-3 py-1",children:(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsxs)("p",{className:"text-sm font-medium",children:["Access control (",q.rights_mode,")"]})}),(0,n.jsx)(P.wy,{asChild:!0,children:(0,n.jsxs)(_.z,{variant:"ghost",size:"icon",className:"size-8",children:[(0,n.jsx)(w.Z,{className:"size-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Toggle"})]})})]})}),(0,n.jsx)(P.Fw,{children:(0,n.jsxs)(S.aY,{className:"space-y-4 p-3",children:[(0,n.jsx)(F.P,{allowedModes:["private","users","roles"],initialRightsMode:q.rights_mode,initialUsers:null===(B=q.RBAC)||void 0===B?void 0:B.users,initialRoles:null===(W=q.RBAC)||void 0===W?void 0:W.roles,onChange:(e,t,s)=>{eE({rights_mode:e,users:t,roles:s})}}),(0,n.jsxs)(_.z,{disabled:eJ.loading,onClick:()=>{eK({variables:{id:q.id,rights_mode:eU.rights_mode,RBAC:{users:eU.users,roles:eU.roles}}})},children:["Save access rights ",eJ.loading&&(0,n.jsx)(L.g,{className:"ml-2"})," "]})]})})]})})]})]})})})}let eM=e=>{var t;let{untypedToolPart:s,callId:l,addToContext:a}=e,r=s.output;console.log("output",r);let i=null===(t=s.type)||void 0===t?void 0:t.replace(/ /g,"-");return i=(null==(i=null==(i=null==i?void 0:i.replace(/tool-/g,""))?void 0:i.replace(/_/g," "))?void 0:i.charAt(0).toUpperCase())+(null==i?void 0:i.slice(1)),(0,n.jsxs)(ec,{className:"mt-3",defaultOpen:!1,children:[(0,n.jsx)(em,{className:"capitalize",type:i,state:s.state}),(0,n.jsxs)(ex,{children:[(0,n.jsx)(ep,{input:s.input}),(0,n.jsx)(eh,{output:r?(0,n.jsx)(eg.H,{children:"string"==typeof r?r:JSON.stringify(r,null,2)}):!s.errorText&&(0,n.jsx)(ef.O,{className:"h-4 w-full"}),errorText:s.errorText})]})]},l)},eU="force-dynamic";function eE(e){var t;let{params:s}=e,l=(0,a.useSearchParams)().get("promptId"),{data:o,loading:d,error:c}=(0,i.aM)(g.lk,{returnPartialData:!0,fetchPolicy:"network-only",nextFetchPolicy:"network-only",variables:{id:s.session}}),{data:u,loading:x,error:p}=(0,i.aM)(g.as,{skip:!(null==o?void 0:o.agent_sessionById),variables:{id:s.agent,project:(null==o?void 0:null===(t=o.agent_sessionById)||void 0===t?void 0:t.project)||void 0}});return d||x?(0,n.jsx)("div",{children:(0,n.jsx)(ef.O,{className:"w-full h-full"})}):c||p?(0,n.jsxs)(r.bZ,{variant:"destructive",children:[(0,n.jsx)(m.LPM,{className:"size-4"}),(0,n.jsx)(r.Cd,{children:"Error"}),(0,n.jsxs)(r.X,{children:["Error loading agent ",(null==p?void 0:p.message)||(null==c?void 0:c.message),"."]})]}):(null==u?void 0:u.agentById)&&(null==o?void 0:o.agent_sessionById)?(0,n.jsx)(eZ,{session:null==o?void 0:o.agent_sessionById,agent:u.agentById,initialPromptId:l||void 0}):(0,n.jsxs)(r.bZ,{variant:"destructive",children:[(0,n.jsx)(m.LPM,{className:"size-4"}),(0,n.jsx)(r.Cd,{children:"Error"}),(0,n.jsx)(r.X,{children:"Agent or session not found."})]})}},27182:function(e,t,s){"use strict";s.d(t,{iG:function(){return i},ri:function(){return r}});var n=s(57437);s(62869);var l=s(94508);s(2265);var a=s(20460);let r=e=>{let{className:t,...s}=e;return(0,n.jsx)(a.h,{className:(0,l.cn)("relative flex-1 overflow-y-auto",t),initial:"smooth",resize:"smooth",role:"log",...s})},i=e=>{let{className:t,...s}=e;return(0,n.jsx)(a.h.Content,{className:(0,l.cn)("p-4",t),...s})}},92279:function(e,t,s){"use strict";var n=s(57437),l=s(7882),a=s(11713),r=s(78361);let i=e=>{let{agent:t,status:s,className:i}=e,{data:o}=(0,a.a)({queryKey:["defaultAnimation","idle"],queryFn:async()=>(await fetch("/agent-idle.json")).json(),staleTime:36e5,enabled:!t.animation_idle}),{data:d}=(0,a.a)({queryKey:["defaultAnimation","responding"],queryFn:async()=>(await fetch("/agent-responding.json")).json(),staleTime:36e5,enabled:!t.animation_responding}),{data:c}=(0,a.a)({queryKey:["customAnimation",t.animation_idle],queryFn:async()=>{if(!t.animation_idle)return null;let e=await (0,r.NF)(t.animation_idle);return(await fetch(e)).json()},enabled:!!t.animation_idle,staleTime:3e5}),{data:u}=(0,a.a)({queryKey:["customAnimation",t.animation_responding],queryFn:async()=>{if(!t.animation_responding)return null;let e=await (0,r.NF)(t.animation_responding);return(await fetch(e)).json()},enabled:!!t.animation_responding,staleTime:3e5}),{View:m}=(0,l.useLottie)((()=>{switch(s){case"submitted":case"ready":case"error":default:return{animationData:c||o,loop:!0,autoplay:!0};case"streaming":return{animationData:u||d,loop:!0,autoplay:!0}}})());return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{className:"",children:(0,n.jsx)("div",{className:i,children:m})})})};t.Z=e=>{let{agent:t,status:s,className:l}=e;return(0,n.jsx)(i,{className:l,agent:t,status:s})}},77256:function(e,t,s){"use strict";s.d(t,{K:function(){return E}});var n=s(57437);s(16831);var l=s(94508);let a=e=>{let{className:t,from:s,...a}=e;return(0,n.jsx)("div",{className:(0,l.cn)("group flex w-full items-end justify-end gap-2 py-4","user"===s?"is-user flex-row-reverse justify-end":"is-assistant flex-row-reverse justify-end","[&>div]:max-w-[80%]",t),...a})},r=e=>{let{children:t,className:s,...a}=e;return(0,n.jsx)("div",{className:(0,l.cn)("flex flex-col gap-2 overflow-hidden rounded-lg py-3 text-foreground text-sm","group-[.is-user]:bg-secondary group-[.is-user]:text-primary-foreground group-[.is-user]:px-4","group-[.is-assistant]:bg-transparent group-[.is-assistant]:text-foreground",s),...a,children:(0,n.jsx)("div",{className:"is-user:dark",children:t})})};var i=s(62869),o=s(81103);let d=e=>{let{className:t,children:s,...a}=e;return(0,n.jsx)("div",{className:(0,l.cn)("flex items-center gap-1",t),...a,children:s})},c=e=>{let{tooltip:t,children:s,label:a,className:r,variant:d="ghost",size:c="sm",...u}=e,m=(0,n.jsxs)(i.z,{className:(0,l.cn)("size-9 p-1.5 text-muted-foreground hover:text-foreground",r),size:c,type:"button",variant:d,...u,children:[s,(0,n.jsx)("span",{className:"sr-only",children:a||t})]});return t?(0,n.jsx)(o.pn,{children:(0,n.jsxs)(o.u,{children:[(0,n.jsx)(o.aJ,{asChild:!0,children:m}),(0,n.jsx)(o._v,{children:(0,n.jsx)("p",{children:t})})]})}):m};var u=s(35629),m=s(80886),x=s(74928),p=s(64972),h=s(40875),f=s(2265);let v=(0,f.createContext)(null),g=()=>{let e=(0,f.useContext)(v);if(!e)throw Error("Reasoning components must be used within Reasoning");return e},j=(0,f.memo)(e=>{let{className:t,isStreaming:s=!1,open:a,defaultOpen:r=!1,onOpenChange:i,duration:o,children:d,...c}=e,[u,p]=(0,m.T)({prop:a,defaultProp:r,onChange:i}),[h,g]=(0,m.T)({prop:o,defaultProp:0}),[j,N]=(0,f.useState)(!1),[y,b]=(0,f.useState)(null);return(0,f.useEffect)(()=>{s?null===y&&b(Date.now()):null!==y&&(g(Math.round((Date.now()-y)/1e3)),b(null))},[s,y,g]),(0,f.useEffect)(()=>{if(s&&!u)p(!0);else if(!s&&u&&!r&&!j){let e=setTimeout(()=>{p(!1),N(!0)},1e3);return()=>clearTimeout(e)}},[s,u,r,p,j]),(0,n.jsx)(v.Provider,{value:{isStreaming:s,isOpen:u,setIsOpen:p,duration:h},children:(0,n.jsx)(x.zF,{className:(0,l.cn)("not-prose mb-4",t),onOpenChange:e=>{p(e)},open:u,...c,children:d})})}),N=(0,f.memo)(e=>{let{className:t,title:s="Reasoning",children:a,...r}=e,{isStreaming:i,isOpen:o,duration:d}=g();return(0,n.jsx)(x.wy,{className:(0,l.cn)("flex items-center gap-2 text-muted-foreground text-sm",t),...r,children:null!=a?a:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(p.Z,{className:"size-4"}),i||0===d?(0,n.jsx)("p",{children:"Thinking..."}):(0,n.jsxs)("p",{children:["Thought for ",d," seconds"]}),(0,n.jsx)(h.Z,{className:(0,l.cn)("size-4 text-muted-foreground transition-transform",o?"rotate-180":"rotate-0")})]})})}),y=(0,f.memo)(e=>{let{className:t,children:s,...a}=e;return(0,n.jsx)(x.Fw,{className:(0,l.cn)("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",t),...a,children:(0,n.jsx)(u.H,{className:"grid gap-2",children:s})})});j.displayName="Reasoning",N.displayName="ReasoningTrigger",y.displayName="ReasoningContent";var b=s(55455);let w=e=>{let{className:t,...s}=e;return(0,n.jsx)(x.zF,{className:(0,l.cn)("not-prose mb-4 text-primary text-xs",t),...s})},k=e=>{let{className:t,count:s,children:l,...a}=e;return(0,n.jsx)(x.wy,{className:"flex items-center gap-2",...a,children:null!=l?l:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{className:"font-medium",children:["Used ",s," sources"]}),(0,n.jsx)(h.Z,{className:"h-4 w-4"})]})})},C=e=>{let{className:t,...s}=e;return(0,n.jsx)(x.Fw,{className:(0,l.cn)("mt-3 flex w-fit flex-col gap-2","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",t),...s})},_=e=>{let{href:t,title:s,children:l,...a}=e;return(0,n.jsx)("a",{className:"flex items-center gap-2",href:t,rel:"noreferrer",target:"_blank",...a,children:null!=l?l:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b.Z,{className:"h-4 w-4"}),(0,n.jsx)("span",{className:"block font-medium",children:s})]})})};var T=s(52636),S=s(78867),z=s(33145),I=s(77992),F=s(40519),P=s(15863),L=s(66901),R=s(45131);let D={pending:{icon:F.Z,label:"Pending",className:"text-muted-foreground"},in_progress:{icon:P.Z,label:"In Progress",className:"text-blue-500 animate-spin"},completed:{icon:L.Z,label:"Completed",className:"text-green-500"},cancelled:{icon:R.Z,label:"Cancelled",className:"text-red-500"}},Z={high:{label:"High",className:"bg-red-500/10 text-red-500 border-red-500/20"},medium:{label:"Medium",className:"bg-yellow-500/10 text-yellow-500 border-yellow-500/20"},low:{label:"Low",className:"bg-blue-500/10 text-blue-500 border-blue-500/20"}},M=e=>{let{todos:t,showPriority:s=!1,state:a,className:r,...i}=e;if("string"==typeof t&&(t=JSON.parse(t)),!t||0===t.length)return null;let o=t.filter(e=>"completed"===e.status).length,d=t.length;return(0,n.jsxs)("div",{className:(0,l.cn)("my-2 space-y-1","input-streaming"===a&&"opacity-70",r),...i,children:[t.map((e,a)=>{let r=D[e.status]?D[e.status].icon:D.pending.icon,i=D[e.status]?D[e.status].className:D.pending.className;Z[e.priority]?Z[e.priority].className:Z.medium.className;let o="in_progress"===e.status&&a===t.findIndex(e=>"in_progress"===e.status);return(0,n.jsxs)("div",{className:(0,l.cn)("flex items-start gap-2 py-0.5","cancelled"===e.status&&"opacity-50"),children:[(0,n.jsx)("div",{className:"flex-shrink-0 pt-0.5",children:(0,n.jsx)(r,{className:(0,l.cn)("size-3.5",i)})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:(0,l.cn)("text-sm","completed"===e.status&&"text-muted-foreground line-through","cancelled"===e.status&&"text-muted-foreground line-through","in_progress"===e.status&&o&&"font-medium"),children:e.content}),s&&"high"===e.priority&&(0,n.jsx)("span",{className:"ml-2 text-red-500 text-xs",children:"(!)"})]})]},e.id)}),d>1&&(0,n.jsxs)("div",{className:"flex items-center gap-2 pt-1 text-muted-foreground text-xs",children:[(0,n.jsx)("div",{className:"h-1 flex-1 overflow-hidden rounded-full bg-secondary",children:(0,n.jsx)("div",{className:"h-full bg-primary transition-all duration-300",style:{width:"".concat(o/d*100,"%")}})}),(0,n.jsxs)("span",{className:"whitespace-nowrap",children:[o,"/",d]})]}),"output-error"===a&&(0,n.jsxs)("div",{className:"flex items-center gap-1 pt-1 text-red-500 text-xs",children:[(0,n.jsx)(R.Z,{className:"size-3"}),(0,n.jsx)("span",{children:"Error updating tasks"})]})]})};var U=s(78361);function E(e){let{messages:t,status:s="idle",className:i,showActions:o=!0,onRegenerate:m,onAddToolResult:x,UntypedToolPartComponent:p,addToContext:h,writeAccess:f=!0,config:v}=e,{toast:g}=(0,I.pm)();return(0,n.jsx)(n.Fragment,{children:null==t?void 0:t.map((e,t)=>{var b,I;let F=e.metadata,P=null!==(I=null===(b=e.parts.filter(e=>{var t;return"text"===e.type&&(null===(t=e.text)||void 0===t?void 0:t.includes('<file name="'))}))||void 0===b?void 0:b.flatMap(e=>{var t;let s=e.text.match(/<file name="([^"]+)">([^<]+)<\/file>/g);return null!==(t=null==s?void 0:s.map(e=>{var t,s,n,l;console.log("filePart",e);let a=null!==(n=null===(t=e.match(/<file name="([^"]+)">/))||void 0===t?void 0:t[1])&&void 0!==n?n:"";return console.log("s3Key",a),{s3Key:a,content:null!==(l=null===(s=e.match(/<file name="([^"]+)">([^<]+)<\/file>/))||void 0===s?void 0:s[2])&&void 0!==l?l:""}}))&&void 0!==t?t:[]}))&&void 0!==I?I:[];return console.log("files",P),(0,n.jsx)(a,{className:(0,l.cn)("assistant"===e.role&&((null==v?void 0:v.customAssistantClassnames)?null==v?void 0:v.customAssistantClassnames:""),0===t&&((null==v?void 0:v.marginTopFirstMessage)?null==v?void 0:v.marginTopFirstMessage:"mt-12"),i),from:e.role,children:(0,n.jsxs)(r,{children:[e.parts.map((t,l)=>{var a,r,i,o,d,c,m,f;if("step-start"===t.type)return null;if("text"===t.type){let s=t.text.replace(/<file name="([^"]+)">([^<]+)<\/file>/g,"");return(0,n.jsx)(u.H,{className:"chat-response-container",children:s},"".concat(e.id,"-").concat(l)+"_response")}if("tool-askForConfirmation"===t.type&&x){let e=t.toolCallId;switch(t.state){case"input-streaming":return(0,n.jsx)("div",{children:"Loading confirmation request..."},e);case"input-available":return(0,n.jsxs)("div",{children:[t.input.message,(0,n.jsxs)("div",{children:[(0,n.jsx)("button",{onClick:()=>x({tool:"askForConfirmation",toolCallId:e,output:"Yes, confirmed"}),children:"Yes"}),(0,n.jsx)("button",{onClick:()=>x({tool:"askForConfirmation",toolCallId:e,output:"No, denied"}),children:"No"})]})]},e);case"output-available":return(0,n.jsxs)("div",{children:["Tool call allowed: ",t.output]},e);case"output-error":return(0,n.jsxs)("div",{children:["Error: ",t.errorText]},e)}}if((null===(a=t.type)||void 0===a?void 0:a.toLowerCase().includes("preview_pdf"))||(null===(r=t.type)||void 0===r?void 0:r.toLowerCase().includes("pdf_file_in_a_web_view"))){let e=JSON.parse(null!==(c=null===(d=t.output)||void 0===d?void 0:d.result)&&void 0!==c?c:"{}");if(!(null==e?void 0:e.url))return(0,n.jsxs)("div",{children:["No URL provided for PDF preview ",JSON.stringify(e)]});let s="".concat(e.url,"#page=").concat(null!==(m=e.page)&&void 0!==m?m:1);return(0,n.jsx)("iframe",{src:s,style:{width:"100%",height:"100vh"},title:"PDF viewer"})}if((null===(i=t.type)||void 0===i?void 0:i.toLowerCase())==="tool-todo_write"||(null===(o=t.type)||void 0===o?void 0:o.toLowerCase())==="tool-todo_read"){let e=t.output;if(!(null==e?void 0:e.result))return null;let s=t.state;return(0,n.jsx)(M,{todos:e.result,showPriority:!0,state:s})}if((t.type.startsWith("tool-")||"dynamic-tool"===t.type)&&p&&h){let e=t.toolCallId;return(0,n.jsx)(p,{untypedToolPart:t,callId:e,addToContext:h},e)}return"file"===t.type&&(null===(f=t.mediaType)||void 0===f?void 0:f.startsWith("image/"))?(0,n.jsx)(z.default,{src:t.url,width:300,height:300,alt:"Generated image"},"".concat(e.id,"-").concat(l)):"source-url"===t.type?(0,n.jsxs)(w,{children:[(0,n.jsx)(k,{count:e.parts.filter(e=>"source-url"===e.type).length}),(0,n.jsx)(C,{children:e.parts.map((t,s)=>{if("source-url"===t.type)return(0,n.jsx)(_,{href:t.url,title:t.title},"".concat(e.id,"-").concat(s))})},"".concat(e.id))]},"".concat(e.id,"-").concat(l)):"reasoning"===t.type?(0,n.jsxs)(j,{className:"w-full",isStreaming:"streaming"===s,children:[(0,n.jsx)(N,{}),(0,n.jsx)(y,{children:t.text})]},"".concat(e.id,"-").concat(l)):null}),P.length>0&&(0,n.jsx)("div",{className:"grid grid-cols-6 min-w-[500px] gap-2 mt-3 mb-3",children:P.map(t=>(0,n.jsx)(U.jU,{s3Key:t.s3Key,onRemove:()=>{},active:!1,disabled:!1},t.s3Key+"_file_item_"+e.id))}),o&&"assistant"===e.role&&(0,n.jsxs)(d,{className:"mt-2",children:[m&&(0,n.jsx)(c,{onClick:()=>m(),label:"Retry",disabled:!f,children:(0,n.jsx)(T.Z,{className:"size-3"})}),(0,n.jsx)(c,{onClick:()=>{navigator.clipboard.writeText(e.parts.map(e=>(null==e?void 0:e.text)||"").join("\n")),g({title:"Copied message",description:"The message was copied to your clipboard."})},label:"Copy",children:(0,n.jsx)(S.Z,{className:"size-3"})}),(null==F?void 0:F.totalTokens)&&(0,n.jsxs)("small",{className:"text-muted-foreground",children:[Intl.NumberFormat("en-US").format(null==F?void 0:F.totalTokens)," tokens"]})]})]})},e.id)})})}},1828:function(e,t,s){"use strict";s.d(t,{r:function(){return i}});var n=s(57437),l=s(50721),a=s(2265),r=s(94508);let i=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(l.fC,{className:(0,r.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",s),...a,ref:t,children:(0,n.jsx)(l.bU,{className:(0,r.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});i.displayName=l.fC.displayName},12194:function(e,t,s){"use strict";s.d(t,{EE:function(){return i},Lq:function(){return x},Sh:function(){return r},VR:function(){return c},er:function(){return o},iJ:function(){return d}});var n=s(7211),l=s(12199),a=s(27689);let r=e=>{var t,s,l,r;return(0,n.aM)(a.xx,{variables:{page:null!==(t=null==e?void 0:e.page)&&void 0!==t?t:1,limit:null!==(s=null==e?void 0:e.limit)&&void 0!==s?s:20,filters:null!==(l=null==e?void 0:e.filters)&&void 0!==l?l:[],sort:null!==(r=null==e?void 0:e.sort)&&void 0!==r?r:{field:"updatedAt",direction:"DESC"}}})},i=()=>(0,l.D)(a.Iv,{refetchQueries:[{query:a.xx,variables:{page:1,limit:20}}]}),o=()=>(0,l.D)(a.jA),d=()=>(0,l.D)(a.Ll,{refetchQueries:[{query:a.xx,variables:{page:1,limit:20}}]}),c=()=>(0,l.D)(a.re),u=()=>(0,l.D)(a.Nl),m=()=>(0,l.D)(a.m8),x=()=>{let[e]=u(),[t]=m(),[s]=(0,l.D)(a.UK);return{toggleFavorite:async(n,l,a,r,i)=>{a&&i?(await t({variables:{id:i}}),await s({variables:{id:n,favorite_count:Math.max(0,r-1)}})):(await e({variables:{user_id:l,prompt_id:n}}),await s({variables:{id:n,favorite_count:r+1}}))}}}},87393:function(e,t,s){"use strict";s.d(t,{I:function(){return n}});let n=(e,t)=>{var s,n,l,a,r,i;let o="private"===e.rights_mode,d="public"===e.rights_mode,c="users"===e.rights_mode,u="roles"===e.rights_mode,m=t.super_admin,x=e.created_by===t.id.toString(),p=!1;return o&&x&&(p=!0),d&&(p=!0),c&&(p=(null===(l=e.RBAC)||void 0===l?void 0:null===(n=l.users)||void 0===n?void 0:null===(s=n.find(e=>e.id===t.id))||void 0===s?void 0:s.rights)==="write"),u&&(p=(null===(i=e.RBAC)||void 0===i?void 0:null===(r=i.roles)||void 0===r?void 0:null===(a=r.find(e=>{var s;return e.id===(null===(s=t.role)||void 0===s?void 0:s.id)}))||void 0===a?void 0:a.rights)==="write"),m&&(p=!0),p}},84544:function(e,t,s){"use strict";function n(e){if(!e)return[];let t=e.matchAll(/\{\{([a-zA-Z0-9_]+)\}\}/g),s=new Set;for(let e of Array.from(t))s.add(e[1]);return Array.from(s).sort()}s.d(t,{H:function(){return n}})}},function(e){e.O(0,[329,6840,8310,3954,4705,3611,6989,5987,9851,7629,7093,6148,847,1942,7648,7823,8068,5799,605,4567,1206,5338,1785,5110,3171,1425,1713,192,7086,3145,8293,6373,3832,8030,3750,1957,2971,2117,1744],function(){return e(e.s=395)}),_N_E=e.O()}]);
|
|
2
|
-
//# sourceMappingURL=page-
|
|
2
|
+
//# sourceMappingURL=page-d59534ca19eee51f.js.map
|