@fleek-platform/agents-ui
Version:
The Fleek Platform Agents UI provides a simple interface for deploying, monitoring, and configuring your agents––making management straightforward
15 lines • 94.1 kB
JavaScript
var wr=Object.defineProperty;var xr=(e,t)=>{for(var r in t)wr(e,r,{get:t[r],enumerable:!0})};var Dt={};xr(Dt,{cancelSubscription:()=>ao,changeAgentStatus:()=>Yr,createAgentDraft:()=>ct,createApiToken:()=>Wr,createCreditsCheckout:()=>mt,createFleekAgentThread:()=>ht,createManagePaymentMethods:()=>no,createSubscription:()=>ze,createSubscriptionCheckout:()=>ve,deleteAgent:()=>Hr,deleteApiToken:()=>$r,deleteFleekAgentThread:()=>lo,deployAgent:()=>pt,generateCharacterfile:()=>ft,getAdminMessages:()=>ro,getAgentAttestation:()=>Kr,getAgentById:()=>Br,getAgentLogs:()=>Vr,getAgentStatus:()=>Gr,getAgentsByProjectId:()=>Ur,getApiTokens:()=>jr,getCredits:()=>gt,getElizaAgent:()=>Xr,getElizaOsVersions:()=>Qr,getFleekAgentThreads:()=>so,getFleekAgentThreadsByAgent:()=>At,getInvoicesList:()=>io,getModels:()=>eo,getPaymentMethods:()=>oo,getPlans:()=>dt,getProjects:()=>Jr,getSubscriptions:()=>ut,getVmResources:()=>bt,improvePrompt:()=>Et,sendAssistantMessageStream:()=>to,sendMessageAgent:()=>Zr,updateAgentById:()=>Fr,updateSubscription:()=>qr,updateSubscriptionQuantity:()=>Le});import{jwtDecode as Rr}from"jwt-decode";var vr=e=>{try{return Rr(e)}catch(t){console.error("Failed to decode access token",t);return}},Q=(e,t)=>vr(e)?.projectId===t;var it={PUBLIC_FLEEK_REST_API_HOST:"api.fleek.xyz",PUBLIC_DASHBOARD_APP_URL:"https://hosting.fleek.xyz/dashboard",PUBLIC_BEEHIIV_PROXY_SERVER_URL:"https://faas-lon1-917a94a7.doserverless.co/api/v1/web/fn-5aaf2a72-1b5b-4ac6-8c42-a2e735a32d8b/main/create-subscription",PUBLIC_AUTOFUN_CALLBACK_URL:"https://auto.fun/callback",PUBLIC_GRAPHQL_API_URL:"https://graphql.service.fleek.xyz/graphql",PUBLIC_DYNAMIC_ENVIRONMENT_ID:"de23a5f0-aaa5-412e-8212-4fb056a3b30d",PUBLIC_AGENTS_BASE_PATH:"/agents",PUBLIC_REDIRECT_URL_UNAUTHENTICATED:"https://eliza.fleek.xyz",PUBLIC_PERSONA_GENERATOR_API_URL:"https://persona-generator.flkservices.io",PUBLIC_FLEEK_WEBSITE_URL:"https://fleek.xyz",PUBLIC_CUSTOM_AGENTS_URL:"https://social-agent.platform.fleek.xyz",PUBLIC_POSTHOG_API_KEY:"phc_RJhBMFHIZxwd361q6q9LZxDvSAta0F56mXQo3An307y",PUBLIC_POSTHOG_HOST:"https://us.i.posthog.com"},U=e=>{let t=it[e];if(t==null)throw new Error(`Expected key "${e}" to be defined but got ${typeof t}`);if(typeof t!="string")throw new Error(`Expected key "${e}" to be string but got ${typeof t}`);return t},zr=e=>{let t={...it,...e};Object.assign(it,t)};var P={endpoints:{aiAgents:"/ai-agents",aiAgent:"/ai-agents/:id",aiAgentUpdate:"/ai-agents/:id",aiAgentPublish:"/ai-agents/:id/publish",aiAgentLogs:"/ai-agents/:id/logs",aiAgentAttestation:"/ai-agents/:id/attestation",aiAgentStatus:"/ai-agents/:id/status",aiAgentStatusUpdate:"/ai-agents/:id/:action",aiAgentDelete:"/ai-agents/:id",aiAgentDraftCreate:"/ai-agents",projects:"/projects",teams:"/teams",subscriptions:"/subscriptions",subscriptionUpdate:"/subscriptions/:id",subscriptionCheckout:"/subscriptions/checkout",subscriptionUpdateQuantity:"/subscriptions/:id/quantity",plans:"/plans",tokens:"/tokens",tokenDelete:"/tokens/:id",aiAgentMessage:"/ai-agents/:id/api/:elizaId/message",aiAgentMessageV2:"/ai-agents/:id/api/api/agents/:elizaId/message",proxyAiAgents:"/ai-agents/:id/api/agents",proxyAiAgentsV2:"/ai-agents/:id/api/api/agents",elizaOsVersions:"/machines/images/eliza",llmModels:"/llm/models",credits:"/credits",createCreditsCheckout:"/credits/checkout",listPaymentMethods:"/payment-methods",managePaymentMethods:"/payment-methods/manage",listInvoices:"/invoices",cancelSubscription:"/subscriptions/:subscriptionId",vmResources:"/machines/vms/resources"},agentsDashboardPage:"/projects/:projectId/agents/"};var at="ai agent",st="ai agent (standard)",lt="fan";var kt="We're currently over capacity and unable to deploy new AI agents. Please try again later.";import Lr from"url-join";import{compile as Nr}from"path-to-regexp";import Or from"query-string";var Re=(...e)=>Lr(...e),kr=(e,t={})=>Nr(e,{encode:encodeURIComponent})(t),Mr=(e,t={})=>!t||Object.keys(t).length===0?e:Or.stringifyUrl({url:e,query:t},{skipNull:!0,skipEmptyString:!0}),Ee=(e,t,r)=>{let o=r?.pathParams??{},n=r?.queryParams??{};return Mr(Re(e,kr(t,o)),n)},Ve=e=>(t,{pathParams:r={},queryParams:o={}}={})=>{let n=typeof e=="function"?e():e;return Ee(n,t,{pathParams:r,queryParams:o})};var Mt=e=>{let t=e.match(/^https?:\/\//i)?e:`https://${e}`,r=new URL(t);return r.protocol="https:",r.toString()};var Ke=({route:e,version:t="v1"})=>Ee(U("PUBLIC_PERSONA_GENERATOR_API_URL"),Re(t,e));var Dr=Ve(()=>Mt(U("PUBLIC_FLEEK_REST_API_HOST"))),S=(e,t,r)=>Dr(Re("/api",`v${t}`,e),r);var A=e=>async(r,o)=>{try{let n=await e(r);return o?.throwOnError?n:{ok:!0,data:n}}catch(n){let i=n instanceof Error?n:new Error("Unknown error");if(o?.throwOnError)throw i;return{ok:!1,error:i}}};import{Client as Ge}from"@langchain/langgraph-sdk";var ct=A(async({projectId:e,characterfile:t,accessToken:r,name:o,avatar:n,frameworkVersion:i,tee:s=!1,managedModelName:l})=>{if(!r||!e||!t)throw new Error("Missing required parameters");if(!Q(r,e))throw new Error("The access token does not match the project");let p=S(P.endpoints.aiAgentDraftCreate,2),c=await fetch(p,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({config:t,projectId:e,name:o,avatar:n,frameworkVersion:i,tee:s,managedModelName:l})});if(!c.ok){let d=await c.text();throw new Error(`HTTP Error ${c.status}: ${d}`)}return c.json()}),pt=A(async({projectId:e,characterfile:t,avatar:r,accessToken:o,draftId:n,frameworkVersion:i,managedModelName:s,tee:l=!1,withUpdate:p=!0})=>{if(!o||!e||!n)throw new Error("Missing required parameters");if(!Q(o,e))throw new Error("The access token does not match the project");if(p){let b;t&&(b=JSON.parse(t).name);let _=S(P.endpoints.aiAgentUpdate,1,{pathParams:{id:n}}),f=await fetch(_,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify({config:t,projectId:e,name:b,avatar:r,frameworkVersion:i,managedModelName:s,tee:l})});if(!f.ok){let I=await f.text();throw new Error(`HTTP Error ${f.status}: ${I}`)}}let c=S(P.endpoints.aiAgentPublish,1,{pathParams:{id:n}}),d=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}});if(!d.ok){let b=await d.text();throw new Error(`HTTP Error ${d.status}: ${b}`)}return n}),Ur=A(async({projectId:e,accessToken:t})=>{if(!t||!e)throw new Error("Missing required parameters");if(!Q(t,e))throw new Error("The access token does not match the project");let r=S(P.endpoints.aiAgents,1,{queryParams:{projectId:e}}),o=await fetch(r,{method:"GET",headers:{authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!o.ok){let n=await o.text();throw new Error(`HTTP Error ${o.status}: ${n}`)}return(await o.json()).data}),Br=A(async({projectId:e,accessToken:t,agentId:r})=>{if(!t||!e||!r)throw new Error("Missing required parameters");if(!Q(t,e))throw new Error("The access token does not match the project");let o=S(P.endpoints.aiAgent,1,{pathParams:{id:r},queryParams:{projectId:e}}),n=await fetch(o,{method:"GET",headers:{authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!n.ok){let i=await n.text();throw new Error(`HTTP Error ${n.status}: ${i}`)}return n.json()}),ut=A(async({projectId:e,accessToken:t})=>{if(!e||!t)throw new Error("Missing required parameters");if(!Q(t,e))throw new Error("The access token does not match the project");let r=S(P.endpoints.subscriptions,1,{queryParams:{projectId:e}}),o=await fetch(r,{method:"GET",headers:{"Content-Type":"application/json",authorization:`Bearer ${t}`}});if(!o.ok&&o.status===404)return[];if(!o.ok){let n=await o.text();throw new Error(`HTTP Error ${o.status}: ${n}`)}return o.json()}),ve=A(async({projectId:e,productId:t,accessToken:r,referralId:o})=>{if(!e||!r||!t)throw new Error("Missing required parameters");if(!Q(r,e))throw new Error("The access token does not match the project");let n=S(P.endpoints.subscriptionCheckout,1),i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${r}`},body:JSON.stringify({projectId:e,product:{id:t,quantity:1},metadata:{referralId:o}})});if(!i.ok){let s=await i.text();throw new Error(`HTTP Error ${i.status}: ${s}`)}return(await i.json()).url}),dt=A(async()=>{let e=S(P.endpoints.plans,1),t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok){let r=await t.text();throw new Error(`HTTP Error ${t.status}: ${r}`)}return t.json()}),Vr=A(async({agentId:e,accessToken:t,pageCursor:r,pageSize:o=25})=>{if(!e||!t)throw new Error("Missing required parameters");let n=S(P.endpoints.aiAgentLogs,1,{pathParams:{id:e},queryParams:{cursor:r,size:o}}),i=await fetch(n,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){let s=await i.text();throw new Error(`HTTP Error ${i.status}: ${s}`)}return i.json()}),Kr=A(async({agentId:e})=>{let t=S(P.endpoints.aiAgentAttestation,1,{pathParams:{id:e}}),r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!r.ok){let o=await r.text();throw new Error(`HTTP Error ${r.status}: ${o}`)}return r.bytes()}),Gr=A(async({accessToken:e,agentId:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=S(P.endpoints.aiAgentStatus,1,{pathParams:{id:t}}),o=await fetch(r,{method:"GET",headers:{authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let n=await o.text();throw new Error(`HTTP Error ${o.status}: ${n}`)}return(await o.json()).status}),Fr=A(async({accessToken:e,agentId:t,payload:r})=>{if(!e||!t||!r)throw new Error("Missing required parameters");let o=S(P.endpoints.aiAgentUpdate,1,{pathParams:{id:t}}),n=await fetch(o,{method:"PUT",headers:{authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:r});if(!n.ok){let i=await n.text();throw new Error(`HTTP Error ${n.status}: ${i}`)}return n.json()}),Yr=A(async({agentId:e,accessToken:t,action:r})=>{if(!e||!t||!r)throw new Error("Missing required parameters");let o=S(P.endpoints.aiAgentStatusUpdate,1,{pathParams:{id:e,action:r}}),n=await fetch(o,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!n.ok){let i=await n.text();throw new Error(`HTTP Error ${n.status}: ${i}`)}}),Hr=A(async({id:e,accessToken:t})=>{if(!t||!e)throw new Error("Missing required parameters");let r=S(P.endpoints.aiAgentDelete,1,{pathParams:{id:e}}),o=await fetch(r,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){let n=await o.text();throw new Error(`HTTP Error ${o.status}: ${n}`)}return(await o.json()).id}),jr=A(async({accessToken:e})=>{if(!e)throw new Error("Missing required parameters");let t=S(P.endpoints.tokens,1),r=await fetch(t,{method:"GET",headers:{authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let o=await r.text();throw new Error(`HTTP Error ${r.status}: ${o}`)}return r.json()}),Wr=A(async({accessToken:e,payload:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=S(P.endpoints.tokens,1),o=await fetch(r,{method:"POST",headers:{authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!o.ok){let n=await o.text();throw new Error(`HTTP Error ${o.status}: ${n}`)}return o.json()}),$r=A(async({accessToken:e,tokenId:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=S(P.endpoints.tokenDelete,1,{pathParams:{id:t}}),o=await fetch(r,{method:"DELETE",headers:{authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let n=await o.text();throw new Error(`HTTP Error ${o.status}: ${n}`)}}),qr=A(async({projectId:e,subscriptionId:t,productId:r,accessToken:o,quantity:n})=>{if(!o||!e||!t||!r||n===void 0)throw new Error("Missing required parameters");if(!Q(o,e))throw new Error("The access token does not match the project");let i=S(P.endpoints.subscriptionUpdate,1,{pathParams:{id:t}}),s=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify({projectId:e,product:{id:r,quantity:n}})});if(!s.ok){let l=await s.text();throw new Error(`HTTP Error ${s.status}: ${l}`)}return s.json()}),Xr=A(async({agentId:e,accessToken:t,timeout:r=3e4,version:o="v1"})=>{if(!e||!t)throw new Error("Missing required parameters");let n=o==="v1"?P.endpoints.proxyAiAgents:P.endpoints.proxyAiAgentsV2,i=S(n,1,{pathParams:{id:e}}),s=await fetch(i,{signal:AbortSignal.timeout(r),method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!s.ok){let p=await s.text();throw new Error(`HTTP Error ${s.status}: ${p}`)}let l=await s.json();return l.data?l.data:l}),Zr=A(async({agentId:e,agentElizaId:t,accessToken:r,message:o,version:n="v1"})=>{if(!e||!r||!t||!o)throw new Error("Missing required parameters");let i=n==="v1"?P.endpoints.aiAgentMessage:P.endpoints.aiAgentMessageV2,s=S(i,1,{pathParams:{id:e,elizaId:t}}),l=await fetch(s,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({text:o})});if(!l.ok){let p=await l.text();throw new Error(`HTTP Error ${l.status}: ${p}`)}return l.json()}),Qr=A(async({accessToken:e})=>{if(!e)throw new Error("Missing required parameters");let t=S(P.endpoints.elizaOsVersions,1),r=await fetch(t,{method:"GET",headers:{authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let o=await r.text();throw new Error(`HTTP Error ${r.status}: ${o}`)}return r.json()}),Jr=A(async({accessToken:e})=>{if(!e)throw new Error("Missing required parameters");let r=await fetch(U("PUBLIC_GRAPHQL_API_URL"),{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify({operationName:"projects",query:`query projects($filter: ProjectsPaginationInput) {
projects(filter: $filter) {
data {
id
name
avatar
}
}
}`,variables:{}})});if(!r.ok){let o=await r.text();throw new Error(`HTTP Error ${r.status}: ${o}`)}return(await r.json()).data.projects.data}),eo=A(async({accessToken:e})=>{if(!e)throw new Error("Missing required parameters");let t=S(P.endpoints.llmModels,1),r=await fetch(t,{method:"GET",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let o=await r.text();throw new Error(`HTTP Error ${r.status}: ${o}`)}return r.json()}),gt=A(async({accessToken:e,projectId:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=S(P.endpoints.credits,1,{queryParams:{projectId:t}}),o=await fetch(r,{method:"GET",headers:{"Content-Type":"application/json",authorization:`Bearer ${e}`}});if(!o.ok){let n=await o.text();throw new Error(`HTTP Error ${o.status}: ${n}`)}return o.json()}),mt=A(async({accessToken:e,projectId:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=S(P.endpoints.createCreditsCheckout,1),o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify({projectId:t})});if(!o.ok){let n=await o.text();throw new Error(`HTTP Error ${o.status}: ${n}`)}return o.json()}),ze=A(async({projectId:e,productId:t,accessToken:r,referralId:o})=>{if(!e||!r||!t)throw new Error("Missing required parameters");if(!Q(r,e))throw new Error("The access token does not match the project");let n=S(P.endpoints.subscriptions,1),i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${r}`},body:JSON.stringify({projectId:e,product:{id:t,quantity:1},metadata:{referralId:o}})});if(!i.ok){let s=await i.text();throw new Error(`HTTP Error ${i.status}: ${s}`)}return await i.json()}),Le=A(async({subscriptionId:e,updateBy:t,projectId:r,accessToken:o})=>{if(!r||!o||!t||!e)throw new Error("Missing required parameters");if(!Q(o,r))throw new Error("The access token does not match the project");let n=S(P.endpoints.subscriptionUpdateQuantity,1,{pathParams:{id:e}}),i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${o}`},body:JSON.stringify({projectId:r,updateBy:t})});if(!i.ok){let s=await i.text();throw new Error(`HTTP Error ${i.status}: ${s}`)}return await i.json()}),to=A(async({content:e,messages:t,accessToken:r,version:o="v1"})=>{if(!r||!e)throw new Error("Missing required parameters");let n=Ke({route:"/assistant/stream",version:o}),i=t.map(l=>`${l.senderRole}: ${l.content}`).join(`
`),s=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${r}`},body:JSON.stringify({content:e,messages:i})});if(!s.ok){let l=await s.text();throw new Error(`HTTP Error ${s.status}: ${l}`)}return s.body?.getReader()}),ft=A(async({messages:e,accessToken:t,version:r="v1"})=>{if(!t||!e)throw new Error("Missing required parameters");let o=Ke({route:"/generate",version:r}),n=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${t}`},body:JSON.stringify({content:JSON.stringify(e)})}),i=await n.json();if(i.status==="error"){let s=i.error;throw new Error(`HTTP Error ${n.status}: ${s}`)}return i}),ro=A(async()=>{let e=Ee(U("PUBLIC_FLEEK_WEBSITE_URL"),"api/agentsAdminNotification.json"),t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok){let r=await t.text();throw new Error(`HTTP Error ${t.status}: ${r}`)}return t.json()}),Et=A(async({content:e})=>{if(!e)throw new Error("Missing required parameters");let t=Ke({route:"/improve_prompt/stream",version:"v2"}),r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})});if(!r.ok){let o=await r.text();throw new Error(`HTTP Error ${r.status}: ${o}`)}return r.body?.getReader()}),oo=A(async({accessToken:e,projectId:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=S(P.endpoints.listPaymentMethods,1,{queryParams:{projectId:t}}),o=await fetch(r,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});if(!o.ok){let n=await o.text();throw new Error(`HTTP Error ${o.status}: ${n}`)}return o.json()}),no=A(async({accessToken:e,projectId:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=S(P.endpoints.managePaymentMethods,1),o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({projectId:t})});if(!o.ok){let n=await o.text();throw new Error(`HTTP Error ${o.status}: ${n}`)}return(await o.json()).url}),ht=A(async({agentId:e,userId:t,projectId:r,accessToken:o})=>{let n=U("PUBLIC_CUSTOM_AGENTS_URL"),s=await new Ge({apiUrl:n,defaultHeaders:{authorization:`Bearer ${o}`}}).threads.create({metadata:{agent_id:e,user_id:t,project_id:r}});return{agentId:s.metadata?.agent_id,id:s.thread_id}}),io=A(async({accessToken:e,projectId:t,cursor:r,pageSize:o=3})=>{if(!e||!t)throw new Error("Missing required parameters");let n=S(P.endpoints.listInvoices,1,{queryParams:{projectId:t,cursor:r,size:o}}),i=await fetch(n,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});if(!i.ok){let s=await i.text();throw new Error(`HTTP Error ${i.status}: ${s}`)}return i.json()}),ao=A(async({accessToken:e,subscriptionId:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=S(P.endpoints.cancelSubscription,1,{pathParams:{subscriptionId:t}}),o=await fetch(r,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});if(!o.ok){let n=await o.text();throw new Error(`HTTP Error ${o.status}: ${n}`)}}),so=A(async({userId:e,projectId:t,accessToken:r})=>{let o=U("PUBLIC_CUSTOM_AGENTS_URL");return(await new Ge({apiUrl:o,defaultHeaders:{authorization:`Bearer ${r}`}}).threads.search({metadata:{user_id:e,project_id:t}})).map(s=>({id:s.thread_id,agentId:s.metadata?.agent_id}))}),lo=A(async({threadId:e,accessToken:t})=>{if(!e||!t)throw new Error("Thread ID or Access Token is missing");let r=U("PUBLIC_CUSTOM_AGENTS_URL");await new Ge({apiUrl:r,defaultHeaders:{authorization:`Bearer ${t}`}}).threads.delete(e)}),At=A(async({userId:e,projectId:t,accessToken:r,agentId:o})=>{let n=U("PUBLIC_CUSTOM_AGENTS_URL");return(await new Ge({apiUrl:n,defaultHeaders:{authorization:`Bearer ${r}`}}).threads.search({metadata:{user_id:e,project_id:t,agent_id:o}})).map(l=>({id:l.thread_id,agentId:l.metadata?.agent_id}))}),bt=A(async({accessToken:e})=>{if(!e)throw new Error("Missing required parameters");let t=S(P.endpoints.vmResources,1),r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});if(!r.ok){let o=await r.text();throw new Error(`HTTP Error ${r.status}: ${o}`)}return r.json()});import{clsx as Ko}from"clsx";var Tt="-",co=e=>{let t=uo(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{let l=s.split(Tt);return l[0]===""&&l.length!==1&&l.shift(),Vt(l,t)||po(s)},getConflictingClassGroupIds:(s,l)=>{let p=r[s]||[];return l&&o[s]?[...p,...o[s]]:p}}},Vt=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],o=t.nextPart.get(r),n=o?Vt(e.slice(1),o):void 0;if(n)return n;if(t.validators.length===0)return;let i=e.join(Tt);return t.validators.find(({validator:s})=>s(i))?.classGroupId},Ut=/^\[(.+)\]$/,po=e=>{if(Ut.test(e)){let t=Ut.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},uo=e=>{let{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return mo(Object.entries(e.classGroups),r).forEach(([i,s])=>{yt(s,o,i,t)}),o},yt=(e,t,r,o)=>{e.forEach(n=>{if(typeof n=="string"){let i=n===""?t:Bt(t,n);i.classGroupId=r;return}if(typeof n=="function"){if(go(n)){yt(n(o),t,r,o);return}t.validators.push({validator:n,classGroupId:r});return}Object.entries(n).forEach(([i,s])=>{yt(s,Bt(t,i),r,o)})})},Bt=(e,t)=>{let r=e;return t.split(Tt).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},go=e=>e.isThemeGetter,mo=(e,t)=>t?e.map(([r,o])=>{let n=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,l])=>[t+s,l])):i);return[r,n]}):e,fo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map,n=(i,s)=>{r.set(i,s),t++,t>e&&(t=0,o=r,r=new Map)};return{get(i){let s=r.get(i);if(s!==void 0)return s;if((s=o.get(i))!==void 0)return n(i,s),s},set(i,s){r.has(i)?r.set(i,s):n(i,s)}}},Kt="!",Eo=e=>{let{separator:t,experimentalParseClassName:r}=e,o=t.length===1,n=t[0],i=t.length,s=l=>{let p=[],c=0,d=0,b;for(let m=0;m<l.length;m++){let g=l[m];if(c===0){if(g===n&&(o||l.slice(m,m+i)===t)){p.push(l.slice(d,m)),d=m+i;continue}if(g==="/"){b=m;continue}}g==="["?c++:g==="]"&&c--}let _=p.length===0?l:l.substring(d),f=_.startsWith(Kt),I=f?_.substring(1):_,E=b&&b>d?b-d:void 0;return{modifiers:p,hasImportantModifier:f,baseClassName:I,maybePostfixModifierPosition:E}};return r?l=>r({className:l,parseClassName:s}):s},ho=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(o=>{o[0]==="["?(t.push(...r.sort(),o),r=[]):r.push(o)}),t.push(...r.sort()),t},Ao=e=>({cache:fo(e.cacheSize),parseClassName:Eo(e),...co(e)}),bo=/\s+/,_o=(e,t)=>{let{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n}=t,i=[],s=e.trim().split(bo),l="";for(let p=s.length-1;p>=0;p-=1){let c=s[p],{modifiers:d,hasImportantModifier:b,baseClassName:_,maybePostfixModifierPosition:f}=r(c),I=!!f,E=o(I?_.substring(0,f):_);if(!E){if(!I){l=c+(l.length>0?" "+l:l);continue}if(E=o(_),!E){l=c+(l.length>0?" "+l:l);continue}I=!1}let m=ho(d).join(":"),g=b?m+Kt:m,w=g+E;if(i.includes(w))continue;i.push(w);let k=n(E,I);for(let M=0;M<k.length;++M){let V=k[M];i.push(g+V)}l=c+(l.length>0?" "+l:l)}return l};function yo(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Gt(t))&&(o&&(o+=" "),o+=r);return o}var Gt=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=Gt(e[o]))&&(r&&(r+=" "),r+=t);return r};function To(e,...t){let r,o,n,i=s;function s(p){let c=t.reduce((d,b)=>b(d),e());return r=Ao(c),o=r.cache.get,n=r.cache.set,i=l,l(p)}function l(p){let c=o(p);if(c)return c;let d=_o(p,r);return n(p,d),d}return function(){return i(yo.apply(null,arguments))}}var x=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ft=/^\[(?:([a-z-]+):)?(.+)\]$/i,Po=/^\d+\/\d+$/,Io=new Set(["px","full","screen"]),So=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Co=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,xo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ro=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,se=e=>Pe(e)||Io.has(e)||Po.test(e),ce=e=>Ie(e,"length",Do),Pe=e=>!!e&&!Number.isNaN(Number(e)),_t=e=>Ie(e,"number",Pe),Ne=e=>!!e&&Number.isInteger(Number(e)),vo=e=>e.endsWith("%")&&Pe(e.slice(0,-1)),h=e=>Ft.test(e),pe=e=>So.test(e),zo=new Set(["length","size","percentage"]),Lo=e=>Ie(e,zo,Yt),No=e=>Ie(e,"position",Yt),Oo=new Set(["image","url"]),ko=e=>Ie(e,Oo,Bo),Mo=e=>Ie(e,"",Uo),Oe=()=>!0,Ie=(e,t,r)=>{let o=Ft.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):r(o[2]):!1},Do=e=>Co.test(e)&&!wo.test(e),Yt=()=>!1,Uo=e=>xo.test(e),Bo=e=>Ro.test(e);var Vo=()=>{let e=x("colors"),t=x("spacing"),r=x("blur"),o=x("brightness"),n=x("borderColor"),i=x("borderRadius"),s=x("borderSpacing"),l=x("borderWidth"),p=x("contrast"),c=x("grayscale"),d=x("hueRotate"),b=x("invert"),_=x("gap"),f=x("gradientColorStops"),I=x("gradientColorStopPositions"),E=x("inset"),m=x("margin"),g=x("opacity"),w=x("padding"),k=x("saturate"),M=x("scale"),V=x("sepia"),ne=x("skew"),ie=x("space"),Z=x("translate"),Y=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",h,t],y=()=>[h,t],W=()=>["",se,ce],C=()=>["auto",Pe,h],u=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],v=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],Te=()=>["","0",h],Be=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ae=()=>[Pe,h];return{cacheSize:500,separator:":",theme:{colors:[Oe],spacing:[se,ce],blur:["none","",pe,h],brightness:ae(),borderColor:[e],borderRadius:["none","","full",pe,h],borderSpacing:y(),borderWidth:W(),contrast:ae(),grayscale:Te(),hueRotate:ae(),invert:Te(),gap:y(),gradientColorStops:[e],gradientColorStopPositions:[vo,ce],inset:L(),margin:L(),opacity:ae(),padding:y(),saturate:ae(),scale:ae(),sepia:Te(),skew:ae(),space:y(),translate:y()},classGroups:{aspect:[{aspect:["auto","square","video",h]}],container:["container"],columns:[{columns:[pe]}],"break-after":[{"break-after":Be()}],"break-before":[{"break-before":Be()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...u(),h]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ne,h]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",h]}],grow:[{grow:Te()}],shrink:[{shrink:Te()}],order:[{order:["first","last","none",Ne,h]}],"grid-cols":[{"grid-cols":[Oe]}],"col-start-end":[{col:["auto",{span:["full",Ne,h]},h]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[Oe]}],"row-start-end":[{row:["auto",{span:[Ne,h]},h]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",h]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",h]}],gap:[{gap:[_]}],"gap-x":[{"gap-x":[_]}],"gap-y":[{"gap-y":[_]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[ie]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ie]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",h,t]}],"min-w":[{"min-w":[h,t,"min","max","fit"]}],"max-w":[{"max-w":[h,t,"none","full","min","max","fit","prose",{screen:[pe]},pe]}],h:[{h:[h,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[h,t,"auto","min","max","fit"]}],"font-size":[{text:["base",pe,ce]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",_t]}],"font-family":[{font:[Oe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",h]}],"line-clamp":[{"line-clamp":["none",Pe,_t]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",se,h]}],"list-image":[{"list-image":["none",h]}],"list-style-type":[{list:["none","disc","decimal",h]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",se,ce]}],"underline-offset":[{"underline-offset":["auto",se,h]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...u(),No]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Lo]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ko]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[I]}],"gradient-via-pos":[{via:[I]}],"gradient-to-pos":[{to:[I]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:z()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[se,h]}],"outline-w":[{outline:[se,ce]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[se,ce]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",pe,Mo]}],"shadow-color":[{shadow:[Oe]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...v(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":v()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",pe,h]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[b]}],saturate:[{saturate:[k]}],sepia:[{sepia:[V]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[V]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",h]}],duration:[{duration:ae()}],ease:[{ease:["linear","in","out","in-out",h]}],delay:[{delay:ae()}],animate:[{animate:["none","spin","ping","pulse","bounce",h]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[Ne,h]}],"translate-x":[{"translate-x":[Z]}],"translate-y":[{"translate-y":[Z]}],"skew-x":[{"skew-x":[ne]}],"skew-y":[{"skew-y":[ne]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",h]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[se,ce,_t]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ht=To(Vo);var R=(...e)=>Ht(Ko(e));import{cva as Go}from"class-variance-authority";import Fo from"react";import{jsx as Ho}from"react/jsx-runtime";var Yo=Go("flex flex-col",{variants:{variant:{container:"bg-elz-neutral-1 p-16 gap-16 rounded-12 border border-elz-neutral-6 overflow-hidden"}}}),T=Fo.forwardRef(({children:e,variant:t,className:r,...o},n)=>Ho("div",{ref:n,className:R(Yo({variant:t}),r),...o,children:e}));import{forwardRef as qo}from"react";import{cva as Xo}from"class-variance-authority";import{forwardRef as jo}from"react";import{jsx as $o}from"react/jsx-runtime";var Wo=jo(({children:e,...t},r)=>$o("a",{ref:r,rel:t.target==="_blank"?"noopener noreferrer":void 0,...t,children:e})),J=Wo;import{jsx as Wt}from"react/jsx-runtime";var jt=Xo("flex min-w-fit font-medium no-underline gap-4 select-none font-inter cursor-pointer items-center justify-center transition-all ring-0 outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:bg-elz-neutral-3 disabled:text-elz-neutral-8",{variants:{variant:{neutral:"text-elz-neutral-11 bg-elz-neutral-3 hover:bg-elz-neutral-4 active:bg-elz-neutral-5 focus-visible:ring-elz-neutral-8",accent:"text-elz-accent-11 bg-elz-accent-3 hover:bg-elz-accent-4 active:bg-elz-accent-5 focus-visible:ring-elz-accent-8",success:"text-elz-success-11 bg-elz-success-3 hover:bg-elz-success-4 active:bg-elz-success-5 focus-visible:ring-elz-success-8",warning:"text-elz-warning-11 bg-elz-warning-3 hover:bg-elz-warning-4 active:bg-elz-warning-5 focus-visible:ring-elz-warning-8",danger:"text-elz-danger-11 bg-elz-danger-3 hover:bg-elz-danger-4 active:bg-elz-danger-5 focus-visible:ring-elz-danger-8",ghost:"text-elz-neutral-11 bg-transparent hover:bg-elz-neutral-4 active:bg-elz-neutral-5 disabled:bg-transparent focus-visible:ring-elz-neutral-8","ghost-bordered":"text-elz-neutral-11 bg-transparent hover:bg-elz-neutral-4 active:bg-elz-neutral-5 disabled:bg-transparent focus-visible:ring-elz-neutral-8 border border-elz-neutral-6",bare:"text-elz-neutral-11 bg-transparent hover:text-elz-neutral-12 active:text-elz-neutral-12 disabled:bg-transparent focus-visible:ring-elz-neutral-8 !p-0 !border-none transition-colors duration-150",primary:"bg-elz-accent-9 hover:bg-elz-accent-10 active:bg-elz-accent-9 text-elz-accent-1 ring-elz-accent-8 disabled:bg-elz-neutral-3 disabled:text-elz-neutral-8 disabled:ring-elz-neutral-3 disabled:cursor-not-allowed",outline:"text-elz-neutral-12 bg-transparent hover:bg-elz-neutral-4 active:bg-elz-neutral-5 disabled:bg-transparent focus-visible:ring-elz-neutral-8 border border-elz-neutral-7",white:"text-elz-neutral-1 bg-white hover:bg-elz-neutral-11 active:bg-elz-neutral-10 focus-visible:ring-elz-neutral-8 disabled:bg-elz-neutral-3"},size:{xxs:"h-24 gap-4 px-8 rounded-10 text-[1.2rem]",xs:"h-24 gap-4 px-8 rounded-10 text-[1.4rem]",sm:"h-36 gap-4 px-8 rounded-11 text-[1.4rem]",md:"h-40 gap-8 px-16 rounded-12 text-[1.6rem]",lg:"h-44 gap-8 px-16 rounded-12 text-[1.6rem]",icon:"size-36 aspect-1 gap-8 rounded-12 text-[1.6rem]"}},defaultVariants:{variant:"accent",size:"sm"}}),G=qo(({id:e,children:t,href:r,target:o,rel:n,onClick:i,variant:s,size:l,className:p,...c},d)=>r?Wt(J,{ref:d,id:e,href:r,target:o,rel:n,className:R(jt({variant:s,size:l}),p),children:t}):Wt("button",{ref:d,id:e,onClick:i,className:R(jt({variant:s,size:l}),p),...c,children:t}));import{useRef as Qt,useState as It,useEffect as St}from"react";import{FaSpinner as Jt}from"react-icons/fa6";import{BsFileEarmarkText as Qo}from"react-icons/bs";import{IoClose as Jo}from"react-icons/io5";import{jsx as he,jsxs as Zo}from"react/jsx-runtime";var Fe=({variant:e})=>e==="small"?he("svg",{role:"img","aria-label":"small bolt icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:he("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.7365 0.0440924C19.8713 -0.0831111 20.0763 0.0903391 19.9709 0.242402L15.2549 7.04263C15.1807 7.14964 15.2656 7.29399 15.3961 7.28267L18.1684 7.04222C18.3064 7.03025 18.3897 7.19022 18.2998 7.29482L13.5419 12.835C13.4521 12.9397 13.5353 13.0996 13.6733 13.0876L16.6586 12.8287C16.8046 12.8161 16.8851 12.9929 16.7789 13.093L5.26353 23.9559C5.12868 24.0831 4.92364 23.9096 5.0291 23.7576L9.8071 16.8679C9.88131 16.7609 9.79642 16.6165 9.66594 16.6278L6.83434 16.8734C6.69677 16.8854 6.61339 16.7264 6.70226 16.6216L11.3202 11.1762C11.4091 11.0714 11.3257 10.9123 11.1881 10.9243L8.34145 11.1712C8.19545 11.1839 8.11499 11.007 8.22117 10.9069L19.7365 0.0440924Z",fill:"#B4B4B4"})}):he("svg",{role:"img","aria-label":"bolt icon",width:"22",height:"45",viewBox:"0 0 22 45",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:he("path",{d:"M20.3695 13.0981L12.7018 24.2968L18.54 23.1037C18.6552 23.2863 18.7704 23.469 18.8856 23.6516L0.661202 45H0L7.49488 31.1342L1.98736 32.2587C1.81079 32.01 1.79577 31.992 1.61919 31.7433L9.0502 20.7429L3.46755 21.8819C3.29098 21.6115 3.29474 21.6115 3.11817 21.3376L21.3313 0H22L14.6066 13.6856L20.0014 12.5827C20.1817 12.8314 20.193 12.8494 20.3695 13.0981Z",fill:"white"})}),ue=()=>Zo("svg",{role:"img",width:"34",height:"33",viewBox:"0 0 34 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{animation:"spin 1s linear infinite"},"aria-label":"Loading spinner",children:[he("path",{d:"M32 16.5C32 24.7843 25.2843 31.5 17 31.5C8.71573 31.5 2 24.7843 2 16.5C2 8.21573 8.71573 1.5 17 1.5C25.2843 1.5 32 8.21573 32 16.5Z",stroke:"#606060",strokeWidth:"2.42308"}),he("path",{d:"M2 16.5C2 8.21573 8.71573 1.5 17 1.5",stroke:"white",strokeWidth:"2.42308",strokeLinecap:"round"}),he("style",{children:`
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
`})]});import{useState as en}from"react";import{Fragment as on,jsx as ee,jsxs as Ye}from"react/jsx-runtime";var tn=({file:e,onRemove:t})=>{let r=e.type.startsWith("image/")&&e.preview,o=e.name.split(".").pop()?.toLowerCase()||"",n=e.name.split(".").slice(0,-1).join("."),[i,s]=en(!0);return Ye(T,{className:`relative group rounded-7 flex-shrink-0 overflow-hidden border border-elz-neutral-6 ${r?"size-[48px]":"w-[96px] h-[48px]"}`,children:[r?Ye(on,{children:[i&&ee(T,{className:"absolute inset-0 flex items-center justify-center bg-elz-neutral-3",children:ee(ue,{})}),ee("img",{src:e.preview,alt:e.name,className:`w-full h-full object-cover transition-opacity duration-200 ${i?"opacity-0":"opacity-100"}`,onLoad:()=>s(!1)})]}):Ye(T,{className:"flex flex-col size-full items-start justify-center bg-elz-neutral-3 p-2 gap-2",children:[Ye("div",{className:"flex flex-row gap-1",children:[ee(Qo,{className:"size-15 text-elz-neutral-8"}),ee("span",{className:"text-elz-neutral-11 text-[10px]",children:o})]}),ee("span",{title:n,className:"text-elz-neutral-11 text-[10px] max-w-full truncate px-1",children:n})]}),ee("button",{type:"button",onClick:t,className:"absolute top-0 right-0 size-15 rounded-full bg-elz-neutral-12 text-elz-neutral-2 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:ee(Jo,{className:"size-10"})})]})},rn=({files:e,onRemoveFile:t})=>e.length===0?null:ee(T,{className:"flex flex-row gap-6 overflow-x-auto pb-2",children:e.map((r,o)=>ee(tn,{file:r,onRemove:()=>t(o)},`${r.name}-${o}`))}),$t=rn;import Ct from"react-hot-toast";import{cva as nn}from"class-variance-authority";import{createElement as an,forwardRef as sn}from"react";var ln=nn("font-inter",{variants:{variant:{title:"text-balance text-[3.6rem] font-semibold text-elz-neutral-12",description:"text-[1.6rem] font-medium text-elz-neutral-11",subtitle:"text-[1.6rem] text-elz-neutral-12 font-semibold",feature:"text-[1.2rem] font-medium uppercase tracking-[0.256rem] text-elz-neutral-11",primary:"text-elz-neutral-12",secondary:"text-elz-neutral-11"},size:{"2xs":"text-[1rem]",xs:"text-[1.2rem]",sm:"text-[1.4rem]",md:"text-[1.6rem]",lg:"text-[1.8rem]",xl:"text-[2.0rem]","2xl":"text-[2.6rem]","3xl":"text-[3.4rem]","4xl":"text-[5.8rem]"},weight:{400:"font-normal",500:"font-medium",700:"font-bold"}},defaultVariants:{variant:"title"}});var B=sn(({children:e,as:t="p",variant:r,size:o,weight:n,className:i,...s},l)=>an(t,{ref:l,className:R(ln({variant:r,size:o,weight:n}),i),...s},e));import{useCallback as cn,useRef as pn,useState as Pt}from"react";function qt({streamFn:e,decoder:t=new TextDecoder,onChunk:r,onSuccess:o,onStreaming:n,onDone:i,onError:s}){let[l,p]=Pt(""),[c,d]=Pt("idle"),[b,_]=Pt(null),f=pn(null),I=cn(async E=>{f.current?.abort();let m=new AbortController;f.current=m;let g="";p(g),_(null),d("pending");try{let w=await e(E);if(!w)throw new Error("Stream function did not return a reader.");for(d("streaming"),n?.({variables:E});;){let{done:k,value:M}=await w.read();if(k)break;let V=t.decode(M,{stream:!0});g=g+V,p(g),await r?.({chunk:V,prev:g,variables:E})}d("success"),o?.({variables:E})}catch(w){let k=w instanceof Error?w:new Error("Unknown error");if(k.name==="AbortError")return;_(k),d("error"),s?.({error:k,variables:E})}finally{i?.({variables:E})}},[e,t,r,o,i,s,n]);return{data:l,error:b,status:c,mutate:I,isIdle:c==="idle",isPending:c==="pending",isStreaming:c==="streaming",isSuccess:c==="success",isError:c==="error",isLoading:c==="pending"||c==="streaming"}}var Xt=e=>new Promise(t=>setTimeout(t,e)),un="agent",dn="user";import mn from"react-hot-toast";var Zt=({onChunk:e,onStreaming:t})=>qt({streamFn:async({content:r})=>Et({content:r},{throwOnError:!0}),onChunk:async({chunk:r})=>{for(let o of r)await Xt(8),e(o)},onErro