libphonenumber-js 1.13.7 → 1.13.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (830) hide show
  1. package/.gitlab-ci.yml +50 -50
  2. package/AUTHORS +4 -4
  3. package/CHANGELOG.md +984 -971
  4. package/CODE_OF_CONDUCT.md +78 -78
  5. package/LICENSE +21 -21
  6. package/LICENSE.Apache +175 -175
  7. package/README.md +2110 -2110
  8. package/build/AsYouType.js +70 -70
  9. package/build/AsYouType.js.map +1 -1
  10. package/build/AsYouType.test.js.map +1 -1
  11. package/build/AsYouTypeFormatter.PatternMatcher.js +6 -6
  12. package/build/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
  13. package/build/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -1
  14. package/build/AsYouTypeFormatter.PatternParser.js.map +1 -1
  15. package/build/AsYouTypeFormatter.PatternParser.test.js.map +1 -1
  16. package/build/AsYouTypeFormatter.complete.js.map +1 -1
  17. package/build/AsYouTypeFormatter.js +11 -11
  18. package/build/AsYouTypeFormatter.js.map +1 -1
  19. package/build/AsYouTypeFormatter.util.js.map +1 -1
  20. package/build/AsYouTypeFormatter.util.test.js.map +1 -1
  21. package/build/AsYouTypeParser.js +26 -26
  22. package/build/AsYouTypeParser.js.map +1 -1
  23. package/build/AsYouTypeState.js +6 -6
  24. package/build/AsYouTypeState.js.map +1 -1
  25. package/build/ParseError.js.map +1 -1
  26. package/build/PhoneNumber.js +5 -5
  27. package/build/PhoneNumber.js.map +1 -1
  28. package/build/PhoneNumber.test.js.map +1 -1
  29. package/build/PhoneNumberMatcher.js +60 -60
  30. package/build/PhoneNumberMatcher.js.map +1 -1
  31. package/build/PhoneNumberMatcher.test.js.map +1 -1
  32. package/build/constants.js.map +1 -1
  33. package/build/findNumbers/LRUCache.js.map +1 -1
  34. package/build/findNumbers/Leniency.js +34 -34
  35. package/build/findNumbers/Leniency.js.map +1 -1
  36. package/build/findNumbers/RegExpCache.js.map +1 -1
  37. package/build/findNumbers/isValidCandidate.js +14 -14
  38. package/build/findNumbers/isValidCandidate.js.map +1 -1
  39. package/build/findNumbers/isValidPreCandidate.js.map +1 -1
  40. package/build/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +6 -6
  41. package/build/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js.map +1 -1
  42. package/build/findNumbers/parsePreCandidate.js.map +1 -1
  43. package/build/findNumbers/utf-8.js +19 -19
  44. package/build/findNumbers/utf-8.js.map +1 -1
  45. package/build/findNumbers/util.js +3 -3
  46. package/build/findNumbers/util.js.map +1 -1
  47. package/build/findNumbers/util.test.js.map +1 -1
  48. package/build/findPhoneNumbersInText.js.map +1 -1
  49. package/build/findPhoneNumbersInText.test.js.map +1 -1
  50. package/build/format.js +14 -14
  51. package/build/format.js.map +1 -1
  52. package/build/format.test.js.map +1 -1
  53. package/build/formatIncompletePhoneNumber.js +7 -7
  54. package/build/formatIncompletePhoneNumber.js.map +1 -1
  55. package/build/formatIncompletePhoneNumber.test.js.map +1 -1
  56. package/build/formatPhoneNumberForMobileDialing.js +35 -35
  57. package/build/formatPhoneNumberForMobileDialing.js.map +1 -1
  58. package/build/getCountries.js.map +1 -1
  59. package/build/getCountries.test.js.map +1 -1
  60. package/build/getCountryCallingCode.js.map +1 -1
  61. package/build/getCountryCallingCode.test.js.map +1 -1
  62. package/build/getExampleNumber.js.map +1 -1
  63. package/build/getExampleNumber.test.js.map +1 -1
  64. package/build/helpers/RFC3966.js +6 -6
  65. package/build/helpers/RFC3966.js.map +1 -1
  66. package/build/helpers/RFC3966.test.js.map +1 -1
  67. package/build/helpers/applyInternationalSeparatorStyle.js.map +1 -1
  68. package/build/helpers/applyInternationalSeparatorStyle.test.js.map +1 -1
  69. package/build/helpers/checkNumberLength.js +15 -15
  70. package/build/helpers/checkNumberLength.js.map +1 -1
  71. package/build/helpers/checkNumberLength.test.js.map +1 -1
  72. package/build/helpers/extension/createExtensionPattern.js +10 -10
  73. package/build/helpers/extension/createExtensionPattern.js.map +1 -1
  74. package/build/helpers/extension/extractExtension.js.map +1 -1
  75. package/build/helpers/extractCountryCallingCode.js +23 -23
  76. package/build/helpers/extractCountryCallingCode.js.map +1 -1
  77. package/build/helpers/extractCountryCallingCode.test.js.map +1 -1
  78. package/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +9 -9
  79. package/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map +1 -1
  80. package/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.test.js.map +1 -1
  81. package/build/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +4 -4
  82. package/build/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map +1 -1
  83. package/build/helpers/extractNationalNumber.js +15 -15
  84. package/build/helpers/extractNationalNumber.js.map +1 -1
  85. package/build/helpers/extractNationalNumber.test.js.map +1 -1
  86. package/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +12 -12
  87. package/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js.map +1 -1
  88. package/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.test.js.map +1 -1
  89. package/build/helpers/extractPhoneContext.js +17 -17
  90. package/build/helpers/extractPhoneContext.js.map +1 -1
  91. package/build/helpers/extractPhoneContext.test.js.map +1 -1
  92. package/build/helpers/formatNationalNumberUsingFormat.js.map +1 -1
  93. package/build/helpers/getCountryAndCallingCodeFromOneOfThem.js.map +1 -1
  94. package/build/helpers/getCountryByCallingCode.js +7 -7
  95. package/build/helpers/getCountryByCallingCode.js.map +1 -1
  96. package/build/helpers/getCountryByNationalNumber.js +7 -7
  97. package/build/helpers/getCountryByNationalNumber.js.map +1 -1
  98. package/build/helpers/getIddPrefix.js +8 -8
  99. package/build/helpers/getIddPrefix.js.map +1 -1
  100. package/build/helpers/getNumberType.js.map +1 -1
  101. package/build/helpers/getNumberType.test.js.map +1 -1
  102. package/build/helpers/getPossibleCountriesForNumber.js +6 -6
  103. package/build/helpers/getPossibleCountriesForNumber.js.map +1 -1
  104. package/build/helpers/isCallingCode.js.map +1 -1
  105. package/build/helpers/isCallingCode.test.js.map +1 -1
  106. package/build/helpers/isCountryCode.js.map +1 -1
  107. package/build/helpers/isCountryCode.test.js.map +1 -1
  108. package/build/helpers/isObject.js.map +1 -1
  109. package/build/helpers/isViablePhoneNumber.js.map +1 -1
  110. package/build/helpers/matchesEntirely.js +4 -4
  111. package/build/helpers/matchesEntirely.js.map +1 -1
  112. package/build/helpers/matchesEntirely.test.js.map +1 -1
  113. package/build/helpers/mergeArrays.js +5 -5
  114. package/build/helpers/mergeArrays.js.map +1 -1
  115. package/build/helpers/mergeArrays.test.js.map +1 -1
  116. package/build/helpers/parseDigits.js +12 -12
  117. package/build/helpers/parseDigits.js.map +1 -1
  118. package/build/helpers/parseDigits.test.js.map +1 -1
  119. package/build/helpers/stripIddPrefix.js.map +1 -1
  120. package/build/helpers/stripIddPrefix.test.js.map +1 -1
  121. package/build/isPossible.js +17 -17
  122. package/build/isPossible.js.map +1 -1
  123. package/build/isPossible.test.js.map +1 -1
  124. package/build/isPossiblePhoneNumber.js.map +1 -1
  125. package/build/isPossiblePhoneNumber.test.js.map +1 -1
  126. package/build/isValid.js +33 -33
  127. package/build/isValid.js.map +1 -1
  128. package/build/isValid.test.js.map +1 -1
  129. package/build/isValidPhoneNumber.js.map +1 -1
  130. package/build/isValidPhoneNumber.test.js.map +1 -1
  131. package/build/legacy/PhoneNumberSearch.js +4 -4
  132. package/build/legacy/PhoneNumberSearch.js.map +1 -1
  133. package/build/legacy/findNumbers.js.map +1 -1
  134. package/build/legacy/findNumbers.test.js.map +1 -1
  135. package/build/legacy/findPhoneNumbers.js +2 -2
  136. package/build/legacy/findPhoneNumbers.js.map +1 -1
  137. package/build/legacy/findPhoneNumbers.test.js.map +1 -1
  138. package/build/legacy/findPhoneNumbersInitialImplementation.js +16 -16
  139. package/build/legacy/findPhoneNumbersInitialImplementation.js.map +1 -1
  140. package/build/legacy/format.js.map +1 -1
  141. package/build/legacy/format.test.js.map +1 -1
  142. package/build/legacy/getNumberType.js.map +1 -1
  143. package/build/legacy/getNumberType.test.js.map +1 -1
  144. package/build/legacy/isPossibleNumber.js +13 -13
  145. package/build/legacy/isPossibleNumber.js.map +1 -1
  146. package/build/legacy/isPossibleNumber.test.js.map +1 -1
  147. package/build/legacy/isValidNumber.js.map +1 -1
  148. package/build/legacy/isValidNumber.test.js.map +1 -1
  149. package/build/legacy/isValidNumberForRegion.js.map +1 -1
  150. package/build/legacy/isValidNumberForRegion.test.js.map +1 -1
  151. package/build/legacy/isValidNumberForRegion_.js +4 -4
  152. package/build/legacy/isValidNumberForRegion_.js.map +1 -1
  153. package/build/legacy/parse.js.map +1 -1
  154. package/build/legacy/parse.test.js.map +1 -1
  155. package/build/legacy/searchNumbers.js +2 -2
  156. package/build/legacy/searchNumbers.js.map +1 -1
  157. package/build/legacy/searchNumbers.test.js.map +1 -1
  158. package/build/metadata.js +40 -40
  159. package/build/metadata.js.map +1 -1
  160. package/build/metadata.test.js.map +1 -1
  161. package/build/normalizeArguments.js.map +1 -1
  162. package/build/parse.js +36 -36
  163. package/build/parse.js.map +1 -1
  164. package/build/parse.test.js.map +1 -1
  165. package/build/parseIncompletePhoneNumber.js +24 -24
  166. package/build/parseIncompletePhoneNumber.js.map +1 -1
  167. package/build/parseIncompletePhoneNumber.test.js.map +1 -1
  168. package/build/parsePhoneNumber.js.map +1 -1
  169. package/build/parsePhoneNumber.test.js.map +1 -1
  170. package/build/parsePhoneNumberWithError.js.map +1 -1
  171. package/build/parsePhoneNumberWithError.test.js.map +1 -1
  172. package/build/parsePhoneNumberWithError_.js.map +1 -1
  173. package/build/parsePhoneNumber_.js.map +1 -1
  174. package/build/searchPhoneNumbersInText.js.map +1 -1
  175. package/build/searchPhoneNumbersInText.test.js.map +1 -1
  176. package/build/tools/semver-compare.js.map +1 -1
  177. package/build/tools/semver-compare.test.js.map +1 -1
  178. package/build/validatePhoneNumberLength.js.map +1 -1
  179. package/build/validatePhoneNumberLength.test.js.map +1 -1
  180. package/bundle/libphonenumber-js.min.js +1 -1
  181. package/bundle/libphonenumber-js.min.js.map +1 -1
  182. package/bundle/libphonenumber-max.js +1 -1
  183. package/bundle/libphonenumber-max.js.map +1 -1
  184. package/bundle/libphonenumber-min.js +1 -1
  185. package/bundle/libphonenumber-min.js.map +1 -1
  186. package/bundle/libphonenumber-mobile.js +1 -1
  187. package/bundle/libphonenumber-mobile.js.map +1 -1
  188. package/core/es6/index.d.cts +2 -2
  189. package/core/es6/index.d.ts +2 -2
  190. package/core/es6/index.js +39 -39
  191. package/core/es6/package.json +12 -12
  192. package/core/index.cjs +57 -57
  193. package/core/index.cjs.js +62 -62
  194. package/core/index.d.cts +150 -150
  195. package/core/index.d.ts +150 -150
  196. package/core/index.js +39 -39
  197. package/core/package.json +14 -14
  198. package/custom.d.ts +209 -209
  199. package/custom.js +78 -78
  200. package/es6/AsYouType.js +70 -70
  201. package/es6/AsYouType.js.map +1 -1
  202. package/es6/AsYouType.test.js.map +1 -1
  203. package/es6/AsYouTypeFormatter.PatternMatcher.js +6 -6
  204. package/es6/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
  205. package/es6/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -1
  206. package/es6/AsYouTypeFormatter.PatternParser.js.map +1 -1
  207. package/es6/AsYouTypeFormatter.PatternParser.test.js.map +1 -1
  208. package/es6/AsYouTypeFormatter.complete.js.map +1 -1
  209. package/es6/AsYouTypeFormatter.js +11 -11
  210. package/es6/AsYouTypeFormatter.js.map +1 -1
  211. package/es6/AsYouTypeFormatter.util.js.map +1 -1
  212. package/es6/AsYouTypeFormatter.util.test.js.map +1 -1
  213. package/es6/AsYouTypeParser.js +26 -26
  214. package/es6/AsYouTypeParser.js.map +1 -1
  215. package/es6/AsYouTypeState.js +6 -6
  216. package/es6/AsYouTypeState.js.map +1 -1
  217. package/es6/ParseError.js.map +1 -1
  218. package/es6/PhoneNumber.js +5 -5
  219. package/es6/PhoneNumber.js.map +1 -1
  220. package/es6/PhoneNumber.test.js.map +1 -1
  221. package/es6/PhoneNumberMatcher.js +60 -60
  222. package/es6/PhoneNumberMatcher.js.map +1 -1
  223. package/es6/PhoneNumberMatcher.test.js.map +1 -1
  224. package/es6/constants.js.map +1 -1
  225. package/es6/findNumbers/LRUCache.js.map +1 -1
  226. package/es6/findNumbers/Leniency.js +34 -34
  227. package/es6/findNumbers/Leniency.js.map +1 -1
  228. package/es6/findNumbers/RegExpCache.js.map +1 -1
  229. package/es6/findNumbers/isValidCandidate.js +14 -14
  230. package/es6/findNumbers/isValidCandidate.js.map +1 -1
  231. package/es6/findNumbers/isValidPreCandidate.js.map +1 -1
  232. package/es6/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +6 -6
  233. package/es6/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js.map +1 -1
  234. package/es6/findNumbers/parsePreCandidate.js.map +1 -1
  235. package/es6/findNumbers/utf-8.js +19 -19
  236. package/es6/findNumbers/utf-8.js.map +1 -1
  237. package/es6/findNumbers/util.js +3 -3
  238. package/es6/findNumbers/util.js.map +1 -1
  239. package/es6/findNumbers/util.test.js.map +1 -1
  240. package/es6/findPhoneNumbersInText.js.map +1 -1
  241. package/es6/findPhoneNumbersInText.test.js.map +1 -1
  242. package/es6/format.js +14 -14
  243. package/es6/format.js.map +1 -1
  244. package/es6/format.test.js.map +1 -1
  245. package/es6/formatIncompletePhoneNumber.js +7 -7
  246. package/es6/formatIncompletePhoneNumber.js.map +1 -1
  247. package/es6/formatIncompletePhoneNumber.test.js.map +1 -1
  248. package/es6/formatPhoneNumberForMobileDialing.js +35 -35
  249. package/es6/formatPhoneNumberForMobileDialing.js.map +1 -1
  250. package/es6/getCountries.js.map +1 -1
  251. package/es6/getCountries.test.js.map +1 -1
  252. package/es6/getCountryCallingCode.js.map +1 -1
  253. package/es6/getCountryCallingCode.test.js.map +1 -1
  254. package/es6/getExampleNumber.js.map +1 -1
  255. package/es6/getExampleNumber.test.js.map +1 -1
  256. package/es6/helpers/RFC3966.js +6 -6
  257. package/es6/helpers/RFC3966.js.map +1 -1
  258. package/es6/helpers/RFC3966.test.js.map +1 -1
  259. package/es6/helpers/applyInternationalSeparatorStyle.js.map +1 -1
  260. package/es6/helpers/applyInternationalSeparatorStyle.test.js.map +1 -1
  261. package/es6/helpers/checkNumberLength.js +15 -15
  262. package/es6/helpers/checkNumberLength.js.map +1 -1
  263. package/es6/helpers/checkNumberLength.test.js.map +1 -1
  264. package/es6/helpers/extension/createExtensionPattern.js +10 -10
  265. package/es6/helpers/extension/createExtensionPattern.js.map +1 -1
  266. package/es6/helpers/extension/extractExtension.js.map +1 -1
  267. package/es6/helpers/extractCountryCallingCode.js +23 -23
  268. package/es6/helpers/extractCountryCallingCode.js.map +1 -1
  269. package/es6/helpers/extractCountryCallingCode.test.js.map +1 -1
  270. package/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +9 -9
  271. package/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map +1 -1
  272. package/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.test.js.map +1 -1
  273. package/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +4 -4
  274. package/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map +1 -1
  275. package/es6/helpers/extractNationalNumber.js +15 -15
  276. package/es6/helpers/extractNationalNumber.js.map +1 -1
  277. package/es6/helpers/extractNationalNumber.test.js.map +1 -1
  278. package/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +12 -12
  279. package/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js.map +1 -1
  280. package/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.test.js.map +1 -1
  281. package/es6/helpers/extractPhoneContext.js +17 -17
  282. package/es6/helpers/extractPhoneContext.js.map +1 -1
  283. package/es6/helpers/extractPhoneContext.test.js.map +1 -1
  284. package/es6/helpers/formatNationalNumberUsingFormat.js.map +1 -1
  285. package/es6/helpers/getCountryAndCallingCodeFromOneOfThem.js.map +1 -1
  286. package/es6/helpers/getCountryByCallingCode.js +7 -7
  287. package/es6/helpers/getCountryByCallingCode.js.map +1 -1
  288. package/es6/helpers/getCountryByNationalNumber.js +7 -7
  289. package/es6/helpers/getCountryByNationalNumber.js.map +1 -1
  290. package/es6/helpers/getIddPrefix.js +8 -8
  291. package/es6/helpers/getIddPrefix.js.map +1 -1
  292. package/es6/helpers/getNumberType.js.map +1 -1
  293. package/es6/helpers/getNumberType.test.js.map +1 -1
  294. package/es6/helpers/getPossibleCountriesForNumber.js +6 -6
  295. package/es6/helpers/getPossibleCountriesForNumber.js.map +1 -1
  296. package/es6/helpers/isCallingCode.js.map +1 -1
  297. package/es6/helpers/isCallingCode.test.js.map +1 -1
  298. package/es6/helpers/isCountryCode.js.map +1 -1
  299. package/es6/helpers/isCountryCode.test.js.map +1 -1
  300. package/es6/helpers/isObject.js.map +1 -1
  301. package/es6/helpers/isViablePhoneNumber.js.map +1 -1
  302. package/es6/helpers/matchesEntirely.js +4 -4
  303. package/es6/helpers/matchesEntirely.js.map +1 -1
  304. package/es6/helpers/matchesEntirely.test.js.map +1 -1
  305. package/es6/helpers/mergeArrays.js +5 -5
  306. package/es6/helpers/mergeArrays.js.map +1 -1
  307. package/es6/helpers/mergeArrays.test.js.map +1 -1
  308. package/es6/helpers/parseDigits.js +12 -12
  309. package/es6/helpers/parseDigits.js.map +1 -1
  310. package/es6/helpers/parseDigits.test.js.map +1 -1
  311. package/es6/helpers/stripIddPrefix.js.map +1 -1
  312. package/es6/helpers/stripIddPrefix.test.js.map +1 -1
  313. package/es6/isPossible.js +17 -17
  314. package/es6/isPossible.js.map +1 -1
  315. package/es6/isPossible.test.js.map +1 -1
  316. package/es6/isPossiblePhoneNumber.js.map +1 -1
  317. package/es6/isPossiblePhoneNumber.test.js.map +1 -1
  318. package/es6/isValid.js +33 -33
  319. package/es6/isValid.js.map +1 -1
  320. package/es6/isValid.test.js.map +1 -1
  321. package/es6/isValidPhoneNumber.js.map +1 -1
  322. package/es6/isValidPhoneNumber.test.js.map +1 -1
  323. package/es6/legacy/PhoneNumberSearch.js +4 -4
  324. package/es6/legacy/PhoneNumberSearch.js.map +1 -1
  325. package/es6/legacy/findNumbers.js.map +1 -1
  326. package/es6/legacy/findNumbers.test.js.map +1 -1
  327. package/es6/legacy/findPhoneNumbers.js +2 -2
  328. package/es6/legacy/findPhoneNumbers.js.map +1 -1
  329. package/es6/legacy/findPhoneNumbers.test.js.map +1 -1
  330. package/es6/legacy/findPhoneNumbersInitialImplementation.js +16 -16
  331. package/es6/legacy/findPhoneNumbersInitialImplementation.js.map +1 -1
  332. package/es6/legacy/format.js.map +1 -1
  333. package/es6/legacy/format.test.js.map +1 -1
  334. package/es6/legacy/getNumberType.js.map +1 -1
  335. package/es6/legacy/getNumberType.test.js.map +1 -1
  336. package/es6/legacy/isPossibleNumber.js +13 -13
  337. package/es6/legacy/isPossibleNumber.js.map +1 -1
  338. package/es6/legacy/isPossibleNumber.test.js.map +1 -1
  339. package/es6/legacy/isValidNumber.js.map +1 -1
  340. package/es6/legacy/isValidNumber.test.js.map +1 -1
  341. package/es6/legacy/isValidNumberForRegion.js.map +1 -1
  342. package/es6/legacy/isValidNumberForRegion.test.js.map +1 -1
  343. package/es6/legacy/isValidNumberForRegion_.js +4 -4
  344. package/es6/legacy/isValidNumberForRegion_.js.map +1 -1
  345. package/es6/legacy/parse.js.map +1 -1
  346. package/es6/legacy/parse.test.js.map +1 -1
  347. package/es6/legacy/searchNumbers.js +2 -2
  348. package/es6/legacy/searchNumbers.js.map +1 -1
  349. package/es6/legacy/searchNumbers.test.js.map +1 -1
  350. package/es6/metadata.js +40 -40
  351. package/es6/metadata.js.map +1 -1
  352. package/es6/metadata.test.js.map +1 -1
  353. package/es6/normalizeArguments.js.map +1 -1
  354. package/es6/parse.js +36 -36
  355. package/es6/parse.js.map +1 -1
  356. package/es6/parse.test.js.map +1 -1
  357. package/es6/parseIncompletePhoneNumber.js +24 -24
  358. package/es6/parseIncompletePhoneNumber.js.map +1 -1
  359. package/es6/parseIncompletePhoneNumber.test.js.map +1 -1
  360. package/es6/parsePhoneNumber.js.map +1 -1
  361. package/es6/parsePhoneNumber.test.js.map +1 -1
  362. package/es6/parsePhoneNumberWithError.js.map +1 -1
  363. package/es6/parsePhoneNumberWithError.test.js.map +1 -1
  364. package/es6/parsePhoneNumberWithError_.js.map +1 -1
  365. package/es6/parsePhoneNumber_.js.map +1 -1
  366. package/es6/searchPhoneNumbersInText.js.map +1 -1
  367. package/es6/searchPhoneNumbersInText.test.js.map +1 -1
  368. package/es6/tools/semver-compare.js.map +1 -1
  369. package/es6/tools/semver-compare.test.js.map +1 -1
  370. package/es6/validatePhoneNumberLength.js.map +1 -1
  371. package/es6/validatePhoneNumberLength.test.js.map +1 -1
  372. package/es6-modern/AsYouType.js +70 -70
  373. package/es6-modern/AsYouType.js.map +1 -1
  374. package/es6-modern/AsYouType.test.js.map +1 -1
  375. package/es6-modern/AsYouTypeFormatter.PatternMatcher.js +6 -6
  376. package/es6-modern/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
  377. package/es6-modern/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -1
  378. package/es6-modern/AsYouTypeFormatter.PatternParser.js.map +1 -1
  379. package/es6-modern/AsYouTypeFormatter.PatternParser.test.js.map +1 -1
  380. package/es6-modern/AsYouTypeFormatter.complete.js.map +1 -1
  381. package/es6-modern/AsYouTypeFormatter.js +11 -11
  382. package/es6-modern/AsYouTypeFormatter.js.map +1 -1
  383. package/es6-modern/AsYouTypeFormatter.util.js.map +1 -1
  384. package/es6-modern/AsYouTypeFormatter.util.test.js.map +1 -1
  385. package/es6-modern/AsYouTypeParser.js +26 -26
  386. package/es6-modern/AsYouTypeParser.js.map +1 -1
  387. package/es6-modern/AsYouTypeState.js +6 -6
  388. package/es6-modern/AsYouTypeState.js.map +1 -1
  389. package/es6-modern/ParseError.js.map +1 -1
  390. package/es6-modern/PhoneNumber.js +5 -5
  391. package/es6-modern/PhoneNumber.js.map +1 -1
  392. package/es6-modern/PhoneNumber.test.js.map +1 -1
  393. package/es6-modern/PhoneNumberMatcher.js +60 -60
  394. package/es6-modern/PhoneNumberMatcher.js.map +1 -1
  395. package/es6-modern/PhoneNumberMatcher.test.js.map +1 -1
  396. package/es6-modern/constants.js.map +1 -1
  397. package/es6-modern/findNumbers/LRUCache.js.map +1 -1
  398. package/es6-modern/findNumbers/Leniency.js +34 -34
  399. package/es6-modern/findNumbers/Leniency.js.map +1 -1
  400. package/es6-modern/findNumbers/RegExpCache.js.map +1 -1
  401. package/es6-modern/findNumbers/isValidCandidate.js +14 -14
  402. package/es6-modern/findNumbers/isValidCandidate.js.map +1 -1
  403. package/es6-modern/findNumbers/isValidPreCandidate.js.map +1 -1
  404. package/es6-modern/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +6 -6
  405. package/es6-modern/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js.map +1 -1
  406. package/es6-modern/findNumbers/parsePreCandidate.js.map +1 -1
  407. package/es6-modern/findNumbers/utf-8.js +19 -19
  408. package/es6-modern/findNumbers/utf-8.js.map +1 -1
  409. package/es6-modern/findNumbers/util.js +3 -3
  410. package/es6-modern/findNumbers/util.js.map +1 -1
  411. package/es6-modern/findNumbers/util.test.js.map +1 -1
  412. package/es6-modern/findPhoneNumbersInText.js.map +1 -1
  413. package/es6-modern/findPhoneNumbersInText.test.js.map +1 -1
  414. package/es6-modern/format.js +14 -14
  415. package/es6-modern/format.js.map +1 -1
  416. package/es6-modern/format.test.js.map +1 -1
  417. package/es6-modern/formatIncompletePhoneNumber.js +7 -7
  418. package/es6-modern/formatIncompletePhoneNumber.js.map +1 -1
  419. package/es6-modern/formatIncompletePhoneNumber.test.js.map +1 -1
  420. package/es6-modern/formatPhoneNumberForMobileDialing.js +35 -35
  421. package/es6-modern/formatPhoneNumberForMobileDialing.js.map +1 -1
  422. package/es6-modern/getCountries.js.map +1 -1
  423. package/es6-modern/getCountries.test.js.map +1 -1
  424. package/es6-modern/getCountryCallingCode.js.map +1 -1
  425. package/es6-modern/getCountryCallingCode.test.js.map +1 -1
  426. package/es6-modern/getExampleNumber.js.map +1 -1
  427. package/es6-modern/getExampleNumber.test.js.map +1 -1
  428. package/es6-modern/helpers/RFC3966.js +6 -6
  429. package/es6-modern/helpers/RFC3966.js.map +1 -1
  430. package/es6-modern/helpers/RFC3966.test.js.map +1 -1
  431. package/es6-modern/helpers/applyInternationalSeparatorStyle.js.map +1 -1
  432. package/es6-modern/helpers/applyInternationalSeparatorStyle.test.js.map +1 -1
  433. package/es6-modern/helpers/checkNumberLength.js +15 -15
  434. package/es6-modern/helpers/checkNumberLength.js.map +1 -1
  435. package/es6-modern/helpers/checkNumberLength.test.js.map +1 -1
  436. package/es6-modern/helpers/extension/createExtensionPattern.js +10 -10
  437. package/es6-modern/helpers/extension/createExtensionPattern.js.map +1 -1
  438. package/es6-modern/helpers/extension/extractExtension.js.map +1 -1
  439. package/es6-modern/helpers/extractCountryCallingCode.js +23 -23
  440. package/es6-modern/helpers/extractCountryCallingCode.js.map +1 -1
  441. package/es6-modern/helpers/extractCountryCallingCode.test.js.map +1 -1
  442. package/es6-modern/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +9 -9
  443. package/es6-modern/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map +1 -1
  444. package/es6-modern/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.test.js.map +1 -1
  445. package/es6-modern/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +4 -4
  446. package/es6-modern/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map +1 -1
  447. package/es6-modern/helpers/extractNationalNumber.js +15 -15
  448. package/es6-modern/helpers/extractNationalNumber.js.map +1 -1
  449. package/es6-modern/helpers/extractNationalNumber.test.js.map +1 -1
  450. package/es6-modern/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +12 -12
  451. package/es6-modern/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js.map +1 -1
  452. package/es6-modern/helpers/extractNationalNumberFromPossiblyIncompleteNumber.test.js.map +1 -1
  453. package/es6-modern/helpers/extractPhoneContext.js +17 -17
  454. package/es6-modern/helpers/extractPhoneContext.js.map +1 -1
  455. package/es6-modern/helpers/extractPhoneContext.test.js.map +1 -1
  456. package/es6-modern/helpers/formatNationalNumberUsingFormat.js.map +1 -1
  457. package/es6-modern/helpers/getCountryAndCallingCodeFromOneOfThem.js.map +1 -1
  458. package/es6-modern/helpers/getCountryByCallingCode.js +7 -7
  459. package/es6-modern/helpers/getCountryByCallingCode.js.map +1 -1
  460. package/es6-modern/helpers/getCountryByNationalNumber.js +7 -7
  461. package/es6-modern/helpers/getCountryByNationalNumber.js.map +1 -1
  462. package/es6-modern/helpers/getIddPrefix.js +8 -8
  463. package/es6-modern/helpers/getIddPrefix.js.map +1 -1
  464. package/es6-modern/helpers/getNumberType.js.map +1 -1
  465. package/es6-modern/helpers/getNumberType.test.js.map +1 -1
  466. package/es6-modern/helpers/getPossibleCountriesForNumber.js +6 -6
  467. package/es6-modern/helpers/getPossibleCountriesForNumber.js.map +1 -1
  468. package/es6-modern/helpers/isCallingCode.js.map +1 -1
  469. package/es6-modern/helpers/isCallingCode.test.js.map +1 -1
  470. package/es6-modern/helpers/isCountryCode.js.map +1 -1
  471. package/es6-modern/helpers/isCountryCode.test.js.map +1 -1
  472. package/es6-modern/helpers/isObject.js.map +1 -1
  473. package/es6-modern/helpers/isViablePhoneNumber.js.map +1 -1
  474. package/es6-modern/helpers/matchesEntirely.js +4 -4
  475. package/es6-modern/helpers/matchesEntirely.js.map +1 -1
  476. package/es6-modern/helpers/matchesEntirely.test.js.map +1 -1
  477. package/es6-modern/helpers/mergeArrays.js +5 -5
  478. package/es6-modern/helpers/mergeArrays.js.map +1 -1
  479. package/es6-modern/helpers/mergeArrays.test.js.map +1 -1
  480. package/es6-modern/helpers/parseDigits.js +12 -12
  481. package/es6-modern/helpers/parseDigits.js.map +1 -1
  482. package/es6-modern/helpers/parseDigits.test.js.map +1 -1
  483. package/es6-modern/helpers/stripIddPrefix.js.map +1 -1
  484. package/es6-modern/helpers/stripIddPrefix.test.js.map +1 -1
  485. package/es6-modern/isPossible.js +17 -17
  486. package/es6-modern/isPossible.js.map +1 -1
  487. package/es6-modern/isPossible.test.js.map +1 -1
  488. package/es6-modern/isPossiblePhoneNumber.js.map +1 -1
  489. package/es6-modern/isPossiblePhoneNumber.test.js.map +1 -1
  490. package/es6-modern/isValid.js +33 -33
  491. package/es6-modern/isValid.js.map +1 -1
  492. package/es6-modern/isValid.test.js.map +1 -1
  493. package/es6-modern/isValidPhoneNumber.js.map +1 -1
  494. package/es6-modern/isValidPhoneNumber.test.js.map +1 -1
  495. package/es6-modern/legacy/PhoneNumberSearch.js +4 -4
  496. package/es6-modern/legacy/PhoneNumberSearch.js.map +1 -1
  497. package/es6-modern/legacy/findNumbers.js.map +1 -1
  498. package/es6-modern/legacy/findNumbers.test.js.map +1 -1
  499. package/es6-modern/legacy/findPhoneNumbers.js +2 -2
  500. package/es6-modern/legacy/findPhoneNumbers.js.map +1 -1
  501. package/es6-modern/legacy/findPhoneNumbers.test.js.map +1 -1
  502. package/es6-modern/legacy/findPhoneNumbersInitialImplementation.js +16 -16
  503. package/es6-modern/legacy/findPhoneNumbersInitialImplementation.js.map +1 -1
  504. package/es6-modern/legacy/format.js.map +1 -1
  505. package/es6-modern/legacy/format.test.js.map +1 -1
  506. package/es6-modern/legacy/getNumberType.js.map +1 -1
  507. package/es6-modern/legacy/getNumberType.test.js.map +1 -1
  508. package/es6-modern/legacy/isPossibleNumber.js +13 -13
  509. package/es6-modern/legacy/isPossibleNumber.js.map +1 -1
  510. package/es6-modern/legacy/isPossibleNumber.test.js.map +1 -1
  511. package/es6-modern/legacy/isValidNumber.js.map +1 -1
  512. package/es6-modern/legacy/isValidNumber.test.js.map +1 -1
  513. package/es6-modern/legacy/isValidNumberForRegion.js.map +1 -1
  514. package/es6-modern/legacy/isValidNumberForRegion.test.js.map +1 -1
  515. package/es6-modern/legacy/isValidNumberForRegion_.js +4 -4
  516. package/es6-modern/legacy/isValidNumberForRegion_.js.map +1 -1
  517. package/es6-modern/legacy/parse.js.map +1 -1
  518. package/es6-modern/legacy/parse.test.js.map +1 -1
  519. package/es6-modern/legacy/searchNumbers.js +2 -2
  520. package/es6-modern/legacy/searchNumbers.js.map +1 -1
  521. package/es6-modern/legacy/searchNumbers.test.js.map +1 -1
  522. package/es6-modern/metadata.js +40 -40
  523. package/es6-modern/metadata.js.map +1 -1
  524. package/es6-modern/metadata.test.js.map +1 -1
  525. package/es6-modern/normalizeArguments.js.map +1 -1
  526. package/es6-modern/parse.js +36 -36
  527. package/es6-modern/parse.js.map +1 -1
  528. package/es6-modern/parse.test.js.map +1 -1
  529. package/es6-modern/parseIncompletePhoneNumber.js +24 -24
  530. package/es6-modern/parseIncompletePhoneNumber.js.map +1 -1
  531. package/es6-modern/parseIncompletePhoneNumber.test.js.map +1 -1
  532. package/es6-modern/parsePhoneNumber.js.map +1 -1
  533. package/es6-modern/parsePhoneNumber.test.js.map +1 -1
  534. package/es6-modern/parsePhoneNumberWithError.js.map +1 -1
  535. package/es6-modern/parsePhoneNumberWithError.test.js.map +1 -1
  536. package/es6-modern/parsePhoneNumberWithError_.js.map +1 -1
  537. package/es6-modern/parsePhoneNumber_.js.map +1 -1
  538. package/es6-modern/searchPhoneNumbersInText.js.map +1 -1
  539. package/es6-modern/searchPhoneNumbersInText.test.js.map +1 -1
  540. package/es6-modern/tools/semver-compare.js.map +1 -1
  541. package/es6-modern/tools/semver-compare.test.js.map +1 -1
  542. package/es6-modern/validatePhoneNumberLength.js.map +1 -1
  543. package/es6-modern/validatePhoneNumberLength.test.js.map +1 -1
  544. package/examples.mobile.json.d.cts +3 -3
  545. package/examples.mobile.json.d.ts +3 -3
  546. package/index.cjs +129 -129
  547. package/index.cjs.js +135 -135
  548. package/index.d.cts +232 -232
  549. package/index.d.ts +232 -232
  550. package/index.es6.exports/PhoneNumberSearch.js +13 -13
  551. package/index.es6.exports/findPhoneNumbers.js +7 -7
  552. package/index.es6.exports/format.js +7 -7
  553. package/index.es6.exports/getNumberType.js +7 -7
  554. package/index.es6.exports/isPossibleNumber.js +9 -9
  555. package/index.es6.exports/isValidNumber.js +9 -9
  556. package/index.es6.exports/isValidNumberForRegion.js +7 -7
  557. package/index.es6.exports/parse.js +7 -7
  558. package/index.es6.exports/searchPhoneNumbers.js +7 -7
  559. package/index.es6.js +5 -5
  560. package/index.js +72 -72
  561. package/max/es6/exports/AsYouType.js +11 -11
  562. package/max/es6/exports/Metadata.js +11 -11
  563. package/max/es6/exports/PhoneNumber.js +11 -11
  564. package/max/es6/exports/PhoneNumberMatcher.js +11 -11
  565. package/max/es6/exports/findNumbers.js +5 -5
  566. package/max/es6/exports/findPhoneNumbersInText.js +5 -5
  567. package/max/es6/exports/formatIncompletePhoneNumber.js +5 -5
  568. package/max/es6/exports/getCountries.js +5 -5
  569. package/max/es6/exports/getCountryCallingCode.js +5 -5
  570. package/max/es6/exports/getExampleNumber.js +5 -5
  571. package/max/es6/exports/getExtPrefix.js +5 -5
  572. package/max/es6/exports/isPossiblePhoneNumber.js +5 -5
  573. package/max/es6/exports/isSupportedCountry.js +5 -5
  574. package/max/es6/exports/isValidPhoneNumber.js +5 -5
  575. package/max/es6/exports/parsePhoneNumber.js +6 -6
  576. package/max/es6/exports/parsePhoneNumberWithError.js +7 -7
  577. package/max/es6/exports/searchNumbers.js +5 -5
  578. package/max/es6/exports/searchPhoneNumbersInText.js +5 -5
  579. package/max/es6/exports/validatePhoneNumberLength.js +5 -5
  580. package/max/es6/exports/withMetadataArgument.js +12 -12
  581. package/max/es6/index.d.cts +2 -2
  582. package/max/es6/index.d.ts +2 -2
  583. package/max/es6/index.js +44 -44
  584. package/max/es6/package.json +12 -12
  585. package/max/exports/AsYouType.js +11 -11
  586. package/max/exports/Metadata.js +11 -11
  587. package/max/exports/PhoneNumber.js +21 -21
  588. package/max/exports/PhoneNumberMatcher.js +11 -11
  589. package/max/exports/findNumbers.js +5 -5
  590. package/max/exports/findPhoneNumbersInText.js +5 -5
  591. package/max/exports/formatIncompletePhoneNumber.js +5 -5
  592. package/max/exports/getCountries.js +5 -5
  593. package/max/exports/getCountryCallingCode.js +5 -5
  594. package/max/exports/getExampleNumber.js +5 -5
  595. package/max/exports/getExtPrefix.js +5 -5
  596. package/max/exports/isPossiblePhoneNumber.js +5 -5
  597. package/max/exports/isSupportedCountry.js +5 -5
  598. package/max/exports/isValidPhoneNumber.js +5 -5
  599. package/max/exports/parsePhoneNumber.js +5 -5
  600. package/max/exports/parsePhoneNumberWithError.js +6 -6
  601. package/max/exports/searchNumbers.js +5 -5
  602. package/max/exports/searchPhoneNumbersInText.js +5 -5
  603. package/max/exports/validatePhoneNumberLength.js +5 -5
  604. package/max/exports/withMetadataArgument.js +8 -8
  605. package/max/index.cjs +113 -113
  606. package/max/index.cjs.js +118 -118
  607. package/max/index.d.cts +137 -137
  608. package/max/index.d.ts +137 -137
  609. package/max/index.js +44 -44
  610. package/max/metadata/metadata.max.json +1 -1
  611. package/max/metadata/metadata.max.json.d.cts +4 -4
  612. package/max/metadata/metadata.max.json.d.ts +4 -4
  613. package/max/metadata/metadata.max.json.js +1 -1
  614. package/max/metadata/package.json +16 -16
  615. package/max/package.json +14 -14
  616. package/metadata.full.json +1 -1
  617. package/metadata.full.json.d.cts +4 -4
  618. package/metadata.full.json.d.ts +4 -4
  619. package/metadata.full.json.js +1 -1
  620. package/metadata.max.json +1 -1
  621. package/metadata.max.json.d.cts +4 -4
  622. package/metadata.max.json.d.ts +4 -4
  623. package/metadata.max.json.js +1 -1
  624. package/metadata.min.json +1 -1
  625. package/metadata.min.json.d.cts +4 -4
  626. package/metadata.min.json.d.ts +4 -4
  627. package/metadata.min.json.js +1 -1
  628. package/metadata.mobile.json +1 -1
  629. package/metadata.mobile.json.d.cts +4 -4
  630. package/metadata.mobile.json.d.ts +4 -4
  631. package/metadata.mobile.json.js +1 -1
  632. package/min/es6/exports/AsYouType.js +11 -11
  633. package/min/es6/exports/Metadata.js +11 -11
  634. package/min/es6/exports/PhoneNumber.js +11 -11
  635. package/min/es6/exports/PhoneNumberMatcher.js +11 -11
  636. package/min/es6/exports/findNumbers.js +5 -5
  637. package/min/es6/exports/findPhoneNumbersInText.js +5 -5
  638. package/min/es6/exports/formatIncompletePhoneNumber.js +5 -5
  639. package/min/es6/exports/getCountries.js +5 -5
  640. package/min/es6/exports/getCountryCallingCode.js +5 -5
  641. package/min/es6/exports/getExampleNumber.js +5 -5
  642. package/min/es6/exports/getExtPrefix.js +5 -5
  643. package/min/es6/exports/isPossiblePhoneNumber.js +5 -5
  644. package/min/es6/exports/isSupportedCountry.js +5 -5
  645. package/min/es6/exports/isValidPhoneNumber.js +5 -5
  646. package/min/es6/exports/parsePhoneNumber.js +6 -6
  647. package/min/es6/exports/parsePhoneNumberWithError.js +7 -7
  648. package/min/es6/exports/searchNumbers.js +5 -5
  649. package/min/es6/exports/searchPhoneNumbersInText.js +5 -5
  650. package/min/es6/exports/validatePhoneNumberLength.js +5 -5
  651. package/min/es6/exports/withMetadataArgument.js +12 -12
  652. package/min/es6/index.d.cts +2 -2
  653. package/min/es6/index.d.ts +2 -2
  654. package/min/es6/index.js +44 -44
  655. package/min/es6/package.json +12 -12
  656. package/min/exports/AsYouType.js +11 -11
  657. package/min/exports/Metadata.js +11 -11
  658. package/min/exports/PhoneNumber.js +21 -21
  659. package/min/exports/PhoneNumberMatcher.js +11 -11
  660. package/min/exports/findNumbers.js +5 -5
  661. package/min/exports/findPhoneNumbersInText.js +5 -5
  662. package/min/exports/formatIncompletePhoneNumber.js +5 -5
  663. package/min/exports/getCountries.js +5 -5
  664. package/min/exports/getCountryCallingCode.js +5 -5
  665. package/min/exports/getExampleNumber.js +5 -5
  666. package/min/exports/getExtPrefix.js +5 -5
  667. package/min/exports/isPossiblePhoneNumber.js +5 -5
  668. package/min/exports/isSupportedCountry.js +5 -5
  669. package/min/exports/isValidPhoneNumber.js +5 -5
  670. package/min/exports/parsePhoneNumber.js +5 -5
  671. package/min/exports/parsePhoneNumberWithError.js +6 -6
  672. package/min/exports/searchNumbers.js +5 -5
  673. package/min/exports/searchPhoneNumbersInText.js +5 -5
  674. package/min/exports/validatePhoneNumberLength.js +5 -5
  675. package/min/exports/withMetadataArgument.js +8 -8
  676. package/min/index.cjs +124 -124
  677. package/min/index.cjs.js +129 -129
  678. package/min/index.d.cts +137 -137
  679. package/min/index.d.ts +137 -137
  680. package/min/index.js +43 -43
  681. package/min/metadata/metadata.min.json +1 -1
  682. package/min/metadata/metadata.min.json.d.cts +4 -4
  683. package/min/metadata/metadata.min.json.d.ts +4 -4
  684. package/min/metadata/metadata.min.json.js +1 -1
  685. package/min/metadata/package.json +16 -16
  686. package/min/package.json +14 -14
  687. package/mobile/es6/exports/AsYouType.js +11 -11
  688. package/mobile/es6/exports/Metadata.js +11 -11
  689. package/mobile/es6/exports/PhoneNumber.js +11 -11
  690. package/mobile/es6/exports/PhoneNumberMatcher.js +11 -11
  691. package/mobile/es6/exports/findNumbers.js +5 -5
  692. package/mobile/es6/exports/findPhoneNumbersInText.js +5 -5
  693. package/mobile/es6/exports/formatIncompletePhoneNumber.js +5 -5
  694. package/mobile/es6/exports/getCountries.js +5 -5
  695. package/mobile/es6/exports/getCountryCallingCode.js +5 -5
  696. package/mobile/es6/exports/getExampleNumber.js +5 -5
  697. package/mobile/es6/exports/getExtPrefix.js +5 -5
  698. package/mobile/es6/exports/isPossiblePhoneNumber.js +5 -5
  699. package/mobile/es6/exports/isSupportedCountry.js +5 -5
  700. package/mobile/es6/exports/isValidPhoneNumber.js +5 -5
  701. package/mobile/es6/exports/parsePhoneNumber.js +6 -6
  702. package/mobile/es6/exports/parsePhoneNumberWithError.js +7 -7
  703. package/mobile/es6/exports/searchNumbers.js +5 -5
  704. package/mobile/es6/exports/searchPhoneNumbersInText.js +5 -5
  705. package/mobile/es6/exports/validatePhoneNumberLength.js +5 -5
  706. package/mobile/es6/exports/withMetadataArgument.js +12 -12
  707. package/mobile/es6/index.d.cts +2 -2
  708. package/mobile/es6/index.d.ts +2 -2
  709. package/mobile/es6/index.js +44 -44
  710. package/mobile/es6/package.json +12 -12
  711. package/mobile/examples/examples.mobile.json.d.cts +3 -3
  712. package/mobile/examples/examples.mobile.json.d.ts +3 -3
  713. package/mobile/examples/package.json +16 -16
  714. package/mobile/exports/AsYouType.js +11 -11
  715. package/mobile/exports/Metadata.js +11 -11
  716. package/mobile/exports/PhoneNumber.js +21 -21
  717. package/mobile/exports/PhoneNumberMatcher.js +11 -11
  718. package/mobile/exports/findNumbers.js +5 -5
  719. package/mobile/exports/findPhoneNumbersInText.js +5 -5
  720. package/mobile/exports/formatIncompletePhoneNumber.js +5 -5
  721. package/mobile/exports/getCountries.js +5 -5
  722. package/mobile/exports/getCountryCallingCode.js +5 -5
  723. package/mobile/exports/getExampleNumber.js +5 -5
  724. package/mobile/exports/getExtPrefix.js +5 -5
  725. package/mobile/exports/isPossiblePhoneNumber.js +5 -5
  726. package/mobile/exports/isSupportedCountry.js +5 -5
  727. package/mobile/exports/isValidPhoneNumber.js +5 -5
  728. package/mobile/exports/parsePhoneNumber.js +5 -5
  729. package/mobile/exports/parsePhoneNumberWithError.js +6 -6
  730. package/mobile/exports/searchNumbers.js +5 -5
  731. package/mobile/exports/searchPhoneNumbersInText.js +5 -5
  732. package/mobile/exports/validatePhoneNumberLength.js +5 -5
  733. package/mobile/exports/withMetadataArgument.js +8 -8
  734. package/mobile/index.cjs +113 -113
  735. package/mobile/index.cjs.js +118 -118
  736. package/mobile/index.d.cts +137 -137
  737. package/mobile/index.d.ts +137 -137
  738. package/mobile/index.js +44 -44
  739. package/mobile/metadata/metadata.mobile.json +1 -1
  740. package/mobile/metadata/metadata.mobile.json.d.cts +4 -4
  741. package/mobile/metadata/metadata.mobile.json.d.ts +4 -4
  742. package/mobile/metadata/metadata.mobile.json.js +1 -1
  743. package/mobile/metadata/package.json +16 -16
  744. package/mobile/package.json +14 -14
  745. package/package.json +202 -202
  746. package/source/AsYouType.js +539 -539
  747. package/source/AsYouTypeFormatter.PatternMatcher.d.ts +66 -66
  748. package/source/AsYouTypeFormatter.PatternMatcher.js +196 -196
  749. package/source/AsYouTypeFormatter.PatternParser.d.ts +58 -58
  750. package/source/AsYouTypeFormatter.PatternParser.js +213 -213
  751. package/source/AsYouTypeFormatter.complete.js +134 -134
  752. package/source/AsYouTypeFormatter.js +713 -713
  753. package/source/AsYouTypeFormatter.util.js +99 -99
  754. package/source/AsYouTypeParser.js +519 -519
  755. package/source/AsYouTypeState.js +123 -123
  756. package/source/ParseError.js +13 -13
  757. package/source/PhoneNumber.js +161 -161
  758. package/source/PhoneNumberMatcher.js +398 -398
  759. package/source/constants.js +30 -30
  760. package/source/findNumbers/LRUCache.js +106 -106
  761. package/source/findNumbers/Leniency.js +407 -407
  762. package/source/findNumbers/RegExpCache.js +19 -19
  763. package/source/findNumbers/isValidCandidate.js +85 -85
  764. package/source/findNumbers/isValidPreCandidate.js +28 -28
  765. package/source/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +63 -63
  766. package/source/findNumbers/parsePreCandidate.js +18 -18
  767. package/source/findNumbers/utf-8.js +81 -81
  768. package/source/findNumbers/util.js +33 -33
  769. package/source/findPhoneNumbersInText.js +11 -11
  770. package/source/format.js +235 -235
  771. package/source/formatIncompletePhoneNumber.js +16 -16
  772. package/source/formatPhoneNumberForMobileDialing.js +224 -224
  773. package/source/getCountries.js +4 -4
  774. package/source/getCountryCallingCode.js +1 -1
  775. package/source/getExampleNumber.js +6 -6
  776. package/source/helpers/RFC3966.js +58 -58
  777. package/source/helpers/applyInternationalSeparatorStyle.js +34 -34
  778. package/source/helpers/checkNumberLength.js +133 -133
  779. package/source/helpers/extension/createExtensionPattern.js +111 -111
  780. package/source/helpers/extension/extractExtension.js +28 -28
  781. package/source/helpers/extractCountryCallingCode.js +160 -160
  782. package/source/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +83 -83
  783. package/source/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +73 -73
  784. package/source/helpers/extractNationalNumber.js +123 -123
  785. package/source/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +103 -103
  786. package/source/helpers/extractPhoneContext.js +102 -102
  787. package/source/helpers/formatNationalNumberUsingFormat.js +45 -45
  788. package/source/helpers/getCountryAndCallingCodeFromOneOfThem.js +30 -30
  789. package/source/helpers/getCountryByCallingCode.js +32 -32
  790. package/source/helpers/getCountryByNationalNumber.js +75 -75
  791. package/source/helpers/getIddPrefix.js +25 -25
  792. package/source/helpers/getNumberType.js +101 -101
  793. package/source/helpers/getPossibleCountriesForNumber.js +24 -24
  794. package/source/helpers/isCallingCode.js +5 -5
  795. package/source/helpers/isCountryCode.js +5 -5
  796. package/source/helpers/isObject.js +5 -5
  797. package/source/helpers/isViablePhoneNumber.js +107 -107
  798. package/source/helpers/matchesEntirely.js +10 -10
  799. package/source/helpers/mergeArrays.js +23 -23
  800. package/source/helpers/parseDigits.js +81 -81
  801. package/source/helpers/stripIddPrefix.js +35 -35
  802. package/source/isPossible.js +84 -84
  803. package/source/isPossiblePhoneNumber.js +11 -11
  804. package/source/isValid.js +58 -58
  805. package/source/isValidPhoneNumber.js +11 -11
  806. package/source/legacy/PhoneNumberSearch.js +121 -121
  807. package/source/legacy/findNumbers.js +11 -11
  808. package/source/legacy/findPhoneNumbers.js +19 -19
  809. package/source/legacy/findPhoneNumbersInitialImplementation.js +81 -81
  810. package/source/legacy/format.js +116 -116
  811. package/source/legacy/getNumberType.js +120 -120
  812. package/source/legacy/isPossibleNumber.js +24 -24
  813. package/source/legacy/isValidNumber.js +11 -11
  814. package/source/legacy/isValidNumberForRegion.js +61 -61
  815. package/source/legacy/isValidNumberForRegion_.js +12 -12
  816. package/source/legacy/parse.js +6 -6
  817. package/source/legacy/searchNumbers.js +30 -30
  818. package/source/metadata.js +580 -580
  819. package/source/normalizeArguments.js +54 -54
  820. package/source/parse.js +403 -403
  821. package/source/parseIncompletePhoneNumber.js +68 -68
  822. package/source/parsePhoneNumber.js +7 -7
  823. package/source/parsePhoneNumberWithError.js +6 -6
  824. package/source/parsePhoneNumberWithError_.js +4 -4
  825. package/source/parsePhoneNumber_.js +24 -24
  826. package/source/searchPhoneNumbersInText.js +23 -23
  827. package/source/tools/semver-compare.js +25 -25
  828. package/source/validatePhoneNumberLength.js +30 -30
  829. package/types.d.cts +181 -181
  830. package/types.d.ts +181 -181
