@exulu/frontend 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/.next/BUILD_ID +1 -1
  2. package/dist/.next/app-build-manifest.json +98 -99
  3. package/dist/.next/app-path-routes-manifest.json +1 -1
  4. package/dist/.next/build-manifest.json +2 -2
  5. package/dist/.next/prerender-manifest.json +1 -1
  6. package/dist/.next/server/app/(application)/agents/edit/[id]/page_client-reference-manifest.js +1 -1
  7. package/dist/.next/server/app/(application)/agents/page_client-reference-manifest.js +1 -1
  8. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js +1 -1
  9. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page_client-reference-manifest.js +1 -1
  10. package/dist/.next/server/app/(application)/chat/[agent]/page_client-reference-manifest.js +1 -1
  11. package/dist/.next/server/app/(application)/chat/page_client-reference-manifest.js +1 -1
  12. package/dist/.next/server/app/(application)/configuration/page_client-reference-manifest.js +1 -1
  13. package/dist/.next/server/app/(application)/dashboard/page_client-reference-manifest.js +1 -1
  14. package/dist/.next/server/app/(application)/data/[[...query]]/page.js +3 -3
  15. package/dist/.next/server/app/(application)/data/[[...query]]/page.js.nft.json +1 -1
  16. package/dist/.next/server/app/(application)/data/[[...query]]/page_client-reference-manifest.js +1 -1
  17. package/dist/.next/server/app/(application)/evals/[id]/page.js +1 -1
  18. package/dist/.next/server/app/(application)/evals/[id]/page.js.nft.json +1 -1
  19. package/dist/.next/server/app/(application)/evals/[id]/page_client-reference-manifest.js +1 -1
  20. package/dist/.next/server/app/(application)/evals/cases/page_client-reference-manifest.js +1 -1
  21. package/dist/.next/server/app/(application)/evals/page_client-reference-manifest.js +1 -1
  22. package/dist/.next/server/app/(application)/explorer/page_client-reference-manifest.js +1 -1
  23. package/dist/.next/server/app/(application)/keys/page_client-reference-manifest.js +1 -1
  24. package/dist/.next/server/app/(application)/page_client-reference-manifest.js +1 -1
  25. package/dist/.next/server/app/(application)/projects/[project]/page_client-reference-manifest.js +1 -1
  26. package/dist/.next/server/app/(application)/projects/page_client-reference-manifest.js +1 -1
  27. package/dist/.next/server/app/(application)/prompts/page_client-reference-manifest.js +1 -1
  28. package/dist/.next/server/app/(application)/roles/page_client-reference-manifest.js +1 -1
  29. package/dist/.next/server/app/(application)/token/page_client-reference-manifest.js +1 -1
  30. package/dist/.next/server/app/(application)/users/page_client-reference-manifest.js +1 -1
  31. package/dist/.next/server/app/(application)/variables/create/page_client-reference-manifest.js +1 -1
  32. package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page_client-reference-manifest.js +1 -1
  33. package/dist/.next/server/app/(application)/variables/page_client-reference-manifest.js +1 -1
  34. package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page_client-reference-manifest.js +1 -1
  35. package/dist/.next/server/app/(application)/workflows/page_client-reference-manifest.js +1 -1
  36. package/dist/.next/server/app/(authentication)/login/page_client-reference-manifest.js +1 -1
  37. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  38. package/dist/.next/server/app/_not-found.html +1 -1
  39. package/dist/.next/server/app/_not-found.rsc +1 -1
  40. package/dist/.next/server/app/api/auth/[...nextauth]/route.js +2 -2
  41. package/dist/.next/server/app-paths-manifest.json +4 -4
  42. package/dist/.next/server/chunks/1051.js +2 -2
  43. package/dist/.next/server/chunks/2270.js +1 -0
  44. package/dist/.next/server/chunks/2948.js +1 -1
  45. package/dist/.next/server/chunks/3434.js +1 -1
  46. package/dist/.next/server/chunks/3575.js +1 -1
  47. package/dist/.next/server/chunks/5485.js +1 -0
  48. package/dist/.next/server/chunks/8050.js +1 -1
  49. package/dist/.next/server/middleware-manifest.json +5 -5
  50. package/dist/.next/server/pages/404.html +1 -1
  51. package/dist/.next/server/pages/500.html +1 -1
  52. package/dist/.next/server/server-reference-manifest.json +1 -1
  53. package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js +2 -0
  54. package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js.map +1 -0
  55. package/dist/.next/static/chunks/1957-39a01a3915f246ab.js +2 -0
  56. package/dist/.next/static/chunks/1957-39a01a3915f246ab.js.map +1 -0
  57. package/dist/.next/static/chunks/{3750-90a213a3c7cceb29.js → 3750-f45c59ef1cc79417.js} +2 -2
  58. package/dist/.next/static/chunks/3750-f45c59ef1cc79417.js.map +1 -0
  59. package/dist/.next/static/chunks/{7856-9fa733bdd6429ba8.js → 6066-65606593516b2a3a.js} +18 -18
  60. package/dist/.next/static/chunks/6066-65606593516b2a3a.js.map +1 -0
  61. package/dist/.next/static/chunks/{6373-7908bd5269f95aa3.js → 6373-4c5dffaf4193621c.js} +2 -2
  62. package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js.map +1 -0
  63. package/dist/.next/static/chunks/9105-dfbce1bad8e3e8dd.js +2 -0
  64. package/dist/.next/static/chunks/9105-dfbce1bad8e3e8dd.js.map +1 -0
  65. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/{page-29794b9c33d2bf7e.js → page-4e7e02768ed1a72a.js} +2 -2
  66. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js.map +1 -0
  67. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js +2 -0
  68. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js.map +1 -0
  69. package/dist/.next/static/chunks/app/(application)/chat/layout-093baa26f89338bc.js +2 -0
  70. package/dist/.next/static/chunks/app/(application)/chat/layout-093baa26f89338bc.js.map +1 -0
  71. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js +2 -0
  72. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js.map +1 -0
  73. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js +2 -0
  74. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js.map +1 -0
  75. package/dist/.next/static/chunks/app/(application)/projects/[project]/{page-0b2d9832e5a023e7.js → page-bc859da58d8505f7.js} +2 -2
  76. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js.map +1 -0
  77. package/dist/.next/static/css/c8c015815c72d053.css +4 -0
  78. package/dist/.next/static/css/c8c015815c72d053.css.map +1 -0
  79. package/dist/.next/static/css/e3f2a16ab7676b05.css.map +1 -1
  80. package/dist/package.json +1 -0
  81. package/package.json +1 -1
  82. package/dist/.next/server/chunks/6623.js +0 -1
  83. package/dist/.next/static/chunks/1685-39351b8a15bbecab.js +0 -2
  84. package/dist/.next/static/chunks/1685-39351b8a15bbecab.js.map +0 -1
  85. package/dist/.next/static/chunks/1957-899d0d6d0d9c11fd.js +0 -2
  86. package/dist/.next/static/chunks/1957-899d0d6d0d9c11fd.js.map +0 -1
  87. package/dist/.next/static/chunks/3750-90a213a3c7cceb29.js.map +0 -1
  88. package/dist/.next/static/chunks/6373-7908bd5269f95aa3.js.map +0 -1
  89. package/dist/.next/static/chunks/7856-9fa733bdd6429ba8.js.map +0 -1
  90. package/dist/.next/static/chunks/8269-0e17dac508340ccf.js +0 -2
  91. package/dist/.next/static/chunks/8269-0e17dac508340ccf.js.map +0 -1
  92. package/dist/.next/static/chunks/9105-78d236e8399181e0.js +0 -2
  93. package/dist/.next/static/chunks/9105-78d236e8399181e0.js.map +0 -1
  94. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-29794b9c33d2bf7e.js.map +0 -1
  95. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-57021bb06089261a.js +0 -2
  96. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-57021bb06089261a.js.map +0 -1
  97. package/dist/.next/static/chunks/app/(application)/chat/layout-42021d301fc609b6.js +0 -2
  98. package/dist/.next/static/chunks/app/(application)/chat/layout-42021d301fc609b6.js.map +0 -1
  99. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-841b2ed48010048e.js +0 -2
  100. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-841b2ed48010048e.js.map +0 -1
  101. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-c1e7e0c81ca508c3.js +0 -2
  102. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-c1e7e0c81ca508c3.js.map +0 -1
  103. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-0b2d9832e5a023e7.js.map +0 -1
  104. package/dist/.next/static/css/a181dac3df0dc7a7.css +0 -4
  105. package/dist/.next/static/css/a181dac3df0dc7a7.css.map +0 -1
  106. /package/dist/.next/static/{J23NmkaMjAJYnE0jX_kO0 → GOwerAkBncYx0J8q1TqQb}/_buildManifest.js +0 -0
  107. /package/dist/.next/static/{J23NmkaMjAJYnE0jX_kO0 → GOwerAkBncYx0J8q1TqQb}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- exports.id=1051,exports.ids=[1051],exports.modules={65534:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,12994,23)),Promise.resolve().then(r.t.bind(r,96114,23)),Promise.resolve().then(r.t.bind(r,9727,23)),Promise.resolve().then(r.t.bind(r,79671,23)),Promise.resolve().then(r.t.bind(r,41868,23)),Promise.resolve().then(r.t.bind(r,84759,23))},75983:(e,t,r)=>{"use strict";r.d(t,{TanstackQueryClientProvider:()=>i});var s=r(10326),o=r(22852),n=r(44976);let a=new o.S,i=({children:e})=>s.jsx(n.aH,{client:a,children:e})},30463:(e,t,r)=>{"use strict";r.d(t,{ConfigContextProvider:()=>n,E:()=>o});var s=r(10326);let o=(0,r(17577).createContext)(null);function n({children:e,config:t}){if(console.log("[EXULU] Config: ",t),!t)throw Error("Config not found");return s.jsx(o.Provider,{value:t,children:e})}},2424:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var s=r(10326),o=r(30463),n=r(17577);let a=({width:e=64,height:t=32,className:r="",alt:a="Logo"})=>{let i=(0,n.useContext)(o.E);return(0,s.jsxs)(s.Fragment,{children:[s.jsx("img",{src:i?.backend+"/logo_dark.png",alt:a,width:e,height:t,className:r+"hidden dark:block"}),s.jsx("img",{src:i?.backend+"/logo_light.png",alt:a,width:e,height:t,className:r+"block dark:hidden"})]})}},15813:(e,t,r)=>{"use strict";r.d(t,{ThemeProvider:()=>n});var s=r(10326),o=r(3574);function n({children:e,...t}){return s.jsx(o.f,{...t,defaultTheme:"dark",children:e})}r(17577)},90772:(e,t,r)=>{"use strict";r.d(t,{d:()=>l,z:()=>d});var s=r(10326),o=r(34214),n=r(79360),a=r(17577),i=r(77863);let l=(0,n.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},d)=>{let c=n?o.g7:"button";return s.jsx(c,{className:(0,i.cn)(l({variant:t,size:r,className:e})),ref:d,...a})});d.displayName="Button"},54432:(e,t,r)=>{"use strict";r.d(t,{I:()=>a});var s=r(10326),o=r(17577),n=r(77863);let a=o.forwardRef(({className:e,type:t,...r},o)=>s.jsx("input",{type:t,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium 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:o,...r}));a.displayName="Input"},77083:(e,t,r)=>{"use strict";r.d(t,{Toaster:()=>h});var s=r(10326),o=r(10321),n=r(79360),a=r(94019),i=r(17577),l=r(77863);let d=o.zt,c=i.forwardRef(({className:e,...t},r)=>s.jsx(o.l_,{ref:r,className:(0,l.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));c.displayName=o.l_.displayName;let u=(0,n.j)("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),p=i.forwardRef(({className:e,variant:t,...r},n)=>s.jsx(o.fC,{ref:n,className:(0,l.cn)(u({variant:t}),e),...r}));p.displayName=o.fC.displayName,i.forwardRef(({className:e,...t},r)=>s.jsx(o.aU,{ref:r,className:(0,l.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t})).displayName=o.aU.displayName;let f=i.forwardRef(({className:e,...t},r)=>s.jsx(o.x8,{ref:r,className:(0,l.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(a.Z,{className:"size-4"})}));f.displayName=o.x8.displayName;let g=i.forwardRef(({className:e,...t},r)=>s.jsx(o.Dx,{ref:r,className:(0,l.cn)("text-sm font-semibold",e),...t}));g.displayName=o.Dx.displayName;let m=i.forwardRef(({className:e,...t},r)=>s.jsx(o.dk,{ref:r,className:(0,l.cn)("text-sm opacity-90",e),...t}));m.displayName=o.dk.displayName;var v=r(34789);function h(){let{toasts:e}=(0,v.pm)();return(0,s.jsxs)(d,{children:[e.map(function({id:e,title:t,description:r,action:o,...n}){return(0,s.jsxs)(p,{...n,children:[(0,s.jsxs)("div",{className:"grid gap-1",children:[t&&s.jsx(g,{children:t}),r&&s.jsx(m,{children:r})]}),o,s.jsx(f,{})]},e)}),s.jsx(c,{})]})}},34789:(e,t,r)=>{"use strict";r.d(t,{Am:()=>u,pm:()=>p});var s=r(17577);let o=0,n=new Map,a=e=>{if(n.has(e))return;let t=setTimeout(()=>{n.delete(e),c({type:"REMOVE_TOAST",toastId:e})},1e6);n.set(e,t)},i=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:r}=t;return r?a(r):e.toasts.forEach(e=>{a(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===r||void 0===r?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},l=[],d={toasts:[]};function c(e){d=i(d,e),l.forEach(e=>{e(d)})}function u({...e}){let t=(o=(o+1)%Number.MAX_SAFE_INTEGER).toString(),r=()=>c({type:"DISMISS_TOAST",toastId:t});return c({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:e=>c({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function p(){let[e,t]=s.useState(d);return s.useEffect(()=>(l.push(t),()=>{let e=l.indexOf(t);e>-1&&l.splice(e,1)}),[e]),{...e,toast:u,dismiss:e=>c({type:"DISMISS_TOAST",toastId:e})}}},77863:(e,t,r)=>{"use strict";r.d(t,{L:()=>a,cn:()=>n});var s=r(41135),o=r(31009);function n(...e){return(0,o.m6)((0,s.W)(e))}function a(e){if(!e)return"0s";let t=Math.floor(e/3600),r=Math.floor(e%3600/60),s=Math.round(e%60);return t>0?`${t}h ${r}m`:r>0?`${r}m ${s}s`:`${s}s`}},64640:(e,t,r)=>{"use strict";r.d(t,{u:()=>s});let s=(0,r(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/query-client.tsx#TanstackQueryClientProvider`)},19579:(e,t,r)=>{"use strict";r.a(e,async(e,s)=>{try{r.d(t,{b:()=>x,d:()=>v});var o=r(14029),n=r(53797),a=r(55245),i=r(84770),l=r(1203),d=r(8678),c=r(98691),u=r(35515),p=r(30849),f=r(77234),g=e([d]);d=(g.then?(await g)():g)[0];let m=async e=>{let t=process.env.NEXTAUTH_SECRET,r=await (0,u.nO)({k:t,alg:"HS256",kty:"oct"});return await new p.N(e).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("365d").sign(r)},v=new d.Pool({host:process.env.POSTGRES_DB_HOST,user:process.env.POSTGRES_DB_USER,port:parseInt(process.env.POSTGRES_DB_PORT||"5432",10),password:process.env.POSTGRES_DB_PASSWORD,database:process.env.POSTGRES_DB_NAME||"exulu",min:2,max:20,acquireTimeoutMillis:3e4,createTimeoutMillis:3e4,idleTimeoutMillis:3e4,reapIntervalMillis:1e3,createRetryIntervalMillis:200,connectionTimeoutMillis:1e4}),h=[(0,n.Z)({name:"Credentials",credentials:{email:{label:"Email",type:"email"},password:{label:"Password",type:"password"}},authorize:async e=>{let t=await v.connect();try{if(!e?.email||!e?.password)return null;let r=await t.query("SELECT * FROM users WHERE email = $1",[e.email]);if(console.log("[NEXT AUTH] authorize res rows count:",r.rows.length),console.log("[NEXT AUTH] Full user object:",JSON.stringify(r.rows[0],null,2)),!r?.rows?.length)return null;for(let s of r.rows){let r=await c.ZP.compare(e.password,s.password);if(console.log("[NEXT AUTH] isMatch",r),r)return await t.query("UPDATE users SET last_used = $1 WHERE email = $2",[new Date,s.email]),s}}finally{t.release()}}})];process.env.EMAIL_SERVER_HOST&&h.push((0,o.Z)({async sendVerificationRequest({identifier:e,token:t,url:r,provider:{server:s,from:o}}){var n;let{host:i}=new URL(r),l=(0,a.createTransport)(s);await l.sendMail({to:e,from:o,subject:`Sign in to ${i}`,text:(n={token:t,host:i},`
1
+ exports.id=1051,exports.ids=[1051],exports.modules={65534:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,12994,23)),Promise.resolve().then(r.t.bind(r,96114,23)),Promise.resolve().then(r.t.bind(r,9727,23)),Promise.resolve().then(r.t.bind(r,79671,23)),Promise.resolve().then(r.t.bind(r,41868,23)),Promise.resolve().then(r.t.bind(r,84759,23))},75983:(e,t,r)=>{"use strict";r.d(t,{TanstackQueryClientProvider:()=>i});var s=r(10326),o=r(22852),n=r(44976);let a=new o.S,i=({children:e})=>s.jsx(n.aH,{client:a,children:e})},30463:(e,t,r)=>{"use strict";r.d(t,{ConfigContextProvider:()=>n,E:()=>o});var s=r(10326);let o=(0,r(17577).createContext)(null);function n({children:e,config:t}){if(console.log("[EXULU] Config: ",t),!t)throw Error("Config not found");return s.jsx(o.Provider,{value:t,children:e})}},2424:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var s=r(10326),o=r(30463),n=r(17577);let a=({width:e=64,height:t=32,className:r="",alt:a="Logo"})=>{let i=(0,n.useContext)(o.E);return(0,s.jsxs)(s.Fragment,{children:[s.jsx("img",{src:i?.backend+"/logo_dark.png",alt:a,width:e,height:t,className:r+"hidden dark:block"}),s.jsx("img",{src:i?.backend+"/logo_light.png",alt:a,width:e,height:t,className:r+"block dark:hidden"})]})}},15813:(e,t,r)=>{"use strict";r.d(t,{ThemeProvider:()=>n});var s=r(10326),o=r(3574);function n({children:e,...t}){return s.jsx(o.f,{...t,defaultTheme:"dark",children:e})}r(17577)},90772:(e,t,r)=>{"use strict";r.d(t,{d:()=>l,z:()=>d});var s=r(10326),o=r(34214),n=r(79360),a=r(17577),i=r(77863);let l=(0,n.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},d)=>{let c=n?o.g7:"button";return s.jsx(c,{className:(0,i.cn)(l({variant:t,size:r,className:e})),ref:d,...a})});d.displayName="Button"},54432:(e,t,r)=>{"use strict";r.d(t,{I:()=>a});var s=r(10326),o=r(17577),n=r(77863);let a=o.forwardRef(({className:e,type:t,...r},o)=>s.jsx("input",{type:t,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium 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:o,...r}));a.displayName="Input"},77083:(e,t,r)=>{"use strict";r.d(t,{Toaster:()=>h});var s=r(10326),o=r(10321),n=r(79360),a=r(94019),i=r(17577),l=r(77863);let d=o.zt,c=i.forwardRef(({className:e,...t},r)=>s.jsx(o.l_,{ref:r,className:(0,l.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));c.displayName=o.l_.displayName;let u=(0,n.j)("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),p=i.forwardRef(({className:e,variant:t,...r},n)=>s.jsx(o.fC,{ref:n,className:(0,l.cn)(u({variant:t}),e),...r}));p.displayName=o.fC.displayName,i.forwardRef(({className:e,...t},r)=>s.jsx(o.aU,{ref:r,className:(0,l.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t})).displayName=o.aU.displayName;let f=i.forwardRef(({className:e,...t},r)=>s.jsx(o.x8,{ref:r,className:(0,l.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(a.Z,{className:"size-4"})}));f.displayName=o.x8.displayName;let g=i.forwardRef(({className:e,...t},r)=>s.jsx(o.Dx,{ref:r,className:(0,l.cn)("text-sm font-semibold",e),...t}));g.displayName=o.Dx.displayName;let m=i.forwardRef(({className:e,...t},r)=>s.jsx(o.dk,{ref:r,className:(0,l.cn)("text-sm opacity-90",e),...t}));m.displayName=o.dk.displayName;var v=r(34789);function h(){let{toasts:e}=(0,v.pm)();return(0,s.jsxs)(d,{children:[e.map(function({id:e,title:t,description:r,action:o,...n}){return(0,s.jsxs)(p,{...n,children:[(0,s.jsxs)("div",{className:"grid gap-1",children:[t&&s.jsx(g,{children:t}),r&&s.jsx(m,{children:r})]}),o,s.jsx(f,{})]},e)}),s.jsx(c,{})]})}},34789:(e,t,r)=>{"use strict";r.d(t,{Am:()=>u,pm:()=>p});var s=r(17577);let o=0,n=new Map,a=e=>{if(n.has(e))return;let t=setTimeout(()=>{n.delete(e),c({type:"REMOVE_TOAST",toastId:e})},1e6);n.set(e,t)},i=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:r}=t;return r?a(r):e.toasts.forEach(e=>{a(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===r||void 0===r?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},l=[],d={toasts:[]};function c(e){d=i(d,e),l.forEach(e=>{e(d)})}function u({...e}){let t=(o=(o+1)%Number.MAX_SAFE_INTEGER).toString(),r=()=>c({type:"DISMISS_TOAST",toastId:t});return c({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:e=>c({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function p(){let[e,t]=s.useState(d);return s.useEffect(()=>(l.push(t),()=>{let e=l.indexOf(t);e>-1&&l.splice(e,1)}),[e]),{...e,toast:u,dismiss:e=>c({type:"DISMISS_TOAST",toastId:e})}}},77863:(e,t,r)=>{"use strict";r.d(t,{L:()=>a,cn:()=>n});var s=r(41135),o=r(31009);function n(...e){return(0,o.m6)((0,s.W)(e))}function a(e){if(!e)return"0s";let t=Math.floor(e/3600),r=Math.floor(e%3600/60),s=Math.round(e%60);return t>0?`${t}h ${r}m`:r>0?`${r}m ${s}s`:`${s}s`}},64640:(e,t,r)=>{"use strict";r.d(t,{u:()=>s});let s=(0,r(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/query-client.tsx#TanstackQueryClientProvider`)},19579:(e,t,r)=>{"use strict";r.a(e,async(e,s)=>{try{r.d(t,{b:()=>x,d:()=>v});var o=r(14029),n=r(53797),a=r(55245),i=r(84770),l=r(1203),d=r(8678),c=r(98691),u=r(35515),p=r(30849),f=r(77234),g=e([d]);d=(g.then?(await g)():g)[0];let m=async e=>{let t=process.env.NEXTAUTH_SECRET;if(!t)throw Error("NEXTAUTH_SECRET is not defined");let r=Buffer.from(t,"utf-8").toString("base64url"),s=await (0,u.nO)({k:r,alg:"HS256",kty:"oct"});return await new p.N(e).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("365d").sign(s)},v=global.__db_pool||new d.Pool({host:process.env.POSTGRES_DB_HOST,user:process.env.POSTGRES_DB_USER,port:parseInt(process.env.POSTGRES_DB_PORT||"5432",10),password:process.env.POSTGRES_DB_PASSWORD,database:process.env.POSTGRES_DB_NAME||"exulu",min:2,max:20,acquireTimeoutMillis:3e4,createTimeoutMillis:3e4,idleTimeoutMillis:3e4,reapIntervalMillis:1e3,createRetryIntervalMillis:200,connectionTimeoutMillis:1e4}),h=[(0,n.Z)({name:"Credentials",credentials:{email:{label:"Email",type:"email"},password:{label:"Password",type:"password"}},authorize:async e=>{let t=await v.connect();try{if(!e?.email||!e?.password)return null;let r=await t.query("SELECT * FROM users WHERE email = $1",[e.email]);if(console.log("[NEXT AUTH] authorize res rows count:",r.rows.length),console.log("[NEXT AUTH] Full user object:",JSON.stringify(r.rows[0],null,2)),!r?.rows?.length)return null;for(let s of r.rows){let r=await c.ZP.compare(e.password,s.password);if(console.log("[NEXT AUTH] isMatch",r),r)return await t.query("UPDATE users SET last_used = $1 WHERE email = $2",[new Date,s.email]),s}}finally{t.release()}}})];process.env.EMAIL_SERVER_HOST&&h.push((0,o.Z)({async sendVerificationRequest({identifier:e,token:t,url:r,provider:{server:s,from:o}}){var n;let{host:i}=new URL(r),l=(0,a.createTransport)(s);await l.sendMail({to:e,from:o,subject:`Sign in to ${i}`,text:(n={token:t,host:i},`
2
2
  Sign in to ${n.host}
3
3
 
4
4
  Sign in code: ${n.token}
@@ -31,7 +31,7 @@ exports.id=1051,exports.ids=[1051],exports.modules={65534:(e,t,r)=>{Promise.reso
31
31
  </tr>
32
32
  </table>
33
33
  </body>
34
- `}({token:t,host:i})})},generateVerificationToken:async()=>(0,i.randomInt)(1e5,999999).toString(),maxAge:180,server:{host:process.env.EMAIL_SERVER_HOST,port:parseInt(process.env.EMAIL_SERVER_PORT,10),auth:{user:process.env.EMAIL_SERVER_USER,pass:process.env.EMAIL_SERVER_PASSWORD}},from:process.env.EMAIL_FROM})),process.env.GOOGLE_CLIENT_ID&&process.env.GOOGLE_CLIENT_SECRET&&h.push((0,f.Z)({clientId:process.env.GOOGLE_CLIENT_ID,clientSecret:process.env.GOOGLE_CLIENT_SECRET,authorization:{params:{access_type:"offline",response_type:"code",scope:"https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/directory.readonly https://www.googleapis.com/auth/user.emails.read https://www.googleapis.com/auth/admin.directory.group.readonly https://www.googleapis.com/auth/admin.directory.user.readonly https://www.googleapis.com/auth/userinfo.email openid"}}}));let x=async()=>({pages:{signIn:"/login"},adapter:(0,l.Z)(v),session:{strategy:"jwt"},jwt:{secret:process.env.NEXTAUTH_SECRET},providers:h,callbacks:{async signIn({account:e,profile:t,user:r}){let s=await v.connect();try{let o=r.email;if(console.log("[EXULU] Sign in callback",e,t,r),e?.provider==="google"&&!(o=t?.email))return console.error("[EXULU] Google auth failed, no email in profile."),s.release(),!1;if(console.log("[EXULU] ALLOWED_EMAIL_DOMAINS",process.env.ALLOWED_EMAIL_DOMAINS),process.env.ALLOWED_EMAIL_DOMAINS){let e=process.env.ALLOWED_EMAIL_DOMAINS.split(",");if(e.push("exulu.com"),e.push("qventu.com"),!e.some(e=>o.endsWith(`@${e}`)))return s.release(),!1}let n=await s.query("SELECT * FROM users WHERE email = $1",[o]),a=n?.rows[0];if(console.log("[EXULU] Sign in callback user query result",a),a&&await s.query("UPDATE users SET last_used = $1 WHERE email = $2",[new Date,o]),!a&&e?.provider==="google"){let e=t?.given_name||"",r=await s.query("SELECT * FROM roles WHERE name = $1",["default"]),n=r?.rows[0],i=await s.query('INSERT INTO users ("email", "name", "createdAt", "updatedAt", "emailVerified", "last_used", "type", "super_admin", "role") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING *',[o,e,new Date,new Date,new Date,new Date,"user",!1,n?.id]);a=i?.rows[0],console.log("[EXULU] Sign in callback new user query result",a)}if(a){if(e?.provider==="google"){console.log("[EXULU] Checking for existing account (provider account id: ",e.providerAccountId);let t=(await s.query('SELECT * FROM accounts WHERE provider = $1 AND "providerAccountId" = $2',["google",e.providerAccountId])).rows[0];console.log("[EXULU] Existing account query result",t),t?await s.query('UPDATE accounts SET access_token = $1, refresh_token = $2, expires_at = $3, id_token = $4, scope = $5, session_state = $6, token_type = $7, "userId" = $8 WHERE id = $9',[e.access_token,e.refresh_token,e.expires_at,e.id_token,e.scope,e.session_state,e.token_type,a.id,t.id]):await s.query('INSERT INTO accounts ("provider", "providerAccountId", "access_token", "refresh_token", "expires_at", "id_token", "scope", "session_state", "token_type", "userId", "type") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)',["google",e.providerAccountId,e.access_token,e.refresh_token,e.expires_at,e.id_token,e.scope,e.session_state,e.token_type,a.id,"oauth"])}return s.release(),!0}return s.release(),!1}catch(e){return console.error("[EXULU] Sign in callback error",e),s.release(),!1}},async jwt({token:e,user:t}){e.uid=e.sub??"nosub";let r=await m({id:t?t.id:e.sub,email:t?t.email:e.email});return e.jwt=r,e},session:async({session:e,token:t})=>(t&&e.user&&(e.user.id=t.id,e.user.jwt=t.jwt,e.user.email=t.email),e)},secret:process.env.NEXTAUTH_SECRET});s()}catch(e){s(e)}})},14796:(e,t,r)=>{"use strict";r.d(t,{b:()=>o});var s=r(68570);(0,s.createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/components/config-context.tsx#ConfigContext`);let o=(0,s.createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/components/config-context.tsx#ConfigContextProvider`)},10296:(e,t,r)=>{"use strict";r.d(t,{f:()=>s});let s=(0,r(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/components/theme-provider.tsx#ThemeProvider`)},23067:(e,t,r)=>{"use strict";r.d(t,{x:()=>s});let s=(0,r(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/components/ui/toaster.tsx#Toaster`)},53254:(e,t,r)=>{"use strict";r.d(t,{s8:()=>d});var s=r(68666),o=r.n(s),n=r(50100),a=r.n(n),i=r(11344),l=r.n(i);let d=[o().variable,a().variable,l().variable].join(" ")},29375:(e,t,r)=>{"use strict";r.a(e,async(e,s)=>{try{r.d(t,{x:()=>i});var o=r(75571),n=r(19579),a=e([n]);n=(a.then?(await a)():a)[0];let i=async()=>{let e=await (0,n.b)(),t=await (0,o.getServerSession)(e);if(!t?.user)return!1;console.log("[EXULU] serverSideAuthCheck session:",t);let r=await n.d.connect();try{let e=await r.query(`
34
+ `}({token:t,host:i})})},generateVerificationToken:async()=>(0,i.randomInt)(1e5,999999).toString(),maxAge:180,server:{host:process.env.EMAIL_SERVER_HOST,port:parseInt(process.env.EMAIL_SERVER_PORT,10),auth:{user:process.env.EMAIL_SERVER_USER,pass:process.env.EMAIL_SERVER_PASSWORD}},from:process.env.EMAIL_FROM})),process.env.GOOGLE_CLIENT_ID&&process.env.GOOGLE_CLIENT_SECRET&&h.push((0,f.Z)({clientId:process.env.GOOGLE_CLIENT_ID,clientSecret:process.env.GOOGLE_CLIENT_SECRET,authorization:{params:{access_type:"offline",response_type:"code",scope:"https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/directory.readonly https://www.googleapis.com/auth/user.emails.read https://www.googleapis.com/auth/admin.directory.group.readonly https://www.googleapis.com/auth/admin.directory.user.readonly https://www.googleapis.com/auth/userinfo.email openid"}}}));let x=async()=>({pages:{signIn:"/login"},adapter:(0,l.Z)(v),session:{strategy:"jwt"},jwt:{secret:process.env.NEXTAUTH_SECRET},providers:h,callbacks:{async signIn({account:e,profile:t,user:r}){let s=await v.connect();try{let o=r.email;if(console.log("[EXULU] Sign in callback",e,t,r),e?.provider==="google"&&!(o=t?.email))return console.error("[EXULU] Google auth failed, no email in profile."),!1;if(console.log("[EXULU] ALLOWED_EMAIL_DOMAINS",process.env.ALLOWED_EMAIL_DOMAINS),process.env.ALLOWED_EMAIL_DOMAINS){let e=process.env.ALLOWED_EMAIL_DOMAINS.split(",");if(e.push("exulu.com"),e.push("qventu.com"),!e.some(e=>o.endsWith(`@${e}`)))return!1}let n=await s.query("SELECT * FROM users WHERE email = $1",[o]),a=n?.rows[0];if(console.log("[EXULU] Sign in callback user query result",a),a&&await s.query("UPDATE users SET last_used = $1 WHERE email = $2",[new Date,o]),!a&&e?.provider==="google"){let e=t?.given_name||"",r=await s.query("SELECT * FROM roles WHERE name = $1",["default"]),n=r?.rows[0],i=await s.query('INSERT INTO users ("email", "name", "createdAt", "updatedAt", "emailVerified", "last_used", "type", "super_admin", "role") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING *',[o,e,new Date,new Date,new Date,new Date,"user",!1,n?.id]);a=i?.rows[0],console.log("[EXULU] Sign in callback new user query result",a)}if(a){if(e?.provider==="google"){console.log("[EXULU] Checking for existing account (provider account id: ",e.providerAccountId);let t=(await s.query('SELECT * FROM accounts WHERE provider = $1 AND "providerAccountId" = $2',["google",e.providerAccountId])).rows[0];console.log("[EXULU] Existing account query result",t),t?await s.query('UPDATE accounts SET access_token = $1, refresh_token = $2, expires_at = $3, id_token = $4, scope = $5, session_state = $6, token_type = $7, "userId" = $8 WHERE id = $9',[e.access_token,e.refresh_token,e.expires_at,e.id_token,e.scope,e.session_state,e.token_type,a.id,t.id]):await s.query('INSERT INTO accounts ("provider", "providerAccountId", "access_token", "refresh_token", "expires_at", "id_token", "scope", "session_state", "token_type", "userId", "type") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)',["google",e.providerAccountId,e.access_token,e.refresh_token,e.expires_at,e.id_token,e.scope,e.session_state,e.token_type,a.id,"oauth"])}return!0}return!1}catch(e){return console.error("[EXULU] Sign in callback error",e),!1}finally{s.release()}},async jwt({token:e,user:t}){e.uid=e.sub??"nosub";let r=await m({id:t?t.id:e.sub,email:t?t.email:e.email});return e.jwt=r,e},session:async({session:e,token:t})=>(t&&e.user&&(e.user.id=t.id,e.user.jwt=t.jwt,e.user.email=t.email),e)},secret:process.env.NEXTAUTH_SECRET});s()}catch(e){s(e)}})},14796:(e,t,r)=>{"use strict";r.d(t,{b:()=>o});var s=r(68570);(0,s.createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/components/config-context.tsx#ConfigContext`);let o=(0,s.createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/components/config-context.tsx#ConfigContextProvider`)},10296:(e,t,r)=>{"use strict";r.d(t,{f:()=>s});let s=(0,r(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/components/theme-provider.tsx#ThemeProvider`)},23067:(e,t,r)=>{"use strict";r.d(t,{x:()=>s});let s=(0,r(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/components/ui/toaster.tsx#Toaster`)},53254:(e,t,r)=>{"use strict";r.d(t,{s8:()=>d});var s=r(68666),o=r.n(s),n=r(50100),a=r.n(n),i=r(11344),l=r.n(i);let d=[o().variable,a().variable,l().variable].join(" ")},29375:(e,t,r)=>{"use strict";r.a(e,async(e,s)=>{try{r.d(t,{x:()=>i});var o=r(75571),n=r(19579),a=e([n]);n=(a.then?(await a)():a)[0];let i=async()=>{let e=await (0,n.b)(),t=await (0,o.getServerSession)(e);if(!t?.user)return!1;console.log("[EXULU] serverSideAuthCheck session:",t);let r=await n.d.connect();try{let e=await r.query(`
35
35
  SELECT
36
36
  users.*,
37
37
  json_build_object(
@@ -5,6 +5,7 @@
5
5
  embedder {
6
6
  name
7
7
  id
8
+ queue
8
9
  config {
9
10
  name
10
11
  description
@@ -1 +1 @@
1
- "use strict";exports.id=2948,exports.ids=[2948],exports.modules={51602:(e,s,t)=>{t.d(s,{d:()=>x,f:()=>h});var r=t(10326),a=t(90772),l=t(77863),n=t(32933),i=t(43810),o=t(17577),d=t(54390),c=t(35057),m=t(48818);let u=(0,o.createContext)({code:""}),x=({code:e,language:s,showLineNumbers:t=!1,className:a,children:n,...i})=>r.jsx(u.Provider,{value:{code:e},children:r.jsx("div",{className:(0,l.cn)("relative w-full overflow-hidden rounded-md border bg-background text-foreground",a),...i,children:(0,r.jsxs)("div",{className:"relative",children:[r.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}),r.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}),n&&r.jsx("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})}),h=({onCopy:e,onError:s,timeout:t=2e3,children:d,className:c,...m})=>{let[x,h]=(0,o.useState)(!1),{code:p}=(0,o.useContext)(u),g=async()=>{s?.(Error("Clipboard API not available"))},f=x?n.Z:i.Z;return r.jsx(a.z,{className:(0,l.cn)("shrink-0",c),onClick:g,size:"icon",variant:"ghost",...m,children:d??r.jsx(f,{size:14})})}},15728:(e,s,t)=>{t.d(s,{iG:()=>i,ri:()=>n});var r=t(10326);t(90772);var a=t(77863);t(17577);var l=t(30778);let n=({className:e,...s})=>r.jsx(l.h,{className:(0,a.cn)("relative flex-1 overflow-y-auto",e),initial:"smooth",resize:"smooth",role:"log",...s}),i=({className:e,...s})=>r.jsx(l.h.Content,{className:(0,a.cn)("p-4",e),...s})},36931:(e,s,t)=>{t.d(s,{H:()=>x});var r=t(10326),a=t(77863),l=t(17577),n=t(16476),i=t(79283),o=t(70285),d=t(7833),c=t(51602);t(32289);let m=(0,t(39499).Z)(n.UG),u={ol:({node:e,children:s,className:t,...l})=>r.jsx("ol",{className:(0,a.cn)("ml-4 list-outside list-decimal",t),...l,children:s}),li:({node:e,children:s,className:t,...l})=>r.jsx("li",{className:(0,a.cn)("py-1",t),...l,children:s}),ul:({node:e,children:s,className:t,...l})=>r.jsx("ul",{className:(0,a.cn)("ml-4 list-outside list-disc",t),...l,children:s}),hr:({node:e,className:s,...t})=>r.jsx("hr",{className:(0,a.cn)("my-6 border-border",s),...t}),strong:({node:e,children:s,className:t,...l})=>r.jsx("span",{className:(0,a.cn)("font-semibold",t),...l,children:s}),a:({node:e,children:s,className:t,...l})=>r.jsx("a",{className:(0,a.cn)("font-medium text-primary underline",t),rel:"noreferrer",target:"_blank",...l,children:s}),h1:({node:e,children:s,className:t,...l})=>r.jsx("h1",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-3xl",t),...l,children:s}),h2:({node:e,children:s,className:t,...l})=>r.jsx("h2",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-2xl",t),...l,children:s}),h3:({node:e,children:s,className:t,...l})=>r.jsx("h3",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-xl",t),...l,children:s}),h4:({node:e,children:s,className:t,...l})=>r.jsx("h4",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-lg",t),...l,children:s}),h5:({node:e,children:s,className:t,...l})=>r.jsx("h5",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-base",t),...l,children:s}),h6:({node:e,children:s,className:t,...l})=>r.jsx("h6",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-sm",t),...l,children:s}),table:({node:e,children:s,className:t,...l})=>r.jsx("div",{className:"my-4 overflow-x-auto",children:r.jsx("table",{className:(0,a.cn)("w-full border-collapse border border-border",t),...l,children:s})}),thead:({node:e,children:s,className:t,...l})=>r.jsx("thead",{className:(0,a.cn)("bg-muted/50",t),...l,children:s}),tbody:({node:e,children:s,className:t,...l})=>r.jsx("tbody",{className:(0,a.cn)("divide-y divide-border",t),...l,children:s}),tr:({node:e,children:s,className:t,...l})=>r.jsx("tr",{className:(0,a.cn)("border-border border-b",t),...l,children:s}),th:({node:e,children:s,className:t,...l})=>r.jsx("th",{className:(0,a.cn)("px-4 py-2 text-left font-semibold text-sm",t),...l,children:s}),td:({node:e,children:s,className:t,...l})=>r.jsx("td",{className:(0,a.cn)("px-4 py-2 text-sm",t),...l,children:s}),blockquote:({node:e,children:s,className:t,...l})=>r.jsx("blockquote",{className:(0,a.cn)("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),...l,children:s}),code:({node:e,className:s,...t})=>e?.position?.start.line!==e?.position?.end.line?r.jsx("code",{className:s,...t}):r.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 n="javascript";"string"==typeof e?.properties?.className&&(n=e.properties.className.replace("language-",""));let i="";return(0,l.isValidElement)(t)&&t.props&&"string"==typeof t.props.children?i=t.props.children:"string"==typeof t&&(i=t),r.jsx(c.d,{className:(0,a.cn)("my-4 h-auto",s),code:i,language:n,children:r.jsx(c.f,{onCopy:()=>console.log("Copied code to clipboard"),onError:()=>console.error("Failed to copy code to clipboard")})})}},x=(0,l.memo)(({className:e,options:s,children:t,allowedImagePrefixes:l,allowedLinkPrefixes:n,defaultOrigin:c,parseIncompleteMarkdown:x=!0,...h})=>{let p="string"==typeof t&&x?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,r)=>{if("*"===t){let t=s[r-1],a=s[r+1];if("*"!==t&&"*"!==a)return e+1}return e},0)%2==1&&(s=`${s}*`),s.match(/(_)([^_]*?)$/)&&s.split("").reduce((e,t,r)=>{if("_"===t){let t=s[r-1],a=s[r+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 r="```"===s.substring(t,t+3),a=t>0&&"```"===s.substring(t-1,t+2),l=t>1&&"```"===s.substring(t-2,t+1);!(r||a||l)&&e++}e%2==1&&(s=`${s}\``)}return s.match(/(~~)([^~]*?)$/)&&(s.match(/~~/g)||[]).length%2==1&&(s=`${s}~~`),s}(t):t;return r.jsx("div",{className:(0,a.cn)("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...h,children:r.jsx(m,{allowedImagePrefixes:l??["*"],allowedLinkPrefixes:n??["*"],components:u,defaultOrigin:c,rehypePlugins:[i.Z],remarkPlugins:[o.Z,d.Z],...s,children:p})})},(e,s)=>e.children===s.children);x.displayName="Response"},87599:(e,s,t)=>{t.d(s,{K:()=>M});var r=t(10326);t(28758);var a=t(77863);let l=({className:e,from:s,...t})=>r.jsx("div",{className:(0,a.cn)("group flex w-full items-end justify-end gap-2 py-4","user"===s?"is-user flex-row-reverse justify-end":"is-assistant flex-row-reverse justify-end","[&>div]:max-w-[80%]",e),...t}),n=({children:e,className:s,...t})=>r.jsx("div",{className:(0,a.cn)("flex flex-col gap-2 overflow-hidden rounded-lg py-3 text-foreground text-sm","group-[.is-user]:bg-secondary group-[.is-user]:text-primary-foreground group-[.is-user]:px-4","group-[.is-assistant]:bg-transparent group-[.is-assistant]:text-foreground",s),...t,children:r.jsx("div",{className:"is-user:dark",children:e})});var i=t(90772),o=t(68232);let d=({className:e,children:s,...t})=>r.jsx("div",{className:(0,a.cn)("flex items-center gap-1",e),...t,children:s}),c=({tooltip:e,children:s,label:t,className:l,variant:n="ghost",size:d="sm",...c})=>{let m=(0,r.jsxs)(i.z,{className:(0,a.cn)("size-9 p-1.5 text-muted-foreground hover:text-foreground",l),size:d,type:"button",variant:n,...c,children:[s,r.jsx("span",{className:"sr-only",children:t||e})]});return e?r.jsx(o.pn,{children:(0,r.jsxs)(o.u,{children:[r.jsx(o.aJ,{asChild:!0,children:m}),r.jsx(o._v,{children:r.jsx("p",{children:e})})]})}):m};var m=t(36931),u=t(52067),x=t(24295),h=t(98360),p=t(941),g=t(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},b=(0,g.memo)(({className:e,isStreaming:s=!1,open:t,defaultOpen:l=!1,onOpenChange:n,duration:i,children:o,...d})=>{let[c,m]=(0,u.T)({prop:t,defaultProp:l,onChange:n}),[h,p]=(0,u.T)({prop:i,defaultProp:0}),[j,b]=(0,g.useState)(!1),[N,y]=(0,g.useState)(null);return(0,g.useEffect)(()=>{s?null===N&&y(Date.now()):null!==N&&(p(Math.round((Date.now()-N)/1e3)),y(null))},[s,N,p]),(0,g.useEffect)(()=>{if(s&&!c)m(!0);else if(!s&&c&&!l&&!j){let e=setTimeout(()=>{m(!1),b(!0)},1e3);return()=>clearTimeout(e)}},[s,c,l,m,j]),r.jsx(f.Provider,{value:{isStreaming:s,isOpen:c,setIsOpen:m,duration:h},children:r.jsx(x.zF,{className:(0,a.cn)("not-prose mb-4",e),onOpenChange:e=>{m(e)},open:c,...d,children:o})})}),N=(0,g.memo)(({className:e,title:s="Reasoning",children:t,...l})=>{let{isStreaming:n,isOpen:i,duration:o}=j();return r.jsx(x.wy,{className:(0,a.cn)("flex items-center gap-2 text-muted-foreground text-sm",e),...l,children:t??(0,r.jsxs)(r.Fragment,{children:[r.jsx(h.Z,{className:"size-4"}),n||0===o?r.jsx("p",{children:"Thinking..."}):(0,r.jsxs)("p",{children:["Thought for ",o," seconds"]}),r.jsx(p.Z,{className:(0,a.cn)("size-4 text-muted-foreground transition-transform",i?"rotate-180":"rotate-0")})]})})}),y=(0,g.memo)(({className:e,children:s,...t})=>r.jsx(x.Fw,{className:(0,a.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),...t,children:r.jsx(m.H,{className:"grid gap-2",children:s})}));b.displayName="Reasoning",N.displayName="ReasoningTrigger",y.displayName="ReasoningContent";var v=t(71876);let w=({className:e,...s})=>r.jsx(x.zF,{className:(0,a.cn)("not-prose mb-4 text-primary text-xs",e),...s}),k=({className:e,count:s,children:t,...a})=>r.jsx(x.wy,{className:"flex items-center gap-2",...a,children:t??(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"font-medium",children:["Used ",s," sources"]}),r.jsx(p.Z,{className:"h-4 w-4"})]})}),C=({className:e,...s})=>r.jsx(x.Fw,{className:(0,a.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),...s}),$=({href:e,title:s,children:t,...a})=>r.jsx("a",{className:"flex items-center gap-2",href:e,rel:"noreferrer",target:"_blank",...a,children:t??(0,r.jsxs)(r.Fragment,{children:[r.jsx(v.Z,{className:"h-4 w-4"}),r.jsx("span",{className:"block font-medium",children:s})]})});var _=t(91468),z=t(43810),Z=t(46226),T=t(34789),F=t(53982),P=t(75290),S=t(2179),R=t(91470);let I={pending:{icon:F.Z,label:"Pending",className:"text-muted-foreground"},in_progress:{icon:P.Z,label:"In Progress",className:"text-blue-500 animate-spin"},completed:{icon:S.Z,label:"Completed",className:"text-green-500"},cancelled:{icon:R.Z,label:"Cancelled",className:"text-red-500"}},E={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"}},L=({todos:e,showPriority:s=!1,state:t,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,r.jsxs)("div",{className:(0,a.cn)("my-2 space-y-1","input-streaming"===t&&"opacity-70",l),...n,children:[e.map((t,l)=>{let n=I[t.status].icon,i=I[t.status].className;E[t.priority].className;let o="in_progress"===t.status&&l===e.findIndex(e=>"in_progress"===e.status);return(0,r.jsxs)("div",{className:(0,a.cn)("flex items-start gap-2 py-0.5","cancelled"===t.status&&"opacity-50"),children:[r.jsx("div",{className:"flex-shrink-0 pt-0.5",children:r.jsx(n,{className:(0,a.cn)("size-3.5",i)})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:(0,a.cn)("text-sm","completed"===t.status&&"text-muted-foreground line-through","cancelled"===t.status&&"text-muted-foreground line-through","in_progress"===t.status&&o&&"font-medium"),children:t.content}),s&&"high"===t.priority&&r.jsx("span",{className:"ml-2 text-red-500 text-xs",children:"(!)"})]})]},t.id)}),o>1&&(0,r.jsxs)("div",{className:"flex items-center gap-2 pt-1 text-muted-foreground text-xs",children:[r.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full bg-secondary",children:r.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:`${i/o*100}%`}})}),(0,r.jsxs)("span",{className:"whitespace-nowrap",children:[i,"/",o]})]}),"output-error"===t&&(0,r.jsxs)("div",{className:"flex items-center gap-1 pt-1 text-red-500 text-xs",children:[r.jsx(R.Z,{className:"size-3"}),r.jsx("span",{children:"Error updating tasks"})]})]})};function M({messages:e,status:s="idle",className:t,showActions:i=!0,onRegenerate:o,onAddToolResult:u,UntypedToolPartComponent:x,addToContext:h,writeAccess:p=!0,config:g}){let{toast:f}=(0,T.pm)();return r.jsx(r.Fragment,{children:e?.map((j,v)=>{let T=j.metadata;return e.length,r.jsx(l,{className:a.cn("assistant"===j.role&&(g?.customAssistantClassnames?g?.customAssistantClassnames:""),0===v&&(g?.marginTopFirstMessage?g?.marginTopFirstMessage:"mt-12"),t),from:j.role,children:r.jsxs(n,{children:[j.parts.map((e,t)=>{if("step-start"===e.type)return null;if("text"===e.type)return r.jsx("div",{children:r.jsx(m.H,{className:"chat-response-container",children:e.text})},`${j.id}-${t}`);if("tool-askForConfirmation"===e.type&&u){let s=e.toolCallId;switch(e.state){case"input-streaming":return r.jsx("div",{children:"Loading confirmation request..."},s);case"input-available":return r.jsxs("div",{children:[e.input.message,r.jsxs("div",{children:[r.jsx("button",{onClick:()=>u({tool:"askForConfirmation",toolCallId:s,output:"Yes, confirmed"}),children:"Yes"}),r.jsx("button",{onClick:()=>u({tool:"askForConfirmation",toolCallId:s,output:"No, denied"}),children:"No"})]})]},s);case"output-available":return r.jsxs("div",{children:["Tool call allowed: ",e.output]},s);case"output-error":return r.jsxs("div",{children:["Error: ",e.errorText]},s)}}if(e.type?.toLowerCase()==="tool-todo_write"||e.type?.toLowerCase()==="tool-todo_read"){let s=e.output;if(!s?.result)return null;let t=e.state;return r.jsx(L,{todos:s.result,showPriority:!0,state:t})}if((e.type.startsWith("tool-")||"dynamic-tool"===e.type)&&x&&h){let s=e.toolCallId;return r.jsx(x,{untypedToolPart:e,callId:s,addToContext:h},s)}return"file"===e.type&&e.mediaType?.startsWith("image/")?r.jsx(Z.default,{src:e.url,width:300,height:300,alt:"Generated image"},`${j.id}-${t}`):"source-url"===e.type?r.jsxs(w,{children:[r.jsx(k,{count:j.parts.filter(e=>"source-url"===e.type).length}),r.jsx(C,{children:j.parts.map((e,s)=>{if("source-url"===e.type)return r.jsx($,{href:e.url,title:e.title},`${j.id}-${s}`)})},`${j.id}`)]},`${j.id}-${t}`):"reasoning"===e.type?r.jsxs(b,{className:"w-full",isStreaming:"streaming"===s,children:[r.jsx(N,{}),r.jsx(y,{children:e.text})]},`${j.id}-${t}`):null}),i&&"assistant"===j.role&&r.jsxs(d,{className:"mt-2",children:[o&&r.jsx(c,{onClick:()=>o(),label:"Retry",disabled:!p,children:r.jsx(_.Z,{className:"size-3"})}),r.jsx(c,{onClick:()=>{navigator.clipboard.writeText(j.parts.map(e=>e?.text||"").join("\n")),f({title:"Copied message",description:"The message was copied to your clipboard."})},label:"Copy",children:r.jsx(z.Z,{className:"size-3"})}),T?.totalTokens&&r.jsxs("small",{className:"text-muted-foreground",children:[Intl.NumberFormat("en-US").format(T?.totalTokens)," tokens"]})]})]})},j.id)})})}},24295:(e,s,t)=>{t.d(s,{Fw:()=>n,wy:()=>l,zF:()=>a});var r=t(35663);let a=r.fC,l=r.wy,n=r.Fw},79210:(e,s,t)=>{t.d(s,{SP:()=>d,dr:()=>o,mQ:()=>i,nU:()=>c});var r=t(10326),a=t(28407),l=t(17577),n=t(77863);let i=a.fC,o=l.forwardRef(({className:e,...s},t)=>r.jsx(a.aV,{ref:t,className:(0,n.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=l.forwardRef(({className:e,...s},t)=>r.jsx(a.xz,{ref:t,className:(0,n.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=l.forwardRef(({className:e,...s},t)=>r.jsx(a.VY,{ref:t,className:(0,n.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}};
1
+ "use strict";exports.id=2948,exports.ids=[2948],exports.modules={51602:(e,s,t)=>{t.d(s,{d:()=>x,f:()=>p});var r=t(10326),a=t(90772),l=t(77863),n=t(32933),i=t(43810),o=t(17577),d=t(54390),c=t(35057),m=t(48818);let u=(0,o.createContext)({code:""}),x=({code:e,language:s,showLineNumbers:t=!1,className:a,children:n,...i})=>r.jsx(u.Provider,{value:{code:e},children:r.jsx("div",{className:(0,l.cn)("relative w-full overflow-hidden rounded-md border bg-background text-foreground",a),...i,children:(0,r.jsxs)("div",{className:"relative",children:[r.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}),r.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}),n&&r.jsx("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})}),p=({onCopy:e,onError:s,timeout:t=2e3,children:d,className:c,...m})=>{let[x,p]=(0,o.useState)(!1),{code:h}=(0,o.useContext)(u),f=async()=>{s?.(Error("Clipboard API not available"))},g=x?n.Z:i.Z;return r.jsx(a.z,{className:(0,l.cn)("shrink-0",c),onClick:f,size:"icon",variant:"ghost",...m,children:d??r.jsx(g,{size:14})})}},15728:(e,s,t)=>{t.d(s,{iG:()=>i,ri:()=>n});var r=t(10326);t(90772);var a=t(77863);t(17577);var l=t(30778);let n=({className:e,...s})=>r.jsx(l.h,{className:(0,a.cn)("relative flex-1 overflow-y-auto",e),initial:"smooth",resize:"smooth",role:"log",...s}),i=({className:e,...s})=>r.jsx(l.h.Content,{className:(0,a.cn)("p-4",e),...s})},36931:(e,s,t)=>{t.d(s,{H:()=>x});var r=t(10326),a=t(77863),l=t(17577),n=t(16476),i=t(79283),o=t(70285),d=t(7833),c=t(51602);t(32289);let m=(0,t(39499).Z)(n.UG),u={ol:({node:e,children:s,className:t,...l})=>r.jsx("ol",{className:(0,a.cn)("ml-4 list-outside list-decimal",t),...l,children:s}),li:({node:e,children:s,className:t,...l})=>r.jsx("li",{className:(0,a.cn)("py-1",t),...l,children:s}),ul:({node:e,children:s,className:t,...l})=>r.jsx("ul",{className:(0,a.cn)("ml-4 list-outside list-disc",t),...l,children:s}),hr:({node:e,className:s,...t})=>r.jsx("hr",{className:(0,a.cn)("my-6 border-border",s),...t}),strong:({node:e,children:s,className:t,...l})=>r.jsx("span",{className:(0,a.cn)("font-semibold",t),...l,children:s}),a:({node:e,children:s,className:t,...l})=>r.jsx("a",{className:(0,a.cn)("font-medium text-primary underline",t),rel:"noreferrer",target:"_blank",...l,children:s}),h1:({node:e,children:s,className:t,...l})=>r.jsx("h1",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-3xl",t),...l,children:s}),h2:({node:e,children:s,className:t,...l})=>r.jsx("h2",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-2xl",t),...l,children:s}),h3:({node:e,children:s,className:t,...l})=>r.jsx("h3",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-xl",t),...l,children:s}),h4:({node:e,children:s,className:t,...l})=>r.jsx("h4",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-lg",t),...l,children:s}),h5:({node:e,children:s,className:t,...l})=>r.jsx("h5",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-base",t),...l,children:s}),h6:({node:e,children:s,className:t,...l})=>r.jsx("h6",{className:(0,a.cn)("mt-6 mb-2 font-semibold text-sm",t),...l,children:s}),table:({node:e,children:s,className:t,...l})=>r.jsx("div",{className:"my-4 overflow-x-auto",children:r.jsx("table",{className:(0,a.cn)("w-full border-collapse border border-border",t),...l,children:s})}),thead:({node:e,children:s,className:t,...l})=>r.jsx("thead",{className:(0,a.cn)("bg-muted/50",t),...l,children:s}),tbody:({node:e,children:s,className:t,...l})=>r.jsx("tbody",{className:(0,a.cn)("divide-y divide-border",t),...l,children:s}),tr:({node:e,children:s,className:t,...l})=>r.jsx("tr",{className:(0,a.cn)("border-border border-b",t),...l,children:s}),th:({node:e,children:s,className:t,...l})=>r.jsx("th",{className:(0,a.cn)("px-4 py-2 text-left font-semibold text-sm",t),...l,children:s}),td:({node:e,children:s,className:t,...l})=>r.jsx("td",{className:(0,a.cn)("px-4 py-2 text-sm",t),...l,children:s}),blockquote:({node:e,children:s,className:t,...l})=>r.jsx("blockquote",{className:(0,a.cn)("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),...l,children:s}),code:({node:e,className:s,...t})=>e?.position?.start.line!==e?.position?.end.line?r.jsx("code",{className:s,...t}):r.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 n="javascript";"string"==typeof e?.properties?.className&&(n=e.properties.className.replace("language-",""));let i="";return(0,l.isValidElement)(t)&&t.props&&"string"==typeof t.props.children?i=t.props.children:"string"==typeof t&&(i=t),r.jsx(c.d,{className:(0,a.cn)("my-4 h-auto",s),code:i,language:n,children:r.jsx(c.f,{onCopy:()=>console.log("Copied code to clipboard"),onError:()=>console.error("Failed to copy code to clipboard")})})}},x=(0,l.memo)(({className:e,options:s,children:t,allowedImagePrefixes:l,allowedLinkPrefixes:n,defaultOrigin:c,parseIncompleteMarkdown:x=!0,...p})=>{let h="string"==typeof t&&x?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,r)=>{if("*"===t){let t=s[r-1],a=s[r+1];if("*"!==t&&"*"!==a)return e+1}return e},0)%2==1&&(s=`${s}*`),s.match(/(_)([^_]*?)$/)&&s.split("").reduce((e,t,r)=>{if("_"===t){let t=s[r-1],a=s[r+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 r="```"===s.substring(t,t+3),a=t>0&&"```"===s.substring(t-1,t+2),l=t>1&&"```"===s.substring(t-2,t+1);!(r||a||l)&&e++}e%2==1&&(s=`${s}\``)}return s.match(/(~~)([^~]*?)$/)&&(s.match(/~~/g)||[]).length%2==1&&(s=`${s}~~`),s}(t):t;return r.jsx("div",{className:(0,a.cn)("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...p,children:r.jsx(m,{allowedImagePrefixes:l??["*"],allowedLinkPrefixes:n??["*"],components:u,defaultOrigin:c,rehypePlugins:[i.Z],remarkPlugins:[o.Z,d.Z],...s,children:h})})},(e,s)=>e.children===s.children);x.displayName="Response"},87599:(e,s,t)=>{t.d(s,{K:()=>O});var r=t(10326);t(28758);var a=t(77863);let l=({className:e,from:s,...t})=>r.jsx("div",{className:(0,a.cn)("group flex w-full items-end justify-end gap-2 py-4","user"===s?"is-user flex-row-reverse justify-end":"is-assistant flex-row-reverse justify-end","[&>div]:max-w-[80%]",e),...t}),n=({children:e,className:s,...t})=>r.jsx("div",{className:(0,a.cn)("flex flex-col gap-2 overflow-hidden rounded-lg py-3 text-foreground text-sm","group-[.is-user]:bg-secondary group-[.is-user]:text-primary-foreground group-[.is-user]:px-4","group-[.is-assistant]:bg-transparent group-[.is-assistant]:text-foreground",s),...t,children:r.jsx("div",{className:"is-user:dark",children:e})});var i=t(90772),o=t(68232);let d=({className:e,children:s,...t})=>r.jsx("div",{className:(0,a.cn)("flex items-center gap-1",e),...t,children:s}),c=({tooltip:e,children:s,label:t,className:l,variant:n="ghost",size:d="sm",...c})=>{let m=(0,r.jsxs)(i.z,{className:(0,a.cn)("size-9 p-1.5 text-muted-foreground hover:text-foreground",l),size:d,type:"button",variant:n,...c,children:[s,r.jsx("span",{className:"sr-only",children:t||e})]});return e?r.jsx(o.pn,{children:(0,r.jsxs)(o.u,{children:[r.jsx(o.aJ,{asChild:!0,children:m}),r.jsx(o._v,{children:r.jsx("p",{children:e})})]})}):m};var m=t(36931),u=t(52067),x=t(24295),p=t(98360),h=t(941),f=t(17577);let g=(0,f.createContext)(null),j=()=>{let e=(0,f.useContext)(g);if(!e)throw Error("Reasoning components must be used within Reasoning");return e},b=(0,f.memo)(({className:e,isStreaming:s=!1,open:t,defaultOpen:l=!1,onOpenChange:n,duration:i,children:o,...d})=>{let[c,m]=(0,u.T)({prop:t,defaultProp:l,onChange:n}),[p,h]=(0,u.T)({prop:i,defaultProp:0}),[j,b]=(0,f.useState)(!1),[N,y]=(0,f.useState)(null);return(0,f.useEffect)(()=>{s?null===N&&y(Date.now()):null!==N&&(h(Math.round((Date.now()-N)/1e3)),y(null))},[s,N,h]),(0,f.useEffect)(()=>{if(s&&!c)m(!0);else if(!s&&c&&!l&&!j){let e=setTimeout(()=>{m(!1),b(!0)},1e3);return()=>clearTimeout(e)}},[s,c,l,m,j]),r.jsx(g.Provider,{value:{isStreaming:s,isOpen:c,setIsOpen:m,duration:p},children:r.jsx(x.zF,{className:(0,a.cn)("not-prose mb-4",e),onOpenChange:e=>{m(e)},open:c,...d,children:o})})}),N=(0,f.memo)(({className:e,title:s="Reasoning",children:t,...l})=>{let{isStreaming:n,isOpen:i,duration:o}=j();return r.jsx(x.wy,{className:(0,a.cn)("flex items-center gap-2 text-muted-foreground text-sm",e),...l,children:t??(0,r.jsxs)(r.Fragment,{children:[r.jsx(p.Z,{className:"size-4"}),n||0===o?r.jsx("p",{children:"Thinking..."}):(0,r.jsxs)("p",{children:["Thought for ",o," seconds"]}),r.jsx(h.Z,{className:(0,a.cn)("size-4 text-muted-foreground transition-transform",i?"rotate-180":"rotate-0")})]})})}),y=(0,f.memo)(({className:e,children:s,...t})=>r.jsx(x.Fw,{className:(0,a.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),...t,children:r.jsx(m.H,{className:"grid gap-2",children:s})}));b.displayName="Reasoning",N.displayName="ReasoningTrigger",y.displayName="ReasoningContent";var v=t(71876);let w=({className:e,...s})=>r.jsx(x.zF,{className:(0,a.cn)("not-prose mb-4 text-primary text-xs",e),...s}),C=({className:e,count:s,children:t,...a})=>r.jsx(x.wy,{className:"flex items-center gap-2",...a,children:t??(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"font-medium",children:["Used ",s," sources"]}),r.jsx(h.Z,{className:"h-4 w-4"})]})}),k=({className:e,...s})=>r.jsx(x.Fw,{className:(0,a.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),...s}),_=({href:e,title:s,children:t,...a})=>r.jsx("a",{className:"flex items-center gap-2",href:e,rel:"noreferrer",target:"_blank",...a,children:t??(0,r.jsxs)(r.Fragment,{children:[r.jsx(v.Z,{className:"h-4 w-4"}),r.jsx("span",{className:"block font-medium",children:s})]})});var $=t(91468),z=t(43810),Z=t(46226),F=t(34789),T=t(53982),P=t(75290),S=t(2179),R=t(91470);let I={pending:{icon:T.Z,label:"Pending",className:"text-muted-foreground"},in_progress:{icon:P.Z,label:"In Progress",className:"text-blue-500 animate-spin"},completed:{icon:S.Z,label:"Completed",className:"text-green-500"},cancelled:{icon:R.Z,label:"Cancelled",className:"text-red-500"}},L={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:s=!1,state:t,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,r.jsxs)("div",{className:(0,a.cn)("my-2 space-y-1","input-streaming"===t&&"opacity-70",l),...n,children:[e.map((t,l)=>{let n=I[t.status].icon,i=I[t.status].className;L[t.priority].className;let o="in_progress"===t.status&&l===e.findIndex(e=>"in_progress"===e.status);return(0,r.jsxs)("div",{className:(0,a.cn)("flex items-start gap-2 py-0.5","cancelled"===t.status&&"opacity-50"),children:[r.jsx("div",{className:"flex-shrink-0 pt-0.5",children:r.jsx(n,{className:(0,a.cn)("size-3.5",i)})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:(0,a.cn)("text-sm","completed"===t.status&&"text-muted-foreground line-through","cancelled"===t.status&&"text-muted-foreground line-through","in_progress"===t.status&&o&&"font-medium"),children:t.content}),s&&"high"===t.priority&&r.jsx("span",{className:"ml-2 text-red-500 text-xs",children:"(!)"})]})]},t.id)}),o>1&&(0,r.jsxs)("div",{className:"flex items-center gap-2 pt-1 text-muted-foreground text-xs",children:[r.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full bg-secondary",children:r.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:`${i/o*100}%`}})}),(0,r.jsxs)("span",{className:"whitespace-nowrap",children:[i,"/",o]})]}),"output-error"===t&&(0,r.jsxs)("div",{className:"flex items-center gap-1 pt-1 text-red-500 text-xs",children:[r.jsx(R.Z,{className:"size-3"}),r.jsx("span",{children:"Error updating tasks"})]})]})};var M=t(77961);function O({messages:e,status:s="idle",className:t,showActions:i=!0,onRegenerate:o,onAddToolResult:u,UntypedToolPartComponent:x,addToContext:p,writeAccess:h=!0,config:f}){let{toast:g}=(0,F.pm)();return r.jsx(r.Fragment,{children:e?.map((e,j)=>{let v=e.metadata,F=e.parts.filter(e=>"text"===e.type&&e.text?.includes('<file name="'))?.flatMap(e=>{let s=e.text.match(/<file name="([^"]+)">([^<]+)<\/file>/g);return s?.map(e=>{console.log("filePart",e);let s=e.match(/<file name="([^"]+)">/)?.[1]??"";return console.log("s3Key",s),{s3Key:s,content:e.match(/<file name="([^"]+)">([^<]+)<\/file>/)?.[2]??""}})??[]})??[];return console.log("files",F),r.jsx(l,{className:a.cn("assistant"===e.role&&(f?.customAssistantClassnames?f?.customAssistantClassnames:""),0===j&&(f?.marginTopFirstMessage?f?.marginTopFirstMessage:"mt-12"),t),from:e.role,children:r.jsxs(n,{children:[e.parts.map((t,a)=>{if("step-start"===t.type)return null;if("text"===t.type){let s=t.text.replace(/<file name="([^"]+)">([^<]+)<\/file>/g,"");return r.jsx(m.H,{className:"chat-response-container",children:s},`${e.id}-${a}_response`)}if("tool-askForConfirmation"===t.type&&u){let e=t.toolCallId;switch(t.state){case"input-streaming":return r.jsx("div",{children:"Loading confirmation request..."},e);case"input-available":return r.jsxs("div",{children:[t.input.message,r.jsxs("div",{children:[r.jsx("button",{onClick:()=>u({tool:"askForConfirmation",toolCallId:e,output:"Yes, confirmed"}),children:"Yes"}),r.jsx("button",{onClick:()=>u({tool:"askForConfirmation",toolCallId:e,output:"No, denied"}),children:"No"})]})]},e);case"output-available":return r.jsxs("div",{children:["Tool call allowed: ",t.output]},e);case"output-error":return r.jsxs("div",{children:["Error: ",t.errorText]},e)}}if(t.type?.toLowerCase().includes("preview_pdf")||t.type?.toLowerCase().includes("pdf_file_in_a_web_view")){let e=JSON.parse(t.output?.result??"{}");if(!e?.url)return r.jsxs("div",{children:["No URL provided for PDF preview ",JSON.stringify(e)]});let s=`${e.url}#page=${e.page??1}`;return r.jsx("iframe",{src:s,style:{width:"100%",height:"100vh"},title:"PDF viewer"})}if(t.type?.toLowerCase()==="tool-todo_write"||t.type?.toLowerCase()==="tool-todo_read"){let e=t.output;if(!e?.result)return null;let s=t.state;return r.jsx(E,{todos:e.result,showPriority:!0,state:s})}if((t.type.startsWith("tool-")||"dynamic-tool"===t.type)&&x&&p){let e=t.toolCallId;return r.jsx(x,{untypedToolPart:t,callId:e,addToContext:p},e)}return"file"===t.type&&t.mediaType?.startsWith("image/")?r.jsx(Z.default,{src:t.url,width:300,height:300,alt:"Generated image"},`${e.id}-${a}`):"source-url"===t.type?r.jsxs(w,{children:[r.jsx(C,{count:e.parts.filter(e=>"source-url"===e.type).length}),r.jsx(k,{children:e.parts.map((s,t)=>{if("source-url"===s.type)return r.jsx(_,{href:s.url,title:s.title},`${e.id}-${t}`)})},`${e.id}`)]},`${e.id}-${a}`):"reasoning"===t.type?r.jsxs(b,{className:"w-full",isStreaming:"streaming"===s,children:[r.jsx(N,{}),r.jsx(y,{children:t.text})]},`${e.id}-${a}`):null}),F.length>0&&r.jsx("div",{className:"grid grid-cols-6 min-w-[500px] gap-2 mt-3 mb-3",children:F.map(s=>r.jsx(M.jU,{s3Key:s.s3Key,onRemove:()=>{},active:!1,disabled:!1},s.s3Key+"_file_item_"+e.id))}),i&&"assistant"===e.role&&r.jsxs(d,{className:"mt-2",children:[o&&r.jsx(c,{onClick:()=>o(),label:"Retry",disabled:!h,children:r.jsx($.Z,{className:"size-3"})}),r.jsx(c,{onClick:()=>{navigator.clipboard.writeText(e.parts.map(e=>e?.text||"").join("\n")),g({title:"Copied message",description:"The message was copied to your clipboard."})},label:"Copy",children:r.jsx(z.Z,{className:"size-3"})}),v?.totalTokens&&r.jsxs("small",{className:"text-muted-foreground",children:[Intl.NumberFormat("en-US").format(v?.totalTokens)," tokens"]})]})]})},e.id)})})}},24295:(e,s,t)=>{t.d(s,{Fw:()=>n,wy:()=>l,zF:()=>a});var r=t(35663);let a=r.fC,l=r.wy,n=r.Fw},79210:(e,s,t)=>{t.d(s,{SP:()=>d,dr:()=>o,mQ:()=>i,nU:()=>c});var r=t(10326),a=t(28407),l=t(17577),n=t(77863);let i=a.fC,o=l.forwardRef(({className:e,...s},t)=>r.jsx(a.aV,{ref:t,className:(0,n.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=l.forwardRef(({className:e,...s},t)=>r.jsx(a.xz,{ref:t,className:(0,n.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=l.forwardRef(({className:e,...s},t)=>r.jsx(a.VY,{ref:t,className:(0,n.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}};
@@ -1 +1 @@
1
- "use strict";exports.id=3434,exports.ids=[3434],exports.modules={360:(e,s,a)=>{a.d(s,{x:()=>w});var t=a(10326),r=a(17577),l=a(18753),i=a(15211),n=a(42270),d=a(62288),o=a(90772),c=a(54432),m=a(87673),x=a(31048),h=a(941),u=a(85206),p=a(98091),v=a(34789),g=a(77863),b=a(15286),j=a(79210),f=a(36931);function w({isOpen:e,onClose:s,messages:a,sessionTitle:w,existingWorkflow:N,isReadOnly:y=!1}){let{user:C}=(0,r.useContext)(i.S),{toast:k}=(0,v.pm)(),[_,Z]=(0,r.useState)({rights_mode:N?.rights_mode||"private",users:N?.RBAC?.users||[],roles:N?.RBAC?.roles||[],projects:N?.RBAC?.projects||[]}),A=!!N,[S,z]=(0,r.useState)(N?.name||""),[E,D]=(0,r.useState)(N?.description||""),[U,B]=(0,r.useState)(N?.variables||[]),[R,W]=(0,r.useState)(N?.steps_json||[]),[$,M]=(0,r.useState)(!1),[P,V]=(0,r.useState)("setup"),[q,F]=(0,r.useState)(!1),[I,O]=(0,r.useState)(null),[H,K]=(0,r.useState)(""),[L]=(0,l.D)(n.B_),[T]=(0,l.D)(n._J),J=(0,r.useCallback)((e,s)=>{if(!e.match(/^[A-Za-z_][A-Za-z0-9_]{1,63}$/))return k({title:"Invalid variable name",description:"Variable name must start with a letter or underscore, contain only letters, numbers, and underscores, and be 2-64 characters long.",variant:"destructive"}),!1;if(U.some(s=>s.name===e))return!0;let a={name:e,type:"string",required:!0,description:s||"Auto-detected variable"};return B(e=>[...e,a]),!0},[U,k]),Q=(0,r.useCallback)((e,s)=>{let a=(s.match(/\{([A-Za-z_][A-Za-z0-9_]{1,63})\}/g)||[]).map(e=>e.slice(1,-1));a.forEach(e=>{J(e)}),W(t=>t.map(t=>t.id===e?{...t,content:s,variablesUsed:a}:t));let t=new Set;R.forEach(a=>{a.id===e?(s.match(/\{([A-Za-z_][A-Za-z0-9_]{1,63})\}/g)||[]).forEach(e=>t.add(e.slice(1,-1))):a.variablesUsed&&a.variablesUsed.forEach(e=>t.add(e))}),B(e=>e.filter(e=>t.has(e.name)))},[R,J]),G=(0,r.useCallback)(e=>{B(s=>s.filter(s=>s.name!==e)),W(s=>s.map(s=>({...s,content:s.content?.replace(RegExp(`\\{${e}\\}`,"g"),""),variablesUsed:s.variablesUsed?.filter(s=>s!==e)||[]})))},[]),X=(0,r.useCallback)((e,s)=>s.match(/^[A-Za-z_][A-Za-z0-9_]{1,63}$/)?U.some(a=>a.name===s&&a.name!==e)?(k({title:"Variable name already exists",description:"A variable with this name already exists.",variant:"destructive"}),!1):(B(a=>a.map(a=>a.name===e?{...a,name:s}:a)),W(a=>a.map(a=>({...a,content:a.content?.replace(RegExp(`\\{${e}\\}`,"g"),`{${s}}`),variablesUsed:a.variablesUsed?.map(a=>a===e?s:a)||[]}))),!0):(k({title:"Invalid variable name",description:"Variable name must start with a letter or underscore and contain only letters, numbers, and underscores.",variant:"destructive"}),!1),[U,k]),Y=(0,r.useMemo)(()=>!!S.trim()&&0!==R.length&&("users"!==_.rights_mode||_.users?.length!==0)&&("roles"!==_.rights_mode||_.roles?.length!==0)&&("projects"!==_.rights_mode||_.projects?.length!==0)&&R.filter(e=>"user"===e.type).every(e=>(e.content||"").replace(/\{[^}]+\}/g,"").trim().length>0),[S,R,_]),ee=(0,r.useCallback)(async()=>{if(Y&&C?.id){M(!0);try{let e=R.map(e=>({id:e.id,type:e.type,..."user"===e.type&&{content:e.content},..."assistant"===e.type&&{contentExample:e.contentExample},..."tool"===e.type&&{toolName:e.toolName}}));A&&N?(await T({variables:{id:N.id,name:S.trim(),description:E.trim()||null,rights_mode:_.rights_mode,RBAC:{users:_.users,roles:_.roles,projects:_.projects},variables:U,steps_json:e}}),k({title:"Workflow updated!",description:`"${S}" has been updated successfully.`})):(await L({variables:{name:S.trim(),description:E.trim()||null,owner:C.id,rights_mode:_.rights_mode,RBAC:{users:_.users,roles:_.roles,projects:_.projects},variables:U,steps_json:e}}),k({title:"Workflow created!",description:`"${S}" has been saved as a workflow template.`})),s()}catch(e){console.error("Error saving workflow:",e),k({title:"Error saving workflow",description:"There was an error saving your workflow. Please try again.",variant:"destructive"})}finally{M(!1)}}},[Y,C?.id,S,E,_,U,R,L,T,k,s,A,N]);return e?t.jsx(d.Vq,{open:e,onOpenChange:s,children:(0,t.jsxs)(d.cZ,{className:"max-w-4xl max-h-[92vh] flex flex-col",children:[(0,t.jsxs)(d.fK,{className:"pb-4",children:[t.jsx(d.$N,{className:"text-lg",children:A?y?"View Workflow":"Edit Workflow":"Save as Workflow"}),t.jsx(d.Be,{className:"text-sm",children:A?y?"View workflow details and configuration.":"Modify this workflow template. Edit your messages and use {variable_name} syntax to create variables.":"Convert this conversation into a reusable workflow template. Edit your messages and use {variable_name} syntax to create variables."})]}),t.jsx("div",{className:"flex-1 mt-6",children:(0,t.jsxs)(j.mQ,{value:P,onValueChange:V,className:"h-full flex flex-col",children:[(0,t.jsxs)(j.dr,{className:"grid w-full grid-cols-2 mb-6",children:[t.jsx(j.SP,{value:"setup",className:"data-[state=active]:bg-background",children:"Setup & Permissions"}),t.jsx(j.SP,{value:"workflow",className:"data-[state=active]:bg-background",children:"Workflow Steps & Variables"})]}),(0,t.jsxs)("div",{className:"flex-1 pb-6",children:[t.jsx(j.nU,{value:"setup",className:"mt-0 h-full",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[t.jsx(x._,{htmlFor:"workflow-name",className:"text-base font-semibold",children:"Workflow Name *"}),t.jsx(c.I,{id:"workflow-name",value:S,onChange:e=>z(e.target.value),placeholder:"My Workflow",className:"mt-2 h-11",readOnly:y}),!S.trim()&&(0,t.jsxs)("p",{className:"text-sm text-destructive mt-1 flex items-center",children:[t.jsx("span",{className:"mr-1",children:"⚠️"}),"Workflow name is required"]})]}),(0,t.jsxs)("div",{children:[t.jsx(x._,{htmlFor:"workflow-description",className:"text-base font-semibold",children:"Description"}),t.jsx(m.g,{id:"workflow-description",value:E,onChange:e=>D(e.target.value),placeholder:"Describe what this workflow does and when to use it...",rows:3,className:"mt-2 resize-none",readOnly:y})]})]}),(0,t.jsxs)("div",{className:"border-t pt-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[t.jsx("h3",{className:"text-base font-semibold mb-1",children:"Sharing & Permissions"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Control who can view and edit this workflow"})]}),(0,t.jsxs)(o.z,{type:"button",variant:"outline",size:"sm",onClick:()=>F(!q),className:"ml-4",children:[q?"Hide Advanced":"Show Advanced",t.jsx(h.Z,{className:(0,g.cn)("w-4 h-4 ml-1 transition-transform",q&&"rotate-180")})]})]}),q&&t.jsx(b.P,{initialRightsMode:N?.rights_mode,initialUsers:N?.RBAC?.users,initialRoles:N?.RBAC?.roles,initialProjects:N?.RBAC?.projects,onChange:(e,s,a,t)=>{Z({rights_mode:e,users:s,roles:a,projects:t})}}),!q&&t.jsx("div",{className:"text-sm text-muted-foreground bg-muted/30 p-3 rounded-md",children:"Using default permissions (private to you)"})]})]})}),t.jsx(j.nU,{value:"workflow",className:"mt-0 h-full",children:(0,t.jsxs)("div",{className:"h-full flex gap-6",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"mb-4",children:[t.jsx("h3",{className:"text-base font-semibold mb-2",children:"Conversation Steps"}),t.jsx("div",{className:"border rounded-lg p-3 mb-4",children:(0,t.jsxs)("p",{className:"text-sm",children:["\uD83D\uDCA1 ",t.jsx("strong",{children:"Pro tip:"})," Use ","{variable_name}"," syntax in your messages to create reusable variables. For example you can use ","{company_name}"," to create a variable for the company name so you can reuse this flow template with different companies."]})})]}),t.jsx("div",{className:"space-y-4 max-h-[500px] overflow-y-auto pr-2",children:R.map((e,s)=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"border rounded-lg p-4 bg-card",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[t.jsx("span",{className:(0,g.cn)("text-sm font-medium px-3 py-1 rounded-full","user"===e.type?"bg-blue-100 text-blue-700":"assistant"===e.type?"bg-green-100 text-green-700":"bg-purple-100 text-purple-700"),children:"user"===e.type?"\uD83D\uDC64 User":"assistant"===e.type?"\uD83E\uDD16 Assistant":`🔧 ${e.toolName}`}),e.variablesUsed&&e.variablesUsed.length>0&&t.jsx("div",{className:"flex gap-1 flex-wrap",children:e.variablesUsed.map(e=>t.jsx("span",{className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded font-mono border border-blue-200",children:`{${e}}`},e))})]}),"user"===e.type?t.jsx("div",{children:t.jsx(m.g,{value:e.content||"",onChange:s=>Q(e.id,s.target.value),placeholder:"Enter your message...",className:"min-h-[80px] resize-none",rows:3,readOnly:y})}):t.jsx("div",{className:"bg-muted/50 p-3 rounded-md",children:"assistant"===e.type?(0,t.jsxs)("div",{children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Example response (will be regenerated):"}),t.jsx(f.H,{children:e.contentExample})]}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:["Tool: ",e.toolName]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:"Parameters will be generated dynamically"})]})})]}),s<R.length-1&&t.jsx("div",{className:"flex justify-center my-3",children:t.jsx(h.Z,{className:"w-5 h-5 text-muted-foreground/50"})})]},e.id))})]}),(0,t.jsxs)("div",{className:"w-80",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("h3",{className:"text-base font-semibold mb-2",children:["Variables (",U.length,")"]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Auto-detected from your messages"})]}),U.length>0?t.jsx("div",{className:"space-y-3 max-h-[500px] overflow-y-auto",children:U.map(e=>(0,t.jsxs)("div",{className:"border rounded-lg p-3 bg-card",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[t.jsx("div",{className:"font-mono text-blue-600 font-medium text-sm",children:`{${e.name}}`}),!y&&t.jsx("div",{className:"flex gap-1",children:I===e.name?t.jsx(c.I,{value:H,onChange:e=>K(e.target.value),className:"h-6 text-xs font-mono w-20",placeholder:"variable_name",autoFocus:!0,onKeyDown:s=>{"Enter"===s.key?(H&&H!==e.name&&X(e.name,H),O(null),K("")):"Escape"===s.key&&(O(null),K(""))},onBlur:()=>{H&&H!==e.name&&X(e.name,H),O(null),K("")}}):(0,t.jsxs)(t.Fragment,{children:[t.jsx(o.z,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>{O(e.name),K(e.name)},children:t.jsx(u.Z,{className:"w-3 h-3"})}),t.jsx(o.z,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-destructive hover:bg-destructive/10",onClick:()=>G(e.name),children:t.jsx(p.Z,{className:"w-3 h-3"})})]})})]}),t.jsx("div",{className:"text-xs text-muted-foreground mb-2",children:e.description}),(0,t.jsxs)("div",{className:"flex gap-1",children:[t.jsx("span",{className:"text-xs bg-gray-100 text-gray-700 px-1.5 py-0.5 rounded",children:e.type}),e.required&&t.jsx("span",{className:"text-xs bg-orange-100 text-orange-700 px-1.5 py-0.5 rounded",children:"required"})]})]},e.name))}):(0,t.jsxs)("div",{className:"text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",children:[t.jsx("div",{className:"mb-3",children:t.jsx("span",{className:"text-3xl",children:"\uD83D\uDCDD"})}),t.jsx("div",{className:"text-sm mb-1 font-medium",children:"No variables yet"}),(0,t.jsxs)("div",{className:"text-xs",children:["Use ","{variable_name}"," syntax in your messages"]})]})]})]})})]})]})}),t.jsx("div",{className:"border-t p-4 bg-background",children:(0,t.jsxs)(d.cN,{children:[t.jsx(o.z,{variant:"outline",onClick:s,children:y?"Close":"Cancel"}),!y&&t.jsx(t.Fragment,{children:t.jsx(o.z,{onClick:ee,disabled:!Y||$,className:(0,g.cn)("min-w-[140px]",!Y&&"opacity-50 cursor-not-allowed"),children:$?(0,t.jsxs)(t.Fragment,{children:[t.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),A?"Updating...":"Saving..."]}):A?"Update Workflow":"Save Workflow"})})]})})]})}):null}},37859:(e,s,a)=>{a.d(s,{g:()=>l});var t=a(10326),r=a(77863);let l=({className:e})=>(0,t.jsxs)("svg",{"aria-hidden":"true",role:"status",className:(0,r.cn)("inline w-4 h-4 text-white animate-spin fill-inherit",e),viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",className:"fill-inherit opacity-20"}),t.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",className:"fill-inherit"})]})},54659:(e,s,a)=>{a.d(s,{Z:()=>t});let t=(0,a(76557).Z)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},12714:(e,s,a)=>{a.d(s,{Z:()=>t});let t=(0,a(76557).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},85206:(e,s,a)=>{a.d(s,{Z:()=>t});let t=(0,a(76557).Z)("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]])}};
1
+ "use strict";exports.id=3434,exports.ids=[3434],exports.modules={360:(e,s,a)=>{a.d(s,{x:()=>w});var t=a(10326),r=a(17577),l=a(18753),i=a(15211),n=a(42270),d=a(62288),o=a(90772),c=a(54432),m=a(87673),x=a(31048),u=a(941),h=a(85206),p=a(98091),v=a(34789),g=a(77863),b=a(15286),j=a(79210),f=a(36931);function w({isOpen:e,onClose:s,messages:a,sessionTitle:w,existingWorkflow:N,isReadOnly:y=!1}){let{user:C}=(0,r.useContext)(i.S),{toast:k}=(0,v.pm)(),[_,Z]=(0,r.useState)({rights_mode:N?.rights_mode||"private",users:N?.RBAC?.users||[],roles:N?.RBAC?.roles||[],projects:N?.RBAC?.projects||[]}),A=!!N,[S,z]=(0,r.useState)(N?.name||""),[E,D]=(0,r.useState)(N?.description||""),[U,B]=(0,r.useState)(N?.variables||[]),[R,W]=(0,r.useState)(N?.steps_json||[]),[$,M]=(0,r.useState)(!1),[P,V]=(0,r.useState)("setup"),[q,F]=(0,r.useState)(!1),[I,O]=(0,r.useState)(null),[H,K]=(0,r.useState)(""),[L]=(0,l.D)(n.B_),[T]=(0,l.D)(n._J),J=(0,r.useCallback)((e,s)=>{if(!e.match(/^[A-Za-z_][A-Za-z0-9_]{1,63}$/))return k({title:"Invalid variable name",description:"Variable name must start with a letter or underscore, contain only letters, numbers, and underscores, and be 2-64 characters long.",variant:"destructive"}),!1;if(U.some(s=>s.name===e))return!0;let a={name:e,type:"string",required:!0,description:s||"Auto-detected variable"};return B(e=>[...e,a]),!0},[U,k]),Q=(0,r.useCallback)((e,s)=>{let a=(s.match(/\{([A-Za-z_][A-Za-z0-9_]{1,63})\}/g)||[]).map(e=>e.slice(1,-1));a.forEach(e=>{J(e)}),W(t=>t.map(t=>t.id===e?{...t,content:s,variablesUsed:a}:t));let t=new Set;R.forEach(a=>{a.id===e?(s.match(/\{([A-Za-z_][A-Za-z0-9_]{1,63})\}/g)||[]).forEach(e=>t.add(e.slice(1,-1))):a.variablesUsed&&a.variablesUsed.forEach(e=>t.add(e))}),B(e=>e.filter(e=>t.has(e.name)))},[R,J]),G=(0,r.useCallback)(e=>{B(s=>s.filter(s=>s.name!==e)),W(s=>s.map(s=>({...s,content:s.content?.replace(RegExp(`\\{${e}\\}`,"g"),""),variablesUsed:s.variablesUsed?.filter(s=>s!==e)||[]})))},[]),X=(0,r.useCallback)((e,s)=>s.match(/^[A-Za-z_][A-Za-z0-9_]{1,63}$/)?U.some(a=>a.name===s&&a.name!==e)?(k({title:"Variable name already exists",description:"A variable with this name already exists.",variant:"destructive"}),!1):(B(a=>a.map(a=>a.name===e?{...a,name:s}:a)),W(a=>a.map(a=>({...a,content:a.content?.replace(RegExp(`\\{${e}\\}`,"g"),`{${s}}`),variablesUsed:a.variablesUsed?.map(a=>a===e?s:a)||[]}))),!0):(k({title:"Invalid variable name",description:"Variable name must start with a letter or underscore and contain only letters, numbers, and underscores.",variant:"destructive"}),!1),[U,k]),Y=(0,r.useMemo)(()=>!!S.trim()&&0!==R.length&&("users"!==_.rights_mode||_.users?.length!==0)&&("roles"!==_.rights_mode||_.roles?.length!==0)&&("projects"!==_.rights_mode||_.projects?.length!==0)&&R.filter(e=>"user"===e.type).every(e=>{let s=e.content||"";return(s?.replace(/\{[^}]+\}/g,"")).trim().length>0}),[S,R,_]),ee=(0,r.useCallback)(async()=>{if(Y&&C?.id){M(!0);try{let e=R.map(e=>({id:e.id,type:e.type,..."user"===e.type&&{content:e.content},..."assistant"===e.type&&{contentExample:e.contentExample},..."tool"===e.type&&{toolName:e.toolName}}));A&&N?(await T({variables:{id:N.id,name:S.trim(),description:E.trim()||null,rights_mode:_.rights_mode,RBAC:{users:_.users,roles:_.roles,projects:_.projects},variables:U,steps_json:e}}),k({title:"Workflow updated!",description:`"${S}" has been updated successfully.`})):(await L({variables:{name:S.trim(),description:E.trim()||null,owner:C.id,rights_mode:_.rights_mode,RBAC:{users:_.users,roles:_.roles,projects:_.projects},variables:U,steps_json:e}}),k({title:"Workflow created!",description:`"${S}" has been saved as a workflow template.`})),s()}catch(e){console.error("Error saving workflow:",e),k({title:"Error saving workflow",description:"There was an error saving your workflow. Please try again.",variant:"destructive"})}finally{M(!1)}}},[Y,C?.id,S,E,_,U,R,L,T,k,s,A,N]);return e?t.jsx(d.Vq,{open:e,onOpenChange:s,children:(0,t.jsxs)(d.cZ,{className:"max-w-4xl max-h-[92vh] flex flex-col",children:[(0,t.jsxs)(d.fK,{className:"pb-4",children:[t.jsx(d.$N,{className:"text-lg",children:A?y?"View Workflow":"Edit Workflow":"Save as Workflow"}),t.jsx(d.Be,{className:"text-sm",children:A?y?"View workflow details and configuration.":"Modify this workflow template. Edit your messages and use {variable_name} syntax to create variables.":"Convert this conversation into a reusable workflow template. Edit your messages and use {variable_name} syntax to create variables."})]}),t.jsx("div",{className:"flex-1 mt-6",children:(0,t.jsxs)(j.mQ,{value:P,onValueChange:V,className:"h-full flex flex-col",children:[(0,t.jsxs)(j.dr,{className:"grid w-full grid-cols-2 mb-6",children:[t.jsx(j.SP,{value:"setup",className:"data-[state=active]:bg-background",children:"Setup & Permissions"}),t.jsx(j.SP,{value:"workflow",className:"data-[state=active]:bg-background",children:"Workflow Steps & Variables"})]}),(0,t.jsxs)("div",{className:"flex-1 pb-6",children:[t.jsx(j.nU,{value:"setup",className:"mt-0 h-full",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[t.jsx(x._,{htmlFor:"workflow-name",className:"text-base font-semibold",children:"Workflow Name *"}),t.jsx(c.I,{id:"workflow-name",value:S,onChange:e=>z(e.target.value),placeholder:"My Workflow",className:"mt-2 h-11",readOnly:y}),!S.trim()&&(0,t.jsxs)("p",{className:"text-sm text-destructive mt-1 flex items-center",children:[t.jsx("span",{className:"mr-1",children:"⚠️"}),"Workflow name is required"]})]}),(0,t.jsxs)("div",{children:[t.jsx(x._,{htmlFor:"workflow-description",className:"text-base font-semibold",children:"Description"}),t.jsx(m.g,{id:"workflow-description",value:E,onChange:e=>D(e.target.value),placeholder:"Describe what this workflow does and when to use it...",rows:3,className:"mt-2 resize-none",readOnly:y})]})]}),(0,t.jsxs)("div",{className:"border-t pt-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[t.jsx("h3",{className:"text-base font-semibold mb-1",children:"Sharing & Permissions"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Control who can view and edit this workflow"})]}),(0,t.jsxs)(o.z,{type:"button",variant:"outline",size:"sm",onClick:()=>F(!q),className:"ml-4",children:[q?"Hide Advanced":"Show Advanced",t.jsx(u.Z,{className:(0,g.cn)("w-4 h-4 ml-1 transition-transform",q&&"rotate-180")})]})]}),q&&t.jsx(b.P,{initialRightsMode:N?.rights_mode,initialUsers:N?.RBAC?.users,initialRoles:N?.RBAC?.roles,initialProjects:N?.RBAC?.projects,onChange:(e,s,a,t)=>{Z({rights_mode:e,users:s,roles:a,projects:t})}}),!q&&t.jsx("div",{className:"text-sm text-muted-foreground bg-muted/30 p-3 rounded-md",children:"Using default permissions (private to you)"})]})]})}),t.jsx(j.nU,{value:"workflow",className:"mt-0 h-full",children:(0,t.jsxs)("div",{className:"h-full flex gap-6",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"mb-4",children:[t.jsx("h3",{className:"text-base font-semibold mb-2",children:"Conversation Steps"}),t.jsx("div",{className:"border rounded-lg p-3 mb-4",children:(0,t.jsxs)("p",{className:"text-sm",children:["\uD83D\uDCA1 ",t.jsx("strong",{children:"Pro tip:"})," Use ","{variable_name}"," syntax in your messages to create reusable variables. For example you can use ","{company_name}"," to create a variable for the company name so you can reuse this flow template with different companies."]})})]}),t.jsx("div",{className:"space-y-4 max-h-[500px] overflow-y-auto pr-2",children:R.map((e,s)=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"border rounded-lg p-4 bg-card",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[t.jsx("span",{className:(0,g.cn)("text-sm font-medium px-3 py-1 rounded-full","user"===e.type?"bg-blue-100 text-blue-700":"assistant"===e.type?"bg-green-100 text-green-700":"bg-purple-100 text-purple-700"),children:"user"===e.type?"\uD83D\uDC64 User":"assistant"===e.type?"\uD83E\uDD16 Assistant":`🔧 ${e.toolName}`}),e.variablesUsed&&e.variablesUsed.length>0&&t.jsx("div",{className:"flex gap-1 flex-wrap",children:e.variablesUsed.map(e=>t.jsx("span",{className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded font-mono border border-blue-200",children:`{${e}}`},e))})]}),"user"===e.type?t.jsx("div",{children:t.jsx(m.g,{value:e.content||"",onChange:s=>Q(e.id,s.target.value),placeholder:"Enter your message...",className:"min-h-[80px] resize-none",rows:3,readOnly:y})}):t.jsx("div",{className:"bg-muted/50 p-3 rounded-md",children:"assistant"===e.type?(0,t.jsxs)("div",{children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Example response (will be regenerated):"}),t.jsx(f.H,{children:e.contentExample})]}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:["Tool: ",e.toolName]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:"Parameters will be generated dynamically"})]})})]}),s<R.length-1&&t.jsx("div",{className:"flex justify-center my-3",children:t.jsx(u.Z,{className:"w-5 h-5 text-muted-foreground/50"})})]},e.id))})]}),(0,t.jsxs)("div",{className:"w-80",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("h3",{className:"text-base font-semibold mb-2",children:["Variables (",U.length,")"]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Auto-detected from your messages"})]}),U.length>0?t.jsx("div",{className:"space-y-3 max-h-[500px] overflow-y-auto",children:U.map(e=>(0,t.jsxs)("div",{className:"border rounded-lg p-3 bg-card",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[t.jsx("div",{className:"font-mono text-blue-600 font-medium text-sm",children:`{${e.name}}`}),!y&&t.jsx("div",{className:"flex gap-1",children:I===e.name?t.jsx(c.I,{value:H,onChange:e=>K(e.target.value),className:"h-6 text-xs font-mono w-20",placeholder:"variable_name",autoFocus:!0,onKeyDown:s=>{"Enter"===s.key?(H&&H!==e.name&&X(e.name,H),O(null),K("")):"Escape"===s.key&&(O(null),K(""))},onBlur:()=>{H&&H!==e.name&&X(e.name,H),O(null),K("")}}):(0,t.jsxs)(t.Fragment,{children:[t.jsx(o.z,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>{O(e.name),K(e.name)},children:t.jsx(h.Z,{className:"w-3 h-3"})}),t.jsx(o.z,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-destructive hover:bg-destructive/10",onClick:()=>G(e.name),children:t.jsx(p.Z,{className:"w-3 h-3"})})]})})]}),t.jsx("div",{className:"text-xs text-muted-foreground mb-2",children:e.description}),(0,t.jsxs)("div",{className:"flex gap-1",children:[t.jsx("span",{className:"text-xs bg-gray-100 text-gray-700 px-1.5 py-0.5 rounded",children:e.type}),e.required&&t.jsx("span",{className:"text-xs bg-orange-100 text-orange-700 px-1.5 py-0.5 rounded",children:"required"})]})]},e.name))}):(0,t.jsxs)("div",{className:"text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",children:[t.jsx("div",{className:"mb-3",children:t.jsx("span",{className:"text-3xl",children:"\uD83D\uDCDD"})}),t.jsx("div",{className:"text-sm mb-1 font-medium",children:"No variables yet"}),(0,t.jsxs)("div",{className:"text-xs",children:["Use ","{variable_name}"," syntax in your messages"]})]})]})]})})]})]})}),t.jsx("div",{className:"border-t p-4 bg-background",children:(0,t.jsxs)(d.cN,{children:[t.jsx(o.z,{variant:"outline",onClick:s,children:y?"Close":"Cancel"}),!y&&t.jsx(t.Fragment,{children:t.jsx(o.z,{onClick:ee,disabled:!Y||$,className:(0,g.cn)("min-w-[140px]",!Y&&"opacity-50 cursor-not-allowed"),children:$?(0,t.jsxs)(t.Fragment,{children:[t.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),A?"Updating...":"Saving..."]}):A?"Update Workflow":"Save Workflow"})})]})})]})}):null}},37859:(e,s,a)=>{a.d(s,{g:()=>l});var t=a(10326),r=a(77863);let l=({className:e})=>(0,t.jsxs)("svg",{"aria-hidden":"true",role:"status",className:(0,r.cn)("inline w-4 h-4 text-white animate-spin fill-inherit",e),viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",className:"fill-inherit opacity-20"}),t.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",className:"fill-inherit"})]})},54659:(e,s,a)=>{a.d(s,{Z:()=>t});let t=(0,a(76557).Z)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},12714:(e,s,a)=>{a.d(s,{Z:()=>t});let t=(0,a(76557).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},85206:(e,s,a)=>{a.d(s,{Z:()=>t});let t=(0,a(76557).Z)("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]])}};
@@ -1 +1 @@
1
- exports.id=3575,exports.ids=[3575],exports.modules={30058:(e,s,t)=>{Promise.resolve().then(t.bind(t,92214))},92214:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>F});var a=t(10326),l=t(90434),n=t(88307),r=t(11890),i=t(33734),d=t(18019),o=t(90772),c=t(54432),x=t(39167),h=t(18753),u=t(42270),m=t(17577),g=t(29718),f=t(35047),p=t(65304),j=t(30510),v=t(15211),N=t(76812),w=t(32663),b=t(83855),y=t(60097),k=t(62288),S=t(34789),C=t(77863),z=t(13854),_=t(43641);function O({agent:e,type:s}){let t=(0,f.usePathname)(),{toast:r}=(0,S.pm)(),{user:i}=(0,m.useContext)(v.S),[d,g]=(0,m.useState)("");(0,z.d)();let j=(0,f.useRouter)(),[O,P]=(0,m.useState)({searchString:null}),[F,D]=(0,m.useState)(!1),[$,I]=(0,m.useState)(null),[Z,A]=(0,m.useState)(""),B=(0,x.aM)(u.GJ,{returnPartialData:!0,fetchPolicy:"network-only",nextFetchPolicy:"network-only",variables:{page:1,limit:40,filters:{agent:{eq:e}}}}),[R,G]=(0,h.D)(u.S9,{refetchQueries:[u.GJ,"GetAgentSessions"]}),[L,W]=(0,h.D)(u.fB),[E,K]=(0,h.D)(u.bI,{refetchQueries:[u.GJ,"GetAgentSessions"]}),J=async()=>{let s=await L({variables:{user:i.id,agent:e,type:"FLOW",title:d.trim(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}});if(s.errors){console.error("error",s.errors);return}if(!s.data?.agent_sessionsCreateOne?.item?.id){console.error("error","failed to create session");return}g(""),B.refetch(),j.push(`/chat/${e}/${s.data?.agent_sessionsCreateOne?.item?.id}`)},M=async()=>{if(!$||!Z.trim())return;let e=await E({variables:{id:$,title:Z.trim()}});if(e.errors){console.error("error",e.errors),r({title:"Error",description:"Failed to rename session.",variant:"destructive"});return}r({title:"Session renamed",description:"The session has been renamed successfully."}),D(!1),I(null),A("")};return(0,a.jsxs)("div",{className:"relative hidden flex-col items-start md:flex h-100 overflow-y-scroll border-r","x-chunk":"dashboard-03-chunk-0",children:[a.jsx("h2",{className:"mb-2 px-4 text-lg font-semibold tracking-tight",children:"Sessions"}),a.jsx("div",{className:"bg-background/95 w-full backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsx("form",{children:(0,a.jsxs)("div",{className:"relative",children:[a.jsx(n.Z,{className:"absolute left-2 top-2.5 size-4 text-muted-foreground"}),a.jsx(c.I,{onKeyUp:e=>{P(e.currentTarget.value)},placeholder:"Search sessions",className:"pl-8 border-0"})]})})}),(0,a.jsxs)("div",{className:"flex w-full items-center gap-2 p-3 border-t justify-between",children:[a.jsx(c.I,{autoFocus:!0,value:d,onChange:e=>g(e.target.value),onKeyDown:e=>{"Enter"===e.key&&J()},placeholder:"Name",className:"flex-1"}),a.jsx(o.z,{variant:"secondary",tabIndex:1,disabled:W.loading||!d.trim(),onClick:async()=>{J()},children:a.jsx("div",{className:"font-semibold",children:a.jsx(b.Z,{})})})]}),B.loading&&(0,a.jsxs)("div",{className:"w-full flex flex-col p-2 pt-0 pb-2",children:[a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md"}),a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md mt-3"}),a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md mt-3"}),a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md mt-3"})]}),!B.loading&&!B?.data?.agent_sessionsPagination?.items?.length&&a.jsx("div",{className:"w-full flex",children:a.jsx("p",{className:"mx-auto mt-5",children:"No sessions found."})}),B.loading?null:B?.data?.agent_sessionsPagination?.items?.map(s=>{let n=_.I({...s,agent:s.agent.id},i);return a.jsx("div",{className:"w-full px-2 flex flex-col items-start gap-0 rounded-none border-none text-left text-sm mb-2",children:a.jsx(l.default,{href:`/chat/${e}/${s.id}`,className:C.cn("p-2 w-full flex flex-col items-start gap-2 rounded-md p-3 text-left text-sm transition-all hover:bg-accent",t.includes(s.id)&&"bg-muted",n?"border border-l-4 border-r-0 border-y-0 border-gray-700":"border border-l-4 border-r-0 border-y-0 border-yellow-900"),children:a.jsxs("div",{className:"flex w-full flex-col px-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"text-md font-medium max-w-[80%] truncate",children:s.title?s.title?.substring(0,20):"No title"}),a.jsxs("div",{className:C.cn("ml-0 text-xs capitalize",t.includes(s.id)?"text-foreground":"text-muted-foreground"),children:[s.updatedAt?w.Q(new Date(s.updatedAt),{addSuffix:!0}):null,"."]})]}),n&&a.jsxs(y.h_,{modal:!1,children:[a.jsx(y.$F,{asChild:!0,children:a.jsxs(o.z,{variant:"ghost",className:"flex size-8 p-0 data-[state=open]:bg-muted",children:[a.jsx(N.nWS,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Open menu"})]})}),a.jsxs(y.AW,{align:"end",className:"w-[160px]",children:[a.jsx(y.Xi,{className:"cursor-pointer",onClick:e=>{e.preventDefault(),e.stopPropagation(),I(s.id),A(s.title||""),D(!0)},children:"Rename"}),a.jsx(y.Xi,{className:"cursor-pointer",onClick:()=>{R({variables:{id:s.id}}),r({title:"Deleting session",description:"We deleted the session."})},children:"Delete"})]})]})]}),a.jsx("small",{className:"text-xs text-muted-foreground",children:s.agent?.name})]})},s.id)},s.id)}),a.jsx(k.Vq,{open:F,onOpenChange:D,children:(0,a.jsxs)(k.cZ,{children:[(0,a.jsxs)(k.fK,{children:[a.jsx(k.$N,{children:"Rename Session"}),a.jsx(k.Be,{children:"Enter a new name for this session."})]}),a.jsx(c.I,{value:Z,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"===e.key&&M()},placeholder:"Session name"}),(0,a.jsxs)(k.cN,{children:[a.jsx(o.z,{variant:"outline",onClick:()=>{D(!1),I(null),A("")},children:"Cancel"}),a.jsx(o.z,{onClick:M,disabled:K.loading||!Z.trim(),children:"Rename"})]})]})})]},e+s)}function P(){let[e,s]=m.useState(""),[t,N]=m.useState(null),[w,b]=m.useState(!1),[y,k]=m.useState(!1),[S,C]=m.useState(!1),z=(0,f.useParams)(),_=(0,f.usePathname)(),{user:P}=(0,m.useContext)(v.S),[F,D]=(0,m.useState)(P),$=(0,x.aM)(u.W9,{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{ids:F?.favourite_agents||[]},skip:!F?.favourite_agents?.length}),I=(0,x.aM)(u.ym,{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{page:1,limit:200,filters:{...F?.super_admin?{}:{active:!0},...e?{name:{contains:e}}:{}}}}),[Z]=(0,h.D)(u.Pe,{onCompleted:e=>{D({...F,favourite_agents:e.usersUpdateOneById?.item?.favourite_agents})}}),A=(e,s)=>{s.preventDefault(),s.stopPropagation(),N(e),b(!0)},B=(e,s)=>{let t;s.preventDefault(),s.stopPropagation(),console.log("user",F);let a=F?.favourite_agents||[];console.log("newFavourites",t=a.includes(e)?a.filter(s=>s!==e):[...a,e]),Z({variables:{id:F.id,favourite_agents:t}})},R=z.agent?I?.data?.agentsPagination?.items?.find(e=>e.id===z.agent):null,G=e=>e.image?a.jsx("img",{src:e.image,alt:`${e.name} profile`,className:"h-4 w-4 rounded-full object-cover"}):a.jsx("div",{className:"h-4 w-4 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white text-xs font-medium",children:e.name?.charAt(0).toUpperCase()||"A"});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"pb-12 w-[250px]",children:[a.jsx("div",{className:"space-y-4 py-4",children:(0,a.jsxs)("div",{children:[a.jsx("h2",{className:"mb-2 px-4 text-lg font-semibold tracking-tight",children:"Agents"}),a.jsx("div",{children:(0,a.jsxs)("div",{className:"relative",children:[a.jsx(n.Z,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),a.jsx(c.I,{placeholder:"Search agents...",value:e,onChange:e=>s(e.target.value),className:"pl-8 h-9 border-0"})]})}),(0,a.jsxs)("div",{className:"space-y-1 border-t px-2 pt-2",children:[R&&!S&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:()=>C(!S),children:a.jsx(r.Z,{className:"h-3 w-3"})}),a.jsx(l.default,{onClick:()=>C(!1),href:`/chat/${R.id}`,className:"flex-1",children:(0,a.jsxs)(o.z,{onClick:()=>C(!1),variant:_.includes(R.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-5",children:[G(R),a.jsx("span",{className:"flex-1 text-left",children:a.jsx(g.L,{text:R.name,length:7})})]})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:e=>B(R.id,e),children:a.jsx(i.Z,{className:"h-3 w-3 fill-yellow-400 text-yellow-400"})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:e=>A(R.id,e),children:a.jsx(d.Z,{className:"h-3 w-3"})})]},`fav-${R.id}`),(!R||S||e)&&(0,a.jsxs)(a.Fragment,{children:[F?.favourite_agents&&F?.favourite_agents?.length>0&&!e&&(0,a.jsxs)(a.Fragment,{children:[$.loading&&(0,a.jsxs)(a.Fragment,{children:[a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"})]}),!$.loading&&(()=>{let e=$?.data?.agentByIds||[],s=y?e:e.slice(0,4);return(0,a.jsxs)(a.Fragment,{children:[s.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx(l.default,{href:`/chat/${e.id}`,className:"flex-1",children:(0,a.jsxs)(o.z,{variant:_.includes(e.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-1",children:[G(e),a.jsx("span",{className:"flex-1 text-left",children:a.jsx(g.L,{text:e.name,length:10})})]})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>B(e.id,s),children:a.jsx(i.Z,{className:"h-3 w-3 fill-yellow-400 text-yellow-400"})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>A(e.id,s),children:a.jsx(d.Z,{className:"h-3 w-3"})})]},`fav-${e.id}`)),e.length>4&&a.jsx(o.z,{variant:"ghost",className:"w-full justify-center text-xs text-muted-foreground h-8",onClick:()=>k(!y),children:y?"Show less":`Show more (${e.length-4})`})]})})()]}),I.loading&&(0,a.jsxs)(a.Fragment,{children:[a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"})]}),!I.loading&&(()=>{let s=I?.data?.agentsPagination?.items?.filter(s=>!F?.favourite_agents?.includes(s.id)||e)||[],t=e||S?s:s.slice(0,4);return(0,a.jsxs)(a.Fragment,{children:[t.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx(l.default,{href:`/chat/${e.id}`,className:"flex-1",children:(0,a.jsxs)(o.z,{variant:_.includes(e.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-1",children:[G(e),a.jsx("span",{className:"flex-1 text-left",children:a.jsx(g.L,{text:e.name,length:14})})]})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>B(e.id,s),children:a.jsx(i.Z,{className:`h-3 w-3 ${F?.favourite_agents?.includes(e.id)?"fill-yellow-400 text-yellow-400":""}`})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>A(e.id,s),children:a.jsx(d.Z,{className:"h-3 w-3"})})]},e.id)),!e&&s.length>4&&a.jsx(o.z,{variant:"ghost",className:"w-full justify-center text-xs text-muted-foreground h-8",onClick:()=>C(!S),children:S?"Show less":`Show more (${s.length-4})`})]})})()]})]})]})}),z.agent&&a.jsx(O,{agent:z.agent,type:"chat"})]}),t&&a.jsx(j.z,{agentId:t,open:w,onOpenChange:e=>{b(e),e||N(null)}})]})}function F({children:e}){return(0,a.jsxs)("div",{className:"flex h-full",children:[a.jsx("div",{className:"border-r bg-muted/10",children:a.jsx(P,{})}),e]})}},29718:(e,s,t)=>{"use strict";t.d(s,{L:()=>l});var a=t(10326);function l({text:e,length:s}){return e.length>s?(0,a.jsxs)(a.Fragment,{children:[e.slice(0,s),"..."]}):a.jsx(a.Fragment,{children:e})}},43641:(e,s,t)=>{"use strict";t.d(s,{I:()=>a});let a=(e,s)=>{let t="private"===e.rights_mode,a="public"===e.rights_mode,l="users"===e.rights_mode,n="roles"===e.rights_mode,r=s.super_admin,i=e.created_by===s.id.toString(),d=!1;return t&&i&&(d=!0),a&&(d=!0),l&&(d=e.RBAC?.users?.find(e=>e.id===s.id)?.rights==="write"),n&&(d=e.RBAC?.roles?.find(e=>e.id===s.role?.id)?.rights==="write"),r&&(d=!0),d}},33734:(e,s,t)=>{"use strict";t.d(s,{Z:()=>a});let a=(0,t(76557).Z)("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]])},90502:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>a});let a=(0,t(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/chat/layout.tsx#default`)}};
1
+ exports.id=3575,exports.ids=[3575],exports.modules={30058:(e,s,t)=>{Promise.resolve().then(t.bind(t,92214))},92214:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>F});var a=t(10326),l=t(90434),n=t(88307),r=t(11890),i=t(33734),d=t(18019),o=t(90772),c=t(54432),x=t(39167),h=t(18753),u=t(42270),m=t(17577),g=t(29718),f=t(35047),p=t(65304),j=t(30510),v=t(15211),N=t(76812),w=t(32663),b=t(83855),y=t(60097),k=t(62288),S=t(34789),C=t(77863),z=t(13854),_=t(43641);function O({agent:e,type:s}){let t=(0,f.usePathname)(),{toast:r}=(0,S.pm)(),{user:i}=(0,m.useContext)(v.S),[d,g]=(0,m.useState)("");(0,z.d)();let j=(0,f.useRouter)(),[O,P]=(0,m.useState)({searchString:null}),[F,D]=(0,m.useState)(!1),[$,I]=(0,m.useState)(null),[Z,A]=(0,m.useState)(""),B=(0,x.aM)(u.GJ,{returnPartialData:!0,fetchPolicy:"network-only",nextFetchPolicy:"network-only",variables:{page:1,limit:40,filters:{agent:{eq:e}}}}),[R,G]=(0,h.D)(u.S9,{refetchQueries:[u.GJ,"GetAgentSessions"]}),[L,W]=(0,h.D)(u.fB),[E,K]=(0,h.D)(u.bI,{refetchQueries:[u.GJ,"GetAgentSessions"]}),J=async()=>{let s=await L({variables:{user:i.id,agent:e,type:"FLOW",title:d.trim(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}});if(s.errors){console.error("error",s.errors);return}if(!s.data?.agent_sessionsCreateOne?.item?.id){console.error("error","failed to create session");return}g(""),B.refetch(),j.push(`/chat/${e}/${s.data?.agent_sessionsCreateOne?.item?.id}`)},M=async()=>{if(!$||!Z.trim())return;let e=await E({variables:{id:$,title:Z.trim()}});if(e.errors){console.error("error",e.errors),r({title:"Error",description:"Failed to rename session.",variant:"destructive"});return}r({title:"Session renamed",description:"The session has been renamed successfully."}),D(!1),I(null),A("")};return(0,a.jsxs)("div",{className:"relative hidden flex-col items-start md:flex border-r","x-chunk":"dashboard-03-chunk-0",children:[a.jsx("h2",{className:"mb-2 px-4 text-lg font-semibold tracking-tight",children:"Sessions"}),a.jsx("div",{className:"bg-background/95 w-full backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsx("form",{children:(0,a.jsxs)("div",{className:"relative",children:[a.jsx(n.Z,{className:"absolute left-2 top-2.5 size-4 text-muted-foreground"}),a.jsx(c.I,{onKeyUp:e=>{P(e.currentTarget.value)},placeholder:"Search sessions",className:"pl-8 border-0"})]})})}),(0,a.jsxs)("div",{className:"flex w-full items-center gap-2 p-3 border-t justify-between",children:[a.jsx(c.I,{autoFocus:!0,value:d,onChange:e=>g(e.target.value),onKeyDown:e=>{"Enter"===e.key&&J()},placeholder:"Name",className:"flex-1"}),a.jsx(o.z,{variant:"secondary",tabIndex:1,disabled:W.loading||!d.trim(),onClick:async()=>{J()},children:a.jsx("div",{className:"font-semibold",children:a.jsx(b.Z,{})})})]}),B.loading&&(0,a.jsxs)("div",{className:"w-full flex flex-col p-2 pt-0 pb-2",children:[a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md"}),a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md mt-3"}),a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md mt-3"}),a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md mt-3"})]}),!B.loading&&!B?.data?.agent_sessionsPagination?.items?.length&&a.jsx("div",{className:"w-full flex",children:a.jsx("p",{className:"mx-auto mt-5",children:"No sessions found."})}),B.loading?null:B?.data?.agent_sessionsPagination?.items?.map(s=>{let n=_.I({...s,agent:s.agent.id},i);return a.jsx("div",{className:"w-full px-2 flex flex-col items-start gap-0 rounded-none border-none text-left text-sm mb-2",children:a.jsx(l.default,{href:`/chat/${e}/${s.id}`,className:C.cn("p-2 w-full flex flex-col items-start gap-2 rounded-md p-3 text-left text-sm transition-all hover:bg-accent",t.includes(s.id)&&"bg-muted",n?"border border-l-4 border-r-0 border-y-0 border-gray-700":"border border-l-4 border-r-0 border-y-0 border-yellow-900"),children:a.jsxs("div",{className:"flex w-full flex-col px-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"text-md font-medium max-w-[80%] truncate",children:s.title?s.title?.substring(0,20):"No title"}),a.jsxs("div",{className:C.cn("ml-0 text-xs capitalize",t.includes(s.id)?"text-foreground":"text-muted-foreground"),children:[s.updatedAt?w.Q(new Date(s.updatedAt),{addSuffix:!0}):null,"."]})]}),n&&a.jsxs(y.h_,{modal:!1,children:[a.jsx(y.$F,{asChild:!0,children:a.jsxs(o.z,{variant:"ghost",className:"flex size-8 p-0 data-[state=open]:bg-muted",children:[a.jsx(N.nWS,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Open menu"})]})}),a.jsxs(y.AW,{align:"end",className:"w-[160px]",children:[a.jsx(y.Xi,{className:"cursor-pointer",onClick:e=>{e.preventDefault(),e.stopPropagation(),I(s.id),A(s.title||""),D(!0)},children:"Rename"}),a.jsx(y.Xi,{className:"cursor-pointer",onClick:()=>{R({variables:{id:s.id}}),r({title:"Deleting session",description:"We deleted the session."})},children:"Delete"})]})]})]}),a.jsx("small",{className:"text-xs text-muted-foreground",children:s.agent?.name})]})},s.id)},s.id)}),a.jsx(k.Vq,{open:F,onOpenChange:D,children:(0,a.jsxs)(k.cZ,{children:[(0,a.jsxs)(k.fK,{children:[a.jsx(k.$N,{children:"Rename Session"}),a.jsx(k.Be,{children:"Enter a new name for this session."})]}),a.jsx(c.I,{value:Z,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"===e.key&&M()},placeholder:"Session name"}),(0,a.jsxs)(k.cN,{children:[a.jsx(o.z,{variant:"outline",onClick:()=>{D(!1),I(null),A("")},children:"Cancel"}),a.jsx(o.z,{onClick:M,disabled:K.loading||!Z.trim(),children:"Rename"})]})]})})]},e+s)}function P(){let[e,s]=m.useState(""),[t,N]=m.useState(null),[w,b]=m.useState(!1),[y,k]=m.useState(!1),[S,C]=m.useState(!1),z=(0,f.useParams)(),_=(0,f.usePathname)(),{user:P}=(0,m.useContext)(v.S),[F,D]=(0,m.useState)(P),$=(0,x.aM)(u.W9,{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{ids:F?.favourite_agents||[]},skip:!F?.favourite_agents?.length}),I=(0,x.aM)(u.ym,{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{page:1,limit:200,filters:{...F?.super_admin?{}:{active:!0},...e?{name:{contains:e}}:{}}}}),[Z]=(0,h.D)(u.Pe,{onCompleted:e=>{D({...F,favourite_agents:e.usersUpdateOneById?.item?.favourite_agents})}}),A=(e,s)=>{s.preventDefault(),s.stopPropagation(),N(e),b(!0)},B=(e,s)=>{let t;s.preventDefault(),s.stopPropagation(),console.log("user",F);let a=F?.favourite_agents||[];console.log("newFavourites",t=a.includes(e)?a.filter(s=>s!==e):[...a,e]),Z({variables:{id:F.id,favourite_agents:t}})},R=z.agent?I?.data?.agentsPagination?.items?.find(e=>e.id===z.agent):null,G=e=>e.image?a.jsx("img",{src:e.image,alt:`${e.name} profile`,className:"h-4 w-4 rounded-full object-cover"}):a.jsx("div",{className:"h-4 w-4 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white text-xs font-medium",children:e.name?.charAt(0).toUpperCase()||"A"});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"pb-12 w-[250px] max-h-[calc(100vh)] overflow-y-auto overflow-x-hidden",children:[a.jsx("div",{className:"space-y-4 py-4",children:(0,a.jsxs)("div",{children:[a.jsx("h2",{className:"mb-2 px-4 text-lg font-semibold tracking-tight",children:"Agents"}),a.jsx("div",{children:(0,a.jsxs)("div",{className:"relative",children:[a.jsx(n.Z,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),a.jsx(c.I,{placeholder:"Search agents...",value:e,onChange:e=>s(e.target.value),className:"pl-8 h-9 border-0"})]})}),(0,a.jsxs)("div",{className:"space-y-1 border-t px-2 pt-2",children:[R&&!S&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:()=>C(!S),children:a.jsx(r.Z,{className:"h-3 w-3"})}),a.jsx(l.default,{onClick:()=>C(!1),href:`/chat/${R.id}`,className:"flex-1",children:(0,a.jsxs)(o.z,{onClick:()=>C(!1),variant:_.includes(R.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-5",children:[G(R),a.jsx("span",{className:"flex-1 text-left",children:a.jsx(g.L,{text:R.name,length:7})})]})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:e=>B(R.id,e),children:a.jsx(i.Z,{className:"h-3 w-3 fill-yellow-400 text-yellow-400"})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:e=>A(R.id,e),children:a.jsx(d.Z,{className:"h-3 w-3"})})]},`fav-${R.id}`),(!R||S||e)&&(0,a.jsxs)(a.Fragment,{children:[F?.favourite_agents&&F?.favourite_agents?.length>0&&!e&&(0,a.jsxs)(a.Fragment,{children:[$.loading&&(0,a.jsxs)(a.Fragment,{children:[a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"})]}),!$.loading&&(()=>{let e=$?.data?.agentByIds||[],s=y?e:e.slice(0,4);return(0,a.jsxs)(a.Fragment,{children:[s.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx(l.default,{href:`/chat/${e.id}`,className:"flex-1",children:(0,a.jsxs)(o.z,{variant:_.includes(e.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-1",children:[G(e),a.jsx("span",{className:"flex-1 text-left",children:a.jsx(g.L,{text:e.name,length:10})})]})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>B(e.id,s),children:a.jsx(i.Z,{className:"h-3 w-3 fill-yellow-400 text-yellow-400"})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>A(e.id,s),children:a.jsx(d.Z,{className:"h-3 w-3"})})]},`fav-${e.id}`)),e.length>4&&a.jsx(o.z,{variant:"ghost",className:"w-full justify-center text-xs text-muted-foreground h-8",onClick:()=>k(!y),children:y?"Show less":`Show more (${e.length-4})`})]})})()]}),I.loading&&(0,a.jsxs)(a.Fragment,{children:[a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"})]}),!I.loading&&(()=>{let s=I?.data?.agentsPagination?.items?.filter(s=>!F?.favourite_agents?.includes(s.id)||e)||[],t=e||S?s:s.slice(0,4);return(0,a.jsxs)(a.Fragment,{children:[t.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx(l.default,{href:`/chat/${e.id}`,className:"flex-1",children:(0,a.jsxs)(o.z,{variant:_.includes(e.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-1",children:[G(e),a.jsx("span",{className:"flex-1 text-left",children:a.jsx(g.L,{text:e.name,length:14})})]})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>B(e.id,s),children:a.jsx(i.Z,{className:`h-3 w-3 ${F?.favourite_agents?.includes(e.id)?"fill-yellow-400 text-yellow-400":""}`})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>A(e.id,s),children:a.jsx(d.Z,{className:"h-3 w-3"})})]},e.id)),!e&&s.length>4&&a.jsx(o.z,{variant:"ghost",className:"w-full justify-center text-xs text-muted-foreground h-8",onClick:()=>C(!S),children:S?"Show less":`Show more (${s.length-4})`})]})})()]})]})]})}),z.agent&&a.jsx(O,{agent:z.agent,type:"chat"})]}),t&&a.jsx(j.z,{agentId:t,open:w,onOpenChange:e=>{b(e),e||N(null)}})]})}function F({children:e}){return(0,a.jsxs)("div",{className:"flex h-full",children:[a.jsx("div",{className:"border-r bg-muted/10",children:a.jsx(P,{})}),e]})}},29718:(e,s,t)=>{"use strict";t.d(s,{L:()=>l});var a=t(10326);function l({text:e,length:s}){return e.length>s?(0,a.jsxs)(a.Fragment,{children:[e.slice(0,s),"..."]}):a.jsx(a.Fragment,{children:e})}},43641:(e,s,t)=>{"use strict";t.d(s,{I:()=>a});let a=(e,s)=>{let t="private"===e.rights_mode,a="public"===e.rights_mode,l="users"===e.rights_mode,n="roles"===e.rights_mode,r=s.super_admin,i=e.created_by===s.id.toString(),d=!1;return t&&i&&(d=!0),a&&(d=!0),l&&(d=e.RBAC?.users?.find(e=>e.id===s.id)?.rights==="write"),n&&(d=e.RBAC?.roles?.find(e=>e.id===s.role?.id)?.rights==="write"),r&&(d=!0),d}},33734:(e,s,t)=>{"use strict";t.d(s,{Z:()=>a});let a=(0,t(76557).Z)("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]])},90502:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>a});let a=(0,t(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/chat/layout.tsx#default`)}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=5485,exports.ids=[5485],exports.modules={19753:(e,s,a)=>{a.d(s,{R:()=>k});var i=a(10326),t=a(17577),l=a(39167),n=a(18753),r=a(42270),d=a(90772),c=a(33071),o=a(53313),x=a(15940),u=a(79210),h=a(99440),m=a(567),j=a(75290),g=a(94893),p=a(71059),b=a(56762),v=a(98091),f=a(91468),N=a(11890),y=a(39183),w=a(34789),C=a(98181),P=a(18615),S=a(76812);function k({queueName:e,nameGenerator:s,retryJob:a}){let{toast:k}=(0,w.pm)(),[Z,z]=(0,t.useState)(!1),[q,R]=(0,t.useState)(!1),[T,$]=(0,t.useState)(!1),[D,I]=(0,t.useState)([]),[A,O]=(0,t.useState)(null),[Q,J]=(0,t.useState)("completed"),[L,M]=(0,t.useState)(1),[F,Y]=(0,t.useState)(20),[E,_]=(0,t.useState)(new Set),{data:G,loading:W,refetch:X}=(0,l.aM)(r.k9,{variables:{queue:e},pollInterval:5e3}),{data:B,loading:H,refetch:V,networkStatus:K}=(0,l.aM)(r.Jq,{variables:{queue:e,statusses:Q,page:L,limit:F},pollInterval:5e3}),[U,{loading:ee}]=(0,n.D)(r.Wr,{onError:e=>{k({title:"Failed to delete job",description:e.message,variant:"destructive"})}}),[es,{loading:ea}]=(0,n.D)(r.fc,{onCompleted:()=>{k({title:"Queue paused",description:`The ${e} queue has been paused.`}),X(),z(!1)},onError:e=>{k({title:"Failed to pause queue",description:e.message,variant:"destructive"})}}),[ei,{loading:et}]=(0,n.D)(r.iC,{onCompleted:()=>{k({title:"Queue resumed",description:`The ${e} queue has been resumed.`}),X(),$(!1)},onError:e=>{k({title:"Failed to resume queue",description:e.message,variant:"destructive"})}}),[el,{loading:en}]=(0,n.D)(r.QW,{onCompleted:()=>{k({title:"Queue drained",description:"All waiting and delayed jobs have been removed from the queue."}),X(),V(),R(!1)},onError:e=>{k({title:"Failed to drain queue",description:e.message,variant:"destructive"})}}),er=e=>{I([e])},ed=e=>{O(e)},ec=e=>{let s=new Set(E);s.has(e)?s.delete(e):s.add(e),_(s)},eo=async()=>{if(D.filter(e=>!e.id).length>0){k({title:"Failed to delete jobs",description:"Some jobs have no ID.",variant:"destructive"});return}try{await Promise.all(D.map(s=>U({variables:{queue:e,id:s.id}}))),k({title:1===D.length?"Job deleted":"Jobs deleted",description:`Successfully deleted ${D.length} job${1===D.length?"":"s"}.`}),V(),X(),I([]),_(new Set)}catch(e){}},ex=G?.queue,eu=B?.jobs||{items:[],pageInfo:{pageCount:0,itemCount:0,currentPage:1,hasPreviousPage:!1,hasNextPage:!1}},eh=e=>i.jsx(m.C,{variant:"outline",className:{active:"bg-blue-100 text-blue-800 border-blue-200",waiting:"bg-yellow-100 text-yellow-800 border-yellow-200",completed:"bg-green-100 text-green-800 border-green-200",failed:"bg-red-100 text-red-800 border-red-200",delayed:"bg-orange-100 text-orange-800 border-orange-200",paused:"bg-gray-100 text-gray-800 border-gray-200"}[e]||"bg-gray-100 text-gray-800",children:e});return W&&H?i.jsx("div",{className:"space-y-4",children:i.jsx(c.Zb,{children:i.jsx(c.aY,{className:"pt-6",children:i.jsx("div",{className:"flex items-center justify-center py-8",children:i.jsx(j.Z,{className:"h-6 w-6 animate-spin"})})})})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(c.Zb,{children:[i.jsx(c.Ol,{children:(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"flex items-center gap-3",children:(0,i.jsxs)("div",{children:[(0,i.jsxs)(c.ll,{children:["Queue: ",e]}),(0,i.jsxs)(c.SZ,{children:["Manage the ",e," job queue and view all jobs."]})]})}),ex&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsxs)(d.z,{variant:"outline",size:"sm",onClick:()=>ex?.isPaused?$(!0):z(!0),disabled:ea||et,children:[ex?.isPaused?i.jsx(g.Z,{className:"mr-2 h-4 w-4"}):i.jsx(p.Z,{className:"mr-2 h-4 w-4"}),ex?.isPaused?"Resume queue":"Pause queue"]}),(0,i.jsxs)(d.z,{variant:"outline",size:"sm",onClick:()=>R(!0),disabled:en,children:[i.jsx(b.Z,{className:"mr-2 h-4 w-4"}),"Drain queue"]})]})]})}),(0,i.jsxs)(c.aY,{className:"space-y-6",children:[ex&&(0,i.jsxs)("div",{className:"flex items-center gap-8 p-4 bg-muted/50 rounded-lg",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"Status:"}),i.jsx("div",{children:ex.isPaused?i.jsx(m.C,{variant:"outline",className:"bg-gray-100 text-gray-800",children:"Paused"}):ex.isMaxed?i.jsx(m.C,{variant:"outline",className:"bg-red-100 text-red-800",children:"Maxed"}):i.jsx(m.C,{variant:"outline",className:"bg-green-100 text-green-800",children:"Active"})})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"Concurrency:"}),i.jsx("div",{className:"font-semibold",children:ex.concurrency})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"Rate Limit:"}),i.jsx("div",{className:"font-semibold",children:ex.ratelimit||"None"})]}),i.jsx(u.mQ,{value:Q,onValueChange:e=>J(e),className:"w-auto",children:(0,i.jsxs)(u.dr,{children:[(0,i.jsxs)(u.SP,{value:"active",className:"gap-1.5",children:[i.jsx("span",{children:"Active"}),i.jsx(m.C,{variant:"secondary",className:"ml-1 bg-blue-100 text-blue-600 border-blue-200",children:ex.jobs?.active||0})]}),(0,i.jsxs)(u.SP,{value:"waiting",className:"gap-1.5",children:[i.jsx("span",{children:"Waiting"}),i.jsx(m.C,{variant:"secondary",className:"ml-1 bg-yellow-100 text-yellow-600 border-yellow-200",children:ex.jobs?.waiting||0})]}),(0,i.jsxs)(u.SP,{value:"failed",className:"gap-1.5",children:[i.jsx("span",{children:"Failed"}),i.jsx(m.C,{variant:"secondary",className:"ml-1 bg-red-100 text-red-600 border-red-200",children:ex.jobs?.failed||0})]}),(0,i.jsxs)(u.SP,{value:"completed",className:"gap-1.5",children:[i.jsx("span",{children:"Completed"}),i.jsx(m.C,{variant:"secondary",className:"ml-1 bg-green-100 text-green-600 border-green-200",children:ex.jobs?.completed||0})]})]})})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-2",children:[(0,i.jsxs)("div",{children:[i.jsx("h3",{className:"text-sm font-semibold",children:"Queue Jobs"}),(0,i.jsxs)("p",{className:"text-xs text-muted-foreground",children:["All jobs currently in the ",e," queue"]})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[E.size>0&&(0,i.jsxs)(d.z,{variant:"destructive",size:"sm",onClick:()=>{I(eu.items.filter(e=>E.has(e.id)))},disabled:ee,children:[i.jsx(v.Z,{className:"mr-2 h-4 w-4"}),"Delete ",E.size," job",1===E.size?"":"s"]}),(0,i.jsxs)(m.C,{variant:"outline",children:["Auto Refresh: ",i.jsx(j.Z,{className:"h-4 w-4 animate-spin text-muted-foreground ml-1"})]})]})]}),(0,i.jsxs)("div",{className:"border rounded-lg",children:[H?i.jsx("div",{className:"flex items-center justify-center py-8",children:i.jsx(j.Z,{className:"h-6 w-6 animate-spin"})}):eu.items?.length===0?i.jsx("div",{className:"text-center pt-8 text-muted-foreground",children:"No jobs in queue"}):(0,i.jsxs)(x.iA,{children:[i.jsx(x.xD,{children:(0,i.jsxs)(x.SC,{children:[i.jsx(x.ss,{className:"w-12",children:i.jsx(o.X,{checked:eu.items.filter(e=>"active"!==e.state).length>0&&E.size===eu.items.filter(e=>"active"!==e.state).length,onCheckedChange:()=>{let e=eu.items.filter(e=>"active"!==e.state);E.size===e.length&&e.length>0?_(new Set):_(new Set(e.map(e=>e.id)))},"aria-label":"Select all jobs"})}),i.jsx(x.ss,{children:"Name"}),i.jsx(x.ss,{children:"State"}),i.jsx(x.ss,{children:"Timestamp"}),i.jsx(x.ss,{children:"Inputs"}),i.jsx(x.ss,{children:"Outputs"}),i.jsx(x.ss,{className:"text-right",children:"Actions"})]})}),i.jsx(x.RM,{children:eu.items?.map((e,a)=>i.jsxs(x.SC,{children:[i.jsx(x.pj,{children:i.jsx(o.X,{checked:E.has(e.id),onCheckedChange:()=>ec(e.id),disabled:"active"===e.state,"aria-label":`Select job ${s(e)}`})}),i.jsx(x.pj,{className:"font-medium max-w-[200px] truncate",children:s(e)}),i.jsx(x.pj,{children:eh(e.state)}),i.jsx(x.pj,{children:e.timestamp?C.WU(new Date(e.timestamp),"MMM d, yyyy HH:mm:ss"):"N/A"}),i.jsx(x.pj,{children:e.data?i.jsx("div",{className:"text-xs max-w-[200px] truncate",children:i.jsx(P.J,{text:JSON.stringify(e.data)})}):null}),i.jsx(x.pj,{children:e.failedReason?i.jsx("div",{className:"text-xs text-red-600 max-w-[200px] truncate",children:i.jsx(P.J,{text:"Error: "+e.failedReason})}):i.jsx("div",{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:i.jsx(P.J,{text:JSON.stringify(e.returnvalue)})})}),i.jsxs(x.pj,{className:"text-right",children:["active"!==e.state&&i.jsx(d.z,{variant:"ghost",size:"sm",onClick:()=>er(e),disabled:ee,children:i.jsx(v.Z,{className:"h-4 w-4 text-red-600"})}),"failed"===e.state&&i.jsxs(d.z,{variant:"ghost",size:"sm",onClick:()=>ed(e),children:[i.jsx(f.Z,{className:"h-4 w-4 text-blue-600"}),"Retry"]})]})]},a))})]}),(0,i.jsxs)("div",{className:"flex items-center justify-between px-2 pb-2",children:[(0,i.jsxs)("div",{className:"flex-1 text-sm text-muted-foreground",children:["(",eu?.pageInfo?.itemCount||0," total"," ","items)."]}),i.jsx("div",{className:"flex items-center space-x-6 lg:space-x-8",children:(0,i.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,i.jsxs)(d.z,{variant:"outline",className:"hidden size-8 p-0 lg:flex",onClick:()=>{M(1),V()},disabled:!eu?.pageInfo?.hasPreviousPage,children:[i.jsx("span",{className:"sr-only",children:"Go to first page"}),i.jsx(S.kRt,{className:"size-4"})]}),(0,i.jsxs)(d.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{console.log("itemsData.data?.pageInfo.hasPreviousPage",eu?.pageInfo?.hasPreviousPage),M(eu?.pageInfo?.hasPreviousPage?eu?.pageInfo?.currentPage-1:1),V()},disabled:!eu?.pageInfo?.hasPreviousPage,children:[i.jsx("span",{className:"sr-only",children:"Go to previous page"}),i.jsx(N.Z,{className:"size-4"})]}),(0,i.jsxs)(d.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{M(eu?.pageInfo?.hasNextPage?eu?.pageInfo?.currentPage+1:1),V()},disabled:!eu?.pageInfo.hasNextPage,children:[i.jsx("span",{className:"sr-only",children:"Go to next page"}),i.jsx(y.Z,{className:"size-4"})]})]})})]})]})]})]})]}),i.jsx(h.aR,{open:D.length>0,onOpenChange:e=>!e&&I([]),children:(0,i.jsxs)(h._T,{children:[(0,i.jsxs)(h.fY,{children:[i.jsx(h.f$,{children:1===D.length?"Delete Job?":`Delete ${D.length} Jobs?`}),i.jsx(h.yT,{children:1===D.length?`Are you sure you want to delete the job "${D[0]?.name}"? This action cannot be undone.`:`Are you sure you want to delete ${D.length} jobs? This action cannot be undone.`})]}),(0,i.jsxs)(h.xo,{children:[i.jsx(h.le,{children:"Cancel"}),(0,i.jsxs)(h.OL,{onClick:eo,disabled:ee,children:[ee&&i.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Delete"]})]})]})}),i.jsx(h.aR,{open:!!A,onOpenChange:e=>!e&&O(null),children:(0,i.jsxs)(h._T,{children:[(0,i.jsxs)(h.fY,{children:[i.jsx(h.f$,{children:"Retry Job?"}),(0,i.jsxs)(h.yT,{children:['Are you sure you want to retry the job "',A?.name,'"? This will schedule a new job with the same data.']})]}),(0,i.jsxs)(h.xo,{children:[i.jsx(h.le,{children:"Cancel"}),i.jsx(h.OL,{onClick:()=>{A&&a(A)},disabled:ee,children:"Retry"})]})]})}),i.jsx(h.aR,{open:Z,onOpenChange:z,children:(0,i.jsxs)(h._T,{children:[(0,i.jsxs)(h.fY,{children:[i.jsx(h.f$,{children:"Pause Queue?"}),(0,i.jsxs)(h.yT,{children:["Are you sure you want to pause the ",e," queue? No jobs will be processed until the queue is resumed."]})]}),(0,i.jsxs)(h.xo,{children:[i.jsx(h.le,{children:"Cancel"}),(0,i.jsxs)(h.OL,{onClick:()=>{es({variables:{queue:e}})},disabled:ea,children:[ea&&i.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Pause Queue"]})]})]})}),i.jsx(h.aR,{open:T,onOpenChange:$,children:(0,i.jsxs)(h._T,{children:[(0,i.jsxs)(h.fY,{children:[i.jsx(h.f$,{children:"Resume Queue?"}),(0,i.jsxs)(h.yT,{children:["Are you sure you want to resume the ",e," queue?."]})]}),(0,i.jsxs)(h.xo,{children:[i.jsx(h.le,{children:"Cancel"}),(0,i.jsxs)(h.OL,{onClick:()=>{ei({variables:{queue:e}})},disabled:et,children:[et&&i.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Resume Queue"]})]})]})}),i.jsx(h.aR,{open:q,onOpenChange:R,children:(0,i.jsxs)(h._T,{children:[(0,i.jsxs)(h.fY,{children:[i.jsx(h.f$,{children:"Drain Queue?"}),(0,i.jsxs)(h.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,i.jsxs)(h.xo,{children:[i.jsx(h.le,{children:"Cancel"}),(0,i.jsxs)(h.OL,{onClick:()=>{el({variables:{queue:e}})},disabled:en,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[en&&i.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Drain Queue"]})]})]})})]})}},57004:(e,s,a)=>{a.a(e,async(e,i)=>{try{a.d(s,{G:()=>p});var t=a(10326),l=a(48644),n=a(93801),r=a(45747),d=a(17577),c=a(94966),o=a(12533),x=a(12428),u=a(47355),h=a(62288),m=a(34789),j=a(77863),g=e([l,n,r]);function p({className:e=null,code:s,language:a,slice:i=200}){let{toast:l}=(0,m.pm)(),[n,r]=(0,d.useState)(null);return(0,t.jsxs)(h.Vq,{children:[t.jsx(h.hg,{asChild:!0,children:n?.length&&t.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:u.Z,children:`${n?.slice(0,i||200)} ${n?.length>(i||200)?"...":""}`})}),t.jsx(h.cZ,{className:"sm:max-w-[800px] overflow-hidden max-h-[500px] overflow-y-scroll",children:(0,t.jsxs)(h.fK,{children:[t.jsx(h.$N,{children:"Code"}),t.jsx("div",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(n??""),l({title:"Copied to clipboard"})},children:t.jsx(c.Z,{className:(0,j.cn)(e),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:a||"plaintext",style:u.Z,children:n??""})})]})})]})}[l,n,r]=g.then?(await g)():g,c.Z.registerLanguage("json",x.Z),c.Z.registerLanguage("javascript",o.Z),i()}catch(e){i(e)}})},53313:(e,s,a)=>{a.d(s,{X:()=>d});var i=a(10326),t=a(13635),l=a(32933),n=a(17577),r=a(77863);let d=n.forwardRef(({className:e,...s},a)=>i.jsx(t.fC,{ref:a,className:(0,r.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...s,children:i.jsx(t.z$,{className:(0,r.cn)("flex items-center justify-center text-current"),children:i.jsx(l.Z,{className:"size-4"})})}));d.displayName=t.fC.displayName}};
@@ -1 +1 @@
1
- "use strict";exports.id=8050,exports.ids=[8050],exports.modules={43273:(e,s,t)=>{t.d(s,{Cd:()=>d,X:()=>c,bZ:()=>o});var a=t(10326),l=t(79360),n=t(17577),i=t(77863);let r=(0,l.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},l)=>a.jsx("div",{ref:l,role:"alert",className:(0,i.cn)(r({variant:s}),e),...t}));o.displayName="Alert";let d=n.forwardRef(({className:e,...s},t)=>a.jsx("h5",{ref:t,className:(0,i.cn)("mb-1 font-medium leading-none tracking-tight",e),...s}));d.displayName="AlertTitle";let c=n.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,i.cn)("text-sm [&_p]:leading-relaxed",e),...s}));c.displayName="AlertDescription"},77961:(e,s,t)=>{t.d(s,{jF:()=>W,jU:()=>U,ZP:()=>F,NF:()=>_});var a=t(10326),l=t(17577);t(32964),t(59946),t(27221);var n=t(59161),i=t(30463);let r=function(e,s=[]){(0,l.useContext)(i.E);let[t,a]=(0,l.useState)(void 0);return t};var o=t(84714),d=t(31540),c=t(15557),x=t(61086),m=t(11890),u=t(39183),p=t(36283),h=t(71709),j=t(39572),g=t(83855),f=t(94019),N=t(3240),v=t(90772),y=t(62288),w=t(65685),b=t(3574),k=t(20108),C=t(10119),Z=t(54432),z=t(76812),L=t(33071),O=t(65304);function W({s3key:e,children:s}){let{data:t,isLoading:l,error:i,refetch:r}=(0,k.a)({queryKey:["fileObject",e],queryFn:async()=>e?await n.QZ.object(e):null,enabled:null!=e});return e?(0,a.jsxs)(L.Zb,{children:[a.jsx(L.Ol,{className:"pb-3",children:a.jsx(L.ll,{className:"text-sm truncate",children:e.split("_EXULU_").pop()})}),(0,a.jsxs)(L.aY,{className:"pt-0",children:[l&&(0,a.jsxs)("div",{className:"space-y-2",children:[a.jsx(O.O,{className:"h-4 w-full"}),a.jsx(O.O,{className:"h-4 w-2/3"})]}),!l&&t&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[a.jsx("span",{className:"capitalize",children:t?.ContentType.split("/").pop()}),(0,a.jsxs)("span",{children:[(t?.ContentLength/1024/1024).toFixed(2)," MB"]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,a.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,a.jsxs)(v.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:[a.jsx("span",{className:"mr-1 text-xs",children:"View"}),a.jsx(d.Z,{className:"h-3 w-3"})]})]})]}),!l&&i&&a.jsx("p",{className:"text-xs text-muted-foreground",children:i.message}),s]})]}):a.jsx(L.Zb,{children:(0,a.jsxs)(L.aY,{className:"p-3 flex",children:[a.jsx("p",{className:"text-sm text-muted-foreground m-auto",children:"No file selected"}),s]})})}function F({id:e,allowedFileTypes:s,dependencies:t,onConfirm:n,selectionLimit:i,buttonText:r}){let[o,d]=(0,l.useState)(!1);return(0,a.jsxs)(y.Vq,{open:o,onOpenChange:d,children:[a.jsx(y.hg,{asChild:!0,children:(0,a.jsxs)(v.z,{variant:"outline",children:[r&&a.jsx("span",{className:"mr-2",children:r}),a.jsx(c.Z,{className:"h-4 w-4"})]})}),(0,a.jsxs)(y.cZ,{className:"sm:max-w-[900px]",children:[(0,a.jsxs)(y.fK,{children:[a.jsx(y.$N,{children:"File Gallery"}),a.jsx(y.Be,{children:"Browse your previously uploaded files or upload new ones."})]}),a.jsx(S,{id:e,allowedFileTypes:s,dependencies:t,selectionLimit:i,onConfirm:e=>{n(e),d(!1)}})]})]})}let S=({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[p,h]=(0,l.useState)(void 0),[j,g]=(0,l.useState)(void 0),[f,N]=(0,l.useState)(void 0),y=(0,l.useContext)(i.E),[L,W]=(0,l.useState)([]),F=e=>{if(L.includes(e)){W(L.filter(s=>s!==e));return}if(1===c){W([e]);return}L.length>=c||W([...L,e])},S=(0,C.D)({mutationFn:async({key:e})=>{await n.QZ.delete(e),A()}}),{data:K,isLoading:_,error:q,refetch:A}=(0,k.a)({queryKey:["filesQuery",p,f],staleTime:3e4,queryFn:async()=>n.QZ.list({search:p,continuationToken:f})});console.log("!! data !!",K);let{theme:Q}=(0,b.F)(),T=r({backend:y?.backend||"",uppyOptions:{id:e,allowedFileTypes:s},callbacks:{uploadSuccess:async e=>{console.log("data",e)}},maxNumberOfFiles:10},t);return((0,l.useEffect)(()=>{A()},[p,f]),T)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[(0,a.jsxs)("div",{className:"border rounded-lg p-4",children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:"Previously Uploaded Files"}),a.jsx(Z.I,{placeholder:"Search files...",value:p,onChange:e=>h(e.target.value),className:"mb-3"}),(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground pb-2",children:[(0,a.jsxs)("span",{children:[L.length," / ",c," files selected"]}),(0,a.jsxs)("span",{children:["Allowed file types: ",s?.map(e=>e).join(", ")]})]}),(0,a.jsxs)(w.x,{children:[_&&(0,a.jsxs)("div",{className:"flex items-center justify-center h-full w-full grid grid-cols-2 sm:grid-cols-3 gap-3",children:[a.jsx(O.O,{className:"h-[120px] w-full"}),a.jsx(O.O,{className:"h-[120px] w-full"}),a.jsx(O.O,{className:"h-[120px] w-full"}),a.jsx(O.O,{className:"h-[120px] w-full"}),a.jsx(O.O,{className:"h-[120px] w-full"}),a.jsx(O.O,{className:"h-[120px] w-full"}),a.jsx(O.O,{className:"h-[120px] w-full"}),a.jsx(O.O,{className:"h-[120px] w-full"}),a.jsx(O.O,{className:"h-[120px] w-full"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[!_&&!K?.Contents?.length&&(0,a.jsxs)("div",{className:"col-span-full flex flex-col items-center justify-center py-12 text-center",children:[a.jsx(x.Z,{className:"h-12 w-12 text-muted-foreground/50 mb-3"}),a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Nothing to see here... yet!"}),a.jsx("p",{className:"text-xs text-muted-foreground/75 mt-1",children:"Upload some files to get started"})]}),K?.Contents?.map(e=>a.jsx(U,{s3Key:e.Key,onSelect:F,active:L.some(s=>s===e.Key),onRemove:()=>{S.mutate({key:e.Key})},disabled:!!s&&!s?.some(s=>e.Key.endsWith(s))}))]}),a.jsx("div",{className:"flex items-center space-x-6 lg:space-x-8 pt-3",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)(v.z,{variant:"outline",className:"hidden size-8 p-0 lg:flex",onClick:()=>{N(void 0)},disabled:!f||_,children:[a.jsx("span",{className:"sr-only",children:"Go to first page"}),a.jsx(z.kRt,{className:"size-4"})]}),(0,a.jsxs)(v.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{N(j)},disabled:!f||_,children:[a.jsx("span",{className:"sr-only",children:"Go to previous page"}),a.jsx(m.Z,{className:"size-4"})]}),(0,a.jsxs)(v.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{g(f),N(K?.NextContinuationToken)},disabled:!K?.NextContinuationToken||_,children:[a.jsx("span",{className:"sr-only",children:"Go to next page"}),a.jsx(u.Z,{className:"size-4"})]})]})})]})]}),(0,a.jsxs)("div",{className:"border rounded-lg p-4",children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:"Upload New Files"}),a.jsx(o.A,{uppy:T,theme:"dark"===Q?"dark":"light"})]})]}),a.jsx("div",{className:"flex justify-end",children:a.jsx(v.z,{variant:"outline",onClick:()=>{d(L),W([])},children:"Confirm"})})]}):null},U=({s3Key:e,onSelect:s,onRemove:t,active:l,disabled:i,addToContext:r})=>{let o;return(0,a.jsxs)("div",{className:`${i?"opacity-50":""} group relative rounded-lg p-2 hover:bg-muted transition-colors cursor-pointer ${l?"border border-purple-500":"border"}`,onClick:()=>{!i&&s&&s(e)},children:[a.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"))?a.jsx(q,{fileKey:e}):(0,a.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")?a.jsx(h.Z,{className:"h-6 w-6 text-blue-500"}):o.endsWith("pdf")?a.jsx(j.Z,{className:"h-6 w-6 text-red-500"}):o.endsWith("xls")||o.endsWith("xlsx")||o.endsWith("csv")?a.jsx(p.Z,{className:"h-6 w-6 text-green-500"}):o.endsWith("ppt")||o.endsWith("pptx")?a.jsx(p.Z,{className:"h-6 w-6 text-orange-500"}):a.jsx(p.Z,{className:"h-6 w-6 text-gray-500"}):a.jsx(p.Z,{className:"h-6 w-6 text-gray-500"}),a.jsx("span",{className:"text-xs text-muted-foreground mt-1 text-center",children:e?e.split("_EXULU_").pop():e})]})}),a.jsx("p",{className:"text-xs truncate",children:e?e.split("_EXULU_").pop():e}),(0,a.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 flex absolute top-1 right-1",children:[r&&(0,a.jsxs)(v.z,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6 bg-background/80 hover:bg-background",onClick:()=>{r(e)},children:[a.jsx(g.Z,{className:"h-3 w-3"}),a.jsx("span",{className:"sr-only",children:"Add"})]}),(0,a.jsxs)(v.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:[a.jsx(d.Z,{className:"h-3 w-3"}),a.jsx("span",{className:"sr-only",children:"View"})]}),t&&(0,a.jsxs)(v.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:[a.jsx(f.Z,{className:"h-3 w-3"}),a.jsx("span",{className:"sr-only",children:"Remove"})]})]})]},e)},K={},_=async e=>{if(K[e]){if(!(K[e].expiresAt<Date.now()))return K[e].url;delete K[e]}let s=await n.QZ.download(e),t=await s.json();return console.log("json",t),K[e]={url:t.url,expiresAt:Date.now()+6e4},t.url},q=({fileKey:e})=>{console.log("key",e);let s=(0,k.a)({queryKey:["imageQuery",e],staleTime:3e4,queryFn:async()=>_(e)});return s.isLoading?a.jsx("div",{children:a.jsx(N.Z,{})}):s.isLoading||s.data?a.jsx("img",{src:s.data,alt:e,className:"object-cover w-full h-full"}):a.jsx("div",{children:a.jsx(x.Z,{})})}}};
1
+ "use strict";exports.id=8050,exports.ids=[8050],exports.modules={43273:(e,s,t)=>{t.d(s,{Cd:()=>c,X:()=>d,bZ:()=>o});var l=t(10326),a=t(79360),n=t(17577),i=t(77863);let r=(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,i.cn)(r({variant:s}),e),...t}));o.displayName="Alert";let c=n.forwardRef(({className:e,...s},t)=>l.jsx("h5",{ref:t,className:(0,i.cn)("mb-1 font-medium leading-none tracking-tight",e),...s}));c.displayName="AlertTitle";let d=n.forwardRef(({className:e,...s},t)=>l.jsx("div",{ref:t,className:(0,i.cn)("text-sm [&_p]:leading-relaxed",e),...s}));d.displayName="AlertDescription"},77961:(e,s,t)=>{t.d(s,{jF:()=>W,jU:()=>U,ZP:()=>F,NF:()=>_});var l=t(10326),a=t(17577);t(32964),t(59946),t(27221);var n=t(59161),i=t(30463);let r=function(e,s=[]){(0,a.useContext)(i.E);let[t,l]=(0,a.useState)(void 0);return t};var o=t(84714),c=t(31540),d=t(15557),x=t(61086),m=t(11890),u=t(39183),p=t(36283),h=t(71709),j=t(39572),g=t(83855),f=t(94019),N=t(3240),v=t(90772),w=t(62288),y=t(65685),b=t(3574),k=t(20108),C=t(10119),Z=t(54432),z=t(76812),L=t(33071),O=t(65304);function W({s3key:e,children:s}){let{data:t,isLoading:a,error:i,refetch:r}=(0,k.a)({queryKey:["fileObject",e],queryFn:async()=>e?await n.QZ.object(e):null,enabled:null!=e});if(!e)return l.jsx(L.Zb,{children:(0,l.jsxs)(L.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,d="";return e.includes("[bucket:")&&(d=e.split("[bucket:")[1]?.split("]")[0]||"",o=e.split("[bucket:")[1]?.split("]")[0]||"",o?.length&&(o=e.split("]")[1]||"")),o=o.split("_EXULU_").pop()||"",(0,l.jsxs)(L.Zb,{children:[l.jsx(L.Ol,{className:"pb-3",children:l.jsx(L.ll,{className:"text-sm max-w-[500px] truncate",children:o})}),(0,l.jsxs)(L.aY,{className:"pt-0",children:[a&&(0,l.jsxs)("div",{className:"space-y-2",children:[l.jsx(O.O,{className:"h-4 w-full"}),l.jsx(O.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(),d&&` [Bucket: ${d}]`]}),(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)(v.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(c.Z,{className:"h-3 w-3"})]})]})]}),!a&&i&&l.jsx("p",{className:"text-xs text-muted-foreground",children:i.message}),s]})]})}function F({id:e,allowedFileTypes:s,dependencies:t,onConfirm:n,selectionLimit:i,buttonText:r}){let[o,c]=(0,a.useState)(!1);return(0,l.jsxs)(w.Vq,{open:o,onOpenChange:c,children:[l.jsx(w.hg,{asChild:!0,children:(0,l.jsxs)(v.z,{variant:"outline",children:[r&&l.jsx("span",{className:"mr-2",children:r}),l.jsx(d.Z,{className:"h-4 w-4"})]})}),(0,l.jsxs)(w.cZ,{className:"sm:max-w-[900px]",children:[(0,l.jsxs)(w.fK,{children:[l.jsx(w.$N,{children:"File Gallery"}),l.jsx(w.Be,{children:"Browse your previously uploaded files or upload new ones."})]}),l.jsx(S,{id:e,allowedFileTypes:s,dependencies:t,selectionLimit:i,onConfirm:e=>{n(e),c(!1)}})]})]})}let S=({id:e,allowedFileTypes:s,dependencies:t,onConfirm:c,selectionLimit:d})=>{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[p,h]=(0,a.useState)(void 0),[j,g]=(0,a.useState)(void 0),[f,N]=(0,a.useState)(void 0),w=(0,a.useContext)(i.E),[L,W]=(0,a.useState)([]),F=e=>{if(L.includes(e)){W(L.filter(s=>s!==e));return}if(1===d){W([e]);return}L.length>=d||W([...L,e])},S=(0,C.D)({mutationFn:async({key:e})=>{await n.QZ.delete(e),A()}}),{data:K,isLoading:_,error:q,refetch:A}=(0,k.a)({queryKey:["filesQuery",p,f],staleTime:3e4,queryFn:async()=>n.QZ.list({search:p,continuationToken:f})});console.log("!! data !!",K);let{theme:Q}=(0,b.F)(),T=r({backend:w?.backend||"",uppyOptions:{id:e,allowedFileTypes:s},callbacks:{uploadSuccess:async e=>{console.log("data",e)}},maxNumberOfFiles:10},t);return((0,a.useEffect)(()=>{A()},[p,f]),T)?(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:p,onChange:e=>h(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:[L.length," / ",d," files selected"]}),(0,l.jsxs)("span",{children:["Allowed file types: ",s?.map(e=>e).join(", ")]})]}),(0,l.jsxs)(y.x,{children:[_&&(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(O.O,{className:"h-[120px] w-full"}),l.jsx(O.O,{className:"h-[120px] w-full"}),l.jsx(O.O,{className:"h-[120px] w-full"}),l.jsx(O.O,{className:"h-[120px] w-full"}),l.jsx(O.O,{className:"h-[120px] w-full"}),l.jsx(O.O,{className:"h-[120px] w-full"}),l.jsx(O.O,{className:"h-[120px] w-full"}),l.jsx(O.O,{className:"h-[120px] w-full"}),l.jsx(O.O,{className:"h-[120px] w-full"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[!_&&!K?.Contents?.length&&(0,l.jsxs)("div",{className:"col-span-full flex flex-col items-center justify-center py-12 text-center",children:[l.jsx(x.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"})]}),K?.Contents?.map(e=>l.jsx(U,{s3Key:e.Key,onSelect:F,active:L.some(s=>s===e.Key),onRemove:()=>{S.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)(v.z,{variant:"outline",className:"hidden size-8 p-0 lg:flex",onClick:()=>{N(void 0)},disabled:!f||_,children:[l.jsx("span",{className:"sr-only",children:"Go to first page"}),l.jsx(z.kRt,{className:"size-4"})]}),(0,l.jsxs)(v.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{N(j)},disabled:!f||_,children:[l.jsx("span",{className:"sr-only",children:"Go to previous page"}),l.jsx(m.Z,{className:"size-4"})]}),(0,l.jsxs)(v.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{g(f),N(K?.NextContinuationToken)},disabled:!K?.NextContinuationToken||_,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:T,theme:"dark"===Q?"dark":"light"})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(v.z,{variant:"outline",onClick:()=>{c(L),W([])},children:"Confirm"})})]}):null},U=({s3Key:e,onSelect:s,onRemove:t,active:a,disabled:i,addToContext:r})=>{let o;return(0,l.jsxs)("div",{className:`${i?"opacity-50":""} group relative rounded-lg p-2 hover:bg-muted transition-colors cursor-pointer ${a?"border border-purple-500":"border"}`,onClick:()=>{!i&&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(q,{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(h.Z,{className:"h-6 w-6 text-blue-500"}):o.endsWith("pdf")?l.jsx(j.Z,{className:"h-6 w-6 text-red-500"}):o.endsWith("xls")||o.endsWith("xlsx")||o.endsWith("csv")?l.jsx(p.Z,{className:"h-6 w-6 text-green-500"}):o.endsWith("ppt")||o.endsWith("pptx")?l.jsx(p.Z,{className:"h-6 w-6 text-orange-500"}):l.jsx(p.Z,{className:"h-6 w-6 text-gray-500"}):l.jsx(p.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:[r&&(0,l.jsxs)(v.z,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6 bg-background/80 hover:bg-background",onClick:()=>{r(e)},children:[l.jsx(g.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"Add"})]}),(0,l.jsxs)(v.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(c.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"View"})]}),t&&(0,l.jsxs)(v.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(f.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"Remove"})]})]})]},e)},K={},_=async e=>{if(K[e]){if(!(K[e].expiresAt<Date.now()))return K[e].url;delete K[e]}let s=await n.QZ.download(e),t=await s.json();return console.log("json",t),K[e]={url:t.url,expiresAt:Date.now()+6e4},t.url},q=({fileKey:e})=>{console.log("key",e);let s=(0,k.a)({queryKey:["imageQuery",e],staleTime:3e4,queryFn:async()=>_(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(x.Z,{})})}}};
@@ -17,11 +17,11 @@
17
17
  "wasm": [],
