import{f as g,j as e,N as A,h as y,H as a}from"./vendor-ClLR6ncd.js";import{c as h,d as x,e as k,p as j}from"./index-OtVJl4GC.js";import"./lodash-ZyeDnt0e.js";import{u as L,a as O,v as b,s as v}from"./model-BneMh0-t.js";import{O as I}from"./ui-DG_5mJZa.js";import{E as D}from"./Messages-BRmQDxrZ.js";import{u as T}from"./model-C9Idzwgo.js";import{D as P,a as C,b as K}from"./DialogContent-DR8Wx7Lo.js";import{D as M}from"./DialogTitle-i0lt2jWQ.js";import{L as R}from"./Link-BLwKPJFF.js";import"./model-DgFcCvKB.js";import"./model-DAvH-x8m.js";import"./SmallStandardSelect-7k6-Wr8Q.js";import"./MenuItem-CCerWMyq.js";import"./dividerClasses-DvO85-mA.js";import"./Visibility-DBeRDmOx.js";import"./InputAdornment-CFoDSQyQ.js";function Y(){const[s,t]=L(),{value:n,isLoading:l}=O(),p=h(j.super),{catalogId:m,allRepositories:i}=T(),d=Array.isArray(i)?i.length===0:!1,c=g(),r=()=>{c("/")},o=x(async()=>{await b(s);const f=k({catalogId:m,repositoryId:i[0].id});await v(f,s,"default")},{onSuccess:r}),u=r;return l?null:p||d||n?e.jsx(A,{to:"/"}):e.jsxs(P,{open:!0,children:[e.jsx(M,{children:"Welcome to AllegroGraph!"}),e.jsxs(C,{children:[e.jsxs(y,{sx:{mb:2},children:[`AllegroGraph integrates LLM from different vendors directly into
          SPARQL queries. By default, AllegroGraph uses OpenAI models to embed
          or generate completions. In order to enable OpenAI LLM integration, you need
          to fill in the OpenAI API key. If you don't have one, you can create
          one `,e.jsx(R,{href:"https://platform.openai.com/api-keys",target:"_blank",children:"here"}),"."]}),e.jsx(I,{required:!0,disabled:o.isLoading,label:"OpenAI API Key",apiKey:s,setApiKey:t}),e.jsx(D,{error:o.error,resetError:o.reset})]}),e.jsxs(K,{children:[e.jsx(a,{disabled:o.isLoading,onClick:u,children:"Cancel"}),e.jsx(a,{disabled:o.isLoading,onClick:o.mutate,children:"Save"})]})]})}export{Y as default};
