import"./api-DyiqpKJK.js";import{u as S,W as x}from"./WorkflowStudio-FCyhGD4y.js";/* empty css                  *//* empty css               */import{u as B}from"./vue-flow-Dn7R8GPr.js";import{u as O}from"./WorkflowEditor-CcaGGbko.js";import{e as T,C as D,D as F,F as j,G as U,t as W}from"./element-ui-D3x2y3TA.js";import{v as h,i as G,c as f,r as K,w as M,J as v,y as r,K as s,U as a,a2 as _,B as p,x as R,H as A,a9 as H,k as I,u as J}from"./vue-core-DL-LgTX0.js";import{_ as L}from"./index-BMvodlwc.js";import"./ui-components-DQ7-U3pr.js";import"./js-yaml-yTPt38rv.js";import"./elkjs-Dm5QV7uy.js";import"./code-editor-DBSql_sc.js";const P={class:"type-info"},q=h({__name:"CreateNewNodeDialog",props:{pos:{}},setup(b){const y=b,l=G(x.CREATE_NEW_NODE_OPEN),d=S().nodeSchemaMap,N=B(),{addNewNode:E}=O(N),n=f(()=>[...d.values()]),t=K(n.value[0]?.name??"");M(n,()=>{n.value[0]&&(t.value=t.value||n.value[0]?.name)});const i=f(()=>d.get(t.value)),w=()=>{l&&(l.value=!1)},V=()=>{t.value&&(E(t.value,y.pos),l&&(l.value=!1))};return(z,e)=>{const C=F,g=D,u=U,m=j,c=T,k=W;return r(),v(k,{modelValue:J(l),"onUpdate:modelValue":e[1]||(e[1]=o=>I(l)?l.value=o:null),title:"新建节点 · 选择节点类型","align-center":""},{default:s(()=>[a(g,{modelValue:t.value,"onUpdate:modelValue":e[0]||(e[0]=o=>t.value=o),placeholder:n.value[0]?.name},{default:s(()=>[(r(!0),R(A,null,H(n.value,o=>(r(),v(C,{key:o.name,label:o.name,value:o.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"]),p("div",P,[p("div",null,[e[2]||(e[2]=p("p",{class:"type-info-entry-title"},"输入",-1)),a(m,{data:Object.values(i.value?.inputs||{})},{default:s(()=>[a(u,{prop:"name",label:"端口名",width:"140"}),a(u,{prop:"type",label:"数据类型"}),a(u,{prop:"default_value",label:"默认值"})]),_:1},8,["data"])]),p("div",null,[e[3]||(e[3]=p("p",{class:"type-info-entry-title"},"输出",-1)),a(m,{data:Object.values(i.value?.outputs||{})},{default:s(()=>[a(u,{prop:"name",label:"端口名",width:"140"}),a(u,{prop:"type",label:"数据类型"})]),_:1},8,["data"])])])]),footer:s(()=>[a(c,{onClick:w},{default:s(()=>[...e[4]||(e[4]=[_("取消",-1)])]),_:1}),a(c,{type:"primary",onClick:V,disabled:!t.value},{default:s(()=>[...e[5]||(e[5]=[_(" 新建 ",-1)])]),_:1},8,["disabled"])]),_:1},8,["modelValue"])}}}),pe=L(q,[["__scopeId","data-v-ce5c662a"]]);export{pe as default};
