'use strict';
'use client';
import { propertyTypes } from '../../../fd-toolbox/enums/enums.js';
import { propertyTypeFormats } from '../constants/property-type-formats.js';

var __defProp=Object['defineProperty'],__name=(_0x29821d,_0x3511c6)=>__defProp(_0x29821d,'name',{'value':_0x3511c6,'configurable':!![]});function getRequiredFields(_0x447938,_0x1158ab){const _0x2038a7=_0x1158ab['properties'],_0x82a4c7=_0x2038a7[_0x447938['name']];return _0x82a4c7['type']!==propertyTypes['boolean']&&_0x82a4c7['required'];}__name(getRequiredFields,'getRequiredFields');function onValidation(_0x4000fd,_0x271d66,_0x28c346,_0x2e6438,_0x3fc260,_0x131d0c){const _0x59f691=_0x4000fd['properties'],_0xe7ba82=_0x131d0c??getFormValues(_0x271d66);return checkValidation(_0x271d66,_0xe7ba82,_0x28c346,_0x2e6438,_0x3fc260,_0x4000fd,_0x59f691);}__name(onValidation,'onValidation');function getFormValues(_0x3bce1f){return _0x3bce1f['getValues']();}__name(getFormValues,'getFormValues');function getFormField(_0xdfde2b,_0x223042){return _0xdfde2b['getValues'](_0x223042);}__name(getFormField,'getFormField');function checkValidation(_0x4fcdd7,_0x5cb925,_0x292df2,_0x4775e4,_0x2dc54c,_0x1f3a03,_0x32700a){const _0x36ffd9=_0x292df2(_0x4775e4,_0x1f3a03),_0x175311=_0x292df2(_0x2dc54c,_0x1f3a03),_0x45d212=_0x36ffd9['concat'](_0x175311),_0x2a1e39=_0x45d212['filter'](_0x354103=>isUnsetField(_0x354103,_0x5cb925,_0x32700a));return _0x2a1e39['forEach'](_0x28c1f8=>{_0x4fcdd7['setError'](_0x28c1f8['name'],{'type':'required'});}),!_0x2a1e39['length'];}__name(checkValidation,'checkValidation');function isUnsetField(_0xb3c1df,_0x51eb26,_0x4bbad2){const _0x1b8f7f=_0x4bbad2[_0xb3c1df['name']];if(_0x1b8f7f['typeFormat']===propertyTypeFormats['enum'])return !_0x51eb26[_0xb3c1df['name']]&&_0x51eb26[_0xb3c1df['name']]!==0x6bb+0x31*-0xc9+0x1*0x1fbe;return !_0x51eb26[_0xb3c1df['name']];}__name(isUnsetField,'isUnsetField');

export { getFormField, getFormValues, getRequiredFields, onValidation };
