import{A as J}from"./index-08e160a7.js";import{c as u,g as X}from"./_commonjsHelpers-725317a4.js";var q={visa:{niceType:"Visa",type:"visa",patterns:[4],gaps:[4,8,12],lengths:[16,18,19],code:{name:"CVV",size:3}},mastercard:{niceType:"Mastercard",type:"mastercard",patterns:[[51,55],[2221,2229],[223,229],[23,26],[270,271],2720],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},"american-express":{niceType:"American Express",type:"american-express",patterns:[34,37],gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},"diners-club":{niceType:"Diners Club",type:"diners-club",patterns:[[300,305],36,38,39],gaps:[4,10],lengths:[14,16,19],code:{name:"CVV",size:3}},discover:{niceType:"Discover",type:"discover",patterns:[6011,[644,649],65],gaps:[4,8,12],lengths:[16,19],code:{name:"CID",size:3}},jcb:{niceType:"JCB",type:"jcb",patterns:[2131,1800,[3528,3589]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVV",size:3}},unionpay:{niceType:"UnionPay",type:"unionpay",patterns:[620,[624,626],[62100,62182],[62184,62187],[62185,62197],[62200,62205],[622010,622999],622018,[622019,622999],[62207,62209],[622126,622925],[623,626],6270,6272,6276,[627700,627779],[627781,627799],[6282,6289],6291,6292,810,[8110,8131],[8132,8151],[8152,8163],[8164,8171]],gaps:[4,8,12],lengths:[14,15,16,17,18,19],code:{name:"CVN",size:3}},maestro:{niceType:"Maestro",type:"maestro",patterns:[493698,[5e5,504174],[504176,506698],[506779,508999],[56,59],63,67,6],gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}},elo:{niceType:"Elo",type:"elo",patterns:[401178,401179,438935,457631,457632,431274,451416,457393,504175,[506699,506778],[509e3,509999],627780,636297,636368,[650031,650033],[650035,650051],[650405,650439],[650485,650538],[650541,650598],[650700,650718],[650720,650727],[650901,650978],[651652,651679],[655e3,655019],[655021,655058]],gaps:[4,8,12],lengths:[16],code:{name:"CVE",size:3}},mir:{niceType:"Mir",type:"mir",patterns:[[2200,2204]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVP2",size:3}},hiper:{niceType:"Hiper",type:"hiper",patterns:[637095,63737423,63743358,637568,637599,637609,637612],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},hipercard:{niceType:"Hipercard",type:"hipercard",patterns:[606282],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}}},W=q,P={},b={};Object.defineProperty(b,"__esModule",{value:!0});b.clone=void 0;function K(e){return e?JSON.parse(JSON.stringify(e)):null}b.clone=K;var A={};Object.defineProperty(A,"__esModule",{value:!0});A.matches=void 0;function Q(e,r,t){var n=String(r).length,a=e.substr(0,n),i=parseInt(a,10);return r=parseInt(String(r).substr(0,a.length),10),t=parseInt(String(t).substr(0,a.length),10),i>=r&&i<=t}function Z(e,r){return r=String(r),r.substring(0,e.length)===e.substring(0,r.length)}function k(e,r){return Array.isArray(r)?Q(e,r[0],r[1]):Z(e,r)}A.matches=k;Object.defineProperty(P,"__esModule",{value:!0});P.addMatchingCardsToResults=void 0;var ee=b,re=A;function te(e,r,t){var n,a;for(n=0;n=a&&(l.matchStrength=a),t.push(l);break}}}P.addMatchingCardsToResults=te;var R={};Object.defineProperty(R,"__esModule",{value:!0});R.isValidInputType=void 0;function ne(e){return typeof e=="string"||e instanceof String}R.isValidInputType=ne;var D={};Object.defineProperty(D,"__esModule",{value:!0});D.findBestMatch=void 0;function ae(e){var r=e.filter(function(t){return t.matchStrength}).length;return r>0&&r===e.length}function ie(e){return ae(e)?e.reduce(function(r,t){return!r||Number(r.matchStrength)ce?g(!1,!1):fe.test(e)?g(!1,!0):g(!0,!0)}E.cardholderName=de;var S={};function pe(e){for(var r=0,t=!1,n=e.length-1,a;n>=0;)a=parseInt(e.charAt(n),10),t&&(a*=2,a>9&&(a=a%10+1)),t=!t,r+=a,n--;return r%10===0}var ve=pe;Object.defineProperty(S,"__esModule",{value:!0});S.cardNumber=void 0;var he=ve,L=F;function v(e,r,t){return{card:e,isPotentiallyValid:r,isValid:t}}function ye(e,r){r===void 0&&(r={});var t,n,a;if(typeof e!="string"&&typeof e!="number")return v(null,!1,!1);var i=String(e).replace(/-|\s/g,"");if(!/^\d*$/.test(i))return v(null,!1,!1);var l=L(i);if(l.length===0)return v(null,!1,!1);if(l.length!==1)return v(null,!0,!1);var s=l[0];if(r.maxLength&&i.length>r.maxLength)return v(s,!1,!1);s.type===L.types.UNIONPAY&&r.luhnValidateUnionPay!==!0?n=!0:n=he(i),a=Math.max.apply(null,s.lengths),r.maxLength&&(a=Math.min(r.maxLength,a));for(var p=0;p4)return f(!1,!1);var s=parseInt(e,10),p=Number(String(a).substr(2,2)),O=!1;if(n===2){if(String(a).substr(0,2)===e)return f(!1,!0);t=p===s,O=s>=p&&s<=p+r}else n===4&&(t=a===s,O=s>=a&&s<=a+r);return f(O,O,t)}y.expirationYear=_e;var N={};Object.defineProperty(N,"__esModule",{value:!0});N.isArray=void 0;N.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};Object.defineProperty($,"__esModule",{value:!0});$.parseDate=void 0;var me=y,Ce=N;function be(e){var r=Number(e[0]),t;return r===0?2:r>1||r===1&&Number(e[1])>2?1:r===1?(t=e.substr(1),me.expirationYear(t).isPotentiallyValid?1:2):e.length===5?1:e.length>5?2:1}function Me(e){var r;if(/^\d{4}-\d{1,2}$/.test(e)?r=e.split("-").reverse():/\//.test(e)?r=e.split(/\s*\/\s*/g):/\s/.test(e)&&(r=e.split(/ +/g)),Ce.isArray(r))return{month:r[0]||"",year:r.slice(1).join()};var t=be(e),n=e.substr(0,t);return{month:n,year:e.substr(n.length)}}$.parseDate=Me;var V={};Object.defineProperty(V,"__esModule",{value:!0});V.expirationMonth=void 0;function _(e,r,t){return{isValid:e,isPotentiallyValid:r,isValidForThisYear:t||!1}}function Ve(e){var r=new Date().getMonth()+1;if(typeof e!="string")return _(!1,!1);if(e.replace(/\s/g,"")===""||e==="0")return _(!1,!0);if(!/^\d*$/.test(e))return _(!1,!1);var t=parseInt(e,10);if(isNaN(Number(e)))return _(!1,!1);var n=t>0&&t<13;return _(n,n,n&&t>=r)}V.expirationMonth=Ve;var Y=u&&u.__assign||function(){return Y=Object.assign||function(e){for(var r,t=1,n=arguments.length;tr?e[t]:r;return r}function h(e,r){return{isValid:e,isPotentiallyValid:r}}function Ee(e,r){return r===void 0&&(r=G),r=r instanceof Array?r:[r],typeof e!="string"||!/^\d*$/.test(e)?h(!1,!1):Re(r,e.length)?h(!0,!0):e.lengthDe(r)?h(!1,!1):h(!0,!0)}j.cvv=Ee;var x={};Object.defineProperty(x,"__esModule",{value:!0});x.postalCode=void 0;var Se=3;function w(e,r){return{isValid:e,isPotentiallyValid:r}}function Ie(e,r){r===void 0&&(r={});var t=r.minLength||Se;return typeof e!="string"?w(!1,!1):e.length{setTimeout(()=>{e.remove()},5e3)});