/*!
 * Built by ShiftSoftware
 * Copyright (c)
 */
import{c as e,a as i,b as l}from"./p-YQJevg3-.js";import{v as n}from"./p-CUREVASG.js";import{g as o}from"./p-D0IHkGuC.js";const a=e=>`${e}-label`,d=e=>`${e}-format`,t=e=>`${e}-require`,r=e=>`${e}-size`,s=e=>`${e}-max`,h=e=>`${e}-placeholder`,v=e=>({label:a(e),placeholder:h(e)}),c=e=>`$${e}Required`,u={label:a,format:d,require:t,condition:c,placeholder:h,meta:v,size:r,max:s},m=(o={})=>e(Object.assign({name:l().meta(v("name")).when(c("name"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(t("name")).min(3,d("name"))}),lastName:l().meta(v("lastName")).when(c("lastName"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(t("lastName")).min(3,d("lastName"))}),message:l().meta(v("message")).when(c("message"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(t("message")).min(10,d("message"))}),email:l().meta(v("email")).when(c("email"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(t("email"))}).email(d("email")),vin:l().meta(v("vin")).when(c("vin"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(t("vin")).test(d("vin"),d("vin"),(e=>n(null==e?void 0:e.toUpperCase())))}),vehicle:l().meta(v("vehicle")).when(u.condition("vehicle"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(u.require("vehicle"))}),vacancyId:l().meta(v("vacancyId")).when(u.condition("vacancyId"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(u.require("vacancyId"))}),companyBranchId:l().meta(v("companyBranchId")).when(u.condition("companyBranchId"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(u.require("companyBranchId"))}),cityId:l().meta(v("cityId")).when(u.condition("cityId"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(u.require("cityId"))}),date:l().meta(v("date")).when(c("date"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(t("date"))}),year:l().meta(v("year")).when(c("year"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(t("year"))}),time:l().meta(v("time")).when(c("time"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(t("time"))}),currentVehicleBrand:l().meta(v("currentVehicleBrand")).when("ownVehicle",{is:e=>"yes"===e,then:e=>e.required(t("currentVehicleBrand")),otherwise:e=>e.optional()}),currentVehicleModel:l().meta(v("currentVehicleModel")).when(["ownVehicle","currentVehicleBrand"],{is:(e,i)=>"yes"===e&&"Other"!==i,then:e=>e.required(t("currentVehicleModel")),otherwise:e=>e.optional()}),ownVehicle:l().meta(v("ownVehicle")).when(c("ownVehicle"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(t("ownVehicle"))}),conditionalCurrentVehicleBrand:l().meta(v("currentVehicleBrand")).when("ownVehicle",{is:e=>"yes"===e,then:e=>e.required(t("currentVehicleBrand")),otherwise:e=>e.optional()}),conditionalCurrentVehicleModel:l().meta(v("currentVehicleModel")).when(["ownVehicle","conditionalCurrentVehicleBrand"],{is:(e,i)=>"yes"===e&&"Other"!==i,then:e=>e.required(t("currentVehicleModel")),otherwise:e=>e.optional()}),gender:i().meta(v("gender")).when(c("gender"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(t("gender"))})},o)),w=(e,i,l)=>{var n,a,d,t,r,s,h,v,c,m,w,V,y,g,$,p,I;const[M,B]=null===(n=null==e?void 0:e.form)||void 0===n?void 0:n.getFormLocale(),b=(null===(d=null===(a=null==e?void 0:e.localization)||void 0===a?void 0:a[B])||void 0===d?void 0:d.label)||o(M,null==i?void 0:i.label)||(null==i?void 0:i.label),x=(null===(r=null===(t=null==e?void 0:e.localization)||void 0===t?void 0:t[B])||void 0===r?void 0:r.placeholder)||o(M,null==i?void 0:i.placeholder)||(null==i?void 0:i.placeholder);let f="";return(null==l?void 0:l.endsWith(u.format("")))&&(f=null===(h=null===(s=null==e?void 0:e.localization)||void 0===s?void 0:s[B])||void 0===h?void 0:h.format),(null==l?void 0:l.endsWith(u.size("")))?f=null===(c=null===(v=null==e?void 0:e.localization)||void 0===v?void 0:v[B])||void 0===c?void 0:c.size:(null==l?void 0:l.endsWith(u.require("")))?f=null===(w=null===(m=null==e?void 0:e.localization)||void 0===m?void 0:m[B])||void 0===w?void 0:w.require:"minMessage"===l?f=null==e?void 0:e.withSlots((null===(y=null===(V=null==e?void 0:e.localization)||void 0===V?void 0:V[B])||void 0===y?void 0:y.minMessage)||"Min date is $minDate$"):"maxMessage"===l?f=null==e?void 0:e.withSlots((null===($=null===(g=null==e?void 0:e.localization)||void 0===g?void 0:g[B])||void 0===$?void 0:$.maxMessage)||"Max date is $maxDate$"):"betweenMessage"===l&&(f=null==e?void 0:e.withSlots((null===(I=null===(p=null==e?void 0:e.localization)||void 0===p?void 0:p[B])||void 0===I?void 0:I.betweenMessage)||"Must be between $minDate$ and $maxDate$")),{label:b,placeholder:x,errorTextMessage:f||M[l]||l}};export{s as a,m as b,d as f,w as g,v as m,t as r,r as s,u as y}