18
18
  "assets": [],
19
19
  "env": {
20
- "__NEXT_BUILD_ID": "J23NmkaMjAJYnE0jX_kO0",
21
- "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "RH33BHGT08dLinjjhsFZaSsR5CH4fKPTsb3Xj2BI3K4=",
22
- "__NEXT_PREVIEW_MODE_ID": "c7913608ffee224d1eb581e5c6ebee6e",
23
- "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "a6194b8f916cdb8562104d1a90163f33729e3471581bb4a5a5ea60074365cc90",
24
- "__NEXT_PREVIEW_MODE_SIGNING_KEY": "cb22045a0e876ae3d175ade08d447aa7efe55b109b4064526d61fd222c486fee"
20
+ "__NEXT_BUILD_ID": "GOwerAkBncYx0J8q1TqQb",
21
+ "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "18xfYNSUAOT1D/YMmncNWojRwYVSkGoQrUyOXnLJe30=",
22
+ "__NEXT_PREVIEW_MODE_ID": "2e44c748c5140336c32ba044d44c2f0c",
23
+ "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "8fb6f7284c8da0ed60656ffa96a88bcedb6cc8db94b40930b838688828bbef33",
24
+ "__NEXT_PREVIEW_MODE_SIGNING_KEY": "a8a72f37130a0549d7a3019d1d687fdccf00b01379e9d3283177e2f8b3aa06e8"
25
25
  }
