@exulu/frontend 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.next/BUILD_ID +1 -1
- package/dist/.next/app-build-manifest.json +163 -160
- package/dist/.next/app-path-routes-manifest.json +1 -1
- package/dist/.next/build-manifest.json +2 -2
- package/dist/.next/prerender-manifest.json +1 -1
- package/dist/.next/server/app/(application)/agents/edit/[id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/agents/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/configuration/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/dashboard/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/data/[[...query]]/page.js +2 -2
- package/dist/.next/server/app/(application)/data/[[...query]]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page.js +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page.js +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/explorer/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/keys/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/projects/[project]/page.js +1 -1
- package/dist/.next/server/app/(application)/projects/[project]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/projects/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/prompts/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/roles/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/token/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/users/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/create/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/workflows/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(authentication)/login/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found.html +1 -1
- package/dist/.next/server/app/_not-found.rsc +1 -1
- package/dist/.next/server/app-paths-manifest.json +5 -5
- package/dist/.next/server/chunks/2270.js +145 -132
- package/dist/.next/server/chunks/{5084.js → 2587.js} +1 -1
- package/dist/.next/server/chunks/3503.js +1 -1
- package/dist/.next/server/chunks/5485.js +1 -1
- package/dist/.next/server/chunks/5974.js +1 -1
- package/dist/.next/server/chunks/7944.js +1 -1
- package/dist/.next/server/chunks/8286.js +1 -1
- package/dist/.next/server/middleware-manifest.json +5 -5
- package/dist/.next/server/pages/404.html +1 -1
- package/dist/.next/server/pages/500.html +1 -1
- package/dist/.next/server/server-reference-manifest.json +1 -1
- package/dist/.next/static/chunks/1707-06e693c4a709c147.js +2 -0
- package/dist/.next/static/chunks/1707-06e693c4a709c147.js.map +1 -0
- package/dist/.next/static/chunks/{1957-cf44b1d31a9c7d5c.js → 1957-34f17de1e14e45de.js} +1 -1
- package/dist/.next/static/chunks/{1957-cf44b1d31a9c7d5c.js.map → 1957-34f17de1e14e45de.js.map} +1 -1
- package/dist/.next/static/chunks/{2293-48a95904b834eccc.js → 2293-592e22dde70d632b.js} +1 -1
- package/dist/.next/static/chunks/{2293-48a95904b834eccc.js.map → 2293-592e22dde70d632b.js.map} +1 -1
- package/dist/.next/static/chunks/2534-3dd7a9fabfbdb9d8.js +2 -0
- package/dist/.next/static/chunks/2534-3dd7a9fabfbdb9d8.js.map +1 -0
- package/dist/.next/static/chunks/2823-324b1cd8f15ff9c5.js +2 -0
- package/dist/.next/static/chunks/2823-324b1cd8f15ff9c5.js.map +1 -0
- package/dist/.next/static/chunks/3246-1812de142455a0ac.js +2 -0
- package/dist/.next/static/chunks/3246-1812de142455a0ac.js.map +1 -0
- package/dist/.next/static/chunks/{3750-e3d1b2cccd265190.js → 3750-d0ae5d73288be8de.js} +2 -2
- package/dist/.next/static/chunks/3750-d0ae5d73288be8de.js.map +1 -0
- package/dist/.next/static/chunks/{3832-d7782d6a2771ae6c.js → 3832-0b8edbcc671f4cc0.js} +2 -2
- package/dist/.next/static/chunks/3832-0b8edbcc671f4cc0.js.map +1 -0
- package/dist/.next/static/chunks/{4386-45b79e656a244d8a.js → 4386-21ac377a719ebdfa.js} +1 -1
- package/dist/.next/static/chunks/{4386-45b79e656a244d8a.js.map → 4386-21ac377a719ebdfa.js.map} +1 -1
- package/dist/.next/static/chunks/4612-da512770f949561a.js +2 -0
- package/dist/.next/static/chunks/4612-da512770f949561a.js.map +1 -0
- package/dist/.next/static/chunks/{5825-efd4db1da512bd7f.js → 4760-d5ceb992b68e35ca.js} +2 -2
- package/dist/.next/static/chunks/4760-d5ceb992b68e35ca.js.map +1 -0
- package/dist/.next/static/chunks/{6367-59655a85d75e19be.js → 6367-aa5020cbea5354e2.js} +1 -1
- package/dist/.next/static/chunks/{6367-59655a85d75e19be.js.map → 6367-aa5020cbea5354e2.js.map} +1 -1
- package/dist/.next/static/chunks/6373-3eee0b6c8b8fd459.js +2 -0
- package/dist/.next/static/chunks/6373-3eee0b6c8b8fd459.js.map +1 -0
- package/dist/.next/static/chunks/{8030-9c926ea4dfd3a54e.js → 8030-5d38a3f1a4ad44cb.js} +1 -1
- package/dist/.next/static/chunks/{8030-9c926ea4dfd3a54e.js.map → 8030-5d38a3f1a4ad44cb.js.map} +1 -1
- package/dist/.next/static/chunks/9105-143f12397a76a332.js +2 -0
- package/dist/.next/static/chunks/9105-143f12397a76a332.js.map +1 -0
- package/dist/.next/static/chunks/9877-378934ae38c6760c.js +2 -0
- package/dist/.next/static/chunks/9877-378934ae38c6760c.js.map +1 -0
- package/dist/.next/static/chunks/{9953-95900a236271a222.js → 9953-02d5b52553a5c573.js} +2 -2
- package/dist/.next/static/chunks/{9953-95900a236271a222.js.map → 9953-02d5b52553a5c573.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/{page-e4a4693953329671.js → page-37918149a8e909b0.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/{page-e4a4693953329671.js.map → page-37918149a8e909b0.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/agents/{page-b77c21a993c55901.js → page-9cff3b35b042d46a.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/agents/{page-b77c21a993c55901.js.map → page-9cff3b35b042d46a.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-53a99d8df53380c7.js +2 -0
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-53a99d8df53380c7.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/chat/{layout-093baa26f89338bc.js → layout-ba702af6bb56baa2.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/chat/{layout-093baa26f89338bc.js.map → layout-ba702af6bb56baa2.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/chat/{page-8a1fcfb68cf9c8c0.js → page-8b00a98d285829b1.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/chat/{page-8a1fcfb68cf9c8c0.js.map → page-8b00a98d285829b1.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/configuration/{page-f315ede6d66922e6.js → page-1e978e117d5086a1.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/configuration/{page-f315ede6d66922e6.js.map → page-1e978e117d5086a1.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/dashboard/{page-4a1956febf5235b6.js → page-c54b4bc8d0ac4ac8.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/dashboard/{page-4a1956febf5235b6.js.map → page-c54b4bc8d0ac4ac8.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/{layout-0c7c1b0e1713bf60.js → layout-dfdb5c1cdc7ddefc.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/{layout-0c7c1b0e1713bf60.js.map → layout-dfdb5c1cdc7ddefc.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-faaee5fe82b45966.js +2 -0
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-faaee5fe82b45966.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/evals/[id]/{page-a7728cf9b0524489.js → page-c956d9892676aa4f.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-c956d9892676aa4f.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/evals/cases/page-6b4dde82376e9aac.js +2 -0
- package/dist/.next/static/chunks/app/(application)/evals/cases/page-6b4dde82376e9aac.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/evals/{page-8b38d8d29f275704.js → page-944bfc4f0a001e4c.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/evals/page-944bfc4f0a001e4c.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/explorer/page-07d67145bb176711.js +2 -0
- package/dist/.next/static/chunks/app/(application)/explorer/page-07d67145bb176711.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/keys/{page-afe59c91cc347208.js → page-6c0cd9ef20cd1461.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/keys/{page-afe59c91cc347208.js.map → page-6c0cd9ef20cd1461.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/projects/[project]/{page-f04fd5291a1ef7b1.js → page-5e2be54e76b8509c.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/projects/[project]/{page-f04fd5291a1ef7b1.js.map → page-5e2be54e76b8509c.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/projects/{layout-a8e1830ef3faafb9.js → layout-f2e0f42a08c96bb8.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/projects/{layout-a8e1830ef3faafb9.js.map → layout-f2e0f42a08c96bb8.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/prompts/{page-2c500e9898447506.js → page-2c03bbe32800acc3.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/prompts/{page-2c500e9898447506.js.map → page-2c03bbe32800acc3.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/roles/{page-873911198c17d9a7.js → page-b977b5c658004717.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/roles/{page-873911198c17d9a7.js.map → page-b977b5c658004717.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/token/{page-3acc39cb8a718331.js → page-08596ece49a811b9.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/token/page-08596ece49a811b9.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/users/{page-0d7f0d7e80cd1436.js → page-49212081be40aeca.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/users/{page-0d7f0d7e80cd1436.js.map → page-49212081be40aeca.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/variables/create/{page-8ebf4e3d4d17443b.js → page-9ce762918374f616.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/variables/create/{page-8ebf4e3d4d17443b.js.map → page-9ce762918374f616.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/variables/edit/[variable_id]/{page-006145e82e054e72.js → page-0e2b7038546d9f7a.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/variables/edit/[variable_id]/{page-006145e82e054e72.js.map → page-0e2b7038546d9f7a.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/variables/{page-51a8aeece444d388.js → page-141d5d3f735454fe.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/variables/{page-51a8aeece444d388.js.map → page-141d5d3f735454fe.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/variables/usage/[variable_id]/{page-8f5cfc9565fd919a.js → page-fb1bb3ea6f7cae47.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/variables/usage/[variable_id]/{page-8f5cfc9565fd919a.js.map → page-fb1bb3ea6f7cae47.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/workflows/{page-e38f9456120dab69.js → page-2b839fdbc55c297b.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/workflows/page-2b839fdbc55c297b.js.map +1 -0
- package/dist/.next/static/css/0f539b50cca35462.css +4 -0
- package/dist/.next/static/css/0f539b50cca35462.css.map +1 -0
- package/dist/.next/static/css/e3f2a16ab7676b05.css.map +1 -1
- package/package.json +1 -1
- package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js +0 -2
- package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js.map +0 -1
- package/dist/.next/static/chunks/3171-6996819b8863d41f.js +0 -2
- package/dist/.next/static/chunks/3171-6996819b8863d41f.js.map +0 -1
- package/dist/.next/static/chunks/3750-e3d1b2cccd265190.js.map +0 -1
- package/dist/.next/static/chunks/3832-d7782d6a2771ae6c.js.map +0 -1
- package/dist/.next/static/chunks/4419-b9be79d8cd46a97d.js +0 -2
- package/dist/.next/static/chunks/4419-b9be79d8cd46a97d.js.map +0 -1
- package/dist/.next/static/chunks/5110-098aa924c3108fa4.js +0 -2
- package/dist/.next/static/chunks/5110-098aa924c3108fa4.js.map +0 -1
- package/dist/.next/static/chunks/5825-efd4db1da512bd7f.js.map +0 -1
- package/dist/.next/static/chunks/6280-50b751f993f2fe4f.js +0 -2
- package/dist/.next/static/chunks/6280-50b751f993f2fe4f.js.map +0 -1
- package/dist/.next/static/chunks/6373-aef582adc575d3ca.js +0 -2
- package/dist/.next/static/chunks/6373-aef582adc575d3ca.js.map +0 -1
- package/dist/.next/static/chunks/9105-d8ff41060f7ffc85.js +0 -2
- package/dist/.next/static/chunks/9105-d8ff41060f7ffc85.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-d59534ca19eee51f.js +0 -2
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-d59534ca19eee51f.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-7db6bfbf02606136.js +0 -2
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-7db6bfbf02606136.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/evals/cases/page-827f50c6d1f150d0.js +0 -2
- package/dist/.next/static/chunks/app/(application)/evals/cases/page-827f50c6d1f150d0.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/evals/page-8b38d8d29f275704.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/explorer/page-e6b1c034c07776e2.js +0 -2
- package/dist/.next/static/chunks/app/(application)/explorer/page-e6b1c034c07776e2.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/token/page-3acc39cb8a718331.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/workflows/page-e38f9456120dab69.js.map +0 -1
- package/dist/.next/static/css/9c08ae5d990a6b14.css +0 -4
- package/dist/.next/static/css/9c08ae5d990a6b14.css.map +0 -1
- /package/dist/.next/static/{3j63p6b3zZZB_v1Hn8Mxp → exslB-IPXi_veOKFA4L1Z}/_buildManifest.js +0 -0
- /package/dist/.next/static/{3j63p6b3zZZB_v1Hn8Mxp → exslB-IPXi_veOKFA4L1Z}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=5084,exports.ids=[5084],exports.modules={85060:(e,s,t)=>{t.d(s,{F:()=>T});var a=t(10326),r=t(17577),l=t(39167),d=t(18753),n=t(18019),i=t(40617),o=t(1572),c=t(83855),m=t(87888),x=t(75290),u=t(62288),p=t(90772),f=t(54432),h=t(31048),g=t(87673),b=t(42270),v=t(34789),j=t(79210),N=t(33071),y=t(567),w=t(65685),C=t(77961),k=t(87599),S=t(5354);function T({open:e,onClose:s,evalSetId:t,onSuccess:T,testCase:Z}){let{toast:D}=(0,v.pm)(),R=!!Z,{data:_}=(0,l.aM)(b.Ul,{variables:{page:1,limit:100}}),{regularTools:z,agentTools:F,knowledgeSourceTools:V}=(0,r.useMemo)(()=>{let e=_?.tools?.items||[];return console.log("tools",e),{regularTools:e.filter(e=>"function"===e.type),agentTools:e.filter(e=>"agent"===e.type),knowledgeSourceTools:e.filter(e=>"context"===e.type)}},[_]),[M,A]=(0,r.useState)(""),[E,q]=(0,r.useState)(""),[O,U]=(0,r.useState)(""),[K,P]=(0,r.useState)([]),[Y,$]=(0,r.useState)(""),[B,I]=(0,r.useState)(null),[H,L]=(0,r.useState)([]),[W,G]=(0,r.useState)([]),[J,Q]=(0,r.useState)([]),[X,ee]=(0,r.useState)([]),[es,et]=(0,r.useState)(""),[ea,er]=(0,r.useState)(""),[el,ed]=(0,r.useState)(""),[en,{loading:ei}]=(0,d.D)(b.hx,{onCompleted:()=>{D({title:"Test case created",description:"The test case has been successfully created."}),T()},onError:e=>{D({title:"Failed to create test case",description:e.message,variant:"destructive"})}}),[eo,{loading:ec}]=(0,d.D)(b.Mh,{onCompleted:()=>{D({title:"Test case updated",description:"The test case has been successfully updated."}),T()},onError:e=>{D({title:"Failed to update test case",description:e.message,variant:"destructive"})}}),em=()=>{if(!Y.trim()&&0===H.length)return;let e=[];Y.trim()&&e.push({type:"text",text:Y.trim()}),H.length>0&&e.push(...H),P([...K,{id:`msg-${Date.now()}`,role:"user",parts:e},{id:`msg-${Date.now()}`,role:"assistant",metadata:{type:"placeholder"},parts:[{type:"text",text:"\uD83D\uDCAC Placeholder, generated agent response will be added here when the test case is run..."}]}]),$(""),I(null),L([])},ex=ei||ec;return a.jsx(u.Vq,{open:e,onOpenChange:s,children:(0,a.jsxs)(u.cZ,{className:"max-w-4xl max-h-[90vh] overflow-hidden flex flex-col",children:[(0,a.jsxs)(u.fK,{children:[(0,a.jsxs)(u.$N,{children:[R?"Edit Test Case":"Create Test Case"," ",t?`for Eval Set: ${t}`:""]}),a.jsx(u.Be,{children:R?"Update the test case details.":"Create a new test case with conversation inputs and expected outputs."})]}),(0,a.jsxs)("form",{onSubmit:e=>{if(e.preventDefault(),!M.trim()||!O.trim()||0===K.length){D({title:"Validation error",description:"Name, at least one input message, and expected output are required.",variant:"destructive"});return}let s={name:M.trim(),description:E.trim()||null,inputs:K,expected_output:O.trim(),expected_tools:W.length>0?W:null,expected_knowledge_sources:J.length>0?J:null,expected_agent_tools:X.length>0?X:null,...t?{eval_set_id:t}:{}};R?eo({variables:{id:Z.id,data:s}}):en({variables:{data:s}})},className:"flex-1 overflow-hidden flex flex-col",children:[(0,a.jsxs)(j.mQ,{defaultValue:"basic",className:"flex-1 overflow-hidden flex flex-col",children:[(0,a.jsxs)(j.dr,{className:"grid w-full grid-cols-2",children:[(0,a.jsxs)(j.SP,{value:"basic",className:"gap-2",children:[a.jsx(n.Z,{className:"h-4 w-4"}),"Basic Info"]}),(0,a.jsxs)(j.SP,{value:"conversation",className:"gap-2",children:[a.jsx(i.Z,{className:"h-4 w-4"}),"Conversation"]})]}),(0,a.jsxs)(w.x,{className:"flex-1",children:[a.jsx(j.nU,{value:"basic",className:"space-y-4 p-1 mt-4",children:(0,a.jsxs)("div",{className:"grid gap-5",children:[(0,a.jsxs)("div",{className:"grid gap-2",children:[a.jsx(h._,{htmlFor:"name",children:"Name *"}),a.jsx(f.I,{id:"name",placeholder:"e.g., Customer Support - Refund Request",value:M,onChange:e=>A(e.target.value),disabled:ex,required:!0})]}),(0,a.jsxs)("div",{className:"grid gap-2",children:[a.jsx(h._,{htmlFor:"description",children:"Description"}),a.jsx(g.g,{id:"description",placeholder:"Describe what this test case evaluates...",value:E,onChange:e=>q(e.target.value),disabled:ex,rows:3})]}),(0,a.jsxs)("div",{className:"grid gap-2",children:[a.jsx(h._,{htmlFor:"expectedOutput",children:"Expected Output *"}),a.jsx(g.g,{id:"expectedOutput",placeholder:"Describe the expected final output (e.g., 'A JSON object containing refund details', 'An empathetic response offering alternatives')",value:O,onChange:e=>U(e.target.value),disabled:ex,rows:4,required:!0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"This can be an exact expected response or a description of what the output should contain."})]})]})}),a.jsx(j.nU,{value:"conversation",className:"space-y-4 p-1 mt-4",children:(0,a.jsxs)(N.Zb,{children:[a.jsx(N.Ol,{className:"pb-3",children:a.jsx("div",{className:"flex items-start justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.ll,{className:"text-sm flex items-center gap-2",children:[a.jsx(i.Z,{className:"h-4 w-4"}),"Conversation Flow",K.length>0&&(0,a.jsxs)(y.C,{variant:"secondary",className:"ml-2",children:[K.length," ",1===K.length?"message":"messages"]})]}),a.jsx(N.SZ,{className:"mt-1.5",children:"Add user messages in order. The agent will run through this conversation flow and respond between each message automatically."})]})})}),(0,a.jsxs)(N.aY,{className:"space-y-6",children:[K?.length===0?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center border-2 border-dashed border-muted rounded-lg",children:[a.jsx(o.Z,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),a.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No messages yet"}),a.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:"Start building your test conversation by adding user messages below."})]}):a.jsx(S.ri,{className:"max-h-[350px] overflow-y-auto border rounded-lg bg-muted/30 transition-all duration-300 ease-in-out",children:a.jsx(S.iG,{className:"px-6 py-4",children:a.jsx("div",{className:"animate-in fade-in duration-500",children:a.jsx(k.K,{messages:K,config:{marginTopFirstMessage:"mt-0",customAssistantClassnames:"bg-secondary/50 rounded-lg px-3 py-1 border-l-2 border-primary/30"},status:"ready",showActions:!1,writeAccess:!1})})})}),(0,a.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[a.jsx(h._,{htmlFor:"currentInput",className:"text-sm font-semibold",children:"Add User Message"}),(0,a.jsxs)("div",{className:"space-y-3",children:[a.jsx(g.g,{id:"currentInput",placeholder:"Type the user's message...",value:Y,onChange:e=>$(e.target.value),disabled:ex,rows:2,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),em())}}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx(C.ZP,{id:"test-case-files",selectionLimit:10,allowedFileTypes:[".png",".jpg",".jpeg",".gif",".webp",".pdf",".docx",".xlsx",".xls",".csv",".pptx",".ppt",".mp3",".wav",".m4a",".mp4",".mpeg"],dependencies:[],onConfirm:e=>{I(e)}}),(0,a.jsxs)(p.z,{type:"button",variant:"outline",onClick:em,disabled:ex||!Y.trim()&&0===H.length,className:"ml-auto",size:"default",children:[a.jsx(c.Z,{className:"h-4 w-4 mr-2"}),"Add Message"]})]}),B&&B.length>0&&(0,a.jsxs)(a.Fragment,{children:[a.jsx("div",{className:"grid grid-cols-3 gap-2",children:B.map(e=>a.jsx(C.jU,{s3Key:e,disabled:!0,active:!1,onRemove:()=>{I(B?.filter(s=>s!==e))}}))}),(0,a.jsxs)("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[a.jsx(m.Z,{className:"h-4 w-4 text-amber-600 dark:text-amber-500 mt-0.5 flex-shrink-0"}),(0,a.jsxs)("p",{className:"text-xs text-amber-900 dark:text-amber-200",children:[a.jsx("strong",{children:"Note:"})," When running this test case, ensure the selected agent supports the file types you've attached here (images, documents, audio, etc.)."]})]})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Press Enter to add, Shift+Enter for new line. You can attach files to messages."})]})]})]})})]})]}),(0,a.jsxs)(u.cN,{className:"mt-4 gap-2",children:[a.jsx(p.z,{type:"button",variant:"outline",onClick:s,disabled:ex,children:"Cancel"}),(0,a.jsxs)(p.z,{type:"submit",disabled:ex||!M.trim()||!O.trim()||0===K.length,className:"shadow-sm hover:shadow-md transition-all",children:[ex&&a.jsx(x.Z,{className:"mr-2 h-4 w-4 animate-spin"}),R?"Update Test Case":"Create Test Case"]})]})]})]})})}},567:(e,s,t)=>{t.d(s,{C:()=>n});var a=t(10326),r=t(79360);t(17577);var l=t(77863);let d=(0,r.j)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function n({className:e,variant:s,...t}){return a.jsx("div",{className:(0,l.cn)(d({variant:s}),e),...t})}},33071:(e,s,t)=>{t.d(s,{Ol:()=>n,SZ:()=>o,Zb:()=>d,aY:()=>c,eW:()=>m,ll:()=>i});var a=t(10326),r=t(17577),l=t(77863);let d=r.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,l.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",e),...s}));d.displayName="Card";let n=r.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",e),...s}));n.displayName="CardHeader";let i=r.forwardRef(({className:e,...s},t)=>a.jsx("h3",{ref:t,className:(0,l.cn)("text-2xl font-semibold leading-none tracking-tight",e),...s}));i.displayName="CardTitle";let o=r.forwardRef(({className:e,...s},t)=>a.jsx("p",{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",e),...s}));o.displayName="CardDescription";let c=r.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,l.cn)("p-6 pt-0",e),...s}));c.displayName="CardContent";let m=r.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,l.cn)("flex items-center p-6 pt-0",e),...s}));m.displayName="CardFooter"},62288:(e,s,t)=>{t.d(s,{$N:()=>f,Be:()=>h,Vq:()=>i,cN:()=>p,cZ:()=>x,fK:()=>u,hg:()=>o});var a=t(10326),r=t(98986),l=t(94019),d=t(17577),n=t(77863);let i=r.fC,o=r.xz,c=r.h_;r.x8;let m=d.forwardRef(({className:e,...s},t)=>a.jsx(r.aV,{ref:t,className:(0,n.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...s}));m.displayName=r.aV.displayName;let x=d.forwardRef(({className:e,children:s,...t},d)=>(0,a.jsxs)(c,{children:[a.jsx(m,{}),(0,a.jsxs)(r.VY,{ref:d,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t,children:[s,(0,a.jsxs)(r.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(l.Z,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));x.displayName=r.VY.displayName;let u=({className:e,...s})=>a.jsx("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...s});u.displayName="DialogHeader";let p=({className:e,...s})=>a.jsx("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...s});p.displayName="DialogFooter";let f=d.forwardRef(({className:e,...s},t)=>a.jsx(r.Dx,{ref:t,className:(0,n.cn)("text-lg font-semibold leading-none tracking-tight",e),...s}));f.displayName=r.Dx.displayName;let h=d.forwardRef(({className:e,...s},t)=>a.jsx(r.dk,{ref:t,className:(0,n.cn)("text-sm text-muted-foreground",e),...s}));h.displayName=r.dk.displayName},31048:(e,s,t)=>{t.d(s,{_:()=>o});var a=t(10326),r=t(34478),l=t(79360),d=t(17577),n=t(77863);let i=(0,l.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=d.forwardRef(({className:e,...s},t)=>a.jsx(r.f,{ref:t,className:(0,n.cn)(i(),e),...s}));o.displayName=r.f.displayName},65685:(e,s,t)=>{t.d(s,{B:()=>i,x:()=>n});var a=t(10326),r=t(9261),l=t(17577),d=t(77863);let n=l.forwardRef(({className:e,children:s,...t},l)=>(0,a.jsxs)(r.fC,{ref:l,className:(0,d.cn)("relative overflow-hidden",e),...t,children:[a.jsx(r.l_,{className:"size-full rounded-[inherit]",children:s}),a.jsx(i,{}),a.jsx(r.Ns,{})]}));n.displayName=r.fC.displayName;let i=l.forwardRef(({className:e,orientation:s="vertical",...t},l)=>a.jsx(r.gb,{ref:l,orientation:s,className:(0,d.cn)("flex touch-none select-none transition-colors","vertical"===s&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===s&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...t,children:a.jsx(r.q4,{className:"relative flex-1 rounded-full bg-border"})}));i.displayName=r.gb.displayName},87673:(e,s,t)=>{t.d(s,{g:()=>d});var a=t(10326),r=t(17577),l=t(77863);let d=r.forwardRef(({className:e,...s},t)=>a.jsx("textarea",{className:(0,l.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:t,...s}));d.displayName="Textarea"},75290:(e,s,t)=>{t.d(s,{Z:()=>a});let a=(0,t(76557).Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},98091:(e,s,t)=>{t.d(s,{Z:()=>a});let a=(0,t(76557).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])}};
|
|
1
|
+
"use strict";exports.id=2587,exports.ids=[2587],exports.modules={85060:(e,s,t)=>{t.d(s,{F:()=>Z});var a=t(10326),r=t(17577),l=t(39167),d=t(18753),n=t(18019),i=t(40617),o=t(1572),c=t(83855),m=t(87888),x=t(75290),u=t(62288),p=t(90772),f=t(54432),h=t(31048),g=t(87673),b=t(42270),v=t(34789),j=t(79210),N=t(33071),y=t(567),w=t(65685),C=t(77961),k=t(87599),S=t(5354);function Z({open:e,onClose:s,evalSetId:t,onSuccess:Z,testCase:T}){let{toast:D}=(0,v.pm)(),R=!!T,{data:_}=(0,l.aM)(b.Ul,{variables:{page:1,limit:100}}),{regularTools:z,agentTools:F,knowledgeSourceTools:V}=(0,r.useMemo)(()=>{let e=_?.tools?.items||[];return console.log("tools",e),{regularTools:e.filter(e=>"function"===e.type),agentTools:e.filter(e=>"agent"===e.type),knowledgeSourceTools:e.filter(e=>"context"===e.type)}},[_]),[M,q]=(0,r.useState)(""),[A,E]=(0,r.useState)(""),[O,U]=(0,r.useState)(""),[K,P]=(0,r.useState)([]),[Y,$]=(0,r.useState)(""),[B,I]=(0,r.useState)(null),[H,L]=(0,r.useState)([]),[W,G]=(0,r.useState)([]),[J,Q]=(0,r.useState)([]),[X,ee]=(0,r.useState)([]),[es,et]=(0,r.useState)(""),[ea,er]=(0,r.useState)(""),[el,ed]=(0,r.useState)(""),[en,{loading:ei}]=(0,d.D)(b.hx,{onCompleted:()=>{D({title:"Test case created",description:"The test case has been successfully created."}),Z()},onError:e=>{D({title:"Failed to create test case",description:e.message,variant:"destructive"})}}),[eo,{loading:ec}]=(0,d.D)(b.Mh,{onCompleted:()=>{D({title:"Test case updated",description:"The test case has been successfully updated."}),Z()},onError:e=>{D({title:"Failed to update test case",description:e.message,variant:"destructive"})}}),em=()=>{if(!Y.trim()&&0===H.length)return;let e=[];Y.trim()&&e.push({type:"text",text:Y.trim()}),H.length>0&&e.push(...H),P([...K,{id:`msg-${Date.now()}`,role:"user",parts:e},{id:`msg-${Date.now()}`,role:"assistant",metadata:{type:"placeholder"},parts:[{type:"text",text:"\uD83D\uDCAC Placeholder, generated agent response will be added here when the test case is run..."}]}]),$(""),I(null),L([])},ex=ei||ec;return a.jsx(u.Vq,{open:e,onOpenChange:s,children:(0,a.jsxs)(u.cZ,{className:"max-w-4xl max-h-[90vh] overflow-hidden flex flex-col",children:[(0,a.jsxs)(u.fK,{children:[(0,a.jsxs)(u.$N,{children:[R?"Edit Test Case":"Create Test Case"," ",t?`for Eval Set: ${t}`:""]}),a.jsx(u.Be,{children:R?"Update the test case details.":"Create a new test case with conversation inputs and expected outputs."})]}),(0,a.jsxs)("form",{onSubmit:e=>{if(e.preventDefault(),!M.trim()||!O.trim()||0===K.length){D({title:"Validation error",description:"Name, at least one input message, and expected output are required.",variant:"destructive"});return}let s={name:M.trim(),description:A.trim()||null,inputs:K,expected_output:O.trim(),expected_tools:W.length>0?W:null,expected_knowledge_sources:J.length>0?J:null,expected_agent_tools:X.length>0?X:null,...t?{eval_set_id:t}:{}};R?eo({variables:{id:T.id,data:s}}):en({variables:{data:s}})},className:"flex-1 overflow-hidden flex flex-col",children:[(0,a.jsxs)(j.mQ,{defaultValue:"basic",className:"flex-1 overflow-hidden flex flex-col",children:[(0,a.jsxs)(j.dr,{className:"grid w-full grid-cols-2",children:[(0,a.jsxs)(j.SP,{value:"basic",className:"gap-2",children:[a.jsx(n.Z,{className:"h-4 w-4"}),"Basic Info"]}),(0,a.jsxs)(j.SP,{value:"conversation",className:"gap-2",children:[a.jsx(i.Z,{className:"h-4 w-4"}),"Conversation"]})]}),(0,a.jsxs)(w.x,{className:"flex-1",children:[a.jsx(j.nU,{value:"basic",className:"space-y-4 p-1 mt-4",children:(0,a.jsxs)("div",{className:"grid gap-5",children:[(0,a.jsxs)("div",{className:"grid gap-2",children:[a.jsx(h._,{htmlFor:"name",children:"Name *"}),a.jsx(f.I,{id:"name",placeholder:"e.g., Customer Support - Refund Request",value:M,onChange:e=>q(e.target.value),disabled:ex,required:!0})]}),(0,a.jsxs)("div",{className:"grid gap-2",children:[a.jsx(h._,{htmlFor:"description",children:"Description"}),a.jsx(g.g,{id:"description",placeholder:"Describe what this test case evaluates...",value:A,onChange:e=>E(e.target.value),disabled:ex,rows:3})]}),(0,a.jsxs)("div",{className:"grid gap-2",children:[a.jsx(h._,{htmlFor:"expectedOutput",children:"Expected Output *"}),a.jsx(g.g,{id:"expectedOutput",placeholder:"Describe the expected final output (e.g., 'A JSON object containing refund details', 'An empathetic response offering alternatives')",value:O,onChange:e=>U(e.target.value),disabled:ex,rows:4,required:!0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"This can be an exact expected response or a description of what the output should contain."})]})]})}),a.jsx(j.nU,{value:"conversation",className:"space-y-4 p-1 mt-4",children:(0,a.jsxs)(N.Zb,{children:[a.jsx(N.Ol,{className:"pb-3",children:a.jsx("div",{className:"flex items-start justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.ll,{className:"text-sm flex items-center gap-2",children:[a.jsx(i.Z,{className:"h-4 w-4"}),"Conversation Flow",K.length>0&&(0,a.jsxs)(y.C,{variant:"secondary",className:"ml-2",children:[K.length," ",1===K.length?"message":"messages"]})]}),a.jsx(N.SZ,{className:"mt-1.5",children:"Add user messages in order. The agent will run through this conversation flow and respond between each message automatically."})]})})}),(0,a.jsxs)(N.aY,{className:"space-y-6",children:[K?.length===0?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center border-2 border-dashed border-muted rounded-lg",children:[a.jsx(o.Z,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),a.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No messages yet"}),a.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:"Start building your test conversation by adding user messages below."})]}):a.jsx(S.ri,{className:"max-h-[350px] overflow-y-auto border rounded-lg bg-muted/30 transition-all duration-300 ease-in-out",children:a.jsx(S.iG,{className:"px-6 py-4",children:a.jsx("div",{className:"animate-in fade-in duration-500",children:a.jsx(k.K,{messages:K,config:{marginTopFirstMessage:"mt-0",customAssistantClassnames:"bg-secondary/50 rounded-lg px-3 py-1 border-l-2 border-primary/30"},status:"ready",showActions:!1,writeAccess:!1})})})}),(0,a.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[a.jsx(h._,{htmlFor:"currentInput",className:"text-sm font-semibold",children:"Add User Message"}),(0,a.jsxs)("div",{className:"space-y-3",children:[a.jsx(g.g,{id:"currentInput",placeholder:"Type the user's message...",value:Y,onChange:e=>$(e.target.value),disabled:ex,rows:2,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),em())}}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx(C.ZP,{id:"test-case-files",selectionLimit:10,allowedFileTypes:[".png",".jpg",".jpeg",".gif",".webp",".pdf",".docx",".xlsx",".xls",".csv",".pptx",".ppt",".mp3",".wav",".m4a",".mp4",".mpeg"],dependencies:[],onConfirm:e=>{I(e)}}),(0,a.jsxs)(p.z,{type:"button",variant:"outline",onClick:em,disabled:ex||!Y.trim()&&0===H.length,className:"ml-auto",size:"default",children:[a.jsx(c.Z,{className:"h-4 w-4 mr-2"}),"Add Message"]})]}),B&&B.length>0&&(0,a.jsxs)(a.Fragment,{children:[a.jsx("div",{className:"grid grid-cols-3 gap-2",children:B.map(e=>a.jsx(C.jU,{s3Key:e,disabled:!0,active:!1,onRemove:()=>{I(B?.filter(s=>s!==e))}}))}),(0,a.jsxs)("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[a.jsx(m.Z,{className:"h-4 w-4 text-amber-600 dark:text-amber-500 mt-0.5 flex-shrink-0"}),(0,a.jsxs)("p",{className:"text-xs text-amber-900 dark:text-amber-200",children:[a.jsx("strong",{children:"Note:"})," When running this test case, ensure the selected agent supports the file types you've attached here (images, documents, audio, etc.)."]})]})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Press Enter to add, Shift+Enter for new line. You can attach files to messages."})]})]})]})})]})]}),(0,a.jsxs)(u.cN,{className:"mt-4 gap-2",children:[a.jsx(p.z,{type:"button",variant:"outline",onClick:s,disabled:ex,children:"Cancel"}),(0,a.jsxs)(p.z,{type:"submit",disabled:ex||!M.trim()||!O.trim()||0===K.length,className:"shadow-sm hover:shadow-md transition-all",children:[ex&&a.jsx(x.Z,{className:"mr-2 h-4 w-4 animate-spin"}),R?"Update Test Case":"Create Test Case"]})]})]})]})})}},567:(e,s,t)=>{t.d(s,{C:()=>n});var a=t(10326),r=t(79360);t(17577);var l=t(77863);let d=(0,r.j)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function n({className:e,variant:s,...t}){return a.jsx("div",{className:(0,l.cn)(d({variant:s}),e),...t})}},33071:(e,s,t)=>{t.d(s,{Ol:()=>n,SZ:()=>o,Zb:()=>d,aY:()=>c,eW:()=>m,ll:()=>i});var a=t(10326),r=t(17577),l=t(77863);let d=r.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,l.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",e),...s}));d.displayName="Card";let n=r.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",e),...s}));n.displayName="CardHeader";let i=r.forwardRef(({className:e,...s},t)=>a.jsx("h3",{ref:t,className:(0,l.cn)("text-2xl font-semibold leading-none tracking-tight",e),...s}));i.displayName="CardTitle";let o=r.forwardRef(({className:e,...s},t)=>a.jsx("p",{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",e),...s}));o.displayName="CardDescription";let c=r.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,l.cn)("p-6 pt-0",e),...s}));c.displayName="CardContent";let m=r.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,l.cn)("flex items-center p-6 pt-0",e),...s}));m.displayName="CardFooter"},62288:(e,s,t)=>{t.d(s,{$N:()=>f,Be:()=>h,Vq:()=>i,cN:()=>p,cZ:()=>x,fK:()=>u,hg:()=>o});var a=t(10326),r=t(98986),l=t(94019),d=t(17577),n=t(77863);let i=r.fC,o=r.xz,c=r.h_;r.x8;let m=d.forwardRef(({className:e,...s},t)=>a.jsx(r.aV,{ref:t,className:(0,n.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...s}));m.displayName=r.aV.displayName;let x=d.forwardRef(({className:e,children:s,...t},d)=>(0,a.jsxs)(c,{children:[a.jsx(m,{}),(0,a.jsxs)(r.VY,{ref:d,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t,children:[s,(0,a.jsxs)(r.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(l.Z,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));x.displayName=r.VY.displayName;let u=({className:e,...s})=>a.jsx("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...s});u.displayName="DialogHeader";let p=({className:e,...s})=>a.jsx("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...s});p.displayName="DialogFooter";let f=d.forwardRef(({className:e,...s},t)=>a.jsx(r.Dx,{ref:t,className:(0,n.cn)("text-lg font-semibold leading-none tracking-tight",e),...s}));f.displayName=r.Dx.displayName;let h=d.forwardRef(({className:e,...s},t)=>a.jsx(r.dk,{ref:t,className:(0,n.cn)("text-sm text-muted-foreground",e),...s}));h.displayName=r.dk.displayName},31048:(e,s,t)=>{t.d(s,{_:()=>o});var a=t(10326),r=t(34478),l=t(79360),d=t(17577),n=t(77863);let i=(0,l.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=d.forwardRef(({className:e,...s},t)=>a.jsx(r.f,{ref:t,className:(0,n.cn)(i(),e),...s}));o.displayName=r.f.displayName},65685:(e,s,t)=>{t.d(s,{B:()=>i,x:()=>n});var a=t(10326),r=t(9261),l=t(17577),d=t(77863);let n=l.forwardRef(({className:e,children:s,...t},l)=>(0,a.jsxs)(r.fC,{ref:l,className:(0,d.cn)("relative overflow-hidden",e),...t,children:[a.jsx(r.l_,{className:"size-full rounded-[inherit]",children:s}),a.jsx(i,{}),a.jsx(r.Ns,{})]}));n.displayName=r.fC.displayName;let i=l.forwardRef(({className:e,orientation:s="vertical",...t},l)=>a.jsx(r.gb,{ref:l,orientation:s,className:(0,d.cn)("flex touch-none select-none transition-colors","vertical"===s&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===s&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...t,children:a.jsx(r.q4,{className:"relative flex-1 rounded-full bg-border"})}));i.displayName=r.gb.displayName},87673:(e,s,t)=>{t.d(s,{g:()=>d});var a=t(10326),r=t(17577),l=t(77863);let d=r.forwardRef(({className:e,...s},t)=>a.jsx("textarea",{className:(0,l.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:t,...s}));d.displayName="Textarea"},75290:(e,s,t)=>{t.d(s,{Z:()=>a});let a=(0,t(76557).Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},88307:(e,s,t)=>{t.d(s,{Z:()=>a});let a=(0,t(76557).Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},98091:(e,s,t)=>{t.d(s,{Z:()=>a});let a=(0,t(76557).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=3503,exports.ids=[3503],exports.modules={5354:(e,t,s)=>{s.d(t,{iG:()=>i,ri:()=>n});var a=s(10326);s(90772);var r=s(77863);s(17577);var l=s(30778);let n=({className:e,...t})=>a.jsx(l.h,{className:(0,r.cn)("relative flex-1 overflow-y-auto",e),initial:"smooth",resize:"smooth",role:"log",...t}),i=({className:e,...t})=>a.jsx(l.h.Content,{className:(0,r.cn)("p-4",e),...t})},87599:(e,t,s)=>{s.d(t,{K:()=>M});var a=s(10326);s(28758);var r=s(77863);let l=({className:e,from:t,...s})=>a.jsx("div",{className:(0,r.cn)("group flex w-full items-end justify-end gap-2 py-4","user"===t?"is-user flex-row-reverse justify-end":"is-assistant flex-row-reverse justify-end","[&>div]:max-w-[80%]",e),...s}),n=({children:e,className:t,...s})=>a.jsx("div",{className:(0,r.cn)("flex flex-col gap-2 overflow-hidden rounded-lg py-3 text-foreground text-sm","group-[.is-user]:bg-secondary group-[.is-user]:text-primary-foreground group-[.is-user]:px-4","group-[.is-assistant]:bg-transparent group-[.is-assistant]:text-foreground",t),...s,children:a.jsx("div",{className:"is-user:dark",children:e})});var i=s(90772),o=s(68232);let d=({className:e,children:t,...s})=>a.jsx("div",{className:(0,r.cn)("flex items-center gap-1",e),...s,children:t}),c=({tooltip:e,children:t,label:s,className:l,variant:n="ghost",size:d="sm",...c})=>{let m=(0,a.jsxs)(i.z,{className:(0,r.cn)("size-9 p-1.5 text-muted-foreground hover:text-foreground",l),size:d,type:"button",variant:n,...c,children:[t,a.jsx("span",{className:"sr-only",children:s||e})]});return e?a.jsx(o.pn,{children:(0,a.jsxs)(o.u,{children:[a.jsx(o.aJ,{asChild:!0,children:m}),a.jsx(o._v,{children:a.jsx("p",{children:e})})]})}):m};var m=s(36931),u=s(52067),p=s(24295),x=s(98360),h=s(941),g=s(17577);let f=(0,g.createContext)(null),j=()=>{let e=(0,g.useContext)(f);if(!e)throw Error("Reasoning components must be used within Reasoning");return e},N=(0,g.memo)(({className:e,isStreaming:t=!1,open:s,defaultOpen:l=!1,onOpenChange:n,duration:i,children:o,...d})=>{let[c,m]=(0,u.T)({prop:s,defaultProp:l,onChange:n}),[x,h]=(0,u.T)({prop:i,defaultProp:0}),[j,N]=(0,g.useState)(!1),[y,v]=(0,g.useState)(null);return(0,g.useEffect)(()=>{t?null===y&&v(Date.now()):null!==y&&(h(Math.round((Date.now()-y)/1e3)),v(null))},[t,y,h]),(0,g.useEffect)(()=>{if(t&&!c)m(!0);else if(!t&&c&&!l&&!j){let e=setTimeout(()=>{m(!1),N(!0)},1e3);return()=>clearTimeout(e)}},[t,c,l,m,j]),a.jsx(f.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:m,duration:x},children:a.jsx(p.zF,{className:(0,r.cn)("not-prose mb-4",e),onOpenChange:e=>{m(e)},open:c,...d,children:o})})}),y=(0,g.memo)(({className:e,title:t="Reasoning",children:s,...l})=>{let{isStreaming:n,isOpen:i,duration:o}=j();return a.jsx(p.wy,{className:(0,r.cn)("flex items-center gap-2 text-muted-foreground text-sm",e),...l,children:s??(0,a.jsxs)(a.Fragment,{children:[a.jsx(x.Z,{className:"size-4"}),n||0===o?a.jsx("p",{children:"Thinking..."}):(0,a.jsxs)("p",{children:["Thought for ",o," seconds"]}),a.jsx(h.Z,{className:(0,r.cn)("size-4 text-muted-foreground transition-transform",i?"rotate-180":"rotate-0")})]})})}),v=(0,g.memo)(({className:e,children:t,...s})=>a.jsx(p.Fw,{className:(0,r.cn)("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...s,children:a.jsx(m.H,{className:"grid gap-2",children:t})}));N.displayName="Reasoning",y.displayName="ReasoningTrigger",v.displayName="ReasoningContent";var w=s(71876);let b=({className:e,...t})=>a.jsx(p.zF,{className:(0,r.cn)("not-prose mb-4 text-primary text-xs",e),...t}),C=({className:e,count:t,children:s,...r})=>a.jsx(p.wy,{className:"flex items-center gap-2",...r,children:s??(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{className:"font-medium",children:["Used ",t," sources"]}),a.jsx(h.Z,{className:"h-4 w-4"})]})}),T=({className:e,...t})=>a.jsx(p.Fw,{className:(0,r.cn)("mt-3 flex w-fit flex-col gap-2","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),_=({href:e,title:t,children:s,...r})=>a.jsx("a",{className:"flex items-center gap-2",href:e,rel:"noreferrer",target:"_blank",...r,children:s??(0,a.jsxs)(a.Fragment,{children:[a.jsx(w.Z,{className:"h-4 w-4"}),a.jsx("span",{className:"block font-medium",children:t})]})});var k=s(91468),F=s(43810),$=s(46226),z=s(34789),Z=s(53982),P=s(75290),R=s(2179),I=s(91470);let L={pending:{icon:Z.Z,label:"Pending",className:"text-muted-foreground"},in_progress:{icon:P.Z,label:"In Progress",className:"text-blue-500 animate-spin"},completed:{icon:R.Z,label:"Completed",className:"text-green-500"},cancelled:{icon:I.Z,label:"Cancelled",className:"text-red-500"}},S={high:{label:"High",className:"bg-red-500/10 text-red-500 border-red-500/20"},medium:{label:"Medium",className:"bg-yellow-500/10 text-yellow-500 border-yellow-500/20"},low:{label:"Low",className:"bg-blue-500/10 text-blue-500 border-blue-500/20"}},E=({todos:e,showPriority:t=!1,state:s,className:l,...n})=>{if("string"==typeof e&&(e=JSON.parse(e)),!e||0===e.length)return null;let i=e.filter(e=>"completed"===e.status).length,o=e.length;return(0,a.jsxs)("div",{className:(0,r.cn)("my-2 space-y-1","input-streaming"===s&&"opacity-70",l),...n,children:[e.map((s,l)=>{let n=L[s.status]?L[s.status].icon:L.pending.icon,i=L[s.status]?L[s.status].className:L.pending.className;S[s.priority]?S[s.priority].className:S.medium.className;let o="in_progress"===s.status&&l===e.findIndex(e=>"in_progress"===e.status);return(0,a.jsxs)("div",{className:(0,r.cn)("flex items-start gap-2 py-0.5","cancelled"===s.status&&"opacity-50"),children:[a.jsx("div",{className:"flex-shrink-0 pt-0.5",children:a.jsx(n,{className:(0,r.cn)("size-3.5",i)})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:(0,r.cn)("text-sm","completed"===s.status&&"text-muted-foreground line-through","cancelled"===s.status&&"text-muted-foreground line-through","in_progress"===s.status&&o&&"font-medium"),children:s.content}),t&&"high"===s.priority&&a.jsx("span",{className:"ml-2 text-red-500 text-xs",children:"(!)"})]})]},s.id)}),o>1&&(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-1 text-muted-foreground text-xs",children:[a.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full bg-secondary",children:a.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:`${i/o*100}%`}})}),(0,a.jsxs)("span",{className:"whitespace-nowrap",children:[i,"/",o]})]}),"output-error"===s&&(0,a.jsxs)("div",{className:"flex items-center gap-1 pt-1 text-red-500 text-xs",children:[a.jsx(I.Z,{className:"size-3"}),a.jsx("span",{children:"Error updating tasks"})]})]})};var K=s(77961);function M({messages:e,status:t="idle",className:s,showActions:i=!0,onRegenerate:o,onAddToolResult:u,UntypedToolPartComponent:p,addToContext:x,writeAccess:h=!0,config:g}){let{toast:f}=(0,z.pm)();return a.jsx(a.Fragment,{children:e?.map((e,j)=>{let w=e.metadata,z=e.parts.filter(e=>"text"===e.type&&e.text?.includes('<file name="'))?.flatMap(e=>{let t=e.text.match(/<file name="([^"]+)">([^<]+)<\/file>/g);return t?.map(e=>{console.log("filePart",e);let t=e.match(/<file name="([^"]+)">/)?.[1]??"";return console.log("s3Key",t),{s3Key:t,content:e.match(/<file name="([^"]+)">([^<]+)<\/file>/)?.[2]??""}})??[]})??[];return console.log("files",z),a.jsx(l,{className:r.cn("assistant"===e.role&&(g?.customAssistantClassnames?g?.customAssistantClassnames:""),0===j&&(g?.marginTopFirstMessage?g?.marginTopFirstMessage:"mt-12"),s),from:e.role,children:a.jsxs(n,{children:[e.parts.map((s,r)=>{if("step-start"===s.type)return null;if("text"===s.type){let t=s.text.replace(/<file name="([^"]+)">([^<]+)<\/file>/g,"");return a.jsx(m.H,{className:"chat-response-container",children:t},`${e.id}-${r}_response`)}if("tool-askForConfirmation"===s.type&&u){let e=s.toolCallId;switch(s.state){case"input-streaming":return a.jsx("div",{children:"Loading confirmation request..."},e);case"input-available":return a.jsxs("div",{children:[s.input.message,a.jsxs("div",{children:[a.jsx("button",{onClick:()=>u({tool:"askForConfirmation",toolCallId:e,output:"Yes, confirmed"}),children:"Yes"}),a.jsx("button",{onClick:()=>u({tool:"askForConfirmation",toolCallId:e,output:"No, denied"}),children:"No"})]})]},e);case"output-available":return a.jsxs("div",{children:["Tool call allowed: ",s.output]},e);case"output-error":return a.jsxs("div",{children:["Error: ",s.errorText]},e)}}if(s.type?.toLowerCase().includes("preview_pdf")||s.type?.toLowerCase().includes("pdf_file_in_a_web_view")){let e=JSON.parse(s.output?.result??"{}");if(!e?.url)return a.jsxs("div",{children:["No URL provided for PDF preview ",JSON.stringify(e)]});let t=`${e.url}#page=${e.page??1}`;return a.jsx("iframe",{src:t,style:{width:"100%",height:"100vh"},title:"PDF viewer"})}if(s.type?.toLowerCase()==="tool-todo_write"||s.type?.toLowerCase()==="tool-todo_read"){let e=s.output;if(!e?.result)return null;let t=s.state;return a.jsx(E,{todos:e.result,showPriority:!0,state:t})}if((s.type.startsWith("tool-")||"dynamic-tool"===s.type)&&p&&x){let e=s.toolCallId;return a.jsx(p,{untypedToolPart:s,callId:e,addToContext:x},e)}return"file"===s.type&&s.mediaType?.startsWith("image/")?a.jsx($.default,{src:s.url,width:300,height:300,alt:"Generated image"},`${e.id}-${r}`):"source-url"===s.type?a.jsxs(b,{children:[a.jsx(C,{count:e.parts.filter(e=>"source-url"===e.type).length}),a.jsx(T,{children:e.parts.map((t,s)=>{if("source-url"===t.type)return a.jsx(_,{href:t.url,title:t.title},`${e.id}-${s}`)})},`${e.id}`)]},`${e.id}-${r}`):"reasoning"===s.type?a.jsxs(N,{className:"w-full",isStreaming:"streaming"===t,children:[a.jsx(y,{}),a.jsx(v,{children:s.text})]},`${e.id}-${r}`):null}),z.length>0&&a.jsx("div",{className:"grid grid-cols-6 min-w-[500px] gap-2 mt-3 mb-3",children:z.map(t=>a.jsx(K.jU,{s3Key:t.s3Key,onRemove:()=>{},active:!1,disabled:!1},t.s3Key+"_file_item_"+e.id))}),i&&"assistant"===e.role&&a.jsxs(d,{className:"mt-2",children:[o&&a.jsx(c,{onClick:()=>o(),label:"Retry",disabled:!h,children:a.jsx(k.Z,{className:"size-3"})}),a.jsx(c,{onClick:()=>{navigator.clipboard.writeText(e.parts.map(e=>e?.text||"").join("\n")),f({title:"Copied message",description:"The message was copied to your clipboard."})},label:"Copy",children:a.jsx(F.Z,{className:"size-3"})}),w?.totalTokens&&a.jsxs("small",{className:"text-muted-foreground",children:[Intl.NumberFormat("en-US").format(w?.totalTokens)," tokens"]})]})]})},e.id)})})}}};
|
|
1
|
+
"use strict";exports.id=3503,exports.ids=[3503],exports.modules={5354:(e,t,s)=>{s.d(t,{iG:()=>i,ri:()=>n});var a=s(10326);s(90772);var r=s(77863);s(17577);var l=s(30778);let n=({className:e,...t})=>a.jsx(l.h,{className:(0,r.cn)("relative flex-1 overflow-y-auto",e),initial:"smooth",resize:"smooth",role:"log",...t}),i=({className:e,...t})=>a.jsx(l.h.Content,{className:(0,r.cn)("p-4",e),...t})},87599:(e,t,s)=>{s.d(t,{K:()=>Y});var a=s(10326);s(28758);var r=s(77863);let l=({className:e,from:t,...s})=>a.jsx("div",{className:(0,r.cn)("group flex w-full items-end justify-end gap-2 py-4","user"===t?"is-user flex-row-reverse justify-end":"is-assistant flex-row-reverse justify-end","[&>div]:max-w-[80%]",e),...s}),n=({children:e,className:t,...s})=>a.jsx("div",{className:(0,r.cn)("flex flex-col gap-2 overflow-hidden rounded-lg py-3 text-foreground text-sm","group-[.is-user]:bg-secondary group-[.is-user]:text-primary-foreground group-[.is-user]:px-4","group-[.is-assistant]:bg-transparent group-[.is-assistant]:text-foreground",t),...s,children:a.jsx("div",{className:"is-user:dark",children:e})});var i=s(90772),o=s(68232);let d=({className:e,children:t,...s})=>a.jsx("div",{className:(0,r.cn)("flex items-center gap-1",e),...s,children:t}),c=({tooltip:e,children:t,label:s,className:l,variant:n="ghost",size:d="sm",...c})=>{let m=(0,a.jsxs)(i.z,{className:(0,r.cn)("size-9 p-1.5 text-muted-foreground hover:text-foreground",l),size:d,type:"button",variant:n,...c,children:[t,a.jsx("span",{className:"sr-only",children:s||e})]});return e?a.jsx(o.pn,{children:(0,a.jsxs)(o.u,{children:[a.jsx(o.aJ,{asChild:!0,children:m}),a.jsx(o._v,{children:a.jsx("p",{children:e})})]})}):m};var m=s(36931),u=s(52067),x=s(24295),p=s(98360),h=s(941),g=s(17577);let f=(0,g.createContext)(null),j=()=>{let e=(0,g.useContext)(f);if(!e)throw Error("Reasoning components must be used within Reasoning");return e},N=(0,g.memo)(({className:e,isStreaming:t=!1,open:s,defaultOpen:l=!1,onOpenChange:n,duration:i,children:o,...d})=>{let[c,m]=(0,u.T)({prop:s,defaultProp:l,onChange:n}),[p,h]=(0,u.T)({prop:i,defaultProp:0}),[j,N]=(0,g.useState)(!1),[v,y]=(0,g.useState)(null);return(0,g.useEffect)(()=>{t?null===v&&y(Date.now()):null!==v&&(h(Math.round((Date.now()-v)/1e3)),y(null))},[t,v,h]),(0,g.useEffect)(()=>{if(t&&!c)m(!0);else if(!t&&c&&!l&&!j){let e=setTimeout(()=>{m(!1),N(!0)},1e3);return()=>clearTimeout(e)}},[t,c,l,m,j]),a.jsx(f.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:m,duration:p},children:a.jsx(x.zF,{className:(0,r.cn)("not-prose mb-4",e),onOpenChange:e=>{m(e)},open:c,...d,children:o})})}),v=(0,g.memo)(({className:e,title:t="Reasoning",children:s,...l})=>{let{isStreaming:n,isOpen:i,duration:o}=j();return a.jsx(x.wy,{className:(0,r.cn)("flex items-center gap-2 text-muted-foreground text-sm",e),...l,children:s??(0,a.jsxs)(a.Fragment,{children:[a.jsx(p.Z,{className:"size-4"}),n||0===o?a.jsx("p",{children:"Thinking..."}):(0,a.jsxs)("p",{children:["Thought for ",o," seconds"]}),a.jsx(h.Z,{className:(0,r.cn)("size-4 text-muted-foreground transition-transform",i?"rotate-180":"rotate-0")})]})})}),y=(0,g.memo)(({className:e,children:t,...s})=>a.jsx(x.Fw,{className:(0,r.cn)("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...s,children:a.jsx(m.H,{className:"grid gap-2",children:t})}));N.displayName="Reasoning",v.displayName="ReasoningTrigger",y.displayName="ReasoningContent";var w=s(71876);let b=({className:e,...t})=>a.jsx(x.zF,{className:(0,r.cn)("not-prose mb-4 text-primary text-xs",e),...t}),C=({className:e,count:t,children:s,...r})=>a.jsx(x.wy,{className:"flex items-center gap-2",...r,children:s??(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{className:"font-medium",children:["Used ",t," sources"]}),a.jsx(h.Z,{className:"h-4 w-4"})]})}),_=({className:e,...t})=>a.jsx(x.Fw,{className:(0,r.cn)("mt-3 flex w-fit flex-col gap-2","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),k=({href:e,title:t,children:s,...r})=>a.jsx("a",{className:"flex items-center gap-2",href:e,rel:"noreferrer",target:"_blank",...r,children:s??(0,a.jsxs)(a.Fragment,{children:[a.jsx(w.Z,{className:"h-4 w-4"}),a.jsx("span",{className:"block font-medium",children:t})]})});var S=s(91468),$=s(43810),F=s(88307),T=s(36283),Z=s(88319),z=s(39183),P=s(46226),R=s(34789),O=s(53982),A=s(75290),L=s(2179),I=s(91470);let J={pending:{icon:O.Z,label:"Pending",className:"text-muted-foreground"},in_progress:{icon:A.Z,label:"In Progress",className:"text-blue-500 animate-spin"},completed:{icon:L.Z,label:"Completed",className:"text-green-500"},cancelled:{icon:I.Z,label:"Cancelled",className:"text-red-500"}},U={high:{label:"High",className:"bg-red-500/10 text-red-500 border-red-500/20"},medium:{label:"Medium",className:"bg-yellow-500/10 text-yellow-500 border-yellow-500/20"},low:{label:"Low",className:"bg-blue-500/10 text-blue-500 border-blue-500/20"}},D=({todos:e,showPriority:t=!1,state:s,className:l,...n})=>{if("string"==typeof e&&(e=JSON.parse(e)),!e||0===e.length)return null;let i=e.filter(e=>"completed"===e.status).length,o=e.length;return(0,a.jsxs)("div",{className:(0,r.cn)("my-2 space-y-1","input-streaming"===s&&"opacity-70",l),...n,children:[e.map((s,l)=>{let n=J[s.status]?J[s.status].icon:J.pending.icon,i=J[s.status]?J[s.status].className:J.pending.className;U[s.priority]?U[s.priority].className:U.medium.className;let o="in_progress"===s.status&&l===e.findIndex(e=>"in_progress"===e.status);return(0,a.jsxs)("div",{className:(0,r.cn)("flex items-start gap-2 py-0.5","cancelled"===s.status&&"opacity-50"),children:[a.jsx("div",{className:"flex-shrink-0 pt-0.5",children:a.jsx(n,{className:(0,r.cn)("size-3.5",i)})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:(0,r.cn)("text-sm","completed"===s.status&&"text-muted-foreground line-through","cancelled"===s.status&&"text-muted-foreground line-through","in_progress"===s.status&&o&&"font-medium"),children:s.content}),t&&"high"===s.priority&&a.jsx("span",{className:"ml-2 text-red-500 text-xs",children:"(!)"})]})]},s.id)}),o>1&&(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-1 text-muted-foreground text-xs",children:[a.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full bg-secondary",children:a.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:`${i/o*100}%`}})}),(0,a.jsxs)("span",{className:"whitespace-nowrap",children:[i,"/",o]})]}),"output-error"===s&&(0,a.jsxs)("div",{className:"flex items-center gap-1 pt-1 text-red-500 text-xs",children:[a.jsx(I.Z,{className:"size-3"}),a.jsx("span",{children:"Error updating tasks"})]})]})};var M=s(77961),E=s(33071),K=s(35047),H=s(567);function Y({messages:e,status:t="idle",className:s,showActions:i=!0,onRegenerate:o,onAddToolResult:u,UntypedToolPartComponent:x,addToContext:p,writeAccess:h=!0,config:g}){let{toast:f}=(0,R.pm)();return a.jsx(a.Fragment,{children:e?.map((e,j)=>{let w=e.metadata,F=e.parts.filter(e=>"text"===e.type&&e.text?.includes('<file name="'))?.flatMap(e=>{let t=e.text.match(/<file name="([^"]+)">([^<]+)<\/file>/g);return t?.map(e=>{console.log("filePart",e);let t=e.match(/<file name="([^"]+)">/)?.[1]??"";return console.log("s3Key",t),{s3Key:t,content:e.match(/<file name="([^"]+)">([^<]+)<\/file>/)?.[2]??""}})??[]})??[];return console.log("files",F),a.jsx(l,{className:r.cn("assistant"===e.role&&(g?.customAssistantClassnames?g?.customAssistantClassnames:""),0===j&&(g?.marginTopFirstMessage?g?.marginTopFirstMessage:"mt-12"),s),from:e.role,children:a.jsxs(n,{children:[e.parts.map((s,r)=>{if("step-start"===s.type)return null;if("text"===s.type){let t=s.text.replace(/<file name="([^"]+)">([^<]+)<\/file>/g,"");return a.jsx(m.H,{className:"chat-response-container",children:t},`${e.id}-${r}_response`)}if("tool-askForConfirmation"===s.type&&u){let e=s.toolCallId;switch(s.state){case"input-streaming":return a.jsx("div",{children:"Loading confirmation request..."},e);case"input-available":return a.jsxs("div",{children:[s.input.message,a.jsxs("div",{children:[a.jsx("button",{onClick:()=>u({tool:"askForConfirmation",toolCallId:e,output:"Yes, confirmed"}),children:"Yes"}),a.jsx("button",{onClick:()=>u({tool:"askForConfirmation",toolCallId:e,output:"No, denied"}),children:"No"})]})]},e);case"output-available":return a.jsxs("div",{children:["Tool call allowed: ",s.output]},e);case"output-error":return a.jsxs("div",{children:["Error: ",s.errorText]},e)}}if(s.type?.toLowerCase().includes("preview_pdf")||s.type?.toLowerCase().includes("pdf_file_in_a_web_view")){let e=JSON.parse(s.output?.result??"{}");if(!e?.url)return a.jsxs("div",{children:["No URL provided for PDF preview ",JSON.stringify(e)]});let t=`${e.url}#page=${e.page??1}`;return a.jsx("iframe",{src:t,style:{width:"100%",height:"100vh"},title:"PDF viewer"})}if(s.type?.toLowerCase()==="tool-todo_write"){let e=s.output;if(!e?.result)return null;let t=s.state;return a.jsx(D,{todos:e.result,showPriority:!0,state:t})}if(s.type?.toLowerCase()==="tool-todo_read")return null;if(s.type?.toLowerCase().includes("context_search")){let t=s.output;if("string"==typeof t&&(t=JSON.parse(t)),"string"==typeof t?.result&&(t.result=JSON.parse(t?.result)),console.log("output",t),console.log("output.result",t?.result),!t?.result?.length)return null;let l=new Map,n=t.result[0]?.context?.name;for(let e of t.result)l.has(e.item_id)?l.get(e.item_id)?.chunks.push(e):l.set(e.item_id,{id:e.item_id,updatedAt:e.item_updated_at,createdAt:e.item_created_at,external_id:e.item_external_id,name:e.item_name,context:{name:e.context?.name,id:e.context?.id},chunks:[e]});return a.jsx(G,{input:s.input,context:n,items:Array.from(l.values()),totalChunks:t.result.length},`${e.id}-${r}`)}if((s.type.startsWith("tool-")||"dynamic-tool"===s.type)&&x&&p){let e=s.toolCallId;return a.jsx(x,{untypedToolPart:s,callId:e,addToContext:p},e)}return"file"===s.type&&s.mediaType?.startsWith("image/")?a.jsx(P.default,{src:s.url,width:300,height:300,alt:"Generated image"},`${e.id}-${r}`):"source-url"===s.type?a.jsxs(b,{children:[a.jsx(C,{count:e.parts.filter(e=>"source-url"===e.type).length}),a.jsx(_,{children:e.parts.map((t,s)=>{if("source-url"===t.type)return a.jsx(k,{href:t.url,title:t.title},`${e.id}-${s}`)})},`${e.id}`)]},`${e.id}-${r}`):"reasoning"===s.type?a.jsxs(N,{className:"w-full",isStreaming:"streaming"===t,children:[a.jsx(v,{}),a.jsx(y,{children:s.text})]},`${e.id}-${r}`):null}),F.length>0&&a.jsx("div",{className:"grid grid-cols-6 min-w-[500px] gap-2 mt-3 mb-3",children:F.map(t=>a.jsx(M.jU,{s3Key:t.s3Key,onRemove:()=>{},active:!1,disabled:!1},t.s3Key+"_file_item_"+e.id))}),i&&"assistant"===e.role&&a.jsxs(d,{className:"mt-2",children:[o&&a.jsx(c,{onClick:()=>o(),label:"Retry",disabled:!h,children:a.jsx(S.Z,{className:"size-3"})}),a.jsx(c,{onClick:()=>{navigator.clipboard.writeText(e.parts.map(e=>e?.text||"").join("\n")),f({title:"Copied message",description:"The message was copied to your clipboard."})},label:"Copy",children:a.jsx($.Z,{className:"size-3"})}),w?.totalTokens&&a.jsxs("small",{className:"text-muted-foreground",children:[Intl.NumberFormat("en-US").format(w?.totalTokens)," tokens"]})]})]})},e.id)})})}let G=({context:e,input:t,items:s,totalChunks:r})=>{let[l,n]=(0,g.useState)(!1),[i,o]=(0,g.useState)(!1),d=new Set(s.map(e=>e.context.name)),c=i?s:s.slice(0,3);return a.jsx("div",{className:"my-3 border rounded-lg overflow-hidden bg-card",children:(0,a.jsxs)(x.zF,{open:l,onOpenChange:n,children:[a.jsx(x.wy,{className:"w-full",children:(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 hover:bg-accent/50 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 rounded-md bg-primary/10",children:a.jsx(F.Z,{className:"h-4 w-4 text-primary"})}),(0,a.jsxs)("div",{className:"text-left",children:[(0,a.jsxs)("div",{className:"font-medium text-sm flex items-center gap-2",children:["Context Search Results for ",e,(0,a.jsxs)(H.C,{variant:"secondary",className:"text-xs",children:[s.length," ",1===s.length?"item":"items"]})]}),(0,a.jsxs)("div",{className:"text-xs text-muted-foreground mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[a.jsx(T.Z,{className:"h-3 w-3"}),r," chunks"]}),d.size>0&&(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[a.jsx(Z.Z,{className:"h-3 w-3"}),d.size," ",1===d.size?"context":"contexts"]})]})]})]}),l?a.jsx(h.Z,{className:"h-5 w-5 text-muted-foreground"}):a.jsx(z.Z,{className:"h-5 w-5 text-muted-foreground"})]})}),a.jsx(x.Fw,{children:(0,a.jsxs)("div",{className:"border-t",children:[Object.keys(t).length>0&&(0,a.jsxs)("div",{className:"p-4 bg-muted/30 border-b",children:[a.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Search Parameters"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(t).map(([e,t])=>(0,a.jsxs)(H.C,{variant:"outline",className:"text-xs",children:[(0,a.jsxs)("span",{className:"font-medium",children:[function(e){if(!e||"string"!=typeof e)return"";let t=e.replace(/([A-Z])/g," $1").trim();return t.charAt(0).toUpperCase()+t.slice(1)}(e),":"]}),a.jsx("span",{className:"ml-1 font-normal",children:"object"==typeof t?JSON.stringify(t):String(t)})]},e))})]}),a.jsx("div",{className:"p-4",children:s.length>0?(0,a.jsxs)(a.Fragment,{children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:c.map(e=>a.jsx(W,{item:e},e.id))}),s.length>3&&a.jsx("div",{className:"mt-4 text-center",children:a.jsx("button",{onClick:e=>{e.stopPropagation(),o(!i)},className:"text-sm text-primary hover:underline",children:i?"Show less":`Show ${s.length-3} more items`})})]}):a.jsx("div",{className:"text-center py-8 text-muted-foreground text-sm",children:"No items found."})})]})})]})})},W=({item:e})=>{let t;let s=(0,K.useRouter)();return a.jsx(E.Zb,{className:"group relative overflow-hidden hover:shadow-md transition-all duration-200 hover:border-primary/50 cursor-pointer",onClick:()=>{s.push(`/data/${e.context.id}/${e.id}`)},children:(0,a.jsxs)(E.aY,{className:"p-4",children:[a.jsx("div",{className:"mb-2",children:a.jsx("h4",{className:"font-medium text-sm line-clamp-2 min-h-[2.5rem]",children:e.name||"Untitled"})}),e.external_id&&a.jsx("small",{className:"text-xs text-muted-foreground",children:e.external_id}),(0,a.jsxs)("div",{className:"space-y-2 pt-2 border-t",children:[a.jsx("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:e.updatedAt&&a.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:(t=e.updatedAt)?new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null})}),e.chunks&&e.chunks.length>0&&a.jsx("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:(0,a.jsxs)("span",{className:"text-xs",children:["• ",e.chunks.length," chunks"]})})]})]})})}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=5485,exports.ids=[5485],exports.modules={19753:(e,s,a)=>{a.d(s,{R:()=>P});var t=a(10326),l=a(17577),i=a(39167),r=a(18753),n=a(42270),d=a(90772),c=a(33071),o=a(53313),x=a(15940),m=a(79210),u=a(99440),h=a(567),j=a(75290),p=a(94893),g=a(71059),f=a(56762),b=a(98091),N=a(91468),v=a(11890),y=a(39183),w=a(34789),C=a(98181),k=a(18615),R=a(76812);function P({queueName:e,nameGenerator:s,retryJob:a}){let{toast:P}=(0,w.pm)(),[S,z]=(0,l.useState)(!1),[T,Z]=(0,l.useState)(!1),[q,D]=(0,l.useState)(!1),[$,A]=(0,l.useState)([]),[I,O]=(0,l.useState)(null),[L,Q]=(0,l.useState)("completed"),[J,M]=(0,l.useState)(1),[Y,F]=(0,l.useState)(20),[_,V]=(0,l.useState)(new Set),{data:E,loading:H,refetch:G}=(0,i.aM)(n.k9,{variables:{queue:e},pollInterval:5e3}),{data:W,loading:B,refetch:U,networkStatus:X}=(0,i.aM)(n.Jq,{variables:{queue:e,statusses:L,page:J,limit:Y},pollInterval:5e3}),[K,{loading:ee}]=(0,r.D)(n.Wr,{onError:e=>{P({title:"Failed to delete job",description:e.message,variant:"destructive"})}}),[es,{loading:ea}]=(0,r.D)(n.fc,{onCompleted:()=>{P({title:"Queue paused",description:`The ${e} queue has been paused.`}),G(),z(!1)},onError:e=>{P({title:"Failed to pause queue",description:e.message,variant:"destructive"})}}),[et,{loading:el}]=(0,r.D)(n.iC,{onCompleted:()=>{P({title:"Queue resumed",description:`The ${e} queue has been resumed.`}),G(),D(!1)},onError:e=>{P({title:"Failed to resume queue",description:e.message,variant:"destructive"})}}),[ei,{loading:er}]=(0,r.D)(n.QW,{onCompleted:()=>{P({title:"Queue drained",description:"All waiting and delayed jobs have been removed from the queue."}),G(),U(),Z(!1)},onError:e=>{P({title:"Failed to drain queue",description:e.message,variant:"destructive"})}}),en=e=>{A([e])},ed=e=>{O(e)},ec=e=>{let s=new Set(_);s.has(e)?s.delete(e):s.add(e),V(s)},eo=async()=>{if($.filter(e=>!e.id).length>0){P({title:"Failed to delete jobs",description:"Some jobs have no ID.",variant:"destructive"});return}try{await Promise.all($.map(s=>K({variables:{queue:e,id:s.id}}))),P({title:1===$.length?"Job deleted":"Jobs deleted",description:`Successfully deleted ${$.length} job${1===$.length?"":"s"}.`}),U(),G(),A([]),V(new Set)}catch(e){}},ex=E?.queue,em=W?.jobs||{items:[],pageInfo:{pageCount:0,itemCount:0,currentPage:1,hasPreviousPage:!1,hasNextPage:!1}},eu=e=>t.jsx(h.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 H&&B?t.jsx("div",{className:"space-y-4",children:t.jsx(c.Zb,{children:t.jsx(c.aY,{className:"pt-6",children:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(j.Z,{className:"h-6 w-6 animate-spin"})})})})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.Zb,{children:[t.jsx(c.Ol,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"flex items-center gap-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.ll,{children:["Queue: ",e]}),(0,t.jsxs)(c.SZ,{children:["Manage the ",e," job queue and view all jobs."]})]})}),ex&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)(d.z,{variant:"outline",size:"sm",onClick:()=>ex?.isPaused?D(!0):z(!0),disabled:ea||el,children:[ex?.isPaused?t.jsx(p.Z,{className:"mr-2 h-4 w-4"}):t.jsx(g.Z,{className:"mr-2 h-4 w-4"}),ex?.isPaused?"Resume queue":"Pause queue"]}),(0,t.jsxs)(d.z,{variant:"outline",size:"sm",onClick:()=>Z(!0),disabled:er,children:[t.jsx(f.Z,{className:"mr-2 h-4 w-4"}),"Drain queue"]})]})]})}),(0,t.jsxs)(c.aY,{className:"space-y-6",children:[ex&&(0,t.jsxs)("div",{className:"flex items-center gap-8 p-4 bg-muted/50 rounded-lg",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Status:"}),t.jsx("div",{children:ex.isPaused?t.jsx(h.C,{variant:"outline",className:"bg-gray-100 text-gray-800",children:"Paused"}):ex.isMaxed?t.jsx(h.C,{variant:"outline",className:"bg-red-100 text-red-800",children:"Maxed"}):t.jsx(h.C,{variant:"outline",className:"bg-green-100 text-green-800",children:"Active"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Concurrency:"}),(0,t.jsxs)("div",{className:"font-semibold",children:["Per queue global concurrency: ",ex.concurrency?.queue||"None","Per worker concurrency: ",ex.concurrency?.worker||"None","."]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Rate Limit:"}),t.jsx("div",{className:"font-semibold",children:ex.ratelimit||"None"})]}),t.jsx(m.mQ,{value:L,onValueChange:e=>Q(e),className:"w-auto",children:(0,t.jsxs)(m.dr,{children:[(0,t.jsxs)(m.SP,{value:"active",className:"gap-1.5",children:[t.jsx("span",{children:"Active"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-blue-100 text-blue-600 border-blue-200",children:ex.jobs?.active||0})]}),(0,t.jsxs)(m.SP,{value:"waiting",className:"gap-1.5",children:[t.jsx("span",{children:"Waiting"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-yellow-100 text-yellow-600 border-yellow-200",children:ex.jobs?.waiting||0})]}),(0,t.jsxs)(m.SP,{value:"failed",className:"gap-1.5",children:[t.jsx("span",{children:"Failed"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-red-100 text-red-600 border-red-200",children:ex.jobs?.failed||0})]}),(0,t.jsxs)(m.SP,{value:"completed",className:"gap-1.5",children:[t.jsx("span",{children:"Completed"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-green-100 text-green-600 border-green-200",children:ex.jobs?.completed||0})]})]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Queue Jobs"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["All jobs currently in the ",e," queue"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[_.size>0&&(0,t.jsxs)(d.z,{variant:"destructive",size:"sm",onClick:()=>{A(em.items.filter(e=>_.has(e.id)))},disabled:ee,children:[t.jsx(b.Z,{className:"mr-2 h-4 w-4"}),"Delete ",_.size," job",1===_.size?"":"s"]}),(0,t.jsxs)(h.C,{variant:"outline",children:["Auto Refresh: ",t.jsx(j.Z,{className:"h-4 w-4 animate-spin text-muted-foreground ml-1"})]})]})]}),(0,t.jsxs)("div",{className:"border rounded-lg",children:[B?t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(j.Z,{className:"h-6 w-6 animate-spin"})}):em.items?.length===0?t.jsx("div",{className:"text-center pt-8 text-muted-foreground",children:"No jobs in queue"}):(0,t.jsxs)(x.iA,{children:[t.jsx(x.xD,{children:(0,t.jsxs)(x.SC,{children:[t.jsx(x.ss,{className:"w-12",children:t.jsx(o.X,{checked:em.items.filter(e=>"active"!==e.state).length>0&&_.size===em.items.filter(e=>"active"!==e.state).length,onCheckedChange:()=>{let e=em.items.filter(e=>"active"!==e.state);_.size===e.length&&e.length>0?V(new Set):V(new Set(e.map(e=>e.id)))},"aria-label":"Select all jobs"})}),t.jsx(x.ss,{children:"Name"}),t.jsx(x.ss,{children:"ID"}),t.jsx(x.ss,{children:"State"}),t.jsx(x.ss,{children:"Timestamp"}),t.jsx(x.ss,{children:"Inputs"}),t.jsx(x.ss,{children:"Outputs"}),t.jsx(x.ss,{className:"text-right",children:"Actions"})]})}),t.jsx(x.RM,{children:em.items?.map((e,a)=>t.jsxs(x.SC,{children:[t.jsx(x.pj,{children:t.jsx(o.X,{checked:_.has(e.id),onCheckedChange:()=>ec(e.id),disabled:"active"===e.state,"aria-label":`Select job ${s(e)}`})}),t.jsx(x.pj,{className:"font-medium max-w-[200px] truncate",children:s(e)}),t.jsx(x.pj,{children:e.id}),t.jsx(x.pj,{children:eu(e.state)}),t.jsx(x.pj,{children:e.timestamp?C.WU(new Date(e.timestamp),"MMM d, yyyy HH:mm:ss"):"N/A"}),t.jsx(x.pj,{children:e.data?t.jsx("div",{className:"text-xs max-w-[200px] truncate",children:t.jsx(k.J,{text:JSON.stringify(e.data)})}):null}),t.jsx(x.pj,{children:e.failedReason?t.jsx("div",{className:"text-xs text-red-600 max-w-[200px] truncate",children:t.jsx(k.J,{text:"Error: "+e.failedReason})}):t.jsx("div",{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:t.jsx(k.J,{text:JSON.stringify(e.returnvalue)})})}),t.jsxs(x.pj,{className:"text-right",children:["active"!==e.state&&t.jsx(d.z,{variant:"ghost",size:"sm",onClick:()=>en(e),disabled:ee,children:t.jsx(b.Z,{className:"h-4 w-4 text-red-600"})}),"failed"===e.state&&t.jsxs(d.z,{variant:"ghost",size:"sm",onClick:()=>ed(e),children:[t.jsx(N.Z,{className:"h-4 w-4 text-blue-600"}),"Retry"]})]})]},a))})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-2 pb-2",children:[(0,t.jsxs)("div",{className:"flex-1 text-sm text-muted-foreground",children:["(",em?.pageInfo?.itemCount||0," total"," ","items)."]}),t.jsx("div",{className:"flex items-center space-x-6 lg:space-x-8",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsxs)(d.z,{variant:"outline",className:"hidden size-8 p-0 lg:flex",onClick:()=>{M(1),U()},disabled:!em?.pageInfo?.hasPreviousPage,children:[t.jsx("span",{className:"sr-only",children:"Go to first page"}),t.jsx(R.kRt,{className:"size-4"})]}),(0,t.jsxs)(d.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{console.log("itemsData.data?.pageInfo.hasPreviousPage",em?.pageInfo?.hasPreviousPage),M(em?.pageInfo?.hasPreviousPage?em?.pageInfo?.currentPage-1:1),U()},disabled:!em?.pageInfo?.hasPreviousPage,children:[t.jsx("span",{className:"sr-only",children:"Go to previous page"}),t.jsx(v.Z,{className:"size-4"})]}),(0,t.jsxs)(d.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{M(em?.pageInfo?.hasNextPage?em?.pageInfo?.currentPage+1:1),U()},disabled:!em?.pageInfo.hasNextPage,children:[t.jsx("span",{className:"sr-only",children:"Go to next page"}),t.jsx(y.Z,{className:"size-4"})]})]})})]})]})]})]})]}),t.jsx(u.aR,{open:$.length>0,onOpenChange:e=>!e&&A([]),children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:1===$.length?"Delete Job?":`Delete ${$.length} Jobs?`}),t.jsx(u.yT,{children:1===$.length?`Are you sure you want to delete the job "${$[0]?.name}"? This action cannot be undone.`:`Are you sure you want to delete ${$.length} jobs? This action cannot be undone.`})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),(0,t.jsxs)(u.OL,{onClick:eo,disabled:ee,children:[ee&&t.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Delete"]})]})]})}),t.jsx(u.aR,{open:!!I,onOpenChange:e=>!e&&O(null),children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:"Retry Job?"}),(0,t.jsxs)(u.yT,{children:['Are you sure you want to retry the job "',I?.name,'"? This will schedule a new job with the same data.']})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),t.jsx(u.OL,{onClick:()=>{I&&a(I)},disabled:ee,children:"Retry"})]})]})}),t.jsx(u.aR,{open:S,onOpenChange:z,children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:"Pause Queue?"}),(0,t.jsxs)(u.yT,{children:["Are you sure you want to pause the ",e," queue? No jobs will be processed until the queue is resumed."]})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),(0,t.jsxs)(u.OL,{onClick:()=>{es({variables:{queue:e}})},disabled:ea,children:[ea&&t.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Pause Queue"]})]})]})}),t.jsx(u.aR,{open:q,onOpenChange:D,children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:"Resume Queue?"}),(0,t.jsxs)(u.yT,{children:["Are you sure you want to resume the ",e," queue?."]})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),(0,t.jsxs)(u.OL,{onClick:()=>{et({variables:{queue:e}})},disabled:el,children:[el&&t.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Resume Queue"]})]})]})}),t.jsx(u.aR,{open:T,onOpenChange:Z,children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:"Drain Queue?"}),(0,t.jsxs)(u.yT,{children:["Are you sure you want to drain the ",e," 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,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),(0,t.jsxs)(u.OL,{onClick:()=>{ei({variables:{queue:e}})},disabled:er,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[er&&t.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Drain Queue"]})]})]})})]})}},57004:(e,s,a)=>{a.a(e,async(e,t)=>{try{a.d(s,{G:()=>g});var l=a(10326),i=a(48644),r=a(93801),n=a(45747),d=a(17577),c=a(94966),o=a(12533),x=a(12428),m=a(47355),u=a(62288),h=a(34789),j=a(77863),p=e([i,r,n]);function g({className:e=null,code:s,language:a,slice:t=200}){let{toast:i}=(0,h.pm)(),[r,n]=(0,d.useState)(null);return(0,l.jsxs)(u.Vq,{children:[l.jsx(u.hg,{asChild:!0,children:r?.length&&l.jsx(c.Z,{className:(0,j.cn)("cursor-pointer",e),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:a||"plaintext",style:m.Z,children:`${r?.slice(0,t||200)} ${r?.length>(t||200)?"...":""}`})}),l.jsx(u.cZ,{className:"sm:max-w-[800px] overflow-hidden max-h-[500px] overflow-y-scroll",children:(0,l.jsxs)(u.fK,{children:[l.jsx(u.$N,{children:"Code"}),l.jsx("div",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(r??""),i({title:"Copied to clipboard"})},children:l.jsx(c.Z,{className:(0,j.cn)(e),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:a||"plaintext",style:m.Z,children:r??""})})]})})]})}[i,r,n]=p.then?(await p)():p,c.Z.registerLanguage("json",x.Z),c.Z.registerLanguage("javascript",o.Z),t()}catch(e){t(e)}})},99440:(e,s,a)=>{a.d(s,{OL:()=>p,_T:()=>x,aR:()=>d,f$:()=>h,fY:()=>m,le:()=>g,xo:()=>u,yT:()=>j});var t=a(10326),l=a(12194),i=a(17577),r=a(90772),n=a(77863);let d=l.fC;l.xz;let c=l.h_,o=i.forwardRef(({className:e,...s},a)=>t.jsx(l.aV,{className:(0,n.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...s,ref:a}));o.displayName=l.aV.displayName;let x=i.forwardRef(({className:e,...s},a)=>(0,t.jsxs)(c,{children:[t.jsx(o,{}),t.jsx(l.VY,{ref:a,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...s})]}));x.displayName=l.VY.displayName;let m=({className:e,...s})=>t.jsx("div",{className:(0,n.cn)("flex flex-col space-y-2 text-center sm:text-left",e),...s});m.displayName="AlertDialogHeader";let u=({className:e,...s})=>t.jsx("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...s});u.displayName="AlertDialogFooter";let h=i.forwardRef(({className:e,...s},a)=>t.jsx(l.Dx,{ref:a,className:(0,n.cn)("text-lg font-semibold",e),...s}));h.displayName=l.Dx.displayName;let j=i.forwardRef(({className:e,...s},a)=>t.jsx(l.dk,{ref:a,className:(0,n.cn)("text-sm text-muted-foreground",e),...s}));j.displayName=l.dk.displayName;let p=i.forwardRef(({className:e,...s},a)=>t.jsx(l.aU,{ref:a,className:(0,n.cn)((0,r.d)(),e),...s}));p.displayName=l.aU.displayName;let g=i.forwardRef(({className:e,...s},a)=>t.jsx(l.$j,{ref:a,className:(0,n.cn)((0,r.d)({variant:"outline"}),"mt-2 sm:mt-0",e),...s}));g.displayName=l.$j.displayName},53313:(e,s,a)=>{a.d(s,{X:()=>d});var t=a(10326),l=a(13635),i=a(32933),r=a(17577),n=a(77863);let d=r.forwardRef(({className:e,...s},a)=>t.jsx(l.fC,{ref:a,className:(0,n.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",e),...s,children:t.jsx(l.z$,{className:(0,n.cn)("flex items-center justify-center text-current"),children:t.jsx(i.Z,{className:"size-4"})})}));d.displayName=l.fC.displayName},15940:(e,s,a)=>{a.d(s,{RM:()=>d,Rn:()=>m,SC:()=>c,iA:()=>r,pj:()=>x,ss:()=>o,xD:()=>n});var t=a(10326),l=a(17577),i=a(77863);let r=l.forwardRef(({className:e,...s},a)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:a,className:(0,i.cn)("w-full caption-bottom text-sm",e),...s})}));r.displayName="Table";let n=l.forwardRef(({className:e,...s},a)=>t.jsx("thead",{ref:a,className:(0,i.cn)("[&_tr]:border-b",e),...s}));n.displayName="TableHeader";let d=l.forwardRef(({className:e,...s},a)=>t.jsx("tbody",{ref:a,className:(0,i.cn)("[&_tr:last-child]:border-0",e),...s}));d.displayName="TableBody",l.forwardRef(({className:e,...s},a)=>t.jsx("tfoot",{ref:a,className:(0,i.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...s})).displayName="TableFooter";let c=l.forwardRef(({className:e,...s},a)=>t.jsx("tr",{ref:a,className:(0,i.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...s}));c.displayName="TableRow";let o=l.forwardRef(({className:e,...s},a)=>t.jsx("th",{ref:a,className:(0,i.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:w-[40px]",e),...s}));o.displayName="TableHead";let x=l.forwardRef(({className:e,...s},a)=>t.jsx("td",{ref:a,className:(0,i.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:w-[40px]",e),...s}));x.displayName="TableCell";let m=l.forwardRef(({className:e,...s},a)=>t.jsx("caption",{ref:a,className:(0,i.cn)("mt-4 text-sm text-muted-foreground",e),...s}));m.displayName="TableCaption"}};
|
|
1
|
+
"use strict";exports.id=5485,exports.ids=[5485],exports.modules={19753:(e,s,a)=>{a.d(s,{R:()=>R});var t=a(10326),l=a(17577),i=a(39167),r=a(18753),n=a(42270),d=a(90772),c=a(33071),o=a(53313),x=a(15940),m=a(79210),u=a(99440),h=a(567),j=a(75290),p=a(94893),f=a(71059),g=a(56762),b=a(98091),N=a(91468),v=a(11890),y=a(39183),w=a(34789),C=a(98181),k=a(18615),P=a(76812);function R({queueName:e,nameGenerator:s,retryJob:a}){let{toast:R}=(0,w.pm)(),[S,z]=(0,l.useState)(!1),[T,Z]=(0,l.useState)(!1),[q,D]=(0,l.useState)(!1),[O,A]=(0,l.useState)([]),[$,M]=(0,l.useState)(null),[I,L]=(0,l.useState)("completed"),[Q,J]=(0,l.useState)(1),[F,Y]=(0,l.useState)(200),[H,_]=(0,l.useState)(new Set),{data:V,loading:W,refetch:E}=(0,i.aM)(n.k9,{variables:{queue:e},pollInterval:5e3}),{data:U,loading:G,refetch:B,networkStatus:X}=(0,i.aM)(n.Jq,{variables:{queue:e,statusses:I,page:Q,limit:F},pollInterval:5e3}),[K,{loading:ee}]=(0,r.D)(n.Wr,{onError:e=>{R({title:"Failed to delete job",description:e.message,variant:"destructive"})}}),[es,{loading:ea}]=(0,r.D)(n.fc,{onCompleted:()=>{R({title:"Queue paused",description:`The ${e} queue has been paused.`}),E(),z(!1)},onError:e=>{R({title:"Failed to pause queue",description:e.message,variant:"destructive"})}}),[et,{loading:el}]=(0,r.D)(n.iC,{onCompleted:()=>{R({title:"Queue resumed",description:`The ${e} queue has been resumed.`}),E(),D(!1)},onError:e=>{R({title:"Failed to resume queue",description:e.message,variant:"destructive"})}}),[ei,{loading:er}]=(0,r.D)(n.QW,{onCompleted:()=>{R({title:"Queue drained",description:"All waiting and delayed jobs have been removed from the queue."}),E(),B(),Z(!1)},onError:e=>{R({title:"Failed to drain queue",description:e.message,variant:"destructive"})}}),en=e=>{A([e])},ed=e=>{M(e)},ec=e=>{let s=new Set(H);s.has(e)?s.delete(e):s.add(e),_(s)},eo=async()=>{if(O.filter(e=>!e.id).length>0){R({title:"Failed to delete jobs",description:"Some jobs have no ID.",variant:"destructive"});return}try{await Promise.all(O.map(s=>K({variables:{queue:e,id:s.id}}))),R({title:1===O.length?"Job deleted":"Jobs deleted",description:`Successfully deleted ${O.length} job${1===O.length?"":"s"}.`}),B(),E(),A([]),_(new Set)}catch(e){}},ex=V?.queue,em=U?.jobs||{items:[],pageInfo:{pageCount:0,itemCount:0,currentPage:1,hasPreviousPage:!1,hasNextPage:!1}};return W&&G?t.jsx("div",{className:"space-y-4",children:t.jsx(c.Zb,{children:t.jsx(c.aY,{className:"pt-6",children:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(j.Z,{className:"h-6 w-6 animate-spin"})})})})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.Zb,{children:[t.jsx(c.Ol,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"flex items-center gap-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.ll,{children:["Queue: ",e]}),(0,t.jsxs)(c.SZ,{children:["Manage the ",e," job queue and view all jobs."]})]})}),ex&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)(d.z,{variant:"outline",size:"sm",onClick:()=>ex?.isPaused?D(!0):z(!0),disabled:ea||el,children:[ex?.isPaused?t.jsx(p.Z,{className:"mr-2 h-4 w-4"}):t.jsx(f.Z,{className:"mr-2 h-4 w-4"}),ex?.isPaused?"Resume queue":"Pause queue"]}),(0,t.jsxs)(d.z,{variant:"outline",size:"sm",onClick:()=>Z(!0),disabled:er,children:[t.jsx(g.Z,{className:"mr-2 h-4 w-4"}),"Drain queue"]})]})]})}),(0,t.jsxs)(c.aY,{className:"space-y-6",children:[ex&&(0,t.jsxs)("div",{className:"flex items-center gap-8 p-4 bg-muted/50 rounded-lg",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Status:"}),t.jsx("div",{children:ex.isPaused?t.jsx(h.C,{variant:"outline",className:"bg-gray-100 text-gray-800",children:"Paused"}):ex.isMaxed?t.jsx(h.C,{variant:"outline",className:"bg-red-100 text-red-800",children:"Maxed"}):t.jsx(h.C,{variant:"outline",className:"bg-green-100 text-green-800",children:"Active"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Concurrency:"}),(0,t.jsxs)("div",{className:"font-semibold",children:["Per queue global concurrency: ",ex.concurrency?.queue||"None","Per worker concurrency: ",ex.concurrency?.worker||"None",". Timeout: ",ex.timeoutInSeconds||"None"," seconds."]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Rate Limit:"}),t.jsx("div",{className:"font-semibold",children:ex.ratelimit||"None"})]}),t.jsx(m.mQ,{value:I,onValueChange:e=>L(e),className:"w-auto",children:(0,t.jsxs)(m.dr,{children:[(0,t.jsxs)(m.SP,{value:"active",className:"gap-1.5",children:[t.jsx("span",{children:"Active"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-blue-100 text-blue-600 border-blue-200",children:ex.jobs?.active||0})]}),(0,t.jsxs)(m.SP,{value:"waiting",className:"gap-1.5",children:[t.jsx("span",{children:"Waiting"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-yellow-100 text-yellow-600 border-yellow-200",children:ex.jobs?.waiting||0})]}),(0,t.jsxs)(m.SP,{value:"failed",className:"gap-1.5",children:[t.jsx("span",{children:"Failed"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-red-100 text-red-600 border-red-200",children:ex.jobs?.failed||0})]}),(0,t.jsxs)(m.SP,{value:"stuck",className:"gap-1.5",children:[t.jsx("span",{children:"Stuck"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-red-100 text-red-600 border-red-200",children:ex.jobs?.stuck||0})]}),(0,t.jsxs)(m.SP,{value:"completed",className:"gap-1.5",children:[t.jsx("span",{children:"Completed"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-green-100 text-green-600 border-green-200",children:ex.jobs?.completed||0})]})]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Queue Jobs"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["All jobs currently in the ",e," queue"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[H.size>0&&(0,t.jsxs)(d.z,{variant:"destructive",size:"sm",onClick:()=>{A(em.items.filter(e=>H.has(e.id)))},disabled:ee,children:[t.jsx(b.Z,{className:"mr-2 h-4 w-4"}),"Delete ",H.size," job",1===H.size?"":"s"]}),(0,t.jsxs)(h.C,{variant:"outline",children:["Auto Refresh: ",t.jsx(j.Z,{className:"h-4 w-4 animate-spin text-muted-foreground ml-1"})]})]})]}),(0,t.jsxs)("div",{className:"border rounded-lg",children:[G?t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(j.Z,{className:"h-6 w-6 animate-spin"})}):em.items?.length===0?t.jsx("div",{className:"text-center pt-8 text-muted-foreground",children:"No jobs in queue"}):(0,t.jsxs)(x.iA,{children:[t.jsx(x.xD,{children:(0,t.jsxs)(x.SC,{children:[t.jsx(x.ss,{className:"w-12",children:t.jsx(o.X,{checked:em.items.filter(e=>"active"!==e.state).length>0&&H.size===em.items.filter(e=>"active"!==e.state).length,onCheckedChange:()=>{let e=em.items.filter(e=>"active"!==e.state);H.size===e.length&&e.length>0?_(new Set):_(new Set(e.map(e=>e.id)))},"aria-label":"Select all jobs"})}),t.jsx(x.ss,{children:"Name"}),t.jsx(x.ss,{children:"ID"}),t.jsx(x.ss,{children:"Attempts Made"}),t.jsx(x.ss,{children:"Created"}),t.jsx(x.ss,{children:"Processed On"}),t.jsx(x.ss,{children:"Finished On"}),t.jsx(x.ss,{children:"Inputs"}),t.jsx(x.ss,{children:"Outputs"}),t.jsx(x.ss,{className:"text-right",children:"Actions"})]})}),t.jsx(x.RM,{children:em.items?.map((e,a)=>t.jsxs(x.SC,{children:[t.jsx(x.pj,{children:t.jsx(o.X,{checked:H.has(e.id),onCheckedChange:()=>ec(e.id),disabled:"active"===e.state,"aria-label":`Select job ${s(e)}`})}),t.jsx(x.pj,{className:"font-medium max-w-[200px] truncate",children:s(e)}),t.jsx(x.pj,{children:e.id}),t.jsx(x.pj,{children:e.attemptsMade}),t.jsx(x.pj,{children:e.timestamp?C.WU(new Date(e.timestamp),"MMM d, yyyy HH:mm:ss"):"N/A"}),t.jsx(x.pj,{children:e.processedOn?C.WU(new Date(e.processedOn),"MMM d, yyyy HH:mm:ss"):"N/A"}),t.jsx(x.pj,{children:e.finishedOn?C.WU(new Date(e.finishedOn),"MMM d, yyyy HH:mm:ss"):"N/A"}),t.jsx(x.pj,{children:e.data?t.jsx("div",{className:"text-xs max-w-[120px] truncate",children:t.jsx(k.J,{text:JSON.stringify(e.data)})}):null}),t.jsx(x.pj,{children:e.failedReason?t.jsx("div",{className:"text-xs text-red-600 max-w-[120px] truncate",children:t.jsx(k.J,{text:"Error: "+e.failedReason})}):t.jsx("div",{className:"text-xs text-muted-foreground max-w-[120px] truncate",children:t.jsx(k.J,{text:JSON.stringify(e.returnvalue)})})}),t.jsxs(x.pj,{className:"text-right",children:["active"!==e.state&&t.jsx(d.z,{variant:"ghost",size:"sm",onClick:()=>en(e),disabled:ee,children:t.jsx(b.Z,{className:"h-4 w-4 text-red-600"})}),"failed"===e.state&&t.jsxs(d.z,{variant:"ghost",size:"sm",onClick:()=>ed(e),children:[t.jsx(N.Z,{className:"h-4 w-4 text-blue-600"}),"Retry"]})]})]},a))})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-2 pb-2",children:[(0,t.jsxs)("div",{className:"flex-1 text-sm text-muted-foreground",children:["(",em?.pageInfo?.itemCount||0," total"," ","items)."]}),t.jsx("div",{className:"flex items-center space-x-6 lg:space-x-8",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsxs)(d.z,{variant:"outline",className:"hidden size-8 p-0 lg:flex",onClick:()=>{J(1),B()},disabled:!em?.pageInfo?.hasPreviousPage,children:[t.jsx("span",{className:"sr-only",children:"Go to first page"}),t.jsx(P.kRt,{className:"size-4"})]}),(0,t.jsxs)(d.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{console.log("itemsData.data?.pageInfo.hasPreviousPage",em?.pageInfo?.hasPreviousPage),J(em?.pageInfo?.hasPreviousPage?em?.pageInfo?.currentPage-1:1),B()},disabled:!em?.pageInfo?.hasPreviousPage,children:[t.jsx("span",{className:"sr-only",children:"Go to previous page"}),t.jsx(v.Z,{className:"size-4"})]}),(0,t.jsxs)(d.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{J(em?.pageInfo?.hasNextPage?em?.pageInfo?.currentPage+1:1),B()},disabled:!em?.pageInfo.hasNextPage,children:[t.jsx("span",{className:"sr-only",children:"Go to next page"}),t.jsx(y.Z,{className:"size-4"})]})]})})]})]})]})]})]}),t.jsx(u.aR,{open:O.length>0,onOpenChange:e=>!e&&A([]),children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:1===O.length?"Delete Job?":`Delete ${O.length} Jobs?`}),t.jsx(u.yT,{children:1===O.length?`Are you sure you want to delete the job "${O[0]?.name}"? This action cannot be undone.`:`Are you sure you want to delete ${O.length} jobs? This action cannot be undone.`})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),(0,t.jsxs)(u.OL,{onClick:eo,disabled:ee,children:[ee&&t.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Delete"]})]})]})}),t.jsx(u.aR,{open:!!$,onOpenChange:e=>!e&&M(null),children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:"Retry Job?"}),(0,t.jsxs)(u.yT,{children:['Are you sure you want to retry the job "',$?.name,'"? This will schedule a new job with the same data.']})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),t.jsx(u.OL,{onClick:()=>{$&&a($)},disabled:ee,children:"Retry"})]})]})}),t.jsx(u.aR,{open:S,onOpenChange:z,children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:"Pause Queue?"}),(0,t.jsxs)(u.yT,{children:["Are you sure you want to pause the ",e," queue? No jobs will be processed until the queue is resumed."]})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),(0,t.jsxs)(u.OL,{onClick:()=>{es({variables:{queue:e}})},disabled:ea,children:[ea&&t.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Pause Queue"]})]})]})}),t.jsx(u.aR,{open:q,onOpenChange:D,children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:"Resume Queue?"}),(0,t.jsxs)(u.yT,{children:["Are you sure you want to resume the ",e," queue?."]})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),(0,t.jsxs)(u.OL,{onClick:()=>{et({variables:{queue:e}})},disabled:el,children:[el&&t.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Resume Queue"]})]})]})}),t.jsx(u.aR,{open:T,onOpenChange:Z,children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:"Drain Queue?"}),(0,t.jsxs)(u.yT,{children:["Are you sure you want to drain the ",e," 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,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),(0,t.jsxs)(u.OL,{onClick:()=>{ei({variables:{queue:e}})},disabled:er,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[er&&t.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Drain Queue"]})]})]})})]})}},57004:(e,s,a)=>{a.a(e,async(e,t)=>{try{a.d(s,{G:()=>f});var l=a(10326),i=a(48644),r=a(93801),n=a(45747),d=a(17577),c=a(94966),o=a(12533),x=a(12428),m=a(47355),u=a(62288),h=a(34789),j=a(77863),p=e([i,r,n]);function f({className:e=null,code:s,language:a,slice:t=200}){let{toast:i}=(0,h.pm)(),[r,n]=(0,d.useState)(null);return(0,l.jsxs)(u.Vq,{children:[l.jsx(u.hg,{asChild:!0,children:r?.length&&l.jsx(c.Z,{className:(0,j.cn)("cursor-pointer",e),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:a||"plaintext",style:m.Z,children:`${r?.slice(0,t||200)} ${r?.length>(t||200)?"...":""}`})}),l.jsx(u.cZ,{className:"sm:max-w-[800px] overflow-hidden max-h-[500px] overflow-y-scroll",children:(0,l.jsxs)(u.fK,{children:[l.jsx(u.$N,{children:"Code"}),l.jsx("div",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(r??""),i({title:"Copied to clipboard"})},children:l.jsx(c.Z,{className:(0,j.cn)(e),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:a||"plaintext",style:m.Z,children:r??""})})]})})]})}[i,r,n]=p.then?(await p)():p,c.Z.registerLanguage("json",x.Z),c.Z.registerLanguage("javascript",o.Z),t()}catch(e){t(e)}})},99440:(e,s,a)=>{a.d(s,{OL:()=>p,_T:()=>x,aR:()=>d,f$:()=>h,fY:()=>m,le:()=>f,xo:()=>u,yT:()=>j});var t=a(10326),l=a(12194),i=a(17577),r=a(90772),n=a(77863);let d=l.fC;l.xz;let c=l.h_,o=i.forwardRef(({className:e,...s},a)=>t.jsx(l.aV,{className:(0,n.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...s,ref:a}));o.displayName=l.aV.displayName;let x=i.forwardRef(({className:e,...s},a)=>(0,t.jsxs)(c,{children:[t.jsx(o,{}),t.jsx(l.VY,{ref:a,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...s})]}));x.displayName=l.VY.displayName;let m=({className:e,...s})=>t.jsx("div",{className:(0,n.cn)("flex flex-col space-y-2 text-center sm:text-left",e),...s});m.displayName="AlertDialogHeader";let u=({className:e,...s})=>t.jsx("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...s});u.displayName="AlertDialogFooter";let h=i.forwardRef(({className:e,...s},a)=>t.jsx(l.Dx,{ref:a,className:(0,n.cn)("text-lg font-semibold",e),...s}));h.displayName=l.Dx.displayName;let j=i.forwardRef(({className:e,...s},a)=>t.jsx(l.dk,{ref:a,className:(0,n.cn)("text-sm text-muted-foreground",e),...s}));j.displayName=l.dk.displayName;let p=i.forwardRef(({className:e,...s},a)=>t.jsx(l.aU,{ref:a,className:(0,n.cn)((0,r.d)(),e),...s}));p.displayName=l.aU.displayName;let f=i.forwardRef(({className:e,...s},a)=>t.jsx(l.$j,{ref:a,className:(0,n.cn)((0,r.d)({variant:"outline"}),"mt-2 sm:mt-0",e),...s}));f.displayName=l.$j.displayName},53313:(e,s,a)=>{a.d(s,{X:()=>d});var t=a(10326),l=a(13635),i=a(32933),r=a(17577),n=a(77863);let d=r.forwardRef(({className:e,...s},a)=>t.jsx(l.fC,{ref:a,className:(0,n.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",e),...s,children:t.jsx(l.z$,{className:(0,n.cn)("flex items-center justify-center text-current"),children:t.jsx(i.Z,{className:"size-4"})})}));d.displayName=l.fC.displayName},15940:(e,s,a)=>{a.d(s,{RM:()=>d,Rn:()=>m,SC:()=>c,iA:()=>r,pj:()=>x,ss:()=>o,xD:()=>n});var t=a(10326),l=a(17577),i=a(77863);let r=l.forwardRef(({className:e,...s},a)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:a,className:(0,i.cn)("w-full caption-bottom text-sm",e),...s})}));r.displayName="Table";let n=l.forwardRef(({className:e,...s},a)=>t.jsx("thead",{ref:a,className:(0,i.cn)("[&_tr]:border-b",e),...s}));n.displayName="TableHeader";let d=l.forwardRef(({className:e,...s},a)=>t.jsx("tbody",{ref:a,className:(0,i.cn)("[&_tr:last-child]:border-0",e),...s}));d.displayName="TableBody",l.forwardRef(({className:e,...s},a)=>t.jsx("tfoot",{ref:a,className:(0,i.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...s})).displayName="TableFooter";let c=l.forwardRef(({className:e,...s},a)=>t.jsx("tr",{ref:a,className:(0,i.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...s}));c.displayName="TableRow";let o=l.forwardRef(({className:e,...s},a)=>t.jsx("th",{ref:a,className:(0,i.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:w-[40px]",e),...s}));o.displayName="TableHead";let x=l.forwardRef(({className:e,...s},a)=>t.jsx("td",{ref:a,className:(0,i.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:w-[40px]",e),...s}));x.displayName="TableCell";let m=l.forwardRef(({className:e,...s},a)=>t.jsx("caption",{ref:a,className:(0,i.cn)("mt-4 text-sm text-muted-foreground",e),...s}));m.displayName="TableCaption"}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=5974,exports.ids=[5974],exports.modules={51602:(e,s,t)=>{t.d(s,{d:()=>u,f:()=>h});var l=t(10326),a=t(90772),n=t(77863),r=t(32933),i=t(43810),o=t(17577),d=t(54390),c=t(35057),m=t(48818);let x=(0,o.createContext)({code:""}),u=({code:e,language:s,showLineNumbers:t=!1,className:a,children:r,...i})=>l.jsx(x.Provider,{value:{code:e},children:l.jsx("div",{className:(0,n.cn)("relative w-full overflow-hidden rounded-md border bg-background text-foreground",a),...i,children:(0,l.jsxs)("div",{className:"relative",children:[l.jsx(d.Z,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:s,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:t,style:c.Z,children:e}),l.jsx(d.Z,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:s,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:t,style:m.Z,children:e}),r&&l.jsx("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:r})]})})}),h=({onCopy:e,onError:s,timeout:t=2e3,children:d,className:c,...m})=>{let[u,h]=(0,o.useState)(!1),{code:p}=(0,o.useContext)(x),g=async()=>{s?.(Error("Clipboard API not available"))},f=u?r.Z:i.Z;return l.jsx(a.z,{className:(0,n.cn)("shrink-0",c),onClick:g,size:"icon",variant:"ghost",...m,children:d??l.jsx(f,{size:14})})}},36931:(e,s,t)=>{t.d(s,{H:()=>u});var l=t(10326),a=t(77863),n=t(17577),r=t(16476),i=t(79283),o=t(70285),d=t(7833),c=t(51602);t(32289);let m=(0,t(39499).Z)(r.UG),x={ol:({node:e,children:s,className:t,...n})=>l.jsx("ol",{className:(0,a.cn)("ml-4 list-outside list-decimal",t),...n,children:s}),li:({node:e,children:s,className:t,...n})=>l.jsx("li",{className:(0,a.cn)("py-1",t),...n,children:s}),ul:({node:e,children:s,className:t,...n})=>l.jsx("ul",{className:(0,a.cn)("ml-4 list-outside list-disc",t),...n,children:s}),hr:({node:e,className:s,...t})=>l.jsx("hr",{className:(0,a.cn)("my-6 border-border",s),...t}),strong:({node:e,children:s,className:t,...n})=>l.jsx("span",{className:(0,a.cn)("font-semibold",t),...n,children:s}),a:({node:e,children:s,className:t,...n})=>l.jsx("a",{className:(0,a.cn)("font-medium text-primary underline",t),rel:"noreferrer",target:"_blank",...n,children:s}),h1:({node:e,children:s,className:t,...n})=>l.jsx("h1",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-3xl",t),...n,children:s}),h2:({node:e,children:s,className:t,...n})=>l.jsx("h2",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-2xl",t),...n,children:s}),h3:({node:e,children:s,className:t,...n})=>l.jsx("h3",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-xl",t),...n,children:s}),h4:({node:e,children:s,className:t,...n})=>l.jsx("h4",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-lg",t),...n,children:s}),h5:({node:e,children:s,className:t,...n})=>l.jsx("h5",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-base",t),...n,children:s}),h6:({node:e,children:s,className:t,...n})=>l.jsx("h6",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-sm",t),...n,children:s}),table:({node:e,children:s,className:t,...n})=>l.jsx("div",{className:"my-4 overflow-x-auto",children:l.jsx("table",{className:(0,a.cn)("w-full border-collapse border border-border",t),...n,children:s})}),thead:({node:e,children:s,className:t,...n})=>l.jsx("thead",{className:(0,a.cn)("bg-muted/50",t),...n,children:s}),tbody:({node:e,children:s,className:t,...n})=>l.jsx("tbody",{className:(0,a.cn)("divide-y divide-border",t),...n,children:s}),tr:({node:e,children:s,className:t,...n})=>l.jsx("tr",{className:(0,a.cn)("border-border border-b",t),...n,children:s}),th:({node:e,children:s,className:t,...n})=>l.jsx("th",{className:(0,a.cn)("px-4 py-2 text-left font-semibold text-sm",t),...n,children:s}),td:({node:e,children:s,className:t,...n})=>l.jsx("td",{className:(0,a.cn)("px-4 py-2 text-sm",t),...n,children:s}),blockquote:({node:e,children:s,className:t,...n})=>l.jsx("blockquote",{className:(0,a.cn)("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),...n,children:s}),code:({node:e,className:s,...t})=>e?.position?.start.line!==e?.position?.end.line?l.jsx("code",{className:s,...t}):l.jsx("code",{className:(0,a.cn)("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",s),...t}),pre:({node:e,className:s,children:t})=>{let r="javascript";"string"==typeof e?.properties?.className&&(r=e.properties.className.replace("language-",""));let i="";return(0,n.isValidElement)(t)&&t.props&&"string"==typeof t.props.children?i=t.props.children:"string"==typeof t&&(i=t),l.jsx(c.d,{className:(0,a.cn)("my-4 h-auto",s),code:i,language:r,children:l.jsx(c.f,{onCopy:()=>console.log("Copied code to clipboard"),onError:()=>console.error("Failed to copy code to clipboard")})})}},u=(0,n.memo)(({className:e,options:s,children:t,allowedImagePrefixes:n,allowedLinkPrefixes:r,defaultOrigin:c,parseIncompleteMarkdown:u=!0,...h})=>{let p="string"==typeof t&&u?function(e){if(!e||"string"!=typeof e)return e;let s=e,t=s.match(/(!?\[)([^\]]*?)$/);if(t){let e=s.lastIndexOf(t[1]);s=s.substring(0,e)}if(s.match(/(\*\*)([^*]*?)$/)&&(s.match(/\*\*/g)||[]).length%2==1&&(s=`${s}**`),s.match(/(__)([^_]*?)$/)&&(s.match(/__/g)||[]).length%2==1&&(s=`${s}__`),s.match(/(\*)([^*]*?)$/)&&s.split("").reduce((e,t,l)=>{if("*"===t){let t=s[l-1],a=s[l+1];if("*"!==t&&"*"!==a)return e+1}return e},0)%2==1&&(s=`${s}*`),s.match(/(_)([^_]*?)$/)&&s.split("").reduce((e,t,l)=>{if("_"===t){let t=s[l-1],a=s[l+1];if("_"!==t&&"_"!==a)return e+1}return e},0)%2==1&&(s=`${s}_`),s.match(/(`)([^`]*?)$/)&&(s.includes("```"),(s.match(/```[\s\S]*?```/g)||[]).length,(s.match(/```/g)||[]).length%2!=1)){let e=0;for(let t=0;t<s.length;t++)if("`"===s[t]){let l="```"===s.substring(t,t+3),a=t>0&&"```"===s.substring(t-1,t+2),n=t>1&&"```"===s.substring(t-2,t+1);!(l||a||n)&&e++}e%2==1&&(s=`${s}\``)}return s.match(/(~~)([^~]*?)$/)&&(s.match(/~~/g)||[]).length%2==1&&(s=`${s}~~`),s}(t):t;return l.jsx("div",{className:(0,a.cn)("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...h,children:l.jsx(m,{allowedImagePrefixes:n??["*"],allowedLinkPrefixes:r??["*"],components:x,defaultOrigin:c,rehypePlugins:[i.Z],remarkPlugins:[o.Z,d.Z],...s,children:p})})},(e,s)=>e.children===s.children);u.displayName="Response"},43273:(e,s,t)=>{t.d(s,{Cd:()=>d,X:()=>c,bZ:()=>o});var l=t(10326),a=t(79360),n=t(17577),r=t(77863);let i=(0,a.j)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",info:"border-info/50 text-info dark:border-info [&>svg]:text-info"}},defaultVariants:{variant:"default"}}),o=n.forwardRef(({className:e,variant:s,...t},a)=>l.jsx("div",{ref:a,role:"alert",className:(0,r.cn)(i({variant:s}),e),...t}));o.displayName="Alert";let d=n.forwardRef(({className:e,...s},t)=>l.jsx("h5",{ref:t,className:(0,r.cn)("mb-1 font-medium leading-none tracking-tight",e),...s}));d.displayName="AlertTitle";let c=n.forwardRef(({className:e,...s},t)=>l.jsx("div",{ref:t,className:(0,r.cn)("text-sm [&_p]:leading-relaxed",e),...s}));c.displayName="AlertDescription"},24295:(e,s,t)=>{t.d(s,{Fw:()=>r,wy:()=>n,zF:()=>a});var l=t(35663);let a=l.fC,n=l.wy,r=l.Fw},79210:(e,s,t)=>{t.d(s,{SP:()=>d,dr:()=>o,mQ:()=>i,nU:()=>c});var l=t(10326),a=t(28407),n=t(17577),r=t(77863);let i=a.fC,o=n.forwardRef(({className:e,...s},t)=>l.jsx(a.aV,{ref:t,className:(0,r.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...s}));o.displayName=a.aV.displayName;let d=n.forwardRef(({className:e,...s},t)=>l.jsx(a.xz,{ref:t,className:(0,r.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...s}));d.displayName=a.xz.displayName;let c=n.forwardRef(({className:e,...s},t)=>l.jsx(a.VY,{ref:t,className:(0,r.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...s}));c.displayName=a.VY.displayName},77961:(e,s,t)=>{t.d(s,{jF:()=>S,jU:()=>W,ZP:()=>F,NF:()=>U});var l=t(10326),a=t(17577);t(32964),t(59946),t(27221);var n=t(59161),r=t(30463);let i=function(e,s=[]){(0,a.useContext)(r.E);let[t,l]=(0,a.useState)(void 0);return t};var o=t(84714),d=t(31540),c=t(15557),m=t(61086),x=t(11890),u=t(39183),h=t(36283),p=t(71709),g=t(39572),f=t(83855),j=t(94019),N=t(3240),b=t(90772),v=t(62288),y=t(65685),w=t(3574),k=t(20108),C=t(10119),Z=t(54432),z=t(76812),_=t(33071),L=t(65304);function S({s3key:e,children:s}){let{data:t,isLoading:a,error:r,refetch:i}=(0,k.a)({queryKey:["fileObject",e],queryFn:async()=>e?await n.QZ.object(e):null,enabled:null!=e});if(!e)return l.jsx(_.Zb,{children:(0,l.jsxs)(_.aY,{className:"p-3 flex",children:[l.jsx("p",{className:"text-sm text-muted-foreground m-auto",children:"No file selected"}),s]})});let o=e,c=e.split("/")[0];return o=(o=e.split("/").slice(1).join("/")).split("_EXULU_").pop()||"",(0,l.jsxs)(_.Zb,{children:[l.jsx(_.Ol,{className:"pb-3",children:l.jsx(_.ll,{className:"text-sm max-w-[500px] truncate",children:o})}),(0,l.jsxs)(_.aY,{className:"pt-0",children:[a&&(0,l.jsxs)("div",{className:"space-y-2",children:[l.jsx(L.O,{className:"h-4 w-full"}),l.jsx(L.O,{className:"h-4 w-2/3"})]}),!a&&t&&(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,l.jsxs)("span",{className:"capitalize",children:[t?.ContentType.split("/").pop(),c&&` Bucket: ${c}`]}),(0,l.jsxs)("span",{children:[(t?.ContentLength/1024/1024).toFixed(2)," MB"]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,l.jsxs)("span",{children:["Last modified: ",new Date(t?.LastModified).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})]}),(0,l.jsxs)(b.z,{variant:"secondary",size:"sm",type:"button",className:"h-7 px-2",onClick:()=>{n.QZ.download(e).then(async e=>{console.log("res",e);let s=await e.json();console.log("res",s);let t=s.url;window.open(t,"_blank")})},children:[l.jsx("span",{className:"mr-1 text-xs",children:"View"}),l.jsx(d.Z,{className:"h-3 w-3"})]})]})]}),!a&&r&&l.jsx("p",{className:"text-xs text-muted-foreground",children:r.message}),s]})]})}function F({id:e,allowedFileTypes:s,dependencies:t,onConfirm:n,selectionLimit:r,buttonText:i}){let[o,d]=(0,a.useState)(!1);return(0,l.jsxs)(v.Vq,{open:o,onOpenChange:d,children:[l.jsx(v.hg,{asChild:!0,children:(0,l.jsxs)(b.z,{variant:"outline",children:[i&&l.jsx("span",{className:"mr-2",children:i}),l.jsx(c.Z,{className:"h-4 w-4"})]})}),(0,l.jsxs)(v.cZ,{className:"sm:max-w-[900px]",children:[(0,l.jsxs)(v.fK,{children:[l.jsx(v.$N,{children:"File Gallery"}),l.jsx(v.Be,{children:"Browse your previously uploaded files or upload new ones."})]}),l.jsx(O,{id:e,allowedFileTypes:s,dependencies:t,selectionLimit:r,onConfirm:e=>{n(e),d(!1)}})]})]})}let O=({id:e,allowedFileTypes:s,dependencies:t,onConfirm:d,selectionLimit:c})=>{s||(s=[".png",".jpg",".jpeg",".gif",".webp",".pdf",".docx",".xlsx",".xls",".csv",".pptx",".ppt",".mp3",".wav",".m4a",".mp4",".mpeg",".mp4",".m4a",".mp3",".mpeg",".wav"]);let[h,p]=(0,a.useState)(void 0),[g,f]=(0,a.useState)(void 0),[j,N]=(0,a.useState)(void 0),v=(0,a.useContext)(r.E),[_,S]=(0,a.useState)([]),F=e=>{if(_.includes(e)){S(_.filter(s=>s!==e));return}if(1===c){S([e]);return}_.length>=c||S([..._,e])},O=(0,C.D)({mutationFn:async({key:e})=>{await n.QZ.delete(e),R()}}),{data:$,isLoading:U,error:P,refetch:R}=(0,k.a)({queryKey:["filesQuery",h,j],staleTime:3e4,queryFn:async()=>n.QZ.list({search:h,continuationToken:j})});console.log("!! data !!",$);let{theme:q}=(0,w.F)(),K=i({backend:v?.backend||"",uppyOptions:{id:e,allowedFileTypes:s},callbacks:{uploadSuccess:async e=>{console.log("data",e)}},maxNumberOfFiles:10},t);return((0,a.useEffect)(()=>{R()},[h,j]),K)?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[(0,l.jsxs)("div",{className:"border rounded-lg p-4",children:[l.jsx("h3",{className:"text-sm font-medium mb-3",children:"Previously Uploaded Files"}),l.jsx(Z.I,{placeholder:"Search files...",value:h,onChange:e=>p(e.target.value),className:"mb-3"}),(0,l.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground pb-2",children:[(0,l.jsxs)("span",{children:[_.length," / ",c," files selected"]}),(0,l.jsxs)("span",{children:["Allowed file types: ",s?.map(e=>e).join(", ")]})]}),(0,l.jsxs)(y.x,{children:[U&&(0,l.jsxs)("div",{className:"flex items-center justify-center h-full w-full grid grid-cols-2 sm:grid-cols-3 gap-3",children:[l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[!U&&!$?.Contents?.length&&(0,l.jsxs)("div",{className:"col-span-full flex flex-col items-center justify-center py-12 text-center",children:[l.jsx(m.Z,{className:"h-12 w-12 text-muted-foreground/50 mb-3"}),l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Nothing to see here... yet!"}),l.jsx("p",{className:"text-xs text-muted-foreground/75 mt-1",children:"Upload some files to get started"})]}),$?.Contents?.map(e=>l.jsx(W,{s3Key:e.Key,onSelect:F,active:_.some(s=>s===e.Key),onRemove:()=>{O.mutate({key:e.Key})},disabled:!!s&&!s?.some(s=>e.Key.endsWith(s))}))]}),l.jsx("div",{className:"flex items-center space-x-6 lg:space-x-8 pt-3",children:(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsxs)(b.z,{variant:"outline",className:"hidden size-8 p-0 lg:flex",onClick:()=>{N(void 0)},disabled:!j||U,children:[l.jsx("span",{className:"sr-only",children:"Go to first page"}),l.jsx(z.kRt,{className:"size-4"})]}),(0,l.jsxs)(b.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{N(g)},disabled:!j||U,children:[l.jsx("span",{className:"sr-only",children:"Go to previous page"}),l.jsx(x.Z,{className:"size-4"})]}),(0,l.jsxs)(b.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{f(j),N($?.NextContinuationToken)},disabled:!$?.NextContinuationToken||U,children:[l.jsx("span",{className:"sr-only",children:"Go to next page"}),l.jsx(u.Z,{className:"size-4"})]})]})})]})]}),(0,l.jsxs)("div",{className:"border rounded-lg p-4",children:[l.jsx("h3",{className:"text-sm font-medium mb-3",children:"Upload New Files"}),l.jsx(o.A,{uppy:K,theme:"dark"===q?"dark":"light"})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(b.z,{variant:"outline",onClick:()=>{d(_),S([])},children:"Confirm"})})]}):null},W=({s3Key:e,onSelect:s,onRemove:t,active:a,disabled:r,addToContext:i})=>{let o;return(0,l.jsxs)("div",{className:`${r?"opacity-50":""} group relative rounded-lg p-2 hover:bg-muted transition-colors cursor-pointer ${a?"border border-purple-500":"border"}`,onClick:()=>{!r&&s&&s(e)},children:[l.jsx("div",{className:"aspect-square relative mb-2 bg-muted/50 rounded-md overflow-hidden flex items-center justify-center",children:e&&(e.toLowerCase().endsWith("jpg")||e.toLowerCase().endsWith("jpeg")||e.toLowerCase().endsWith("png")||e.toLowerCase().endsWith("svg"))?l.jsx(P,{fileKey:e}):(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center h-full",children:[(o=e)?o.toLowerCase().endsWith("jpg")||o.toLowerCase().endsWith("jpeg")||o.toLowerCase().endsWith("png")||o.toLowerCase().endsWith("svg")?l.jsx(p.Z,{className:"h-6 w-6 text-blue-500"}):o.endsWith("pdf")?l.jsx(g.Z,{className:"h-6 w-6 text-red-500"}):o.endsWith("xls")||o.endsWith("xlsx")||o.endsWith("csv")?l.jsx(h.Z,{className:"h-6 w-6 text-green-500"}):o.endsWith("ppt")||o.endsWith("pptx")?l.jsx(h.Z,{className:"h-6 w-6 text-orange-500"}):l.jsx(h.Z,{className:"h-6 w-6 text-gray-500"}):l.jsx(h.Z,{className:"h-6 w-6 text-gray-500"}),l.jsx("span",{className:"text-xs text-muted-foreground mt-1 text-center",children:e?e.split("_EXULU_").pop():e})]})}),l.jsx("p",{className:"text-xs truncate",children:e?e.split("_EXULU_").pop():e}),(0,l.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 flex absolute top-1 right-1",children:[i&&(0,l.jsxs)(b.z,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6 bg-background/80 hover:bg-background",onClick:()=>{i(e)},children:[l.jsx(f.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"Add"})]}),(0,l.jsxs)(b.z,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6 bg-background/80 hover:bg-background",onClick:()=>{n.QZ.download(e).then(async e=>{console.log("res",e);let s=await e.json();console.log("res",s);let t=s.url;window.open(t,"_blank")})},children:[l.jsx(d.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"View"})]}),t&&(0,l.jsxs)(b.z,{onClick:s=>{s.stopPropagation(),t(e)},variant:"ghost",type:"button",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 bg-background/80 hover:bg-background ml-1",children:[l.jsx(j.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"Remove"})]})]})]},e)},$={},U=async e=>{if($[e]){if(!($[e].expiresAt<Date.now()))return $[e].url;delete $[e]}let s=await n.QZ.download(e),t=await s.json();return console.log("json",t),$[e]={url:t.url,expiresAt:Date.now()+6e4},t.url},P=({fileKey:e})=>{console.log("key",e);let s=(0,k.a)({queryKey:["imageQuery",e],staleTime:3e4,queryFn:async()=>U(e)});return s.isLoading?l.jsx("div",{children:l.jsx(N.Z,{})}):s.isLoading||s.data?l.jsx("img",{src:s.data,alt:e,className:"object-cover w-full h-full"}):l.jsx("div",{children:l.jsx(m.Z,{})})}}};
|
|
1
|
+
"use strict";exports.id=5974,exports.ids=[5974],exports.modules={51602:(e,s,t)=>{t.d(s,{d:()=>u,f:()=>h});var l=t(10326),a=t(90772),n=t(77863),r=t(32933),i=t(43810),o=t(17577),d=t(54390),c=t(35057),m=t(48818);let x=(0,o.createContext)({code:""}),u=({code:e,language:s,showLineNumbers:t=!1,className:a,children:r,...i})=>l.jsx(x.Provider,{value:{code:e},children:l.jsx("div",{className:(0,n.cn)("relative w-full overflow-hidden rounded-md border bg-background text-foreground",a),...i,children:(0,l.jsxs)("div",{className:"relative",children:[l.jsx(d.Z,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:s,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:t,style:c.Z,children:e}),l.jsx(d.Z,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:s,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:t,style:m.Z,children:e}),r&&l.jsx("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:r})]})})}),h=({onCopy:e,onError:s,timeout:t=2e3,children:d,className:c,...m})=>{let[u,h]=(0,o.useState)(!1),{code:p}=(0,o.useContext)(x),g=async()=>{s?.(Error("Clipboard API not available"))},f=u?r.Z:i.Z;return l.jsx(a.z,{className:(0,n.cn)("shrink-0",c),onClick:g,size:"icon",variant:"ghost",...m,children:d??l.jsx(f,{size:14})})}},36931:(e,s,t)=>{t.d(s,{H:()=>u});var l=t(10326),a=t(77863),n=t(17577),r=t(16476),i=t(79283),o=t(70285),d=t(7833),c=t(51602);t(32289);let m=(0,t(39499).Z)(r.UG),x={ol:({node:e,children:s,className:t,...n})=>l.jsx("ol",{className:(0,a.cn)("ml-4 list-outside list-decimal",t),...n,children:s}),li:({node:e,children:s,className:t,...n})=>l.jsx("li",{className:(0,a.cn)("py-1",t),...n,children:s}),ul:({node:e,children:s,className:t,...n})=>l.jsx("ul",{className:(0,a.cn)("ml-4 list-outside list-disc",t),...n,children:s}),hr:({node:e,className:s,...t})=>l.jsx("hr",{className:(0,a.cn)("my-6 border-border",s),...t}),strong:({node:e,children:s,className:t,...n})=>l.jsx("span",{className:(0,a.cn)("font-semibold",t),...n,children:s}),a:({node:e,children:s,className:t,...n})=>l.jsx("a",{className:(0,a.cn)("font-medium text-primary underline",t),rel:"noreferrer",target:"_blank",...n,children:s}),h1:({node:e,children:s,className:t,...n})=>l.jsx("h1",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-3xl",t),...n,children:s}),h2:({node:e,children:s,className:t,...n})=>l.jsx("h2",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-2xl",t),...n,children:s}),h3:({node:e,children:s,className:t,...n})=>l.jsx("h3",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-xl",t),...n,children:s}),h4:({node:e,children:s,className:t,...n})=>l.jsx("h4",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-lg",t),...n,children:s}),h5:({node:e,children:s,className:t,...n})=>l.jsx("h5",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-base",t),...n,children:s}),h6:({node:e,children:s,className:t,...n})=>l.jsx("h6",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-sm",t),...n,children:s}),table:({node:e,children:s,className:t,...n})=>l.jsx("div",{className:"my-4 overflow-x-auto",children:l.jsx("table",{className:(0,a.cn)("w-full border-collapse border border-border",t),...n,children:s})}),thead:({node:e,children:s,className:t,...n})=>l.jsx("thead",{className:(0,a.cn)("bg-muted/50",t),...n,children:s}),tbody:({node:e,children:s,className:t,...n})=>l.jsx("tbody",{className:(0,a.cn)("divide-y divide-border",t),...n,children:s}),tr:({node:e,children:s,className:t,...n})=>l.jsx("tr",{className:(0,a.cn)("border-border border-b",t),...n,children:s}),th:({node:e,children:s,className:t,...n})=>l.jsx("th",{className:(0,a.cn)("px-4 py-2 text-left font-semibold text-sm",t),...n,children:s}),td:({node:e,children:s,className:t,...n})=>l.jsx("td",{className:(0,a.cn)("px-4 py-2 text-sm",t),...n,children:s}),blockquote:({node:e,children:s,className:t,...n})=>l.jsx("blockquote",{className:(0,a.cn)("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),...n,children:s}),code:({node:e,className:s,...t})=>e?.position?.start.line!==e?.position?.end.line?l.jsx("code",{className:s,...t}):l.jsx("code",{className:(0,a.cn)("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",s),...t}),pre:({node:e,className:s,children:t})=>{let r="javascript";"string"==typeof e?.properties?.className&&(r=e.properties.className.replace("language-",""));let i="";return(0,n.isValidElement)(t)&&t.props&&"string"==typeof t.props.children?i=t.props.children:"string"==typeof t&&(i=t),l.jsx(c.d,{className:(0,a.cn)("my-4 h-auto",s),code:i,language:r,children:l.jsx(c.f,{onCopy:()=>console.log("Copied code to clipboard"),onError:()=>console.error("Failed to copy code to clipboard")})})}},u=(0,n.memo)(({className:e,options:s,children:t,allowedImagePrefixes:n,allowedLinkPrefixes:r,defaultOrigin:c,parseIncompleteMarkdown:u=!0,...h})=>{let p="string"==typeof t&&u?function(e){if(!e||"string"!=typeof e)return e;let s=e,t=s.match(/(!?\[)([^\]]*?)$/);if(t){let e=s.lastIndexOf(t[1]);s=s.substring(0,e)}if(s.match(/(\*\*)([^*]*?)$/)&&(s.match(/\*\*/g)||[]).length%2==1&&(s=`${s}**`),s.match(/(__)([^_]*?)$/)&&(s.match(/__/g)||[]).length%2==1&&(s=`${s}__`),s.match(/(\*)([^*]*?)$/)&&s.split("").reduce((e,t,l)=>{if("*"===t){let t=s[l-1],a=s[l+1];if("*"!==t&&"*"!==a)return e+1}return e},0)%2==1&&(s=`${s}*`),s.match(/(_)([^_]*?)$/)&&s.split("").reduce((e,t,l)=>{if("_"===t){let t=s[l-1],a=s[l+1];if("_"!==t&&"_"!==a)return e+1}return e},0)%2==1&&(s=`${s}_`),s.match(/(`)([^`]*?)$/)&&(s.includes("```"),(s.match(/```[\s\S]*?```/g)||[]).length,(s.match(/```/g)||[]).length%2!=1)){let e=0;for(let t=0;t<s.length;t++)if("`"===s[t]){let l="```"===s.substring(t,t+3),a=t>0&&"```"===s.substring(t-1,t+2),n=t>1&&"```"===s.substring(t-2,t+1);!(l||a||n)&&e++}e%2==1&&(s=`${s}\``)}return s.match(/(~~)([^~]*?)$/)&&(s.match(/~~/g)||[]).length%2==1&&(s=`${s}~~`),s}(t):t;return l.jsx("div",{className:(0,a.cn)("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...h,children:l.jsx(m,{allowedImagePrefixes:n??["*"],allowedLinkPrefixes:r??["*"],components:x,defaultOrigin:c,rehypePlugins:[i.Z],remarkPlugins:[o.Z,d.Z],...s,children:p})})},(e,s)=>e.children===s.children);u.displayName="Response"},43273:(e,s,t)=>{t.d(s,{Cd:()=>d,X:()=>c,bZ:()=>o});var l=t(10326),a=t(79360),n=t(17577),r=t(77863);let i=(0,a.j)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",info:"border-info/50 text-info dark:border-info [&>svg]:text-info"}},defaultVariants:{variant:"default"}}),o=n.forwardRef(({className:e,variant:s,...t},a)=>l.jsx("div",{ref:a,role:"alert",className:(0,r.cn)(i({variant:s}),e),...t}));o.displayName="Alert";let d=n.forwardRef(({className:e,...s},t)=>l.jsx("h5",{ref:t,className:(0,r.cn)("mb-1 font-medium leading-none tracking-tight",e),...s}));d.displayName="AlertTitle";let c=n.forwardRef(({className:e,...s},t)=>l.jsx("div",{ref:t,className:(0,r.cn)("text-sm [&_p]:leading-relaxed",e),...s}));c.displayName="AlertDescription"},24295:(e,s,t)=>{t.d(s,{Fw:()=>r,wy:()=>n,zF:()=>a});var l=t(35663);let a=l.fC,n=l.wy,r=l.Fw},79210:(e,s,t)=>{t.d(s,{SP:()=>d,dr:()=>o,mQ:()=>i,nU:()=>c});var l=t(10326),a=t(28407),n=t(17577),r=t(77863);let i=a.fC,o=n.forwardRef(({className:e,...s},t)=>l.jsx(a.aV,{ref:t,className:(0,r.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...s}));o.displayName=a.aV.displayName;let d=n.forwardRef(({className:e,...s},t)=>l.jsx(a.xz,{ref:t,className:(0,r.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...s}));d.displayName=a.xz.displayName;let c=n.forwardRef(({className:e,...s},t)=>l.jsx(a.VY,{ref:t,className:(0,r.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...s}));c.displayName=a.VY.displayName},77961:(e,s,t)=>{t.d(s,{jF:()=>S,jU:()=>W,ZP:()=>F,NF:()=>U});var l=t(10326),a=t(17577);t(32964),t(59946),t(27221);var n=t(59161),r=t(30463);let i=function(e,s=[]){(0,a.useContext)(r.E);let[t,l]=(0,a.useState)(void 0);return t};var o=t(84714),d=t(31540),c=t(15557),m=t(61086),x=t(11890),u=t(39183),h=t(36283),p=t(71709),g=t(39572),f=t(83855),j=t(94019),N=t(3240),b=t(90772),v=t(62288),y=t(65685),w=t(3574),k=t(20108),C=t(10119),Z=t(54432),z=t(76812),_=t(33071),L=t(65304);function S({s3key:e,children:s}){let{data:t,isLoading:a,error:r,refetch:i}=(0,k.a)({queryKey:["fileObject",e],queryFn:async()=>e?await n.QZ.object(e):null,enabled:null!=e});if(!e)return l.jsx(_.Zb,{children:(0,l.jsxs)(_.aY,{className:"p-3 flex",children:[l.jsx("p",{className:"text-sm text-muted-foreground m-auto",children:"No file selected"}),s]})});let o=e,c=e.split("/")[0];return o=(o=e.split("/").slice(1).join("/")).split("_EXULU_").pop()||"",console.log("s3Key",e),(0,l.jsxs)(_.Zb,{children:[l.jsx(_.Ol,{className:"pb-3",children:l.jsx(_.ll,{className:"text-sm max-w-[500px] truncate",children:o})}),(0,l.jsxs)(_.aY,{className:"pt-0",children:[a&&(0,l.jsxs)("div",{className:"space-y-2",children:[l.jsx(L.O,{className:"h-4 w-full"}),l.jsx(L.O,{className:"h-4 w-2/3"})]}),!a&&t&&(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,l.jsxs)("span",{className:"capitalize",children:[t?.ContentType.split("/").pop(),c&&` Bucket: ${c}`]}),(0,l.jsxs)("span",{children:[(t?.ContentLength/1024/1024).toFixed(2)," MB"]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,l.jsxs)("span",{children:["Last modified: ",new Date(t?.LastModified).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})]}),(0,l.jsxs)(b.z,{variant:"secondary",size:"sm",type:"button",className:"h-7 px-2",onClick:()=>{n.QZ.download(e).then(async e=>{console.log("res",e);let s=await e.json();console.log("res",s);let t=s.url;window.open(t,"_blank")})},children:[l.jsx("span",{className:"mr-1 text-xs",children:"View"}),l.jsx(d.Z,{className:"h-3 w-3"})]})]})]}),!a&&r&&l.jsx("p",{className:"text-xs text-muted-foreground",children:r.message}),s]})]})}function F({id:e,allowedFileTypes:s,dependencies:t,onConfirm:n,selectionLimit:r,buttonText:i}){let[o,d]=(0,a.useState)(!1);return(0,l.jsxs)(v.Vq,{open:o,onOpenChange:d,children:[l.jsx(v.hg,{asChild:!0,children:(0,l.jsxs)(b.z,{variant:"outline",children:[i&&l.jsx("span",{className:"mr-2",children:i}),l.jsx(c.Z,{className:"h-4 w-4"})]})}),(0,l.jsxs)(v.cZ,{className:"sm:max-w-[900px]",children:[(0,l.jsxs)(v.fK,{children:[l.jsx(v.$N,{children:"File Gallery"}),l.jsx(v.Be,{children:"Browse your previously uploaded files or upload new ones."})]}),l.jsx(O,{id:e,allowedFileTypes:s,dependencies:t,selectionLimit:r,onConfirm:e=>{n(e),d(!1)}})]})]})}let O=({id:e,allowedFileTypes:s,dependencies:t,onConfirm:d,selectionLimit:c})=>{s||(s=[".png",".jpg",".jpeg",".gif",".webp",".pdf",".docx",".xlsx",".xls",".csv",".pptx",".ppt",".mp3",".wav",".m4a",".mp4",".mpeg",".mp4",".m4a",".mp3",".mpeg",".wav"]);let[h,p]=(0,a.useState)(void 0),[g,f]=(0,a.useState)(void 0),[j,N]=(0,a.useState)(void 0),v=(0,a.useContext)(r.E),[_,S]=(0,a.useState)([]),F=e=>{if(_.includes(e)){S(_.filter(s=>s!==e));return}if(1===c){S([e]);return}_.length>=c||S([..._,e])},O=(0,C.D)({mutationFn:async({key:e})=>{await n.QZ.delete(e),R()}}),{data:$,isLoading:U,error:P,refetch:R}=(0,k.a)({queryKey:["filesQuery",h,j],staleTime:3e4,queryFn:async()=>n.QZ.list({search:h,continuationToken:j})});console.log("!! data !!",$);let{theme:K}=(0,w.F)(),q=i({backend:v?.backend||"",uppyOptions:{id:e,allowedFileTypes:s},callbacks:{uploadSuccess:async e=>{console.log("data",e)}},maxNumberOfFiles:10},t);return((0,a.useEffect)(()=>{R()},[h,j]),q)?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[(0,l.jsxs)("div",{className:"border rounded-lg p-4",children:[l.jsx("h3",{className:"text-sm font-medium mb-3",children:"Previously Uploaded Files"}),l.jsx(Z.I,{placeholder:"Search files...",value:h,onChange:e=>p(e.target.value),className:"mb-3"}),(0,l.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground pb-2",children:[(0,l.jsxs)("span",{children:[_.length," / ",c," files selected"]}),(0,l.jsxs)("span",{children:["Allowed file types: ",s?.map(e=>e).join(", ")]})]}),(0,l.jsxs)(y.x,{children:[U&&(0,l.jsxs)("div",{className:"flex items-center justify-center h-full w-full grid grid-cols-2 sm:grid-cols-3 gap-3",children:[l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"}),l.jsx(L.O,{className:"h-[120px] w-full"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[!U&&!$?.Contents?.length&&(0,l.jsxs)("div",{className:"col-span-full flex flex-col items-center justify-center py-12 text-center",children:[l.jsx(m.Z,{className:"h-12 w-12 text-muted-foreground/50 mb-3"}),l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Nothing to see here... yet!"}),l.jsx("p",{className:"text-xs text-muted-foreground/75 mt-1",children:"Upload some files to get started"})]}),$?.Contents?.map(e=>l.jsx(W,{s3Key:e.Key,onSelect:F,active:_.some(s=>s===e.Key),onRemove:()=>{O.mutate({key:e.Key})},disabled:!!s&&!s?.some(s=>e.Key.endsWith(s))}))]}),l.jsx("div",{className:"flex items-center space-x-6 lg:space-x-8 pt-3",children:(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsxs)(b.z,{variant:"outline",className:"hidden size-8 p-0 lg:flex",onClick:()=>{N(void 0)},disabled:!j||U,children:[l.jsx("span",{className:"sr-only",children:"Go to first page"}),l.jsx(z.kRt,{className:"size-4"})]}),(0,l.jsxs)(b.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{N(g)},disabled:!j||U,children:[l.jsx("span",{className:"sr-only",children:"Go to previous page"}),l.jsx(x.Z,{className:"size-4"})]}),(0,l.jsxs)(b.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{f(j),N($?.NextContinuationToken)},disabled:!$?.NextContinuationToken||U,children:[l.jsx("span",{className:"sr-only",children:"Go to next page"}),l.jsx(u.Z,{className:"size-4"})]})]})})]})]}),(0,l.jsxs)("div",{className:"border rounded-lg p-4",children:[l.jsx("h3",{className:"text-sm font-medium mb-3",children:"Upload New Files"}),l.jsx(o.A,{uppy:q,theme:"dark"===K?"dark":"light"})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(b.z,{variant:"outline",onClick:()=>{d(_),S([])},children:"Confirm"})})]}):null},W=({s3Key:e,onSelect:s,onRemove:t,active:a,disabled:r,addToContext:i})=>{let o;return(0,l.jsxs)("div",{className:`${r?"opacity-50":""} group relative rounded-lg p-2 hover:bg-muted transition-colors cursor-pointer ${a?"border border-purple-500":"border"}`,onClick:()=>{!r&&s&&s(e)},children:[l.jsx("div",{className:"aspect-square relative mb-2 bg-muted/50 rounded-md overflow-hidden flex items-center justify-center",children:e&&(e.toLowerCase().endsWith("jpg")||e.toLowerCase().endsWith("jpeg")||e.toLowerCase().endsWith("png")||e.toLowerCase().endsWith("svg"))?l.jsx(P,{fileKey:e}):(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center h-full",children:[(o=e)?o.toLowerCase().endsWith("jpg")||o.toLowerCase().endsWith("jpeg")||o.toLowerCase().endsWith("png")||o.toLowerCase().endsWith("svg")?l.jsx(p.Z,{className:"h-6 w-6 text-blue-500"}):o.endsWith("pdf")?l.jsx(g.Z,{className:"h-6 w-6 text-red-500"}):o.endsWith("xls")||o.endsWith("xlsx")||o.endsWith("csv")?l.jsx(h.Z,{className:"h-6 w-6 text-green-500"}):o.endsWith("ppt")||o.endsWith("pptx")?l.jsx(h.Z,{className:"h-6 w-6 text-orange-500"}):l.jsx(h.Z,{className:"h-6 w-6 text-gray-500"}):l.jsx(h.Z,{className:"h-6 w-6 text-gray-500"}),l.jsx("span",{className:"text-xs text-muted-foreground mt-1 text-center",children:e?e.split("_EXULU_").pop():e})]})}),l.jsx("p",{className:"text-xs truncate",children:e?e.split("_EXULU_").pop():e}),(0,l.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 flex absolute top-1 right-1",children:[i&&(0,l.jsxs)(b.z,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6 bg-background/80 hover:bg-background",onClick:()=>{i(e)},children:[l.jsx(f.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"Add"})]}),(0,l.jsxs)(b.z,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6 bg-background/80 hover:bg-background",onClick:()=>{n.QZ.download(e).then(async e=>{console.log("res",e);let s=await e.json();console.log("res",s);let t=s.url;window.open(t,"_blank")})},children:[l.jsx(d.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"View"})]}),t&&(0,l.jsxs)(b.z,{onClick:s=>{s.stopPropagation(),t(e)},variant:"ghost",type:"button",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 bg-background/80 hover:bg-background ml-1",children:[l.jsx(j.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"Remove"})]})]})]},e)},$={},U=async e=>{if($[e]){if(!($[e].expiresAt<Date.now()))return $[e].url;delete $[e]}let s=await n.QZ.download(e),t=await s.json();return console.log("json",t),$[e]={url:t.url,expiresAt:Date.now()+6e4},t.url},P=({fileKey:e})=>{console.log("key",e);let s=(0,k.a)({queryKey:["imageQuery",e],staleTime:3e4,queryFn:async()=>U(e)});return s.isLoading?l.jsx("div",{children:l.jsx(N.Z,{})}):s.isLoading||s.data?l.jsx("img",{src:s.data,alt:e,className:"object-cover w-full h-full"}):l.jsx("div",{children:l.jsx(m.Z,{})})}}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
exports.id=7944,exports.ids=[7944],exports.modules={44006:(e,a,t)=>{Promise.resolve().then(t.bind(t,15211)),Promise.resolve().then(t.bind(t,75983)),Promise.resolve().then(t.bind(t,30463)),Promise.resolve().then(t.bind(t,15813)),Promise.resolve().then(t.bind(t,77083))},15211:(e,a,t)=>{"use strict";t.d(a,{S:()=>eu,default:()=>ep});var s=t(10326),r=t(8164),i=t(46874),n=t(89919),d=t(50126),o=t(99592),l=t(39790),c=t(77109),u=t(17577),f=t(90434),p=t(35047),m=t(34214),h=t(79360),b=t(9664),x=t(13854),g=t(77863),v=t(90772),w=t(54432),j=t(8281),N=t(7890),y=t(65304),k=t(68232);let z=u.createContext(null);function _(){let e=u.useContext(z);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}let S=u.forwardRef(({defaultOpen:e=!0,open:a,onOpenChange:t,className:r,style:i,children:n,...d},o)=>{let l=(0,x.d)(),[c,f]=u.useState(!1),[p,m]=u.useState(e),h=a??p,b=u.useCallback(e=>{let a="function"==typeof e?e(h):e;t?t(a):m(a),document.cookie=`sidebar_state=${a}; path=/; max-age=604800`},[t,h]),v=u.useCallback(()=>l?f(e=>!e):b(e=>!e),[l,b,f]);u.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[v]);let w=h?"expanded":"collapsed",j=u.useMemo(()=>({state:w,open:h,setOpen:b,isMobile:l,openMobile:c,setOpenMobile:f,toggleSidebar:v}),[w,h,b,l,c,f,v]);return s.jsx(z.Provider,{value:j,children:s.jsx(k.pn,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":"16rem","--sidebar-width-icon":"3rem",...i},className:(0,g.cn)("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:o,...d,children:n})})})});S.displayName="SidebarProvider";let C=u.forwardRef(({side:e="left",variant:a="sidebar",collapsible:t="offcanvas",className:r,children:i,...n},d)=>{let{isMobile:o,state:l,openMobile:c,setOpenMobile:u}=_();return"none"===t?s.jsx("div",{className:(0,g.cn)("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:d,...n,children:i}):o?s.jsx(N.yo,{open:c,onOpenChange:u,...n,children:(0,s.jsxs)(N.ue,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":"18rem"},side:e,children:[(0,s.jsxs)(N.Tu,{className:"sr-only",children:[s.jsx(N.bC,{children:"Sidebar"}),s.jsx(N.Ei,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):(0,s.jsxs)("div",{ref:d,className:"group peer hidden text-sidebar-foreground md:block","data-state":l,"data-collapsible":"collapsed"===l?t:"","data-variant":a,"data-side":e,children:[s.jsx("div",{className:(0,g.cn)("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===a||"inset"===a?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),s.jsx("div",{className:(0,g.cn)("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex","left"===e?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===a||"inset"===a?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...n,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:i})})]})});C.displayName="Sidebar";let R=u.forwardRef(({className:e,onClick:a,...t},r)=>{let{toggleSidebar:i}=_();return(0,s.jsxs)(v.z,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:(0,g.cn)("h-7 w-7",e),onClick:e=>{a?.(e),i()},...t,children:[s.jsx(b.Z,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});R.displayName="SidebarTrigger",u.forwardRef(({className:e,...a},t)=>{let{toggleSidebar:r}=_();return s.jsx("button",{ref:t,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:(0,g.cn)("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...a})}).displayName="SidebarRail",u.forwardRef(({className:e,...a},t)=>s.jsx("main",{ref:t,className:(0,g.cn)("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...a})).displayName="SidebarInset",u.forwardRef(({className:e,...a},t)=>s.jsx(w.I,{ref:t,"data-sidebar":"input",className:(0,g.cn)("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...a})).displayName="SidebarInput",u.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,"data-sidebar":"header",className:(0,g.cn)("flex flex-col gap-2 p-2",e),...a})).displayName="SidebarHeader";let E=u.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,"data-sidebar":"footer",className:(0,g.cn)("flex flex-col gap-2 p-2",e),...a}));E.displayName="SidebarFooter",u.forwardRef(({className:e,...a},t)=>s.jsx(j.Z,{ref:t,"data-sidebar":"separator",className:(0,g.cn)("mx-2 w-auto bg-sidebar-border",e),...a})).displayName="SidebarSeparator";let Z=u.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,"data-sidebar":"content",className:(0,g.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...a}));Z.displayName="SidebarContent";let $=u.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,"data-sidebar":"group",className:(0,g.cn)("relative flex w-full min-w-0 flex-col p-0",e),...a}));$.displayName="SidebarGroup",u.forwardRef(({className:e,asChild:a=!1,...t},r)=>{let i=a?m.g7:"div";return s.jsx(i,{ref:r,"data-sidebar":"group-label",className:(0,g.cn)("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...t})}).displayName="SidebarGroupLabel",u.forwardRef(({className:e,asChild:a=!1,...t},r)=>{let i=a?m.g7:"button";return s.jsx(i,{ref:r,"data-sidebar":"group-action",className:(0,g.cn)("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...t})}).displayName="SidebarGroupAction";let T=u.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,"data-sidebar":"group-content",className:(0,g.cn)("w-full text-sm",e),...a}));T.displayName="SidebarGroupContent";let O=u.forwardRef(({className:e,...a},t)=>s.jsx("ul",{ref:t,"data-sidebar":"menu",className:(0,g.cn)("flex w-full min-w-0 flex-col gap-1",e),...a}));O.displayName="SidebarMenu";let P=u.forwardRef(({className:e,...a},t)=>s.jsx("li",{ref:t,"data-sidebar":"menu-item",className:(0,g.cn)("group/menu-item relative",e),...a}));P.displayName="SidebarMenuItem";let A=(0,h.j)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-[0.40rem] [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),D=u.forwardRef(({asChild:e=!1,isActive:a=!1,variant:t="default",size:r="default",tooltip:i,className:n,...d},o)=>{let l=e?m.g7:"button",{isMobile:c,state:u}=_(),f=s.jsx(l,{ref:o,"data-sidebar":"menu-button","data-size":r,"data-active":a,className:(0,g.cn)(A({variant:t,size:r}),n),...d});return i?("string"==typeof i&&(i={children:i}),(0,s.jsxs)(k.u,{children:[s.jsx(k.aJ,{asChild:!0,children:f}),s.jsx(k._v,{side:"right",align:"center",hidden:"collapsed"!==u||c,...i})]})):f});D.displayName="SidebarMenuButton",u.forwardRef(({className:e,asChild:a=!1,showOnHover:t=!1,...r},i)=>{let n=a?m.g7:"button";return s.jsx(n,{ref:i,"data-sidebar":"menu-action",className:(0,g.cn)("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r})}).displayName="SidebarMenuAction",u.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,"data-sidebar":"menu-badge",className:(0,g.cn)("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...a})).displayName="SidebarMenuBadge",u.forwardRef(({className:e,showIcon:a=!1,...t},r)=>{let i=u.useMemo(()=>`${Math.floor(40*Math.random())+50}%`,[]);return(0,s.jsxs)("div",{ref:r,"data-sidebar":"menu-skeleton",className:(0,g.cn)("flex h-8 items-center gap-2 rounded-md px-2",e),...t,children:[a&&s.jsx(y.O,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(y.O,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})}).displayName="SidebarMenuSkeleton",u.forwardRef(({className:e,...a},t)=>s.jsx("ul",{ref:t,"data-sidebar":"menu-sub",className:(0,g.cn)("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...a})).displayName="SidebarMenuSub",u.forwardRef(({...e},a)=>s.jsx("li",{ref:a,...e})).displayName="SidebarMenuSubItem",u.forwardRef(({asChild:e=!1,size:a="md",isActive:t,className:r,...i},n)=>{let d=e?m.g7:"a";return s.jsx(d,{ref:n,"data-sidebar":"menu-sub-button","data-size":a,"data-active":t,className:(0,g.cn)("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground","sm"===a&&"text-xs","md"===a&&"text-sm","group-data-[collapsible=icon]:hidden",r),...i})}).displayName="SidebarMenuSubButton";var B=t(60097),M=t(24319),L=t(88319),V=t(50732),I=t(28932),K=t(39730),U=t(8707),q=t(98360),G=t(24061),Y=t(76828),F=t(32105),H=t(52216),J=t(88378),Q=t(1572),W=t(96633),X=t(60850),ee=t(72607),ea=t(71810),et=t(3574),es=t(28758),er=t(2424);let ei=(e,a)=>{let t=[];return e.super_admin&&t.push({label:"Dashboard",path:"dashboard",icon:s.jsx(M.Z,{})}),t.push({label:"Knowledge",path:"data",icon:s.jsx(L.Z,{})}),(e.super_admin||"write"===a.agents)&&t.push({label:"Agents",path:"agents",icon:s.jsx(V.Z,{})}),t.push({label:"Projects",path:"projects",icon:s.jsx(I.Z,{})}),t.push({label:"Chat",path:"chat",icon:s.jsx(K.Z,{})}),t.push({label:"Prompts",path:"prompts",icon:s.jsx(U.Z,{})}),(e.super_admin||"read"===a.evals||"write"===a.evals)&&t.push({label:"Evals",path:"evals",icon:s.jsx(q.Z,{})}),(e.super_admin||"write"===a.users)&&t.push({label:"Users",path:"users",icon:s.jsx(G.Z,{})}),(e.super_admin||"write"===a.api)&&t.push({label:"Keys",path:"keys",icon:s.jsx(Y.Z,{})}),(e.super_admin||"write"===a.variables)&&t.push({label:"Variables",path:"variables",icon:s.jsx(F.Z,{})}),(e.super_admin||"write"===a.api)&&t.push({label:"API",path:"explorer",icon:s.jsx(H.Z,{})}),e.super_admin&&t.push({label:"Theme",path:"configuration",icon:s.jsx(J.Z,{})}),t};function en({items:e}){let a=(0,p.usePathname)();return s.jsx(O,{className:"space-y-1",children:e.map((e,t)=>{let r=a.includes(e.path);return s.jsx(P,{children:s.jsx(D,{asChild:!0,isActive:r,tooltip:e.label,className:(0,g.cn)("h-10 transition-all duration-200"),children:(0,s.jsxs)(f.default,{href:`/${e.path}`,className:"flex items-center gap-3",children:[s.jsx("div",{className:(0,g.cn)("flex h-5 w-5 items-center justify-center transition-colors"),children:e.icon}),s.jsx("span",{className:(0,g.cn)("font-medium transition-colors"),children:e.label})]})})},t)})})}function ed({sidebarDefaultOpen:e}){let{user:a}=(0,u.useContext)(eu),t=ei(a,a.role),r=(0,p.useRouter)(),{setTheme:i,theme:n}=(0,et.F)();return(0,p.useParams)(),_(),(0,s.jsxs)(C,{collapsible:"icon",className:"border-r",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 border-b bg-background/80 backdrop-blur-sm p-[12px] sticky top-0 z-10",children:[s.jsx(R,{}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(er.default,{alt:"Logo",width:100,height:40})})]}),s.jsx(Z,{className:"px-2",children:s.jsx($,{className:"mt-4",children:s.jsx(T,{children:s.jsx(en,{items:t})})})}),(0,s.jsxs)(E,{className:"border-t bg-muted/20 p-[5px]",children:[s.jsx("div",{className:"px-2 pb-1 group-data-[collapsible=icon]:hidden",children:(0,s.jsxs)("div",{className:"inline-flex items-center gap-1.5 rounded-full border border-primary/20 bg-primary/5 px-2.5 py-0.5",children:[s.jsx(Q.Z,{className:"h-3 w-3 text-primary"}),s.jsx("span",{className:"text-xs font-medium text-primary",children:"Beta"})]})}),s.jsx(O,{children:s.jsx(P,{children:(0,s.jsxs)(B.h_,{modal:!1,children:[s.jsx(B.$F,{asChild:!0,children:(0,s.jsxs)(D,{className:"h-12 hover:bg-accent/50",children:[s.jsx(es.qE,{className:"h-5 w-5",children:s.jsx(es.Q5,{className:"bg-gradient-to-br from-primary/20 to-primary/60 text-white text-sm",children:a.email.charAt(0).toUpperCase()})}),(0,s.jsxs)("div",{className:"flex flex-col items-start group-data-[collapsible=icon]:hidden",children:[s.jsx("span",{className:"text-sm font-medium capitalize",children:a.email.split("@")[0]}),s.jsx("div",{className:"flex items-center gap-1",children:s.jsx("span",{className:"text-xs text-muted-foreground",children:a.email.split("@")[1]})})]}),s.jsx(W.Z,{className:"ml-auto h-4 w-4 group-data-[collapsible=icon]:hidden"})]})}),(0,s.jsxs)(B.AW,{side:"top",className:"w-[--radix-popper-anchor-width] mb-2",align:"start",children:[s.jsx(B.Xi,{onClick:()=>i("dark"===n?"light":"dark"),children:(0,s.jsxs)("div",{className:"flex items-center gap-2 w-full",children:["dark"===n?s.jsx(X.Z,{className:"h-4 w-4"}):s.jsx(ee.Z,{className:"h-4 w-4"}),s.jsx("span",{children:"Theme"})]})}),s.jsx(B.Xi,{onClick:()=>r.push("/api/auth/signout"),children:(0,s.jsxs)("div",{className:"flex items-center gap-2 w-full",children:[s.jsx(ea.Z,{className:"h-4 w-4"}),s.jsx("span",{children:"Logout"})]})})]})]})})})]})]})}function eo({children:e,sidebarDefaultOpen:a}){return console.log("sidebarDefaultOpen",a),s.jsx(S,{defaultOpen:a,children:(0,s.jsxs)("div",{className:"flex w-full bg-background overflow-hidden",children:[s.jsx(ed,{sidebarDefaultOpen:a}),s.jsx("main",{className:"flex-1 overflow-auto",children:e})]})})}var el=t(59161),ec=t(30463);let eu=u.createContext(null),ef=({children:e,user:a,sidebarDefaultOpen:t})=>s.jsx(eu.Provider,{value:{user:a},children:s.jsx(eo,{sidebarDefaultOpen:t,children:e})}),ep=({children:e,user:a,sidebarDefaultOpen:t})=>{let f=u.useContext(ec.E),p=f?.backend?f?.backend+"/graphql":"http://localhost:9001/graphql",m=(0,l.v)((e,a)=>({headers:{Accept:"charset=utf-8"}})),h=(0,l.v)(async(e,a)=>{let t=await (0,el.LP)();return{headers:{Authorization:`Bearer ${t}`}}}),b=r.i.from([m,h,new i.u({uri:p})]),x=new n.f({uri:p,cache:new d.h({addTypename:!1}),link:b,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}});return s.jsx(o.e,{client:x,children:s.jsx(c.SessionProvider,{children:s.jsx(ef,{sidebarDefaultOpen:t,user:a,children:e})})})}},28758:(e,a,t)=>{"use strict";t.d(a,{Q5:()=>o,qE:()=>d});var s=t(10326),r=t(42851),i=t(17577),n=t(77863);let d=i.forwardRef(({className:e,...a},t)=>s.jsx(r.fC,{ref:t,className:(0,n.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...a}));d.displayName=r.fC.displayName,i.forwardRef(({className:e,...a},t)=>s.jsx(r.Ee,{ref:t,className:(0,n.cn)("aspect-square h-full w-full",e),...a})).displayName=r.Ee.displayName;let o=i.forwardRef(({className:e,...a},t)=>s.jsx(r.NY,{ref:t,className:(0,n.cn)("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...a}));o.displayName=r.NY.displayName},60097:(e,a,t)=>{"use strict";t.d(a,{$F:()=>u,AW:()=>p,Ju:()=>x,VD:()=>g,Xi:()=>m,_x:()=>f,bO:()=>h,h_:()=>c,qB:()=>b});var s=t(10326),r=t(79313),i=t(39183),n=t(32933),d=t(53982),o=t(17577),l=t(77863);let c=r.fC,u=r.xz;r.ZA,r.Uv,r.Tr;let f=r.Ee;o.forwardRef(({className:e,inset:a,children:t,...n},d)=>(0,s.jsxs)(r.fF,{ref:d,className:(0,l.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",a&&"pl-8",e),...n,children:[t,s.jsx(i.Z,{className:"ml-auto size-4"})]})).displayName=r.fF.displayName,o.forwardRef(({className:e,...a},t)=>s.jsx(r.tu,{ref:t,className:(0,l.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})).displayName=r.tu.displayName;let p=o.forwardRef(({className:e,sideOffset:a=4,...t},i)=>s.jsx(r.Uv,{children:s.jsx(r.VY,{ref:i,sideOffset:a,className:(0,l.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));p.displayName=r.VY.displayName;let m=o.forwardRef(({className:e,inset:a,...t},i)=>s.jsx(r.ck,{ref:i,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",e),...t}));m.displayName=r.ck.displayName;let h=o.forwardRef(({className:e,children:a,checked:t,...i},d)=>(0,s.jsxs)(r.oC,{ref:d,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:t,...i,children:[s.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:s.jsx(r.wU,{children:s.jsx(n.Z,{className:"size-4"})})}),a]}));h.displayName=r.oC.displayName;let b=o.forwardRef(({className:e,children:a,...t},i)=>(0,s.jsxs)(r.Rk,{ref:i,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t,children:[s.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:s.jsx(r.wU,{children:s.jsx(d.Z,{className:"size-2 fill-current"})})}),a]}));b.displayName=r.Rk.displayName;let x=o.forwardRef(({className:e,inset:a,...t},i)=>s.jsx(r.__,{ref:i,className:(0,l.cn)("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",e),...t}));x.displayName=r.__.displayName;let g=o.forwardRef(({className:e,...a},t)=>s.jsx(r.Z0,{ref:t,className:(0,l.cn)("-mx-1 my-1 h-px bg-muted",e),...a}));g.displayName=r.Z0.displayName},8281:(e,a,t)=>{"use strict";t.d(a,{Z:()=>d});var s=t(10326),r=t(90220),i=t(17577),n=t(77863);let d=i.forwardRef(({className:e,orientation:a="horizontal",decorative:t=!0,...i},d)=>s.jsx(r.f,{ref:d,decorative:t,orientation:a,className:(0,n.cn)("shrink-0 bg-border","horizontal"===a?"h-[1px] w-full":"h-full w-[1px]",e),...i}));d.displayName=r.f.displayName},7890:(e,a,t)=>{"use strict";t.d(a,{Ei:()=>x,Tu:()=>h,aM:()=>c,bC:()=>b,ue:()=>m,yo:()=>l});var s=t(10326),r=t(98986),i=t(79360),n=t(94019),d=t(17577),o=t(77863);let l=r.fC,c=r.xz;r.x8;let u=r.h_,f=d.forwardRef(({className:e,...a},t)=>s.jsx(r.aV,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...a,ref:t}));f.displayName=r.aV.displayName;let p=(0,i.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),m=d.forwardRef(({side:e="right",className:a,children:t,...i},d)=>(0,s.jsxs)(u,{children:[s.jsx(f,{}),(0,s.jsxs)(r.VY,{ref:d,className:(0,o.cn)(p({side:e}),a),...i,children:[t,(0,s.jsxs)(r.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[s.jsx(n.Z,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=r.VY.displayName;let h=({className:e,...a})=>s.jsx("div",{className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",e),...a});h.displayName="SheetHeader";let b=d.forwardRef(({className:e,...a},t)=>s.jsx(r.Dx,{ref:t,className:(0,o.cn)("text-lg font-semibold text-foreground",e),...a}));b.displayName=r.Dx.displayName;let x=d.forwardRef(({className:e,...a},t)=>s.jsx(r.dk,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",e),...a}));x.displayName=r.dk.displayName},65304:(e,a,t)=>{"use strict";t.d(a,{O:()=>i});var s=t(10326),r=t(77863);function i({className:e,...a}){return s.jsx("div",{className:(0,r.cn)("animate-pulse rounded-md bg-muted",e),...a})}},68232:(e,a,t)=>{"use strict";t.d(a,{_v:()=>c,aJ:()=>l,pn:()=>d,u:()=>o});var s=t(10326),r=t(45677),i=t(17577),n=t(77863);let d=r.zt,o=r.fC,l=r.xz,c=i.forwardRef(({className:e,sideOffset:a=4,...t},i)=>s.jsx(r.VY,{ref:i,sideOffset:a,className:(0,n.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));c.displayName=r.VY.displayName},13854:(e,a,t)=>{"use strict";t.d(a,{d:()=>r});var s=t(17577);function r(){let[e,a]=s.useState(void 0);return s.useEffect(()=>{let e=window.matchMedia("(max-width: 767px)"),t=()=>{a(window.innerWidth<768)};return e.addEventListener("change",t),a(window.innerWidth<768),()=>e.removeEventListener("change",t)},[]),!!e}},59161:(e,a,t)=>{"use strict";t.d(a,{DQ:()=>n,LP:()=>i,QZ:()=>d});var s=t(77109);let r=async()=>{{let e=process.env.BACKEND;if(!e)throw Error("No backend set.");return{files:e,base:e}}},i=async()=>{let e=await (0,s.getSession)();return e?.user?.jwt},n={image:{generate:async e=>{let a=await r(),t=`${a.base}/generate/agent/image`,s=await i();if(!s)throw Error("No valid session token available.");return fetch(t,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}})}}},d={object:async e=>{let a=await r(),t=`${a.files}/s3/object`,s=await i();return(await fetch(t,{method:"POST",body:JSON.stringify({key:e}),headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}})).json()},list:async({search:e,continuationToken:a})=>{let t=await r(),s=`${t.files}/s3/list`,n=await i();if(!n)throw Error("No valid session token available.");return e&&(s+=`?search=${e}`),a&&(s+=`?continuationToken=${a}`),(await fetch(s,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}})).json()},download:async e=>{let a=await r(),t=`${a.files}/s3/download?key=${e}`,s=await i();if(!s)throw Error("No valid session token available.");return fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}})},delete:async e=>{let a=await r(),t=`${a.files}/s3/delete?key=${e}`,s=await i();if(!s)throw Error("No valid session token available.");return fetch(t,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}})}}},2009:(e,a,t)=>{"use strict";t.d(a,{Z:()=>r});var s=t(68570);(0,s.createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/authenticated.tsx#UserContext`);let r=(0,s.createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/authenticated.tsx#default`)},71197:(e,a,t)=>{"use strict";t.a(e,async(e,s)=>{try{t.r(a),t.d(a,{default:()=>x});var r=t(19510);t(67272);var i=t(53254);t(71159);var n=t(50650),d=t(71615),o=t(58585),l=t(10296),c=t(64640),u=t(2009),f=t(23067),p=t(29375),m=t(14796),h=t(47252),b=e([p]);async function x({children:e}){let a=await (0,d.cookies)(),t=a.get("sidebar_state")?.value==="true",s=(0,d.headers)().get("x-next-pathname")||"/",b=await (0,p.x)();if(!b)return(0,o.redirect)(`/login${s?`?destination=${s}`:""}`);let x=await h.vc.backend();console.log("[EXULU] backend",x);let g=await x.json(),v={backend:process.env.BACKEND||"",google_client_id:process.env.GOOGLE_CLIENT_ID||"",auth_mode:process.env.AUTH_MODE||"",...g},w=await h.vc.theme();return(0,r.jsxs)("html",{lang:"en",suppressHydrationWarning:!0,children:[(0,r.jsxs)("head",{children:[r.jsx("link",{rel:"icon",href:process.env.BACKEND+"/icon_16x16.png",type:"image/png",sizes:"16x16"}),r.jsx("link",{rel:"icon",href:process.env.BACKEND+"/icon_32x32.png",type:"image/png",sizes:"32x32"}),r.jsx("link",{rel:"icon",href:process.env.BACKEND+"/icon_48x48.png",type:"image/png",sizes:"48x48"}),r.jsx("link",{rel:"icon",href:process.env.BACKEND+"/icon_512x512.png",type:"image/png",sizes:"512x512"}),r.jsx("style",{dangerouslySetInnerHTML:{__html:`
|
|
1
|
+
exports.id=7944,exports.ids=[7944],exports.modules={44006:(e,a,t)=>{Promise.resolve().then(t.bind(t,15211)),Promise.resolve().then(t.bind(t,75983)),Promise.resolve().then(t.bind(t,30463)),Promise.resolve().then(t.bind(t,15813)),Promise.resolve().then(t.bind(t,77083))},15211:(e,a,t)=>{"use strict";t.d(a,{S:()=>eu,default:()=>ep});var s=t(10326),r=t(8164),i=t(46874),n=t(89919),d=t(50126),o=t(99592),l=t(39790),c=t(77109),u=t(17577),f=t(90434),p=t(35047),m=t(34214),h=t(79360),b=t(9664),x=t(13854),g=t(77863),v=t(90772),w=t(54432),j=t(8281),N=t(7890),y=t(65304),k=t(68232);let z=u.createContext(null);function _(){let e=u.useContext(z);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}let S=u.forwardRef(({defaultOpen:e=!0,open:a,onOpenChange:t,className:r,style:i,children:n,...d},o)=>{let l=(0,x.d)(),[c,f]=u.useState(!1),[p,m]=u.useState(e),h=a??p,b=u.useCallback(e=>{let a="function"==typeof e?e(h):e;t?t(a):m(a),document.cookie=`sidebar_state=${a}; path=/; max-age=604800`},[t,h]),v=u.useCallback(()=>l?f(e=>!e):b(e=>!e),[l,b,f]);u.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[v]);let w=h?"expanded":"collapsed",j=u.useMemo(()=>({state:w,open:h,setOpen:b,isMobile:l,openMobile:c,setOpenMobile:f,toggleSidebar:v}),[w,h,b,l,c,f,v]);return s.jsx(z.Provider,{value:j,children:s.jsx(k.pn,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":"16rem","--sidebar-width-icon":"3rem",...i},className:(0,g.cn)("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:o,...d,children:n})})})});S.displayName="SidebarProvider";let C=u.forwardRef(({side:e="left",variant:a="sidebar",collapsible:t="offcanvas",className:r,children:i,...n},d)=>{let{isMobile:o,state:l,openMobile:c,setOpenMobile:u}=_();return"none"===t?s.jsx("div",{className:(0,g.cn)("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:d,...n,children:i}):o?s.jsx(N.yo,{open:c,onOpenChange:u,...n,children:(0,s.jsxs)(N.ue,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":"18rem"},side:e,children:[(0,s.jsxs)(N.Tu,{className:"sr-only",children:[s.jsx(N.bC,{children:"Sidebar"}),s.jsx(N.Ei,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):(0,s.jsxs)("div",{ref:d,className:"group peer hidden text-sidebar-foreground md:block","data-state":l,"data-collapsible":"collapsed"===l?t:"","data-variant":a,"data-side":e,children:[s.jsx("div",{className:(0,g.cn)("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===a||"inset"===a?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),s.jsx("div",{className:(0,g.cn)("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex","left"===e?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===a||"inset"===a?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...n,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:i})})]})});C.displayName="Sidebar";let R=u.forwardRef(({className:e,onClick:a,...t},r)=>{let{toggleSidebar:i}=_();return(0,s.jsxs)(v.z,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:(0,g.cn)("h-7 w-7",e),onClick:e=>{a?.(e),i()},...t,children:[s.jsx(b.Z,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});R.displayName="SidebarTrigger",u.forwardRef(({className:e,...a},t)=>{let{toggleSidebar:r}=_();return s.jsx("button",{ref:t,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:(0,g.cn)("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...a})}).displayName="SidebarRail",u.forwardRef(({className:e,...a},t)=>s.jsx("main",{ref:t,className:(0,g.cn)("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...a})).displayName="SidebarInset",u.forwardRef(({className:e,...a},t)=>s.jsx(w.I,{ref:t,"data-sidebar":"input",className:(0,g.cn)("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...a})).displayName="SidebarInput",u.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,"data-sidebar":"header",className:(0,g.cn)("flex flex-col gap-2 p-2",e),...a})).displayName="SidebarHeader";let E=u.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,"data-sidebar":"footer",className:(0,g.cn)("flex flex-col gap-2 p-2",e),...a}));E.displayName="SidebarFooter",u.forwardRef(({className:e,...a},t)=>s.jsx(j.Z,{ref:t,"data-sidebar":"separator",className:(0,g.cn)("mx-2 w-auto bg-sidebar-border",e),...a})).displayName="SidebarSeparator";let Z=u.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,"data-sidebar":"content",className:(0,g.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...a}));Z.displayName="SidebarContent";let $=u.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,"data-sidebar":"group",className:(0,g.cn)("relative flex w-full min-w-0 flex-col p-0",e),...a}));$.displayName="SidebarGroup",u.forwardRef(({className:e,asChild:a=!1,...t},r)=>{let i=a?m.g7:"div";return s.jsx(i,{ref:r,"data-sidebar":"group-label",className:(0,g.cn)("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...t})}).displayName="SidebarGroupLabel",u.forwardRef(({className:e,asChild:a=!1,...t},r)=>{let i=a?m.g7:"button";return s.jsx(i,{ref:r,"data-sidebar":"group-action",className:(0,g.cn)("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...t})}).displayName="SidebarGroupAction";let T=u.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,"data-sidebar":"group-content",className:(0,g.cn)("w-full text-sm",e),...a}));T.displayName="SidebarGroupContent";let O=u.forwardRef(({className:e,...a},t)=>s.jsx("ul",{ref:t,"data-sidebar":"menu",className:(0,g.cn)("flex w-full min-w-0 flex-col gap-1",e),...a}));O.displayName="SidebarMenu";let P=u.forwardRef(({className:e,...a},t)=>s.jsx("li",{ref:t,"data-sidebar":"menu-item",className:(0,g.cn)("group/menu-item relative",e),...a}));P.displayName="SidebarMenuItem";let A=(0,h.j)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-[0.40rem] [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),D=u.forwardRef(({asChild:e=!1,isActive:a=!1,variant:t="default",size:r="default",tooltip:i,className:n,...d},o)=>{let l=e?m.g7:"button",{isMobile:c,state:u}=_(),f=s.jsx(l,{ref:o,"data-sidebar":"menu-button","data-size":r,"data-active":a,className:(0,g.cn)(A({variant:t,size:r}),n),...d});return i?("string"==typeof i&&(i={children:i}),(0,s.jsxs)(k.u,{children:[s.jsx(k.aJ,{asChild:!0,children:f}),s.jsx(k._v,{side:"right",align:"center",hidden:"collapsed"!==u||c,...i})]})):f});D.displayName="SidebarMenuButton",u.forwardRef(({className:e,asChild:a=!1,showOnHover:t=!1,...r},i)=>{let n=a?m.g7:"button";return s.jsx(n,{ref:i,"data-sidebar":"menu-action",className:(0,g.cn)("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r})}).displayName="SidebarMenuAction",u.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,"data-sidebar":"menu-badge",className:(0,g.cn)("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...a})).displayName="SidebarMenuBadge",u.forwardRef(({className:e,showIcon:a=!1,...t},r)=>{let i=u.useMemo(()=>`${Math.floor(40*Math.random())+50}%`,[]);return(0,s.jsxs)("div",{ref:r,"data-sidebar":"menu-skeleton",className:(0,g.cn)("flex h-8 items-center gap-2 rounded-md px-2",e),...t,children:[a&&s.jsx(y.O,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(y.O,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})}).displayName="SidebarMenuSkeleton",u.forwardRef(({className:e,...a},t)=>s.jsx("ul",{ref:t,"data-sidebar":"menu-sub",className:(0,g.cn)("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...a})).displayName="SidebarMenuSub",u.forwardRef(({...e},a)=>s.jsx("li",{ref:a,...e})).displayName="SidebarMenuSubItem",u.forwardRef(({asChild:e=!1,size:a="md",isActive:t,className:r,...i},n)=>{let d=e?m.g7:"a";return s.jsx(d,{ref:n,"data-sidebar":"menu-sub-button","data-size":a,"data-active":t,className:(0,g.cn)("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground","sm"===a&&"text-xs","md"===a&&"text-sm","group-data-[collapsible=icon]:hidden",r),...i})}).displayName="SidebarMenuSubButton";var B=t(60097),M=t(24319),L=t(88319),V=t(50732),I=t(28932),U=t(39730),K=t(8707),q=t(98360),G=t(24061),Y=t(76828),F=t(32105),H=t(52216),J=t(88378),Q=t(1572),W=t(96633),X=t(60850),ee=t(72607),ea=t(71810),et=t(3574),es=t(28758),er=t(2424);let ei=(e,a)=>{let t=[];return e.super_admin&&t.push({label:"Dashboard",path:"dashboard",icon:s.jsx(M.Z,{})}),t.push({label:"Knowledge",path:"data",icon:s.jsx(L.Z,{})}),(e.super_admin||"write"===a.agents)&&t.push({label:"Agents",path:"agents",icon:s.jsx(V.Z,{})}),t.push({label:"Projects",path:"projects",icon:s.jsx(I.Z,{})}),t.push({label:"Chat",path:"chat",icon:s.jsx(U.Z,{})}),t.push({label:"Prompts",path:"prompts",icon:s.jsx(K.Z,{})}),(e.super_admin||"read"===a.evals||"write"===a.evals)&&t.push({label:"Evals",path:"evals",icon:s.jsx(q.Z,{})}),(e.super_admin||"write"===a.users)&&t.push({label:"Users",path:"users",icon:s.jsx(G.Z,{})}),(e.super_admin||"write"===a.api)&&t.push({label:"Keys",path:"keys",icon:s.jsx(Y.Z,{})}),(e.super_admin||"write"===a.variables)&&t.push({label:"Variables",path:"variables",icon:s.jsx(F.Z,{})}),(e.super_admin||"write"===a.api)&&t.push({label:"API",path:"explorer",icon:s.jsx(H.Z,{})}),e.super_admin&&t.push({label:"Theme",path:"configuration",icon:s.jsx(J.Z,{})}),t};function en({items:e}){let a=(0,p.usePathname)();return s.jsx(O,{className:"space-y-1",children:e.map((e,t)=>{let r=a.includes(e.path);return s.jsx(P,{children:s.jsx(D,{asChild:!0,isActive:r,tooltip:e.label,className:(0,g.cn)("h-10 transition-all duration-200"),children:(0,s.jsxs)(f.default,{href:`/${e.path}`,className:"flex items-center gap-3",children:[s.jsx("div",{className:(0,g.cn)("flex h-5 w-5 items-center justify-center transition-colors"),children:e.icon}),s.jsx("span",{className:(0,g.cn)("font-medium transition-colors"),children:e.label})]})})},t)})})}function ed({sidebarDefaultOpen:e}){let{user:a}=(0,u.useContext)(eu),t=ei(a,a.role),r=(0,p.useRouter)(),{setTheme:i,theme:n}=(0,et.F)();return(0,p.useParams)(),_(),(0,s.jsxs)(C,{collapsible:"icon",className:"border-r",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 border-b bg-background/80 backdrop-blur-sm p-[12px] sticky top-0 z-10",children:[s.jsx(R,{}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(er.default,{alt:"Logo",width:100,height:40})})]}),s.jsx(Z,{className:"px-2",children:s.jsx($,{className:"mt-4",children:s.jsx(T,{children:s.jsx(en,{items:t})})})}),(0,s.jsxs)(E,{className:"border-t bg-muted/20 p-[5px]",children:[s.jsx("div",{className:"px-2 pb-1 group-data-[collapsible=icon]:hidden",children:(0,s.jsxs)("div",{className:"inline-flex items-center gap-1.5 rounded-full border border-primary/20 bg-primary/5 px-2.5 py-0.5",children:[s.jsx(Q.Z,{className:"h-3 w-3 text-primary"}),s.jsx("span",{className:"text-xs font-medium text-primary",children:"Beta"})]})}),s.jsx(O,{children:s.jsx(P,{children:(0,s.jsxs)(B.h_,{modal:!1,children:[s.jsx(B.$F,{asChild:!0,children:(0,s.jsxs)(D,{className:"h-12 hover:bg-accent/50",children:[s.jsx(es.qE,{className:"h-5 w-5",children:s.jsx(es.Q5,{className:"bg-gradient-to-br from-primary/20 to-primary/60 text-white text-sm",children:a.email.charAt(0).toUpperCase()})}),(0,s.jsxs)("div",{className:"flex flex-col items-start group-data-[collapsible=icon]:hidden",children:[s.jsx("span",{className:"text-sm font-medium capitalize",children:a.email.split("@")[0]}),s.jsx("div",{className:"flex items-center gap-1",children:s.jsx("span",{className:"text-xs text-muted-foreground",children:a.email.split("@")[1]})})]}),s.jsx(W.Z,{className:"ml-auto h-4 w-4 group-data-[collapsible=icon]:hidden"})]})}),(0,s.jsxs)(B.AW,{side:"top",className:"w-[--radix-popper-anchor-width] mb-2",align:"start",children:[s.jsx(B.Xi,{onClick:()=>i("dark"===n?"light":"dark"),children:(0,s.jsxs)("div",{className:"flex items-center gap-2 w-full",children:["dark"===n?s.jsx(X.Z,{className:"h-4 w-4"}):s.jsx(ee.Z,{className:"h-4 w-4"}),s.jsx("span",{children:"Theme"})]})}),s.jsx(B.Xi,{onClick:()=>r.push("/api/auth/signout"),children:(0,s.jsxs)("div",{className:"flex items-center gap-2 w-full",children:[s.jsx(ea.Z,{className:"h-4 w-4"}),s.jsx("span",{children:"Logout"})]})})]})]})})})]})]})}function eo({children:e,sidebarDefaultOpen:a}){return console.log("sidebarDefaultOpen",a),s.jsx(S,{defaultOpen:a,children:(0,s.jsxs)("div",{className:"flex w-full bg-background overflow-hidden",children:[s.jsx(ed,{sidebarDefaultOpen:a}),s.jsx("main",{className:"flex-1 overflow-auto",children:e})]})})}var el=t(59161),ec=t(30463);let eu=u.createContext(null),ef=({children:e,user:a,sidebarDefaultOpen:t})=>s.jsx(eu.Provider,{value:{user:a},children:s.jsx(eo,{sidebarDefaultOpen:t,children:e})}),ep=({children:e,user:a,sidebarDefaultOpen:t})=>{let f=u.useContext(ec.E),p=f?.backend?f?.backend+"/graphql":"http://localhost:9001/graphql",m=(0,l.v)((e,a)=>({headers:{Accept:"charset=utf-8"}})),h=(0,l.v)(async(e,a)=>{let t=await (0,el.LP)();return{headers:{Authorization:`Bearer ${t}`}}}),b=r.i.from([m,h,new i.u({uri:p})]),x=new n.f({uri:p,cache:new d.h({addTypename:!1}),link:b,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}});return s.jsx(o.e,{client:x,children:s.jsx(c.SessionProvider,{children:s.jsx(ef,{sidebarDefaultOpen:t,user:a,children:e})})})}},28758:(e,a,t)=>{"use strict";t.d(a,{Q5:()=>o,qE:()=>d});var s=t(10326),r=t(42851),i=t(17577),n=t(77863);let d=i.forwardRef(({className:e,...a},t)=>s.jsx(r.fC,{ref:t,className:(0,n.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...a}));d.displayName=r.fC.displayName,i.forwardRef(({className:e,...a},t)=>s.jsx(r.Ee,{ref:t,className:(0,n.cn)("aspect-square h-full w-full",e),...a})).displayName=r.Ee.displayName;let o=i.forwardRef(({className:e,...a},t)=>s.jsx(r.NY,{ref:t,className:(0,n.cn)("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...a}));o.displayName=r.NY.displayName},60097:(e,a,t)=>{"use strict";t.d(a,{$F:()=>u,AW:()=>p,Ju:()=>x,VD:()=>g,Xi:()=>m,_x:()=>f,bO:()=>h,h_:()=>c,qB:()=>b});var s=t(10326),r=t(79313),i=t(39183),n=t(32933),d=t(53982),o=t(17577),l=t(77863);let c=r.fC,u=r.xz;r.ZA,r.Uv,r.Tr;let f=r.Ee;o.forwardRef(({className:e,inset:a,children:t,...n},d)=>(0,s.jsxs)(r.fF,{ref:d,className:(0,l.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",a&&"pl-8",e),...n,children:[t,s.jsx(i.Z,{className:"ml-auto size-4"})]})).displayName=r.fF.displayName,o.forwardRef(({className:e,...a},t)=>s.jsx(r.tu,{ref:t,className:(0,l.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})).displayName=r.tu.displayName;let p=o.forwardRef(({className:e,sideOffset:a=4,...t},i)=>s.jsx(r.Uv,{children:s.jsx(r.VY,{ref:i,sideOffset:a,className:(0,l.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));p.displayName=r.VY.displayName;let m=o.forwardRef(({className:e,inset:a,...t},i)=>s.jsx(r.ck,{ref:i,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",e),...t}));m.displayName=r.ck.displayName;let h=o.forwardRef(({className:e,children:a,checked:t,...i},d)=>(0,s.jsxs)(r.oC,{ref:d,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:t,...i,children:[s.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:s.jsx(r.wU,{children:s.jsx(n.Z,{className:"size-4"})})}),a]}));h.displayName=r.oC.displayName;let b=o.forwardRef(({className:e,children:a,...t},i)=>(0,s.jsxs)(r.Rk,{ref:i,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t,children:[s.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:s.jsx(r.wU,{children:s.jsx(d.Z,{className:"size-2 fill-current"})})}),a]}));b.displayName=r.Rk.displayName;let x=o.forwardRef(({className:e,inset:a,...t},i)=>s.jsx(r.__,{ref:i,className:(0,l.cn)("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",e),...t}));x.displayName=r.__.displayName;let g=o.forwardRef(({className:e,...a},t)=>s.jsx(r.Z0,{ref:t,className:(0,l.cn)("-mx-1 my-1 h-px bg-muted",e),...a}));g.displayName=r.Z0.displayName},8281:(e,a,t)=>{"use strict";t.d(a,{Z:()=>d});var s=t(10326),r=t(90220),i=t(17577),n=t(77863);let d=i.forwardRef(({className:e,orientation:a="horizontal",decorative:t=!0,...i},d)=>s.jsx(r.f,{ref:d,decorative:t,orientation:a,className:(0,n.cn)("shrink-0 bg-border","horizontal"===a?"h-[1px] w-full":"h-full w-[1px]",e),...i}));d.displayName=r.f.displayName},7890:(e,a,t)=>{"use strict";t.d(a,{Ei:()=>x,Tu:()=>h,aM:()=>c,bC:()=>b,ue:()=>m,yo:()=>l});var s=t(10326),r=t(98986),i=t(79360),n=t(94019),d=t(17577),o=t(77863);let l=r.fC,c=r.xz;r.x8;let u=r.h_,f=d.forwardRef(({className:e,...a},t)=>s.jsx(r.aV,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...a,ref:t}));f.displayName=r.aV.displayName;let p=(0,i.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),m=d.forwardRef(({side:e="right",className:a,children:t,...i},d)=>(0,s.jsxs)(u,{children:[s.jsx(f,{}),(0,s.jsxs)(r.VY,{ref:d,className:(0,o.cn)(p({side:e}),a),...i,children:[t,(0,s.jsxs)(r.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[s.jsx(n.Z,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=r.VY.displayName;let h=({className:e,...a})=>s.jsx("div",{className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",e),...a});h.displayName="SheetHeader";let b=d.forwardRef(({className:e,...a},t)=>s.jsx(r.Dx,{ref:t,className:(0,o.cn)("text-lg font-semibold text-foreground",e),...a}));b.displayName=r.Dx.displayName;let x=d.forwardRef(({className:e,...a},t)=>s.jsx(r.dk,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",e),...a}));x.displayName=r.dk.displayName},65304:(e,a,t)=>{"use strict";t.d(a,{O:()=>i});var s=t(10326),r=t(77863);function i({className:e,...a}){return s.jsx("div",{className:(0,r.cn)("animate-pulse rounded-md bg-muted",e),...a})}},68232:(e,a,t)=>{"use strict";t.d(a,{_v:()=>c,aJ:()=>l,pn:()=>d,u:()=>o});var s=t(10326),r=t(45677),i=t(17577),n=t(77863);let d=r.zt,o=r.fC,l=r.xz,c=i.forwardRef(({className:e,sideOffset:a=4,...t},i)=>s.jsx(r.VY,{ref:i,sideOffset:a,className:(0,n.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));c.displayName=r.VY.displayName},13854:(e,a,t)=>{"use strict";t.d(a,{d:()=>r});var s=t(17577);function r(){let[e,a]=s.useState(void 0);return s.useEffect(()=>{let e=window.matchMedia("(max-width: 767px)"),t=()=>{a(window.innerWidth<768)};return e.addEventListener("change",t),a(window.innerWidth<768),()=>e.removeEventListener("change",t)},[]),!!e}},59161:(e,a,t)=>{"use strict";t.d(a,{DQ:()=>n,LP:()=>i,QZ:()=>d});var s=t(77109);let r=async()=>{{let e=process.env.BACKEND;if(!e)throw Error("No backend set.");return{files:e,base:e}}},i=async()=>{let e=await (0,s.getSession)();return e?.user?.jwt},n={image:{generate:async e=>{let a=await r(),t=`${a.base}/generate/agent/image`,s=await i();if(!s)throw Error("No valid session token available.");return fetch(t,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}})}}},d={object:async e=>{let a=await r(),t=`${a.files}/s3/object`,s=await i();return(await fetch(t,{method:"POST",body:JSON.stringify({key:e}),headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}})).json()},list:async({search:e,continuationToken:a})=>{let t=await r(),s=`${t.files}/s3/list`,n=await i();if(!n)throw Error("No valid session token available.");return e&&(s+=`?search=${e}`),a&&(s+=`?continuationToken=${a}`),(await fetch(s,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}})).json()},download:async e=>{let a=await r(),t=`${a.files}/s3/download?key=${encodeURIComponent(e)}`,s=await i();if(!s)throw Error("No valid session token available.");return fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}})},delete:async e=>{let a=await r(),t=`${a.files}/s3/delete?key=${e}`,s=await i();if(!s)throw Error("No valid session token available.");return fetch(t,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}})}}},2009:(e,a,t)=>{"use strict";t.d(a,{Z:()=>r});var s=t(68570);(0,s.createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/authenticated.tsx#UserContext`);let r=(0,s.createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/authenticated.tsx#default`)},71197:(e,a,t)=>{"use strict";t.a(e,async(e,s)=>{try{t.r(a),t.d(a,{default:()=>x});var r=t(19510);t(67272);var i=t(53254);t(71159);var n=t(50650),d=t(71615),o=t(58585),l=t(10296),c=t(64640),u=t(2009),f=t(23067),p=t(29375),m=t(14796),h=t(47252),b=e([p]);async function x({children:e}){let a=await (0,d.cookies)(),t=a.get("sidebar_state")?.value==="true",s=(0,d.headers)().get("x-next-pathname")||"/",b=await (0,p.x)();if(!b)return(0,o.redirect)(`/login${s?`?destination=${s}`:""}`);let x=await h.vc.backend();console.log("[EXULU] backend",x);let g=await x.json(),v={backend:process.env.BACKEND||"",google_client_id:process.env.GOOGLE_CLIENT_ID||"",auth_mode:process.env.AUTH_MODE||"",...g},w=await h.vc.theme();return(0,r.jsxs)("html",{lang:"en",suppressHydrationWarning:!0,children:[(0,r.jsxs)("head",{children:[r.jsx("link",{rel:"icon",href:process.env.BACKEND+"/icon_16x16.png",type:"image/png",sizes:"16x16"}),r.jsx("link",{rel:"icon",href:process.env.BACKEND+"/icon_32x32.png",type:"image/png",sizes:"32x32"}),r.jsx("link",{rel:"icon",href:process.env.BACKEND+"/icon_48x48.png",type:"image/png",sizes:"48x48"}),r.jsx("link",{rel:"icon",href:process.env.BACKEND+"/icon_512x512.png",type:"image/png",sizes:"512x512"}),r.jsx("style",{dangerouslySetInnerHTML:{__html:`
|
|
2
2
|
:root {
|
|
3
3
|
${Object.entries(w.light||{}).map(([e,a])=>`${e}: ${a};`).join("\n")}
|
|
4
4
|
}
|