import { defineAsyncComponent, markRaw } from 'vue';

import AddButtonEdge from '../editor/edges/AddButtonEdge.vue';

const ChoiceNode = defineAsyncComponent(() => import('../editor/nodes/ChoiceNode.vue'));
const CodeNode = defineAsyncComponent(() => import('../editor/nodes/CodeNode.vue'));
const ConditionNode = defineAsyncComponent(() => import('../editor/nodes/ConditionNode.vue'));
const ConfirmNode = defineAsyncComponent(() => import('../editor/nodes/ConfirmNode.vue'));
const EndNode = defineAsyncComponent(() => import('../editor/nodes/EndNode.vue'));
const HttpNode = defineAsyncComponent(() => import('../editor/nodes/HttpNode.vue'));
const IntentNode = defineAsyncComponent(() => import('../editor/nodes/IntentNode.vue'));
const KnowledgeRetrievalNode = defineAsyncComponent(() => import('../editor/nodes/KnowledgeRetrievalNode.vue'));
const LLMNode = defineAsyncComponent(() => import('../editor/nodes/LLMNode.vue'));
const LoopNode = defineAsyncComponent(() => import('../editor/nodes/LoopNode.vue'));
const MergeNode = defineAsyncComponent(() => import('../editor/nodes/MergeNode.vue'));
const MessageNode = defineAsyncComponent(() => import('../editor/nodes/MessageNode.vue'));
const ParallelNode = defineAsyncComponent(() => import('../editor/nodes/ParallelNode.vue'));
const QuestionNode = defineAsyncComponent(() => import('../editor/nodes/QuestionNode.vue'));
const StartNode = defineAsyncComponent(() => import('../editor/nodes/StartNode.vue'));
const SubflowNode = defineAsyncComponent(() => import('../editor/nodes/SubflowNode.vue'));
const TemplateNode = defineAsyncComponent(() => import('../editor/nodes/TemplateNode.vue'));

export const workflowNodeTypes = {
  start: markRaw(StartNode),
  llm: markRaw(LLMNode),
  end: markRaw(EndNode),
  http: markRaw(HttpNode),
  code: markRaw(CodeNode),
  condition: markRaw(ConditionNode),
  template: markRaw(TemplateNode),
  parallel: markRaw(ParallelNode),
  merge: markRaw(MergeNode),
  question: markRaw(QuestionNode),
  choice: markRaw(ChoiceNode),
  message: markRaw(MessageNode),
  confirm: markRaw(ConfirmNode),
  intent: markRaw(IntentNode),
  loop: markRaw(LoopNode),
  subflow: markRaw(SubflowNode),
  knowledge_retrieval: markRaw(KnowledgeRetrievalNode),
};

export const workflowEdgeTypes = {
  addButton: markRaw(AddButtonEdge),
};
