import{ENCRYPTED_EXPIRY_DATE as e,ENCRYPTED_EXPIRY_MONTH as r,ENCRYPTED_EXPIRY_YEAR as l,ENCRYPTED_SECURITY_CODE as i,CVC_POLICY_OPTIONAL as t,DATE_POLICY_OPTIONAL as c,CVC_POLICY_HIDDEN as o,DATE_POLICY_HIDDEN as s}from"../lib/constants.js";import{EMPTY_FIELD_ERROR_MESSAGES as d}from"../../../../core/Errors/constants.js";const a=e=>e?Array.prototype.slice.call(e.querySelectorAll('[data-cse*="encrypted"]')).map(e=>e.getAttribute("data-cse")):[],p=(i,t)=>(t===e?(i[r]=!1,i[l]=!1):i[t]=!1,i),y=(d,a)=>(p,y)=>{let n=!0!==a.valid[y]?((i,t)=>1!==t||i!==r&&i!==l?i:e)(y,d):null;return n=((e,r,l)=>{const{isFieldOfType:d,fieldIsValid:a}=l.reduce((l,i)=>(l.isFieldOfType||(l.isFieldOfType=e===i,l.fieldIsValid=!r.errors[i]),l),{isFieldOfType:!1,fieldIsValid:!1}),p=e===i?"cvcPolicy":"expiryDatePolicy",y="cvcPolicy"===p?t:c,n="cvcPolicy"===p?o:s;return(r[p]===y||r[p]===n)&&a&&d?null:e})(n,a,[i,e,r,l]),n&&!p.includes(n)&&p.push(n),p},n=(e,r,l)=>({rootNode:r,fieldType:e,error:l.errors?.[e]||d[e],type:"card"});export{n as getErrorObject,y as getErrorReducer,a as getFields,p as validFieldsReducer};
//# sourceMappingURL=SFPUtils.js.map
