import{a$ as Ie,Q as Re,w as Me,N as dt,r as s,u as M,y as ct,H as ke,e,D as Ee,f as Ae,g as He,B as h,O as pt,ai as we,G as oe,aj as gt,ak as ut,al as ht,L as O,T,l as Pe,P as S,A as C,b3 as Oe,S as Te,ar as ft,as as xt,at as mt,au as bt,av as jt,aw as St,ax as vt,ay as yt,az as Dt,am as Ve,an as Ne,n as Ct,aC as kt,x as wt,aD as It,R as Rt,M as Mt,E as Et,V as At,aF as Ht,a7 as L,b4 as Pt,X as D,ac as H,ag as P,F as Ot,ad as Tt,J as Vt,ah as te,a5 as ae,a6 as re,b5 as Nt,b6 as Lt,b7 as Ut,aU as $t,K as _t}from"./index-_6SmYgWK.js";import{D as se}from"./DocStoreInputHandler-CaPW_OoW.js";import{U as Ft}from"./UpsertResultDialog-DT0mwC9l.js";import{v as Wt,H as qt}from"./vectorstore-khdhkL5P.js";import{S as Bt,I as zt,T as Yt,a as Gt,b as Qt,c as Jt,d as Xt,e as Kt,f as Zt,t as ea}from"./TimelineSeparator-CYoEBuNS.js";import{d as ta}from"./ExpandMore-DfVpxsz-.js";import{T as aa}from"./Table-DcZ35doG.js";import{S as U}from"./StatsCard-DjLJlF2a.js";import{d as $}from"./DynamicFeed-B7HOSqN2.js";import{I as ra}from"./IconDeviceFloppy-WiT0BtR9.js";import{v as ne}from"./v4-CtRu48qb.js";import"./AssistantDialog-CjH6GuIO.js";import"./string-BbYD24iH.js";/**
 * @license @tabler/icons-react v3.31.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var ie=Ie("outline","edit-circle","IconEditCircle",[["path",{d:"M12 15l8.385 -8.415a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3z",key:"svg-0"}],["path",{d:"M16 5l3 3",key:"svg-1"}],["path",{d:"M9 7.07a7 7 0 0 0 1 13.93a7 7 0 0 0 6.929 -6",key:"svg-2"}]]);/**
 * @license @tabler/icons-react v3.31.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var sa=Ie("outline","row-insert-top","IconRowInsertTop",[["path",{d:"M4 18v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M12 9v-4",key:"svg-1"}],["path",{d:"M10 7l4 0",key:"svg-2"}]]);const _=({show:f,dialogProps:u,onCancel:k,apiCall:I,onSelected:y})=>{const n=document.getElementById("portal"),x=Re(d=>d.customization),g=Me(),r=dt(),[v,m]=s.useState(""),[b,R]=s.useState([]),w=M(I),E=d=>{m(d)};function A(d){var j;return((j=d==null?void 0:d.name)==null?void 0:j.toLowerCase().indexOf(v.toLowerCase()))>-1}s.useEffect(()=>{},[u]),s.useEffect(()=>{w.request()},[]),s.useEffect(()=>{w.data&&R(w.data)},[w.data]),s.useEffect(()=>(g(f?{type:ct}:{type:ke}),()=>g({type:ke})),[f,g]);const V=f?e.jsxs(Ee,{fullWidth:!0,maxWidth:"md",open:f,onClose:k,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[e.jsx(Ae,{sx:{fontSize:"1rem",p:3,pb:0},id:"alert-dialog-title",children:u.title}),e.jsxs(He,{sx:{display:"flex",flexDirection:"column",gap:2,maxHeight:"75vh",position:"relative",px:3,pb:3},children:[e.jsx(h,{sx:{backgroundColor:x.isDarkMode?r.palette.background.darkPaper:r.palette.background.paper,pt:2,position:"sticky",top:0,zIndex:10},children:e.jsx(pt,{sx:{width:"100%",pr:2,pl:2,position:"sticky"},id:"input-search-credential",value:v,onChange:d=>E(d.target.value),placeholder:"Search",startAdornment:e.jsx(we,{position:"start",children:e.jsx(gt,{stroke:1.5,size:"1rem",color:r.palette.grey[500]})}),endAdornment:e.jsx(we,{position:"end",sx:{cursor:"pointer",color:r.palette.grey[500],"&:hover":{color:r.palette.grey[900]}},title:"Clear Search",children:e.jsx(oe,{stroke:1.5,size:"1rem",onClick:()=>E(""),style:{cursor:"pointer"}})}),"aria-describedby":"search-helper-text",inputProps:{"aria-label":"weight"}})}),e.jsx(ut,{sx:{width:"100%",display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:2,py:0,zIndex:9,borderRadius:"10px",[r.breakpoints.down("md")]:{maxWidth:370}},children:[...b].filter(A).map(d=>e.jsxs(ht,{alignItems:"center",onClick:()=>y(d),sx:{border:1,borderColor:r.palette.grey[900]+25,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"start",textAlign:"left",gap:1,p:2},children:[e.jsx("div",{style:{width:50,height:50,borderRadius:"50%",backgroundColor:"white",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("img",{style:{width:"100%",height:"100%",padding:7,borderRadius:"50%",objectFit:"contain"},alt:d.name,src:`${O}/api/v1/node-icon/${d.name}`})}),e.jsx(T,{children:d.label})]},d.name))})]})]}):null;return Pe.createPortal(V,n)};_.propTypes={show:S.bool,dialogProps:S.object,onCancel:S.func,apiCall:S.func,onSelected:S.func};const Le=({show:f,dialogProps:u,onClickFunction:k,onSelectHistoryDetails:I})=>{const y=()=>{},[n,x]=s.useState([]),g=M(Wt.getUpsertHistory);return s.useEffect(()=>{g.request(u.id)},[u]),s.useEffect(()=>{g.data&&x(g.data)},[g.data]),e.jsx(e.Fragment,{children:e.jsxs(Bt,{anchor:"right",open:f,onClose:()=>k(),onOpen:y,children:[e.jsx(C,{startIcon:e.jsx(zt,{}),onClick:()=>k(),children:"Close"}),e.jsx(h,{style:{width:350,margin:10},role:"presentation",onClick:k,children:e.jsxs(Yt,{sx:{[`& .${ea.root}`]:{flex:1}},children:[n&&n.map((r,v)=>e.jsxs(Gt,{children:[e.jsx(Qt,{children:Oe(r.date).format("DD-MMM-YYYY, hh:mm:ss A")}),e.jsxs(Jt,{style:{marginTop:5},children:[e.jsx(Xt,{}),v!==n.length-1&&e.jsx(Kt,{})]}),e.jsxs(Zt,{children:[r.result.numAdded!==void 0&&r.result.numAdded>0&&e.jsxs(h,{sx:{fontWeight:500},children:["Added: ",r.result.numAdded]}),r.result.numUpdated!==void 0&&r.result.numUpdated>0&&e.jsxs(h,{sx:{fontWeight:500},children:["Updated: ",r.result.numUpdated]}),r.result.numSkipped!==void 0&&r.result.numSkipped>0&&e.jsxs(h,{sx:{fontWeight:500},children:["Skipped: ",r.result.numSkipped]}),r.result.numDeleted!==void 0&&r.result.numDeleted>0&&e.jsxs(h,{sx:{fontWeight:500},children:["Deleted: ",r.result.numDeleted]}),e.jsx(C,{size:"small",sx:{mt:1,mb:3,borderRadius:"25px"},variant:"outlined",onClick:()=>I(r),children:"Details"})]})]},v)),n.length===0&&e.jsxs(Te,{sx:{alignItems:"center",justifyContent:"center"},flexDirection:"column",children:[e.jsx(h,{sx:{pb:2,height:"auto"},children:e.jsx("img",{style:{objectFit:"cover",height:"10vh",width:"auto"},src:qt,alt:"HistoryEmptySVG"})}),e.jsx("div",{children:"No Upsert History Yet"})]})]})})]})})};Le.propTypes={show:S.bool,dialogProps:S.object,onClickFunction:S.func,onSelectHistoryDetails:S.func};const Ue=({show:f,dialogProps:u,onCancel:k})=>{const I=document.getElementById("portal"),[y,n]=s.useState({}),x=r=>(v,m)=>{const b={...y};b[r]=m,n(b)},g=f?e.jsxs(Ee,{fullWidth:!0,maxWidth:"md",open:f,onClose:k,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[e.jsx(Ae,{sx:{fontSize:"1rem",p:3,pb:0},id:"alert-dialog-title",children:u.title}),e.jsxs(He,{sx:{display:"flex",flexDirection:"column",gap:2,maxHeight:"75vh",position:"relative",px:3,pb:3},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, minmax(0, 1fr))",gap:5,marginTop:"10px"},children:[e.jsx(U,{title:"Added",stat:u.numAdded??0}),e.jsx(U,{title:"Updated",stat:u.numUpdated??0}),e.jsx(U,{title:"Skipped",stat:u.numSkipped??0}),e.jsx(U,{title:"Deleted",stat:u.numDeleted??0})]}),e.jsx("div",{children:e.jsx(ft,{component:xt,children:e.jsx(mt,{sx:{minWidth:650},"aria-label":"simple table",children:e.jsx(bt,{children:e.jsx(jt,{sx:{"& td":{border:0}},children:e.jsx(St,{sx:{pb:0,pt:0},colSpan:6,children:e.jsx(h,{sx:{mt:1,mb:2},children:(u.flowData??[]).map((r,v)=>e.jsxs(vt,{expanded:y[r.id]||!1,onChange:x(r.id),disableGutters:!0,children:[e.jsx(yt,{expandIcon:e.jsx(ta,{}),"aria-controls":`nodes-accordian-${r.name}`,id:`nodes-accordian-header-${r.name}`,children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsx("div",{style:{width:40,height:40,marginRight:10,borderRadius:"50%",backgroundColor:"white"},children:e.jsx("img",{style:{width:"100%",height:"100%",padding:7,borderRadius:"50%",objectFit:"contain"},alt:r.name,src:`${O}/api/v1/node-icon/${r.name}`})}),e.jsx(T,{variant:"h5",children:r.label}),e.jsx("div",{style:{display:"flex",flexDirection:"row",width:"max-content",borderRadius:15,background:"rgb(254,252,191)",padding:5,paddingLeft:10,paddingRight:10,marginLeft:10},children:e.jsx("span",{style:{color:"rgb(116,66,16)",fontSize:"0.825rem"},children:r.id})})]})}),e.jsx(Dt,{children:r.paramValues[0]&&e.jsx(aa,{sx:{minWidth:150},rows:r.paramValues,columns:Object.keys(r.paramValues[0])})})]},v))})})})})})})})]})]}):null;return Pe.createPortal(g,I)};Ue.propTypes={show:S.bool,dialogProps:S.object,onCancel:S.func};var le={},na=Ve;Object.defineProperty(le,"__esModule",{value:!0});var $e=le.default=void 0,ia=na(Ne()),oa=e,la=(0,ia.default)((0,oa.jsx)("path",{d:"M2 20h20v-4H2v4zm2-3h2v2H4v-2zM2 4v4h20V4H2zm4 3H4V5h2v2zm-4 7h20v-4H2v4zm2-3h2v2H4v-2z"}),"Storage");$e=le.default=la;var de={},da=Ve;Object.defineProperty(de,"__esModule",{value:!0});var _e=de.default=void 0,ca=da(Ne()),pa=e,ga=(0,ca.default)((0,pa.jsx)("path",{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm11 10h2V5h-4v2h2v8zm7-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"}),"Filter1");_e=de.default=ga;const ua=["Embeddings","Vector Store","Record Manager"],Ia=()=>{const f=Ct(),u=Me(),{hasAssignedWorkspace:k}=kt();wt();const{error:I,setError:y}=It(),n=Re(t=>t.customization),{storeId:x,docId:g}=Rt(),r=(...t)=>u(Vt(...t)),v=(...t)=>u(_t(...t)),m=M(P.getSpecificDocumentStore),b=M(P.insertIntoVectorStore),R=M(P.saveVectorStoreConfig),w=M(te.getSpecificNode),E=M(te.getSpecificNode),A=M(te.getSpecificNode),[V,d]=s.useState(!0),[j,Fe]=s.useState({}),[F,W]=s.useState({}),[ce,We]=s.useState(null),[q,B]=s.useState(!1),[o,z]=s.useState({}),[Y,G]=s.useState(!1),[l,Q]=s.useState({}),[J,X]=s.useState(!1),[p,N]=s.useState({}),[K,pe]=s.useState(!1),[ge,ue]=s.useState(!1),[qe,Be]=s.useState({}),[he,fe]=s.useState(!1),[ze,Ye]=s.useState({}),[xe,me]=s.useState(!1),[Ge,Qe]=s.useState({}),Je=({inputParam:t,newValue:a})=>{z(c=>{const i={...c};return i.inputs[t.name]=a,i.inputParams=H(i),i})},Xe=({inputParam:t,newValue:a})=>{Q(c=>{const i={...c};return i.inputs[t.name]=a,i.inputParams=H(i),i})},Ke=({inputParam:t,newValue:a})=>{N(c=>{const i={...c};return i.inputs[t.name]=a,i.inputParams=H(i),i})},be=t=>{const a=ae.cloneDeep(re(t,ne()));!q&&j.embeddingConfig&&(a.inputs=j.embeddingConfig.config,a.credential=j.embeddingConfig.config.credential),z(a),B(!1)},je=()=>{W({title:"Select Embeddings Provider"}),B(!0)},Se=t=>{const a=ae.cloneDeep(re(t,ne()));a.inputAnchors.find(c=>c.name==="recordManager")?pe(!1):(pe(!0),N({})),!Y&&j.vectorStoreConfig&&(a.inputs=j.vectorStoreConfig.config,a.credential=j.vectorStoreConfig.config.credential),Q(a),G(!1)},ve=()=>{W({title:"Select a Vector Store Provider"}),G(!0)},ye=t=>{const a=ae.cloneDeep(re(t,ne()));!J&&j.recordManagerConfig&&(a.inputs=j.recordManagerConfig.config,a.credential=j.recordManagerConfig.config.credential),N(a),X(!1)},De=()=>{W({title:"Select a Record Manager"}),X(!0)},Ze=()=>{Ye({id:x}),fe(!0)},et=t=>{const a={title:Oe(t.date).format("DD-MMM-YYYY, hh:mm:ss A"),numAdded:t.result.numAdded,numUpdated:t.result.numUpdated,numSkipped:t.result.numSkipped,numDeleted:t.result.numDeleted,flowData:t.flowData};Qe(a),me(!0)},tt=()=>{let t=!0;const a=((l==null?void 0:l.inputParams)??[]).filter(i=>!i.hidden);for(const i of a)if(!i.optional&&(!l.inputs[i.name]||!l.credential)){if(i.type==="credential"&&!l.credential){t=!1;break}else if(i.type!=="credential"&&!l.inputs[i.name]){t=!1;break}}const c=((o==null?void 0:o.inputParams)??[]).filter(i=>!i.hidden);for(const i of c)if(!i.optional&&(!o.inputs[i.name]||!o.credential)){if(i.type==="credential"&&!o.credential){t=!1;break}else if(i.type!=="credential"&&!o.inputs[i.name]){t=!1;break}}return t||r({message:"Please fill in all mandatory fields.",options:{key:new Date().getTime()+Math.random(),variant:"warning",action:i=>e.jsx(C,{style:{color:"white"},onClick:()=>v(i),children:e.jsx(oe,{})})}}),t},Ce=()=>{const t={storeId:x,docId:g,isStrictSave:!0};return o.inputs?(t.embeddingConfig={},t.embeddingName=o.name,Object.keys(o.inputs).map(a=>{a==="FLOWISE_CREDENTIAL_ID"?t.embeddingConfig.credential=o.inputs[a]:t.embeddingConfig[a]=o.inputs[a]})):(t.embeddingConfig=null,t.embeddingName=""),l.inputs?(t.vectorStoreConfig={},t.vectorStoreName=l.name,Object.keys(l.inputs).map(a=>{a==="FLOWISE_CREDENTIAL_ID"?t.vectorStoreConfig.credential=l.inputs[a]:t.vectorStoreConfig[a]=l.inputs[a]})):(t.vectorStoreConfig=null,t.vectorStoreName=""),p.inputs?(t.recordManagerConfig={},t.recordManagerName=p.name,Object.keys(p.inputs).map(a=>{a==="FLOWISE_CREDENTIAL_ID"?t.recordManagerConfig.credential=p.inputs[a]:t.recordManagerConfig[a]=p.inputs[a]})):(t.recordManagerConfig=null,t.recordManagerName=""),t},at=()=>{if(tt()){d(!0);const t=Ce();b.request(t)}},rt=()=>{d(!0);const t=Ce();R.request(t)},st=()=>{z({}),Q({}),N({})},nt=()=>p&&Object.keys(p).length>0?3:l&&Object.keys(l).length>0?2:o&&Object.keys(o).length>0?1:0,it=()=>e.jsx(h,{sx:{width:"100%"},children:e.jsx(Nt,{activeStep:nt(),alternativeLabel:!0,children:ua.map(t=>e.jsx(Lt,{children:e.jsx(Ut,{children:t})},t))})}),Z=()=>Object.keys(l).length===0||K,ee=()=>Object.keys(o).length===0,ot=t=>{if(!t)return"";const a=t.loaderName||"Unknown";let c="";return t.files&&Array.isArray(t.files)&&t.files.length>0?c=t.files.map(i=>i.name).join(", "):t.source&&(typeof t.source=="string"&&t.source.includes("base64")?c=$t(t.source):typeof t.source=="string"&&t.source.startsWith("[")&&t.source.endsWith("]")?c=JSON.parse(t.source).join(", "):typeof t.source=="string"&&(c=t.source)),c?`${a} (${c})`:a},lt=()=>{var a;const t=((a=m.data)==null?void 0:a.name)||"";if(g&&ce){const c=ot(ce);return`${t} / ${c}`}return t};return s.useEffect(()=>{R.data&&(d(!1),r({message:"Configuration saved successfully",options:{key:new Date().getTime()+Math.random(),variant:"success",action:t=>e.jsx(C,{style:{color:"white"},onClick:()=>v(t),children:e.jsx(oe,{})})}}))},[R.data]),s.useEffect(()=>{b.data&&(d(!1),ue(!0),Be({...b.data,goToRetrievalQuery:!0}))},[b.data]),s.useEffect(()=>{b.error&&(d(!1),y(b.error))},[b.error]),s.useEffect(()=>{R.error&&(d(!1),y(R.error))},[R.error]),s.useEffect(()=>{m.request(x)},[]),s.useEffect(()=>{if(m.data){const t=m.data;if(!k(t.workspaceId)){f("/unauthorized");return}if(Fe(t),g&&t.loaders){const a=t.loaders.find(c=>c.id===g);a&&We(a)}t.embeddingConfig&&w.request(t.embeddingConfig.name),t.vectorStoreConfig&&E.request(t.vectorStoreConfig.name),t.recordManagerConfig&&A.request(t.recordManagerConfig.name),d(!1)}},[m.data]),s.useEffect(()=>{if(w.data){const t=w.data;be(t)}},[w.data]),s.useEffect(()=>{if(E.data){const t=E.data;Se(t)}},[E.data]),s.useEffect(()=>{if(A.data){const t=A.data;ye(t)}},[A.data]),s.useEffect(()=>{m.error&&y(m.error)},[m.error]),e.jsxs(e.Fragment,{children:[e.jsx(Mt,{children:I?e.jsx(Et,{error:I}):e.jsxs(e.Fragment,{children:[!x&&e.jsx("div",{}),x&&e.jsxs(Te,{flexDirection:"column",sx:{gap:3},children:[e.jsxs(At,{isBackButton:!0,search:!1,title:lt(),description:"Configure Embeddings, Vector Store and Record Manager",onBack:()=>f(-1),children:[(Object.keys(o).length>0||Object.keys(l).length>0)&&e.jsx(C,{variant:"outlined",color:"error",sx:{borderRadius:2,height:"100%"},startIcon:e.jsx(Ht,{}),onClick:()=>st(),children:"Reset"}),(Object.keys(o).length>0||Object.keys(l).length>0)&&e.jsx(C,{variant:"outlined",color:"secondary",sx:{borderRadius:2,height:"100%"},startIcon:e.jsx(ra,{}),onClick:()=>rt(),children:"Save Config"}),Object.keys(o).length>0&&Object.keys(l).length>0&&e.jsx(C,{variant:"contained",sx:{borderRadius:2,height:"100%",backgroundImage:"linear-gradient(to right, #13547a, #2f9e91)","&:hover":{backgroundImage:"linear-gradient(to right, #0b3d5b, #1a8377)"}},startIcon:e.jsx(sa,{}),onClick:()=>at(),children:"Upsert"}),e.jsx(L,{onClick:Ze,size:"small",color:"inherit",title:"Upsert History",children:e.jsx(Pt,{})})]}),e.jsx(it,{}),e.jsxs(D,{container:!0,spacing:1,children:[e.jsx(D,{item:!0,xs:12,sm:4,md:4,children:Object.keys(o).length===0?e.jsx(C,{onClick:je,fullWidth:!0,startIcon:e.jsx($,{style:{background:"transparent",height:32,width:32}}),sx:{color:n!=null&&n.isDarkMode?"white":"inherit",borderRadius:"10px",minHeight:"200px",boxShadow:"0 2px 14px 0 rgb(32 40 45 / 20%)",backgroundImage:n!=null&&n.isDarkMode?"linear-gradient(to right, #e654bc, #4b86e7)":"linear-gradient(to right, #fadef2, #cfdcf1)","&:hover":{backgroundImage:n!=null&&n.isDarkMode?"linear-gradient(to right, #de32ac, #2d73e7)":"linear-gradient(to right, #f6c2e7, #b4cbf1)"}},children:"Select Embeddings"}):e.jsx(h,{children:e.jsx(D,{container:!0,spacing:"2",children:e.jsx(D,{item:!0,xs:12,md:12,lg:12,sm:12,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",paddingRight:15},children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"row",p:1},children:[e.jsx("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:"white",display:"flex",boxShadow:"0 2px 14px 0 rgb(32 40 45 / 25%)"},children:o.label?e.jsx("img",{style:{width:"100%",height:"100%",padding:7,borderRadius:"50%",objectFit:"contain"},alt:o.label??"embeddings",src:`${O}/api/v1/node-icon/${o==null?void 0:o.name}`}):e.jsx($,{color:"black"})}),e.jsx(T,{sx:{ml:2},variant:"h3",children:o.label}),e.jsx("div",{style:{flex:1}}),e.jsx("div",{style:{display:"flex",alignContent:"center",flexDirection:"row"},children:Object.keys(o).length>0&&e.jsx(e.Fragment,{children:e.jsx(L,{variant:"outlined",sx:{ml:1},color:"secondary",onClick:je,children:e.jsx(ie,{})})})})]}),o&&Object.keys(o).length>0&&H(o).filter(t=>!t.hidden&&t.display!==!1).map((t,a)=>e.jsx(se,{data:o,inputParam:t,isAdditionalParams:t.additionalParams,onNodeDataChange:Je},a))]})})})})}),e.jsx(D,{item:!0,xs:12,sm:4,md:4,children:Object.keys(l).length===0?e.jsx(C,{onClick:ve,fullWidth:!0,startIcon:e.jsx($e,{style:{background:"transparent",height:32,width:32}}),sx:{color:n!=null&&n.isDarkMode?"white":"inherit",borderRadius:"10px",minHeight:"200px",opacity:ee()?.7:1,boxShadow:ee()?"none":"0 2px 14px 0 rgb(32 40 45 / 20%)",backgroundImage:n!=null&&n.isDarkMode?"linear-gradient(to right, #4d8ef1, #f1de5c)":"linear-gradient(to right, #b9d0f4, #fef9d7)","&:hover":{backgroundImage:n!=null&&n.isDarkMode?"linear-gradient(to right, #2576f2, #f0d72e)":"linear-gradient(to right, #9cbdf2, #fcf3b6)"}},disabled:ee(),children:"Select Vector Store"}):e.jsx(h,{children:e.jsx(D,{container:!0,spacing:"2",children:e.jsx(D,{item:!0,xs:12,md:12,lg:12,sm:12,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",paddingRight:15},children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"row",p:1},children:[e.jsx("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:"white",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 14px 0 rgb(32 40 45 / 25%)"},children:l.label?e.jsx("img",{style:{width:"100%",height:"100%",padding:7,borderRadius:"50%",objectFit:"contain"},alt:l.label??"embeddings",src:`${O}/api/v1/node-icon/${l==null?void 0:l.name}`}):e.jsx($,{color:"black"})}),e.jsx(T,{sx:{ml:2},variant:"h3",children:l.label}),e.jsx("div",{style:{flex:1}}),e.jsx("div",{style:{display:"flex",alignContent:"center",flexDirection:"row"},children:Object.keys(l).length>0&&e.jsx(e.Fragment,{children:e.jsx(L,{variant:"outlined",sx:{ml:1},color:"secondary",onClick:ve,children:e.jsx(ie,{})})})})]}),l&&Object.keys(l).length>0&&H(l).filter(t=>!t.hidden&&t.display!==!1).map((t,a)=>e.jsx(se,{data:l,inputParam:t,isAdditionalParams:t.additionalParams,onNodeDataChange:Xe},a))]})})})})}),e.jsx(D,{item:!0,xs:12,sm:4,md:4,children:Object.keys(p).length===0?e.jsx(C,{onClick:De,fullWidth:!0,startIcon:K?e.jsx(e.Fragment,{}):e.jsx(_e,{style:{background:"transparent",height:32,width:32}}),sx:{color:n!=null&&n.isDarkMode?"white":"inherit",borderRadius:"10px",minHeight:"200px",opacity:Z()?.7:1,boxShadow:Z()?"none":"0 2px 14px 0 rgb(32 40 45 / 20%)",backgroundImage:n!=null&&n.isDarkMode?"linear-gradient(to right, #f5db3f, #42daa7)":"linear-gradient(to right, #f9f1c0, #c7f1e3)","&:hover":{backgroundImage:n!=null&&n.isDarkMode?"linear-gradient(to right, #d9c238, #3dc295)":"linear-gradient(to right, #f6e99b, #a0f2d7)"}},disabled:Z(),children:K?"Record Manager is not applicable for selected Vector Store":"Select Record Manager"}):e.jsx(h,{children:e.jsx(D,{container:!0,spacing:"2",children:e.jsx(D,{item:!0,xs:12,md:12,lg:12,sm:12,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",paddingRight:15},children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"row",p:1},children:[e.jsx("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:"white",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 14px 0 rgb(32 40 45 / 25%)"},children:p.label?e.jsx("img",{style:{width:"100%",height:"100%",padding:7,borderRadius:"50%",objectFit:"contain"},alt:p.label??"embeddings",src:`${O}/api/v1/node-icon/${p==null?void 0:p.name}`}):e.jsx($,{color:"black"})}),e.jsx(T,{sx:{ml:2},variant:"h3",children:p.label}),e.jsx("div",{style:{flex:1}}),e.jsx("div",{style:{display:"flex",alignContent:"center",flexDirection:"row"},children:Object.keys(p).length>0&&e.jsx(e.Fragment,{children:e.jsx(L,{variant:"outlined",sx:{ml:1},color:"secondary",onClick:De,children:e.jsx(ie,{})})})})]}),p&&Object.keys(p).length>0&&H(p).filter(t=>!t.hidden&&t.display!==!1).map((t,a)=>e.jsx(se,{data:p,inputParam:t,isAdditionalParams:t.additionalParams,onNodeDataChange:Ke},a))]})})})})})]})]})]})}),q&&e.jsx(_,{show:q,dialogProps:F,onCancel:()=>B(!1),apiCall:P.getEmbeddingProviders,onSelected:be}),Y&&e.jsx(_,{show:Y,dialogProps:F,onCancel:()=>G(!1),apiCall:P.getVectorStoreProviders,onSelected:Se}),J&&e.jsx(_,{show:J,dialogProps:F,onCancel:()=>X(!1),apiCall:P.getRecordManagerProviders,onSelected:ye}),ge&&e.jsx(Ft,{show:ge,dialogProps:qe,onCancel:()=>{ue(!1)},onGoToRetrievalQuery:()=>f("/document-stores/query/"+x)}),he&&e.jsx(Le,{show:he,dialogProps:ze,onClickFunction:()=>fe(!1),onSelectHistoryDetails:et}),xe&&e.jsx(Ue,{show:xe,dialogProps:Ge,onCancel:()=>me(!1)}),e.jsx(Ot,{}),V&&e.jsx(Tt,{open:V})]})};export{Ia as default};