26
26
  }
27
27
  },
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-480cfeb2c2aa3f7e.js"/><script src="/_next/static/chunks/fd9d1056-f20120f69c10766e.js" async=""></script><script src="/_next/static/chunks/2117-7e0e97ffa5867cf9.js" async=""></script><script src="/_next/static/chunks/main-app-da1df2757744a2ea.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-480cfeb2c2aa3f7e.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:I[12846,[],\"\"]\n3:I[4707,[],\"\"]\n4:I[36423,[],\"\"]\na:I[61060,[],\"\"]\n5:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n6:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n7:{\"display\":\"inline-block\"}\n8:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nb:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L1\",null,{\"buildId\":\"J23NmkaMjAJYnE0jX_kO0\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L2\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[null,[\"$\",\"html\",null,{\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$5\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$6\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$8\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$L9\"],\"globalErrorComponent\":\"$a\",\"missingSlots\":\"$Wb\"}]\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"2\",{\"name\":\"next-size-adjust\"}]]\n2:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-480cfeb2c2aa3f7e.js"/><script src="/_next/static/chunks/fd9d1056-f20120f69c10766e.js" async=""></script><script src="/_next/static/chunks/2117-7e0e97ffa5867cf9.js" async=""></script><script src="/_next/static/chunks/main-app-da1df2757744a2ea.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-480cfeb2c2aa3f7e.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:I[12846,[],\"\"]\n3:I[4707,[],\"\"]\n4:I[36423,[],\"\"]\na:I[61060,[],\"\"]\n5:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n6:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n7:{\"display\":\"inline-block\"}\n8:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nb:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L1\",null,{\"buildId\":\"GOwerAkBncYx0J8q1TqQb\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L2\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[null,[\"$\",\"html\",null,{\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$5\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$6\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$8\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$L9\"],\"globalErrorComponent\":\"$a\",\"missingSlots\":\"$Wb\"}]\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"2\",{\"name\":\"next-size-adjust\"}]]\n2:null\n"])</script></body></html>
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>500: Internal Server Error</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-480cfeb2c2aa3f7e.js" defer=""></script><script src="/_next/static/chunks/framework-9317b1ce0f036b87.js" defer=""></script><script src="/_next/static/chunks/main-bf608235d4e99320.js" defer=""></script><script src="/_next/static/chunks/pages/_app-9f5760457b3fbb4c.js" defer=""></script><script src="/_next/static/chunks/pages/_error-daa80f5b4d0fe27d.js" defer=""></script><script src="/_next/static/J23NmkaMjAJYnE0jX_kO0/_buildManifest.js" defer=""></script><script src="/_next/static/J23NmkaMjAJYnE0jX_kO0/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"J23NmkaMjAJYnE0jX_kO0","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>500: Internal Server Error</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-480cfeb2c2aa3f7e.js" defer=""></script><script src="/_next/static/chunks/framework-9317b1ce0f036b87.js" defer=""></script><script src="/_next/static/chunks/main-bf608235d4e99320.js" defer=""></script><script src="/_next/static/chunks/pages/_app-9f5760457b3fbb4c.js" defer=""></script><script src="/_next/static/chunks/pages/_error-daa80f5b4d0fe27d.js" defer=""></script><script src="/_next/static/GOwerAkBncYx0J8q1TqQb/_buildManifest.js" defer=""></script><script src="/_next/static/GOwerAkBncYx0J8q1TqQb/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"GOwerAkBncYx0J8q1TqQb","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- {"node":{},"edge":{},"encryptionKey":"RH33BHGT08dLinjjhsFZaSsR5CH4fKPTsb3Xj2BI3K4="}
1
+ {"node":{},"edge":{},"encryptionKey":"18xfYNSUAOT1D/YMmncNWojRwYVSkGoQrUyOXnLJe30="}