import{b as m,i}from"./useflows-BpG3C9m1.js";import{e}from"./main-few-lands-burn.js";import{s as p}from"./machine.-BRuqPpdF.js";import{h as r,a as o,c as u}from"./openaico-BZSnTkIZ.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const s=m(({helpers:n})=>({states:{components:[u(n),{componentName:n.componentName.select,id:"model-id",label:e("Select Model"),onChange:"SET_MODEL",options:[{label:e("omni-moderation-latest"),value:"omni-moderation-latest"},{label:e("text-moderation-latest"),value:"text-moderation-latest"}],path:"model",placeholder:e("Select a Model"),render:"IF_CONNECTION_SELECTED",required:!0,value:"omni-moderation-latest"},{componentName:n.componentName.select,fieldType:"config",id:"input-format",label:e("Select Input Format"),onChange:"SET_INPUT_FORMAT",options:[{label:e("Text"),value:"text"},{label:e("Array of Text"),value:"array_of_text"},{label:e("Image"),value:"image"}],placeholder:e("Select a Input Format"),render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:n.componentName.mixInput,id:"input",label:e("Input"),onChange:"SET_INPUT",path:"input",render:"IF_NOT_ARRAY_SELECTED",value:[]},{addItemButtonLabel:e("Add Input Fields"),componentName:n.componentName.repeaterField,fieldsMetaData:[{componentName:n.componentName.select,id:"input-entry",label:e("Type"),name:"type",options:[{label:e("Text"),value:"text"}],required:!0,style:{width:150},value:"text"},{componentName:n.componentName.mixInput,label:e("Value"),name:"text",required:!0,value:[],wrapperClassName:"w-100"}],id:"input-list",inputGroupProps:{label:e("Text #{COUNT}")},label:e("Field Mapping"),onChange:"ON_FIELD_MAP_CHANGE",render:"IF_ARRAY_SELECTED",value:[]}]},actions:{SET_CONNECTION:async({$:t,e:l})=>{t.setThisComponent(a=>{a.value=l}),t.setDb(a=>{a.connectionId=l})},IF_CONNECTION_SELECTED:({$:t})=>i(t.getComponent("connection-id")?.value),IF_ARRAY_SELECTED:({$:t})=>{if(i(t.getComponent("connection-id")?.value)&&t.getComponent("input-format")?.value==="array_of_text")return!0},IF_NOT_ARRAY_SELECTED:({$:t})=>{if(i(t.getComponent("connection-id")?.value)&&t.getComponent("input-format")?.value==="text"||t.getComponent("input-format")?.value==="image")return!0},SET_MODEL:o("model"),SET_INPUT_FORMAT:o("inputFormat"),SET_INPUT:o("input"),ON_FIELD_MAP_CHANGE:o("inputList"),CONNECTION_ADD_CHANGE:r,ON_MACHINE_LOAD:async({$:t})=>{p(t,[{db:"connectionId",id:"connection-id"},{db:"model",id:"model-id"},{db:"inputList",id:"input-list"},{db:"input",id:"input"},{db:"inputFormat",id:"input-format"}])}}}));export{s as default};
