import{b as m}from"./useflows-BpG3C9m1.js";import{e as s}from"./main-few-lands-burn.js";import{s as r}from"./machine.-BRuqPpdF.js";import{h as o}from"./commonut-D3rqJBtm.js";import{f as a}from"./machineh-D8WlVdMZ.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const p=m(({helpers:t})=>({states:{components:[{componentName:t.componentName.select,id:"user-role",label:s("Select User Role"),onChange:"SELECT_USER_ROLE",onRefetch:"REFETCH_USER_ROLE",options:[],path:"userRole",render:"SHOULD_SHOW_USER_ROLE_SELECT",required:!0,value:void 0},{componentName:t.componentName.mixInput,id:"custom-user-role",label:s("Custom User Role"),onChange:"HANDLE_CUSTOM_ROLES",path:"customUserRoles",render:"SHOULD_SHOW_CUSTOM_USER_ROLE",required:!0,value:void 0},{componentName:t.componentName.switch,fieldType:"config",id:"map-custom-role",label:s("Map Custom User Role"),onChange:"HANDLE_CUSTOM_ROLE_ENABLE",path:"mapCustomRole",render:!0,value:!1,wrapperClassName:"my-1"}]},actions:{SHOULD_SHOW_USER_ROLE_SELECT:({$:e})=>e.getComponent("map-custom-role")?.value===!1,SHOULD_SHOW_CUSTOM_USER_ROLE:({$:e})=>e.getComponent("map-custom-role")?.value===!0,HANDLE_CUSTOM_ROLE_ENABLE:o("mapCustomRole"),HANDLE_CUSTOM_ROLES:o("customUserRoles"),HANDLE_ROLE_CAPABILITIES:o("roleCapabilities"),SELECT_USER_ROLE:o("userRole"),ON_MACHINE_LOAD:async({$:e})=>{r(e,[{db:"userRole",id:"user-role"},{db:"customUserRoles",id:"custom-user-role"},{db:"mapCustomRole",id:"map-custom-role"}]),await a(e)},REFETCH_USER_ROLES:async({$:e})=>{await a(e)}}}));export{p as default};
