Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-international-phone

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-international-phone - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

5

build/components/PhoneInput/PhoneInput.d.ts
import './PhoneInput.style.scss';
import React from 'react';
import { UsePhoneInputConfig } from '../../hooks/usePhoneInput';
import { CountryIso2 } from '../../types';
import { CountrySelectorProps, CountrySelectorStyleProps } from '../CountrySelector/CountrySelector';

@@ -44,7 +45,7 @@ import { DialCodePreviewStyleProps } from '../DialCodePreview/DialCodePreview';

* @description Callback that calls on phone change
* @params *phone* - new phone value
* @params `phone` - new phone value, `country` - country iso2 value
* @default undefined
*/
onChange?: (phone: string) => void;
onChange?: (phone: string, country: CountryIso2) => void;
}
export declare const PhoneInput: React.FC<PhoneInputProps>;

2

build/index.js

@@ -1,1 +0,1 @@

!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a(require("react")):"function"==typeof define&&define.amd?define(["react"],a):"object"==typeof exports?exports["react-international-phone"]=a(require("react")):e["react-international-phone"]=a(e.react)}(this,(e=>(()=>{"use strict";var a={0:(e,a,r)=>{r.r(a)},374:(e,a,r)=>{r.r(a)},840:(e,a,r)=>{r.r(a)},481:(e,a,r)=>{r.r(a)},549:(e,a,r)=>{r.r(a)},153:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(a,e,r);return o(a,e),a},u=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.CountrySelector=void 0,r(0);var l=i(r(156)),c=r(946),s=r(515),d=r(332),f=r(425),p=r(60);a.CountrySelector=function(e){var a,r,n=e.selectedCountry,o=e.onSelect,i=e.disabled,v=e.hideDropdown,y=e.countries,h=void 0===y?c.defaultCountries:y,m=e.renderButtonWrapper,b=u(e,["selectedCountry","onSelect","disabled","hideDropdown","countries","renderButtonWrapper"]),C=(0,l.useState)(!1),g=C[0],P=C[1],_=(0,l.useMemo)((function(){if(n)return(0,d.getCountry)({value:n,field:"iso2",countries:h})}),[h,n]),O=(0,l.useRef)(null);return l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector"],rawClassNames:[b.className]}),style:b.style,ref:O},(a={title:null==_?void 0:_.name,onClick:function(){return P((function(e){return!e}))},onMouseDown:function(e){return e.preventDefault()},onKeyDown:function(e){e.key&&["ArrowUp","ArrowDown"].includes(e.key)&&(e.preventDefault(),P(!0))},disabled:v||i,role:"combobox","aria-label":"Country selector","aria-haspopup":"listbox","aria-expanded":g},r=l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector-button__button-content"],rawClassNames:[b.buttonContentWrapperClassName]}),style:b.buttonContentWrapperStyle},l.default.createElement(f.FlagEmoji,{iso2:n,className:(0,s.buildClassNames)({addPrefix:["country-selector-button__flag-emoji",i&&"country-selector-button__flag-emoji--disabled"],rawClassNames:[b.flagClassName]}),style:t({visibility:n?"visible":"hidden"},b.flagStyle)}),!v&&l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector-button__dropdown-arrow",i&&"country-selector-button__dropdown-arrow--disabled",g&&"country-selector-button__dropdown-arrow--active"],rawClassNames:[b.dropdownArrowClassName]}),style:b.dropdownArrowStyle})),m?m({children:r,rootProps:a}):l.default.createElement("button",t({},a,{type:"button",className:(0,s.buildClassNames)({addPrefix:["country-selector-button",g&&"country-selector-button--active",i&&"country-selector-button--disabled",v&&"country-selector-button--hide-dropdown"],rawClassNames:[b.buttonClassName]}),"data-country":n,style:b.buttonStyle}),r)),l.default.createElement(p.CountrySelectorDropdown,t({show:g,countries:h,onSelect:function(e){P(!1),null==o||o(e)},selectedCountry:n,onClose:function(){P(!1)}},b.dropdownStyleProps)))}},60:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(a,e,r);return o(a,e),a},u=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.CountrySelectorDropdown=void 0,r(374);var l=i(r(156)),c=r(946),s=r(515),d=r(332),f=r(425);a.CountrySelectorDropdown=function(e){var a=e.show,r=e.dialCodePrefix,n=void 0===r?"+":r,o=e.selectedCountry,i=e.countries,p=void 0===i?c.defaultCountries:i,v=e.onSelect,y=e.onClose,h=u(e,["show","dialCodePrefix","selectedCountry","countries","onSelect","onClose"]),m=(0,l.useRef)(null),b=(0,l.useRef)(),C=(0,l.useCallback)((function(e){return p.findIndex((function(a){return(0,d.parseCountry)(a).iso2===e}))}),[p]),g=(0,l.useState)(C(o)),P=g[0],_=g[1],O=function(){b.current!==o&&_(C(o))},w=(0,l.useCallback)((function(e){_(C(e.iso2)),null==v||v(e)}),[v,C]),j=function(e){var a=p.length-1;_((function(r){var t,n=(t=r,"prev"===e?t-1:"next"===e?t+1:"last"===e?a:0);return n<0?0:n>a?a:n}))},D=(0,l.useCallback)((function(){if(m.current&&void 0!==P){var e=(0,d.parseCountry)(p[P]).iso2;if(e!==b.current){var a=m.current.querySelector('[data-country="'.concat(e,'"]'));a&&((0,d.scrollToChild)(m.current,a),b.current=e)}}}),[P,p]);return(0,l.useEffect)((function(){D()}),[P,D]),(0,l.useEffect)((function(){m.current&&(a?m.current.focus():O())}),[a]),(0,l.useEffect)((function(){O()}),[o]),l.default.createElement("ul",{ref:m,role:"listbox",className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown"],rawClassNames:[h.className]}),style:t({display:a?"block":"none"},h.style),onKeyDown:function(e){if("Enter"!==e.key){if("Escape"!==e.key)return"ArrowUp"===e.key?(e.preventDefault(),void j("prev")):"ArrowDown"===e.key?(e.preventDefault(),void j("next")):"PageUp"===e.key?(e.preventDefault(),void j("first")):"PageDown"===e.key?(e.preventDefault(),void j("last")):void 0;null==y||y()}else{var a=(0,d.parseCountry)(p[P]);w(a)}},onBlur:y,tabIndex:-1,"aria-activedescendant":"".concat((0,d.parseCountry)(p[P]).iso2,"-option")},p.map((function(e,a){var r=(0,d.parseCountry)(e),t=r.iso2===o,i=a===P;return l.default.createElement("li",{key:r.iso2,"data-country":r.iso2,role:"option","aria-selected":t,"aria-label":"".concat(r.name," ").concat(n).concat(r.dialCode),id:"".concat(r.iso2,"-option"),className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item",t&&"country-selector-dropdown__list-item--selected",i&&"country-selector-dropdown__list-item--focused"],rawClassNames:[h.listItemClassName]}),onClick:function(){return w(r)},style:h.listItemStyle},l.default.createElement(f.FlagEmoji,{iso2:r.iso2,className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-flag-emoji"],rawClassNames:[h.listItemFlagClassName]}),style:h.listItemFlagStyle}),l.default.createElement("span",{className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-country-name"],rawClassNames:[h.listItemCountryNameClassName]}),style:h.listItemCountryNameStyle},r.name),l.default.createElement("span",{className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-dial-code"],rawClassNames:[h.listItemDialCodeClassName]}),style:h.listItemDialCodeStyle},n,r.dialCode))})))}},7:function(e,a,r){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.DialCodePreview=void 0,r(840);var n=t(r(156)),o=r(515);a.DialCodePreview=function(e){var a=e.dialCode,r=e.prefix,t=e.disabled,i=e.style,u=e.className;return n.default.createElement("div",{className:(0,o.buildClassNames)({addPrefix:["dial-code-preview",t&&"dial-code-preview--disabled"],rawClassNames:[u]}),style:i},"".concat(r).concat(a))}},425:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.FlagEmoji=void 0,r(481);var i=o(r(156)),u=r(515),l="abcdefghijklmnopqrstuvwxyz".split("").reduce((function(e,a,r){var n,o,i;return t(t({},e),((n={})[a]=(o=r,i=parseInt("1f1e6",16),Number(i+o).toString(16)),n))}),{});a.FlagEmoji=function(e){var a=e.iso2,r=e.size,o=void 0===r?"24px":r,c=e.protocol,s=void 0===c?"https":c,d=e.disableLazyLoading,f=e.className,p=n(e,["iso2","size","protocol","disableLazyLoading","className"]);if(!a)return i.default.createElement("img",t({width:o,height:o},p));var v=function(e){return[l[e[0]],l[e[1]]].join("-")}(a),y="".concat(s,"://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/").concat(v,".svg");return i.default.createElement("img",t({className:(0,u.buildClassNames)({addPrefix:["flag-emoji"],rawClassNames:[f]}),src:y,width:o,height:o,draggable:!1,"data-country":a,loading:d?void 0:"lazy"},p))}},28:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(a,e,r);return o(a,e),a},u=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.PhoneInput=void 0,r(549);var l=i(r(156)),c=r(946),s=r(882),d=r(515),f=r(332),p=r(153),v=r(7);a.PhoneInput=function(e){var a,r=e.hideDropdown,n=e.placeholder,o=e.disabled,i=e.showDisabledDialCodeAndPrefix,y=e.inputProps,h=e.onChange,m=e.style,b=e.className,C=e.inputStyle,g=e.inputClassName,P=e.countrySelectorStyleProps,_=e.dialCodePreviewStyleProps,O=e.value,w=e.countries,j=void 0===w?c.defaultCountries:w,D=u(e,["hideDropdown","placeholder","disabled","showDisabledDialCodeAndPrefix","inputProps","onChange","style","className","inputStyle","inputClassName","countrySelectorStyleProps","dialCodePreviewStyleProps","value","countries"]),M=(0,s.usePhoneInput)(t(t({value:O,countries:j},D),{onChange:function(e){null==h||h(e.phone)}})),S=M.phone,x=M.inputRef,N=M.country,k=M.setCountry,A=M.handlePhoneValueChange,E=(0,l.useMemo)((function(){if(N)return(0,f.getCountry)({value:N,field:"iso2",countries:j})}),[j,N]),I=D.disableDialCodeAndPrefix&&i&&(null==E?void 0:E.dialCode);return l.default.createElement("div",{className:(0,d.buildClassNames)({addPrefix:["input-container"],rawClassNames:[b]}),style:m},l.default.createElement(p.CountrySelector,t({onSelect:function(e){return k(e.iso2)},selectedCountry:N,countries:j,disabled:o,hideDropdown:r},P)),I&&l.default.createElement(v.DialCodePreview,t({dialCode:E.dialCode,prefix:null!==(a=D.prefix)&&void 0!==a?a:"+",disabled:o},_)),l.default.createElement("input",t({onChange:A,value:S,type:"tel",ref:x,className:(0,d.buildClassNames)({addPrefix:["input",o&&"input--disabled"],rawClassNames:[g]}),placeholder:n,disabled:o,style:C},y)))}},946:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.defaultCountries=void 0,a.defaultCountries=[["Afghanistan",["asia"],"af","93"],["Albania",["europe"],"al","355"],["Algeria",["africa","north-africa"],"dz","213"],["Andorra",["europe"],"ad","376"],["Angola",["africa"],"ao","244"],["Antigua and Barbuda",["america","carribean"],"ag","1268"],["Argentina",["america","south-america"],"ar","54","(..) ........",0,["11","221","223","261","264","2652","280","2905","291","2920","2966","299","341","342","343","351","376","379","381","3833","385","387","388"]],["Armenia",["asia","ex-ussr"],"am","374",".. ......"],["Aruba",["america","carribean"],"aw","297"],["Australia",["oceania"],"au","61","(..) .... ....",0,["2","3","4","7","8","02","03","04","07","08"]],["Austria",["europe","eu-union"],"at","43"],["Azerbaijan",["asia","ex-ussr"],"az","994","(..) ... .. .."],["Bahamas",["america","carribean"],"bs","1242"],["Bahrain",["middle-east"],"bh","973"],["Bangladesh",["asia"],"bd","880"],["Barbados",["america","carribean"],"bb","1246"],["Belarus",["europe","ex-ussr"],"by","375","(..) ... .. .."],["Belgium",["europe","eu-union"],"be","32","... .. .. .."],["Belize",["america","central-america"],"bz","501"],["Benin",["africa"],"bj","229"],["Bhutan",["asia"],"bt","975"],["Bolivia",["america","south-america"],"bo","591"],["Bosnia and Herzegovina",["europe","ex-yugos"],"ba","387"],["Botswana",["africa"],"bw","267"],["Brazil",["america","south-america"],"br","55","(..) ........."],["British Indian Ocean Territory",["asia"],"io","246"],["Brunei",["asia"],"bn","673"],["Bulgaria",["europe","eu-union"],"bg","359"],["Burkina Faso",["africa"],"bf","226"],["Burundi",["africa"],"bi","257"],["Cambodia",["asia"],"kh","855"],["Cameroon",["africa"],"cm","237"],["Canada",["america","north-america"],"ca","1","(...) ...-....",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde",["africa"],"cv","238"],["Caribbean Netherlands",["america","carribean"],"bq","599","",1],["Central African Republic",["africa"],"cf","236"],["Chad",["africa"],"td","235"],["Chile",["america","south-america"],"cl","56"],["China",["asia"],"cn","86","... .... ...."],["Colombia",["america","south-america"],"co","57","... ... ...."],["Comoros",["africa"],"km","269"],["Congo",["africa"],"cd","243"],["Congo",["africa"],"cg","242"],["Costa Rica",["america","central-america"],"cr","506","....-...."],["Côte d'Ivoire",["africa"],"ci","225",".. .. .. .."],["Croatia",["europe","eu-union","ex-yugos"],"hr","385"],["Cuba",["america","carribean"],"cu","53"],["Curaçao",["america","carribean"],"cw","599","",0],["Cyprus",["europe","eu-union"],"cy","357",".. ......"],["Czech Republic",["europe","eu-union"],"cz","420","... ... ..."],["Denmark",["europe","eu-union","baltic"],"dk","45",".. .. .. .."],["Djibouti",["africa"],"dj","253"],["Dominica",["america","carribean"],"dm","1767"],["Dominican Republic",["america","carribean"],"do","1","",2],["Ecuador",["america","south-america"],"ec","593"],["Egypt",["africa","north-africa"],"eg","20"],["El Salvador",["america","central-america"],"sv","503","....-...."],["Equatorial Guinea",["africa"],"gq","240"],["Eritrea",["africa"],"er","291"],["Estonia",["europe","eu-union","ex-ussr","baltic"],"ee","372",".... ......"],["Ethiopia",["africa"],"et","251"],["Fiji",["oceania"],"fj","679"],["Finland",["europe","eu-union","baltic"],"fi","358",".. ... .. .."],["France",["europe","eu-union"],"fr","33",". .. .. .. .."],["French Guiana",["america","south-america"],"gf","594"],["French Polynesia",["oceania"],"pf","689"],["Gabon",["africa"],"ga","241"],["Gambia",["africa"],"gm","220"],["Georgia",["asia","ex-ussr"],"ge","995"],["Germany",["europe","eu-union","baltic"],"de","49",".... ........"],["Ghana",["africa"],"gh","233"],["Greece",["europe","eu-union"],"gr","30"],["Grenada",["america","carribean"],"gd","1473"],["Guadeloupe",["america","carribean"],"gp","590","",0],["Guam",["oceania"],"gu","1671"],["Guatemala",["america","central-america"],"gt","502","....-...."],["Guinea",["africa"],"gn","224"],["Guinea-Bissau",["africa"],"gw","245"],["Guyana",["america","south-america"],"gy","592"],["Haiti",["america","carribean"],"ht","509","....-...."],["Honduras",["america","central-america"],"hn","504"],["Hong Kong",["asia"],"hk","852",".... ...."],["Hungary",["europe","eu-union"],"hu","36"],["Iceland",["europe"],"is","354","... ...."],["India",["asia"],"in","91",".....-....."],["Indonesia",["asia"],"id","62"],["Iran",["middle-east"],"ir","98","... ... ...."],["Iraq",["middle-east"],"iq","964"],["Ireland",["europe","eu-union"],"ie","353",".. ......."],["Israel",["middle-east"],"il","972","... ... ...."],["Italy",["europe","eu-union"],"it","39","... .......",0],["Jamaica",["america","carribean"],"jm","1876"],["Japan",["asia"],"jp","81",".. .... ...."],["Jordan",["middle-east"],"jo","962"],["Kazakhstan",["asia","ex-ussr"],"kz","7","... ...-..-..",0,["310","311","312","313","315","318","321","324","325","326","327","336","7172","73622"]],["Kenya",["africa"],"ke","254"],["Kiribati",["oceania"],"ki","686"],["Kosovo",["europe","ex-yugos"],"xk","383"],["Kuwait",["middle-east"],"kw","965"],["Kyrgyzstan",["asia","ex-ussr"],"kg","996","... ... ..."],["Laos",["asia"],"la","856"],["Latvia",["europe","eu-union","ex-ussr","baltic"],"lv","371",".. ... ..."],["Lebanon",["middle-east"],"lb","961"],["Lesotho",["africa"],"ls","266"],["Liberia",["africa"],"lr","231"],["Libya",["africa","north-africa"],"ly","218"],["Liechtenstein",["europe"],"li","423"],["Lithuania",["europe","eu-union","ex-ussr","baltic"],"lt","370"],["Luxembourg",["europe","eu-union"],"lu","352"],["Macau",["asia"],"mo","853"],["Macedonia",["europe","ex-yugos"],"mk","389"],["Madagascar",["africa"],"mg","261"],["Malawi",["africa"],"mw","265"],["Malaysia",["asia"],"my","60","..-....-...."],["Maldives",["asia"],"mv","960"],["Mali",["africa"],"ml","223"],["Malta",["europe","eu-union"],"mt","356"],["Marshall Islands",["oceania"],"mh","692"],["Martinique",["america","carribean"],"mq","596"],["Mauritania",["africa"],"mr","222"],["Mauritius",["africa"],"mu","230"],["Mexico",["america","central-america"],"mx","52","... ... ....",0,["33","55","81","229","656","664","774","998"]],["Micronesia",["oceania"],"fm","691"],["Moldova",["europe"],"md","373","(..) ..-..-.."],["Monaco",["europe"],"mc","377"],["Mongolia",["asia"],"mn","976"],["Montenegro",["europe","ex-yugos"],"me","382"],["Morocco",["africa","north-africa"],"ma","212"],["Mozambique",["africa"],"mz","258"],["Myanmar",["asia"],"mm","95"],["Namibia",["africa"],"na","264"],["Nauru",["africa"],"nr","674"],["Nepal",["asia"],"np","977"],["Netherlands",["europe","eu-union"],"nl","31",".. ........"],["New Caledonia",["oceania"],"nc","687"],["New Zealand",["oceania"],"nz","64","...-...-...."],["Nicaragua",["america","central-america"],"ni","505"],["Niger",["africa"],"ne","227"],["Nigeria",["africa"],"ng","234"],["North Korea",["asia"],"kp","850"],["Norway",["europe","baltic"],"no","47","... .. ..."],["Oman",["middle-east"],"om","968"],["Pakistan",["asia"],"pk","92","...-......."],["Palau",["oceania"],"pw","680"],["Palestine",["middle-east"],"ps","970"],["Panama",["america","central-america"],"pa","507"],["Papua New Guinea",["oceania"],"pg","675"],["Paraguay",["america","south-america"],"py","595"],["Peru",["america","south-america"],"pe","51"],["Philippines",["asia"],"ph","63",".... ......."],["Poland",["europe","eu-union","baltic"],"pl","48","...-...-..."],["Portugal",["europe","eu-union"],"pt","351"],["Puerto Rico",["america","carribean"],"pr","1","",3],["Qatar",["middle-east"],"qa","974"],["Réunion",["africa"],"re","262"],["Romania",["europe","eu-union"],"ro","40"],["Russia",["europe","asia","ex-ussr","baltic"],"ru","7","(...) ...-..-..",1],["Rwanda",["africa"],"rw","250"],["Saint Kitts and Nevis",["america","carribean"],"kn","1869"],["Saint Lucia",["america","carribean"],"lc","1758"],["Saint Vincent and the Grenadines",["america","carribean"],"vc","1784"],["Samoa",["oceania"],"ws","685"],["San Marino",["europe"],"sm","378"],["São Tomé and Príncipe",["africa"],"st","239"],["Saudi Arabia",["middle-east"],"sa","966"],["Senegal",["africa"],"sn","221"],["Serbia",["europe","ex-yugos"],"rs","381"],["Seychelles",["africa"],"sc","248"],["Sierra Leone",["africa"],"sl","232"],["Singapore",["asia"],"sg","65","....-...."],["Slovakia",["europe","eu-union"],"sk","421"],["Slovenia",["europe","eu-union","ex-yugos"],"si","386"],["Solomon Islands",["oceania"],"sb","677"],["Somalia",["africa"],"so","252"],["South Africa",["africa"],"za","27"],["South Korea",["asia"],"kr","82","... .... ...."],["South Sudan",["africa","north-africa"],"ss","211"],["Spain",["europe","eu-union"],"es","34","... ... ..."],["Sri Lanka",["asia"],"lk","94"],["Sudan",["africa"],"sd","249"],["Suriname",["america","south-america"],"sr","597"],["Swaziland",["africa"],"sz","268"],["Sweden",["europe","eu-union","baltic"],"se","46","(...) ...-..."],["Switzerland",["europe"],"ch","41",".. ... .. .."],["Syria",["middle-east"],"sy","963"],["Taiwan",["asia"],"tw","886"],["Tajikistan",["asia","ex-ussr"],"tj","992"],["Tanzania",["africa"],"tz","255"],["Thailand",["asia"],"th","66"],["Timor-Leste",["asia"],"tl","670"],["Togo",["africa"],"tg","228"],["Tonga",["oceania"],"to","676"],["Trinidad and Tobago",["america","carribean"],"tt","1868"],["Tunisia",["africa","north-africa"],"tn","216"],["Turkey",["europe"],"tr","90","... ... .. .."],["Turkmenistan",["asia","ex-ussr"],"tm","993"],["Tuvalu",["asia"],"tv","688"],["Uganda",["africa"],"ug","256"],["Ukraine",["europe","ex-ussr"],"ua","380","(..) ... .. .."],["United Arab Emirates",["middle-east"],"ae","971"],["United Kingdom",["europe","eu-union"],"gb","44",".... ......"],["United States",["america","north-america"],"us","1","(...) ...-....",0,["201","202","203","205","206","207","208","209","210","212","213","214","215","216","217","218","219","225","228","229","231","239","248","251","252","253","254","256","260","262","269","270","276","281","301","302","303","304","305","307","308","309","310","312","313","314","315","316","317","318","319","320","321","323","325","330","334","336","337","352","360","361","386","401","402","404","405","406","407","408","409","410","412","413","414","415","417","419","423","425","432","434","435","440","478","479","480","501","502","503","504","505","507","508","509","510","512","513","515","516","517","518","520","530","540","541","559","561","562","563","570","573","574","575","580","585","586","601","602","603","605","606","607","608","609","610","612","614","615","616","617","618","619","620","623","626","630","631","636","641","650","651","660","661","662","701","702","703","704","706","707","708","712","713","714","715","716","717","718","719","724","727","731","732","734","740","757","760","763","765","770","772","773","775","781","785","801","802","803","804","805","806","808","810","812","813","814","815","816","817","818","828","830","831","843","845","847","850","856","858","859","860","863","864","865","870","901","903","904","906","907","908","909","910","912","913","914","915","916","918","919","920","925","928","931","936","937","940","941","949","951","952","954","956","970","972","973","978","979","985","989"]],["Uruguay",["america","south-america"],"uy","598"],["Uzbekistan",["asia","ex-ussr"],"uz","998",".. ... .. .."],["Vanuatu",["oceania"],"vu","678"],["Vatican City",["europe"],"va","39",".. .... ....",1],["Venezuela",["america","south-america"],"ve","58"],["Vietnam",["asia"],"vn","84"],["Yemen",["middle-east"],"ye","967"],["Zambia",["africa"],"zm","260"],["Zimbabwe",["africa"],"zw","263"]]},11:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__spreadArray||function(e,a,r){if(r||2===arguments.length)for(var t,n=0,o=a.length;n<o;n++)!t&&n in a||(t||(t=Array.prototype.slice.call(a,0,n)),t[n]=a[n]);return e.concat(t||Array.prototype.slice.call(a))};Object.defineProperty(a,"__esModule",{value:!0}),a.useHistoryState=void 0;var o=r(156),i=r(795),u={size:20,overrideLastItemDebounceMS:-1};a.useHistoryState=function(e,a){var r=t(t({},u),a),l=r.size,c=r.overrideLastItemDebounceMS,s=r.onChange,d=(0,o.useState)(e),f=d[0],p=d[1],v=(0,o.useState)([f]),y=v[0],h=v[1],m=(0,o.useState)(0),b=m[0],C=m[1],g=(0,i.useTimer)();return[f,function(e,a){if(("object"!=typeof e||Object.entries(e).toString()!==Object.entries(f).toString())&&e!==f){var r=c>0,t=g.check(),o=!r||void 0===t||t>c;if(void 0!==(null==a?void 0:a.overrideLastItem)?a.overrideLastItem:!o)h((function(a){return n(n([],a.slice(0,b),!0),[e],!1)}));else{var i=y.length>=l;h((function(a){return n(n([],a.slice(i?1:0,b+1),!0),[e],!1)})),i||C((function(e){return e+1}))}p(e),null==s||s(e)}},function(){if(b<=0)return{success:!1};var e=y[b-1];return p(e),C((function(e){return e-1})),null==s||s(e),{success:!0,value:e}},function(){if(b+1>=y.length)return{success:!1};var e=y[b+1];return p(e),C((function(e){return e+1})),null==s||s(e),{success:!0,value:e}}]}},882:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.usePhoneInput=a.defaultConfig=a.MASK_CHAR=void 0;var t=r(156),n=r(946),o=r(332),i=r(11);a.MASK_CHAR=".",a.defaultConfig={defaultCountry:"us",value:"",prefix:"+",defaultMask:"............",charAfterDialCode:" ",historySaveDebounceMS:200,disableCountryGuess:!1,disableDialCodePrefill:!1,forceDialCode:!1,disableDialCodeAndPrefix:!1,countries:n.defaultCountries},a.usePhoneInput=function(e){var r=e.defaultCountry,n=void 0===r?a.defaultConfig.defaultCountry:r,u=e.value,l=void 0===u?a.defaultConfig.value:u,c=e.countries,s=void 0===c?a.defaultConfig.countries:c,d=e.prefix,f=void 0===d?a.defaultConfig.prefix:d,p=e.defaultMask,v=void 0===p?a.defaultConfig.defaultMask:p,y=e.charAfterDialCode,h=void 0===y?a.defaultConfig.charAfterDialCode:y,m=e.historySaveDebounceMS,b=void 0===m?a.defaultConfig.historySaveDebounceMS:m,C=e.disableCountryGuess,g=void 0===C?a.defaultConfig.disableCountryGuess:C,P=e.disableDialCodePrefill,_=void 0===P?a.defaultConfig.disableDialCodePrefill:P,O=e.forceDialCode,w=void 0===O?a.defaultConfig.forceDialCode:O,j=e.disableDialCodeAndPrefix,D=void 0===j?a.defaultConfig.disableDialCodeAndPrefix:j,M=e.onChange,S=!D&&!g,x=(0,t.useRef)(null),N=function(e){var r,t=e.value,n=e.country,i=e.trimNonDigitsEnd,u=e.insertDialCodeOnEmpty,l=!e.forceDisableCountryGuess&&S?(0,o.guessCountryByPartialNumber)({phone:t,countries:s,currentCountryIso2:n.iso2}):void 0,c=null!==(r=null==l?void 0:l.country)&&void 0!==r?r:n;return{phone:c?(0,o.formatPhone)(t,{prefix:f,mask:c.format||v,maskChar:a.MASK_CHAR,dialCode:c.dialCode,trimNonDigitsEnd:i,charAfterDialCode:h,forceDialCode:w,insertDialCodeOnEmpty:u,disableDialCodeAndPrefix:D}):t,countryGuessResult:l,formatCountry:c}},k=function(e){Promise.resolve().then((function(){var a;null===(a=x.current)||void 0===a||a.setSelectionRange(e,e)}))},A=(0,i.useHistoryState)((function(){var e=(0,o.guessCountryByPartialNumber)({phone:l,countries:s,currentCountryIso2:n}).country||(0,o.getCountry)({value:n,field:"iso2",countries:s});e||console.error('[react-international-phone]: can not find a country with "'.concat(B,'" iso2 code'));var a=N({value:l,country:e,insertDialCodeOnEmpty:!_}).phone;return k(a.length),l!==a&&(null==M||M({phone:a,country:e.iso2})),{phone:a,country:e.iso2}}),{overrideLastItemDebounceMS:b,onChange:M}),E=A[0],I=E.phone,B=E.country,z=A[1],L=A[2],R=A[3],T=(0,t.useMemo)((function(){return(0,o.getCountry)({value:B,field:"iso2",countries:s})}),[s,B]),G=function(e,a){var r,t,n=void 0===a?{}:a,i=n.deletion,u=n.cursorPosition,l=n.insertDialCodeOnEmpty,c=n.inserted,s=e,d=u;w&&!D&&T&&!(0,o.removeNonDigits)(e).startsWith(T.dialCode)&&e&&(c&&e.startsWith(f)&&e.length-(null!=u?u:0)==0?s=e:(s=I,d=0));var p=N({value:s,country:T,trimNonDigitsEnd:"backward"===i,insertDialCodeOnEmpty:l,forceDisableCountryGuess:w&&!!i&&(0,o.removeNonDigits)(s).length<T.dialCode.length}),v=p.phone,y=p.countryGuessResult,m=T;S&&(null==y?void 0:y.country)&&y.country.name!==B&&y.fullDialCodeMatch&&(m=y.country);var b=(0,o.getCursorPosition)({cursorPositionAfterInput:null!=d?d:0,phoneBeforeInput:I,phoneAfterInput:e,phoneAfterFormatted:v,leftOffset:w?f.length+(null!==(t=null===(r=null==T?void 0:T.dialCode)||void 0===r?void 0:r.length)&&void 0!==t?t:0)+h.length:0,deletion:i});return z({phone:v,country:m.iso2}),k(b),v};(0,t.useEffect)((function(){var e=x.current;if(e){var a=function(e){if(e.key){var a=e.ctrlKey,r=e.shiftKey,t="z"===e.key.toLowerCase();a&&t&&(r?R():L())}};return e.addEventListener("keydown",a),function(){e.removeEventListener("keydown",a)}}}),[x,L,R]);var F=(0,t.useState)(!1),K=F[0],V=F[1];return(0,t.useEffect)((function(){K?l!==I&&G(l):V(!0)}),[l]),{phone:I,country:B,setCountry:function(e){var a=(0,o.getCountry)({value:e,field:"iso2",countries:s});if(a){var r=D?"":"".concat(f).concat(a.dialCode).concat(h);z({phone:r,country:a.iso2}),Promise.resolve().then((function(){var e;null===(e=x.current)||void 0===e||e.focus()}))}},handlePhoneValueChange:function(e){var a;e.preventDefault();var r=e.nativeEvent.inputType,t=null==r?void 0:r.startsWith("insertFrom"),n=G(e.target.value,{deletion:function(){var e;if(null!==(e=null==r?void 0:r.toLocaleLowerCase().includes("delete"))&&void 0!==e&&e)return(null==r?void 0:r.toLocaleLowerCase().includes("forward"))?"forward":"backward"}(),inserted:t,cursorPosition:null!==(a=e.target.selectionStart)&&void 0!==a?a:0});return D&&T?(0,o.addDialCode)({phone:n,dialCode:T.dialCode,charAfterDialCode:h,prefix:f}):n},inputRef:x}}},393:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.usePhoneValidation=void 0;var t=r(332);a.usePhoneValidation=function(e,a){return(0,t.validatePhone)(e,a)}},795:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.useTimer=void 0;var t=r(156);a.useTimer=function(){var e=(0,t.useRef)(),a=(0,t.useRef)(Date.now());return{check:function(){var r=Date.now(),t=e.current?r-a.current:void 0;return e.current=a.current,a.current=r,t}}}},515:function(e,a){var r=this&&this.__spreadArray||function(e,a,r){if(r||2===arguments.length)for(var t,n=0,o=a.length;n<o;n++)!t&&n in a||(t||(t=Array.prototype.slice.call(a,0,n)),t[n]=a[n]);return e.concat(t||Array.prototype.slice.call(a))};Object.defineProperty(a,"__esModule",{value:!0}),a.buildClassNames=a.classNamesWithPrefix=a.joinClasses=a.classPrefix=void 0,a.classPrefix="react-international-phone-",a.joinClasses=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return e.filter((function(e){return!!e})).join(" ").trim()},a.classNamesWithPrefix=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return a.joinClasses.apply(void 0,e).split(" ").map((function(e){return"".concat(a.classPrefix).concat(e)})).join(" ")},a.buildClassNames=function(e){var t=e.addPrefix,n=e.rawClassNames;return a.joinClasses.apply(void 0,r([a.classNamesWithPrefix.apply(void 0,t)],n,!1))}},62:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.applyMask=void 0,a.applyMask=function(e){var a=e.value,r=e.mask,t=e.maskSymbol,n=e.offset,o=void 0===n?0:n,i=e.trimNonMaskCharsLeftover,u=void 0!==i&&i;if(a.length<o)return a;for(var l=a.slice(0,o),c=a.slice(o),s=l,d=0,f=0,p=r.split("");f<p.length;f++){var v=p[f];if(d>=c.length){if(!u&&v!==t){s+=v;continue}break}v===t?(s+=c[d],d+=1):s+=v}return s}},239:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(62),a),n(r(939),a),n(r(222),a)},939:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeNonDigits=void 0,a.removeNonDigits=function(e){return e.replace(/\D/g,"")}},222:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.scrollToChild=void 0,a.scrollToChild=function(e,a){var r=e.style.display;"block"!==r&&(e.style.display="block");var t=e.getBoundingClientRect(),n=a.getBoundingClientRect(),o=n.top-t.top,i=t.bottom-n.bottom;o>=0&&i>=0||(Math.abs(o)<Math.abs(i)?e.scrollTop+=o:e.scrollTop-=i),e.style.display=r}},298:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.buildCountryData=void 0,a.buildCountryData=function(e){for(var a=[e.name,e.regions,e.iso2,e.dialCode,e.format,e.priority,e.areaCodes],r=0;r<a.length;r+=1)if(0!==r){var t=a[r-1],n=a[r];if(void 0===t&&void 0!==n){var o=JSON.stringify(a,(function(e,a){return void 0===a?"__undefined":a})).replace(/"__undefined"/g,"undefined");throw new Error("[react-international-phone] invalid country values passed to buildCountryData. Check ".concat(t," in: ").concat(o))}}return a.filter((function(e){return void 0!==e}))}},891:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getCountry=void 0;var t=r(300);a.getCountry=function(e){var a=e.value,r=e.field,n=e.countries;if(["regions","priority"].includes(r))throw new Error(function(e){return'Field "'.concat(e,'" is not supported')}(r));var o=n.find((function(e){var n=(0,t.parseCountry)(e);return a===n[r]}));if(o)return(0,t.parseCountry)(o)}},4:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.guessCountryByPartialNumber=void 0;var t=r(239),n=r(891),o=r(300);a.guessCountryByPartialNumber=function(e){var a,r=e.phone,i=e.countries,u=e.currentCountryIso2,l={country:void 0,fullDialCodeMatch:!1,areaCodeMatch:void 0};if(!r)return l;var c=(0,t.removeNonDigits)(r);if(!c)return l;for(var s=l,d=function(e){var a,r,t,n,o=e.country,i=e.fullDialCodeMatch,u=e.areaCodeMatch,l=o.dialCode===(null===(a=s.country)||void 0===a?void 0:a.dialCode),c=(null!==(r=o.priority)&&void 0!==r?r:0)<(null!==(n=null===(t=s.country)||void 0===t?void 0:t.priority)&&void 0!==n?n:0);l&&!c||(s={country:o,fullDialCodeMatch:i,areaCodeMatch:u})},f=0,p=i;f<p.length;f++){var v=p[f],y=(0,o.parseCountry)(v),h=y.dialCode,m=y.areaCodes;if(c.startsWith(h)){var b=!s.country||Number(h)>=Number(s.country.dialCode);if(m)for(var C=c.substring(h.length),g=0,P=m;g<P.length;g++){var _=P[g];if(C.startsWith(_))return{country:y,fullDialCodeMatch:!0,areaCodeMatch:!0}}!b&&h!==c&&s.fullDialCodeMatch||d({country:y,fullDialCodeMatch:!0,areaCodeMatch:m?!m:void 0})}s.fullDialCodeMatch||c.length<h.length&&h.startsWith(c)&&(!s.country||Number(h)<=Number(s.country.dialCode))&&d({country:y,fullDialCodeMatch:!1})}if(u){var O=(0,n.getCountry)({value:u,field:"iso2",countries:i});s&&O&&(null===(a=s.country)||void 0===a?void 0:a.dialCode)===O.dialCode&&s.country!==O&&s.fullDialCodeMatch&&!s.areaCodeMatch&&(s.country=O)}return s}},88:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(298),a),n(r(891),a),n(r(4),a),n(r(300),a)},300:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.parseCountry=void 0,a.parseCountry=function(e){return{name:e[0],regions:e[1],iso2:e[2],dialCode:e[3],format:e[4],priority:e[5],areaCodes:e[6]}}},332:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(239),a),n(r(88),a),n(r(165),a)},820:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDialCode=void 0;var t=r(214);a.addDialCode=function(e){var a=e.phone,r=e.dialCode,n=e.prefix,o=void 0===n?"+":n,i=e.charAfterDialCode,u=void 0===i?" ":i;return"".concat(o).concat(r).concat(u).concat((0,t.removeDialCode)({phone:a,dialCode:r,charAfterDialCode:u,prefix:o}))}},380:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.formatPhone=void 0;var t=r(239);a.formatPhone=function(e,a){var r=!a.disableDialCodeAndPrefix&&a.forceDialCode,n=!a.disableDialCodeAndPrefix&&a.insertDialCodeOnEmpty,o=e,i=function(e){return a.trimNonDigitsEnd?e.trim():e};if(!o)return n&&!o.length||r?i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode)):i(o);if((o=(0,t.removeNonDigits)(o))===a.dialCode&&!a.disableDialCodeAndPrefix)return i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode));if(a.dialCode.startsWith(o)&&!a.disableDialCodeAndPrefix)return i(r?"".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode):"".concat(a.prefix).concat(o));if(!o.startsWith(a.dialCode)&&!a.disableDialCodeAndPrefix){if(r)return i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode));if(o.length<a.dialCode.length)return i("".concat(a.prefix).concat(o))}var u,l=(u=a.dialCode.length,a.disableDialCodeAndPrefix&&(u=0),{phoneLeftSide:o.slice(0,u),phoneRightSide:o.slice(u)}),c=l.phoneLeftSide,s=l.phoneRightSide;return c="".concat(a.prefix).concat(c).concat(a.charAfterDialCode),s=(0,t.applyMask)({value:s,mask:a.mask,maskSymbol:a.maskChar,trimNonMaskCharsLeftover:a.trimNonDigitsEnd}),a.disableDialCodeAndPrefix&&(c=""),i("".concat(c).concat(s))}},775:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getCursorPosition=void 0;var r=function(e){return/\d/.test(e)};a.getCursorPosition=function(e){var a=e.phoneBeforeInput,t=e.phoneAfterInput,n=e.phoneAfterFormatted,o=e.cursorPositionAfterInput,i=e.leftOffset,u=void 0===i?0:i,l=e.deletion;if(o<u)return u;if(!a)return n.length;var c="backward"===l;if(0===o&&t.length>0&&n.length>0){if(c)return 0;for(var s=0;s<n.length;s+=1)if(r(n[s]))return s;return n.length}if(t.length<a.length&&1===t.length)return n.length;var d=null;for(s=o-1;s>=0;s-=1)if(r(t[s])){d=s;break}if(null===d)return 0!==o?o:n.length;var f=0;for(s=0;s<d;s+=1)r(t[s])&&(f+=1);c&&(f-=1);var p=0,v=0;for(s=0;s<n.length&&(p+=1,r(n[s])&&(v+=1),v!==f+1);s+=1);for(;!r(n[p])&&p<n.length;)p+=1;return c&&(p+=1),p}},165:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(820),a),n(r(380),a),n(r(775),a),n(r(214),a),n(r(684),a)},214:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeDialCode=void 0,a.removeDialCode=function(e){var a=e.phone,r=e.dialCode,t=e.prefix,n=void 0===t?"+":t,o=e.charAfterDialCode,i=void 0===o?" ":o;if(!a||!r)return a;var u=a;return u.startsWith(n)&&(u=u.replace(n,"")),u.startsWith(r)?((u=u.replace(r,"")).startsWith(i)&&(u=u.replace(i,"")),u):a}},684:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)};Object.defineProperty(a,"__esModule",{value:!0}),a.validatePhone=void 0;var n=r(882),o=r(239),i=r(88);a.validatePhone=function(e,a){var r=t(t({},n.defaultConfig),a),u=r.countries,l=r.defaultMask,c=r.defaultMaskMinPhoneLength,s=void 0===c?10:c,d=r.prefix,f=r.charAfterDialCode,p=(0,i.guessCountryByPartialNumber)({phone:e,countries:u}),v=p.country,y=p.fullDialCodeMatch,h=p.areaCodeMatch;if(!v||!y)return{country:void 0,lengthMatch:!1,areaCodeMatch:h,isValid:!1};var m="".concat(d).concat(v.dialCode).concat(f);if(!e.startsWith(m))return{country:v,lengthMatch:!1,areaCodeMatch:h,isValid:!1};var b=e.substring(m.length),C=!v.format,g=C?l:v.format;if(C&&(0,o.removeNonDigits)(e).length<s)return{country:v,lengthMatch:!1,areaCodeMatch:h,isValid:!1};if(!C&&b.length!==g.length)return{country:v,lengthMatch:!1,areaCodeMatch:h,isValid:!1};for(var P=0;P<b.length;P+=1)if(b[P]!==g[P]&&g[P]!==n.MASK_CHAR)return{country:v,lengthMatch:!1,areaCodeMatch:h,isValid:!1};return{country:v,lengthMatch:!0,areaCodeMatch:h,isValid:null==h||h}}},156:a=>{a.exports=e}},r={};function t(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}};return a[e].call(o.exports,o,o.exports,t),o.exports}t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.validatePhone=e.parseCountry=e.buildCountryData=e.usePhoneValidation=e.usePhoneInput=e.defaultCountries=e.PhoneInput=e.FlagEmoji=e.DialCodePreview=e.CountrySelectorDropdown=e.CountrySelector=void 0;var a=t(153);Object.defineProperty(e,"CountrySelector",{enumerable:!0,get:function(){return a.CountrySelector}});var r=t(60);Object.defineProperty(e,"CountrySelectorDropdown",{enumerable:!0,get:function(){return r.CountrySelectorDropdown}});var o=t(7);Object.defineProperty(e,"DialCodePreview",{enumerable:!0,get:function(){return o.DialCodePreview}});var i=t(425);Object.defineProperty(e,"FlagEmoji",{enumerable:!0,get:function(){return i.FlagEmoji}});var u=t(28);Object.defineProperty(e,"PhoneInput",{enumerable:!0,get:function(){return u.PhoneInput}});var l=t(946);Object.defineProperty(e,"defaultCountries",{enumerable:!0,get:function(){return l.defaultCountries}});var c=t(882);Object.defineProperty(e,"usePhoneInput",{enumerable:!0,get:function(){return c.usePhoneInput}});var s=t(393);Object.defineProperty(e,"usePhoneValidation",{enumerable:!0,get:function(){return s.usePhoneValidation}});var d=t(332);Object.defineProperty(e,"buildCountryData",{enumerable:!0,get:function(){return d.buildCountryData}}),Object.defineProperty(e,"parseCountry",{enumerable:!0,get:function(){return d.parseCountry}}),Object.defineProperty(e,"validatePhone",{enumerable:!0,get:function(){return d.validatePhone}})})(),n})()));
!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a(require("react")):"function"==typeof define&&define.amd?define(["react"],a):"object"==typeof exports?exports["react-international-phone"]=a(require("react")):e["react-international-phone"]=a(e.react)}(this,(e=>(()=>{"use strict";var a={0:(e,a,r)=>{r.r(a)},374:(e,a,r)=>{r.r(a)},840:(e,a,r)=>{r.r(a)},481:(e,a,r)=>{r.r(a)},549:(e,a,r)=>{r.r(a)},153:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(a,e,r);return o(a,e),a},u=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.CountrySelector=void 0,r(0);var l=i(r(156)),c=r(946),s=r(515),d=r(332),f=r(425),p=r(60);a.CountrySelector=function(e){var a,r,n=e.selectedCountry,o=e.onSelect,i=e.disabled,v=e.hideDropdown,y=e.countries,h=void 0===y?c.defaultCountries:y,m=e.renderButtonWrapper,b=u(e,["selectedCountry","onSelect","disabled","hideDropdown","countries","renderButtonWrapper"]),C=(0,l.useState)(!1),g=C[0],P=C[1],_=(0,l.useMemo)((function(){if(n)return(0,d.getCountry)({value:n,field:"iso2",countries:h})}),[h,n]),O=(0,l.useRef)(null);return l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector"],rawClassNames:[b.className]}),style:b.style,ref:O},(a={title:null==_?void 0:_.name,onClick:function(){return P((function(e){return!e}))},onMouseDown:function(e){return e.preventDefault()},onKeyDown:function(e){e.key&&["ArrowUp","ArrowDown"].includes(e.key)&&(e.preventDefault(),P(!0))},disabled:v||i,role:"combobox","aria-label":"Country selector","aria-haspopup":"listbox","aria-expanded":g},r=l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector-button__button-content"],rawClassNames:[b.buttonContentWrapperClassName]}),style:b.buttonContentWrapperStyle},l.default.createElement(f.FlagEmoji,{iso2:n,className:(0,s.buildClassNames)({addPrefix:["country-selector-button__flag-emoji",i&&"country-selector-button__flag-emoji--disabled"],rawClassNames:[b.flagClassName]}),style:t({visibility:n?"visible":"hidden"},b.flagStyle)}),!v&&l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector-button__dropdown-arrow",i&&"country-selector-button__dropdown-arrow--disabled",g&&"country-selector-button__dropdown-arrow--active"],rawClassNames:[b.dropdownArrowClassName]}),style:b.dropdownArrowStyle})),m?m({children:r,rootProps:a}):l.default.createElement("button",t({},a,{type:"button",className:(0,s.buildClassNames)({addPrefix:["country-selector-button",g&&"country-selector-button--active",i&&"country-selector-button--disabled",v&&"country-selector-button--hide-dropdown"],rawClassNames:[b.buttonClassName]}),"data-country":n,style:b.buttonStyle}),r)),l.default.createElement(p.CountrySelectorDropdown,t({show:g,countries:h,onSelect:function(e){P(!1),null==o||o(e)},selectedCountry:n,onClose:function(){P(!1)}},b.dropdownStyleProps)))}},60:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(a,e,r);return o(a,e),a},u=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.CountrySelectorDropdown=void 0,r(374);var l=i(r(156)),c=r(946),s=r(515),d=r(332),f=r(425);a.CountrySelectorDropdown=function(e){var a=e.show,r=e.dialCodePrefix,n=void 0===r?"+":r,o=e.selectedCountry,i=e.countries,p=void 0===i?c.defaultCountries:i,v=e.onSelect,y=e.onClose,h=u(e,["show","dialCodePrefix","selectedCountry","countries","onSelect","onClose"]),m=(0,l.useRef)(null),b=(0,l.useRef)(),C=(0,l.useCallback)((function(e){return p.findIndex((function(a){return(0,d.parseCountry)(a).iso2===e}))}),[p]),g=(0,l.useState)(C(o)),P=g[0],_=g[1],O=function(){b.current!==o&&_(C(o))},w=(0,l.useCallback)((function(e){_(C(e.iso2)),null==v||v(e)}),[v,C]),j=function(e){var a=p.length-1;_((function(r){var t,n=(t=r,"prev"===e?t-1:"next"===e?t+1:"last"===e?a:0);return n<0?0:n>a?a:n}))},D=(0,l.useCallback)((function(){if(m.current&&void 0!==P){var e=(0,d.parseCountry)(p[P]).iso2;if(e!==b.current){var a=m.current.querySelector('[data-country="'.concat(e,'"]'));a&&((0,d.scrollToChild)(m.current,a),b.current=e)}}}),[P,p]);return(0,l.useEffect)((function(){D()}),[P,D]),(0,l.useEffect)((function(){m.current&&(a?m.current.focus():O())}),[a]),(0,l.useEffect)((function(){O()}),[o]),l.default.createElement("ul",{ref:m,role:"listbox",className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown"],rawClassNames:[h.className]}),style:t({display:a?"block":"none"},h.style),onKeyDown:function(e){if("Enter"!==e.key){if("Escape"!==e.key)return"ArrowUp"===e.key?(e.preventDefault(),void j("prev")):"ArrowDown"===e.key?(e.preventDefault(),void j("next")):"PageUp"===e.key?(e.preventDefault(),void j("first")):"PageDown"===e.key?(e.preventDefault(),void j("last")):void 0;null==y||y()}else{var a=(0,d.parseCountry)(p[P]);w(a)}},onBlur:y,tabIndex:-1,"aria-activedescendant":"".concat((0,d.parseCountry)(p[P]).iso2,"-option")},p.map((function(e,a){var r=(0,d.parseCountry)(e),t=r.iso2===o,i=a===P;return l.default.createElement("li",{key:r.iso2,"data-country":r.iso2,role:"option","aria-selected":t,"aria-label":"".concat(r.name," ").concat(n).concat(r.dialCode),id:"".concat(r.iso2,"-option"),className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item",t&&"country-selector-dropdown__list-item--selected",i&&"country-selector-dropdown__list-item--focused"],rawClassNames:[h.listItemClassName]}),onClick:function(){return w(r)},style:h.listItemStyle},l.default.createElement(f.FlagEmoji,{iso2:r.iso2,className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-flag-emoji"],rawClassNames:[h.listItemFlagClassName]}),style:h.listItemFlagStyle}),l.default.createElement("span",{className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-country-name"],rawClassNames:[h.listItemCountryNameClassName]}),style:h.listItemCountryNameStyle},r.name),l.default.createElement("span",{className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-dial-code"],rawClassNames:[h.listItemDialCodeClassName]}),style:h.listItemDialCodeStyle},n,r.dialCode))})))}},7:function(e,a,r){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.DialCodePreview=void 0,r(840);var n=t(r(156)),o=r(515);a.DialCodePreview=function(e){var a=e.dialCode,r=e.prefix,t=e.disabled,i=e.style,u=e.className;return n.default.createElement("div",{className:(0,o.buildClassNames)({addPrefix:["dial-code-preview",t&&"dial-code-preview--disabled"],rawClassNames:[u]}),style:i},"".concat(r).concat(a))}},425:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.FlagEmoji=void 0,r(481);var i=o(r(156)),u=r(515),l="abcdefghijklmnopqrstuvwxyz".split("").reduce((function(e,a,r){var n,o,i;return t(t({},e),((n={})[a]=(o=r,i=parseInt("1f1e6",16),Number(i+o).toString(16)),n))}),{});a.FlagEmoji=function(e){var a=e.iso2,r=e.size,o=void 0===r?"24px":r,c=e.protocol,s=void 0===c?"https":c,d=e.disableLazyLoading,f=e.className,p=n(e,["iso2","size","protocol","disableLazyLoading","className"]);if(!a)return i.default.createElement("img",t({width:o,height:o},p));var v=function(e){return[l[e[0]],l[e[1]]].join("-")}(a),y="".concat(s,"://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/").concat(v,".svg");return i.default.createElement("img",t({className:(0,u.buildClassNames)({addPrefix:["flag-emoji"],rawClassNames:[f]}),src:y,width:o,height:o,draggable:!1,"data-country":a,loading:d?void 0:"lazy"},p))}},28:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(a,e,r);return o(a,e),a},u=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.PhoneInput=void 0,r(549);var l=i(r(156)),c=r(946),s=r(882),d=r(515),f=r(332),p=r(153),v=r(7);a.PhoneInput=function(e){var a,r=e.hideDropdown,n=e.placeholder,o=e.disabled,i=e.showDisabledDialCodeAndPrefix,y=e.inputProps,h=e.onChange,m=e.style,b=e.className,C=e.inputStyle,g=e.inputClassName,P=e.countrySelectorStyleProps,_=e.dialCodePreviewStyleProps,O=e.value,w=e.countries,j=void 0===w?c.defaultCountries:w,D=u(e,["hideDropdown","placeholder","disabled","showDisabledDialCodeAndPrefix","inputProps","onChange","style","className","inputStyle","inputClassName","countrySelectorStyleProps","dialCodePreviewStyleProps","value","countries"]),M=(0,s.usePhoneInput)(t(t({value:O,countries:j},D),{onChange:function(e){null==h||h(e.phone,e.country)}})),S=M.phone,x=M.inputRef,N=M.country,k=M.setCountry,A=M.handlePhoneValueChange,E=(0,l.useMemo)((function(){if(N)return(0,f.getCountry)({value:N,field:"iso2",countries:j})}),[j,N]),I=D.disableDialCodeAndPrefix&&i&&(null==E?void 0:E.dialCode);return l.default.createElement("div",{className:(0,d.buildClassNames)({addPrefix:["input-container"],rawClassNames:[b]}),style:m},l.default.createElement(p.CountrySelector,t({onSelect:function(e){return k(e.iso2)},selectedCountry:N,countries:j,disabled:o,hideDropdown:r},P)),I&&l.default.createElement(v.DialCodePreview,t({dialCode:E.dialCode,prefix:null!==(a=D.prefix)&&void 0!==a?a:"+",disabled:o},_)),l.default.createElement("input",t({onChange:A,value:S,type:"tel",ref:x,className:(0,d.buildClassNames)({addPrefix:["input",o&&"input--disabled"],rawClassNames:[g]}),placeholder:n,disabled:o,style:C},y)))}},946:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.defaultCountries=void 0,a.defaultCountries=[["Afghanistan",["asia"],"af","93"],["Albania",["europe"],"al","355"],["Algeria",["africa","north-africa"],"dz","213"],["Andorra",["europe"],"ad","376"],["Angola",["africa"],"ao","244"],["Antigua and Barbuda",["america","carribean"],"ag","1268"],["Argentina",["america","south-america"],"ar","54","(..) ........",0,["11","221","223","261","264","2652","280","2905","291","2920","2966","299","341","342","343","351","376","379","381","3833","385","387","388"]],["Armenia",["asia","ex-ussr"],"am","374",".. ......"],["Aruba",["america","carribean"],"aw","297"],["Australia",["oceania"],"au","61","(..) .... ....",0,["2","3","4","7","8","02","03","04","07","08"]],["Austria",["europe","eu-union"],"at","43"],["Azerbaijan",["asia","ex-ussr"],"az","994","(..) ... .. .."],["Bahamas",["america","carribean"],"bs","1242"],["Bahrain",["middle-east"],"bh","973"],["Bangladesh",["asia"],"bd","880"],["Barbados",["america","carribean"],"bb","1246"],["Belarus",["europe","ex-ussr"],"by","375","(..) ... .. .."],["Belgium",["europe","eu-union"],"be","32","... .. .. .."],["Belize",["america","central-america"],"bz","501"],["Benin",["africa"],"bj","229"],["Bhutan",["asia"],"bt","975"],["Bolivia",["america","south-america"],"bo","591"],["Bosnia and Herzegovina",["europe","ex-yugos"],"ba","387"],["Botswana",["africa"],"bw","267"],["Brazil",["america","south-america"],"br","55","(..) ........."],["British Indian Ocean Territory",["asia"],"io","246"],["Brunei",["asia"],"bn","673"],["Bulgaria",["europe","eu-union"],"bg","359"],["Burkina Faso",["africa"],"bf","226"],["Burundi",["africa"],"bi","257"],["Cambodia",["asia"],"kh","855"],["Cameroon",["africa"],"cm","237"],["Canada",["america","north-america"],"ca","1","(...) ...-....",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde",["africa"],"cv","238"],["Caribbean Netherlands",["america","carribean"],"bq","599","",1],["Central African Republic",["africa"],"cf","236"],["Chad",["africa"],"td","235"],["Chile",["america","south-america"],"cl","56"],["China",["asia"],"cn","86","... .... ...."],["Colombia",["america","south-america"],"co","57","... ... ...."],["Comoros",["africa"],"km","269"],["Congo",["africa"],"cd","243"],["Congo",["africa"],"cg","242"],["Costa Rica",["america","central-america"],"cr","506","....-...."],["Côte d'Ivoire",["africa"],"ci","225",".. .. .. .."],["Croatia",["europe","eu-union","ex-yugos"],"hr","385"],["Cuba",["america","carribean"],"cu","53"],["Curaçao",["america","carribean"],"cw","599","",0],["Cyprus",["europe","eu-union"],"cy","357",".. ......"],["Czech Republic",["europe","eu-union"],"cz","420","... ... ..."],["Denmark",["europe","eu-union","baltic"],"dk","45",".. .. .. .."],["Djibouti",["africa"],"dj","253"],["Dominica",["america","carribean"],"dm","1767"],["Dominican Republic",["america","carribean"],"do","1","",2],["Ecuador",["america","south-america"],"ec","593"],["Egypt",["africa","north-africa"],"eg","20"],["El Salvador",["america","central-america"],"sv","503","....-...."],["Equatorial Guinea",["africa"],"gq","240"],["Eritrea",["africa"],"er","291"],["Estonia",["europe","eu-union","ex-ussr","baltic"],"ee","372",".... ......"],["Ethiopia",["africa"],"et","251"],["Fiji",["oceania"],"fj","679"],["Finland",["europe","eu-union","baltic"],"fi","358",".. ... .. .."],["France",["europe","eu-union"],"fr","33",". .. .. .. .."],["French Guiana",["america","south-america"],"gf","594"],["French Polynesia",["oceania"],"pf","689"],["Gabon",["africa"],"ga","241"],["Gambia",["africa"],"gm","220"],["Georgia",["asia","ex-ussr"],"ge","995"],["Germany",["europe","eu-union","baltic"],"de","49",".... ........"],["Ghana",["africa"],"gh","233"],["Greece",["europe","eu-union"],"gr","30"],["Grenada",["america","carribean"],"gd","1473"],["Guadeloupe",["america","carribean"],"gp","590","",0],["Guam",["oceania"],"gu","1671"],["Guatemala",["america","central-america"],"gt","502","....-...."],["Guinea",["africa"],"gn","224"],["Guinea-Bissau",["africa"],"gw","245"],["Guyana",["america","south-america"],"gy","592"],["Haiti",["america","carribean"],"ht","509","....-...."],["Honduras",["america","central-america"],"hn","504"],["Hong Kong",["asia"],"hk","852",".... ...."],["Hungary",["europe","eu-union"],"hu","36"],["Iceland",["europe"],"is","354","... ...."],["India",["asia"],"in","91",".....-....."],["Indonesia",["asia"],"id","62"],["Iran",["middle-east"],"ir","98","... ... ...."],["Iraq",["middle-east"],"iq","964"],["Ireland",["europe","eu-union"],"ie","353",".. ......."],["Israel",["middle-east"],"il","972","... ... ...."],["Italy",["europe","eu-union"],"it","39","... .......",0],["Jamaica",["america","carribean"],"jm","1876"],["Japan",["asia"],"jp","81",".. .... ...."],["Jordan",["middle-east"],"jo","962"],["Kazakhstan",["asia","ex-ussr"],"kz","7","... ...-..-..",0,["310","311","312","313","315","318","321","324","325","326","327","336","7172","73622"]],["Kenya",["africa"],"ke","254"],["Kiribati",["oceania"],"ki","686"],["Kosovo",["europe","ex-yugos"],"xk","383"],["Kuwait",["middle-east"],"kw","965"],["Kyrgyzstan",["asia","ex-ussr"],"kg","996","... ... ..."],["Laos",["asia"],"la","856"],["Latvia",["europe","eu-union","ex-ussr","baltic"],"lv","371",".. ... ..."],["Lebanon",["middle-east"],"lb","961"],["Lesotho",["africa"],"ls","266"],["Liberia",["africa"],"lr","231"],["Libya",["africa","north-africa"],"ly","218"],["Liechtenstein",["europe"],"li","423"],["Lithuania",["europe","eu-union","ex-ussr","baltic"],"lt","370"],["Luxembourg",["europe","eu-union"],"lu","352"],["Macau",["asia"],"mo","853"],["Macedonia",["europe","ex-yugos"],"mk","389"],["Madagascar",["africa"],"mg","261"],["Malawi",["africa"],"mw","265"],["Malaysia",["asia"],"my","60","..-....-...."],["Maldives",["asia"],"mv","960"],["Mali",["africa"],"ml","223"],["Malta",["europe","eu-union"],"mt","356"],["Marshall Islands",["oceania"],"mh","692"],["Martinique",["america","carribean"],"mq","596"],["Mauritania",["africa"],"mr","222"],["Mauritius",["africa"],"mu","230"],["Mexico",["america","central-america"],"mx","52","... ... ....",0,["33","55","81","229","656","664","774","998"]],["Micronesia",["oceania"],"fm","691"],["Moldova",["europe"],"md","373","(..) ..-..-.."],["Monaco",["europe"],"mc","377"],["Mongolia",["asia"],"mn","976"],["Montenegro",["europe","ex-yugos"],"me","382"],["Morocco",["africa","north-africa"],"ma","212"],["Mozambique",["africa"],"mz","258"],["Myanmar",["asia"],"mm","95"],["Namibia",["africa"],"na","264"],["Nauru",["africa"],"nr","674"],["Nepal",["asia"],"np","977"],["Netherlands",["europe","eu-union"],"nl","31",".. ........"],["New Caledonia",["oceania"],"nc","687"],["New Zealand",["oceania"],"nz","64","...-...-...."],["Nicaragua",["america","central-america"],"ni","505"],["Niger",["africa"],"ne","227"],["Nigeria",["africa"],"ng","234"],["North Korea",["asia"],"kp","850"],["Norway",["europe","baltic"],"no","47","... .. ..."],["Oman",["middle-east"],"om","968"],["Pakistan",["asia"],"pk","92","...-......."],["Palau",["oceania"],"pw","680"],["Palestine",["middle-east"],"ps","970"],["Panama",["america","central-america"],"pa","507"],["Papua New Guinea",["oceania"],"pg","675"],["Paraguay",["america","south-america"],"py","595"],["Peru",["america","south-america"],"pe","51"],["Philippines",["asia"],"ph","63",".... ......."],["Poland",["europe","eu-union","baltic"],"pl","48","...-...-..."],["Portugal",["europe","eu-union"],"pt","351"],["Puerto Rico",["america","carribean"],"pr","1","",3],["Qatar",["middle-east"],"qa","974"],["Réunion",["africa"],"re","262"],["Romania",["europe","eu-union"],"ro","40"],["Russia",["europe","asia","ex-ussr","baltic"],"ru","7","(...) ...-..-..",1],["Rwanda",["africa"],"rw","250"],["Saint Kitts and Nevis",["america","carribean"],"kn","1869"],["Saint Lucia",["america","carribean"],"lc","1758"],["Saint Vincent and the Grenadines",["america","carribean"],"vc","1784"],["Samoa",["oceania"],"ws","685"],["San Marino",["europe"],"sm","378"],["São Tomé and Príncipe",["africa"],"st","239"],["Saudi Arabia",["middle-east"],"sa","966"],["Senegal",["africa"],"sn","221"],["Serbia",["europe","ex-yugos"],"rs","381"],["Seychelles",["africa"],"sc","248"],["Sierra Leone",["africa"],"sl","232"],["Singapore",["asia"],"sg","65","....-...."],["Slovakia",["europe","eu-union"],"sk","421"],["Slovenia",["europe","eu-union","ex-yugos"],"si","386"],["Solomon Islands",["oceania"],"sb","677"],["Somalia",["africa"],"so","252"],["South Africa",["africa"],"za","27"],["South Korea",["asia"],"kr","82","... .... ...."],["South Sudan",["africa","north-africa"],"ss","211"],["Spain",["europe","eu-union"],"es","34","... ... ..."],["Sri Lanka",["asia"],"lk","94"],["Sudan",["africa"],"sd","249"],["Suriname",["america","south-america"],"sr","597"],["Swaziland",["africa"],"sz","268"],["Sweden",["europe","eu-union","baltic"],"se","46","(...) ...-..."],["Switzerland",["europe"],"ch","41",".. ... .. .."],["Syria",["middle-east"],"sy","963"],["Taiwan",["asia"],"tw","886"],["Tajikistan",["asia","ex-ussr"],"tj","992"],["Tanzania",["africa"],"tz","255"],["Thailand",["asia"],"th","66"],["Timor-Leste",["asia"],"tl","670"],["Togo",["africa"],"tg","228"],["Tonga",["oceania"],"to","676"],["Trinidad and Tobago",["america","carribean"],"tt","1868"],["Tunisia",["africa","north-africa"],"tn","216"],["Turkey",["europe"],"tr","90","... ... .. .."],["Turkmenistan",["asia","ex-ussr"],"tm","993"],["Tuvalu",["asia"],"tv","688"],["Uganda",["africa"],"ug","256"],["Ukraine",["europe","ex-ussr"],"ua","380","(..) ... .. .."],["United Arab Emirates",["middle-east"],"ae","971"],["United Kingdom",["europe","eu-union"],"gb","44",".... ......"],["United States",["america","north-america"],"us","1","(...) ...-....",0,["201","202","203","205","206","207","208","209","210","212","213","214","215","216","217","218","219","225","228","229","231","239","248","251","252","253","254","256","260","262","269","270","276","281","301","302","303","304","305","307","308","309","310","312","313","314","315","316","317","318","319","320","321","323","325","330","334","336","337","352","360","361","386","401","402","404","405","406","407","408","409","410","412","413","414","415","417","419","423","425","432","434","435","440","478","479","480","501","502","503","504","505","507","508","509","510","512","513","515","516","517","518","520","530","540","541","559","561","562","563","570","573","574","575","580","585","586","601","602","603","605","606","607","608","609","610","612","614","615","616","617","618","619","620","623","626","630","631","636","641","650","651","660","661","662","701","702","703","704","706","707","708","712","713","714","715","716","717","718","719","724","727","731","732","734","740","757","760","763","765","770","772","773","775","781","785","801","802","803","804","805","806","808","810","812","813","814","815","816","817","818","828","830","831","843","845","847","850","856","858","859","860","863","864","865","870","901","903","904","906","907","908","909","910","912","913","914","915","916","918","919","920","925","928","931","936","937","940","941","949","951","952","954","956","970","972","973","978","979","985","989"]],["Uruguay",["america","south-america"],"uy","598"],["Uzbekistan",["asia","ex-ussr"],"uz","998",".. ... .. .."],["Vanuatu",["oceania"],"vu","678"],["Vatican City",["europe"],"va","39",".. .... ....",1],["Venezuela",["america","south-america"],"ve","58"],["Vietnam",["asia"],"vn","84"],["Yemen",["middle-east"],"ye","967"],["Zambia",["africa"],"zm","260"],["Zimbabwe",["africa"],"zw","263"]]},11:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__spreadArray||function(e,a,r){if(r||2===arguments.length)for(var t,n=0,o=a.length;n<o;n++)!t&&n in a||(t||(t=Array.prototype.slice.call(a,0,n)),t[n]=a[n]);return e.concat(t||Array.prototype.slice.call(a))};Object.defineProperty(a,"__esModule",{value:!0}),a.useHistoryState=void 0;var o=r(156),i=r(795),u={size:20,overrideLastItemDebounceMS:-1};a.useHistoryState=function(e,a){var r=t(t({},u),a),l=r.size,c=r.overrideLastItemDebounceMS,s=r.onChange,d=(0,o.useState)(e),f=d[0],p=d[1],v=(0,o.useState)([f]),y=v[0],h=v[1],m=(0,o.useState)(0),b=m[0],C=m[1],g=(0,i.useTimer)();return[f,function(e,a){if(("object"!=typeof e||Object.entries(e).toString()!==Object.entries(f).toString())&&e!==f){var r=c>0,t=g.check(),o=!r||void 0===t||t>c;if(void 0!==(null==a?void 0:a.overrideLastItem)?a.overrideLastItem:!o)h((function(a){return n(n([],a.slice(0,b),!0),[e],!1)}));else{var i=y.length>=l;h((function(a){return n(n([],a.slice(i?1:0,b+1),!0),[e],!1)})),i||C((function(e){return e+1}))}p(e),null==s||s(e)}},function(){if(b<=0)return{success:!1};var e=y[b-1];return p(e),C((function(e){return e-1})),null==s||s(e),{success:!0,value:e}},function(){if(b+1>=y.length)return{success:!1};var e=y[b+1];return p(e),C((function(e){return e+1})),null==s||s(e),{success:!0,value:e}}]}},882:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.usePhoneInput=a.defaultConfig=a.MASK_CHAR=void 0;var t=r(156),n=r(946),o=r(332),i=r(11);a.MASK_CHAR=".",a.defaultConfig={defaultCountry:"us",value:"",prefix:"+",defaultMask:"............",charAfterDialCode:" ",historySaveDebounceMS:200,disableCountryGuess:!1,disableDialCodePrefill:!1,forceDialCode:!1,disableDialCodeAndPrefix:!1,countries:n.defaultCountries},a.usePhoneInput=function(e){var r=e.defaultCountry,n=void 0===r?a.defaultConfig.defaultCountry:r,u=e.value,l=void 0===u?a.defaultConfig.value:u,c=e.countries,s=void 0===c?a.defaultConfig.countries:c,d=e.prefix,f=void 0===d?a.defaultConfig.prefix:d,p=e.defaultMask,v=void 0===p?a.defaultConfig.defaultMask:p,y=e.charAfterDialCode,h=void 0===y?a.defaultConfig.charAfterDialCode:y,m=e.historySaveDebounceMS,b=void 0===m?a.defaultConfig.historySaveDebounceMS:m,C=e.disableCountryGuess,g=void 0===C?a.defaultConfig.disableCountryGuess:C,P=e.disableDialCodePrefill,_=void 0===P?a.defaultConfig.disableDialCodePrefill:P,O=e.forceDialCode,w=void 0===O?a.defaultConfig.forceDialCode:O,j=e.disableDialCodeAndPrefix,D=void 0===j?a.defaultConfig.disableDialCodeAndPrefix:j,M=e.onChange,S=!D&&!g,x=(0,t.useRef)(null),N=function(e){var r,t=e.value,n=e.country,i=e.trimNonDigitsEnd,u=e.insertDialCodeOnEmpty,l=!e.forceDisableCountryGuess&&S?(0,o.guessCountryByPartialNumber)({phone:t,countries:s,currentCountryIso2:n.iso2}):void 0,c=null!==(r=null==l?void 0:l.country)&&void 0!==r?r:n;return{phone:c?(0,o.formatPhone)(t,{prefix:f,mask:c.format||v,maskChar:a.MASK_CHAR,dialCode:c.dialCode,trimNonDigitsEnd:i,charAfterDialCode:h,forceDialCode:w,insertDialCodeOnEmpty:u,disableDialCodeAndPrefix:D}):t,countryGuessResult:l,formatCountry:c}},k=function(e){Promise.resolve().then((function(){var a;null===(a=x.current)||void 0===a||a.setSelectionRange(e,e)}))},A=(0,i.useHistoryState)((function(){var e=(0,o.guessCountryByPartialNumber)({phone:l,countries:s,currentCountryIso2:n}).country||(0,o.getCountry)({value:n,field:"iso2",countries:s});e||console.error('[react-international-phone]: can not find a country with "'.concat(B,'" iso2 code'));var a=N({value:l,country:e,insertDialCodeOnEmpty:!_}).phone;return k(a.length),l!==a&&(null==M||M({phone:a,country:e.iso2})),{phone:a,country:e.iso2}}),{overrideLastItemDebounceMS:b,onChange:M}),E=A[0],I=E.phone,B=E.country,z=A[1],L=A[2],R=A[3],T=(0,t.useMemo)((function(){return(0,o.getCountry)({value:B,field:"iso2",countries:s})}),[s,B]),G=function(e,a){var r,t,n=void 0===a?{}:a,i=n.deletion,u=n.cursorPosition,l=n.insertDialCodeOnEmpty,c=n.inserted,s=e,d=u;w&&!D&&T&&!(0,o.removeNonDigits)(e).startsWith(T.dialCode)&&e&&(c&&e.startsWith(f)&&e.length-(null!=u?u:0)==0?s=e:(s=I,d=0));var p=N({value:s,country:T,trimNonDigitsEnd:"backward"===i,insertDialCodeOnEmpty:l,forceDisableCountryGuess:w&&!!i&&(0,o.removeNonDigits)(s).length<T.dialCode.length}),v=p.phone,y=p.countryGuessResult,m=T;S&&(null==y?void 0:y.country)&&y.country.name!==B&&y.fullDialCodeMatch&&(m=y.country);var b=(0,o.getCursorPosition)({cursorPositionAfterInput:null!=d?d:0,phoneBeforeInput:I,phoneAfterInput:e,phoneAfterFormatted:v,leftOffset:w?f.length+(null!==(t=null===(r=null==T?void 0:T.dialCode)||void 0===r?void 0:r.length)&&void 0!==t?t:0)+h.length:0,deletion:i});return z({phone:v,country:m.iso2}),k(b),v};(0,t.useEffect)((function(){var e=x.current;if(e){var a=function(e){if(e.key){var a=e.ctrlKey,r=e.shiftKey,t="z"===e.key.toLowerCase();a&&t&&(r?R():L())}};return e.addEventListener("keydown",a),function(){e.removeEventListener("keydown",a)}}}),[x,L,R]);var F=(0,t.useState)(!1),K=F[0],W=F[1];return(0,t.useEffect)((function(){K?l!==I&&G(l):W(!0)}),[l]),{phone:I,country:B,setCountry:function(e){var a=(0,o.getCountry)({value:e,field:"iso2",countries:s});if(a){var r=D?"":"".concat(f).concat(a.dialCode).concat(h);z({phone:r,country:a.iso2}),Promise.resolve().then((function(){var e;null===(e=x.current)||void 0===e||e.focus()}))}},handlePhoneValueChange:function(e){var a;e.preventDefault();var r=e.nativeEvent.inputType,t=null==r?void 0:r.startsWith("insertFrom"),n=G(e.target.value,{deletion:function(){var e;if(null!==(e=null==r?void 0:r.toLocaleLowerCase().includes("delete"))&&void 0!==e&&e)return(null==r?void 0:r.toLocaleLowerCase().includes("forward"))?"forward":"backward"}(),inserted:t,cursorPosition:null!==(a=e.target.selectionStart)&&void 0!==a?a:0});return D&&T?(0,o.addDialCode)({phone:n,dialCode:T.dialCode,charAfterDialCode:h,prefix:f}):n},inputRef:x}}},393:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.usePhoneValidation=void 0;var t=r(332);a.usePhoneValidation=function(e,a){return(0,t.validatePhone)(e,a)}},795:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.useTimer=void 0;var t=r(156);a.useTimer=function(){var e=(0,t.useRef)(),a=(0,t.useRef)(Date.now());return{check:function(){var r=Date.now(),t=e.current?r-a.current:void 0;return e.current=a.current,a.current=r,t}}}},515:function(e,a){var r=this&&this.__spreadArray||function(e,a,r){if(r||2===arguments.length)for(var t,n=0,o=a.length;n<o;n++)!t&&n in a||(t||(t=Array.prototype.slice.call(a,0,n)),t[n]=a[n]);return e.concat(t||Array.prototype.slice.call(a))};Object.defineProperty(a,"__esModule",{value:!0}),a.buildClassNames=a.classNamesWithPrefix=a.joinClasses=a.classPrefix=void 0,a.classPrefix="react-international-phone-",a.joinClasses=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return e.filter((function(e){return!!e})).join(" ").trim()},a.classNamesWithPrefix=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return a.joinClasses.apply(void 0,e).split(" ").map((function(e){return"".concat(a.classPrefix).concat(e)})).join(" ")},a.buildClassNames=function(e){var t=e.addPrefix,n=e.rawClassNames;return a.joinClasses.apply(void 0,r([a.classNamesWithPrefix.apply(void 0,t)],n,!1))}},62:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.applyMask=void 0,a.applyMask=function(e){var a=e.value,r=e.mask,t=e.maskSymbol,n=e.offset,o=void 0===n?0:n,i=e.trimNonMaskCharsLeftover,u=void 0!==i&&i;if(a.length<o)return a;for(var l=a.slice(0,o),c=a.slice(o),s=l,d=0,f=0,p=r.split("");f<p.length;f++){var v=p[f];if(d>=c.length){if(!u&&v!==t){s+=v;continue}break}v===t?(s+=c[d],d+=1):s+=v}return s}},239:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(62),a),n(r(939),a),n(r(222),a)},939:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeNonDigits=void 0,a.removeNonDigits=function(e){return e.replace(/\D/g,"")}},222:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.scrollToChild=void 0,a.scrollToChild=function(e,a){var r=e.style.display;"block"!==r&&(e.style.display="block");var t=e.getBoundingClientRect(),n=a.getBoundingClientRect(),o=n.top-t.top,i=t.bottom-n.bottom;o>=0&&i>=0||(Math.abs(o)<Math.abs(i)?e.scrollTop+=o:e.scrollTop-=i),e.style.display=r}},298:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.buildCountryData=void 0,a.buildCountryData=function(e){for(var a=[e.name,e.regions,e.iso2,e.dialCode,e.format,e.priority,e.areaCodes],r=0;r<a.length;r+=1)if(0!==r){var t=a[r-1],n=a[r];if(void 0===t&&void 0!==n){var o=JSON.stringify(a,(function(e,a){return void 0===a?"__undefined":a})).replace(/"__undefined"/g,"undefined");throw new Error("[react-international-phone] invalid country values passed to buildCountryData. Check ".concat(t," in: ").concat(o))}}return a.filter((function(e){return void 0!==e}))}},891:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getCountry=void 0;var t=r(300);a.getCountry=function(e){var a=e.value,r=e.field,n=e.countries;if(["regions","priority"].includes(r))throw new Error(function(e){return'Field "'.concat(e,'" is not supported')}(r));var o=n.find((function(e){var n=(0,t.parseCountry)(e);return a===n[r]}));if(o)return(0,t.parseCountry)(o)}},4:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.guessCountryByPartialNumber=void 0;var t=r(239),n=r(891),o=r(300);a.guessCountryByPartialNumber=function(e){var a,r=e.phone,i=e.countries,u=e.currentCountryIso2,l={country:void 0,fullDialCodeMatch:!1,areaCodeMatch:void 0};if(!r)return l;var c=(0,t.removeNonDigits)(r);if(!c)return l;for(var s=l,d=function(e){var a,r,t,n,o=e.country,i=e.fullDialCodeMatch,u=e.areaCodeMatch,l=o.dialCode===(null===(a=s.country)||void 0===a?void 0:a.dialCode),c=(null!==(r=o.priority)&&void 0!==r?r:0)<(null!==(n=null===(t=s.country)||void 0===t?void 0:t.priority)&&void 0!==n?n:0);l&&!c||(s={country:o,fullDialCodeMatch:i,areaCodeMatch:u})},f=0,p=i;f<p.length;f++){var v=p[f],y=(0,o.parseCountry)(v),h=y.dialCode,m=y.areaCodes;if(c.startsWith(h)){var b=!s.country||Number(h)>=Number(s.country.dialCode);if(m)for(var C=c.substring(h.length),g=0,P=m;g<P.length;g++){var _=P[g];if(C.startsWith(_))return{country:y,fullDialCodeMatch:!0,areaCodeMatch:!0}}!b&&h!==c&&s.fullDialCodeMatch||d({country:y,fullDialCodeMatch:!0,areaCodeMatch:m?!m:void 0})}s.fullDialCodeMatch||c.length<h.length&&h.startsWith(c)&&(!s.country||Number(h)<=Number(s.country.dialCode))&&d({country:y,fullDialCodeMatch:!1})}if(u){var O=(0,n.getCountry)({value:u,field:"iso2",countries:i});s&&O&&(null===(a=s.country)||void 0===a?void 0:a.dialCode)===O.dialCode&&s.country!==O&&s.fullDialCodeMatch&&!s.areaCodeMatch&&(s={country:O,areaCodeMatch:!(null==O?void 0:O.areaCodes)&&void 0,fullDialCodeMatch:!0})}return s}},88:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(298),a),n(r(891),a),n(r(4),a),n(r(300),a)},300:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.parseCountry=void 0,a.parseCountry=function(e){return{name:e[0],regions:e[1],iso2:e[2],dialCode:e[3],format:e[4],priority:e[5],areaCodes:e[6]}}},332:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(239),a),n(r(88),a),n(r(165),a)},820:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDialCode=void 0;var t=r(214);a.addDialCode=function(e){var a=e.phone,r=e.dialCode,n=e.prefix,o=void 0===n?"+":n,i=e.charAfterDialCode,u=void 0===i?" ":i;return"".concat(o).concat(r).concat(u).concat((0,t.removeDialCode)({phone:a,dialCode:r,charAfterDialCode:u,prefix:o}))}},380:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.formatPhone=void 0;var t=r(239);a.formatPhone=function(e,a){var r=!a.disableDialCodeAndPrefix&&a.forceDialCode,n=!a.disableDialCodeAndPrefix&&a.insertDialCodeOnEmpty,o=e,i=function(e){return a.trimNonDigitsEnd?e.trim():e};if(!o)return n&&!o.length||r?i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode)):i(o);if((o=(0,t.removeNonDigits)(o))===a.dialCode&&!a.disableDialCodeAndPrefix)return i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode));if(a.dialCode.startsWith(o)&&!a.disableDialCodeAndPrefix)return i(r?"".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode):"".concat(a.prefix).concat(o));if(!o.startsWith(a.dialCode)&&!a.disableDialCodeAndPrefix){if(r)return i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode));if(o.length<a.dialCode.length)return i("".concat(a.prefix).concat(o))}var u,l=(u=a.dialCode.length,a.disableDialCodeAndPrefix&&(u=0),{phoneLeftSide:o.slice(0,u),phoneRightSide:o.slice(u)}),c=l.phoneLeftSide,s=l.phoneRightSide;return c="".concat(a.prefix).concat(c).concat(a.charAfterDialCode),s=(0,t.applyMask)({value:s,mask:a.mask,maskSymbol:a.maskChar,trimNonMaskCharsLeftover:a.trimNonDigitsEnd}),a.disableDialCodeAndPrefix&&(c=""),i("".concat(c).concat(s))}},775:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getCursorPosition=void 0;var r=function(e){return/\d/.test(e)};a.getCursorPosition=function(e){var a=e.phoneBeforeInput,t=e.phoneAfterInput,n=e.phoneAfterFormatted,o=e.cursorPositionAfterInput,i=e.leftOffset,u=void 0===i?0:i,l=e.deletion;if(o<u)return u;if(!a)return n.length;var c="backward"===l;if(0===o&&t.length>0&&n.length>0){if(c)return 0;for(var s=0;s<n.length;s+=1)if(r(n[s]))return s;return n.length}if(t.length<a.length&&1===t.length)return n.length;var d=null;for(s=o-1;s>=0;s-=1)if(r(t[s])){d=s;break}if(null===d)return 0!==o?o:n.length;var f=0;for(s=0;s<d;s+=1)r(t[s])&&(f+=1);c&&(f-=1);var p=0,v=0;for(s=0;s<n.length&&(p+=1,r(n[s])&&(v+=1),v!==f+1);s+=1);for(;!r(n[p])&&p<n.length;)p+=1;return c&&(p+=1),p}},165:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(820),a),n(r(380),a),n(r(775),a),n(r(214),a),n(r(684),a)},214:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeDialCode=void 0,a.removeDialCode=function(e){var a=e.phone,r=e.dialCode,t=e.prefix,n=void 0===t?"+":t,o=e.charAfterDialCode,i=void 0===o?" ":o;if(!a||!r)return a;var u=a;return u.startsWith(n)&&(u=u.replace(n,"")),u.startsWith(r)?((u=u.replace(r,"")).startsWith(i)&&(u=u.replace(i,"")),u):a}},684:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)};Object.defineProperty(a,"__esModule",{value:!0}),a.validatePhone=void 0;var n=r(882),o=r(239),i=r(88);a.validatePhone=function(e,a){var r,u=t(t({},n.defaultConfig),a),l=u.countries,c=u.defaultMask,s=u.defaultMaskMinPhoneLength,d=void 0===s?10:s,f=u.prefix,p=u.charAfterDialCode,v=(null==a?void 0:a.country)?(0,i.getCountry)({value:a.country,field:"iso2",countries:l}):null,y=(0,i.guessCountryByPartialNumber)({phone:e,countries:l,currentCountryIso2:null==a?void 0:a.country}),h=(null===(r=y.country)||void 0===r?void 0:r.iso2)===(null==v?void 0:v.iso2),m=!v||h?y:{country:v,fullDialCodeMatch:!1,areaCodeMatch:!(null==v?void 0:v.areaCodes)&&void 0},b=m.country,C=m.fullDialCodeMatch,g=m.areaCodeMatch;if(!b)return{country:b,lengthMatch:!1,dialCodeMatch:C,areaCodeMatch:g,formatMatch:!1,isValid:!1};var P=b.format||c,_=!b.format,O=_?d-b.dialCode.length:P.length-P.replaceAll(n.MASK_CHAR,"").length,w=_?P.slice(0,O):P,j="".concat(f).concat(b.dialCode).concat(p).concat(w).split("").every((function(a,r){var t=e[r]===a,o=a===n.MASK_CHAR&&Number.isFinite(+e[r]);return t||o})),D=(0,o.removeNonDigits)(e),M=b.dialCode.length+O;return D.length<M?{country:b,lengthMatch:!1,dialCodeMatch:C,areaCodeMatch:g,formatMatch:j,isValid:!1}:{country:b,lengthMatch:!0,dialCodeMatch:C,areaCodeMatch:g,formatMatch:j,isValid:D.startsWith(b.dialCode)}}},156:a=>{a.exports=e}},r={};function t(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}};return a[e].call(o.exports,o,o.exports,t),o.exports}t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.validatePhone=e.parseCountry=e.buildCountryData=e.usePhoneValidation=e.usePhoneInput=e.defaultCountries=e.PhoneInput=e.FlagEmoji=e.DialCodePreview=e.CountrySelectorDropdown=e.CountrySelector=void 0;var a=t(153);Object.defineProperty(e,"CountrySelector",{enumerable:!0,get:function(){return a.CountrySelector}});var r=t(60);Object.defineProperty(e,"CountrySelectorDropdown",{enumerable:!0,get:function(){return r.CountrySelectorDropdown}});var o=t(7);Object.defineProperty(e,"DialCodePreview",{enumerable:!0,get:function(){return o.DialCodePreview}});var i=t(425);Object.defineProperty(e,"FlagEmoji",{enumerable:!0,get:function(){return i.FlagEmoji}});var u=t(28);Object.defineProperty(e,"PhoneInput",{enumerable:!0,get:function(){return u.PhoneInput}});var l=t(946);Object.defineProperty(e,"defaultCountries",{enumerable:!0,get:function(){return l.defaultCountries}});var c=t(882);Object.defineProperty(e,"usePhoneInput",{enumerable:!0,get:function(){return c.usePhoneInput}});var s=t(393);Object.defineProperty(e,"usePhoneValidation",{enumerable:!0,get:function(){return s.usePhoneValidation}});var d=t(332);Object.defineProperty(e,"buildCountryData",{enumerable:!0,get:function(){return d.buildCountryData}}),Object.defineProperty(e,"parseCountry",{enumerable:!0,get:function(){return d.parseCountry}}),Object.defineProperty(e,"validatePhone",{enumerable:!0,get:function(){return d.validatePhone}})})(),n})()));

@@ -1,4 +0,8 @@

import { CountryData, ParsedCountry } from '../../types';
import { CountryData, CountryIso2, ParsedCountry } from '../../types';
export interface ValidatePhoneConfig {
/**
* Country to validate
*/
country?: CountryIso2;
/**
* Custom countries list

@@ -15,5 +19,15 @@ */

isValid: boolean;
/**
* Phone number overflow is allowed:
* +1 (999) 999-99999 will set `lengthMatch: true`.
*
* This is needed for countries that does not have format,
* and share same dial code with another countries (like 'do')
* For example: +1 999999999999 will be parsed as 'us', but we need to mark it as valid phone
*/
lengthMatch: boolean;
areaCodeMatch: boolean | undefined;
dialCodeMatch: boolean;
formatMatch: boolean;
}
export declare const validatePhone: (phone: string, config?: ValidatePhoneConfig) => ValidatePhoneReturn;
{
"name": "react-international-phone",
"version": "2.1.0",
"version": "2.2.0",
"description": "☎️ International phone input component for React",

@@ -5,0 +5,0 @@ "keywords": [

@@ -61,2 +61,2 @@ # react-international-phone

You can encounter some breaking changes after update from v1 to v2 <br/>
Checkout [migration document](https://react-international-phone-docs.vercel.app/docs/migration) that contains a list of breaking changes and ways to migrate.
Checkout [migration document](https://react-international-phone-docs.vercel.app/docs/Migrations/migrate-to-v2) that contains a list of breaking changes and ways to migrate.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc