import{b as r}from"./useflows-BpG3C9m1.js";import{e}from"./main-few-lands-burn.js";import{s as l,a as s}from"./machine.-BRuqPpdF.js";import{h as t}from"./commonut-D3rqJBtm.js";import{h as d,f as n}from"./machineh-D8WlVdMZ.js";import{w as i}from"./wpuserfi-Ud3BKkbF.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const w=r(({helpers:a})=>({states:{components:[{componentName:a.componentName.select,id:"user-role",label:e("Select User Role"),onChange:"SELECT_USER_ROLE",onRefetch:"REFETCH_USER_ROLES",options:[],path:"userRole",render:!0,required:!0,value:void 0},{componentName:a.componentName.select,helperText:e("Selecting this option will trigger a welcome email from WordPress upon user registration."),id:"email-notification",label:e("Select Email Notification"),onChange:"SELECT_EMAIL_NOTIFICATION",options:[{label:e("Admin"),value:"admin"},{label:e("User"),required:!0,value:"user"},{label:e("Both (Admin & User)"),required:!1,value:"both"}],path:"emailNotification",render:!0,value:void 0},{addItemButtonLabel:e("Add Field"),componentName:a.componentName.repeaterField,fieldsMetaData:[{componentName:a.componentName.select,label:e("Field"),name:"wordPressField",options:i,required:!0,style:{width:150},value:""},{componentName:a.componentName.mixInput,label:e("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"field-map",label:e("Field Map"),nonRemovableRows:[],onChange:"HANDLE_FIELD_MAPPING",path:"fieldMap",render:!0,value:[]},{componentName:a.componentName.switch,fieldType:"config",id:"is-auto-password-enabled",label:e("Generate Password Automatically"),onChange:"HANDLE_AUTO_PASSWORD_ENABLE",path:"isAutoPasswordEnabled",render:!0,value:!0,wrapperClassName:"my-1"},{componentName:a.componentName.mixInput,id:"password",label:e("Custom User Password"),onChange:"HANDLE_CUSTOM_PASSWORD",path:"password",render:"SHOULD_SHOW_MANUAL_PASSWORD_FIELD",required:!0,value:void 0},{componentName:a.componentName.button,fieldType:"config",id:"generate-password",onClick:"GENERATE_PASSWORD",render:"SHOULD_SHOW_MANUAL_PASSWORD_FIELD",text:e("Generate Password")},{addItemButtonLabel:e("Add Field"),componentName:a.componentName.repeaterField,fieldsMetaData:[{componentName:a.componentName.mixInput,label:e("Meta Key"),name:"meta_key",required:!0,value:[],wrapperClassName:"w-100"},{componentName:a.componentName.mixInput,label:e("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"user-meta-field-map",label:e("User Meta Field Map"),nonRemovableRows:[],onChange:"HANDLE_META_FIELD_MAPPING",path:"userMetaFieldMap",render:"SHOULD_SHOW_USER_META_FIELD_MAPPING",value:[]},{componentName:a.componentName.switch,fieldType:"config",id:"show-user-meta-field",label:e("Show User Meta Field Mapping"),onChange:"SHOW_META_FIELD_ENABLE",path:"showUserMetaField",render:!0,value:!1,wrapperClassName:"my-1"}]},actions:{SHOULD_SHOW_MANUAL_PASSWORD_FIELD:({$:o})=>o.getComponent("is-auto-password-enabled")?.value===!1,SHOULD_SHOW_USER_META_FIELD_MAPPING:({$:o})=>o.getComponent("show-user-meta-field")?.value===!0,ON_MACHINE_LOAD:async({$:o})=>{l(o,[{db:"userRole",id:"user-role"},{db:"emailNotification",id:"email-notification"},{db:"isAutoPasswordEnabled",id:"is-auto-password-enabled"},{db:"password",id:"password"},{db:"showUserMetaField",id:"show-user-meta-field"},{db:"userMetaFieldMap",id:"user-meta-field-map"}]),s({$:o,componentId:"field-map",dbKey:"fieldMap",fields:i,mapFieldKey:"wordPressField",mapFieldValue:"value"}),await n(o)},REFETCH_USER_ROLES:async({$:o})=>{await n(o)},GENERATE_PASSWORD:async({$:o})=>{await d(o)},HANDLE_AUTO_PASSWORD_ENABLE:t("isAutoPasswordEnabled"),HANDLE_CUSTOM_PASSWORD:t("password"),HANDLE_FIELD_MAPPING:t("fieldMap"),HANDLE_META_FIELD_MAPPING:t("userMetaFieldMap"),SELECT_EMAIL_NOTIFICATION:t("emailNotification"),SELECT_USER_ROLE:t("userRole"),SHOW_META_FIELD_ENABLE:t("showUserMetaField")}}));export{w as default};
