import{aa as m}from"./_applist-tangy-colts-beg-36.js";import{_ as e}from"./main-tangy-colts-beg.js";import{h as n,s as l}from"./machine.-tangy-colts-beg-869.js";import{b as o}from"./commonut-tangy-colts-beg-367.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(a,i){return this.cache.has(a)?this.cache.get(a):(this.cache.set(a,i),i)}};const _=m(({helpers:a})=>({states:{components:[{componentName:a.componentName.mixInput,helperText:e("Provide first name to create the customer."),id:"first-name",label:e("First Name"),onChange:"HANDLE_FIRST_NAME",path:"first_name",render:!0,value:void 0},{componentName:a.componentName.mixInput,helperText:e("Provide last name to create the customer."),id:"last-name",label:e("Last Name"),onChange:"HANDLE_LAST_NAME",path:"last_name",render:!0,value:void 0},{componentName:a.componentName.mixInput,helperText:e("Provide display name to create the customer."),id:"display-name",label:e("Display Name"),onChange:"HANDLE_DISPLAY_NAME",path:"display_name",render:!0,required:!0,value:void 0},{componentName:a.componentName.mixInput,helperText:e("Provide email to create the customer."),id:"email",label:e("Email Address"),onChange:"HANDLE_EMAIL",path:"email",render:!0,required:!0,value:void 0},{componentName:a.componentName.mixInput,helperText:e("Provide username to create the customer."),id:"username",label:e("Username"),onChange:"HANDLE_USERNAME",path:"username",render:!0,value:void 0},{componentName:a.componentName.mixInput,helperText:e("Provide password to create the customer."),id:"password",label:e("Password"),onChange:"HANDLE_PASSWORD",path:"password",render:"SHOULD_SHOW_PASSWORD_FIELD",value:void 0},{componentName:a.componentName.switch,fieldType:"config",helperText:e("If enabled, a password will be automatically generated."),id:"generate-password",label:e("Generate Password"),onChange:"HANDLE_GENERATE_PASSWORD",path:"generate_password",render:!0,value:void 0},{addItemButtonLabel:e("Add Field"),componentName:a.componentName.repeaterField,fieldsMetaData:[{componentName:a.componentName.select,label:e("Billing Field"),name:"billing_field",options:o,required:!0,style:{width:150},value:""},{componentName:a.componentName.mixInput,label:e("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"billing-field-map",label:e("Map Billing Address"),nonRemovableRows:[],onChange:"HANDLE_BILLING_FIELD_MAPPING",path:"billing_field_map",render:!0,value:[]},{componentName:a.componentName.switch,fieldType:"config",helperText:e("Enable this option to set shipping address same as billing address."),id:"shipping-same-as-billing",label:e("Set Shipping Address same as Billing Address"),onChange:"HANDLE_SHIPPING_SAME_AS_BILLING",path:"shipping_same_as_billing",render:!0,value:void 0,wrapperClassName:"mt-3"},{addItemButtonLabel:e("Add Field"),componentName:a.componentName.repeaterField,fieldsMetaData:[{componentName:a.componentName.select,label:e("Shipping Field"),name:"shipping_field",options:o,required:!0,style:{width:150},value:""},{componentName:a.componentName.mixInput,label:e("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"shipping-field-map",label:e("Map Shipping Address"),nonRemovableRows:[],onChange:"HANDLE_SHIPPING_FIELD_MAPPING",path:"shipping_field_map",render:"SHOULD_SHOW_SHIPPING_FIELD_MAP",value:[]}]},actions:{SHOULD_SHOW_PASSWORD_FIELD:({$:i})=>{var t;return!((t=i.getComponent("generate-password"))!=null&&t.value)},SHOULD_SHOW_SHIPPING_FIELD_MAP:({$:i})=>{var t;return!((t=i.getComponent("shipping-same-as-billing"))!=null&&t.value)},HANDLE_BILLING_FIELD_MAPPING:n("billingFieldMap"),HANDLE_DISPLAY_NAME:n("displayName"),HANDLE_EMAIL:n("email"),HANDLE_FIRST_NAME:n("firstName"),HANDLE_GENERATE_PASSWORD:n("generatePassword"),HANDLE_LAST_NAME:n("lastName"),HANDLE_PASSWORD:n("password"),HANDLE_SHIPPING_FIELD_MAPPING:n("shippingFieldMap"),HANDLE_SHIPPING_SAME_AS_BILLING:n("shippingSameAsBilling"),HANDLE_USERNAME:n("username"),ON_MACHINE_LOAD:({$:i})=>{l(i,[{db:"email",id:"email"},{db:"username",id:"username"},{db:"generatePassword",id:"generate-password"},{db:"billingFieldMap",id:"billing-field-map"},{db:"shippingSameAsBilling",id:"shipping-same-as-billing"},{db:"shippingFieldMap",id:"shipping-field-map"},{db:"firstName",id:"first-name"},{db:"lastName",id:"last-name"},{db:"displayName",id:"display-name"}])}}}));export{_ as default};
