@exulu/frontend 1.8.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.
Files changed (173) hide show
  1. package/dist/.next/BUILD_ID +1 -1
  2. package/dist/.next/app-build-manifest.json +153 -155
  3. package/dist/.next/app-path-routes-manifest.json +1 -1
  4. package/dist/.next/build-manifest.json +2 -2
  5. package/dist/.next/prerender-manifest.json +1 -1
  6. package/dist/.next/server/app/(application)/agents/edit/[id]/page.js +1 -1
  7. package/dist/.next/server/app/(application)/agents/edit/[id]/page.js.nft.json +1 -1
  8. package/dist/.next/server/app/(application)/agents/edit/[id]/page_client-reference-manifest.js +1 -1
  9. package/dist/.next/server/app/(application)/agents/page_client-reference-manifest.js +1 -1
  10. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js +8 -8
  11. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js.nft.json +1 -1
  12. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page_client-reference-manifest.js +1 -1
  13. package/dist/.next/server/app/(application)/chat/[agent]/page_client-reference-manifest.js +1 -1
  14. package/dist/.next/server/app/(application)/chat/page_client-reference-manifest.js +1 -1
  15. package/dist/.next/server/app/(application)/configuration/page_client-reference-manifest.js +1 -1
  16. package/dist/.next/server/app/(application)/dashboard/page_client-reference-manifest.js +1 -1
  17. package/dist/.next/server/app/(application)/data/[[...query]]/page.js +4 -4
  18. package/dist/.next/server/app/(application)/data/[[...query]]/page.js.nft.json +1 -1
  19. package/dist/.next/server/app/(application)/data/[[...query]]/page_client-reference-manifest.js +1 -1
  20. package/dist/.next/server/app/(application)/evals/[id]/page.js +1 -1
  21. package/dist/.next/server/app/(application)/evals/[id]/page.js.nft.json +1 -1
  22. package/dist/.next/server/app/(application)/evals/[id]/page_client-reference-manifest.js +1 -1
  23. package/dist/.next/server/app/(application)/evals/cases/page.js +1 -1
  24. package/dist/.next/server/app/(application)/evals/cases/page.js.nft.json +1 -1
  25. package/dist/.next/server/app/(application)/evals/cases/page_client-reference-manifest.js +1 -1
  26. package/dist/.next/server/app/(application)/evals/page_client-reference-manifest.js +1 -1
  27. package/dist/.next/server/app/(application)/explorer/page_client-reference-manifest.js +1 -1
  28. package/dist/.next/server/app/(application)/keys/page_client-reference-manifest.js +1 -1
  29. package/dist/.next/server/app/(application)/page_client-reference-manifest.js +1 -1
  30. package/dist/.next/server/app/(application)/projects/[project]/page.js +1 -1
  31. package/dist/.next/server/app/(application)/projects/[project]/page.js.nft.json +1 -1
  32. package/dist/.next/server/app/(application)/projects/[project]/page_client-reference-manifest.js +1 -1
  33. package/dist/.next/server/app/(application)/projects/page.js +1 -1
  34. package/dist/.next/server/app/(application)/projects/page_client-reference-manifest.js +1 -1
  35. package/dist/.next/server/app/(application)/prompts/page.js +1 -1
  36. package/dist/.next/server/app/(application)/prompts/page_client-reference-manifest.js +1 -1
  37. package/dist/.next/server/app/(application)/roles/page_client-reference-manifest.js +1 -1
  38. package/dist/.next/server/app/(application)/token/page_client-reference-manifest.js +1 -1
  39. package/dist/.next/server/app/(application)/users/page_client-reference-manifest.js +1 -1
  40. package/dist/.next/server/app/(application)/variables/create/page_client-reference-manifest.js +1 -1
  41. package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page_client-reference-manifest.js +1 -1
  42. package/dist/.next/server/app/(application)/variables/page_client-reference-manifest.js +1 -1
  43. package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page_client-reference-manifest.js +1 -1
  44. package/dist/.next/server/app/(application)/workflows/page.js +1 -1
  45. package/dist/.next/server/app/(application)/workflows/page_client-reference-manifest.js +1 -1
  46. package/dist/.next/server/app/(authentication)/login/page_client-reference-manifest.js +1 -1
  47. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  48. package/dist/.next/server/app/_not-found.html +1 -1
  49. package/dist/.next/server/app/_not-found.rsc +1 -1
  50. package/dist/.next/server/app-paths-manifest.json +5 -5
  51. package/dist/.next/server/chunks/1025.js +1 -0
  52. package/dist/.next/server/chunks/2270.js +18 -44
  53. package/dist/.next/server/chunks/3434.js +1 -1
  54. package/dist/.next/server/chunks/3503.js +1 -0
  55. package/dist/.next/server/chunks/5084.js +1 -0
  56. package/dist/.next/server/chunks/5192.js +1 -1
  57. package/dist/.next/server/chunks/5485.js +1 -1
  58. package/dist/.next/server/chunks/5600.js +1 -1
  59. package/dist/.next/server/chunks/5974.js +1 -0
  60. package/dist/.next/server/chunks/6590.js +1 -1
  61. package/dist/.next/server/chunks/7471.js +1 -1
  62. package/dist/.next/server/chunks/8286.js +1 -1
  63. package/dist/.next/server/chunks/{3679.js → 9874.js} +5 -5
  64. package/dist/.next/server/middleware-manifest.json +5 -5
  65. package/dist/.next/server/pages/404.html +1 -1
  66. package/dist/.next/server/pages/500.html +1 -1
  67. package/dist/.next/server/server-reference-manifest.json +1 -1
  68. package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js +2 -0
  69. package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js.map +1 -0
  70. package/dist/.next/static/chunks/{4811-316807e25b634f9f.js → 192-72d6868cd891ccc6.js} +8 -8
  71. package/dist/.next/static/chunks/192-72d6868cd891ccc6.js.map +1 -0
  72. package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js +2 -0
  73. package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js.map +1 -0
  74. package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js +2 -0
  75. package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js.map +1 -0
  76. package/dist/.next/static/chunks/3750-e3d1b2cccd265190.js +2 -0
  77. package/dist/.next/static/chunks/3750-e3d1b2cccd265190.js.map +1 -0
  78. package/dist/.next/static/chunks/{3832-417a5eeee712a793.js → 3832-d7782d6a2771ae6c.js} +1 -1
  79. package/dist/.next/static/chunks/{3832-417a5eeee712a793.js.map → 3832-d7782d6a2771ae6c.js.map} +1 -1
  80. package/dist/.next/static/chunks/552-39155a93c527ec6d.js +2 -0
  81. package/dist/.next/static/chunks/552-39155a93c527ec6d.js.map +1 -0
  82. package/dist/.next/static/chunks/6280-50b751f993f2fe4f.js +2 -0
  83. package/dist/.next/static/chunks/6280-50b751f993f2fe4f.js.map +1 -0
  84. package/dist/.next/static/chunks/6367-59655a85d75e19be.js +2 -0
  85. package/dist/.next/static/chunks/6367-59655a85d75e19be.js.map +1 -0
  86. package/dist/.next/static/chunks/6373-aef582adc575d3ca.js +2 -0
  87. package/dist/.next/static/chunks/6373-aef582adc575d3ca.js.map +1 -0
  88. package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js +2 -0
  89. package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js.map +1 -0
  90. package/dist/.next/static/chunks/{6805-792cc8008b165c07.js → 8293-ba5cd36594e6fde1.js} +10 -10
  91. package/dist/.next/static/chunks/8293-ba5cd36594e6fde1.js.map +1 -0
  92. package/dist/.next/static/chunks/9105-d8ff41060f7ffc85.js +2 -0
  93. package/dist/.next/static/chunks/9105-d8ff41060f7ffc85.js.map +1 -0
  94. package/dist/.next/static/chunks/9953-95900a236271a222.js +2 -0
  95. package/dist/.next/static/chunks/9953-95900a236271a222.js.map +1 -0
  96. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js +2 -0
  97. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js.map +1 -0
  98. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-d59534ca19eee51f.js +2 -0
  99. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-d59534ca19eee51f.js.map +1 -0
  100. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-0c7c1b0e1713bf60.js +2 -0
  101. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-0c7c1b0e1713bf60.js.map +1 -0
  102. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-7db6bfbf02606136.js +2 -0
  103. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-7db6bfbf02606136.js.map +1 -0
  104. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js +2 -0
  105. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js.map +1 -0
  106. package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js → page-827f50c6d1f150d0.js} +2 -2
  107. package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js.map → page-827f50c6d1f150d0.js.map} +1 -1
  108. package/dist/.next/static/chunks/app/(application)/explorer/{page-1d676c9dfe3ed58b.js → page-e6b1c034c07776e2.js} +1 -1
  109. package/dist/.next/static/chunks/app/(application)/explorer/{page-1d676c9dfe3ed58b.js.map → page-e6b1c034c07776e2.js.map} +1 -1
  110. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js +2 -0
  111. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js.map +1 -0
  112. package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js +2 -0
  113. package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js.map +1 -0
  114. package/dist/.next/static/chunks/app/(application)/token/{page-3f74f711f3d04fce.js → page-3acc39cb8a718331.js} +1 -1
  115. package/dist/.next/static/chunks/app/(application)/token/{page-3f74f711f3d04fce.js.map → page-3acc39cb8a718331.js.map} +1 -1
  116. package/dist/.next/static/chunks/app/(application)/workflows/{page-47dedb88cec600d5.js → page-e38f9456120dab69.js} +2 -2
  117. package/dist/.next/static/chunks/app/(application)/workflows/page-e38f9456120dab69.js.map +1 -0
  118. package/dist/.next/static/chunks/ba12c10f-85ed008ce7746dbe.js +2 -0
  119. package/dist/.next/static/chunks/ba12c10f-85ed008ce7746dbe.js.map +1 -0
  120. package/dist/.next/static/css/9c08ae5d990a6b14.css +4 -0
  121. package/dist/.next/static/css/9c08ae5d990a6b14.css.map +1 -0
  122. package/dist/.next/static/css/e3f2a16ab7676b05.css.map +1 -1
  123. package/dist/package.json +1 -1
  124. package/package.json +1 -1
  125. package/dist/.next/server/chunks/2948.js +0 -1
  126. package/dist/.next/server/chunks/38.js +0 -1
  127. package/dist/.next/server/chunks/7958.js +0 -1
  128. package/dist/.next/server/chunks/8050.js +0 -1
  129. package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js +0 -2
  130. package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js.map +0 -1
  131. package/dist/.next/static/chunks/1957-39a01a3915f246ab.js +0 -2
  132. package/dist/.next/static/chunks/1957-39a01a3915f246ab.js.map +0 -1
  133. package/dist/.next/static/chunks/3750-f45c59ef1cc79417.js +0 -2
  134. package/dist/.next/static/chunks/3750-f45c59ef1cc79417.js.map +0 -1
  135. package/dist/.next/static/chunks/4811-316807e25b634f9f.js.map +0 -1
  136. package/dist/.next/static/chunks/5282-68f9880f1f951f44.js +0 -2
  137. package/dist/.next/static/chunks/5282-68f9880f1f951f44.js.map +0 -1
  138. package/dist/.next/static/chunks/572-2940a399da1e3a3b.js +0 -2
  139. package/dist/.next/static/chunks/572-2940a399da1e3a3b.js.map +0 -1
  140. package/dist/.next/static/chunks/6367-59cef3c74213925b.js +0 -2
  141. package/dist/.next/static/chunks/6367-59cef3c74213925b.js.map +0 -1
  142. package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js +0 -2
  143. package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js.map +0 -1
  144. package/dist/.next/static/chunks/6805-792cc8008b165c07.js.map +0 -1
  145. package/dist/.next/static/chunks/8030-c1b6be46253076cb.js +0 -2
  146. package/dist/.next/static/chunks/8030-c1b6be46253076cb.js.map +0 -1
  147. package/dist/.next/static/chunks/9105-dfbce1bad8e3e8dd.js +0 -2
  148. package/dist/.next/static/chunks/9105-dfbce1bad8e3e8dd.js.map +0 -1
  149. package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js +0 -2
  150. package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js.map +0 -1
  151. package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js +0 -2
  152. package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js.map +0 -1
  153. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js +0 -2
  154. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js.map +0 -1
  155. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js +0 -2
  156. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js.map +0 -1
  157. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-2d47be0ee80dd89d.js +0 -2
  158. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-2d47be0ee80dd89d.js.map +0 -1
  159. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js +0 -2
  160. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js.map +0 -1
  161. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js +0 -2
  162. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js.map +0 -1
  163. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js +0 -2
  164. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js.map +0 -1
  165. package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js +0 -2
  166. package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js.map +0 -1
  167. package/dist/.next/static/chunks/app/(application)/workflows/page-47dedb88cec600d5.js.map +0 -1
  168. package/dist/.next/static/chunks/ba12c10f-aaafcb074f608624.js +0 -2
  169. package/dist/.next/static/chunks/ba12c10f-aaafcb074f608624.js.map +0 -1
  170. package/dist/.next/static/css/c8c015815c72d053.css +0 -4
  171. package/dist/.next/static/css/c8c015815c72d053.css.map +0 -1
  172. /package/dist/.next/static/{GOwerAkBncYx0J8q1TqQb → 3j63p6b3zZZB_v1Hn8Mxp}/_buildManifest.js +0 -0
  173. /package/dist/.next/static/{GOwerAkBncYx0J8q1TqQb → 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,EAqCLC,EA4BGA,EAuEDA,EAWaA,EAgBAA,EAiC6BC,KAtgB9B,CAAEC,UAAAA,CAAS,CAAEC,cAAAA,CAAa,CAAEC,SAAAA,CAAQ,CAAwB,CAA5DN,EACxB,CAAEO,MAAAA,CAAK,CAAE,CAAGC,CAAAA,EAAAA,EAAAA,EAAAA,IACZ,CAACC,EAAiBC,EAAmB,CAAGC,CAAAA,EAAAA,EAAAA,QAAAA,EAAS,IACjD,CAACC,EAAiBC,EAAmB,CAAGF,CAAAA,EAAAA,EAAAA,QAAAA,EAAS,IACjD,CAACG,EAAkBC,EAAoB,CAAGJ,CAAAA,EAAAA,EAAAA,QAAAA,EAAS,IACnD,CAACR,EAAca,EAAgB,CAAGL,CAAAA,EAAAA,EAAAA,QAAAA,EAAqB,EAAE,EACzD,CAACM,EAAYC,EAAc,CAAGP,CAAAA,EAAAA,EAAAA,QAAAA,EAA0B,MACxD,CAACQ,EAAQC,EAAU,CAAGT,CAAAA,EAAAA,EAAAA,QAAAA,EAAoB,aAC1C,CAACU,EAAMC,GAAQ,CAAGX,CAAAA,EAAAA,EAAAA,QAAAA,EAAS,GAC3B,CAACY,GAAOC,G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AAA,EAAWA,CAAAA,UAAC,SACb,GAAA1G,EAAAC,GAAA,EAACW,MAAAA,CACGT,UAAU,cACVoB,QAAS,UACL,MAAMoF,UAAUC,SAAS,CAACC,SAAS,CAAC5B,MAAAA,EAAAA,EAAQ,IAC5CrK,EAAM,CAAE2C,MAAO,qBAAsB,EACzC,WAEA,GAAAyC,EAAAC,GAAA,EAAC8F,EAAAA,CAAiBA,CAAAA,CACd5F,UAAW6F,CAAAA,EAAAA,EAAAA,EAAAA,EAAG7F,GACd8F,gBAAiB,GACjBC,UAAW,GACXC,UAAW,CACPC,MAAO,CAAEC,UAAW,YAAaC,WAAY,UAAW,CAC5D,EACAnB,SAAUA,GAAsB,YAChCiB,MAAOG,EAAAA,CAAOA,UAEbtB,MAAAA,EAAAA,EAAQ,cAOrC,CAnFAc,EAAAA,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":""}
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9953],{69953:function(e,s,i){i.d(s,{f:function(){return en},Z:function(){return er}});var l=i(57437),a=i(7211),n=i(12199),t=i(13590),r=i(99376),d=i(2265),c=i(29501),o=i(67119),m=i(18930),x=i(62869),h=i(26110),u=i(95186),v=i(26815),j=i(10492);function p(e){let{deleteAgent:s,deleteAgentResult:i,agent:a}=e,n="delete this agent",[t,r]=(0,d.useState)("");return(0,l.jsxs)(h.Vq,{children:[(0,l.jsx)(h.hg,{asChild:!0,children:(0,l.jsx)(x.z,{disabled:!(null==a?void 0:a.id),variant:"destructive",children:(0,l.jsx)(m.Z,{className:"size-4"})})}),(0,l.jsxs)(h.cZ,{className:"sm:max-w-[475px]",children:[(0,l.jsx)(h.fK,{children:(0,l.jsx)(h.$N,{children:"Delete this agent"})}),(0,l.jsx)("div",{className:"grid gap-4 py-4",children:(0,l.jsxs)("div",{className:"grid gap-2",children:[(0,l.jsxs)(v._,{htmlFor:"name",children:['Type "',n,'" to confirm']}),(0,l.jsx)(u.I,{onChange:e=>{r(e.target.value)},id:"name",autoFocus:!0})]})}),(0,l.jsx)(h.cN,{children:(0,l.jsxs)(x.z,{disabled:t!==n||i.loading,onClick:()=>{s({variables:{id:a.id}})},variant:"destructive",type:"submit",children:["Delete ",i.loading&&(0,l.jsx)(j.g,{})]})})]})]})}var g=i(27689),f=i(66070),N=i(15681),b=i(6512),y=i(1828),w=i(12339),C=i(76818),z=i(13832),k=i(35974),Z=i(77992);function S(){return(0,l.jsx)("svg",{width:"19",height:"20",viewBox:"0 0 19 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M3.5 12.5003C2.72343 12.5003 2.33515 12.5003 2.02886 12.3735C1.62048 12.2043 1.29602 11.8798 1.12687 11.4715C1 11.1652 1 10.7769 1 10.0003V4.33366C1 3.40024 1 2.93353 1.18166 2.57701C1.34144 2.2634 1.59641 2.00844 1.91002 1.84865C2.26654 1.66699 2.73325 1.66699 3.66667 1.66699H9.33333C10.1099 1.66699 10.4982 1.66699 10.8045 1.79386C11.2129 1.96302 11.5373 2.28747 11.7065 2.69585C11.8333 3.00214 11.8333 3.39042 11.8333 4.16699M9.5 18.3337H15C15.9334 18.3337 16.4001 18.3337 16.7567 18.152C17.0703 17.9922 17.3252 17.7372 17.485 17.4236C17.6667 17.0671 17.6667 16.6004 17.6667 15.667V10.167C17.6667 9.23357 17.6667 8.76686 17.485 8.41034C17.3252 8.09674 17.0703 7.84177 16.7567 7.68198C16.4001 7.50033 15.9334 7.50033 15 7.50033H9.5C8.56658 7.50033 8.09987 7.50033 7.74335 7.68198C7.42975 7.84177 7.17478 8.09674 7.01499 8.41034C6.83333 8.76686 6.83333 9.23357 6.83333 10.167V15.667C6.83333 16.6004 6.83333 17.0671 7.01499 17.4236C7.17478 17.7372 7.42975 17.9922 7.74335 18.152C8.09987 18.3337 8.56658 18.3337 9.5 18.3337Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var A=i(53647),F=i(57054),_=i(23518),I=i(24156),D=i(30401),O=i(49137),T=i(53113),R=i(48736),M=i(81706),P=i(29374),J=i(99397),E=i(73247),V=i(32489),G=i(22252),B=i(98728),q=i(33245),Y=i(94508),L=i(8014),U=i(74928),W=i(81103),K=i(69304),Q=i(78361),X=i(92279),H=i(44045),$=i(68656),ee=i(76367),es=i(35283),ei=i(12194),el=i(35629);let ea=["marketing","sales","finance","hr","coding","support","research","knowledge","product"],en=e=>{let{configItem:s,currentValue:i,variables:a,onVariableSelect:n}=e,[t,r]=d.useState(!1),c=a.find(e=>e.name===i);return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{className:"text-sm",children:[(0,l.jsx)("div",{className:"font-medium capitalize",children:s.name}),(0,l.jsx)("div",{className:"text-muted-foreground text-xs capitalize",children:s.description})]}),(0,l.jsxs)(F.J2,{open:t,onOpenChange:r,modal:!0,children:[(0,l.jsx)(F.xo,{asChild:!0,children:(0,l.jsxs)(x.z,{variant:"outline",role:"combobox","aria-expanded":t,className:"w-full justify-between text-sm",children:[c?c.name:"Select variable...",(0,l.jsx)(I.Z,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,l.jsx)(F.yk,{className:"w-full p-0",children:(0,l.jsxs)(_.mY,{children:[(0,l.jsx)(_.sZ,{placeholder:"Search variables..."}),(0,l.jsxs)(_.e8,{children:[(0,l.jsx)(_.rb,{children:"No variables found."}),(0,l.jsx)(_.fu,{children:a.map(e=>(0,l.jsxs)(_.di,{onSelect:()=>{n(e.name),console.log("variable",e),r(!1)},children:[(0,l.jsx)(D.Z,{className:(0,Y.cn)("mr-2 h-4 w-4",i===e.name?"opacity-100":"opacity-0")}),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("span",{children:e.name}),e.encrypted&&(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"\uD83D\uDD12 Encrypted"})]})]},e.id))})]})]})}),s.default&&(0,l.jsxs)(f.Zb,{children:[(0,l.jsx)(f.Ol,{children:(0,l.jsx)(f.ll,{className:"text-md",children:"Default value"})}),(0,l.jsx)(f.aY,{children:(0,l.jsx)($.J,{text:s.default,sliceLength:200})})]})]})]})},et=o.Ry({name:o.Z_().min(2,{message:"Agent name must be at least 2 characters."}).max(300,{message:"Agent name must not be longer than 300 characters."}),category:o.Z_().optional(),description:o.Z_().max(1e4,{message:"Agent description must not be longer than 10.000 characters."}).nullable().optional(),instructions:o.Z_().max(4e4,{message:"Agent instructions must not be longer than 40.000 characters."}).nullable().optional(),id:o.Z_().or(o.Rx()).nullable().optional(),active:o.Yj(),providerapikey:o.Z_().nullable().optional(),firewall:o.Ry({enabled:o.O7().optional(),scanners:o.Ry({promptGuard:o.O7().optional(),codeShield:o.O7().optional(),agentAlignment:o.O7().optional(),hiddenAscii:o.O7().optional(),piiDetection:o.O7().optional()}).optional()}).optional()});function er(e){var s,i,o,m,h,v,$,er,ed,ec,eo,em,ex,eh,eu,ev,ej,ep,eg,ef,eN,eb,ey,ew,eC,ez,ek,eZ,eS,eA,eF,e_,eI,eD,eO,eT,eR,eM,eP;let{agent:eJ,refetch:eE}=e,eV=(0,r.useRouter)(),{user:eG}=(0,d.useContext)(z.S),eB=(0,d.useContext)(H.E),[eq,eY]=(0,d.useState)(eJ.tools?eJ.tools:[]),[eL,eU]=(0,d.useState)(!1),[eW,eK]=(0,d.useState)(""),[eQ,eX]=(0,d.useState)("all"),[eH,e$]=(0,d.useState)(""),[e0,e1]=(0,d.useState)(new Set),[e2,e3]=(0,d.useState)(!1);(0,d.useEffect)(()=>{let e=setTimeout(()=>{e$(eW)},300);return()=>clearTimeout(e)},[eW]);let[e4,e7]=(0,d.useState)(eJ.providerapikey||""),[e6,e5]=(0,d.useState)((null===(s=eJ.firewall)||void 0===s?void 0:s.enabled)||!1),[e9,e8]=(0,d.useState)(eJ.animation_idle||""),[se,ss]=(0,d.useState)(eJ.animation_responding||""),[si,sl]=(0,d.useState)({rights_mode:eJ.rights_mode,users:null===(i=eJ.RBAC)||void 0===i?void 0:i.users,roles:null===(o=eJ.RBAC)||void 0===o?void 0:o.roles}),[sa,sn]=(0,d.useState)({promptGuard:(null===(h=eJ.firewall)||void 0===h?void 0:null===(m=h.scanners)||void 0===m?void 0:m.promptGuard)||!1,codeShield:(null===($=eJ.firewall)||void 0===$?void 0:null===(v=$.scanners)||void 0===v?void 0:v.codeShield)||!1,agentAlignment:(null===(ed=eJ.firewall)||void 0===ed?void 0:null===(er=ed.scanners)||void 0===er?void 0:er.agentAlignment)||!1,hiddenAscii:(null===(eo=eJ.firewall)||void 0===eo?void 0:null===(ec=eo.scanners)||void 0===ec?void 0:ec.hiddenAscii)||!1,piiDetection:(null===(ex=eJ.firewall)||void 0===ex?void 0:null===(em=ex.scanners)||void 0===em?void 0:em.piiDetection)||!1}),{toast:st}=(0,Z.pm)(),sr=(0,d.useMemo)(()=>({search:eH||void 0,category:"all"===eQ?void 0:eQ,limit:100,page:0}),[eH,eQ]),{data:sd,loading:sc}=(0,a.aM)(g.Ul,{variables:sr}),{data:so}=(0,a.aM)(g.Az,{variables:{page:1,limit:100}}),{data:sm}=(0,a.aM)(g.Tp),sx=(null==so?void 0:null===(eh=so.variablesPagination)||void 0===eh?void 0:eh.items)||[],{data:sh,loading:su,refetch:sv}=(0,ei.Sh)({page:1,limit:100,filters:[{assigned_agents:{contains:eJ.id}}]}),sj=(null==sh?void 0:null===(eu=sh.prompt_libraryPagination)||void 0===eu?void 0:eu.items)||[],sp=(0,d.useMemo)(()=>{var e,s;return(null==sd?void 0:null===(s=sd.tools)||void 0===s?void 0:null===(e=s.items)||void 0===e?void 0:e.filter(e=>e.id!==eJ.id))||[]},[null==sd?void 0:null===(ev=sd.tools)||void 0===ev?void 0:ev.items,eJ.id]),sg=(0,d.useMemo)(()=>sp.reduce((e,s)=>(e[s.category]||(e[s.category]=[]),e[s.category].push(s),e),{}),[sp]),sf=(null==sm?void 0:sm.toolCategories)||[];(0,d.useEffect)(()=>{sf.length>0&&e1(new Set(Object.keys(sg)))},[sg]);let sN=()=>{eK(""),eX("all")},sb=e=>{e1(s=>{let i=new Set(s);return i.has(e)?i.delete(e):i.add(e),i})},sy=async()=>{try{await navigator.clipboard.writeText(eJ.id),st({title:"Agent ID copied to clipboard"})}catch(e){st({title:"Failed to copy Agent ID",variant:"destructive"})}},[sw,sC]=(0,n.D)(g.fG,{onCompleted:()=>{eV.push("/agents",{scroll:!1})}}),[sz,sk]=(0,n.D)(g.Dt,{refetchQueries:[g.as,"GetAgentById"]}),sZ=(0,c.cI)({resolver:(0,t.F)(et),defaultValues:null!=eJ?eJ:{name:"New agent",instructions:"",steps:[],firewall:{enabled:!1,scanners:{promptGuard:!1,codeShield:!1,agentAlignment:!1,hiddenAscii:!1,piiDetection:!1}}},mode:"onChange"}),[sS]=(0,n.D)(g.fB);return(0,l.jsxs)("div",{className:"h-full flex-col md:flex",children:[(0,l.jsx)("div",{className:"container flex flex-col items-start justify-between space-y-2 py-4 sm:flex-row sm:items-center sm:space-y-0 md:h-16",children:(0,l.jsxs)("div",{className:"ml-auto flex w-full space-x-2 sm:justify-end",children:[(null==eJ?void 0:eJ.id)&&(0,l.jsxs)(x.z,{onClick:sZ.handleSubmit(async e=>{console.log("data",e),sz({variables:{id:e.id,name:e.name,description:e.description,instructions:e.instructions,category:e.category,active:e.active,providerapikey:e4,animation_idle:e9,animation_responding:se,rights_mode:si.rights_mode,RBAC:{users:si.users||[],roles:si.roles||[]},firewall:JSON.stringify({enabled:e6,scanners:sa}),tools:JSON.stringify(eq)}}),eE()},e=>{console.error("form data invalid",e)}),disabled:sk.loading,variant:"secondary",type:"submit",children:["Save ",sk.loading&&(0,l.jsx)(j.g,{className:"ml-2"})]}),(0,l.jsx)(x.z,{onClick:()=>{eV.push("/agents",{scroll:!1})},variant:"secondary",type:"button",children:"Back"}),(0,l.jsx)(p,{agent:eJ,deleteAgent:sw,deleteAgentResult:sC})]})}),(0,l.jsx)(b.Z,{}),(0,l.jsx)(w.mQ,{defaultValue:"complete",className:"flex-1",children:(0,l.jsx)("div",{className:"container py-6",children:(0,l.jsx)("div",{className:"grid items-stretch gap-6",children:(0,l.jsx)("div",{className:"md:order-1",children:(0,l.jsx)("div",{className:"flex flex-col space-y-4",children:(0,l.jsx)("div",{className:"h-full",children:(0,l.jsx)(N.l0,{...sZ,children:(0,l.jsx)("form",{className:"space-y-8",children:(0,l.jsxs)("div",{className:"grid grid-rows-1 grid-flow-col gap-6 lg:grid-cols-2",children:[(0,l.jsx)("div",{className:"col",children:(0,l.jsx)("div",{className:"flex flex-col space-y-4",children:(0,l.jsx)("div",{className:"flex flex-col space-y-2",children:(0,l.jsxs)(f.Zb,{children:[(0,l.jsx)(f.Ol,{children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[eJ.image&&(0,l.jsx)("div",{className:"w-10 h-10 rounded-full overflow-hidden flex-shrink-0",children:(0,l.jsx)("img",{src:eJ.image,alt:"".concat(eJ.name," profile"),className:"w-full h-full object-cover"})}),(0,l.jsx)(f.ll,{children:"Agent"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,l.jsxs)("span",{children:["ID: ",eJ.id]}),(0,l.jsx)("button",{type:"button",onClick:sy,className:"p-1 hover:bg-muted rounded transition-colors text-muted-foreground",title:"Copy Agent ID",children:(0,l.jsx)(S,{})})]})]})}),(0,l.jsxs)(f.aY,{className:"grid gap-4",children:[(0,l.jsx)(N.Wi,{control:sZ.control,name:"name",render:e=>{let{field:s}=e;return(0,l.jsxs)(N.xJ,{children:[(0,l.jsx)(N.lX,{children:"Name"}),(0,l.jsx)(N.NI,{children:(0,l.jsx)(u.I,{type:"text",className:"resize-none",...s})}),(0,l.jsx)(N.zG,{})]})}}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-sm font-medium mb-2",children:"Modalities"}),(0,l.jsxs)("p",{className:"text-sm text-muted-foreground mb-2",children:["This agent uses ",(0,l.jsx)("b",{children:eJ.modelName})," from ",(0,l.jsx)("b",{children:eJ.providerName})," and can use the following capabilities:"]}),(0,l.jsx)(W.pn,{children:(0,l.jsxs)("div",{className:"flex items-center gap-3 mt-2",children:[(0,l.jsx)("div",{className:"p-2 rounded-md ".concat((null===(ej=eJ.capabilities)||void 0===ej?void 0:ej.text)?"bg-primary text-primary-foreground":"bg-gray-500 text-white"),children:(0,l.jsx)(O.Z,{className:"h-4 w-4"})}),(0,l.jsxs)(W.u,{children:[(0,l.jsx)(W.aJ,{asChild:!0,children:(0,l.jsx)("div",{className:"p-2 rounded-md ".concat((null===(eg=eJ.capabilities)||void 0===eg?void 0:null===(ep=eg.images)||void 0===ep?void 0:ep.length)?"bg-primary text-primary-foreground":"bg-gray-500 text-white"),children:(0,l.jsx)(T.Z,{className:"h-4 w-4"})})}),(0,l.jsx)(W._v,{children:(0,l.jsxs)("p",{children:["Images: ",(null===(eN=eJ.capabilities)||void 0===eN?void 0:null===(ef=eN.images)||void 0===ef?void 0:ef.length)?eJ.capabilities.images.join(", "):"None"]})})]}),(0,l.jsxs)(W.u,{children:[(0,l.jsx)(W.aJ,{asChild:!0,children:(0,l.jsx)("div",{className:"p-2 rounded-md ".concat((null===(ey=eJ.capabilities)||void 0===ey?void 0:null===(eb=ey.files)||void 0===eb?void 0:eb.length)?"bg-primary text-primary-foreground":"bg-gray-500 text-white"),children:(0,l.jsx)(R.Z,{className:"h-4 w-4"})})}),(0,l.jsx)(W._v,{children:(0,l.jsxs)("p",{children:["Files: ",(null===(eC=eJ.capabilities)||void 0===eC?void 0:null===(ew=eC.files)||void 0===ew?void 0:ew.length)?eJ.capabilities.files.join(", "):"None"]})})]}),(0,l.jsxs)(W.u,{children:[(0,l.jsx)(W.aJ,{asChild:!0,children:(0,l.jsx)("div",{className:"p-2 rounded-md ".concat((null===(ek=eJ.capabilities)||void 0===ek?void 0:null===(ez=ek.audio)||void 0===ez?void 0:ez.length)?"bg-primary text-primary-foreground":"bg-gray-500 text-white"),children:(0,l.jsx)(M.Z,{className:"h-4 w-4"})})}),(0,l.jsx)(W._v,{children:(0,l.jsxs)("p",{children:["Audio: ",(null===(eS=eJ.capabilities)||void 0===eS?void 0:null===(eZ=eS.audio)||void 0===eZ?void 0:eZ.length)?eJ.capabilities.audio.join(", "):"None"]})})]}),(0,l.jsxs)(W.u,{children:[(0,l.jsx)(W.aJ,{asChild:!0,children:(0,l.jsx)("div",{className:"p-2 rounded-md ".concat((null===(eF=eJ.capabilities)||void 0===eF?void 0:null===(eA=eF.video)||void 0===eA?void 0:eA.length)?"bg-primary text-primary-foreground":"bg-gray-500 text-white"),children:(0,l.jsx)(P.Z,{className:"h-4 w-4"})})}),(0,l.jsx)(W._v,{children:(0,l.jsxs)("p",{children:["Video: ",(null===(eI=eJ.capabilities)||void 0===eI?void 0:null===(e_=eI.video)||void 0===e_?void 0:e_.length)?eJ.capabilities.video.join(", "):"None"]})})]})]})})]}),(0,l.jsx)(N.Wi,{control:sZ.control,name:"category",render:e=>{let{field:s}=e;return s.value||(s.value=""),(0,l.jsxs)(N.xJ,{children:[(0,l.jsx)(N.lX,{children:"Category"}),(0,l.jsx)(N.NI,{children:(0,l.jsxs)(A.Ph,{onValueChange:e=>{s.onChange(e)},children:[(0,l.jsx)(A.i4,{children:(0,l.jsx)(A.ki,{className:"capitalize",placeholder:s.value||"Select a category"})}),(0,l.jsx)(A.Bw,{children:ea.map(e=>(0,l.jsx)(A.Ql,{className:"capitalize",value:e,children:e},e))})]})}),(0,l.jsx)(N.zG,{})]})}}),(0,l.jsx)(N.Wi,{control:sZ.control,name:"description",render:e=>{var s;let{field:i}=e;return i.value||(i.value=""),(0,l.jsxs)(N.xJ,{children:[(0,l.jsx)(N.lX,{children:"Description"}),(0,l.jsx)(N.NI,{children:(0,l.jsx)(C.g,{rows:2,className:"resize-none",...i,value:null!==(s=i.value)&&void 0!==s?s:""})}),(0,l.jsx)(N.zG,{})]})}}),(0,l.jsx)(N.Wi,{control:sZ.control,name:"instructions",render:e=>{var s;let{field:i}=e;return i.value||(i.value=""),(0,l.jsxs)(N.xJ,{children:[(0,l.jsx)(N.lX,{children:"Instructions"}),(0,l.jsx)(N.NI,{children:(0,l.jsx)(C.g,{rows:5,className:"resize-none",...i,value:null!==(s=i.value)&&void 0!==s?s:""})}),(0,l.jsx)(N.zG,{})]})}}),(0,l.jsxs)("div",{className:"space-y-2 w-full overflow-x-hidden",children:[(0,l.jsxs)("div",{className:"text-sm",children:[(0,l.jsx)("div",{className:"font-medium",children:"Provider API Key"}),(0,l.jsx)("div",{className:"text-muted-foreground text-xs",children:"Select a variable containing the API key for the provider"}),eJ.authenticationInformation&&(0,l.jsx)("div",{className:"text-muted-foreground text-xs",children:(0,l.jsx)(el.H,{children:eJ.authenticationInformation})})]}),(0,l.jsxs)(F.J2,{children:[(0,l.jsx)(F.xo,{asChild:!0,children:(0,l.jsxs)(x.z,{variant:"outline",role:"combobox",className:"w-full justify-between text-sm",children:[(null===(eD=sx.find(e=>e.name===e4))||void 0===eD?void 0:eD.name)||"Select variable...",(0,l.jsx)(I.Z,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,l.jsx)(F.yk,{className:"w-full p-0 z-[9999]",children:(0,l.jsxs)(_.mY,{children:[(0,l.jsx)(_.sZ,{placeholder:"Search variables..."}),(0,l.jsxs)(_.e8,{children:[(0,l.jsx)(_.rb,{children:"No variables found."}),(0,l.jsx)(_.fu,{children:sx.map(e=>(0,l.jsxs)(_.di,{onSelect:()=>{e7(e.name)},children:[(0,l.jsx)(D.Z,{className:(0,Y.cn)("mr-2 h-4 w-4",e4===e.name?"opacity-100":"opacity-0")}),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("span",{children:e.name}),e.encrypted&&(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"\uD83D\uDD12 Encrypted"})]})]},e.id))})]})]})})]})]}),(null==eB?void 0:null===(eO=eB.fileUploads)||void 0===eO?void 0:eO.s3endpoint)&&(0,l.jsx)(f.Zb,{className:"bg-transparent",children:(0,l.jsxs)(U.zF,{children:[(0,l.jsx)(f.Ol,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("p",{className:"text-base",children:"Custom visualizations"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground mb-0",children:"Upload custom Lottie animations for idle and responding states."})]}),(0,l.jsx)(U.wy,{asChild:!0,children:(0,l.jsxs)(x.z,{variant:"ghost",size:"icon",className:"size-8",children:[(0,l.jsx)(I.Z,{className:"size-4"}),(0,l.jsx)("span",{className:"sr-only",children:"Toggle"})]})})]})}),(0,l.jsx)(U.Fw,{className:"mt-5",children:(0,l.jsx)(f.aY,{className:"space-y-4",children:(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-sm font-medium",children:"Idle Animation"}),(0,l.jsx)("div",{className:"text-xs text-muted-foreground",children:"Animation when agent is waiting"})]}),(0,l.jsxs)(Q.jF,{s3key:e9,children:[(0,l.jsx)(Q.ZP,{id:"agent-idle-animation",allowedFileTypes:[".json"],selectionLimit:1,buttonText:"",dependencies:[eJ.id],onConfirm:e=>{e.length>0&&e8(e[0])}}),e9&&(0,l.jsxs)("div",{className:"mt-2 p-2 border rounded bg-muted/30",children:[(0,l.jsx)("div",{className:"text-xs text-muted-foreground mb-1",children:"Preview:"}),(0,l.jsx)("div",{className:"w-12 h-12 mx-auto",children:(0,l.jsx)(X.Z,{agent:{...eJ,animation_idle:e9},status:"ready"})})]})]})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-sm font-medium",children:"Responding Animation"}),(0,l.jsx)("div",{className:"text-xs text-muted-foreground",children:"Animation when agent is responding"})]}),(0,l.jsxs)(Q.jF,{s3key:se,children:[(0,l.jsx)(Q.ZP,{id:"agent-responding-animation",allowedFileTypes:[".json"],selectionLimit:1,buttonText:"",dependencies:[eJ.id],onConfirm:e=>{e.length>0&&ss(e[0])}}),se&&(0,l.jsxs)("div",{className:"mt-2 p-2 border rounded bg-muted/30",children:[(0,l.jsx)("div",{className:"text-xs text-muted-foreground mb-1",children:"Preview:"}),(0,l.jsx)("div",{className:"w-12 h-12 mx-auto",children:(0,l.jsx)(X.Z,{agent:{...eJ,animation_responding:se},status:"streaming"})})]})]})]})]})})})]})}),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"text-sm font-medium mb-0",children:" You can test this agent using the Exulu UI without activating the agent if you are a super admin:"}),(0,l.jsx)(x.z,{className:"mt-0",onClick:async()=>{var e,s,i;console.log("agent",eJ);let l=await sS({variables:{title:"New session",user:eG.id,agent:eJ.id}});console.log("result",l);let a=null==l?void 0:null===(i=l.data)||void 0===i?void 0:null===(s=i.agent_sessionsCreateOne)||void 0===s?void 0:null===(e=s.item)||void 0===e?void 0:e.id;eV.push("/chat/".concat(eJ.id,"/").concat(a))},type:"button",variant:"default",children:"Go to chat"})]})]})]})})})}),(0,l.jsx)("div",{className:"col",children:(0,l.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,l.jsx)(N.Wi,{control:sZ.control,name:"active",render:e=>{let{field:s}=e;return(0,l.jsxs)(N.xJ,{className:"flex flex-row items-center justify-between rounded-lg border p-4",children:[(0,l.jsxs)("div",{className:"space-y-0.5",children:[(0,l.jsx)(N.lX,{className:"text-base",children:"Is this agent active?"}),(0,l.jsx)(N.pf,{children:"When active this agent will be available via the Exulu UI and API endpoint."})]}),(0,l.jsx)(N.NI,{children:(0,l.jsx)(y.r,{checked:s.value,onCheckedChange:s.onChange})})]})}}),(0,l.jsx)(f.Zb,{className:"bg-transparent",children:(0,l.jsxs)(U.zF,{children:[(0,l.jsx)(f.Ol,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("p",{className:"text-base",children:"Access Control"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground mb-0",children:"Control access to this agent."})]}),(0,l.jsx)(U.wy,{asChild:!0,children:(0,l.jsxs)(x.z,{variant:"ghost",size:"icon",className:"size-8",children:[(0,l.jsx)(I.Z,{className:"size-4"}),(0,l.jsx)("span",{className:"sr-only",children:"Toggle"})]})})]})}),(0,l.jsx)(U.Fw,{className:"mt-5",children:(0,l.jsx)(f.aY,{className:"space-y-4",children:(0,l.jsx)(L.P,{initialRightsMode:eJ.rights_mode,initialUsers:null===(eT=eJ.RBAC)||void 0===eT?void 0:eT.users,initialRoles:null===(eR=eJ.RBAC)||void 0===eR?void 0:eR.roles,onChange:(e,s,i)=>{sl({rights_mode:e,users:s,roles:i})}})})})]})}),(0,l.jsx)(f.Zb,{className:"bg-transparent",children:(0,l.jsxs)(U.zF,{children:[(0,l.jsx)(f.Ol,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("p",{className:"text-base",children:"Prompt Templates"}),(0,l.jsxs)("p",{className:"text-sm text-muted-foreground mb-0",children:["Manage prompt templates assigned to this agent (",sj.length,")"]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(x.z,{type:"button",variant:"outline",size:"sm",onClick:()=>e3(!0),children:[(0,l.jsx)(J.Z,{className:"h-4 w-4 mr-2"}),"New Prompt"]}),(0,l.jsx)(U.wy,{asChild:!0,children:(0,l.jsxs)(x.z,{variant:"ghost",size:"icon",className:"size-8",children:[(0,l.jsx)(I.Z,{className:"size-4"}),(0,l.jsx)("span",{className:"sr-only",children:"Toggle"})]})})]})]})}),(0,l.jsx)(U.Fw,{className:"mt-5",children:(0,l.jsx)(f.aY,{className:"space-y-4",children:su?(0,l.jsx)("div",{className:"text-sm text-muted-foreground",children:"Loading prompts..."}):0===sj.length?(0,l.jsxs)("div",{className:"text-center py-6 border-2 border-dashed rounded-lg",children:[(0,l.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No prompts assigned to this agent yet"}),(0,l.jsxs)(x.z,{type:"button",variant:"outline",size:"sm",onClick:()=>e3(!0),children:[(0,l.jsx)(J.Z,{className:"h-4 w-4 mr-2"}),"Create First Prompt"]})]}):(0,l.jsx)("div",{className:"grid gap-4",children:sj.map(e=>(0,l.jsx)(ee.$,{prompt:e,user:eG,onUpdate:sv},e.id))})})})]})}),(0,l.jsxs)(f.Zb,{children:[(0,l.jsxs)(f.Ol,{children:[(0,l.jsxs)(f.ll,{className:"flex items-center gap-2",children:["Tools",sc&&(0,l.jsx)(j.g,{className:"h-4 w-4"})]}),(0,l.jsx)(f.SZ,{children:eq.length>0?"".concat(eq.length," tool").concat(1===eq.length?"":"s"," enabled for this agent"):"No tools enabled for this agent"})]}),(0,l.jsx)(f.aY,{children:(0,l.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)("div",{className:"flex items-center gap-2",children:(0,l.jsxs)("div",{className:"relative flex-1",children:[(0,l.jsx)(E.Z,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,l.jsx)(u.I,{placeholder:"Search tools by name or description...",value:eW,onChange:e=>eK(e.target.value),className:"pl-10 pr-10"}),eW&&(0,l.jsx)(x.z,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 transform -translate-y-1/2 h-6 w-6 p-0",onClick:()=>eK(""),children:(0,l.jsx)(V.Z,{className:"h-3 w-3"})})]})}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(A.Ph,{value:eQ,onValueChange:eX,children:[(0,l.jsx)(A.i4,{className:"w-[200px]",children:(0,l.jsx)(A.ki,{placeholder:"Filter by category"})}),(0,l.jsxs)(A.Bw,{children:[(0,l.jsx)(A.Ql,{value:"all",children:"All categories"}),sf.map(e=>(0,l.jsx)(A.Ql,{value:e,className:"capitalize",children:e},e))]})]}),(eW||"all"!==eQ)&&(0,l.jsxs)(x.z,{variant:"outline",onClick:sN,children:[(0,l.jsx)(V.Z,{className:"h-4 w-4"}),(0,l.jsx)("span",{className:"sr-only",children:"Clear filters"})]}),(0,l.jsx)(x.z,{type:"button",variant:"outline",onClick:()=>{e1(new Set)},children:"Expand all"}),(0,l.jsx)(x.z,{type:"button",variant:"outline",onClick:()=>{e1(new Set(Object.keys(sg)))},children:"Collapse all"})]}),(0,l.jsxs)("div",{className:"ml-auto text-sm text-muted-foreground",children:[(null==sd?void 0:null===(eM=sd.tools)||void 0===eM?void 0:eM.total)||0," tool",1!==((null==sd?void 0:null===(eP=sd.tools)||void 0===eP?void 0:eP.total)||0)?"s":"",eH||"all"!==eQ?" found":" available","."]})]}),(0,l.jsxs)("div",{className:"space-y-6",children:["all"===eQ?Object.entries(sg).map(e=>{let[s,i]=e,a=i.filter(e=>eq.some(s=>s.id===e.id)).length,n=e0.has(s);return(0,l.jsxs)(U.zF,{open:!n,onOpenChange:()=>sb(s),children:[(0,l.jsxs)("div",{className:"flex items-center justify-between p-3 border rounded-lg bg-muted/30",children:[(0,l.jsx)(U.wy,{asChild:!0,children:(0,l.jsxs)(x.z,{variant:"ghost",className:"flex items-center gap-2 p-0 h-auto font-medium",children:[(0,l.jsx)(I.Z,{className:"h-4 w-4"}),(0,l.jsx)("span",{className:"capitalize",children:s}),(0,l.jsxs)(k.C,{variant:"secondary",className:"text-xs",children:[a,"/",i.length]})]})}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(x.z,{variant:"outline",size:"sm",onClick:()=>{let e=i.filter(e=>!eq.some(s=>s.id===e.id)).map(e=>{var s;return{id:e.id,type:e.type,config:(null===(s=e.config)||void 0===s?void 0:s.map(e=>({name:e.name,variable:""})))||[]}});eY([...eq,...e])},disabled:a===i.length,children:"Enable All"}),(0,l.jsx)(x.z,{variant:"outline",size:"sm",onClick:()=>{let e=i.map(e=>e.id);eY(eq.filter(s=>!e.includes(s.id)))},disabled:0===a,children:"Disable All"})]})]}),(0,l.jsx)(U.Fw,{className:"mt-2",children:(0,l.jsx)("div",{className:"space-y-2 pl-4",children:i.map(e=>{var s,i;let a=eq.some(s=>s.id===e.id),n=eq.find(s=>s.id===e.id),t=(null===(s=e.config)||void 0===s?void 0:s.length)||0,r=(null==n?void 0:null===(i=n.config)||void 0===i?void 0:i.filter(e=>e.variable&&""!==e.variable.trim()).length)||0,d=a&&t>0&&r<t;return(0,l.jsx)("div",{className:"rounded-lg border p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center flex-1",children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"font-medium",children:null==e?void 0:e.name}),(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[t>0&&a&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(k.C,{variant:"secondary",className:"text-xs",children:[r,"/",t]}),d&&(0,l.jsx)(G.Z,{className:"h-4 w-4 text-destructive"})]}),(0,l.jsx)(k.C,{variant:"outline",children:null==e?void 0:e.category})]})]}),(0,l.jsx)("div",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:null==e?void 0:e.description})]}),(0,l.jsxs)(K.yo,{open:eL===e.id,onOpenChange:()=>{eL===e.id?eU(!1):eU(e.id)},children:[t>0&&!a?(0,l.jsx)(K.aM,{asChild:!0,children:(0,l.jsx)(x.z,{variant:"ghost",size:"sm",children:(0,l.jsx)(B.Z,{className:"h-4 w-4"})})}):(0,l.jsx)(x.z,{type:"button",disabled:!0,variant:"ghost",size:"sm",children:(0,l.jsx)(B.Z,{className:"h-4 w-4"})}),(0,l.jsx)(K.aM,{asChild:!0,children:(0,l.jsx)(x.z,{className:"mr-2",variant:"ghost",size:"sm",children:(0,l.jsx)(q.Z,{className:"h-4 w-4"})})}),(0,l.jsxs)(K.ue,{className:"w-[400px] sm:w-[540px]",children:[(0,l.jsxs)(K.Tu,{children:[(0,l.jsx)(K.bC,{children:null==e?void 0:e.name}),(0,l.jsx)(K.Ei,{children:null==e?void 0:e.description})]}),(0,l.jsx)("div",{className:"py-6",children:(0,l.jsx)("div",{className:"space-y-4",children:e.config&&e.config.length>0&&(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("div",{className:"text-md font-medium",children:"Configuration variables:"}),e.config.map((s,i)=>{var t;let r=(null==n?void 0:null===(t=n.config.find(e=>e.name===s.name))||void 0===t?void 0:t.variable)||"";return(0,l.jsx)("div",{className:"space-y-2",children:a?(0,l.jsx)(en,{configItem:s,currentValue:r,variables:sx,onVariableSelect:i=>{let l=eq.map(l=>l.id===e.id?{...l,config:l.config.map(e=>e.name===s.name?{...e,variable:i}:e)}:l);console.log("updated",l),eY(l)}}):(0,l.jsx)("div",{className:"text-xs text-muted-foreground p-2 bg-muted rounded",children:"Enable this tool to configure"})},i)})]})})})]})]})]}),(0,l.jsx)(y.r,{checked:a,onCheckedChange:s=>{let i=[...eq];if(s){var l,a;i=[...eq,{id:e.id,type:e.type,config:(null===(l=e.config)||void 0===l?void 0:l.map(e=>({name:e.name,variable:""})))||[]}],(null===(a=e.config)||void 0===a?void 0:a.length)>0&&eU(e.id)}else i=eq.filter(s=>s.id!==e.id);eY(i)}})]})},null==e?void 0:e.id)})})})]},s)}):(0,l.jsx)("div",{className:"space-y-2",children:sp.map(e=>{var s,i;let a=eq.some(s=>s.id===e.id),n=eq.find(s=>s.id===e.id),t=(null===(s=e.config)||void 0===s?void 0:s.length)||0,r=(null==n?void 0:null===(i=n.config)||void 0===i?void 0:i.filter(e=>e.variable&&""!==e.variable.trim()).length)||0,d=a&&t>0&&r<t;return(0,l.jsx)("div",{className:"rounded-lg border p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center flex-1",children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"font-medium",children:null==e?void 0:e.name}),(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[t>0&&a&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(k.C,{variant:"secondary",className:"text-xs",children:[r,"/",t]}),d&&(0,l.jsx)(G.Z,{className:"h-4 w-4 text-destructive"})]}),(0,l.jsx)(k.C,{variant:"outline",children:null==e?void 0:e.category})]})]}),(0,l.jsx)("div",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:null==e?void 0:e.description})]}),(0,l.jsxs)(K.yo,{open:eL===e.id,onOpenChange:()=>{eL===e.id?eU(!1):eU(e.id)},children:[t>0&&!a?(0,l.jsx)(K.aM,{asChild:!0,children:(0,l.jsx)(x.z,{variant:"ghost",size:"sm",children:(0,l.jsx)(B.Z,{className:"h-4 w-4"})})}):(0,l.jsx)(x.z,{type:"button",disabled:!0,variant:"ghost",size:"sm",children:(0,l.jsx)(B.Z,{className:"h-4 w-4"})}),(0,l.jsx)(K.aM,{asChild:!0,children:(0,l.jsx)(x.z,{className:"mr-2",variant:"ghost",size:"sm",children:(0,l.jsx)(q.Z,{className:"h-4 w-4"})})}),(0,l.jsxs)(K.ue,{className:"w-[400px] sm:w-[540px]",children:[(0,l.jsxs)(K.Tu,{children:[(0,l.jsx)(K.bC,{children:null==e?void 0:e.name}),(0,l.jsx)(K.Ei,{children:null==e?void 0:e.description})]}),(0,l.jsx)("div",{className:"py-6",children:(0,l.jsx)("div",{className:"space-y-4",children:e.config&&e.config.length>0&&(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("div",{className:"text-md font-medium",children:"Configuration variables:"}),e.config.map((s,i)=>{var t;let r=(null==n?void 0:null===(t=n.config.find(e=>e.name===s.name))||void 0===t?void 0:t.variable)||"";return(0,l.jsx)("div",{className:"space-y-2",children:a?(0,l.jsx)(en,{configItem:s,currentValue:r,variables:sx,onVariableSelect:i=>{let l=eq.map(l=>l.id===e.id?{...l,config:l.config.map(e=>e.name===s.name?{...e,variable:i}:e)}:l);console.log("updated",l),eY(l)}}):(0,l.jsx)("div",{className:"text-xs text-muted-foreground p-2 bg-muted rounded",children:"Enable this tool to configure"})},i)})]})})})]})]})]}),(0,l.jsx)(y.r,{checked:a,onCheckedChange:s=>{let i=[...eq];if(s){var l,a;i=[...eq,{id:e.id,type:e.type,config:(null===(l=e.config)||void 0===l?void 0:l.map(e=>({name:e.name,variable:""})))||[]}],(null===(a=e.config)||void 0===a?void 0:a.length)>0&&eU(e.id)}else i=eq.filter(s=>s.id!==e.id);eY(i)}})]})},null==e?void 0:e.id)})}),0===sp.length&&(eW||"all"!==eQ)&&(0,l.jsxs)("div",{className:"text-center py-8",children:[(0,l.jsx)("div",{className:"text-muted-foreground",children:"No tools found matching your criteria."}),(0,l.jsx)(x.z,{variant:"outline",size:"sm",className:"mt-2",onClick:sN,children:"Clear filters"})]})]})]})})]})]})})]})})})})})})})})}),(0,l.jsx)(es.D,{open:e2,onOpenChange:e3,onSuccess:sv,user:eG,defaultAssignedAgents:[eJ.id]})]})}},68656:function(e,s,i){i.d(s,{J:function(){return p}});var l=i(57437);i(2265);var a=i(26110),n=i(77992),t=i(35629),r=i(62869),d=i(81103),c=i(94508);let o=e=>{let{className:s,...i}=e;return(0,l.jsx)("div",{className:(0,c.cn)("flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm",s),...i})},m=e=>{let{className:s,...i}=e;return(0,l.jsx)("div",{className:(0,c.cn)("flex items-center justify-between border-b bg-muted/50 px-4 py-3",s),...i})},x=e=>{let{className:s,...i}=e;return(0,l.jsx)("div",{className:(0,c.cn)("flex items-center gap-1",s),...i})},h=e=>{let{tooltip:s,label:i,icon:a,children:n,className:t,size:o="sm",variant:m="ghost",...x}=e,h=(0,l.jsxs)(r.z,{className:(0,c.cn)("size-8 p-0 text-muted-foreground hover:text-foreground",t),size:o,type:"button",variant:m,...x,children:[a?(0,l.jsx)(a,{className:"size-4"}):n,(0,l.jsx)("span",{className:"sr-only",children:i||s})]});return s?(0,l.jsx)(d.pn,{children:(0,l.jsxs)(d.u,{children:[(0,l.jsx)(d.aJ,{asChild:!0,children:h}),(0,l.jsx)(d._v,{children:(0,l.jsx)("p",{children:s})})]})}):h},u=e=>{let{className:s,...i}=e;return(0,l.jsx)("div",{className:(0,c.cn)("flex-1 overflow-auto p-4",s),...i})};var v=i(33245),j=i(78867);function p(e){let{text:s,sliceLength:i}=e,{toast:r}=(0,n.pm)();return(0,l.jsxs)(a.Vq,{children:[(0,l.jsx)(a.hg,{asChild:!0,children:(0,l.jsxs)("button",{className:"cursor-pointer text-sm text-left w-full hover:bg-accent/50 transition-colors rounded-md p-2 group",children:[(0,l.jsxs)("span",{className:"block",children:[null==s?void 0:s.slice(0,null!=i?i:200),i&&s.length>i?"...":""]}),(0,l.jsxs)("span",{className:"flex items-center gap-1 text-xs text-muted-foreground mt-1 group-hover:text-foreground transition-colors",children:[(0,l.jsx)(v.Z,{className:"w-3 h-3"}),"Click to view full text"]})]})}),(0,l.jsx)(a.cZ,{className:"sm:max-w-[800px] max-h-[500px] overflow-y-scroll",children:(0,l.jsxs)(o,{children:[(0,l.jsx)(m,{children:(0,l.jsx)(x,{children:(0,l.jsx)(h,{icon:j.Z,label:"Copy",tooltip:"Copy to clipboard",onClick:async()=>{await navigator.clipboard.writeText(s),r({title:"Copied to clipboard"})}})})}),(0,l.jsx)(u,{children:(0,l.jsx)(t.H,{children:s})})]})})]})}},92279:function(e,s,i){var l=i(57437),a=i(7882),n=i(11713),t=i(78361);let r=e=>{let{agent:s,status:i,className:r}=e,{data:d}=(0,n.a)({queryKey:["defaultAnimation","idle"],queryFn:async()=>(await fetch("/agent-idle.json")).json(),staleTime:36e5,enabled:!s.animation_idle}),{data:c}=(0,n.a)({queryKey:["defaultAnimation","responding"],queryFn:async()=>(await fetch("/agent-responding.json")).json(),staleTime:36e5,enabled:!s.animation_responding}),{data:o}=(0,n.a)({queryKey:["customAnimation",s.animation_idle],queryFn:async()=>{if(!s.animation_idle)return null;let e=await (0,t.NF)(s.animation_idle);return(await fetch(e)).json()},enabled:!!s.animation_idle,staleTime:3e5}),{data:m}=(0,n.a)({queryKey:["customAnimation",s.animation_responding],queryFn:async()=>{if(!s.animation_responding)return null;let e=await (0,t.NF)(s.animation_responding);return(await fetch(e)).json()},enabled:!!s.animation_responding,staleTime:3e5}),{View:x}=(0,a.useLottie)((()=>{switch(i){case"submitted":case"ready":case"error":default:return{animationData:o||d,loop:!0,autoplay:!0};case"streaming":return{animationData:m||c,loop:!0,autoplay:!0}}})());return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"",children:(0,l.jsx)("div",{className:r,children:x})})})};s.Z=e=>{let{agent:s,status:i,className:a}=e;return(0,l.jsx)(r,{className:a,agent:s,status:i})}},15681:function(e,s,i){i.d(s,{NI:function(){return j},Wi:function(){return m},l0:function(){return c},lX:function(){return v},pf:function(){return p},xJ:function(){return u},zG:function(){return g}});var l=i(57437),a=i(37053),n=i(2265),t=i(29501),r=i(26815),d=i(94508);let c=t.RV,o=n.createContext({}),m=e=>{let{...s}=e;return(0,l.jsx)(o.Provider,{value:{name:s.name},children:(0,l.jsx)(t.Qr,{...s})})},x=()=>{let e=n.useContext(o),s=n.useContext(h),{getFieldState:i,formState:l}=(0,t.Gc)(),a=i(e.name,l);if(!e)throw Error("useFormField should be used within <FormField>");let{id:r}=s;return{id:r,name:e.name,formItemId:"".concat(r,"-form-item"),formDescriptionId:"".concat(r,"-form-item-description"),formMessageId:"".concat(r,"-form-item-message"),...a}},h=n.createContext({}),u=n.forwardRef((e,s)=>{let{className:i,...a}=e,t=n.useId();return(0,l.jsx)(h.Provider,{value:{id:t},children:(0,l.jsx)("div",{ref:s,className:(0,d.cn)("space-y-2",i),...a})})});u.displayName="FormItem";let v=n.forwardRef((e,s)=>{let{className:i,...a}=e,{error:n,formItemId:t}=x();return(0,l.jsx)(r._,{ref:s,className:(0,d.cn)(n&&"text-destructive",i),htmlFor:t,...a})});v.displayName="FormLabel";let j=n.forwardRef((e,s)=>{let{...i}=e,{error:n,formItemId:t,formDescriptionId:r,formMessageId:d}=x();return(0,l.jsx)(a.g7,{ref:s,id:t,"aria-describedby":n?"".concat(r," ").concat(d):"".concat(r),"aria-invalid":!!n,...i})});j.displayName="FormControl";let p=n.forwardRef((e,s)=>{let{className:i,...a}=e,{formDescriptionId:n}=x();return(0,l.jsx)("p",{ref:s,id:n,className:(0,d.cn)("text-sm text-muted-foreground",i),...a})});p.displayName="FormDescription";let g=n.forwardRef((e,s)=>{let{className:i,children:a,...n}=e,{error:t,formMessageId:r}=x(),c=t?String(null==t?void 0:t.message):a;return c?(0,l.jsx)("p",{ref:s,id:r,className:(0,d.cn)("text-sm font-medium text-destructive",i),...n,children:c}):null});g.displayName="FormMessage"},10492:function(e,s,i){i.d(s,{g:function(){return n}});var l=i(57437),a=i(94508);let n=e=>{let{className:s}=e;return(0,l.jsxs)("svg",{"aria-hidden":"true",role:"status",className:(0,a.cn)("inline w-4 h-4 text-white animate-spin fill-inherit",s),viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",className:"fill-inherit opacity-20"}),(0,l.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",className:"fill-inherit"})]})}},1828:function(e,s,i){i.d(s,{r:function(){return r}});var l=i(57437),a=i(50721),n=i(2265),t=i(94508);let r=n.forwardRef((e,s)=>{let{className:i,...n}=e;return(0,l.jsx)(a.fC,{className:(0,t.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",i),...n,ref:s,children:(0,l.jsx)(a.bU,{className:(0,t.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")})})});r.displayName=a.fC.displayName}}]);
2
+ //# sourceMappingURL=9953-95900a236271a222.js.map