{"version":3,"file":"PromoCardV2ValidationProps.552ee1e3.es5.js","mappings":"sKAAO,ICYDA,EACF,SAACC,GAAD,OACA,kBDd6BC,ECcvBC,EAAN,EAAMA,SAAUC,EAAhB,EAAgBA,KAAhB,sBAEQH,OAAAA,EACAI,IAAG,MAAED,GAAF,SAAEA,EAAME,YAAR,EAAE,EAAaD,KACdF,GAAY,CAAEA,UDlBGD,ECkBwBC,EDjB9B,iBAAZD,EAA6B,CAACA,GAElCA,OCkBEK,EAAkBP,EAAiB,SCbnCQ,GDeiBR,EAAiB,QAEdA,EAAiB,WAEnBA,EAAiB,SCnBtB,SAAC,GAE6C,QADpES,EACoE,EADpEA,MAEQC,EAAuBD,EAAvBC,WAAYC,EAAWF,EAAXE,OAEpB,GAAc,MAAVD,GAAA,SAAAA,EAAYJ,QAAZ,EAAmBM,MAAnB,MAA2BD,GAA3B,SAA2BA,EAAQL,QAAR,EAAeM,KAC1C,MAAO,CACHD,OAAQJ,EAAgB,CACpBJ,SAAU,CAAC,4DACXC,KAAMO","sources":["webpack://assr-alfaleasing/./node_modules/@alfa-bank/site-helpers-validation-props/src/helpers.ts","webpack://assr-alfaleasing/./node_modules/@alfa-bank/site-helpers-validation-props/src/index.ts","webpack://assr-alfaleasing/./node_modules/@alfa-bank/site-promo-card-v2/src/validation/index.ts"],"sourcesContent":["export const getArrayMessages = (message: string | string[]) => {\n if (typeof message === 'string') return [message];\n\n return message;\n};\n","import type {\n TWidgetPropForValidation,\n TValidationResultPopertyValue,\n} from '@alfa-bank/site-platform-types/types/validation';\n\nimport { getArrayMessages } from './helpers';\n\ninterface IParams {\n messages?: string[] | string;\n prop: TWidgetPropForValidation;\n}\n\nconst createValidation =\n (status: TValidationResultPopertyValue['status']) =>\n ({ messages, prop }: IParams) =>\n ({\n status,\n uid: prop?.value?.uid,\n ...(messages && { messages: getArrayMessages(messages) }),\n } as TValidationResultPopertyValue);\n\nexport const validationError = createValidation('error');\n\nexport const validationInfo = createValidation('info');\n\nexport const validationWarning = createValidation('warning');\n\nexport const validationValid = createValidation('valid');\n","import type {\n IValidationParams,\n TValidationResult,\n} from '@alfa-bank/site-platform-types/types/validation';\nimport { validationError } from '@alfa-bank/site-helpers-validation-props';\n\nimport type { IPublicProps } from '../models';\n\nexport const validation = ({\n props,\n}: IValidationParams): TValidationResult => {\n const { autoHeight, height } = props;\n\n if (autoHeight?.value?.data && height?.value?.data)\n return {\n height: validationError({\n messages: ['При включенном autoHeight, заполнение height - избыточно'],\n prop: height,\n }),\n };\n};\n"],"names":["createValidation","status","message","messages","prop","uid","value","validationError","validation","props","autoHeight","height","data"],"sourceRoot":""}