@@ -9,9 +9,9 @@ import getCountryByNationalNumber from './helpers/getCountryByNationalNumber.js'
9
9
  import isObject from './helpers/isObject.js';
10
10
  const USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;
11
11
  export default class AsYouType {
12
- /**
13
- * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.
14
- * @param {Object} metadata
12
+ /**
13
+ * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.
14
+ * @param {Object} metadata
15
15
  */
16
16
  constructor(optionsOrDefaultCountry, metadata) {
17
17
  // Metadata instance is created once and stays constant.
@@ -53,10 +53,10 @@ export default class AsYouType {
53
53
  return [defaultCountry, defaultCallingCode];
54
54
  }
55
55
 
56
- /**
57
- * Inputs "next" phone number characters.
58
- * @param {string} text
59
- * @return {string} Formatted phone number characters that have been input so far.
56
+ /**
57
+ * Inputs "next" phone number characters.
58
+ * @param {string} text
59
+ * @return {string} Formatted phone number characters that have been input so far.
60
60
  */
61
61
  input(text) {
62
62
  const {
@@ -128,20 +128,20 @@ export default class AsYouType {
128
128
  return this;
129
129
  }
130
130
 
131
- /**
132
- * Returns `true` if the phone number is being input in international format.
133
- * In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
134
- * @return {boolean}
131
+ /**
132
+ * Returns `true` if the phone number is being input in international format.
133
+ * In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
134
+ * @return {boolean}
135
135
  */
136
136
  isInternational() {
137
137
  return this.state.international;
138
138
  }
139
139
 
140
- /**
141
- * Returns the "calling code" part of the phone number when it's being input
142
- * in an international format.
143
- * If no valid calling code has been entered so far, returns `undefined`.
144
- * @return {string} [callingCode]
140
+ /**
141
+ * Returns the "calling code" part of the phone number when it's being input
142
+ * in an international format.
143
+ * If no valid calling code has been entered so far, returns `undefined`.
144
+ * @return {string} [callingCode]
145
145
  */
146
146
  getCallingCode() {
147
147
  // If the number is being input in national format and some "default calling code"
@@ -162,11 +162,11 @@ export default class AsYouType {
162
162
  return this.getCallingCode();
163
163
  }
164
164
 
165
- /**
166
- * Returns a two-letter country code of the phone number.
167
- * Returns `undefined` for "non-geographic" phone numbering plans.
168
- * Returns `undefined` if no phone number has been input yet.
169
- * @return {string} [country]
165
+ /**
166
+ * Returns a two-letter country code of the phone number.
167
+ * Returns `undefined` for "non-geographic" phone numbering plans.
168
+ * Returns `undefined` if no phone number has been input yet.
169
+ * @return {string} [country]
170
170
  */
171
171
  getCountry() {
172
172
  const {
@@ -178,10 +178,10 @@ export default class AsYouType {
178
178
  }
179
179
  }
180
180
 
181
- /**
182
- * Returns a two-letter country code of the phone number.
183
- * Returns `undefined` for "non-geographic" phone numbering plans.
184
- * @return {string} [country]
181
+ /**
182
+ * Returns a two-letter country code of the phone number.
183
+ * Returns `undefined` for "non-geographic" phone numbering plans.
184
+ * @return {string} [country]
185
185
  */
186
186
  _getCountry() {
187
187
  const {
@@ -303,23 +303,23 @@ export default class AsYouType {
303
303
  }
304
304
  }
305
305
 
306
- /**
307
- * Returns a E.164 phone number value for the user's input.
308
- *
309
- * For example, for country `"US"` and input `"(222) 333-4444"`
310
- * it will return `"+12223334444"`.
311
- *
312
- * For international phone number input, it will also auto-correct
313
- * some minor errors such as using a national prefix when writing
314
- * an international phone number. For example, if the user inputs
315
- * `"+44 0 7400 000000"` then it will return an auto-corrected
316
- * `"+447400000000"` phone number value.
317
- *
318
- * Will return `undefined` if no digits have been input,
319
- * or when inputting a phone number in national format and no
320
- * default country or default "country calling code" have been set.
321
- *
322
- * @return {string} [value]
306
+ /**
307
+ * Returns a E.164 phone number value for the user's input.
308
+ *
309
+ * For example, for country `"US"` and input `"(222) 333-4444"`
310
+ * it will return `"+12223334444"`.
311
+ *
312
+ * For international phone number input, it will also auto-correct
313
+ * some minor errors such as using a national prefix when writing
314
+ * an international phone number. For example, if the user inputs
315
+ * `"+44 0 7400 000000"` then it will return an auto-corrected
316
+ * `"+447400000000"` phone number value.
317
+ *
318
+ * Will return `undefined` if no digits have been input,
319
+ * or when inputting a phone number in national format and no
320
+ * default country or default "country calling code" have been set.
321
+ *
322
+ * @return {string} [value]
323
323
  */
324
324
  getNumberValue() {
325
325
  const {
@@ -347,11 +347,11 @@ export default class AsYouType {
347
347
  }
348
348
  }
349
349
 
350
- /**
351
- * Returns an instance of `PhoneNumber` class.
352
- * Will return `undefined` if no national (significant) number
353
- * digits have been entered so far, or if no `defaultCountry` has been
354
- * set and the user enters a phone number not in international format.
350
+ /**
351
+ * Returns an instance of `PhoneNumber` class.
352
+ * Will return `undefined` if no national (significant) number
353
+ * digits have been entered so far, or if no `defaultCountry` has been
354
+ * set and the user enters a phone number not in international format.
355
355
  */
356
356
  getNumber() {
357
357
  const {
@@ -424,10 +424,10 @@ export default class AsYouType {
424
424
  return phoneNumber;
425
425
  }
426
426
 
427
- /**
428
- * Returns `true` if the phone number is "possible".
429
- * Is just a shortcut for `PhoneNumber.isPossible()`.
430
- * @return {boolean}
427
+ /**
428
+ * Returns `true` if the phone number is "possible".
429
+ * Is just a shortcut for `PhoneNumber.isPossible()`.
430
+ * @return {boolean}
431
431
  */
432
432
  isPossible() {
433
433
  const phoneNumber = this.getNumber();
@@ -437,10 +437,10 @@ export default class AsYouType {
437
437
  return phoneNumber.isPossible();
438
438
  }
439
439
 
440
- /**
441
- * Returns `true` if the phone number is "valid".
442
- * Is just a shortcut for `PhoneNumber.isValid()`.
443
- * @return {boolean}
440
+ /**
441
+ * Returns `true` if the phone number is "valid".
442
+ * Is just a shortcut for `PhoneNumber.isValid()`.
443
+ * @return {boolean}
444
444
  */
445
445
  isValid() {
446
446
  const phoneNumber = this.getNumber();
@@ -450,11 +450,11 @@ export default class AsYouType {
450
450
  return phoneNumber.isValid();
451
451
  }
452
452
 
453
- /**
454
- * Checks if the phone number length is valid.
455
- * If it is, nothing is returned.
456
- * Otherwise, a rejection reason is returned.
457
- * @return {string?}
453
+ /**
454
+ * Checks if the phone number length is valid.
455
+ * If it is, nothing is returned.
456
+ * Otherwise, a rejection reason is returned.
457
+ * @return {string?}
458
458
  */
459
459
  validateLength() {
460
460
  const {
@@ -482,26 +482,26 @@ export default class AsYouType {
482
482
  }
483
483
  }
484
484
 
485
- /**
486
- * @deprecated
487
- * This method is used in `react-phone-number-input/source/input-control.js`
488
- * in versions before `3.0.16`.
485
+ /**
486
+ * @deprecated
487
+ * This method is used in `react-phone-number-input/source/input-control.js`
488
+ * in versions before `3.0.16`.
489
489
  */
490
490
  getNationalNumber() {
491
491
  return this.state.nationalSignificantNumber;
492
492
  }
493
493
 
494
- /**
495
- * Returns the phone number characters entered by the user.
496
- * @return {string}
494
+ /**
495
+ * Returns the phone number characters entered by the user.
496
+ * @return {string}
497
497
  */
498
498
  getChars() {
499
499
  return (this.state.international ? '+' : '') + this.state.digits;
500
500
  }
501
501
 
502
- /**
503
- * Returns the template for the formatted phone number.
504
- * @return {string}
502
+ /**
503
+ * Returns the template for the formatted phone number.
504
+ * @return {string}
505
505
  */
506
506
  getTemplate() {
507
507
  return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || '';
@@ -1 +1 @@
1
- {"version":3,"file":"AsYouType.js","names":["Metadata","PhoneNumber","checkNumberLength","AsYouTypeState","AsYouTypeFormatter","DIGIT_PLACEHOLDER","AsYouTypeParser","extractFormattedDigitsAndPlus","getCountryByCallingCode","getCountryByNationalNumber","isObject","USE_NON_GEOGRAPHIC_COUNTRY_CODE","AsYouType","constructor","optionsOrDefaultCountry","metadata","defaultCountry","defaultCallingCode","getCountryAndCallingCode","reset","hasCountry","undefined","isNonGeographicCallingCode","input","text","digits","justLeadingPlus","parser","state","formattedOutput","determineTheCountryIfNeeded","nationalSignificantNumber","formatter","narrowDownMatchingFormats","formattedNationalNumber","hasSelectedNumberingPlan","format","reExtractNationalSignificantNumber","nationalDigits","getNationalDigits","getFullNumber","getNonFormattedNumber","onCountryChange","country","onCallingCodeChange","callingCode","selectNumberingPlan","numberingPlan","onNationalSignificantNumberChange","isInternational","international","getCallingCode","getCountryCallingCode","getCountry","_getCountry","isCountryCallingCodeAmbiguous","determineTheCountry","prefix","getInternationalPrefixBeforeCountryCallingCode","spacing","getDigitsWithoutInternationalPrefix","getNonFormattedNationalNumberWithPrefix","prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix","nationalPrefix","number","nationalSignificantNumberIsModified","getNonFormattedTemplate","replace","countryCodes","getCountryCodesForCallingCode","length","nationalNumber","setCountry","getNumberValue","callingCode_","countryCallingCode","getNumber","carrierCode","exactCountry","getExactCountryForMultiCountryCallingCode","phoneNumber","isPossible","isValid","validateLength","result","getNationalNumber","getChars","getTemplate","ambiguousCountries"],"sources":["../source/AsYouType.js"],"sourcesContent":["import Metadata from './metadata.js'\r\nimport PhoneNumber from './PhoneNumber.js'\r\nimport checkNumberLength from './helpers/checkNumberLength.js'\r\nimport AsYouTypeState from './AsYouTypeState.js'\r\nimport AsYouTypeFormatter, { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.js'\r\nimport AsYouTypeParser, { extractFormattedDigitsAndPlus } from './AsYouTypeParser.js'\r\nimport getCountryByCallingCode from './helpers/getCountryByCallingCode.js'\r\nimport getCountryByNationalNumber from './helpers/getCountryByNationalNumber.js'\r\nimport isObject from './helpers/isObject.js'\r\n\r\nconst USE_NON_GEOGRAPHIC_COUNTRY_CODE = false\r\n\r\nexport default class AsYouType {\r\n\t/**\r\n\t * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.\r\n\t * @param {Object} metadata\r\n\t */\r\n\tconstructor(optionsOrDefaultCountry, metadata) {\r\n\t\t// Metadata instance is created once and stays constant.\r\n\t\t// This is required because other utility classes such as `AsYouTypeFormatter`\r\n\t\t// will use this metadata instance \"reference\" and will assume that it stays constant.\r\n\t\tthis.metadata = new Metadata(metadata)\r\n\t\tconst [defaultCountry, defaultCallingCode] = this.getCountryAndCallingCode(optionsOrDefaultCountry)\r\n\t\t// `this.defaultCountry` and `this.defaultCallingCode` aren't required to be in sync.\r\n\t\t// For example, `this.defaultCountry` could be `\"AR\"` and `this.defaultCallingCode` could be `undefined`.\r\n\t\t// So `this.defaultCountry` and `this.defaultCallingCode` are totally independent.\r\n\t\tthis.defaultCountry = defaultCountry\r\n\t\tthis.defaultCallingCode = defaultCallingCode\r\n\t\tthis.reset()\r\n\t}\r\n\r\n\tgetCountryAndCallingCode(optionsOrDefaultCountry) {\r\n\t\t// Set `defaultCountry` and `defaultCallingCode` options.\r\n\t\tlet defaultCountry\r\n\t\tlet defaultCallingCode\r\n\t\t// Turns out `null` also has type \"object\". Weird.\r\n\t\tif (optionsOrDefaultCountry) {\r\n\t\t\tif (isObject(optionsOrDefaultCountry)) {\r\n\t\t\t\tdefaultCountry = optionsOrDefaultCountry.defaultCountry\r\n\t\t\t\tdefaultCallingCode = optionsOrDefaultCountry.defaultCallingCode\r\n\t\t\t} else {\r\n\t\t\t\tdefaultCountry = optionsOrDefaultCountry\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {\r\n\t\t\tdefaultCountry = undefined\r\n\t\t}\r\n\t\tif (defaultCallingCode) {\r\n\t\t\t/* istanbul ignore if */\r\n\t\t\tif (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\r\n\t\t\t\tif (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) {\r\n\t\t\t\t\tdefaultCountry = '001'\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn [defaultCountry, defaultCallingCode]\r\n\t}\r\n\r\n\t/**\r\n\t * Inputs \"next\" phone number characters.\r\n\t * @param {string} text\r\n\t * @return {string} Formatted phone number characters that have been input so far.\r\n\t */\r\n\tinput(text) {\r\n\t\tconst {\r\n\t\t\tdigits,\r\n\t\t\tjustLeadingPlus\r\n\t\t} = this.parser.input(text, this.state)\r\n\t\tif (justLeadingPlus) {\r\n\t\t\tthis.formattedOutput = '+'\r\n\t\t} else if (digits) {\r\n\t\t\tthis.determineTheCountryIfNeeded()\r\n\t\t\t// Match the available formats by the currently available leading digits.\r\n\t\t\tif (this.state.nationalSignificantNumber) {\r\n\t\t\t\tthis.formatter.narrowDownMatchingFormats(this.state)\r\n\t\t\t}\r\n\t\t\tlet formattedNationalNumber\r\n\t\t\tif (this.metadata.hasSelectedNumberingPlan()) {\r\n\t\t\t\tformattedNationalNumber = this.formatter.format(digits, this.state)\r\n\t\t\t}\r\n\t\t\tif (formattedNationalNumber === undefined) {\r\n\t\t\t\t// See if another national (significant) number could be re-extracted.\r\n\t\t\t\tif (this.parser.reExtractNationalSignificantNumber(this.state)) {\r\n\t\t\t\t\tthis.determineTheCountryIfNeeded()\r\n\t\t\t\t\t// If it could, then re-try formatting the new national (significant) number.\r\n\t\t\t\t\tconst nationalDigits = this.state.getNationalDigits()\r\n\t\t\t\t\tif (nationalDigits) {\r\n\t\t\t\t\t\tformattedNationalNumber = this.formatter.format(nationalDigits, this.state)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.formattedOutput = formattedNationalNumber\r\n\t\t\t\t? this.getFullNumber(formattedNationalNumber)\r\n\t\t\t\t: this.getNonFormattedNumber()\r\n\t\t}\r\n\t\treturn this.formattedOutput\r\n\t}\r\n\r\n\treset() {\r\n\t\tthis.state = new AsYouTypeState({\r\n\t\t\tonCountryChange: (country) => {\r\n\t\t\t\t// Before version `1.6.0`, the official `AsYouType` formatter API\r\n\t\t\t\t// included a `.country` property on an `AsYouType` instance.\r\n\t\t\t\t// Since that property (along with the others) have been moved to\r\n\t\t\t\t// `this.state`, `this.country` property is emulated for compatibility\r\n\t\t\t\t// with the old versions.\r\n\t\t\t\tthis.country = country\r\n\t\t\t},\r\n\t\t\tonCallingCodeChange: (callingCode, country) => {\r\n\t\t\t\tthis.metadata.selectNumberingPlan(country || callingCode)\r\n\t\t\t\tthis.formatter.reset(this.metadata.numberingPlan, this.state)\r\n\t\t\t\tthis.parser.reset(this.metadata.numberingPlan)\r\n\t\t\t}\r\n\t\t})\r\n\t\tthis.formatter = new AsYouTypeFormatter({\r\n\t\t\tstate: this.state,\r\n\t\t\tmetadata: this.metadata\r\n\t\t})\r\n\t\tthis.parser = new AsYouTypeParser({\r\n\t\t\tdefaultCountry: this.defaultCountry,\r\n\t\t\tdefaultCallingCode: this.defaultCallingCode,\r\n\t\t\tmetadata: this.metadata,\r\n\t\t\tstate: this.state,\r\n\t\t\tonNationalSignificantNumberChange: () => {\r\n\t\t\t\tthis.determineTheCountryIfNeeded()\r\n\t\t\t\tthis.formatter.reset(this.metadata.numberingPlan, this.state)\r\n\t\t\t}\r\n\t\t})\r\n\t\tthis.state.reset({\r\n\t\t\tcountry: this.defaultCountry,\r\n\t\t\tcallingCode: this.defaultCallingCode\r\n\t\t})\r\n\t\tthis.formattedOutput = ''\r\n\t\treturn this\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if the phone number is being input in international format.\r\n\t * In other words, returns `true` if and only if the parsed phone number starts with a `\"+\"`.\r\n\t * @return {boolean}\r\n\t */\r\n\tisInternational() {\r\n\t\treturn this.state.international\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the \"calling code\" part of the phone number when it's being input\r\n\t * in an international format.\r\n\t * If no valid calling code has been entered so far, returns `undefined`.\r\n\t * @return {string} [callingCode]\r\n\t */\r\n\tgetCallingCode() {\r\n\t\t // If the number is being input in national format and some \"default calling code\"\r\n\t\t // has been passed to `AsYouType` constructor, then `this.state.callingCode`\r\n\t\t // is equal to that \"default calling code\".\r\n\t\t //\r\n\t\t // If the number is being input in national format and no \"default calling code\"\r\n\t\t // has been passed to `AsYouType` constructor, then returns `undefined`,\r\n\t\t // even if a \"default country\" has been passed to `AsYouType` constructor.\r\n\t\t //\r\n\t\tif (this.isInternational()) {\r\n\t\t\treturn this.state.callingCode\r\n\t\t}\r\n\t}\r\n\r\n\t// A legacy alias.\r\n\tgetCountryCallingCode() {\r\n\t\treturn this.getCallingCode()\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a two-letter country code of the phone number.\r\n\t * Returns `undefined` for \"non-geographic\" phone numbering plans.\r\n\t * Returns `undefined` if no phone number has been input yet.\r\n\t * @return {string} [country]\r\n\t */\r\n\tgetCountry() {\r\n\t\tconst { digits } = this.state\r\n\t\t// Return `undefined` if no digits have been input yet.\r\n\t\tif (digits) {\r\n\t\t\treturn this._getCountry()\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a two-letter country code of the phone number.\r\n\t * Returns `undefined` for \"non-geographic\" phone numbering plans.\r\n\t * @return {string} [country]\r\n\t */\r\n\t_getCountry() {\r\n\t\tconst { country } = this.state\r\n\t\t/* istanbul ignore if */\r\n\t\tif (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\r\n\t\t\t// `AsYouType.getCountry()` returns `undefined`\r\n\t\t\t// for \"non-geographic\" phone numbering plans.\r\n\t\t\tif (country === '001') {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn country\r\n\t}\r\n\r\n\tdetermineTheCountryIfNeeded() {\r\n\t\t// Suppose a user enters a phone number in international format,\r\n\t\t// and there're several countries corresponding to that country calling code,\r\n\t\t// and a country has been derived from the number, and then\r\n\t\t// a user enters one more digit and the number is no longer\r\n\t\t// valid for the derived country, so the country should be re-derived\r\n\t\t// on every new digit in those cases.\r\n\t\t//\r\n\t\t// If the phone number is being input in national format,\r\n\t\t// then it could be a case when `defaultCountry` wasn't specified\r\n\t\t// when creating `AsYouType` instance, and just `defaultCallingCode` was specified,\r\n\t\t// and that \"calling code\" could correspond to a \"non-geographic entity\",\r\n\t\t// or there could be several countries corresponding to that country calling code.\r\n\t\t// In those cases, `this.country` is `undefined` and should be derived\r\n\t\t// from the number. Again, if country calling code is ambiguous, then\r\n\t\t// `this.country` should be re-derived with each new digit.\r\n\t\t//\r\n\t\tif (!this.state.country || this.isCountryCallingCodeAmbiguous()) {\r\n\t\t\tthis.determineTheCountry()\r\n\t\t}\r\n\t}\r\n\r\n\t// Prepends `+CountryCode ` in case of an international phone number\r\n\tgetFullNumber(formattedNationalNumber) {\r\n\t\tif (this.isInternational()) {\r\n\t\t\tconst prefix = (text) => this.formatter.getInternationalPrefixBeforeCountryCallingCode(this.state, {\r\n\t\t\t\tspacing: text ? true : false\r\n\t\t\t}) + text\r\n\t\t\tconst { callingCode } = this.state\r\n\t\t\tif (!callingCode) {\r\n\t\t\t\treturn prefix(`${this.state.getDigitsWithoutInternationalPrefix()}`)\r\n\t\t\t}\r\n\t\t\tif (!formattedNationalNumber) {\r\n\t\t\t\treturn prefix(callingCode)\r\n\t\t\t}\r\n\t\t\treturn prefix(`${callingCode} ${formattedNationalNumber}`)\r\n\t\t}\r\n\t\treturn formattedNationalNumber\r\n\t}\r\n\r\n\tgetNonFormattedNationalNumberWithPrefix() {\r\n\t\tconst {\r\n\t\t\tnationalSignificantNumber,\r\n\t\t\tprefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,\r\n\t\t\tnationalPrefix\r\n\t\t} = this.state\r\n\t\tlet number = nationalSignificantNumber\r\n\t\tconst prefix = prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix || nationalPrefix\r\n\t\tif (prefix) {\r\n\t\t\tnumber = prefix + number\r\n\t\t}\r\n\t\treturn number\r\n\t}\r\n\r\n\tgetNonFormattedNumber() {\r\n\t\tconst { nationalSignificantNumberIsModified } = this.state\r\n\t\treturn this.getFullNumber(\r\n\t\t\tnationalSignificantNumberIsModified\r\n\t\t\t\t? this.state.getNationalDigits()\r\n\t\t\t\t: this.getNonFormattedNationalNumberWithPrefix()\r\n\t\t)\r\n\t}\r\n\r\n\tgetNonFormattedTemplate() {\r\n\t\tconst number = this.getNonFormattedNumber()\r\n\t\tif (number) {\r\n\t\t\treturn number.replace(/[\\+\\d]/g, DIGIT_PLACEHOLDER)\r\n\t\t}\r\n\t}\r\n\r\n\tisCountryCallingCodeAmbiguous() {\r\n\t\tconst { callingCode } = this.state\r\n\t\tconst countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode)\r\n\t\treturn countryCodes && countryCodes.length > 1\r\n\t}\r\n\r\n\t// Determines the exact country of the phone number\r\n\t// entered so far based on the country phone code\r\n\t// and the national phone number.\r\n\tdetermineTheCountry() {\r\n\t\t// Get a more precise country code for this national number.\r\n\t\t// It is possible that the precise country couldn't be determined\r\n\t\t// in cases when there're multiple countries sharing the same calling code.\r\n\t\t// In that case, `country` will be `undefined`.\r\n\t\tconst country = getCountryByCallingCode(\r\n\t\t\tthis.isInternational() ? this.state.callingCode : this.defaultCallingCode,\r\n\t\t\t{\r\n\t\t\t\tnationalNumber: this.state.nationalSignificantNumber,\r\n\t\t\t\tmetadata: this.metadata\r\n\t\t\t}\r\n\t\t)\r\n\t\t// If the derived country is indeed more precise,\r\n\t\t// or if no country could be derived for the updated phone number.\r\n\t\tif (country !== this.state.country) {\r\n\t\t\t// Set (or reset) the more precise country.\r\n\t\t\tthis.state.setCountry(country)\r\n\t\t\t// If a more precise country could be derived.\r\n\t\t\tif (country) {\r\n\t\t\t\t// Select a more precise telephone numbering plan.\r\n\t\t\t\t// For example, consider that `AsYouType` instance was created with `defaultCountry: \"US\"` argument.\r\n\t\t\t\t// In that case, the metadata instance will be using \"US\" metadata.\r\n\t\t\t\t// But then the user could input a Canadian phone number, in which case\r\n\t\t\t\t// the metadata instance should be switched to Canadian telephone numbering plan.\r\n\t\t\t\t// It is required to do that because later `canFormatCompleteNumber()` function will be called,\r\n\t\t\t\t// and that function relies on the precise country being pre-selected in the metadata instance.\r\n\t\t\t\t// Or, for example, `checkNumberLength()` function also relies on same thing.\r\n\t\t\t\tthis.metadata.selectNumberingPlan(country)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a E.164 phone number value for the user's input.\r\n\t *\r\n\t * For example, for country `\"US\"` and input `\"(222) 333-4444\"`\r\n\t * it will return `\"+12223334444\"`.\r\n\t *\r\n\t * For international phone number input, it will also auto-correct\r\n\t * some minor errors such as using a national prefix when writing\r\n\t * an international phone number. For example, if the user inputs\r\n\t * `\"+44 0 7400 000000\"` then it will return an auto-corrected\r\n\t * `\"+447400000000\"` phone number value.\r\n\t *\r\n\t * Will return `undefined` if no digits have been input,\r\n\t * or when inputting a phone number in national format and no\r\n\t * default country or default \"country calling code\" have been set.\r\n\t *\r\n\t * @return {string} [value]\r\n\t */\r\n\tgetNumberValue() {\r\n\t\tconst {\r\n\t\t\tdigits,\r\n\t\t\tcallingCode,\r\n\t\t\tcountry,\r\n\t\t\tnationalSignificantNumber\r\n\t\t} = this.state\r\n\r\n\t \t// Will return `undefined` if no digits have been input.\r\n\t\tif (!digits) {\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tif (this.isInternational()) {\r\n\t\t\tif (callingCode) {\r\n\t\t\t\treturn '+' + callingCode + nationalSignificantNumber\r\n\t\t\t} else {\r\n\t\t\t\treturn '+' + digits\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (country || callingCode) {\r\n\t\t\t\tconst callingCode_ = country ? this.metadata.countryCallingCode() : callingCode\r\n\t\t\t\treturn '+' + callingCode_ + nationalSignificantNumber\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an instance of `PhoneNumber` class.\r\n\t * Will return `undefined` if no national (significant) number\r\n\t * digits have been entered so far, or if no `defaultCountry` has been\r\n\t * set and the user enters a phone number not in international format.\r\n\t */\r\n\tgetNumber() {\r\n\t\tconst {\r\n\t\t\tnationalSignificantNumber,\r\n\t\t\tcarrierCode,\r\n\t\t\tcallingCode\r\n\t\t} = this.state\r\n\r\n\t\tif (!nationalSignificantNumber) {\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\t// `this._getCountry()` is basically same as `this.state.country`\r\n\t\t// with the only change that it returns `undefined` in case of a\r\n\t\t// \"non-geographic\" numbering plan instead of `\"001\"` \"internal use\" value.\r\n\t\tlet country = this._getCountry()\r\n\r\n\t\t// Sidenote:\r\n\t\t// `state.callingCode` and `state.country` are somewhat independent from one another\r\n\t\t// and there could be situations when one is defined but the other is not.\r\n\t\t// See the comment in `AsYouTypeState.js` for more info on when that is possible.\r\n\r\n\t\tif (!country && !callingCode) {\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\t// By default, if `defaultCountry` parameter was passed when\r\n\t\t// creating `AsYouType` instance, `state.country` is gonna be\r\n\t\t// that `defaultCountry`, which doesn't entirely conform with\r\n\t\t// `parsePhoneNumber()`'s behavior where it attempts to determine\r\n\t\t// the country more precisely in cases when multiple countries\r\n\t\t// could correspond to the same `countryCallingCode`.\r\n\t\t// https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103#note_1417192969\r\n\t\t//\r\n\t\t// Because `AsYouType.getNumber()` method is supposed to be a 1:1\r\n\t\t// equivalent for `parsePhoneNumber(AsYouType.getNumberValue())`,\r\n\t\t// it means that it should also behave accordingly in such cases of `country` ambiguity.\r\n\t\t// That's how users of this library would expect it to behave anyway.\r\n\t\t//\r\n\t\t// So here it checks if `state.country` is same as the `defaultCountry`,\r\n\t\t// and if it is, it attempts to get rid of any potential ambiguity.\r\n\t\t//\r\n\t\tif (country) {\r\n\t\t\tif (country === this.defaultCountry) {\r\n\t\t\t\t// // Create a `Metadata` instance just to get the calling code of the `country`.\r\n\t\t\t\t// const metadata = new Metadata(this.metadata.metadata)\r\n\t\t\t\t// // `state.callingCode` and `state.country` are somewhat independent from one another\r\n\t\t\t\t// // and there could be situations when one is defined but the other is not.\r\n\t\t\t\t// // See the comment in `AsYouTypeState.js` for more info on when that is possible.\r\n\t\t\t\t// // Here, it only passes `state.country` because there's no need to pass `state.callingCode`\r\n\t\t\t\t// // because `state.country` is known to be defined.\r\n\t\t\t\t// metadata.selectNumberingPlan(country)\r\n\t\t\t\t// const countryCallingCode = metadata.numberingPlan.callingCode()\r\n\r\n\t\t\t\t// Instead of getting `countryCallingCode` value above,\r\n\t\t\t\t// it could simply read it from the existing metadata instance.\r\n\t\t\t\tconst countryCallingCode = this.metadata.numberingPlan.callingCode()\r\n\r\n\t\t\t\t// Attempt to rule out any potential country code ambiguity, if present.\r\n\t\t\t\tconst exactCountry = getExactCountryForMultiCountryCallingCode(\r\n\t\t\t\t\tcountryCallingCode,\r\n\t\t\t\t\tnationalSignificantNumber,\r\n\t\t\t\t\tthis.metadata\r\n\t\t\t\t)\r\n\t\t\t\tif (exactCountry) {\r\n\t\t\t\t\tcountry = exactCountry\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst phoneNumber = new PhoneNumber(\r\n\t\t\tcountry || callingCode,\r\n\t\t\tnationalSignificantNumber,\r\n\t\t\tthis.metadata.metadata\r\n\t\t)\r\n\t\tif (carrierCode) {\r\n\t\t\tphoneNumber.carrierCode = carrierCode\r\n\t\t}\r\n\t\t// Phone number extensions are not supported by \"As You Type\" formatter.\r\n\t\treturn phoneNumber\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if the phone number is \"possible\".\r\n\t * Is just a shortcut for `PhoneNumber.isPossible()`.\r\n\t * @return {boolean}\r\n\t */\r\n\tisPossible() {\r\n\t\tconst phoneNumber = this.getNumber()\r\n\t\tif (!phoneNumber) {\r\n\t\t\treturn false\r\n\t\t}\r\n\t\treturn phoneNumber.isPossible()\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if the phone number is \"valid\".\r\n\t * Is just a shortcut for `PhoneNumber.isValid()`.\r\n\t * @return {boolean}\r\n\t */\r\n\tisValid() {\r\n\t\tconst phoneNumber = this.getNumber()\r\n\t\tif (!phoneNumber) {\r\n\t\t\treturn false\r\n\t\t}\r\n\t\treturn phoneNumber.isValid()\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if the phone number length is valid.\r\n\t * If it is, nothing is returned.\r\n\t * Otherwise, a rejection reason is returned.\r\n\t * @return {string?}\r\n\t */\r\n\tvalidateLength() {\r\n\t\tconst {\r\n\t\t\tdigits,\r\n\t\t\tnationalSignificantNumber\r\n\t\t} = this.state\r\n\r\n\t\tif (!digits) {\r\n\t\t\treturn 'NOT_A_NUMBER'\r\n\t\t}\r\n\r\n\t\tif (!this.metadata.numberingPlan) {\r\n\t\t\treturn 'INVALID_COUNTRY'\r\n\t\t}\r\n\r\n\t\tif (!nationalSignificantNumber) {\r\n\t\t\t return 'TOO_SHORT'\r\n\t\t}\r\n\r\n\t\t// `state.callingCode` and `state.country` are somewhat independent from one another\r\n\t\t// and there could be situations when one is defined but the other is not.\r\n\t\t// See the comment in `AsYouTypeState.js` for more info on when that is possible.\r\n\t\t// Here, it uses both: if `country` is defined then it will use that,\r\n\t\t// otherwise it will use `callingCode`.\r\n\t\tconst result = checkNumberLength(nationalSignificantNumber, undefined, this.metadata)\r\n\t\tif (result !== 'IS_POSSIBLE') {\r\n\t\t\treturn result\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @deprecated\r\n\t * This method is used in `react-phone-number-input/source/input-control.js`\r\n\t * in versions before `3.0.16`.\r\n\t */\r\n\tgetNationalNumber() {\r\n\t\treturn this.state.nationalSignificantNumber\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the phone number characters entered by the user.\r\n\t * @return {string}\r\n\t */\r\n\tgetChars() {\r\n\t\treturn (this.state.international ? '+' : '') + this.state.digits\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the template for the formatted phone number.\r\n\t * @return {string}\r\n\t */\r\n\tgetTemplate() {\r\n\t\treturn this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || ''\r\n\t}\r\n}\r\n\r\n// In situations when multiple countries use the same calling code,\r\n// this function tells what exact country does a given national (significant) number belong to.\r\nfunction getExactCountryForMultiCountryCallingCode(callingCode, nationalSignificantNumber, metadata) {\r\n\tconst ambiguousCountries = metadata.getCountryCodesForCallingCode(callingCode)\r\n\tif (ambiguousCountries.length > 1) {\r\n\t\treturn getCountryByNationalNumber(nationalSignificantNumber, ambiguousCountries, metadata.metadata)\r\n\t}\r\n}"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,eAAe;AACpC,OAAOC,WAAW,MAAM,kBAAkB;AAC1C,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,OAAOC,cAAc,MAAM,qBAAqB;AAChD,OAAOC,kBAAkB,IAAIC,iBAAiB,QAAQ,yBAAyB;AAC/E,OAAOC,eAAe,IAAIC,6BAA6B,QAAQ,sBAAsB;AACrF,OAAOC,uBAAuB,MAAM,sCAAsC;AAC1E,OAAOC,0BAA0B,MAAM,yCAAyC;AAChF,OAAOC,QAAQ,MAAM,uBAAuB;AAE5C,MAAMC,+BAA+B,GAAG,KAAK;AAE7C,eAAe,MAAMC,SAAS,CAAC;EAC9B;AACD;AACA;AACA;EACCC,WAAWA,CAACC,uBAAuB,EAAEC,QAAQ,EAAE;IAC9C;IACA;IACA;IACA,IAAI,CAACA,QAAQ,GAAG,IAAIf,QAAQ,CAACe,QAAQ,CAAC;IACtC,MAAM,CAACC,cAAc,EAAEC,kBAAkB,CAAC,GAAG,IAAI,CAACC,wBAAwB,CAACJ,uBAAuB,CAAC;IACnG;IACA;IACA;IACA,IAAI,CAACE,cAAc,GAAGA,cAAc;IACpC,IAAI,CAACC,kBAAkB,GAAGA,kBAAkB;IAC5C,IAAI,CAACE,KAAK,CAAC,CAAC;EACb;EAEAD,wBAAwBA,CAACJ,uBAAuB,EAAE;IACjD;IAC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AO,cAAc;IACtB;IAEA,IAAI,CAAC,IAAI,CAACV,QAAQ,CAACgC,aAAa,EAAE;MACjC,OAAO,iBAAiB;IACzB;IAEA,IAAI,CAAChB,yBAAyB,EAAE;MAC9B,OAAO,WAAW;IACpB;;IAEA;IACA;IACA;IACA;IACA;IACA,MAAMqD,MAAM,GAAGlF,iBAAiB,CAAC6B,yBAAyB,EAAEV,SAAS,EAAE,IAAI,CAACN,QAAQ,CAAC;IACrF,IAAIqE,MAAM,KAAK,aAAa,EAAE;MAC7B,OAAOA,MAAM;IACd;EACD;;EAEA;AACD;AACA;AACA;AACA;EACCC,iBAAiBA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACzD,KAAK,CAACG,yBAAyB;EAC5C;;EAEA;AACD;AACA;AACA;EACCuD,QAAQA,CAAA,EAAG;IACV,OAAO,CAAC,IAAI,CAAC1D,KAAK,CAACsB,aAAa,GAAG,GAAG,GAAG,EAAE,IAAI,IAAI,CAACtB,KAAK,CAACH,MAAM;EACjE;;EAEA;AACD;AACA;AACA;EACC8D,WAAWA,CAAA,EAAG;IACb,OAAO,IAAI,CAACvD,SAAS,CAACuD,WAAW,CAAC,IAAI,CAAC3D,KAAK,CAAC,IAAI,IAAI,CAACsC,uBAAuB,CAAC,CAAC,IAAI,EAAE;EACtF;AACD;;AAEA;AACA;AACA,SAASa,yCAAyCA,CAAClC,WAAW,EAAEd,yBAAyB,EAAEhB,QAAQ,EAAE;EACpG,MAAMyE,kBAAkB,GAAGzE,QAAQ,CAACsD,6BAA6B,CAACxB,WAAW,CAAC;EAC9E,IAAI2C,kBAAkB,CAAClB,MAAM,GAAG,CAAC,EAAE;IAClC,OAAO7D,0BAA0B,CAACsB,yBAAyB,EAAEyD,kBAAkB,EAAEzE,QAAQ,CAACA,QAAQ,CAAC;EACpG;AACD","ignoreList":[]}
1
+ {"version":3,"file":"AsYouType.js","names":["Metadata","PhoneNumber","checkNumberLength","AsYouTypeState","AsYouTypeFormatter","DIGIT_PLACEHOLDER","AsYouTypeParser","extractFormattedDigitsAndPlus","getCountryByCallingCode","getCountryByNationalNumber","isObject","USE_NON_GEOGRAPHIC_COUNTRY_CODE","AsYouType","constructor","optionsOrDefaultCountry","metadata","defaultCountry","defaultCallingCode","getCountryAndCallingCode","reset","hasCountry","undefined","isNonGeographicCallingCode","input","text","digits","justLeadingPlus","parser","state","formattedOutput","determineTheCountryIfNeeded","nationalSignificantNumber","formatter","narrowDownMatchingFormats","formattedNationalNumber","hasSelectedNumberingPlan","format","reExtractNationalSignificantNumber","nationalDigits","getNationalDigits","getFullNumber","getNonFormattedNumber","onCountryChange","country","onCallingCodeChange","callingCode","selectNumberingPlan","numberingPlan","onNationalSignificantNumberChange","isInternational","international","getCallingCode","getCountryCallingCode","getCountry","_getCountry","isCountryCallingCodeAmbiguous","determineTheCountry","prefix","getInternationalPrefixBeforeCountryCallingCode","spacing","getDigitsWithoutInternationalPrefix","getNonFormattedNationalNumberWithPrefix","prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix","nationalPrefix","number","nationalSignificantNumberIsModified","getNonFormattedTemplate","replace","countryCodes","getCountryCodesForCallingCode","length","nationalNumber","setCountry","getNumberValue","callingCode_","countryCallingCode","getNumber","carrierCode","exactCountry","getExactCountryForMultiCountryCallingCode","phoneNumber","isPossible","isValid","validateLength","result","getNationalNumber","getChars","getTemplate","ambiguousCountries"],"sources":["../source/AsYouType.js"],"sourcesContent":["import Metadata from './metadata.js'\nimport PhoneNumber from './PhoneNumber.js'\nimport checkNumberLength from './helpers/checkNumberLength.js'\nimport AsYouTypeState from './AsYouTypeState.js'\nimport AsYouTypeFormatter, { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.js'\nimport AsYouTypeParser, { extractFormattedDigitsAndPlus } from './AsYouTypeParser.js'\nimport getCountryByCallingCode from './helpers/getCountryByCallingCode.js'\nimport getCountryByNationalNumber from './helpers/getCountryByNationalNumber.js'\nimport isObject from './helpers/isObject.js'\n\nconst USE_NON_GEOGRAPHIC_COUNTRY_CODE = false\n\nexport default class AsYouType {\n\t/**\n\t * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.\n\t * @param {Object} metadata\n\t */\n\tconstructor(optionsOrDefaultCountry, metadata) {\n\t\t// Metadata instance is created once and stays constant.\n\t\t// This is required because other utility classes such as `AsYouTypeFormatter`\n\t\t// will use this metadata instance \"reference\" and will assume that it stays constant.\n\t\tthis.metadata = new Metadata(metadata)\n\t\tconst [defaultCountry, defaultCallingCode] = this.getCountryAndCallingCode(optionsOrDefaultCountry)\n\t\t// `this.defaultCountry` and `this.defaultCallingCode` aren't required to be in sync.\n\t\t// For example, `this.defaultCountry` could be `\"AR\"` and `this.defaultCallingCode` could be `undefined`.\n\t\t// So `this.defaultCountry` and `this.defaultCallingCode` are totally independent.\n\t\tthis.defaultCountry = defaultCountry\n\t\tthis.defaultCallingCode = defaultCallingCode\n\t\tthis.reset()\n\t}\n\n\tgetCountryAndCallingCode(optionsOrDefaultCountry) {\n\t\t// Set `defaultCountry` and `defaultCallingCode` options.\n\t\tlet defaultCountry\n\t\tlet defaultCallingCode\n\t\t// Turns out `null` also has type \"object\". Weird.\n\t\tif (optionsOrDefaultCountry) {\n\t\t\tif (isObject(optionsOrDefaultCountry)) {\n\t\t\t\tdefaultCountry = optionsOrDefaultCountry.defaultCountry\n\t\t\t\tdefaultCallingCode = optionsOrDefaultCountry.defaultCallingCode\n\t\t\t} else {\n\t\t\t\tdefaultCountry = optionsOrDefaultCountry\n\t\t\t}\n\t\t}\n\t\tif (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {\n\t\t\tdefaultCountry = undefined\n\t\t}\n\t\tif (defaultCallingCode) {\n\t\t\t/* istanbul ignore if */\n\t\t\tif (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n\t\t\t\tif (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) {\n\t\t\t\t\tdefaultCountry = '001'\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn [defaultCountry, defaultCallingCode]\n\t}\n\n\t/**\n\t * Inputs \"next\" phone number characters.\n\t * @param {string} text\n\t * @return {string} Formatted phone number characters that have been input so far.\n\t */\n\tinput(text) {\n\t\tconst {\n\t\t\tdigits,\n\t\t\tjustLeadingPlus\n\t\t} = this.parser.input(text, this.state)\n\t\tif (justLeadingPlus) {\n\t\t\tthis.formattedOutput = '+'\n\t\t} else if (digits) {\n\t\t\tthis.determineTheCountryIfNeeded()\n\t\t\t// Match the available formats by the currently available leading digits.\n\t\t\tif (this.state.nationalSignificantNumber) {\n\t\t\t\tthis.formatter.narrowDownMatchingFormats(this.state)\n\t\t\t}\n\t\t\tlet formattedNationalNumber\n\t\t\tif (this.metadata.hasSelectedNumberingPlan()) {\n\t\t\t\tformattedNationalNumber = this.formatter.format(digits, this.state)\n\t\t\t}\n\t\t\tif (formattedNationalNumber === undefined) {\n\t\t\t\t// See if another national (significant) number could be re-extracted.\n\t\t\t\tif (this.parser.reExtractNationalSignificantNumber(this.state)) {\n\t\t\t\t\tthis.determineTheCountryIfNeeded()\n\t\t\t\t\t// If it could, then re-try formatting the new national (significant) number.\n\t\t\t\t\tconst nationalDigits = this.state.getNationalDigits()\n\t\t\t\t\tif (nationalDigits) {\n\t\t\t\t\t\tformattedNationalNumber = this.formatter.format(nationalDigits, this.state)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.formattedOutput = formattedNationalNumber\n\t\t\t\t? this.getFullNumber(formattedNationalNumber)\n\t\t\t\t: this.getNonFormattedNumber()\n\t\t}\n\t\treturn this.formattedOutput\n\t}\n\n\treset() {\n\t\tthis.state = new AsYouTypeState({\n\t\t\tonCountryChange: (country) => {\n\t\t\t\t// Before version `1.6.0`, the official `AsYouType` formatter API\n\t\t\t\t// included a `.country` property on an `AsYouType` instance.\n\t\t\t\t// Since that property (along with the others) have been moved to\n\t\t\t\t// `this.state`, `this.country` property is emulated for compatibility\n\t\t\t\t// with the old versions.\n\t\t\t\tthis.country = country\n\t\t\t},\n\t\t\tonCallingCodeChange: (callingCode, country) => {\n\t\t\t\tthis.metadata.selectNumberingPlan(country || callingCode)\n\t\t\t\tthis.formatter.reset(this.metadata.numberingPlan, this.state)\n\t\t\t\tthis.parser.reset(this.metadata.numberingPlan)\n\t\t\t}\n\t\t})\n\t\tthis.formatter = new AsYouTypeFormatter({\n\t\t\tstate: this.state,\n\t\t\tmetadata: this.metadata\n\t\t})\n\t\tthis.parser = new AsYouTypeParser({\n\t\t\tdefaultCountry: this.defaultCountry,\n\t\t\tdefaultCallingCode: this.defaultCallingCode,\n\t\t\tmetadata: this.metadata,\n\t\t\tstate: this.state,\n\t\t\tonNationalSignificantNumberChange: () => {\n\t\t\t\tthis.determineTheCountryIfNeeded()\n\t\t\t\tthis.formatter.reset(this.metadata.numberingPlan, this.state)\n\t\t\t}\n\t\t})\n\t\tthis.state.reset({\n\t\t\tcountry: this.defaultCountry,\n\t\t\tcallingCode: this.defaultCallingCode\n\t\t})\n\t\tthis.formattedOutput = ''\n\t\treturn this\n\t}\n\n\t/**\n\t * Returns `true` if the phone number is being input in international format.\n\t * In other words, returns `true` if and only if the parsed phone number starts with a `\"+\"`.\n\t * @return {boolean}\n\t */\n\tisInternational() {\n\t\treturn this.state.international\n\t}\n\n\t/**\n\t * Returns the \"calling code\" part of the phone number when it's being input\n\t * in an international format.\n\t * If no valid calling code has been entered so far, returns `undefined`.\n\t * @return {string} [callingCode]\n\t */\n\tgetCallingCode() {\n\t\t // If the number is being input in national format and some \"default calling code\"\n\t\t // has been passed to `AsYouType` constructor, then `this.state.callingCode`\n\t\t // is equal to that \"default calling code\".\n\t\t //\n\t\t // If the number is being input in national format and no \"default calling code\"\n\t\t // has been passed to `AsYouType` constructor, then returns `undefined`,\n\t\t // even if a \"default country\" has been passed to `AsYouType` constructor.\n\t\t //\n\t\tif (this.isInternational()) {\n\t\t\treturn this.state.callingCode\n\t\t}\n\t}\n\n\t// A legacy alias.\n\tgetCountryCallingCode() {\n\t\treturn this.getCallingCode()\n\t}\n\n\t/**\n\t * Returns a two-letter country code of the phone number.\n\t * Returns `undefined` for \"non-geographic\" phone numbering plans.\n\t * Returns `undefined` if no phone number has been input yet.\n\t * @return {string} [country]\n\t */\n\tgetCountry() {\n\t\tconst { digits } = this.state\n\t\t// Return `undefined` if no digits have been input yet.\n\t\tif (digits) {\n\t\t\treturn this._getCountry()\n\t\t}\n\t}\n\n\t/**\n\t * Returns a two-letter country code of the phone number.\n\t * Returns `undefined` for \"non-geographic\" phone numbering plans.\n\t * @return {string} [country]\n\t */\n\t_getCountry() {\n\t\tconst { country } = this.state\n\t\t/* istanbul ignore if */\n\t\tif (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n\t\t\t// `AsYouType.getCountry()` returns `undefined`\n\t\t\t// for \"non-geographic\" phone numbering plans.\n\t\t\tif (country === '001') {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\treturn country\n\t}\n\n\tdetermineTheCountryIfNeeded() {\n\t\t// Suppose a user enters a phone number in international format,\n\t\t// and there're several countries corresponding to that country calling code,\n\t\t// and a country has been derived from the number, and then\n\t\t// a user enters one more digit and the number is no longer\n\t\t// valid for the derived country, so the country should be re-derived\n\t\t// on every new digit in those cases.\n\t\t//\n\t\t// If the phone number is being input in national format,\n\t\t// then it could be a case when `defaultCountry` wasn't specified\n\t\t// when creating `AsYouType` instance, and just `defaultCallingCode` was specified,\n\t\t// and that \"calling code\" could correspond to a \"non-geographic entity\",\n\t\t// or there could be several countries corresponding to that country calling code.\n\t\t// In those cases, `this.country` is `undefined` and should be derived\n\t\t// from the number. Again, if country calling code is ambiguous, then\n\t\t// `this.country` should be re-derived with each new digit.\n\t\t//\n\t\tif (!this.state.country || this.isCountryCallingCodeAmbiguous()) {\n\t\t\tthis.determineTheCountry()\n\t\t}\n\t}\n\n\t// Prepends `+CountryCode ` in case of an international phone number\n\tgetFullNumber(formattedNationalNumber) {\n\t\tif (this.isInternational()) {\n\t\t\tconst prefix = (text) => this.formatter.getInternationalPrefixBeforeCountryCallingCode(this.state, {\n\t\t\t\tspacing: text ? true : false\n\t\t\t}) + text\n\t\t\tconst { callingCode } = this.state\n\t\t\tif (!callingCode) {\n\t\t\t\treturn prefix(`${this.state.getDigitsWithoutInternationalPrefix()}`)\n\t\t\t}\n\t\t\tif (!formattedNationalNumber) {\n\t\t\t\treturn prefix(callingCode)\n\t\t\t}\n\t\t\treturn prefix(`${callingCode} ${formattedNationalNumber}`)\n\t\t}\n\t\treturn formattedNationalNumber\n\t}\n\n\tgetNonFormattedNationalNumberWithPrefix() {\n\t\tconst {\n\t\t\tnationalSignificantNumber,\n\t\t\tprefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,\n\t\t\tnationalPrefix\n\t\t} = this.state\n\t\tlet number = nationalSignificantNumber\n\t\tconst prefix = prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix || nationalPrefix\n\t\tif (prefix) {\n\t\t\tnumber = prefix + number\n\t\t}\n\t\treturn number\n\t}\n\n\tgetNonFormattedNumber() {\n\t\tconst { nationalSignificantNumberIsModified } = this.state\n\t\treturn this.getFullNumber(\n\t\t\tnationalSignificantNumberIsModified\n\t\t\t\t? this.state.getNationalDigits()\n\t\t\t\t: this.getNonFormattedNationalNumberWithPrefix()\n\t\t)\n\t}\n\n\tgetNonFormattedTemplate() {\n\t\tconst number = this.getNonFormattedNumber()\n\t\tif (number) {\n\t\t\treturn number.replace(/[\\+\\d]/g, DIGIT_PLACEHOLDER)\n\t\t}\n\t}\n\n\tisCountryCallingCodeAmbiguous() {\n\t\tconst { callingCode } = this.state\n\t\tconst countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode)\n\t\treturn countryCodes && countryCodes.length > 1\n\t}\n\n\t// Determines the exact country of the phone number\n\t// entered so far based on the country phone code\n\t// and the national phone number.\n\tdetermineTheCountry() {\n\t\t// Get a more precise country code for this national number.\n\t\t// It is possible that the precise country couldn't be determined\n\t\t// in cases when there're multiple countries sharing the same calling code.\n\t\t// In that case, `country` will be `undefined`.\n\t\tconst country = getCountryByCallingCode(\n\t\t\tthis.isInternational() ? this.state.callingCode : this.defaultCallingCode,\n\t\t\t{\n\t\t\t\tnationalNumber: this.state.nationalSignificantNumber,\n\t\t\t\tmetadata: this.metadata\n\t\t\t}\n\t\t)\n\t\t// If the derived country is indeed more precise,\n\t\t// or if no country could be derived for the updated phone number.\n\t\tif (country !== this.state.country) {\n\t\t\t// Set (or reset) the more precise country.\n\t\t\tthis.state.setCountry(country)\n\t\t\t// If a more precise country could be derived.\n\t\t\tif (country) {\n\t\t\t\t// Select a more precise telephone numbering plan.\n\t\t\t\t// For example, consider that `AsYouType` instance was created with `defaultCountry: \"US\"` argument.\n\t\t\t\t// In that case, the metadata instance will be using \"US\" metadata.\n\t\t\t\t// But then the user could input a Canadian phone number, in which case\n\t\t\t\t// the metadata instance should be switched to Canadian telephone numbering plan.\n\t\t\t\t// It is required to do that because later `canFormatCompleteNumber()` function will be called,\n\t\t\t\t// and that function relies on the precise country being pre-selected in the metadata instance.\n\t\t\t\t// Or, for example, `checkNumberLength()` function also relies on same thing.\n\t\t\t\tthis.metadata.selectNumberingPlan(country)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns a E.164 phone number value for the user's input.\n\t *\n\t * For example, for country `\"US\"` and input `\"(222) 333-4444\"`\n\t * it will return `\"+12223334444\"`.\n\t *\n\t * For international phone number input, it will also auto-correct\n\t * some minor errors such as using a national prefix when writing\n\t * an international phone number. For example, if the user inputs\n\t * `\"+44 0 7400 000000\"` then it will return an auto-corrected\n\t * `\"+447400000000\"` phone number value.\n\t *\n\t * Will return `undefined` if no digits have been input,\n\t * or when inputting a phone number in national format and no\n\t * default country or default \"country calling code\" have been set.\n\t *\n\t * @return {string} [value]\n\t */\n\tgetNumberValue() {\n\t\tconst {\n\t\t\tdigits,\n\t\t\tcallingCode,\n\t\t\tcountry,\n\t\t\tnationalSignificantNumber\n\t\t} = this.state\n\n\t \t// Will return `undefined` if no digits have been input.\n\t\tif (!digits) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.isInternational()) {\n\t\t\tif (callingCode) {\n\t\t\t\treturn '+' + callingCode + nationalSignificantNumber\n\t\t\t} else {\n\t\t\t\treturn '+' + digits\n\t\t\t}\n\t\t} else {\n\t\t\tif (country || callingCode) {\n\t\t\t\tconst callingCode_ = country ? this.metadata.countryCallingCode() : callingCode\n\t\t\t\treturn '+' + callingCode_ + nationalSignificantNumber\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an instance of `PhoneNumber` class.\n\t * Will return `undefined` if no national (significant) number\n\t * digits have been entered so far, or if no `defaultCountry` has been\n\t * set and the user enters a phone number not in international format.\n\t */\n\tgetNumber() {\n\t\tconst {\n\t\t\tnationalSignificantNumber,\n\t\t\tcarrierCode,\n\t\t\tcallingCode\n\t\t} = this.state\n\n\t\tif (!nationalSignificantNumber) {\n\t\t\treturn\n\t\t}\n\n\t\t// `this._getCountry()` is basically same as `this.state.country`\n\t\t// with the only change that it returns `undefined` in case of a\n\t\t// \"non-geographic\" numbering plan instead of `\"001\"` \"internal use\" value.\n\t\tlet country = this._getCountry()\n\n\t\t// Sidenote:\n\t\t// `state.callingCode` and `state.country` are somewhat independent from one another\n\t\t// and there could be situations when one is defined but the other is not.\n\t\t// See the comment in `AsYouTypeState.js` for more info on when that is possible.\n\n\t\tif (!country && !callingCode) {\n\t\t\treturn\n\t\t}\n\n\t\t// By default, if `defaultCountry` parameter was passed when\n\t\t// creating `AsYouType` instance, `state.country` is gonna be\n\t\t// that `defaultCountry`, which doesn't entirely conform with\n\t\t// `parsePhoneNumber()`'s behavior where it attempts to determine\n\t\t// the country more precisely in cases when multiple countries\n\t\t// could correspond to the same `countryCallingCode`.\n\t\t// https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103#note_1417192969\n\t\t//\n\t\t// Because `AsYouType.getNumber()` method is supposed to be a 1:1\n\t\t// equivalent for `parsePhoneNumber(AsYouType.getNumberValue())`,\n\t\t// it means that it should also behave accordingly in such cases of `country` ambiguity.\n\t\t// That's how users of this library would expect it to behave anyway.\n\t\t//\n\t\t// So here it checks if `state.country` is same as the `defaultCountry`,\n\t\t// and if it is, it attempts to get rid of any potential ambiguity.\n\t\t//\n\t\tif (country) {\n\t\t\tif (country === this.defaultCountry) {\n\t\t\t\t// // Create a `Metadata` instance just to get the calling code of the `country`.\n\t\t\t\t// const metadata = new Metadata(this.metadata.metadata)\n\t\t\t\t// // `state.callingCode` and `state.country` are somewhat independent from one another\n\t\t\t\t// // and there could be situations when one is defined but the other is not.\n\t\t\t\t// // See the comment in `AsYouTypeState.js` for more info on when that is possible.\n\t\t\t\t// // Here, it only passes `state.country` because there's no need to pass `state.callingCode`\n\t\t\t\t// // because `state.country` is known to be defined.\n\t\t\t\t// metadata.selectNumberingPlan(country)\n\t\t\t\t// const countryCallingCode = metadata.numberingPlan.callingCode()\n\n\t\t\t\t// Instead of getting `countryCallingCode` value above,\n\t\t\t\t// it could simply read it from the existing metadata instance.\n\t\t\t\tconst countryCallingCode = this.metadata.numberingPlan.callingCode()\n\n\t\t\t\t// Attempt to rule out any potential country code ambiguity, if present.\n\t\t\t\tconst exactCountry = getExactCountryForMultiCountryCallingCode(\n\t\t\t\t\tcountryCallingCode,\n\t\t\t\t\tnationalSignificantNumber,\n\t\t\t\t\tthis.metadata\n\t\t\t\t)\n\t\t\t\tif (exactCountry) {\n\t\t\t\t\tcountry = exactCountry\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst phoneNumber = new PhoneNumber(\n\t\t\tcountry || callingCode,\n\t\t\tnationalSignificantNumber,\n\t\t\tthis.metadata.metadata\n\t\t)\n\t\tif (carrierCode) {\n\t\t\tphoneNumber.carrierCode = carrierCode\n\t\t}\n\t\t// Phone number extensions are not supported by \"As You Type\" formatter.\n\t\treturn phoneNumber\n\t}\n\n\t/**\n\t * Returns `true` if the phone number is \"possible\".\n\t * Is just a shortcut for `PhoneNumber.isPossible()`.\n\t * @return {boolean}\n\t */\n\tisPossible() {\n\t\tconst phoneNumber = this.getNumber()\n\t\tif (!phoneNumber) {\n\t\t\treturn false\n\t\t}\n\t\treturn phoneNumber.isPossible()\n\t}\n\n\t/**\n\t * Returns `true` if the phone number is \"valid\".\n\t * Is just a shortcut for `PhoneNumber.isValid()`.\n\t * @return {boolean}\n\t */\n\tisValid() {\n\t\tconst phoneNumber = this.getNumber()\n\t\tif (!phoneNumber) {\n\t\t\treturn false\n\t\t}\n\t\treturn phoneNumber.isValid()\n\t}\n\n\t/**\n\t * Checks if the phone number length is valid.\n\t * If it is, nothing is returned.\n\t * Otherwise, a rejection reason is returned.\n\t * @return {string?}\n\t */\n\tvalidateLength() {\n\t\tconst {\n\t\t\tdigits,\n\t\t\tnationalSignificantNumber\n\t\t} = this.state\n\n\t\tif (!digits) {\n\t\t\treturn 'NOT_A_NUMBER'\n\t\t}\n\n\t\tif (!this.metadata.numberingPlan) {\n\t\t\treturn 'INVALID_COUNTRY'\n\t\t}\n\n\t\tif (!nationalSignificantNumber) {\n\t\t\t return 'TOO_SHORT'\n\t\t}\n\n\t\t// `state.callingCode` and `state.country` are somewhat independent from one another\n\t\t// and there could be situations when one is defined but the other is not.\n\t\t// See the comment in `AsYouTypeState.js` for more info on when that is possible.\n\t\t// Here, it uses both: if `country` is defined then it will use that,\n\t\t// otherwise it will use `callingCode`.\n\t\tconst result = checkNumberLength(nationalSignificantNumber, undefined, this.metadata)\n\t\tif (result !== 'IS_POSSIBLE') {\n\t\t\treturn result\n\t\t}\n\t}\n\n\t/**\n\t * @deprecated\n\t * This method is used in `react-phone-number-input/source/input-control.js`\n\t * in versions before `3.0.16`.\n\t */\n\tgetNationalNumber() {\n\t\treturn this.state.nationalSignificantNumber\n\t}\n\n\t/**\n\t * Returns the phone number characters entered by the user.\n\t * @return {string}\n\t */\n\tgetChars() {\n\t\treturn (this.state.international ? '+' : '') + this.state.digits\n\t}\n\n\t/**\n\t * Returns the template for the formatted phone number.\n\t * @return {string}\n\t */\n\tgetTemplate() {\n\t\treturn this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || ''\n\t}\n}\n\n// In situations when multiple countries use the same calling code,\n// this function tells what exact country does a given national (significant) number belong to.\nfunction getExactCountryForMultiCountryCallingCode(callingCode, nationalSignificantNumber, metadata) {\n\tconst ambiguousCountries = metadata.getCountryCodesForCallingCode(callingCode)\n\tif (ambiguousCountries.length > 1) {\n\t\treturn getCountryByNationalNumber(nationalSignificantNumber, ambiguousCountries, metadata.metadata)\n\t}\n}"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,eAAe;AACpC,OAAOC,WAAW,MAAM,kBAAkB;AAC1C,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,OAAOC,cAAc,MAAM,qBAAqB;AAChD,OAAOC,kBAAkB,IAAIC,iBAAiB,QAAQ,yBAAyB;AAC/E,OAAOC,eAAe,IAAIC,6BAA6B,QAAQ,sBAAsB;AACrF,OAAOC,uBAAuB,MAAM,sCAAsC;AAC1E,OAAOC,0BAA0B,MAAM,yCAAyC;AAChF,OAAOC,QAAQ,MAAM,uBAAuB;AAE5C,MAAMC,+BAA+B,GAAG,KAAK;AAE7C,eAAe,MAAMC,SAAS,CAAC;EAC9B;AACD;AACA;AACA;EACCC,WAAWA,CAACC,uBAAuB,EAAEC,QAAQ,EAAE;IAC9C;IACA;IACA;IACA,IAAI,CAACA,QAAQ,GAAG,IAAIf,QAAQ,CAACe,QAAQ,CAAC;IACtC,MAAM,CAACC,cAAc,EAAEC,kBAAkB,CAAC,GAAG,IAAI,CAACC,wBAAwB,CAACJ,uBAAuB,CAAC;IACnG;IACA;IACA;IACA,IAAI,CAACE,cAAc,GAAGA,cAAc;IACpC,IAAI,CAACC,kBAAkB,GAAGA,kBAAkB;IAC5C,IAAI,CAACE,KAAK,CAAC,CAAC;EACb;EAEAD,wBAAwBA,CAACJ,uBAAuB,EAAE;IACjD;IACA,IAAIE,cAAc;IAClB,IAAIC,kBAAkB;IACtB;IACA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