@saasquatch/mint-components 1.6.2-2 → 1.7.0-1

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 (948) hide show
  1. package/CHANGELOG.md +473 -0
  2. package/LICENSE +21 -21
  3. package/dist/cjs/{GenericTableView-4921be4b.js → GenericTableView-6b0d1f93.js} +110 -110
  4. package/dist/cjs/{JSS-97fd087e.js → JSS-a75f3a9a.js} +1 -1
  5. package/dist/cjs/{ShadowViewAddon-aa14c0c4.js → ShadowViewAddon-1fe631ba.js} +3481 -3438
  6. package/dist/cjs/{global-5e3deef1.js → global-a7614907.js} +837 -847
  7. package/dist/cjs/{index.module-ffe1aa35.js → index.module-1c799b1f.js} +14 -15
  8. package/dist/cjs/loader.cjs.js +3 -3
  9. package/dist/cjs/mint-components.cjs.js +3 -3
  10. package/dist/cjs/{mixins-fe9d4112.js → mixins-338ca5f1.js} +85 -85
  11. package/dist/cjs/raisins-plop-target.cjs.entry.js +14 -17
  12. package/dist/cjs/{re-render-8fee17a9.js → re-render-c02c16c0.js} +37 -37
  13. package/dist/cjs/{sqm-asset-card-view-3da8cac1.js → sqm-asset-card-view-07420209.js} +44 -44
  14. package/dist/cjs/sqm-asset-card.cjs.entry.js +32 -32
  15. package/dist/cjs/sqm-big-stat_35.cjs.entry.js +7062 -3138
  16. package/dist/cjs/sqm-empty_5.cjs.entry.js +193 -192
  17. package/dist/cjs/sqm-form-message.cjs.entry.js +19 -19
  18. package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +22 -22
  19. package/dist/cjs/{sqm-hero-view-46223e34.js → sqm-hero-view-d5d46a36.js} +138 -138
  20. package/dist/cjs/sqm-hero.cjs.entry.js +45 -45
  21. package/dist/cjs/{sqm-leaderboard-rank-view-5a3d4a88.js → sqm-leaderboard-rank-view-35015d30.js} +3 -3
  22. package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +72 -72
  23. package/dist/cjs/{sqm-navigation-sidebar-item-view-9820193d.js → sqm-navigation-sidebar-item-view-85e51ba6.js} +38 -38
  24. package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +40 -40
  25. package/dist/cjs/{sqm-navigation-sidebar-view-969adcdc.js → sqm-navigation-sidebar-view-0ee28f65.js} +29 -29
  26. package/dist/cjs/sqm-navigation-sidebar.cjs.entry.js +13 -13
  27. package/dist/cjs/sqm-password-field.cjs.entry.js +184 -184
  28. package/dist/cjs/sqm-popup-container.cjs.entry.js +52 -52
  29. package/dist/cjs/{sqm-portal-container-view-840db620.js → sqm-portal-container-view-a3e86fc2.js} +30 -28
  30. package/dist/cjs/{sqm-portal-email-verification-view-57fbd19b.js → sqm-portal-email-verification-view-c60833cc.js} +37 -37
  31. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +98 -98
  32. package/dist/cjs/{sqm-portal-footer-view-eb757378.js → sqm-portal-footer-view-d5478077.js} +72 -72
  33. package/dist/cjs/sqm-portal-footer.cjs.entry.js +49 -48
  34. package/dist/cjs/{sqm-portal-forgot-password-view-fed1f563.js → sqm-portal-forgot-password-view-97932f7a.js} +38 -38
  35. package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +92 -92
  36. package/dist/cjs/sqm-portal-logout.cjs.entry.js +19 -19
  37. package/dist/cjs/{sqm-portal-profile-view-7cb535a8.js → sqm-portal-profile-view-a8ee44c2.js} +65 -65
  38. package/dist/cjs/sqm-portal-profile.cjs.entry.js +245 -245
  39. package/dist/cjs/sqm-portal-protected-route.cjs.entry.js +53 -53
  40. package/dist/cjs/{sqm-portal-reset-password-view-f8dc0b79.js → sqm-portal-reset-password-view-042073ca.js} +74 -74
  41. package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +171 -171
  42. package/dist/cjs/{sqm-portal-section-view-854a3e9c.js → sqm-portal-section-view-765aae4d.js} +20 -20
  43. package/dist/cjs/{sqm-portal-verify-email-view-cc59877c.js → sqm-portal-verify-email-view-cb3c9c2f.js} +40 -40
  44. package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +121 -121
  45. package/dist/cjs/sqm-qa-referral-card.cjs.entry.js +76 -76
  46. package/dist/cjs/sqm-qa-tabs.cjs.entry.js +84 -84
  47. package/dist/cjs/sqm-qa.cjs.entry.js +107 -102
  48. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +750 -750
  49. package/dist/cjs/sqm-rewards-table-customer-note-cell.cjs.entry.js +14 -14
  50. package/dist/cjs/sqm-rewards-table-customer-note-column.cjs.entry.js +24 -24
  51. package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +956 -953
  52. package/dist/cjs/sqm-route.cjs.entry.js +9 -9
  53. package/dist/cjs/sqm-stencilbook.cjs.entry.js +7821 -7821
  54. package/dist/cjs/sqm-tab.cjs.entry.js +9 -9
  55. package/dist/cjs/sqm-tabs.cjs.entry.js +84 -84
  56. package/dist/cjs/{sqm-text-span-view-2c7d94b5.js → sqm-text-span-view-ab4ad6ef.js} +52 -52
  57. package/dist/cjs/sqm-text-span.cjs.entry.js +13 -13
  58. package/dist/cjs/{useChildElements-a7a7b921.js → useChildElements-dc4c3132.js} +23 -16
  59. package/dist/cjs/{useReferralTable-7e18f12e.js → useReferralTable-f52c7f8e.js} +346 -346
  60. package/dist/cjs/{utils-6847bc06.js → utils-8ef4fe4a.js} +38 -38
  61. package/dist/collection/ShadowViewAddon.js +35 -35
  62. package/dist/collection/collection-manifest.json +1 -2
  63. package/dist/collection/components/{sqm-rewards-table/columns/sqm-rewards-table-plop-target.js → raisins-plop-target/raisins-plop-target.js} +53 -58
  64. package/dist/collection/components/sqm-asset-card/AssetCard.stories.js +29 -29
  65. package/dist/collection/components/sqm-asset-card/sqm-asset-card-view.js +46 -46
  66. package/dist/collection/components/sqm-asset-card/sqm-asset-card.js +107 -107
  67. package/dist/collection/components/sqm-asset-card/useAssetCard.js +9 -9
  68. package/dist/collection/components/sqm-big-stat/BigStat.stories.js +88 -88
  69. package/dist/collection/components/sqm-big-stat/UseBigStat.stories.js +113 -113
  70. package/dist/collection/components/sqm-big-stat/sqm-big-stat-view.js +41 -36
  71. package/dist/collection/components/sqm-big-stat/sqm-big-stat.js +311 -180
  72. package/dist/collection/components/sqm-big-stat/useBigStat.js +616 -614
  73. package/dist/collection/components/sqm-big-stat/useDemoBigStat.js +42 -34
  74. package/dist/collection/components/sqm-brand/SqmBrand.stories.js +97 -97
  75. package/dist/collection/components/sqm-brand/sqm-brand.js +181 -111
  76. package/dist/collection/components/sqm-card-feed/CardFeed.stories.js +232 -232
  77. package/dist/collection/components/sqm-card-feed/sqm-card-feed-view.js +37 -27
  78. package/dist/collection/components/sqm-card-feed/sqm-card-feed.js +151 -82
  79. package/dist/collection/components/sqm-checkbox-field/CheckboxField.stories.js +91 -91
  80. package/dist/collection/components/sqm-checkbox-field/UseCheckboxField.stories.js +68 -68
  81. package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field-view.js +71 -71
  82. package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +234 -234
  83. package/dist/collection/components/sqm-checkbox-field/useCheckboxField.js +16 -16
  84. package/dist/collection/components/sqm-divided-layout/DividedLayout.stories.js +85 -85
  85. package/dist/collection/components/sqm-divided-layout/sqm-divided-layout-view.js +52 -52
  86. package/dist/collection/components/sqm-divided-layout/sqm-divided-layout.js +79 -79
  87. package/dist/collection/components/sqm-dropdown-field/DropdownField.stories.js +38 -38
  88. package/dist/collection/components/sqm-dropdown-field/UseDropdownField.stories.js +54 -54
  89. package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field-view.js +50 -50
  90. package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field.js +180 -180
  91. package/dist/collection/components/sqm-dropdown-field/useDropdownField.js +10 -10
  92. package/dist/collection/components/sqm-edit-profile/EditProfileForm.stories.js +61 -61
  93. package/dist/collection/components/sqm-edit-profile/UseEditProfile.stories.js +41 -41
  94. package/dist/collection/components/sqm-edit-profile/sqm-edit-profile-view.js +55 -55
  95. package/dist/collection/components/sqm-edit-profile/sqm-edit-profile.js +279 -279
  96. package/dist/collection/components/sqm-edit-profile/useEditProfile.js +156 -156
  97. package/dist/collection/components/sqm-empty/EmptyState.stories.js +53 -53
  98. package/dist/collection/components/sqm-empty/sqm-empty-view.js +10 -10
  99. package/dist/collection/components/sqm-empty/sqm-empty.js +85 -85
  100. package/dist/collection/components/sqm-form-message/FormMessage.stories.js +28 -28
  101. package/dist/collection/components/sqm-form-message/sqm-form-message.js +82 -82
  102. package/dist/collection/components/sqm-graphql-client-provider/sqm-graphql-client-provider.js +51 -51
  103. package/dist/collection/components/sqm-graphql-client-provider/useGraphQLProvider.js +14 -14
  104. package/dist/collection/components/sqm-hero/Hero.stories.js +168 -168
  105. package/dist/collection/components/sqm-hero/sqm-hero-view.js +129 -129
  106. package/dist/collection/components/sqm-hero/sqm-hero.js +171 -171
  107. package/dist/collection/components/sqm-hero-image/HeroImage.stories.js +56 -56
  108. package/dist/collection/components/sqm-hero-image/sqm-hero-image-view.js +140 -138
  109. package/dist/collection/components/sqm-hero-image/sqm-hero-image.js +509 -489
  110. package/dist/collection/components/sqm-hook-story-container/sqm-hook-story-container.js +42 -42
  111. package/dist/collection/components/sqm-image/Image.stories.js +26 -26
  112. package/dist/collection/components/sqm-image/sqm-image-view.js +33 -32
  113. package/dist/collection/components/sqm-image/sqm-image.js +151 -131
  114. package/dist/collection/components/sqm-input-field/InputField.stories.js +81 -81
  115. package/dist/collection/components/sqm-input-field/UseInputField.stories.js +77 -77
  116. package/dist/collection/components/sqm-input-field/sqm-input-field-view.js +37 -37
  117. package/dist/collection/components/sqm-input-field/sqm-input-field.js +208 -208
  118. package/dist/collection/components/sqm-input-field/useInputField.js +10 -10
  119. package/dist/collection/components/sqm-leaderboard/Leaderboard.stories.js +483 -483
  120. package/dist/collection/components/sqm-leaderboard/UseLeaderboard.stories.js +208 -208
  121. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard-view.js +101 -101
  122. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard.js +430 -430
  123. package/dist/collection/components/sqm-leaderboard/useLeaderboard.js +112 -112
  124. package/dist/collection/components/sqm-leaderboard-rank/LeaderboardRank.stories.js +30 -30
  125. package/dist/collection/components/sqm-leaderboard-rank/sqm-leaderboard-rank-view.js +5 -5
  126. package/dist/collection/components/sqm-leaderboard-rank/sqm-leaderboard-rank.js +231 -231
  127. package/dist/collection/components/sqm-leaderboard-rank/useLeaderboardRank.js +45 -45
  128. package/dist/collection/components/sqm-name-fields/NameFields.stories.js +36 -36
  129. package/dist/collection/components/sqm-name-fields/sqm-name-fields-view.js +43 -43
  130. package/dist/collection/components/sqm-name-fields/sqm-name-fields.js +117 -117
  131. package/dist/collection/components/sqm-name-fields/useNameFields.js +14 -14
  132. package/dist/collection/components/sqm-navigation-menu/sqm-navigation-menu-view.js +14 -14
  133. package/dist/collection/components/sqm-navigation-menu/sqm-navigation-menu.js +122 -122
  134. package/dist/collection/components/sqm-navigation-menu/useNavigationMenu.js +27 -27
  135. package/dist/collection/components/sqm-navigation-sidebar/NavigationSidebar.stories.js +45 -45
  136. package/dist/collection/components/sqm-navigation-sidebar/sqm-navigation-sidebar-view.js +31 -31
  137. package/dist/collection/components/sqm-navigation-sidebar/sqm-navigation-sidebar.js +24 -24
  138. package/dist/collection/components/sqm-navigation-sidebar-item/SidebarItem.stories.js +31 -31
  139. package/dist/collection/components/sqm-navigation-sidebar-item/sqm-navigation-sidebar-item-view.js +40 -40
  140. package/dist/collection/components/sqm-navigation-sidebar-item/sqm-navigation-sidebar-item.js +127 -127
  141. package/dist/collection/components/sqm-navigation-sidebar-item/useNavigationSidebarItem.js +14 -14
  142. package/dist/collection/components/sqm-password-field/PasswordField.stories.js +40 -40
  143. package/dist/collection/components/sqm-password-field/passwordValidation.js +76 -76
  144. package/dist/collection/components/sqm-password-field/sqm-password-field-view.js +41 -41
  145. package/dist/collection/components/sqm-password-field/sqm-password-field.js +135 -135
  146. package/dist/collection/components/sqm-password-field/usePasswordField.js +25 -25
  147. package/dist/collection/components/sqm-popup-container/sqm-popup-container-view.js +11 -11
  148. package/dist/collection/components/sqm-popup-container/sqm-popup-container.js +147 -145
  149. package/dist/collection/components/sqm-popup-container/usePopupContainer.js +33 -33
  150. package/dist/collection/components/sqm-portal-change-password/ChangePassword.stories.js +147 -147
  151. package/dist/collection/components/sqm-portal-change-password/sqm-portal-change-password-view.js +74 -74
  152. package/dist/collection/components/sqm-portal-change-password/sqm-portal-change-password.js +293 -293
  153. package/dist/collection/components/sqm-portal-change-password/usePortalChangePassword.js +61 -61
  154. package/dist/collection/components/sqm-portal-container/PortalContainer.stories.js +119 -119
  155. package/dist/collection/components/sqm-portal-container/sqm-portal-container-view.js +32 -30
  156. package/dist/collection/components/sqm-portal-container/sqm-portal-container.js +316 -273
  157. package/dist/collection/components/sqm-portal-email-verification/PortalEmailVerification.stories.js +77 -77
  158. package/dist/collection/components/sqm-portal-email-verification/sqm-portal-email-verification-view.js +39 -39
  159. package/dist/collection/components/sqm-portal-email-verification/sqm-portal-email-verification.js +175 -175
  160. package/dist/collection/components/sqm-portal-email-verification/usePortalEmailVerification.js +50 -50
  161. package/dist/collection/components/sqm-portal-footer/PortalFooter.stories.js +24 -24
  162. package/dist/collection/components/sqm-portal-footer/PoweredByImg.js +11 -11
  163. package/dist/collection/components/sqm-portal-footer/sqm-portal-footer-view.js +66 -66
  164. package/dist/collection/components/sqm-portal-footer/sqm-portal-footer.js +309 -305
  165. package/dist/collection/components/sqm-portal-forgot-password/PortalForgotPassword.stories.js +73 -73
  166. package/dist/collection/components/sqm-portal-forgot-password/sqm-portal-forgot-password-view.js +40 -40
  167. package/dist/collection/components/sqm-portal-forgot-password/sqm-portal-forgot-password.js +176 -176
  168. package/dist/collection/components/sqm-portal-forgot-password/usePortalForgotPassword.js +46 -46
  169. package/dist/collection/components/sqm-portal-frame/PortalFrame.stories.js +118 -118
  170. package/dist/collection/components/sqm-portal-frame/sqm-portal-frame-view.js +53 -53
  171. package/dist/collection/components/sqm-portal-frame/sqm-portal-frame.js +78 -78
  172. package/dist/collection/components/sqm-portal-frame/usePortalFrame.js +13 -13
  173. package/dist/collection/components/sqm-portal-login/PortalLogin.stories.js +44 -44
  174. package/dist/collection/components/sqm-portal-login/sqm-portal-login-view.js +45 -45
  175. package/dist/collection/components/sqm-portal-login/sqm-portal-login.js +325 -325
  176. package/dist/collection/components/sqm-portal-login/usePortalLogin.js +47 -47
  177. package/dist/collection/components/sqm-portal-logout/sqm-portal-logout.js +50 -50
  178. package/dist/collection/components/sqm-portal-logout/usePortalLogout.js +5 -5
  179. package/dist/collection/components/sqm-portal-profile/PortalProfile.stories.js +227 -227
  180. package/dist/collection/components/sqm-portal-profile/sqm-portal-profile-view.js +67 -67
  181. package/dist/collection/components/sqm-portal-profile/sqm-portal-profile.js +308 -308
  182. package/dist/collection/components/sqm-portal-profile/usePortalProfile.js +149 -149
  183. package/dist/collection/components/sqm-portal-protected-route/sqm-portal-protected-route.js +110 -110
  184. package/dist/collection/components/sqm-portal-protected-route/usePortalProtectedRoute.js +26 -26
  185. package/dist/collection/components/sqm-portal-register/PortalRegister.stories.js +104 -104
  186. package/dist/collection/components/sqm-portal-register/sqm-portal-register-view.js +74 -74
  187. package/dist/collection/components/sqm-portal-register/sqm-portal-register.js +409 -409
  188. package/dist/collection/components/sqm-portal-register/usePortalRegister.js +115 -115
  189. package/dist/collection/components/sqm-portal-register/useValidationState.js +8 -8
  190. package/dist/collection/components/sqm-portal-reset-password/PortalResetPassword.stories.js +153 -153
  191. package/dist/collection/components/sqm-portal-reset-password/sqm-portal-reset-password-view.js +76 -76
  192. package/dist/collection/components/sqm-portal-reset-password/sqm-portal-reset-password.js +325 -325
  193. package/dist/collection/components/sqm-portal-reset-password/usePortalResetPassword.js +83 -83
  194. package/dist/collection/components/sqm-portal-verify-email/PortalVerifyEmail.stories.js +39 -39
  195. package/dist/collection/components/sqm-portal-verify-email/sqm-portal-verify-email-view.js +42 -42
  196. package/dist/collection/components/sqm-portal-verify-email/sqm-portal-verify-email.js +127 -127
  197. package/dist/collection/components/sqm-portal-verify-email/usePortalVerifyEmail.js +80 -80
  198. package/dist/collection/components/sqm-program-explainer/ProgramExplainer.stories.js +50 -50
  199. package/dist/collection/components/sqm-program-explainer/sqm-program-explainer-view.js +44 -44
  200. package/dist/collection/components/sqm-program-explainer/sqm-program-explainer.js +100 -100
  201. package/dist/collection/components/sqm-program-explainer-step/ProgramExplainerStep.stories.js +14 -14
  202. package/dist/collection/components/sqm-program-explainer-step/sqm-program-explainer-step-view.js +71 -71
  203. package/dist/collection/components/sqm-program-explainer-step/sqm-program-explainer-step.js +164 -164
  204. package/dist/collection/components/sqm-program-menu/ProgramMenu.stories.js +39 -39
  205. package/dist/collection/components/sqm-program-menu/sqm-program-menu.js +25 -25
  206. package/dist/collection/components/sqm-program-menu/useProgramMenu.js +33 -33
  207. package/dist/collection/components/sqm-qa/sqm-qa.js +1064 -1038
  208. package/dist/collection/components/sqm-qa-referral-card/ReferralCard.stories.js +79 -79
  209. package/dist/collection/components/sqm-qa-referral-card/sqm-referral-card-view.js +56 -56
  210. package/dist/collection/components/sqm-qa-referral-card/sqm-referral-card.js +70 -70
  211. package/dist/collection/components/sqm-qa-tabs/Tabs.stories.js +491 -491
  212. package/dist/collection/components/sqm-qa-tabs/sqm-tabs-view.js +31 -31
  213. package/dist/collection/components/sqm-qa-tabs/sqm-tabs.js +59 -59
  214. package/dist/collection/components/sqm-qa-tabs/useTabs.js +46 -46
  215. package/dist/collection/components/sqm-referral-card/ReferralCard.stories.js +79 -79
  216. package/dist/collection/components/sqm-referral-card/sqm-referral-card-view.js +62 -56
  217. package/dist/collection/components/sqm-referral-card/sqm-referral-card.js +199 -69
  218. package/dist/collection/components/sqm-referral-iframe/ReferralIframe.stories.js +29 -29
  219. package/dist/collection/components/sqm-referral-iframe/sqm-referral-iframe-view.js +29 -29
  220. package/dist/collection/components/sqm-referral-iframe/sqm-referral-iframe.js +158 -158
  221. package/dist/collection/components/sqm-referral-iframe/useReferralIframe.js +25 -25
  222. package/dist/collection/components/sqm-referral-table/ReferralTable.stories.js +540 -540
  223. package/dist/collection/components/sqm-referral-table/ReferralTableCell.stories.js +72 -72
  224. package/dist/collection/components/sqm-referral-table/ReferralTableRewardsCell.stories.js +233 -233
  225. package/dist/collection/components/sqm-referral-table/UseReferralTable.stories.js +149 -149
  226. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-cell.js +36 -36
  227. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-date-cell.js +61 -61
  228. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.js +345 -345
  229. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-status-cell.js +58 -58
  230. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-user-cell.js +27 -27
  231. package/dist/collection/components/sqm-referral-table/columns/ReferralTableColumn.js +1 -1
  232. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-column.js +89 -89
  233. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-date-column.js +180 -180
  234. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-rewards-column.js +332 -332
  235. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-status-column.js +181 -181
  236. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-user-column.js +205 -205
  237. package/dist/collection/components/sqm-referral-table/mockReferralData.js +141 -141
  238. package/dist/collection/components/sqm-referral-table/sqm-referral-table.js +413 -413
  239. package/dist/collection/components/sqm-referral-table/useReferralTable.js +351 -351
  240. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeList.stories.js +31 -31
  241. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +395 -395
  242. package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +27 -27
  243. package/dist/collection/components/sqm-reward-exchange-list/UseRewardExchangeList.stories.js +143 -143
  244. package/dist/collection/components/sqm-reward-exchange-list/progressBar.js +64 -64
  245. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +613 -613
  246. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +781 -781
  247. package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +205 -205
  248. package/dist/collection/components/sqm-rewards-table/RewardsTable.stories.js +122 -122
  249. package/dist/collection/components/sqm-rewards-table/RewardsTableCell.stories.js +269 -269
  250. package/dist/collection/components/sqm-rewards-table/UseRewardsTable.stories.js +149 -149
  251. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-customer-note-cell.js +57 -57
  252. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-date-cell.js +61 -61
  253. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-reward-cell.js +253 -253
  254. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-source-cell.js +192 -192
  255. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.js +237 -237
  256. package/dist/collection/components/sqm-rewards-table/columns/RewardTableColumn.js +1 -1
  257. package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-date-column.js +138 -138
  258. package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-note-column.js +99 -99
  259. package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-reward-column.js +177 -177
  260. package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-source-column.js +245 -245
  261. package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-status-column.js +241 -241
  262. package/dist/collection/components/sqm-rewards-table/mockRewardData.js +103 -103
  263. package/dist/collection/components/sqm-rewards-table/sqm-rewards-table.js +354 -351
  264. package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +235 -235
  265. package/dist/collection/components/sqm-route/sqm-route.js +41 -40
  266. package/dist/collection/components/sqm-router/Router.stories.js +144 -144
  267. package/dist/collection/components/sqm-router/sqm-router.css +7 -7
  268. package/dist/collection/components/sqm-router/sqm-router.js +31 -30
  269. package/dist/collection/components/sqm-router/useRouter.js +79 -79
  270. package/dist/collection/components/sqm-scroll/Scroll.stories.js +155 -155
  271. package/dist/collection/components/sqm-scroll/sqm-scroll.js +381 -381
  272. package/dist/collection/components/sqm-scroll/useScroll.js +17 -17
  273. package/dist/collection/components/sqm-share-button/ShareButton.stories.js +102 -102
  274. package/dist/collection/components/sqm-share-button/UseShareButton.stories.js +59 -59
  275. package/dist/collection/components/sqm-share-button/sqm-share-button-view.js +77 -77
  276. package/dist/collection/components/sqm-share-button/sqm-share-button.js +476 -476
  277. package/dist/collection/components/sqm-share-button/useShareButton.js +89 -89
  278. package/dist/collection/components/sqm-share-code/ShareCode.stories.js +17 -17
  279. package/dist/collection/components/sqm-share-code/sqm-share-code.js +152 -152
  280. package/dist/collection/components/sqm-share-code/useShareCode.js +49 -49
  281. package/dist/collection/components/sqm-share-link/ShareLink.stories.js +37 -37
  282. package/dist/collection/components/sqm-share-link/UseShareLink.stories.js +59 -59
  283. package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +31 -18
  284. package/dist/collection/components/sqm-share-link/sqm-share-link.js +275 -152
  285. package/dist/collection/components/sqm-share-link/useShareLink.js +49 -49
  286. package/dist/collection/components/sqm-stat-container/sqm-stat-container-view.js +52 -48
  287. package/dist/collection/components/sqm-stat-container/sqm-stat-container.js +155 -107
  288. package/dist/collection/components/sqm-stencilbook/AutoColor.js +49 -49
  289. package/dist/collection/components/sqm-stencilbook/CucumberAddon.js +20 -20
  290. package/dist/collection/components/sqm-stencilbook/HookStoryAddon.js +19 -19
  291. package/dist/collection/components/sqm-stencilbook/Matrix.js +66 -66
  292. package/dist/collection/components/sqm-stencilbook/Resizer.js +27 -27
  293. package/dist/collection/components/sqm-stencilbook/Themes.js +44 -44
  294. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +207 -207
  295. package/dist/collection/components/sqm-tab/sqm-tab-view.js +4 -4
  296. package/dist/collection/components/sqm-tab/sqm-tab.js +38 -38
  297. package/dist/collection/components/sqm-table-cell/sqm-table-cell.js +64 -52
  298. package/dist/collection/components/sqm-table-row/sqm-table-row.js +43 -33
  299. package/dist/collection/components/sqm-tabs/Tabs.stories.js +491 -491
  300. package/dist/collection/components/sqm-tabs/sqm-tabs-view.js +31 -31
  301. package/dist/collection/components/sqm-tabs/sqm-tabs.js +59 -58
  302. package/dist/collection/components/sqm-tabs/useTabs.js +46 -46
  303. package/dist/collection/components/sqm-task-card/DetailsView.js +53 -53
  304. package/dist/collection/components/sqm-task-card/SVGs.js +14 -14
  305. package/dist/collection/components/sqm-task-card/TaskCard.stories.js +437 -437
  306. package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +67 -67
  307. package/dist/collection/components/sqm-task-card/progress-bar/SVGs.js +15 -15
  308. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +398 -398
  309. package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +287 -286
  310. package/dist/collection/components/sqm-task-card/sqm-task-card.js +753 -753
  311. package/dist/collection/components/sqm-task-card/useTaskCard.js +43 -43
  312. package/dist/collection/components/sqm-text/sqm-text.js +79 -79
  313. package/dist/collection/components/sqm-text-span/sqm-text-span-view.js +54 -54
  314. package/dist/collection/components/sqm-text-span/sqm-text-span.js +73 -73
  315. package/dist/collection/components/sqm-timeline/SVGs.js +10 -10
  316. package/dist/collection/components/sqm-timeline/Timeline.stories.js +70 -70
  317. package/dist/collection/components/sqm-timeline/sqm-timeline-entry-view.js +76 -77
  318. package/dist/collection/components/sqm-timeline/sqm-timeline-entry.js +167 -144
  319. package/dist/collection/components/sqm-timeline/sqm-timeline.js +83 -83
  320. package/dist/collection/components/sqm-titled-section/TitledSection.stories.js +224 -224
  321. package/dist/collection/components/sqm-titled-section/sqm-portal-section-view.js +22 -22
  322. package/dist/collection/components/sqm-titled-section/sqm-titled-section.js +170 -170
  323. package/dist/collection/components/sqm-user-name/UserName.stories.js +14 -14
  324. package/dist/collection/components/sqm-user-name/sqm-user-name-view.js +4 -4
  325. package/dist/collection/components/sqm-user-name/sqm-user-name.js +117 -117
  326. package/dist/collection/components/sqm-user-name/useUserName.js +26 -26
  327. package/dist/collection/fonts/GoogleFonts.js +12 -12
  328. package/dist/collection/global/global.js +80 -80
  329. package/dist/collection/global/mixins.js +100 -100
  330. package/dist/collection/global/styles.js +727 -737
  331. package/dist/collection/global/styles.ts +729 -739
  332. package/dist/collection/index.js +1 -1
  333. package/dist/collection/insertcss.js +44 -44
  334. package/dist/collection/stories/NewPortal.stories.js +303 -303
  335. package/dist/collection/stories/PortalTemplates.stories.js +149 -149
  336. package/dist/collection/stories/PoweredByImg.stories.js +14 -14
  337. package/dist/collection/stories/Widget.stories.js +49 -49
  338. package/dist/collection/styling/JSS.js +9 -9
  339. package/dist/collection/tables/GenericTableView.js +112 -112
  340. package/dist/collection/tables/TableSlots.js +30 -30
  341. package/dist/collection/tables/re-render.js +39 -39
  342. package/dist/collection/tables/useChildElements.js +25 -18
  343. package/dist/collection/utilities.js +21 -21
  344. package/dist/collection/utils/RequiredPropsError.js +56 -56
  345. package/dist/collection/utils/isDemo.js +10 -10
  346. package/dist/collection/utils/utils.js +49 -49
  347. package/dist/esm/{GenericTableView-59c5d47c.js → GenericTableView-80119630.js} +110 -110
  348. package/dist/esm/{JSS-f00f9536.js → JSS-418cab16.js} +1 -1
  349. package/dist/esm/{ShadowViewAddon-3626a92b.js → ShadowViewAddon-c8e40951.js} +3483 -3440
  350. package/dist/esm/{global-0842e0e4.js → global-2d97b8c1.js} +838 -848
  351. package/dist/esm/{index.module-96470dcf.js → index.module-2b4f1755.js} +4 -4
  352. package/dist/esm/loader.js +5 -5
  353. package/dist/esm/{luxon-38ca2169.js → luxon-578505e2.js} +1 -1
  354. package/dist/esm/mint-components.js +5 -5
  355. package/dist/esm/{mixins-f60a614c.js → mixins-59fd94b7.js} +85 -85
  356. package/dist/esm/polyfills/core-js.js +0 -0
  357. package/dist/esm/polyfills/dom.js +0 -0
  358. package/dist/esm/polyfills/es5-html-element.js +0 -0
  359. package/dist/esm/polyfills/index.js +0 -0
  360. package/dist/esm/polyfills/system.js +0 -0
  361. package/dist/esm/raisins-plop-target.entry.js +15 -18
  362. package/dist/esm/{re-render-f444e556.js → re-render-2c1d8030.js} +38 -38
  363. package/dist/esm/{sqm-asset-card-view-08e68656.js → sqm-asset-card-view-68f80b85.js} +44 -44
  364. package/dist/esm/sqm-asset-card.entry.js +34 -34
  365. package/dist/esm/sqm-big-stat_35.entry.js +7065 -3141
  366. package/dist/esm/sqm-empty_5.entry.js +193 -192
  367. package/dist/esm/sqm-form-message.entry.js +20 -20
  368. package/dist/esm/sqm-graphql-client-provider.entry.js +24 -24
  369. package/dist/esm/{sqm-hero-view-93fac447.js → sqm-hero-view-1f148798.js} +140 -140
  370. package/dist/esm/sqm-hero.entry.js +47 -47
  371. package/dist/esm/{sqm-leaderboard-rank-view-10657658.js → sqm-leaderboard-rank-view-da91f5f3.js} +3 -3
  372. package/dist/esm/sqm-leaderboard-rank.entry.js +74 -74
  373. package/dist/esm/{sqm-navigation-sidebar-item-view-fb10e0c2.js → sqm-navigation-sidebar-item-view-b22b07a2.js} +38 -38
  374. package/dist/esm/sqm-navigation-sidebar-item.entry.js +42 -42
  375. package/dist/esm/{sqm-navigation-sidebar-view-06d444ca.js → sqm-navigation-sidebar-view-9cb9a5f4.js} +29 -29
  376. package/dist/esm/sqm-navigation-sidebar.entry.js +14 -14
  377. package/dist/esm/sqm-password-field.entry.js +186 -186
  378. package/dist/esm/sqm-popup-container.entry.js +54 -54
  379. package/dist/esm/{sqm-portal-container-view-ca454627.js → sqm-portal-container-view-5d6f1411.js} +30 -28
  380. package/dist/esm/{sqm-portal-email-verification-view-f6daf315.js → sqm-portal-email-verification-view-3dad1010.js} +37 -37
  381. package/dist/esm/sqm-portal-email-verification.entry.js +100 -100
  382. package/dist/esm/{sqm-portal-footer-view-42db3277.js → sqm-portal-footer-view-c35314a2.js} +72 -72
  383. package/dist/esm/sqm-portal-footer.entry.js +51 -50
  384. package/dist/esm/{sqm-portal-forgot-password-view-86d13eef.js → sqm-portal-forgot-password-view-f7239087.js} +38 -38
  385. package/dist/esm/sqm-portal-forgot-password.entry.js +94 -94
  386. package/dist/esm/sqm-portal-logout.entry.js +21 -21
  387. package/dist/esm/{sqm-portal-profile-view-dd2774b2.js → sqm-portal-profile-view-3d621db8.js} +65 -65
  388. package/dist/esm/sqm-portal-profile.entry.js +247 -247
  389. package/dist/esm/sqm-portal-protected-route.entry.js +55 -55
  390. package/dist/esm/{sqm-portal-reset-password-view-213b3af6.js → sqm-portal-reset-password-view-e0436989.js} +74 -74
  391. package/dist/esm/sqm-portal-reset-password.entry.js +173 -173
  392. package/dist/esm/{sqm-portal-section-view-6c249c74.js → sqm-portal-section-view-c8d1c727.js} +20 -20
  393. package/dist/esm/{sqm-portal-verify-email-view-c32dfd7e.js → sqm-portal-verify-email-view-c489166b.js} +40 -40
  394. package/dist/esm/sqm-portal-verify-email.entry.js +123 -123
  395. package/dist/esm/sqm-qa-referral-card.entry.js +77 -77
  396. package/dist/esm/sqm-qa-tabs.entry.js +86 -86
  397. package/dist/esm/sqm-qa.entry.js +108 -103
  398. package/dist/esm/sqm-referral-table_11.entry.js +753 -753
  399. package/dist/esm/sqm-rewards-table-customer-note-cell.entry.js +15 -15
  400. package/dist/esm/sqm-rewards-table-customer-note-column.entry.js +26 -26
  401. package/dist/esm/sqm-rewards-table_9.entry.js +959 -956
  402. package/dist/esm/sqm-route.entry.js +9 -9
  403. package/dist/esm/sqm-stencilbook.entry.js +7824 -7824
  404. package/dist/esm/sqm-tab.entry.js +9 -9
  405. package/dist/esm/sqm-tabs.entry.js +86 -86
  406. package/dist/esm/{sqm-text-span-view-0ba1484d.js → sqm-text-span-view-020db63f.js} +52 -52
  407. package/dist/esm/sqm-text-span.entry.js +14 -14
  408. package/dist/esm/{stencil-hooks.module-66fea7dc.js → stencil-hooks.module-e39af977.js} +1 -1
  409. package/dist/esm/{use-callback-69ec5c5c.js → use-callback-697e2ff0.js} +1 -1
  410. package/dist/esm/{useChildElements-756c6a81.js → useChildElements-0eab9c95.js} +24 -17
  411. package/dist/esm/{useReferralTable-0a8ee3b7.js → useReferralTable-3513622d.js} +347 -347
  412. package/dist/esm/{utils-334c1e34.js → utils-d7bbb0e2.js} +38 -38
  413. package/dist/esm-es5/{GenericTableView-59c5d47c.js → GenericTableView-80119630.js} +1 -1
  414. package/dist/esm-es5/{JSS-f00f9536.js → JSS-418cab16.js} +0 -0
  415. package/dist/esm-es5/ShadowViewAddon-c8e40951.js +1 -0
  416. package/dist/esm-es5/{global-0842e0e4.js → global-2d97b8c1.js} +2 -2
  417. package/dist/esm-es5/{index.module-96470dcf.js → index.module-2b4f1755.js} +1 -1
  418. package/dist/esm-es5/loader.js +1 -1
  419. package/dist/esm-es5/{luxon-38ca2169.js → luxon-578505e2.js} +1 -1
  420. package/dist/esm-es5/mint-components.js +1 -1
  421. package/dist/esm-es5/{mixins-f60a614c.js → mixins-59fd94b7.js} +0 -0
  422. package/dist/esm-es5/raisins-plop-target.entry.js +1 -1
  423. package/dist/esm-es5/{re-render-f444e556.js → re-render-2c1d8030.js} +1 -1
  424. package/dist/esm-es5/{sqm-asset-card-view-08e68656.js → sqm-asset-card-view-68f80b85.js} +1 -1
  425. package/dist/esm-es5/sqm-asset-card.entry.js +1 -1
  426. package/dist/esm-es5/sqm-big-stat_35.entry.js +1 -1
  427. package/dist/esm-es5/sqm-empty_5.entry.js +1 -1
  428. package/dist/esm-es5/sqm-form-message.entry.js +1 -1
  429. package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
  430. package/dist/esm-es5/{sqm-hero-view-93fac447.js → sqm-hero-view-1f148798.js} +1 -1
  431. package/dist/esm-es5/sqm-hero.entry.js +1 -1
  432. package/dist/esm-es5/{sqm-leaderboard-rank-view-10657658.js → sqm-leaderboard-rank-view-da91f5f3.js} +0 -0
  433. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  434. package/dist/esm-es5/{sqm-navigation-sidebar-item-view-fb10e0c2.js → sqm-navigation-sidebar-item-view-b22b07a2.js} +1 -1
  435. package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
  436. package/dist/esm-es5/{sqm-navigation-sidebar-view-06d444ca.js → sqm-navigation-sidebar-view-9cb9a5f4.js} +1 -1
  437. package/dist/esm-es5/sqm-navigation-sidebar.entry.js +1 -1
  438. package/dist/esm-es5/sqm-password-field.entry.js +1 -1
  439. package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
  440. package/dist/esm-es5/sqm-portal-container-view-5d6f1411.js +1 -0
  441. package/dist/esm-es5/{sqm-portal-email-verification-view-f6daf315.js → sqm-portal-email-verification-view-3dad1010.js} +1 -1
  442. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  443. package/dist/esm-es5/{sqm-portal-footer-view-42db3277.js → sqm-portal-footer-view-c35314a2.js} +1 -1
  444. package/dist/esm-es5/sqm-portal-footer.entry.js +1 -1
  445. package/dist/esm-es5/{sqm-portal-forgot-password-view-86d13eef.js → sqm-portal-forgot-password-view-f7239087.js} +1 -1
  446. package/dist/esm-es5/sqm-portal-forgot-password.entry.js +1 -1
  447. package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
  448. package/dist/esm-es5/{sqm-portal-profile-view-dd2774b2.js → sqm-portal-profile-view-3d621db8.js} +1 -1
  449. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  450. package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
  451. package/dist/esm-es5/{sqm-portal-reset-password-view-213b3af6.js → sqm-portal-reset-password-view-e0436989.js} +1 -1
  452. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  453. package/dist/esm-es5/sqm-portal-section-view-c8d1c727.js +1 -0
  454. package/dist/esm-es5/{sqm-portal-verify-email-view-c32dfd7e.js → sqm-portal-verify-email-view-c489166b.js} +1 -1
  455. package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
  456. package/dist/esm-es5/sqm-qa-referral-card.entry.js +1 -1
  457. package/dist/esm-es5/sqm-qa-tabs.entry.js +1 -1
  458. package/dist/esm-es5/sqm-qa.entry.js +1 -1
  459. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  460. package/dist/esm-es5/sqm-rewards-table-customer-note-cell.entry.js +1 -1
  461. package/dist/esm-es5/sqm-rewards-table-customer-note-column.entry.js +1 -1
  462. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
  463. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  464. package/dist/esm-es5/sqm-tabs.entry.js +1 -1
  465. package/dist/esm-es5/{sqm-text-span-view-0ba1484d.js → sqm-text-span-view-020db63f.js} +1 -1
  466. package/dist/esm-es5/sqm-text-span.entry.js +1 -1
  467. package/dist/esm-es5/{stencil-hooks.module-66fea7dc.js → stencil-hooks.module-e39af977.js} +1 -1
  468. package/dist/esm-es5/use-callback-697e2ff0.js +1 -0
  469. package/dist/esm-es5/useChildElements-0eab9c95.js +1 -0
  470. package/dist/esm-es5/{useReferralTable-0a8ee3b7.js → useReferralTable-3513622d.js} +1 -1
  471. package/dist/esm-es5/{utils-334c1e34.js → utils-d7bbb0e2.js} +0 -0
  472. package/dist/mint-components/global/styles.ts +729 -739
  473. package/dist/mint-components/mint-components.esm.js +1 -1
  474. package/dist/mint-components/mint-components.js +1 -1
  475. package/dist/mint-components/{p-b02064c4.system.js → p-066a4b23.system.js} +2 -2
  476. package/dist/mint-components/{p-5a7f7362.system.js → p-0935fef5.system.js} +1 -1
  477. package/dist/mint-components/p-0ec3b3e5.system.js +1 -0
  478. package/dist/mint-components/{p-e0140005.system.entry.js → p-127e25e6.system.entry.js} +1 -1
  479. package/dist/mint-components/{p-3abbc5b3.system.js → p-13f034ac.system.js} +1 -1
  480. package/dist/mint-components/{p-ffe8c6ce.system.entry.js → p-15b1a2b2.system.entry.js} +1 -1
  481. package/dist/mint-components/{p-5928afc0.js → p-16b6aea4.js} +1 -1
  482. package/dist/mint-components/p-174767c7.entry.js +1 -0
  483. package/dist/mint-components/{p-b0668789.system.js → p-190d0446.system.js} +1 -1
  484. package/dist/mint-components/p-1b3afdee.entry.js +159 -0
  485. package/dist/mint-components/{p-5e6890eb.system.entry.js → p-1e13c65a.system.entry.js} +1 -1
  486. package/dist/mint-components/p-242d76ee.system.entry.js +1 -0
  487. package/dist/mint-components/p-24f8c2f6.entry.js +1 -0
  488. package/dist/mint-components/{p-bd32d6f4.js → p-25846611.js} +2 -2
  489. package/dist/mint-components/{p-d5d32d0d.system.js → p-2800ad44.system.js} +0 -0
  490. package/dist/mint-components/p-2bed0c6a.entry.js +9 -0
  491. package/dist/mint-components/{p-78c7b4b7.js → p-30b3592f.js} +1 -1
  492. package/dist/mint-components/{p-22b45a04.system.entry.js → p-3149462a.system.entry.js} +1 -1
  493. package/dist/mint-components/p-353a6419.system.js +1 -0
  494. package/dist/mint-components/{p-9bb39058.system.entry.js → p-36578b9f.system.entry.js} +1 -1
  495. package/dist/mint-components/{p-1c24a18c.js → p-380b25a3.js} +1 -1
  496. package/dist/mint-components/{p-1b962e50.system.js → p-38889f3c.system.js} +1 -1
  497. package/dist/mint-components/{p-e6eedd9e.js → p-3894495a.js} +1 -1
  498. package/dist/mint-components/{p-1bd5cd35.system.entry.js → p-39c637da.system.entry.js} +1 -1
  499. package/dist/mint-components/p-408f983a.system.js +1 -0
  500. package/dist/mint-components/{p-9bac73dc.system.js → p-4519c6d9.system.js} +1 -1
  501. package/dist/mint-components/{p-210cd41b.js → p-46416f3e.js} +1 -1
  502. package/dist/mint-components/{p-c88cb982.entry.js → p-4647ef97.entry.js} +1 -1
  503. package/dist/mint-components/{p-d1e6d105.system.entry.js → p-46ab109e.system.entry.js} +1 -1
  504. package/dist/mint-components/{p-dd627dd0.entry.js → p-48a1e759.entry.js} +1 -1
  505. package/dist/mint-components/p-491eb934.system.entry.js +1 -0
  506. package/dist/mint-components/{p-09551f97.entry.js → p-4d4fbaec.entry.js} +1 -1
  507. package/dist/mint-components/{p-d5e12393.system.entry.js → p-50ef8db6.system.entry.js} +1 -1
  508. package/dist/mint-components/{p-ea1b0e1c.js → p-541460a6.js} +2 -2
  509. package/dist/mint-components/p-54694cd4.system.js +1 -0
  510. package/dist/mint-components/p-54bad89f.system.entry.js +1 -0
  511. package/dist/mint-components/{p-a6291305.system.entry.js → p-555c9e1d.system.entry.js} +1 -1
  512. package/dist/mint-components/{p-f6934a55.system.js → p-573c4b39.system.js} +0 -0
  513. package/dist/mint-components/p-59d481ea.entry.js +1 -0
  514. package/dist/mint-components/{p-c2b5997d.entry.js → p-5c454d18.entry.js} +1 -1
  515. package/dist/mint-components/{p-29f82c6d.system.entry.js → p-5dd4dcc7.system.entry.js} +1 -1
  516. package/dist/mint-components/{p-2cac212f.system.js → p-5fca1bb9.system.js} +1 -1
  517. package/dist/mint-components/{p-61eeea9e.entry.js → p-6073e2f7.entry.js} +1 -1
  518. package/dist/mint-components/{p-e907c45c.system.js → p-6081728e.system.js} +1 -1
  519. package/dist/mint-components/{p-cc6f7cb5.entry.js → p-60e2423f.entry.js} +1 -1
  520. package/dist/mint-components/{p-02be1a88.js → p-61ff3ceb.js} +0 -0
  521. package/dist/mint-components/p-63617b4b.system.entry.js +1 -0
  522. package/dist/mint-components/p-673a731f.entry.js +1 -0
  523. package/dist/mint-components/p-684967e6.entry.js +1 -0
  524. package/dist/mint-components/{p-380c3d58.system.entry.js → p-6882941e.system.entry.js} +1 -1
  525. package/dist/mint-components/{p-f9056e14.system.js → p-6e0c7f7c.system.js} +1 -1
  526. package/dist/mint-components/p-6e2ca2a0.js +1 -0
  527. package/dist/mint-components/p-6fc2fea4.entry.js +1 -0
  528. package/dist/mint-components/p-6fd0198e.js +1 -0
  529. package/dist/mint-components/{p-986f10d2.system.js → p-72b3562a.system.js} +1 -1
  530. package/dist/mint-components/{p-2ec62a9b.system.entry.js → p-7473b40b.system.entry.js} +1 -1
  531. package/dist/mint-components/p-75982d34.system.js +1 -0
  532. package/dist/mint-components/p-77e5a1d4.entry.js +1 -0
  533. package/dist/mint-components/p-7fd6f6ef.system.entry.js +1 -0
  534. package/dist/mint-components/p-86fcb500.system.entry.js +1 -0
  535. package/dist/mint-components/{p-958d913e.js → p-8763472e.js} +1 -1
  536. package/dist/mint-components/{p-4a0ef2d3.entry.js → p-889dbba5.entry.js} +1 -1
  537. package/dist/mint-components/{p-d7d007fb.system.entry.js → p-88a2e66e.system.entry.js} +1 -1
  538. package/dist/mint-components/{p-192617e7.system.js → p-894cf728.system.js} +1 -1
  539. package/dist/mint-components/{p-d1aef95c.entry.js → p-8d445a96.entry.js} +1 -1
  540. package/dist/mint-components/{p-b22b94ac.js → p-903a6d4d.js} +1 -1
  541. package/dist/mint-components/{p-1644c8e4.js → p-916a8f50.js} +1 -1
  542. package/dist/mint-components/p-92110eef.entry.js +1 -0
  543. package/dist/mint-components/{p-a53d815e.system.js → p-937bf427.system.js} +1 -1
  544. package/dist/mint-components/{p-092d030a.system.js → p-967445d6.system.js} +1 -1
  545. package/dist/mint-components/{p-e8acccb5.system.js → p-96b0537b.system.js} +1 -1
  546. package/dist/mint-components/p-9744ae44.system.js +1 -0
  547. package/dist/mint-components/{p-51dd860c.system.entry.js → p-97483814.system.entry.js} +1 -1
  548. package/dist/mint-components/{p-f2bd9120.system.entry.js → p-991d3c0c.system.entry.js} +1 -1
  549. package/dist/mint-components/{p-9ec99ced.js → p-9c5f124f.js} +0 -0
  550. package/dist/mint-components/p-9f082483.js +268 -0
  551. package/dist/mint-components/{p-6b5fbbdb.js → p-9f08dc58.js} +1 -1
  552. package/dist/mint-components/{p-27a8ee57.system.entry.js → p-9f54769f.system.entry.js} +1 -1
  553. package/dist/mint-components/p-9f5e7313.entry.js +33 -0
  554. package/dist/mint-components/{p-b7e6ce3c.system.js → p-a1b9ca51.system.js} +1 -1
  555. package/dist/mint-components/p-a73784bb.entry.js +1 -0
  556. package/dist/mint-components/{p-6333265f.system.js → p-a92677a0.system.js} +0 -0
  557. package/dist/mint-components/{p-95f70cb1.js → p-aa0ccc8d.js} +1 -1
  558. package/dist/mint-components/{p-275cf42f.js → p-ab2cbd56.js} +1 -1
  559. package/dist/mint-components/{p-d8876d3f.js → p-ab8f86d3.js} +0 -0
  560. package/dist/mint-components/{p-2c4da197.entry.js → p-ac80106e.entry.js} +1 -1
  561. package/dist/mint-components/{p-0a898ab1.js → p-b3af1c6f.js} +0 -0
  562. package/dist/mint-components/{p-2b2ed97b.entry.js → p-b3fa7c87.entry.js} +1 -1
  563. package/dist/mint-components/{p-5d80f75a.entry.js → p-b8452e47.entry.js} +2 -2
  564. package/dist/mint-components/p-be45347d.entry.js +1 -0
  565. package/dist/mint-components/{p-e2bf9132.system.js → p-be4cfea0.system.js} +1 -1
  566. package/dist/mint-components/{p-49e61dc4.entry.js → p-bed4977e.entry.js} +1 -1
  567. package/dist/mint-components/{p-6b5e355c.system.js → p-bf055b6c.system.js} +0 -0
  568. package/dist/mint-components/{p-c9977e50.system.entry.js → p-bf29e206.system.entry.js} +1 -1
  569. package/dist/mint-components/{p-ec689579.js → p-c5573b7c.js} +1 -1
  570. package/dist/mint-components/{p-433f243c.system.entry.js → p-c8c83a9e.system.entry.js} +1 -1
  571. package/dist/mint-components/{p-5da081c3.entry.js → p-ccbacc32.entry.js} +1 -1
  572. package/dist/mint-components/p-cee807de.system.entry.js +1 -0
  573. package/dist/mint-components/p-cf7d0aee.js +1 -0
  574. package/dist/mint-components/{p-3364ee29.system.entry.js → p-d298e4c5.system.entry.js} +1 -1
  575. package/dist/mint-components/{p-8390e33e.system.entry.js → p-d30d1664.system.entry.js} +1 -1
  576. package/dist/mint-components/{p-7dff3e29.entry.js → p-d9488d28.entry.js} +1 -1
  577. package/dist/mint-components/p-dc564561.js +1 -0
  578. package/dist/mint-components/{p-8a0cf4be.system.js → p-dc7b06ef.system.js} +1 -1
  579. package/dist/mint-components/{p-89d8133d.entry.js → p-e4f4bfbb.entry.js} +1 -1
  580. package/dist/mint-components/{p-3c8becd3.js → p-e8f5f4e0.js} +1 -1
  581. package/dist/mint-components/p-ea03ec68.system.entry.js +1 -0
  582. package/dist/mint-components/p-eb2f96a0.system.js +1 -0
  583. package/dist/mint-components/p-ec5b69bd.system.entry.js +1 -0
  584. package/dist/mint-components/{p-b1441d8e.system.entry.js → p-ec634002.system.entry.js} +1 -1
  585. package/dist/mint-components/p-edb569b8.js +1 -0
  586. package/dist/mint-components/p-ee461c80.js +1 -0
  587. package/dist/mint-components/p-f33e65c8.entry.js +1 -0
  588. package/dist/mint-components/p-f55d96ad.entry.js +99 -0
  589. package/dist/mint-components/{p-50cb9888.js → p-fb5163d7.js} +1 -1
  590. package/dist/types/ShadowViewAddon.d.ts +6 -6
  591. package/dist/types/components/raisins-plop-target/raisins-plop-target.d.ts +9 -0
  592. package/dist/types/components/sqm-asset-card/AssetCard.stories.d.ts +7 -7
  593. package/dist/types/components/sqm-asset-card/sqm-asset-card-view.d.ts +8 -8
  594. package/dist/types/components/sqm-asset-card/sqm-asset-card.d.ts +24 -24
  595. package/dist/types/components/sqm-asset-card/useAssetCard.d.ts +7 -7
  596. package/dist/types/components/sqm-big-stat/BigStat.stories.d.ts +16 -16
  597. package/dist/types/components/sqm-big-stat/UseBigStat.stories.d.ts +196 -196
  598. package/dist/types/components/sqm-big-stat/sqm-big-stat-view.d.ts +15 -10
  599. package/dist/types/components/sqm-big-stat/sqm-big-stat.d.ts +80 -55
  600. package/dist/types/components/sqm-big-stat/useBigStat.d.ts +22 -22
  601. package/dist/types/components/sqm-big-stat/useDemoBigStat.d.ts +3 -3
  602. package/dist/types/components/sqm-brand/SqmBrand.stories.d.ts +10 -10
  603. package/dist/types/components/sqm-brand/sqm-brand.d.ts +40 -26
  604. package/dist/types/components/sqm-card-feed/CardFeed.stories.d.ts +13 -13
  605. package/dist/types/components/sqm-card-feed/sqm-card-feed-view.d.ts +9 -6
  606. package/dist/types/components/sqm-card-feed/sqm-card-feed.d.ts +36 -21
  607. package/dist/types/components/sqm-checkbox-field/CheckboxField.stories.d.ts +55 -55
  608. package/dist/types/components/sqm-checkbox-field/UseCheckboxField.stories.d.ts +37 -37
  609. package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field-view.d.ts +19 -19
  610. package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field.d.ts +43 -43
  611. package/dist/types/components/sqm-checkbox-field/useCheckboxField.d.ts +9 -9
  612. package/dist/types/components/sqm-divided-layout/DividedLayout.stories.d.ts +7 -7
  613. package/dist/types/components/sqm-divided-layout/sqm-divided-layout-view.d.ts +7 -7
  614. package/dist/types/components/sqm-divided-layout/sqm-divided-layout.d.ts +23 -23
  615. package/dist/types/components/sqm-dropdown-field/DropdownField.stories.d.ts +28 -28
  616. package/dist/types/components/sqm-dropdown-field/UseDropdownField.stories.d.ts +22 -22
  617. package/dist/types/components/sqm-dropdown-field/sqm-dropdown-field-view.d.ts +15 -15
  618. package/dist/types/components/sqm-dropdown-field/sqm-dropdown-field.d.ts +33 -33
  619. package/dist/types/components/sqm-dropdown-field/useDropdownField.d.ts +5 -5
  620. package/dist/types/components/sqm-edit-profile/EditProfileForm.stories.d.ts +7 -7
  621. package/dist/types/components/sqm-edit-profile/UseEditProfile.stories.d.ts +10 -10
  622. package/dist/types/components/sqm-edit-profile/sqm-edit-profile-view.d.ts +37 -37
  623. package/dist/types/components/sqm-edit-profile/sqm-edit-profile.d.ts +51 -51
  624. package/dist/types/components/sqm-edit-profile/useEditProfile.d.ts +12 -12
  625. package/dist/types/components/sqm-empty/EmptyState.stories.d.ts +9 -9
  626. package/dist/types/components/sqm-empty/sqm-empty-view.d.ts +6 -6
  627. package/dist/types/components/sqm-empty/sqm-empty.d.ts +19 -19
  628. package/dist/types/components/sqm-form-message/FormMessage.stories.d.ts +8 -8
  629. package/dist/types/components/sqm-form-message/sqm-form-message.d.ts +19 -19
  630. package/dist/types/components/sqm-graphql-client-provider/sqm-graphql-client-provider.d.ts +14 -14
  631. package/dist/types/components/sqm-graphql-client-provider/useGraphQLProvider.d.ts +3 -3
  632. package/dist/types/components/sqm-hero/Hero.stories.d.ts +16 -16
  633. package/dist/types/components/sqm-hero/sqm-hero-view.d.ts +15 -15
  634. package/dist/types/components/sqm-hero/sqm-hero.d.ts +42 -42
  635. package/dist/types/components/sqm-hero-image/HeroImage.stories.d.ts +23 -23
  636. package/dist/types/components/sqm-hero-image/sqm-hero-image-view.d.ts +22 -21
  637. package/dist/types/components/sqm-hero-image/sqm-hero-image.d.ts +106 -102
  638. package/dist/types/components/sqm-hook-story-container/sqm-hook-story-container.d.ts +11 -11
  639. package/dist/types/components/sqm-image/Image.stories.d.ts +13 -13
  640. package/dist/types/components/sqm-image/sqm-image-view.d.ts +10 -9
  641. package/dist/types/components/sqm-image/sqm-image.d.ts +37 -33
  642. package/dist/types/components/sqm-input-field/InputField.stories.d.ts +15 -15
  643. package/dist/types/components/sqm-input-field/UseInputField.stories.d.ts +49 -49
  644. package/dist/types/components/sqm-input-field/sqm-input-field-view.d.ts +14 -14
  645. package/dist/types/components/sqm-input-field/sqm-input-field.d.ts +42 -42
  646. package/dist/types/components/sqm-input-field/useInputField.d.ts +5 -5
  647. package/dist/types/components/sqm-leaderboard/Leaderboard.stories.d.ts +17 -17
  648. package/dist/types/components/sqm-leaderboard/UseLeaderboard.stories.d.ts +52 -52
  649. package/dist/types/components/sqm-leaderboard/sqm-leaderboard-view.d.ts +37 -37
  650. package/dist/types/components/sqm-leaderboard/sqm-leaderboard.d.ts +80 -80
  651. package/dist/types/components/sqm-leaderboard/useLeaderboard.d.ts +31 -31
  652. package/dist/types/components/sqm-leaderboard-rank/LeaderboardRank.stories.d.ts +10 -10
  653. package/dist/types/components/sqm-leaderboard-rank/sqm-leaderboard-rank-view.d.ts +6 -6
  654. package/dist/types/components/sqm-leaderboard-rank/sqm-leaderboard-rank.d.ts +53 -53
  655. package/dist/types/components/sqm-leaderboard-rank/useLeaderboardRank.d.ts +10 -10
  656. package/dist/types/components/sqm-name-fields/NameFields.stories.d.ts +9 -9
  657. package/dist/types/components/sqm-name-fields/sqm-name-fields-view.d.ts +11 -11
  658. package/dist/types/components/sqm-name-fields/sqm-name-fields.d.ts +24 -24
  659. package/dist/types/components/sqm-name-fields/useNameFields.d.ts +10 -10
  660. package/dist/types/components/sqm-navigation-menu/sqm-navigation-menu-view.d.ts +15 -15
  661. package/dist/types/components/sqm-navigation-menu/sqm-navigation-menu.d.ts +26 -26
  662. package/dist/types/components/sqm-navigation-menu/useNavigationMenu.d.ts +3 -3
  663. package/dist/types/components/sqm-navigation-sidebar/NavigationSidebar.stories.d.ts +5 -5
  664. package/dist/types/components/sqm-navigation-sidebar/sqm-navigation-sidebar-view.d.ts +4 -4
  665. package/dist/types/components/sqm-navigation-sidebar/sqm-navigation-sidebar.d.ts +11 -11
  666. package/dist/types/components/sqm-navigation-sidebar-item/SidebarItem.stories.d.ts +6 -6
  667. package/dist/types/components/sqm-navigation-sidebar-item/sqm-navigation-sidebar-item-view.d.ts +11 -11
  668. package/dist/types/components/sqm-navigation-sidebar-item/sqm-navigation-sidebar-item.d.ts +29 -29
  669. package/dist/types/components/sqm-navigation-sidebar-item/useNavigationSidebarItem.d.ts +3 -3
  670. package/dist/types/components/sqm-password-field/PasswordField.stories.d.ts +7 -7
  671. package/dist/types/components/sqm-password-field/passwordValidation.d.ts +1 -1
  672. package/dist/types/components/sqm-password-field/sqm-password-field-view.d.ts +15 -15
  673. package/dist/types/components/sqm-password-field/sqm-password-field.d.ts +35 -35
  674. package/dist/types/components/sqm-password-field/usePasswordField.d.ts +3 -3
  675. package/dist/types/components/sqm-popup-container/sqm-popup-container-view.d.ts +4 -4
  676. package/dist/types/components/sqm-popup-container/sqm-popup-container.d.ts +45 -43
  677. package/dist/types/components/sqm-popup-container/usePopupContainer.d.ts +33 -33
  678. package/dist/types/components/sqm-portal-change-password/ChangePassword.stories.d.ts +13 -13
  679. package/dist/types/components/sqm-portal-change-password/sqm-portal-change-password-view.d.ts +23 -23
  680. package/dist/types/components/sqm-portal-change-password/sqm-portal-change-password.d.ts +60 -60
  681. package/dist/types/components/sqm-portal-change-password/usePortalChangePassword.d.ts +24 -24
  682. package/dist/types/components/sqm-portal-container/PortalContainer.stories.d.ts +21 -21
  683. package/dist/types/components/sqm-portal-container/sqm-portal-container-view.d.ts +16 -14
  684. package/dist/types/components/sqm-portal-container/sqm-portal-container.d.ts +70 -61
  685. package/dist/types/components/sqm-portal-email-verification/PortalEmailVerification.stories.d.ts +11 -11
  686. package/dist/types/components/sqm-portal-email-verification/sqm-portal-email-verification-view.d.ts +17 -17
  687. package/dist/types/components/sqm-portal-email-verification/sqm-portal-email-verification.d.ts +34 -34
  688. package/dist/types/components/sqm-portal-email-verification/usePortalEmailVerification.d.ts +17 -17
  689. package/dist/types/components/sqm-portal-footer/PortalFooter.stories.d.ts +12 -12
  690. package/dist/types/components/sqm-portal-footer/PoweredByImg.d.ts +7 -7
  691. package/dist/types/components/sqm-portal-footer/sqm-portal-footer-view.d.ts +16 -16
  692. package/dist/types/components/sqm-portal-footer/sqm-portal-footer.d.ts +58 -57
  693. package/dist/types/components/sqm-portal-forgot-password/PortalForgotPassword.stories.d.ts +11 -11
  694. package/dist/types/components/sqm-portal-forgot-password/sqm-portal-forgot-password-view.d.ts +18 -18
  695. package/dist/types/components/sqm-portal-forgot-password/sqm-portal-forgot-password.d.ts +34 -34
  696. package/dist/types/components/sqm-portal-forgot-password/usePortalForgotPassword.d.ts +12 -12
  697. package/dist/types/components/sqm-portal-frame/PortalFrame.stories.d.ts +8 -8
  698. package/dist/types/components/sqm-portal-frame/sqm-portal-frame-view.d.ts +11 -11
  699. package/dist/types/components/sqm-portal-frame/sqm-portal-frame.d.ts +16 -16
  700. package/dist/types/components/sqm-portal-frame/usePortalFrame.d.ts +3 -3
  701. package/dist/types/components/sqm-portal-login/PortalLogin.stories.d.ts +7 -7
  702. package/dist/types/components/sqm-portal-login/sqm-portal-login-view.d.ts +20 -20
  703. package/dist/types/components/sqm-portal-login/sqm-portal-login.d.ts +68 -68
  704. package/dist/types/components/sqm-portal-login/usePortalLogin.d.ts +11 -11
  705. package/dist/types/components/sqm-portal-logout/sqm-portal-logout.d.ts +13 -13
  706. package/dist/types/components/sqm-portal-logout/usePortalLogout.d.ts +3 -3
  707. package/dist/types/components/sqm-portal-profile/PortalProfile.stories.d.ts +10 -10
  708. package/dist/types/components/sqm-portal-profile/sqm-portal-profile-view.d.ts +37 -37
  709. package/dist/types/components/sqm-portal-profile/sqm-portal-profile.d.ts +58 -58
  710. package/dist/types/components/sqm-portal-profile/usePortalProfile.d.ts +12 -12
  711. package/dist/types/components/sqm-portal-protected-route/sqm-portal-protected-route.d.ts +22 -22
  712. package/dist/types/components/sqm-portal-protected-route/usePortalProtectedRoute.d.ts +7 -7
  713. package/dist/types/components/sqm-portal-register/PortalRegister.stories.d.ts +10 -10
  714. package/dist/types/components/sqm-portal-register/sqm-portal-register-view.d.ts +32 -32
  715. package/dist/types/components/sqm-portal-register/sqm-portal-register.d.ts +76 -76
  716. package/dist/types/components/sqm-portal-register/usePortalRegister.d.ts +25 -25
  717. package/dist/types/components/sqm-portal-register/useValidationState.d.ts +18 -18
  718. package/dist/types/components/sqm-portal-reset-password/PortalResetPassword.stories.d.ts +13 -13
  719. package/dist/types/components/sqm-portal-reset-password/sqm-portal-reset-password-view.d.ts +26 -26
  720. package/dist/types/components/sqm-portal-reset-password/sqm-portal-reset-password.d.ts +63 -63
  721. package/dist/types/components/sqm-portal-reset-password/usePortalResetPassword.d.ts +3 -3
  722. package/dist/types/components/sqm-portal-verify-email/PortalVerifyEmail.stories.d.ts +9 -9
  723. package/dist/types/components/sqm-portal-verify-email/sqm-portal-verify-email-view.d.ts +15 -15
  724. package/dist/types/components/sqm-portal-verify-email/sqm-portal-verify-email.d.ts +28 -28
  725. package/dist/types/components/sqm-portal-verify-email/usePortalVerifyEmail.d.ts +17 -17
  726. package/dist/types/components/sqm-program-explainer/ProgramExplainer.stories.d.ts +12 -12
  727. package/dist/types/components/sqm-program-explainer/sqm-program-explainer-view.d.ts +7 -7
  728. package/dist/types/components/sqm-program-explainer/sqm-program-explainer.d.ts +28 -28
  729. package/dist/types/components/sqm-program-explainer-step/ProgramExplainerStep.stories.d.ts +9 -9
  730. package/dist/types/components/sqm-program-explainer-step/sqm-program-explainer-step-view.d.ts +9 -9
  731. package/dist/types/components/sqm-program-explainer-step/sqm-program-explainer-step.d.ts +46 -46
  732. package/dist/types/components/sqm-program-menu/ProgramMenu.stories.d.ts +28 -28
  733. package/dist/types/components/sqm-program-menu/sqm-program-menu.d.ts +10 -10
  734. package/dist/types/components/sqm-program-menu/useProgramMenu.d.ts +13 -13
  735. package/dist/types/components/sqm-qa/sqm-qa.d.ts +255 -250
  736. package/dist/types/components/sqm-qa-referral-card/ReferralCard.stories.d.ts +14 -14
  737. package/dist/types/components/sqm-qa-referral-card/sqm-referral-card-view.d.ts +9 -9
  738. package/dist/types/components/sqm-qa-referral-card/sqm-referral-card.d.ts +20 -20
  739. package/dist/types/components/sqm-qa-tabs/Tabs.stories.d.ts +15 -15
  740. package/dist/types/components/sqm-qa-tabs/sqm-tabs-view.d.ts +9 -9
  741. package/dist/types/components/sqm-qa-tabs/sqm-tabs.d.ts +23 -23
  742. package/dist/types/components/sqm-qa-tabs/useTabs.d.ts +9 -9
  743. package/dist/types/components/sqm-referral-card/ReferralCard.stories.d.ts +14 -14
  744. package/dist/types/components/sqm-referral-card/sqm-referral-card-view.d.ts +15 -9
  745. package/dist/types/components/sqm-referral-card/sqm-referral-card.d.ts +46 -19
  746. package/dist/types/components/sqm-referral-iframe/ReferralIframe.stories.d.ts +9 -9
  747. package/dist/types/components/sqm-referral-iframe/sqm-referral-iframe-view.d.ts +13 -13
  748. package/dist/types/components/sqm-referral-iframe/sqm-referral-iframe.d.ts +32 -32
  749. package/dist/types/components/sqm-referral-iframe/useReferralIframe.d.ts +3 -3
  750. package/dist/types/components/sqm-referral-table/ReferralTable.stories.d.ts +18 -18
  751. package/dist/types/components/sqm-referral-table/ReferralTableCell.stories.d.ts +13 -13
  752. package/dist/types/components/sqm-referral-table/ReferralTableRewardsCell.stories.d.ts +23 -23
  753. package/dist/types/components/sqm-referral-table/UseReferralTable.stories.d.ts +40 -40
  754. package/dist/types/components/sqm-referral-table/cells/sqm-referral-table-cell.d.ts +7 -7
  755. package/dist/types/components/sqm-referral-table/cells/sqm-referral-table-date-cell.d.ts +8 -8
  756. package/dist/types/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.d.ts +12 -12
  757. package/dist/types/components/sqm-referral-table/cells/sqm-referral-table-status-cell.d.ts +5 -5
  758. package/dist/types/components/sqm-referral-table/cells/sqm-referral-table-user-cell.d.ts +4 -4
  759. package/dist/types/components/sqm-referral-table/columns/ReferralTableColumn.d.ts +6 -6
  760. package/dist/types/components/sqm-referral-table/columns/sqm-referral-table-column.d.ts +16 -16
  761. package/dist/types/components/sqm-referral-table/columns/sqm-referral-table-date-column.d.ts +41 -41
  762. package/dist/types/components/sqm-referral-table/columns/sqm-referral-table-rewards-column.d.ts +62 -62
  763. package/dist/types/components/sqm-referral-table/columns/sqm-referral-table-status-column.d.ts +27 -27
  764. package/dist/types/components/sqm-referral-table/columns/sqm-referral-table-user-column.d.ts +31 -31
  765. package/dist/types/components/sqm-referral-table/mockReferralData.d.ts +83 -83
  766. package/dist/types/components/sqm-referral-table/sqm-referral-table.d.ts +56 -56
  767. package/dist/types/components/sqm-referral-table/useReferralTable.d.ts +8 -8
  768. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeList.stories.d.ts +25 -25
  769. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +1064 -1064
  770. package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +5 -5
  771. package/dist/types/components/sqm-reward-exchange-list/UseRewardExchangeList.stories.d.ts +28 -28
  772. package/dist/types/components/sqm-reward-exchange-list/progressBar.d.ts +4 -4
  773. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +62 -62
  774. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list.d.ts +147 -147
  775. package/dist/types/components/sqm-reward-exchange-list/useRewardExchangeList.d.ts +88 -88
  776. package/dist/types/components/sqm-rewards-table/RewardsTable.stories.d.ts +14 -14
  777. package/dist/types/components/sqm-rewards-table/RewardsTableCell.stories.d.ts +39 -39
  778. package/dist/types/components/sqm-rewards-table/UseRewardsTable.stories.d.ts +40 -40
  779. package/dist/types/components/sqm-rewards-table/cells/sqm-rewards-table-customer-note-cell.d.ts +8 -8
  780. package/dist/types/components/sqm-rewards-table/cells/sqm-rewards-table-date-cell.d.ts +8 -8
  781. package/dist/types/components/sqm-rewards-table/cells/sqm-rewards-table-reward-cell.d.ts +8 -8
  782. package/dist/types/components/sqm-rewards-table/cells/sqm-rewards-table-source-cell.d.ts +10 -10
  783. package/dist/types/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.d.ts +11 -11
  784. package/dist/types/components/sqm-rewards-table/columns/RewardTableColumn.d.ts +5 -5
  785. package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-date-column.d.ts +29 -29
  786. package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-note-column.d.ts +18 -18
  787. package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-reward-column.d.ts +30 -30
  788. package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-source-column.d.ts +48 -48
  789. package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-status-column.d.ts +47 -47
  790. package/dist/types/components/sqm-rewards-table/mockRewardData.d.ts +45 -45
  791. package/dist/types/components/sqm-rewards-table/sqm-rewards-table.d.ts +43 -43
  792. package/dist/types/components/sqm-rewards-table/useRewardsTable.d.ts +6 -6
  793. package/dist/types/components/sqm-route/sqm-route.d.ts +16 -15
  794. package/dist/types/components/sqm-router/Router.stories.d.ts +28 -28
  795. package/dist/types/components/sqm-router/sqm-router.d.ts +10 -9
  796. package/dist/types/components/sqm-router/useRouter.d.ts +9 -9
  797. package/dist/types/components/sqm-scroll/Scroll.stories.d.ts +10 -10
  798. package/dist/types/components/sqm-scroll/sqm-scroll.d.ts +85 -85
  799. package/dist/types/components/sqm-scroll/useScroll.d.ts +6 -6
  800. package/dist/types/components/sqm-share-button/ShareButton.stories.d.ts +18 -18
  801. package/dist/types/components/sqm-share-button/UseShareButton.stories.d.ts +16 -16
  802. package/dist/types/components/sqm-share-button/sqm-share-button-view.d.ts +19 -19
  803. package/dist/types/components/sqm-share-button/sqm-share-button.d.ts +121 -121
  804. package/dist/types/components/sqm-share-button/useShareButton.d.ts +8 -8
  805. package/dist/types/components/sqm-share-code/ShareCode.stories.d.ts +10 -10
  806. package/dist/types/components/sqm-share-code/sqm-share-code.d.ts +36 -36
  807. package/dist/types/components/sqm-share-code/useShareCode.d.ts +8 -8
  808. package/dist/types/components/sqm-share-link/ShareLink.stories.d.ts +11 -11
  809. package/dist/types/components/sqm-share-link/UseShareLink.stories.d.ts +22 -22
  810. package/dist/types/components/sqm-share-link/sqm-share-link-view.d.ts +13 -8
  811. package/dist/types/components/sqm-share-link/sqm-share-link.d.ts +62 -36
  812. package/dist/types/components/sqm-share-link/useShareLink.d.ts +8 -8
  813. package/dist/types/components/sqm-stat-container/sqm-stat-container-view.d.ts +8 -6
  814. package/dist/types/components/sqm-stat-container/sqm-stat-container.d.ts +36 -27
  815. package/dist/types/components/sqm-stencilbook/AutoColor.d.ts +8 -8
  816. package/dist/types/components/sqm-stencilbook/CucumberAddon.d.ts +2 -2
  817. package/dist/types/components/sqm-stencilbook/HookStoryAddon.d.ts +8 -8
  818. package/dist/types/components/sqm-stencilbook/Matrix.d.ts +11 -11
  819. package/dist/types/components/sqm-stencilbook/Resizer.d.ts +3 -3
  820. package/dist/types/components/sqm-stencilbook/Themes.d.ts +17 -17
  821. package/dist/types/components/sqm-stencilbook/sqm-stencilbook.d.ts +11 -11
  822. package/dist/types/components/sqm-tab/sqm-tab-view.d.ts +4 -4
  823. package/dist/types/components/sqm-tab/sqm-tab.d.ts +12 -12
  824. package/dist/types/components/sqm-table-cell/sqm-table-cell.d.ts +11 -5
  825. package/dist/types/components/sqm-table-row/sqm-table-row.d.ts +11 -4
  826. package/dist/types/components/sqm-tabs/Tabs.stories.d.ts +15 -15
  827. package/dist/types/components/sqm-tabs/sqm-tabs-view.d.ts +9 -9
  828. package/dist/types/components/sqm-tabs/sqm-tabs.d.ts +23 -22
  829. package/dist/types/components/sqm-tabs/useTabs.d.ts +9 -9
  830. package/dist/types/components/sqm-task-card/DetailsView.d.ts +41 -41
  831. package/dist/types/components/sqm-task-card/SVGs.d.ts +3 -3
  832. package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +21 -21
  833. package/dist/types/components/sqm-task-card/UseTaskCard.stories.d.ts +16 -16
  834. package/dist/types/components/sqm-task-card/progress-bar/SVGs.d.ts +2 -2
  835. package/dist/types/components/sqm-task-card/progress-bar/progress-bar-view.d.ts +13 -13
  836. package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +35 -35
  837. package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +171 -171
  838. package/dist/types/components/sqm-task-card/useTaskCard.d.ts +11 -11
  839. package/dist/types/components/sqm-text/sqm-text.d.ts +20 -20
  840. package/dist/types/components/sqm-text-span/sqm-text-span-view.d.ts +5 -5
  841. package/dist/types/components/sqm-text-span/sqm-text-span.d.ts +22 -22
  842. package/dist/types/components/sqm-timeline/SVGs.d.ts +3 -3
  843. package/dist/types/components/sqm-timeline/Timeline.stories.d.ts +11 -11
  844. package/dist/types/components/sqm-timeline/sqm-timeline-entry-view.d.ts +10 -9
  845. package/dist/types/components/sqm-timeline/sqm-timeline-entry.d.ts +38 -33
  846. package/dist/types/components/sqm-timeline/sqm-timeline.d.ts +19 -19
  847. package/dist/types/components/sqm-titled-section/TitledSection.stories.d.ts +12 -12
  848. package/dist/types/components/sqm-titled-section/sqm-portal-section-view.d.ts +10 -10
  849. package/dist/types/components/sqm-titled-section/sqm-titled-section.d.ts +43 -43
  850. package/dist/types/components/sqm-user-name/UserName.stories.d.ts +6 -6
  851. package/dist/types/components/sqm-user-name/sqm-user-name-view.d.ts +6 -6
  852. package/dist/types/components/sqm-user-name/sqm-user-name.d.ts +27 -27
  853. package/dist/types/components/sqm-user-name/useUserName.d.ts +3 -3
  854. package/dist/types/components.d.ts +393 -225
  855. package/dist/types/fonts/GoogleFonts.d.ts +9 -9
  856. package/dist/types/global/android.d.ts +7 -7
  857. package/dist/types/global/global.d.ts +6 -6
  858. package/dist/types/global/mixins.d.ts +166 -166
  859. package/dist/types/global/styles.d.ts +2 -2
  860. package/dist/types/index.d.ts +1 -1
  861. package/dist/types/insertcss.d.ts +6 -6
  862. package/dist/types/saasquatch.d.ts +132 -132
  863. package/dist/types/stories/NewPortal.stories.d.ts +8 -8
  864. package/dist/types/stories/PortalTemplates.stories.d.ts +100 -100
  865. package/dist/types/stories/PoweredByImg.stories.d.ts +7 -7
  866. package/dist/types/stories/Widget.stories.d.ts +22 -22
  867. package/dist/types/stories/features.d.ts +4 -4
  868. package/dist/types/stories/templates.d.ts +4 -4
  869. package/dist/types/styling/JSS.d.ts +7 -7
  870. package/dist/types/tables/GenericTableView.d.ts +32 -32
  871. package/dist/types/tables/TableSlots.d.ts +9 -9
  872. package/dist/types/tables/re-render.d.ts +13 -13
  873. package/dist/types/tables/useChildElements.d.ts +1 -1
  874. package/dist/types/utilities.d.ts +3 -3
  875. package/dist/types/utils/RequiredPropsError.d.ts +10 -10
  876. package/dist/types/utils/isDemo.d.ts +4 -4
  877. package/dist/types/utils/utils.d.ts +14 -14
  878. package/docs/docs.docx +0 -0
  879. package/docs/raisins.json +1 -1
  880. package/grapesjs/grapesjs.js +54 -54
  881. package/package.json +102 -101
  882. package/readme.md +13 -13
  883. package/dist/cjs/sqm-portal-registration-form.cjs.entry.js +0 -309
  884. package/dist/cjs/useValidationState-63f00763.js +0 -3886
  885. package/dist/collection/assets/PoweredBySaaSquatch.png +0 -0
  886. package/dist/collection/assets/saasquatch-logo-wide.jpeg +0 -0
  887. package/dist/collection/assets/saasquatch-logo.png +0 -0
  888. package/dist/collection/components/sqm-portal-registration-form/PortalRegistrationForm.stories.js +0 -104
  889. package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form-view.js +0 -74
  890. package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form.js +0 -409
  891. package/dist/collection/components/sqm-portal-registration-form/usePortalRegistrationForm.js +0 -119
  892. package/dist/esm/sqm-portal-registration-form.entry.js +0 -305
  893. package/dist/esm/useValidationState-adb2b066.js +0 -3882
  894. package/dist/esm-es5/ShadowViewAddon-3626a92b.js +0 -1
  895. package/dist/esm-es5/sqm-portal-container-view-ca454627.js +0 -1
  896. package/dist/esm-es5/sqm-portal-registration-form.entry.js +0 -1
  897. package/dist/esm-es5/sqm-portal-section-view-6c249c74.js +0 -1
  898. package/dist/esm-es5/use-callback-69ec5c5c.js +0 -1
  899. package/dist/esm-es5/useChildElements-756c6a81.js +0 -1
  900. package/dist/esm-es5/useValidationState-adb2b066.js +0 -1
  901. package/dist/mint-components/p-0777ac5b.entry.js +0 -9
  902. package/dist/mint-components/p-0b7ec490.entry.js +0 -1
  903. package/dist/mint-components/p-0b838d31.entry.js +0 -1
  904. package/dist/mint-components/p-14e28fcc.entry.js +0 -1
  905. package/dist/mint-components/p-16beb451.system.entry.js +0 -1
  906. package/dist/mint-components/p-19266514.js +0 -1
  907. package/dist/mint-components/p-19b0e2b5.system.js +0 -1
  908. package/dist/mint-components/p-19dfb893.system.entry.js +0 -1
  909. package/dist/mint-components/p-1ff7ee8a.entry.js +0 -1
  910. package/dist/mint-components/p-23485cfe.system.js +0 -1
  911. package/dist/mint-components/p-27aac88b.system.entry.js +0 -1
  912. package/dist/mint-components/p-27ed7b95.js +0 -1
  913. package/dist/mint-components/p-2809a9c7.system.entry.js +0 -1
  914. package/dist/mint-components/p-33a8d572.entry.js +0 -33
  915. package/dist/mint-components/p-3c7b3831.entry.js +0 -1
  916. package/dist/mint-components/p-42133e0b.entry.js +0 -159
  917. package/dist/mint-components/p-42994d5d.entry.js +0 -99
  918. package/dist/mint-components/p-42d3eb3e.system.js +0 -1
  919. package/dist/mint-components/p-46ed891a.entry.js +0 -1
  920. package/dist/mint-components/p-4778fb68.js +0 -1
  921. package/dist/mint-components/p-4c2cec5c.system.entry.js +0 -1
  922. package/dist/mint-components/p-4c93df52.entry.js +0 -1
  923. package/dist/mint-components/p-5660e578.system.js +0 -1
  924. package/dist/mint-components/p-577299fe.system.entry.js +0 -1
  925. package/dist/mint-components/p-57b7a680.entry.js +0 -1
  926. package/dist/mint-components/p-80981da1.entry.js +0 -1
  927. package/dist/mint-components/p-8c1348dc.system.js +0 -1
  928. package/dist/mint-components/p-8dfe5873.system.entry.js +0 -1
  929. package/dist/mint-components/p-90bd03bb.entry.js +0 -1
  930. package/dist/mint-components/p-99830904.system.entry.js +0 -1
  931. package/dist/mint-components/p-9ef39196.system.entry.js +0 -1
  932. package/dist/mint-components/p-a3f87461.entry.js +0 -1
  933. package/dist/mint-components/p-a4fa8ba2.system.js +0 -1
  934. package/dist/mint-components/p-a9d7eb10.js +0 -1
  935. package/dist/mint-components/p-b17b4a61.system.entry.js +0 -1
  936. package/dist/mint-components/p-b5bfb818.system.js +0 -1
  937. package/dist/mint-components/p-bf298e68.js +0 -1
  938. package/dist/mint-components/p-c2aecbd1.js +0 -268
  939. package/dist/mint-components/p-c8e8aab7.js +0 -1
  940. package/dist/mint-components/p-ca2819e8.system.js +0 -1
  941. package/dist/mint-components/p-cdabe7a8.js +0 -1
  942. package/dist/mint-components/p-daf8de5c.entry.js +0 -1
  943. package/dist/types/components/sqm-portal-registration-form/PortalRegistrationForm.stories.d.ts +0 -10
  944. package/dist/types/components/sqm-portal-registration-form/sqm-portal-registration-form-view.d.ts +0 -32
  945. package/dist/types/components/sqm-portal-registration-form/sqm-portal-registration-form.d.ts +0 -76
  946. package/dist/types/components/sqm-portal-registration-form/usePortalRegistrationForm.d.ts +0 -25
  947. package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-plop-target.d.ts +0 -11
  948. package/docs/grapesjs.js +0 -54
@@ -1,3882 +0,0 @@
1
- import { y } from './stencil-hooks.module-66fea7dc.js';
2
- import { P } from './index.module-96470dcf.js';
3
-
4
- // This file is a workaround for a bug in web browsers' "native"
5
- // ES6 importing system which is uncapable of importing "*.json" files.
6
- // https://github.com/catamphetamine/libphonenumber-js/issues/239
7
- const metadata = {"version":4,"country_calling_codes":{"1":["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],"7":["RU","KZ"],"20":["EG"],"27":["ZA"],"30":["GR"],"31":["NL"],"32":["BE"],"33":["FR"],"34":["ES"],"36":["HU"],"39":["IT","VA"],"40":["RO"],"41":["CH"],"43":["AT"],"44":["GB","GG","IM","JE"],"45":["DK"],"46":["SE"],"47":["NO","SJ"],"48":["PL"],"49":["DE"],"51":["PE"],"52":["MX"],"53":["CU"],"54":["AR"],"55":["BR"],"56":["CL"],"57":["CO"],"58":["VE"],"60":["MY"],"61":["AU","CC","CX"],"62":["ID"],"63":["PH"],"64":["NZ"],"65":["SG"],"66":["TH"],"81":["JP"],"82":["KR"],"84":["VN"],"86":["CN"],"90":["TR"],"91":["IN"],"92":["PK"],"93":["AF"],"94":["LK"],"95":["MM"],"98":["IR"],"211":["SS"],"212":["MA","EH"],"213":["DZ"],"216":["TN"],"218":["LY"],"220":["GM"],"221":["SN"],"222":["MR"],"223":["ML"],"224":["GN"],"225":["CI"],"226":["BF"],"227":["NE"],"228":["TG"],"229":["BJ"],"230":["MU"],"231":["LR"],"232":["SL"],"233":["GH"],"234":["NG"],"235":["TD"],"236":["CF"],"237":["CM"],"238":["CV"],"239":["ST"],"240":["GQ"],"241":["GA"],"242":["CG"],"243":["CD"],"244":["AO"],"245":["GW"],"246":["IO"],"247":["AC"],"248":["SC"],"249":["SD"],"250":["RW"],"251":["ET"],"252":["SO"],"253":["DJ"],"254":["KE"],"255":["TZ"],"256":["UG"],"257":["BI"],"258":["MZ"],"260":["ZM"],"261":["MG"],"262":["RE","YT"],"263":["ZW"],"264":["NA"],"265":["MW"],"266":["LS"],"267":["BW"],"268":["SZ"],"269":["KM"],"290":["SH","TA"],"291":["ER"],"297":["AW"],"298":["FO"],"299":["GL"],"350":["GI"],"351":["PT"],"352":["LU"],"353":["IE"],"354":["IS"],"355":["AL"],"356":["MT"],"357":["CY"],"358":["FI","AX"],"359":["BG"],"370":["LT"],"371":["LV"],"372":["EE"],"373":["MD"],"374":["AM"],"375":["BY"],"376":["AD"],"377":["MC"],"378":["SM"],"380":["UA"],"381":["RS"],"382":["ME"],"383":["XK"],"385":["HR"],"386":["SI"],"387":["BA"],"389":["MK"],"420":["CZ"],"421":["SK"],"423":["LI"],"500":["FK"],"501":["BZ"],"502":["GT"],"503":["SV"],"504":["HN"],"505":["NI"],"506":["CR"],"507":["PA"],"508":["PM"],"509":["HT"],"590":["GP","BL","MF"],"591":["BO"],"592":["GY"],"593":["EC"],"594":["GF"],"595":["PY"],"596":["MQ"],"597":["SR"],"598":["UY"],"599":["CW","BQ"],"670":["TL"],"672":["NF"],"673":["BN"],"674":["NR"],"675":["PG"],"676":["TO"],"677":["SB"],"678":["VU"],"679":["FJ"],"680":["PW"],"681":["WF"],"682":["CK"],"683":["NU"],"685":["WS"],"686":["KI"],"687":["NC"],"688":["TV"],"689":["PF"],"690":["TK"],"691":["FM"],"692":["MH"],"850":["KP"],"852":["HK"],"853":["MO"],"855":["KH"],"856":["LA"],"880":["BD"],"886":["TW"],"960":["MV"],"961":["LB"],"962":["JO"],"963":["SY"],"964":["IQ"],"965":["KW"],"966":["SA"],"967":["YE"],"968":["OM"],"970":["PS"],"971":["AE"],"972":["IL"],"973":["BH"],"974":["QA"],"975":["BT"],"976":["MN"],"977":["NP"],"992":["TJ"],"993":["TM"],"994":["AZ"],"995":["GE"],"996":["KG"],"998":["UZ"]},"countries":{"AC":["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],"AD":["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],"AE":["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],"AF":["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],"AG":["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([457]\\d{6})$","268$1",0,"268"],"AI":["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2457]\\d{6})$","264$1",0,"264"],"AL":["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],"AM":["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],"AO":["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],"AR":["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],"AS":["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"1|([267]\\d{6})$","684$1",0,"684"],"AT":["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],"AU":["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7,8}|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"0|(183[12])",0,0,0,[["(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8]))\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:83[0-38]|93[0-4])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}",[6,8,10]]],"0011"],"AW":["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],"AX":["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],"AZ":["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365|46","1[28]|2|365(?:[0-46-9]|5[0-35-9])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],"BA":["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],"BB":["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","246$1",0,"246"],"BD":["880","00","1\\d{9}|2\\d{7,8}|88\\d{4,6}|(?:8[0-79]|9\\d)\\d{4,8}|(?:[346]\\d|[57])\\d{5,8}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:28|4[14]|5)|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],"BE":["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],"BF":["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],"BG":["359","00","[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],"BH":["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[047]"]]]],"BI":["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],"BJ":["229","00","[25689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[25689]"]]]],"BL":["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],"BM":["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","441$1",0,"441"],"BN":["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],"BO":["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],"BQ":["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],"BR":["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-24679]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],"BS":["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([3-8]\\d{6})$","242$1",0,"242"],"BT":["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],"BW":["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-79]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],"BY":["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],"BZ":["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],"CA":["1","011","(?:[2-8]\\d|90)\\d{8}",[10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|6[578])|4(?:03|1[68]|3[178]|50|74)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47|72)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\d{6}"],0,0,0,["600[2-9]\\d{6}"]]],"CC":["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d|8[0-24-9])\\d{7}|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:83[0-38]|93[0-4])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}",[6,8,10]]],"0011"],"CD":["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],"CF":["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],"CG":["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["801"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],"CH":["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],"CI":["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],"CK":["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],"CL":["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-3]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],"CM":["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],"CN":["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","(?:10|2[0-57-9])(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"0|(1(?:[12]\\d|79)\\d\\d)",0,0,0,0,"00"],"CO":["57","00(?:4(?:[14]4|56)|[579])","(?:(?:1\\d|3)\\d{3}|9101)\\d{6}|[124-8]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1 $2",["[14][2-9]|[25-8]"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["[39]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],"CR":["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],"CU":["53","119","[27]\\d{6,7}|[34]\\d{5,7}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["5"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],"CV":["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],"CW":["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],"CX":["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d|8[0-24-9])\\d{7}|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:83[0-38]|93[0-4])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}",[6,8,10]]],"0011"],"CY":["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],"CZ":["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],"DE":["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:[12]\\d|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[05]\\d|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[0568]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],"DJ":["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],"DK":["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],"DM":["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","767$1",0,"767"],"DO":["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],"DZ":["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],"EC":["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],"EE":["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],"EG":["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[189]"],"0$1"]],"0"],"EH":["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],"ER":["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],"ES":["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],"ET":["251","00","(?:11|[2-59]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-59]"],"0$1"]],"0"],"FI":["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d)(\\d{4,9})","$1 $2",["[2568][1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["[12]00|[368]|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[1245]|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],"FJ":["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],"FK":["500","00","[2-7]\\d{4}",[5]],"FM":["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],"FO":["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],"FR":["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],"GA":["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]]],0,0,"0(11\\d{6}|6[256]\\d{6}|7[47]\\d{6})","$1"],"GB":["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[023])|4(?:[0-5]\\d\\d|69[7-9]|70[059])|(?:5[0-26-9]|[78][0-49])\\d\\d|6(?:[0-4]\\d\\d|50[259]))|2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d\\d|1(?:[0-7]\\d\\d|8(?:[02]\\d|1[278])))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],"GD":["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","473$1",0,"473"],"GE":["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],"GF":["594","00","(?:[56]94|80\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"GG":["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"0|([25-9]\\d{5})$","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],"GH":["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],"GI":["350","00","(?:[25]\\d\\d|606)\\d{5}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],"GL":["299","00","(?:19|[2-689]\\d)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-689]"]]]],"GM":["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],"GN":["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],"GP":["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|1[0-2]|2[0-68]|3[1289]|4[0-24-9]|5[3-579]|6[0189]|7[08]|8[0-689]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],"GQ":["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],"GR":["30","00","5005000\\d{3}|8\\d{9,10}|(?:[269]\\d|70)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["8"]]]],"GT":["502","00","(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],"GU":["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"1|([3-9]\\d{6})$","671$1",0,"671"],"GW":["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],"GY":["592","001","(?:862\\d|9008)\\d{3}|(?:[2-46]\\d|77)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-46-9]"]]]],"HK":["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4}(?:\\d(?:\\d(?:\\d{4})?)?)?|(?:[235-79]\\d|46)\\d{6}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],"HN":["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],"HR":["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],"HT":["509","00","[2-489]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-489]"]]]],"HU":["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],"ID":["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],"IE":["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"IL":["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],"IM":["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([25-8]\\d{5})$","1624$1",0,"74576|(?:16|7[56])24"],"IN":["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],"IO":["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],"IQ":["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],"IR":["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],"IS":["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],"IT":["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[245])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1[4679]|[38]"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d\\d|89(?:2|4[5-9]\\d))\\d{3}|89[45][0-4]\\d\\d|(?:1(?:44|6[346])|89(?:5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],"JE":["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([0-24-8]\\d{5})$","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}"],["56\\d{8}"]]],"JM":["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],"JO":["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],"JP":["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:49|80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9]|636)|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9]|636[457-9])|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[27-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|51|6(?:[0-24]|36|5[0-3589]|72|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0"],"KE":["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],"KG":["996","00","8\\d{9}|(?:[235-8]\\d|99)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"KH":["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],"KI":["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],"KM":["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],"KN":["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","869$1",0,"869"],"KP":["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],"KR":["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],"KW":["965","00","(?:18|[2569]\\d\\d)\\d{5}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[25]"]]]],"KY":["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","345$1",0,"345"],"KZ":["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],"LA":["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],"LB":["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],"LC":["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","758$1",0,"758"],"LI":["423","00","90\\d{5}|(?:[2378]|6\\d\\d)\\d{6}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[237-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"0|(1001)"],"LK":["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],"LR":["231","00","(?:2|33|5\\d|77|88)\\d{7}|[4-6]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3578]"],"0$1"]],"0"],"LS":["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],"LT":["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]"],"LU":["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],"LV":["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],"LY":["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],"MA":["212","00","[5-8]\\d{8}",[9],[["(\\d{5})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29|38)[89]","5(?:29|38)[89]0"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:29(?:[189][05]|2[29]|3[01])|38[89][05])\\d{4}|5(?:2(?:[0-25-7]\\d|3[1-578]|4[02-46-8]|8[0235-7]|90)|3(?:[0-47]\\d|5[02-9]|6[02-8]|80|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:0\\d|1[0-3]|6[1267]|7[0-57]))\\d{6}"],["80\\d{7}"],["89\\d{7}"],0,0,0,0,["592(?:4[0-2]|93)\\d{4}"]]],"MC":["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],"MD":["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],"ME":["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],"MF":["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],"MG":["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"0|([24-9]\\d{6})$","20$1"],"MH":["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],"MK":["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],"ML":["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],"MM":["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],"MN":["976","001","[12]\\d{7,9}|[57-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[57-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],"MO":["853","00","08005\\d\\d|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],"MP":["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","670$1",0,"670"],"MQ":["596","00","(?:69|80)\\d{7}|(?:59|97)6\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"MR":["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],"MS":["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"1|([34]\\d{6})$","664$1",0,"664"],"MT":["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],"MU":["230","0(?:0|[24-7]0|3[03])","(?:5|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["5"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],"MV":["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[3467]|9[13-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],"MW":["265","00","(?:[19]\\d|[23]1|77|88)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],"MX":["52","0[09]","199[1-9]\\d{7}|(?:1(?:[01467]\\d|[235][1-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],"MY":["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9])|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1[36-8]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],"MZ":["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],"NA":["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],"NC":["687","00","[2-57-9]\\d{5}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[2-57-9]"]]]],"NE":["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[04]"]]]],"NF":["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],"NG":["234","009","(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-7]|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],"NI":["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],"NL":["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|[89]\\d{6,9}|1\\d{4,5}",[5,6,7,8,9,10],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0"],"NO":["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[489]|59"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-7]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],"NP":["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-579]|6[2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],"NR":["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],"NU":["683","00","(?:[47]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],"NZ":["64","0(?:0|161)","[29]\\d{7,9}|50\\d{5}(?:\\d{2,3})?|6[0-35-9]\\d{6}|7\\d{7,8}|8\\d{4,9}|(?:11\\d|[34])\\d{7}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-579]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|[89]0","50(?:[0367]|88)|[89]0"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[59]|80"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7|86"],"0$1"]],"0",0,0,0,0,0,0,"00"],"OM":["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],"PA":["507","00","8\\d{9}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],"PE":["51","19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,0," Anexo "],"PF":["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],"PG":["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],"PH":["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],"PK":["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],"PL":["48","00","6\\d{5}(?:\\d{2})?|8\\d{9}|[1-9]\\d{6}(?:\\d{2})?",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],"PM":["508","00","(?:[45]|80\\d\\d)\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"PR":["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],"PS":["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],"PT":["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],"PW":["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],"PY":["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-6])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],"QA":["974","00","[2-7]\\d{7}|(?:2\\d\\d|800)\\d{4}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["2[126]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]]]],"RE":["262","00","9769\\d{5}|(?:26|[68]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,"26[23]|69|[89]"],"RO":["40","00","(?:[237]\\d|[89]0)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[237-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],"RS":["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],"RU":["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],"RW":["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]]],"0"],"SA":["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],"SB":["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],"SC":["248","010|0[0-2]","8000\\d{3}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],"SD":["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],"SE":["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],"SG":["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-4]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],"SH":["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],"SI":["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],"SJ":["47","00","0\\d{4}|(?:[489]\\d|[57]9)\\d{6}",[5,8],0,0,0,0,0,0,"79"],"SK":["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],"SL":["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],"SM":["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],"SN":["221","00","(?:[378]\\d{4}|93330)\\d{4}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],"SO":["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["24|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3478]|64|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[1-35-9]|9[2-9]"]]],"0"],"SR":["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],"SS":["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],"ST":["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],"SV":["503","00","[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],"SX":["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|(5\\d{6})$","721$1",0,"721"],"SY":["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],"SZ":["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],"TA":["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],"TC":["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"1|([2-479]\\d{6})$","649$1",0,"649"],"TD":["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],"TG":["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],"TH":["66","00[1-9]","1\\d{9}|[1689]\\d{8}|[1-57]\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],"TJ":["992","810","(?:00|11|[2-57-9]\\d)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"],0,1],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[34]7|91[78]"],0,1],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"],0,1],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02-57-9]|11"],0,1]],"8",0,0,0,0,0,0,"8~10"],"TK":["690","00","[2-47]\\d{3,6}",[4,5,6,7]],"TL":["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],"TM":["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],"TN":["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],"TO":["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],"TR":["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|616)","5(?:[0-59]|6161)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],"TT":["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-46-8]\\d{6})$","868$1",0,"868"],"TV":["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],"TW":["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],"TZ":["255","00[056]","(?:[26-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],"UA":["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["4[45][0-5]|5(?:0|6[37])|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]","4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["[3-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],"UG":["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],"US":["1","011","[2-9]\\d{9}",[10],[["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[0179]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01579]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}"]]],"UY":["598","0(?:0|1[3-9]\\d)","4\\d{9}|[249]\\d{7}|(?:[49]\\d|80)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["405|8|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[24]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["4"],"0$1"]],"0",0,0,0,0,0,0,"00"," int. "],"UZ":["998","810","(?:33|55|[679]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[35-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],"VA":["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],"VC":["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","784$1",0,"784"],"VE":["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],"VG":["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-578]\\d{6})$","284$1",0,"284"],"VI":["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","340$1",0,"340"],"VN":["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[69]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3578]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],"VU":["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],"WF":["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],"WS":["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],"XK":["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0"],"YE":["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7[24-68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],"YT":["262","00","80\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,"269|63"],"ZA":["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],"ZM":["260","00","(?:63|80)0\\d{6}|(?:21|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],"ZW":["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},"nonGeographic":{"800":["800",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,["[1-9]\\d{7}"]]],"808":["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],"870":["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],"878":["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],"881":["881",0,"[0-36-9]\\d{8}",[9],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-36-9]"]]],0,0,0,0,0,0,[0,["[0-36-9]\\d{8}"]]],"882":["882",0,"[13]\\d{6}(?:\\d{2,5})?|285\\d{9}|(?:[19]\\d|49)\\d{6}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["4"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[19]"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["34[57]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-3]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|3(?:2|47|7\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:(?:285\\d\\d|3(?:45|[69]\\d{3}))\\d|9[89])\\d{6}"]]],"883":["883",0,"210\\d{7}|51\\d{7}(?:\\d{3})?",[9,10,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["510"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["5"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:210|51[013]0\\d)\\d{7}|5100\\d{5}"]]],"888":["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],"979":["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};
8
-
9
- // The minimum length of the national significant number.
10
-
11
- var MAX_LENGTH_COUNTRY_CODE = 3; // Digits accepted in phone numbers
12
- // (ascii, fullwidth, arabic-indic, and eastern arabic digits).
13
-
14
- var VALID_DIGITS = "0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9"; // `DASHES` will be right after the opening square bracket of the "character class"
15
-
16
- var DASHES = "-\u2010-\u2015\u2212\u30FC\uFF0D";
17
- var SLASHES = "\uFF0F/";
18
- var DOTS = "\uFF0E.";
19
- var WHITESPACE = " \xA0\xAD\u200B\u2060\u3000";
20
- var BRACKETS = "()\uFF08\uFF09\uFF3B\uFF3D\\[\\]"; // export const OPENING_BRACKETS = '(\uFF08\uFF3B\\\['
21
-
22
- var TILDES = "~\u2053\u223C\uFF5E"; // Regular expression of acceptable punctuation found in phone numbers. This
23
- // excludes punctuation found as a leading character only. This consists of dash
24
- // characters, white space characters, full stops, slashes, square brackets,
25
- // parentheses and tildes. Full-width variants are also present.
26
-
27
- var VALID_PUNCTUATION = "".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);
28
- var PLUS_CHARS = "+\uFF0B"; // const LEADING_PLUS_CHARS_PATTERN = new RegExp('^[' + PLUS_CHARS + ']+')
29
-
30
- // Copy-pasted from:
31
- // https://github.com/substack/semver-compare/blob/master/index.js
32
- //
33
- // Inlining this function because some users reported issues with
34
- // importing from `semver-compare` in a browser with ES6 "native" modules.
35
- //
36
- // Fixes `semver-compare` not being able to compare versions with alpha/beta/etc "tags".
37
- // https://github.com/catamphetamine/libphonenumber-js/issues/381
38
- function compare (a, b) {
39
- a = a.split('-');
40
- b = b.split('-');
41
- var pa = a[0].split('.');
42
- var pb = b[0].split('.');
43
-
44
- for (var i = 0; i < 3; i++) {
45
- var na = Number(pa[i]);
46
- var nb = Number(pb[i]);
47
- if (na > nb) return 1;
48
- if (nb > na) return -1;
49
- if (!isNaN(na) && isNaN(nb)) return 1;
50
- if (isNaN(na) && !isNaN(nb)) return -1;
51
- }
52
-
53
- if (a[1] && b[1]) {
54
- return a[1] > b[1] ? 1 : a[1] < b[1] ? -1 : 0;
55
- }
56
-
57
- return !a[1] && b[1] ? 1 : a[1] && !b[1] ? -1 : 0;
58
- }
59
-
60
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
61
-
62
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
63
-
64
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
65
-
66
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
67
-
68
- var V3 = '1.2.0'; // Moved `001` country code to "nonGeographic" section of metadata.
69
-
70
- var V4 = '1.7.35';
71
- var DEFAULT_EXT_PREFIX = ' ext. ';
72
- var CALLING_CODE_REG_EXP = /^\d+$/;
73
- /**
74
- * See: https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md
75
- */
76
-
77
- var Metadata =
78
- /*#__PURE__*/
79
- function () {
80
- function Metadata(metadata) {
81
- _classCallCheck(this, Metadata);
82
-
83
- validateMetadata(metadata);
84
- this.metadata = metadata;
85
- setVersion.call(this, metadata);
86
- }
87
-
88
- _createClass(Metadata, [{
89
- key: "getCountries",
90
- value: function getCountries() {
91
- return Object.keys(this.metadata.countries).filter(function (_) {
92
- return _ !== '001';
93
- });
94
- }
95
- }, {
96
- key: "getCountryMetadata",
97
- value: function getCountryMetadata(countryCode) {
98
- return this.metadata.countries[countryCode];
99
- }
100
- }, {
101
- key: "nonGeographic",
102
- value: function nonGeographic() {
103
- if (this.v1 || this.v2 || this.v3) return; // `nonGeographical` was a typo.
104
- // It's present in metadata generated from `1.7.35` to `1.7.37`.
105
-
106
- return this.metadata.nonGeographic || this.metadata.nonGeographical;
107
- }
108
- }, {
109
- key: "hasCountry",
110
- value: function hasCountry(country) {
111
- return this.getCountryMetadata(country) !== undefined;
112
- }
113
- }, {
114
- key: "hasCallingCode",
115
- value: function hasCallingCode(callingCode) {
116
- if (this.getCountryCodesForCallingCode(callingCode)) {
117
- return true;
118
- }
119
-
120
- if (this.nonGeographic()) {
121
- if (this.nonGeographic()[callingCode]) {
122
- return true;
123
- }
124
- } else {
125
- // A hacky workaround for old custom metadata (generated before V4).
126
- var countryCodes = this.countryCallingCodes()[callingCode];
127
-
128
- if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {
129
- return true;
130
- }
131
- }
132
- }
133
- }, {
134
- key: "isNonGeographicCallingCode",
135
- value: function isNonGeographicCallingCode(callingCode) {
136
- if (this.nonGeographic()) {
137
- return this.nonGeographic()[callingCode] ? true : false;
138
- } else {
139
- return this.getCountryCodesForCallingCode(callingCode) ? false : true;
140
- }
141
- } // Deprecated.
142
-
143
- }, {
144
- key: "country",
145
- value: function country(countryCode) {
146
- return this.selectNumberingPlan(countryCode);
147
- }
148
- }, {
149
- key: "selectNumberingPlan",
150
- value: function selectNumberingPlan(countryCode, callingCode) {
151
- // Supports just passing `callingCode` as the first argument.
152
- if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) {
153
- callingCode = countryCode;
154
- countryCode = null;
155
- }
156
-
157
- if (countryCode && countryCode !== '001') {
158
- if (!this.hasCountry(countryCode)) {
159
- throw new Error("Unknown country: ".concat(countryCode));
160
- }
161
-
162
- this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this);
163
- } else if (callingCode) {
164
- if (!this.hasCallingCode(callingCode)) {
165
- throw new Error("Unknown calling code: ".concat(callingCode));
166
- }
167
-
168
- this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);
169
- } else {
170
- this.numberingPlan = undefined;
171
- }
172
-
173
- return this;
174
- }
175
- }, {
176
- key: "getCountryCodesForCallingCode",
177
- value: function getCountryCodesForCallingCode(callingCode) {
178
- var countryCodes = this.countryCallingCodes()[callingCode];
179
-
180
- if (countryCodes) {
181
- // Metadata before V4 included "non-geographic entity" calling codes
182
- // inside `country_calling_codes` (for example, `"881":["001"]`).
183
- // Now the semantics of `country_calling_codes` has changed:
184
- // it's specifically for "countries" now.
185
- // Older versions of custom metadata will simply skip parsing
186
- // "non-geographic entity" phone numbers with new versions
187
- // of this library: it's not considered a bug,
188
- // because such numbers are extremely rare,
189
- // and developers extremely rarely use custom metadata.
190
- if (countryCodes.length === 1 && countryCodes[0].length === 3) {
191
- return;
192
- }
193
-
194
- return countryCodes;
195
- }
196
- }
197
- }, {
198
- key: "getCountryCodeForCallingCode",
199
- value: function getCountryCodeForCallingCode(callingCode) {
200
- var countryCodes = this.getCountryCodesForCallingCode(callingCode);
201
-
202
- if (countryCodes) {
203
- return countryCodes[0];
204
- }
205
- }
206
- }, {
207
- key: "getNumberingPlanMetadata",
208
- value: function getNumberingPlanMetadata(callingCode) {
209
- var countryCode = this.getCountryCodeForCallingCode(callingCode);
210
-
211
- if (countryCode) {
212
- return this.getCountryMetadata(countryCode);
213
- }
214
-
215
- if (this.nonGeographic()) {
216
- var metadata = this.nonGeographic()[callingCode];
217
-
218
- if (metadata) {
219
- return metadata;
220
- }
221
- } else {
222
- // A hacky workaround for old custom metadata (generated before V4).
223
- var countryCodes = this.countryCallingCodes()[callingCode];
224
-
225
- if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {
226
- return this.metadata.countries['001'];
227
- }
228
- }
229
- } // Deprecated.
230
-
231
- }, {
232
- key: "countryCallingCode",
233
- value: function countryCallingCode() {
234
- return this.numberingPlan.callingCode();
235
- } // Deprecated.
236
-
237
- }, {
238
- key: "IDDPrefix",
239
- value: function IDDPrefix() {
240
- return this.numberingPlan.IDDPrefix();
241
- } // Deprecated.
242
-
243
- }, {
244
- key: "defaultIDDPrefix",
245
- value: function defaultIDDPrefix() {
246
- return this.numberingPlan.defaultIDDPrefix();
247
- } // Deprecated.
248
-
249
- }, {
250
- key: "nationalNumberPattern",
251
- value: function nationalNumberPattern() {
252
- return this.numberingPlan.nationalNumberPattern();
253
- } // Deprecated.
254
-
255
- }, {
256
- key: "possibleLengths",
257
- value: function possibleLengths() {
258
- return this.numberingPlan.possibleLengths();
259
- } // Deprecated.
260
-
261
- }, {
262
- key: "formats",
263
- value: function formats() {
264
- return this.numberingPlan.formats();
265
- } // Deprecated.
266
-
267
- }, {
268
- key: "nationalPrefixForParsing",
269
- value: function nationalPrefixForParsing() {
270
- return this.numberingPlan.nationalPrefixForParsing();
271
- } // Deprecated.
272
-
273
- }, {
274
- key: "nationalPrefixTransformRule",
275
- value: function nationalPrefixTransformRule() {
276
- return this.numberingPlan.nationalPrefixTransformRule();
277
- } // Deprecated.
278
-
279
- }, {
280
- key: "leadingDigits",
281
- value: function leadingDigits() {
282
- return this.numberingPlan.leadingDigits();
283
- } // Deprecated.
284
-
285
- }, {
286
- key: "hasTypes",
287
- value: function hasTypes() {
288
- return this.numberingPlan.hasTypes();
289
- } // Deprecated.
290
-
291
- }, {
292
- key: "type",
293
- value: function type(_type) {
294
- return this.numberingPlan.type(_type);
295
- } // Deprecated.
296
-
297
- }, {
298
- key: "ext",
299
- value: function ext() {
300
- return this.numberingPlan.ext();
301
- }
302
- }, {
303
- key: "countryCallingCodes",
304
- value: function countryCallingCodes() {
305
- if (this.v1) return this.metadata.country_phone_code_to_countries;
306
- return this.metadata.country_calling_codes;
307
- } // Deprecated.
308
-
309
- }, {
310
- key: "chooseCountryByCountryCallingCode",
311
- value: function chooseCountryByCountryCallingCode(callingCode) {
312
- return this.selectNumberingPlan(callingCode);
313
- }
314
- }, {
315
- key: "hasSelectedNumberingPlan",
316
- value: function hasSelectedNumberingPlan() {
317
- return this.numberingPlan !== undefined;
318
- }
319
- }]);
320
-
321
- return Metadata;
322
- }();
323
-
324
- var NumberingPlan =
325
- /*#__PURE__*/
326
- function () {
327
- function NumberingPlan(metadata, globalMetadataObject) {
328
- _classCallCheck(this, NumberingPlan);
329
-
330
- this.globalMetadataObject = globalMetadataObject;
331
- this.metadata = metadata;
332
- setVersion.call(this, globalMetadataObject.metadata);
333
- }
334
-
335
- _createClass(NumberingPlan, [{
336
- key: "callingCode",
337
- value: function callingCode() {
338
- return this.metadata[0];
339
- } // Formatting information for regions which share
340
- // a country calling code is contained by only one region
341
- // for performance reasons. For example, for NANPA region
342
- // ("North American Numbering Plan Administration",
343
- // which includes USA, Canada, Cayman Islands, Bahamas, etc)
344
- // it will be contained in the metadata for `US`.
345
-
346
- }, {
347
- key: "getDefaultCountryMetadataForRegion",
348
- value: function getDefaultCountryMetadataForRegion() {
349
- return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
350
- }
351
- }, {
352
- key: "IDDPrefix",
353
- value: function IDDPrefix() {
354
- if (this.v1 || this.v2) return;
355
- return this.metadata[1];
356
- }
357
- }, {
358
- key: "defaultIDDPrefix",
359
- value: function defaultIDDPrefix() {
360
- if (this.v1 || this.v2) return;
361
- return this.metadata[12];
362
- }
363
- }, {
364
- key: "nationalNumberPattern",
365
- value: function nationalNumberPattern() {
366
- if (this.v1 || this.v2) return this.metadata[1];
367
- return this.metadata[2];
368
- }
369
- }, {
370
- key: "possibleLengths",
371
- value: function possibleLengths() {
372
- if (this.v1) return;
373
- return this.metadata[this.v2 ? 2 : 3];
374
- }
375
- }, {
376
- key: "_getFormats",
377
- value: function _getFormats(metadata) {
378
- return metadata[this.v1 ? 2 : this.v2 ? 3 : 4];
379
- } // For countries of the same region (e.g. NANPA)
380
- // formats are all stored in the "main" country for that region.
381
- // E.g. "RU" and "KZ", "US" and "CA".
382
-
383
- }, {
384
- key: "formats",
385
- value: function formats() {
386
- var _this = this;
387
-
388
- var formats = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];
389
- return formats.map(function (_) {
390
- return new Format(_, _this);
391
- });
392
- }
393
- }, {
394
- key: "nationalPrefix",
395
- value: function nationalPrefix() {
396
- return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
397
- }
398
- }, {
399
- key: "_getNationalPrefixFormattingRule",
400
- value: function _getNationalPrefixFormattingRule(metadata) {
401
- return metadata[this.v1 ? 4 : this.v2 ? 5 : 6];
402
- } // For countries of the same region (e.g. NANPA)
403
- // national prefix formatting rule is stored in the "main" country for that region.
404
- // E.g. "RU" and "KZ", "US" and "CA".
405
-
406
- }, {
407
- key: "nationalPrefixFormattingRule",
408
- value: function nationalPrefixFormattingRule() {
409
- return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());
410
- }
411
- }, {
412
- key: "_nationalPrefixForParsing",
413
- value: function _nationalPrefixForParsing() {
414
- return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
415
- }
416
- }, {
417
- key: "nationalPrefixForParsing",
418
- value: function nationalPrefixForParsing() {
419
- // If `national_prefix_for_parsing` is not set explicitly,
420
- // then infer it from `national_prefix` (if any)
421
- return this._nationalPrefixForParsing() || this.nationalPrefix();
422
- }
423
- }, {
424
- key: "nationalPrefixTransformRule",
425
- value: function nationalPrefixTransformRule() {
426
- return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
427
- }
428
- }, {
429
- key: "_getNationalPrefixIsOptionalWhenFormatting",
430
- value: function _getNationalPrefixIsOptionalWhenFormatting() {
431
- return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
432
- } // For countries of the same region (e.g. NANPA)
433
- // "national prefix is optional when formatting" flag is
434
- // stored in the "main" country for that region.
435
- // E.g. "RU" and "KZ", "US" and "CA".
436
-
437
- }, {
438
- key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
439
- value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
440
- return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());
441
- }
442
- }, {
443
- key: "leadingDigits",
444
- value: function leadingDigits() {
445
- return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
446
- }
447
- }, {
448
- key: "types",
449
- value: function types() {
450
- return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
451
- }
452
- }, {
453
- key: "hasTypes",
454
- value: function hasTypes() {
455
- // Versions 1.2.0 - 1.2.4: can be `[]`.
456
-
457
- /* istanbul ignore next */
458
- if (this.types() && this.types().length === 0) {
459
- return false;
460
- } // Versions <= 1.2.4: can be `undefined`.
461
- // Version >= 1.2.5: can be `0`.
462
-
463
-
464
- return !!this.types();
465
- }
466
- }, {
467
- key: "type",
468
- value: function type(_type2) {
469
- if (this.hasTypes() && getType(this.types(), _type2)) {
470
- return new Type(getType(this.types(), _type2), this);
471
- }
472
- }
473
- }, {
474
- key: "ext",
475
- value: function ext() {
476
- if (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;
477
- return this.metadata[13] || DEFAULT_EXT_PREFIX;
478
- }
479
- }]);
480
-
481
- return NumberingPlan;
482
- }();
483
-
484
- var Format =
485
- /*#__PURE__*/
486
- function () {
487
- function Format(format, metadata) {
488
- _classCallCheck(this, Format);
489
-
490
- this._format = format;
491
- this.metadata = metadata;
492
- }
493
-
494
- _createClass(Format, [{
495
- key: "pattern",
496
- value: function pattern() {
497
- return this._format[0];
498
- }
499
- }, {
500
- key: "format",
501
- value: function format() {
502
- return this._format[1];
503
- }
504
- }, {
505
- key: "leadingDigitsPatterns",
506
- value: function leadingDigitsPatterns() {
507
- return this._format[2] || [];
508
- }
509
- }, {
510
- key: "nationalPrefixFormattingRule",
511
- value: function nationalPrefixFormattingRule() {
512
- return this._format[3] || this.metadata.nationalPrefixFormattingRule();
513
- }
514
- }, {
515
- key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
516
- value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
517
- return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
518
- }
519
- }, {
520
- key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
521
- value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {
522
- // National prefix is omitted if there's no national prefix formatting rule
523
- // set for this country, or when the national prefix formatting rule
524
- // contains no national prefix itself, or when this rule is set but
525
- // national prefix is optional for this phone number format
526
- // (and it is not enforced explicitly)
527
- return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
528
- } // Checks whether national prefix formatting rule contains national prefix.
529
-
530
- }, {
531
- key: "usesNationalPrefix",
532
- value: function usesNationalPrefix() {
533
- return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a "dummy" one.
534
- !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) // In compressed metadata, `this.nationalPrefixFormattingRule()` is `0`
535
- // when `national_prefix_formatting_rule` is not present.
536
- // So, `true` or `false` are returned explicitly here, so that
537
- // `0` number isn't returned.
538
- ? true : false;
539
- }
540
- }, {
541
- key: "internationalFormat",
542
- value: function internationalFormat() {
543
- return this._format[5] || this.format();
544
- }
545
- }]);
546
-
547
- return Format;
548
- }();
549
- /**
550
- * A pattern that is used to determine if the national prefix formatting rule
551
- * has the first group only, i.e., does not start with the national prefix.
552
- * Note that the pattern explicitly allows for unbalanced parentheses.
553
- */
554
-
555
-
556
- var FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\(?\$1\)?$/;
557
-
558
- var Type =
559
- /*#__PURE__*/
560
- function () {
561
- function Type(type, metadata) {
562
- _classCallCheck(this, Type);
563
-
564
- this.type = type;
565
- this.metadata = metadata;
566
- }
567
-
568
- _createClass(Type, [{
569
- key: "pattern",
570
- value: function pattern() {
571
- if (this.metadata.v1) return this.type;
572
- return this.type[0];
573
- }
574
- }, {
575
- key: "possibleLengths",
576
- value: function possibleLengths() {
577
- if (this.metadata.v1) return;
578
- return this.type[1] || this.metadata.possibleLengths();
579
- }
580
- }]);
581
-
582
- return Type;
583
- }();
584
-
585
- function getType(types, type) {
586
- switch (type) {
587
- case 'FIXED_LINE':
588
- return types[0];
589
-
590
- case 'MOBILE':
591
- return types[1];
592
-
593
- case 'TOLL_FREE':
594
- return types[2];
595
-
596
- case 'PREMIUM_RATE':
597
- return types[3];
598
-
599
- case 'PERSONAL_NUMBER':
600
- return types[4];
601
-
602
- case 'VOICEMAIL':
603
- return types[5];
604
-
605
- case 'UAN':
606
- return types[6];
607
-
608
- case 'PAGER':
609
- return types[7];
610
-
611
- case 'VOIP':
612
- return types[8];
613
-
614
- case 'SHARED_COST':
615
- return types[9];
616
- }
617
- }
618
-
619
- function validateMetadata(metadata) {
620
- if (!metadata) {
621
- throw new Error('[libphonenumber-js] `metadata` argument not passed. Check your arguments.');
622
- } // `country_phone_code_to_countries` was renamed to
623
- // `country_calling_codes` in `1.0.18`.
624
-
625
-
626
- if (!is_object(metadata) || !is_object(metadata.countries)) {
627
- throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(is_object(metadata) ? 'an object of shape: { ' + Object.keys(metadata).join(', ') + ' }' : 'a ' + type_of(metadata) + ': ' + metadata, "."));
628
- }
629
- } // Babel transforms `typeof` into some "branches"
630
- // so istanbul will show this as "branch not covered".
631
-
632
- /* istanbul ignore next */
633
-
634
- var is_object = function is_object(_) {
635
- return _typeof(_) === 'object';
636
- }; // Babel transforms `typeof` into some "branches"
637
- // so istanbul will show this as "branch not covered".
638
-
639
- /* istanbul ignore next */
640
-
641
-
642
- var type_of = function type_of(_) {
643
- return _typeof(_);
644
- };
645
- /**
646
- * Returns "country calling code" for a country.
647
- * Throws an error if the country doesn't exist or isn't supported by this library.
648
- * @param {string} country
649
- * @param {object} metadata
650
- * @return {string}
651
- * @example
652
- * // Returns "44"
653
- * getCountryCallingCode("GB")
654
- */
655
-
656
- function getCountryCallingCode(country, metadata) {
657
- metadata = new Metadata(metadata);
658
-
659
- if (metadata.hasCountry(country)) {
660
- return metadata.country(country).countryCallingCode();
661
- }
662
-
663
- throw new Error("Unknown country: ".concat(country));
664
- }
665
-
666
- function setVersion(metadata) {
667
- var version = metadata.version;
668
-
669
- if (typeof version === 'number') {
670
- this.v1 = version === 1;
671
- this.v2 = version === 2;
672
- this.v3 = version === 3;
673
- this.v4 = version === 4;
674
- } else {
675
- if (!version) {
676
- this.v1 = true;
677
- } else if (compare(version, V3) === -1) {
678
- this.v2 = true;
679
- } else if (compare(version, V4) === -1) {
680
- this.v3 = true;
681
- } else {
682
- this.v4 = true;
683
- }
684
- }
685
- } // const ISO_COUNTRY_CODE = /^[A-Z]{2}$/
686
- // function isCountryCode(countryCode) {
687
- // return ISO_COUNTRY_CODE.test(countryCodeOrCountryCallingCode)
688
- // }
689
-
690
- // These mappings map a character (key) to a specific digit that should
691
- // replace it for normalization purposes. Non-European digits that
692
- // may be used in phone numbers are mapped to a European equivalent.
693
- //
694
- // E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.
695
- //
696
- var DIGITS = {
697
- '0': '0',
698
- '1': '1',
699
- '2': '2',
700
- '3': '3',
701
- '4': '4',
702
- '5': '5',
703
- '6': '6',
704
- '7': '7',
705
- '8': '8',
706
- '9': '9',
707
- "\uFF10": '0',
708
- // Fullwidth digit 0
709
- "\uFF11": '1',
710
- // Fullwidth digit 1
711
- "\uFF12": '2',
712
- // Fullwidth digit 2
713
- "\uFF13": '3',
714
- // Fullwidth digit 3
715
- "\uFF14": '4',
716
- // Fullwidth digit 4
717
- "\uFF15": '5',
718
- // Fullwidth digit 5
719
- "\uFF16": '6',
720
- // Fullwidth digit 6
721
- "\uFF17": '7',
722
- // Fullwidth digit 7
723
- "\uFF18": '8',
724
- // Fullwidth digit 8
725
- "\uFF19": '9',
726
- // Fullwidth digit 9
727
- "\u0660": '0',
728
- // Arabic-indic digit 0
729
- "\u0661": '1',
730
- // Arabic-indic digit 1
731
- "\u0662": '2',
732
- // Arabic-indic digit 2
733
- "\u0663": '3',
734
- // Arabic-indic digit 3
735
- "\u0664": '4',
736
- // Arabic-indic digit 4
737
- "\u0665": '5',
738
- // Arabic-indic digit 5
739
- "\u0666": '6',
740
- // Arabic-indic digit 6
741
- "\u0667": '7',
742
- // Arabic-indic digit 7
743
- "\u0668": '8',
744
- // Arabic-indic digit 8
745
- "\u0669": '9',
746
- // Arabic-indic digit 9
747
- "\u06F0": '0',
748
- // Eastern-Arabic digit 0
749
- "\u06F1": '1',
750
- // Eastern-Arabic digit 1
751
- "\u06F2": '2',
752
- // Eastern-Arabic digit 2
753
- "\u06F3": '3',
754
- // Eastern-Arabic digit 3
755
- "\u06F4": '4',
756
- // Eastern-Arabic digit 4
757
- "\u06F5": '5',
758
- // Eastern-Arabic digit 5
759
- "\u06F6": '6',
760
- // Eastern-Arabic digit 6
761
- "\u06F7": '7',
762
- // Eastern-Arabic digit 7
763
- "\u06F8": '8',
764
- // Eastern-Arabic digit 8
765
- "\u06F9": '9' // Eastern-Arabic digit 9
766
-
767
- };
768
- function parseDigit(character) {
769
- return DIGITS[character];
770
- }
771
- /**
772
- * Parses phone number digits from a string.
773
- * Drops all punctuation leaving only digits.
774
- * Also converts wide-ascii and arabic-indic numerals to conventional numerals.
775
- * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.
776
- * @param {string} string
777
- * @return {string}
778
- * @example
779
- * ```js
780
- * parseDigits('8 (800) 555')
781
- * // Outputs '8800555'.
782
- * ```
783
- */
784
-
785
- function parseDigits(string) {
786
- var result = ''; // Using `.split('')` here instead of normal `for ... of`
787
- // because the importing application doesn't neccessarily include an ES6 polyfill.
788
- // The `.split('')` approach discards "exotic" UTF-8 characters
789
- // (the ones consisting of four bytes) but digits
790
- // (including non-European ones) don't fall into that range
791
- // so such "exotic" characters would be discarded anyway.
792
-
793
- for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
794
- var _ref;
795
-
796
- if (_isArray) {
797
- if (_i >= _iterator.length) break;
798
- _ref = _iterator[_i++];
799
- } else {
800
- _i = _iterator.next();
801
- if (_i.done) break;
802
- _ref = _i.value;
803
- }
804
-
805
- var character = _ref;
806
- var digit = parseDigit(character);
807
-
808
- if (digit) {
809
- result += digit;
810
- }
811
- }
812
-
813
- return result;
814
- }
815
-
816
- /**
817
- * Merges two arrays.
818
- * @param {*} a
819
- * @param {*} b
820
- * @return {*}
821
- */
822
- function mergeArrays(a, b) {
823
- var merged = a.slice();
824
-
825
- for (var _iterator = b, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
826
- var _ref;
827
-
828
- if (_isArray) {
829
- if (_i >= _iterator.length) break;
830
- _ref = _iterator[_i++];
831
- } else {
832
- _i = _iterator.next();
833
- if (_i.done) break;
834
- _ref = _i.value;
835
- }
836
-
837
- var element = _ref;
838
-
839
- if (a.indexOf(element) < 0) {
840
- merged.push(element);
841
- }
842
- }
843
-
844
- return merged.sort(function (a, b) {
845
- return a - b;
846
- }); // ES6 version, requires Set polyfill.
847
- // let merged = new Set(a)
848
- // for (const element of b) {
849
- // merged.add(i)
850
- // }
851
- // return Array.from(merged).sort((a, b) => a - b)
852
- }
853
-
854
- function checkNumberLength(nationalNumber, metadata) {
855
- return checkNumberLengthForType(nationalNumber, undefined, metadata);
856
- } // Checks whether a number is possible for the country based on its length.
857
- // Should only be called for the "new" metadata which has "possible lengths".
858
-
859
- function checkNumberLengthForType(nationalNumber, type, metadata) {
860
- var type_info = metadata.type(type); // There should always be "<possiblePengths/>" set for every type element.
861
- // This is declared in the XML schema.
862
- // For size efficiency, where a sub-description (e.g. fixed-line)
863
- // has the same "<possiblePengths/>" as the "general description", this is missing,
864
- // so we fall back to the "general description". Where no numbers of the type
865
- // exist at all, there is one possible length (-1) which is guaranteed
866
- // not to match the length of any real phone number.
867
-
868
- var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths(); // let local_lengths = type_info && type.possibleLengthsLocal() || metadata.possibleLengthsLocal()
869
- // Metadata before version `1.0.18` didn't contain `possible_lengths`.
870
-
871
- if (!possible_lengths) {
872
- return 'IS_POSSIBLE';
873
- }
874
-
875
- if (type === 'FIXED_LINE_OR_MOBILE') {
876
- // No such country in metadata.
877
-
878
- /* istanbul ignore next */
879
- if (!metadata.type('FIXED_LINE')) {
880
- // The rare case has been encountered where no fixedLine data is available
881
- // (true for some non-geographic entities), so we just check mobile.
882
- return checkNumberLengthForType(nationalNumber, 'MOBILE', metadata);
883
- }
884
-
885
- var mobile_type = metadata.type('MOBILE');
886
-
887
- if (mobile_type) {
888
- // Merge the mobile data in if there was any. "Concat" creates a new
889
- // array, it doesn't edit possible_lengths in place, so we don't need a copy.
890
- // Note that when adding the possible lengths from mobile, we have
891
- // to again check they aren't empty since if they are this indicates
892
- // they are the same as the general desc and should be obtained from there.
893
- possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths()); // The current list is sorted; we need to merge in the new list and
894
- // re-sort (duplicates are okay). Sorting isn't so expensive because
895
- // the lists are very small.
896
- // if (local_lengths) {
897
- // local_lengths = mergeArrays(local_lengths, mobile_type.possibleLengthsLocal())
898
- // } else {
899
- // local_lengths = mobile_type.possibleLengthsLocal()
900
- // }
901
- }
902
- } // If the type doesn't exist then return 'INVALID_LENGTH'.
903
- else if (type && !type_info) {
904
- return 'INVALID_LENGTH';
905
- }
906
-
907
- var actual_length = nationalNumber.length; // In `libphonenumber-js` all "local-only" formats are dropped for simplicity.
908
- // // This is safe because there is never an overlap beween the possible lengths
909
- // // and the local-only lengths; this is checked at build time.
910
- // if (local_lengths && local_lengths.indexOf(nationalNumber.length) >= 0)
911
- // {
912
- // return 'IS_POSSIBLE_LOCAL_ONLY'
913
- // }
914
-
915
- var minimum_length = possible_lengths[0];
916
-
917
- if (minimum_length === actual_length) {
918
- return 'IS_POSSIBLE';
919
- }
920
-
921
- if (minimum_length > actual_length) {
922
- return 'TOO_SHORT';
923
- }
924
-
925
- if (possible_lengths[possible_lengths.length - 1] < actual_length) {
926
- return 'TOO_LONG';
927
- } // We skip the first element since we've already checked it.
928
-
929
-
930
- return possible_lengths.indexOf(actual_length, 1) >= 0 ? 'IS_POSSIBLE' : 'INVALID_LENGTH';
931
- }
932
-
933
- function isPossiblePhoneNumber(input, options, metadata) {
934
- /* istanbul ignore if */
935
- if (options === undefined) {
936
- options = {};
937
- }
938
-
939
- metadata = new Metadata(metadata);
940
-
941
- if (options.v2) {
942
- if (!input.countryCallingCode) {
943
- throw new Error('Invalid phone number object passed');
944
- }
945
-
946
- metadata.selectNumberingPlan(input.countryCallingCode);
947
- } else {
948
- if (!input.phone) {
949
- return false;
950
- }
951
-
952
- if (input.country) {
953
- if (!metadata.hasCountry(input.country)) {
954
- throw new Error("Unknown country: ".concat(input.country));
955
- }
956
-
957
- metadata.country(input.country);
958
- } else {
959
- if (!input.countryCallingCode) {
960
- throw new Error('Invalid phone number object passed');
961
- }
962
-
963
- metadata.selectNumberingPlan(input.countryCallingCode);
964
- }
965
- }
966
-
967
- if (metadata.possibleLengths()) {
968
- return isPossibleNumber(input.phone || input.nationalNumber, metadata);
969
- } else {
970
- // There was a bug between `1.7.35` and `1.7.37` where "possible_lengths"
971
- // were missing for "non-geographical" numbering plans.
972
- // Just assume the number is possible in such cases:
973
- // it's unlikely that anyone generated their custom metadata
974
- // in that short period of time (one day).
975
- // This code can be removed in some future major version update.
976
- if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {
977
- // "Non-geographic entities" did't have `possibleLengths`
978
- // due to a bug in metadata generation process.
979
- return true;
980
- } else {
981
- throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.');
982
- }
983
- }
984
- }
985
- function isPossibleNumber(nationalNumber, metadata) {
986
- //, isInternational) {
987
- switch (checkNumberLength(nationalNumber, metadata)) {
988
- case 'IS_POSSIBLE':
989
- return true;
990
- // This library ignores "local-only" phone numbers (for simplicity).
991
- // See the readme for more info on what are "local-only" phone numbers.
992
- // case 'IS_POSSIBLE_LOCAL_ONLY':
993
- // return !isInternational
994
-
995
- default:
996
- return false;
997
- }
998
- }
999
-
1000
- /**
1001
- * @param {object} - `{ ?number, ?extension }`.
1002
- * @return {string} Phone URI (RFC 3966).
1003
- */
1004
-
1005
- function formatRFC3966(_ref2) {
1006
- var number = _ref2.number,
1007
- ext = _ref2.ext;
1008
-
1009
- if (!number) {
1010
- return '';
1011
- }
1012
-
1013
- if (number[0] !== '+') {
1014
- throw new Error("\"formatRFC3966()\" expects \"number\" to be in E.164 format.");
1015
- }
1016
-
1017
- return "tel:".concat(number).concat(ext ? ';ext=' + ext : '');
1018
- }
1019
-
1020
- /**
1021
- * Checks whether the entire input sequence can be matched
1022
- * against the regular expression.
1023
- * @return {boolean}
1024
- */
1025
- function matchesEntirely(text, regular_expression) {
1026
- // If assigning the `''` default value is moved to the arguments above,
1027
- // code coverage would decrease for some weird reason.
1028
- text = text || '';
1029
- return new RegExp('^(?:' + regular_expression + ')$').test(text);
1030
- }
1031
-
1032
- var NON_FIXED_LINE_PHONE_TYPES = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL']; // Finds out national phone number type (fixed line, mobile, etc)
1033
-
1034
- function getNumberType(input, options, metadata) {
1035
- // If assigning the `{}` default value is moved to the arguments above,
1036
- // code coverage would decrease for some weird reason.
1037
- options = options || {}; // When `parse()` returned `{}`
1038
- // meaning that the phone number is not a valid one.
1039
-
1040
- if (!input.country) {
1041
- return;
1042
- }
1043
-
1044
- metadata = new Metadata(metadata);
1045
- metadata.selectNumberingPlan(input.country, input.countryCallingCode);
1046
- var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // The following is copy-pasted from the original function:
1047
- // https://github.com/googlei18n/libphonenumber/blob/3ea547d4fbaa2d0b67588904dfa5d3f2557c27ff/javascript/i18n/phonenumbers/phonenumberutil.js#L2835
1048
- // Is this national number even valid for this country
1049
-
1050
- if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern())) {
1051
- return;
1052
- } // Is it fixed line number
1053
-
1054
-
1055
- if (isNumberTypeEqualTo(nationalNumber, 'FIXED_LINE', metadata)) {
1056
- // Because duplicate regular expressions are removed
1057
- // to reduce metadata size, if "mobile" pattern is ""
1058
- // then it means it was removed due to being a duplicate of the fixed-line pattern.
1059
- //
1060
- if (metadata.type('MOBILE') && metadata.type('MOBILE').pattern() === '') {
1061
- return 'FIXED_LINE_OR_MOBILE';
1062
- } // v1 metadata.
1063
- // Legacy.
1064
- // Deprecated.
1065
-
1066
-
1067
- if (!metadata.type('MOBILE')) {
1068
- return 'FIXED_LINE_OR_MOBILE';
1069
- } // Check if the number happens to qualify as both fixed line and mobile.
1070
- // (no such country in the minimal metadata set)
1071
-
1072
- /* istanbul ignore if */
1073
-
1074
-
1075
- if (isNumberTypeEqualTo(nationalNumber, 'MOBILE', metadata)) {
1076
- return 'FIXED_LINE_OR_MOBILE';
1077
- }
1078
-
1079
- return 'FIXED_LINE';
1080
- }
1081
-
1082
- for (var _i = 0, _NON_FIXED_LINE_PHONE = NON_FIXED_LINE_PHONE_TYPES; _i < _NON_FIXED_LINE_PHONE.length; _i++) {
1083
- var type = _NON_FIXED_LINE_PHONE[_i];
1084
-
1085
- if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {
1086
- return type;
1087
- }
1088
- }
1089
- }
1090
- function isNumberTypeEqualTo(nationalNumber, type, metadata) {
1091
- type = metadata.type(type);
1092
-
1093
- if (!type || !type.pattern()) {
1094
- return false;
1095
- } // Check if any possible number lengths are present;
1096
- // if so, we use them to avoid checking
1097
- // the validation pattern if they don't match.
1098
- // If they are absent, this means they match
1099
- // the general description, which we have
1100
- // already checked before a specific number type.
1101
-
1102
-
1103
- if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {
1104
- return false;
1105
- }
1106
-
1107
- return matchesEntirely(nationalNumber, type.pattern());
1108
- }
1109
-
1110
- /**
1111
- * Checks if a given phone number is valid.
1112
- *
1113
- * If the `number` is a string, it will be parsed to an object,
1114
- * but only if it contains only valid phone number characters (including punctuation).
1115
- * If the `number` is an object, it is used as is.
1116
- *
1117
- * The optional `defaultCountry` argument is the default country.
1118
- * I.e. it does not restrict to just that country,
1119
- * e.g. in those cases where several countries share
1120
- * the same phone numbering rules (NANPA, Britain, etc).
1121
- * For example, even though the number `07624 369230`
1122
- * belongs to the Isle of Man ("IM" country code)
1123
- * calling `isValidNumber('07624369230', 'GB', metadata)`
1124
- * still returns `true` because the country is not restricted to `GB`,
1125
- * it's just that `GB` is the default one for the phone numbering rules.
1126
- * For restricting the country see `isValidNumberForRegion()`
1127
- * though restricting a country might not be a good idea.
1128
- * https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion
1129
- *
1130
- * Examples:
1131
- *
1132
- * ```js
1133
- * isValidNumber('+78005553535', metadata)
1134
- * isValidNumber('8005553535', 'RU', metadata)
1135
- * isValidNumber('88005553535', 'RU', metadata)
1136
- * isValidNumber({ phone: '8005553535', country: 'RU' }, metadata)
1137
- * ```
1138
- */
1139
-
1140
- function isValidNumber(input, options, metadata) {
1141
- // If assigning the `{}` default value is moved to the arguments above,
1142
- // code coverage would decrease for some weird reason.
1143
- options = options || {};
1144
- metadata = new Metadata(metadata); // This is just to support `isValidNumber({})`
1145
- // for cases when `parseNumber()` returns `{}`.
1146
-
1147
- if (!input.country) {
1148
- return false;
1149
- }
1150
-
1151
- metadata.selectNumberingPlan(input.country, input.countryCallingCode); // By default, countries only have type regexps when it's required for
1152
- // distinguishing different countries having the same `countryCallingCode`.
1153
-
1154
- if (metadata.hasTypes()) {
1155
- return getNumberType(input, options, metadata.metadata) !== undefined;
1156
- } // If there are no type regexps for this country in metadata then use
1157
- // `nationalNumberPattern` as a "better than nothing" replacement.
1158
-
1159
-
1160
- var national_number = options.v2 ? input.nationalNumber : input.phone;
1161
- return matchesEntirely(national_number, metadata.nationalNumberPattern());
1162
- }
1163
-
1164
- //
1165
- // E.g. "(999) 111-22-33" -> "999 111 22 33"
1166
- //
1167
- // For some reason Google's metadata contains `<intlFormat/>`s with brackets and dashes.
1168
- // Meanwhile, there's no single opinion about using punctuation in international phone numbers.
1169
- //
1170
- // For example, Google's `<intlFormat/>` for USA is `+1 213-373-4253`.
1171
- // And here's a quote from WikiPedia's "North American Numbering Plan" page:
1172
- // https://en.wikipedia.org/wiki/North_American_Numbering_Plan
1173
- //
1174
- // "The country calling code for all countries participating in the NANP is 1.
1175
- // In international format, an NANP number should be listed as +1 301 555 01 00,
1176
- // where 301 is an area code (Maryland)."
1177
- //
1178
- // I personally prefer the international format without any punctuation.
1179
- // For example, brackets are remnants of the old age, meaning that the
1180
- // phone number part in brackets (so called "area code") can be omitted
1181
- // if dialing within the same "area".
1182
- // And hyphens were clearly introduced for splitting local numbers into memorizable groups.
1183
- // For example, remembering "5553535" is difficult but "555-35-35" is much simpler.
1184
- // Imagine a man taking a bus from home to work and seeing an ad with a phone number.
1185
- // He has a couple of seconds to memorize that number until it passes by.
1186
- // If it were spaces instead of hyphens the man wouldn't necessarily get it,
1187
- // but with hyphens instead of spaces the grouping is more explicit.
1188
- // I personally think that hyphens introduce visual clutter,
1189
- // so I prefer replacing them with spaces in international numbers.
1190
- // In the modern age all output is done on displays where spaces are clearly distinguishable
1191
- // so hyphens can be safely replaced with spaces without losing any legibility.
1192
- //
1193
-
1194
- function applyInternationalSeparatorStyle(formattedNumber) {
1195
- return formattedNumber.replace(new RegExp("[".concat(VALID_PUNCTUATION, "]+"), 'g'), ' ').trim();
1196
- }
1197
-
1198
- // first group is not used in the national pattern (e.g. Argentina) so the $1
1199
- // group does not match correctly. Therefore, we use `\d`, so that the first
1200
- // group actually used in the pattern will be matched.
1201
-
1202
- var FIRST_GROUP_PATTERN = /(\$\d)/;
1203
- function formatNationalNumberUsingFormat(number, format, _ref) {
1204
- var useInternationalFormat = _ref.useInternationalFormat,
1205
- withNationalPrefix = _ref.withNationalPrefix;
1206
- var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() : // This library doesn't use `domestic_carrier_code_formatting_rule`,
1207
- // because that one is only used when formatting phone numbers
1208
- // for dialing from a mobile phone, and this is not a dialing library.
1209
- // carrierCode && format.domesticCarrierCodeFormattingRule()
1210
- // // First, replace the $CC in the formatting rule with the desired carrier code.
1211
- // // Then, replace the $FG in the formatting rule with the first group
1212
- // // and the carrier code combined in the appropriate way.
1213
- // ? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))
1214
- // : (
1215
- // withNationalPrefix && format.nationalPrefixFormattingRule()
1216
- // ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())
1217
- // : format.format()
1218
- // )
1219
- withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format());
1220
-
1221
- if (useInternationalFormat) {
1222
- return applyInternationalSeparatorStyle(formattedNumber);
1223
- }
1224
-
1225
- return formattedNumber;
1226
- }
1227
-
1228
- /**
1229
- * Pattern that makes it easy to distinguish whether a region has a single
1230
- * international dialing prefix or not. If a region has a single international
1231
- * prefix (e.g. 011 in USA), it will be represented as a string that contains
1232
- * a sequence of ASCII digits, and possibly a tilde, which signals waiting for
1233
- * the tone. If there are multiple available international prefixes in a
1234
- * region, they will be represented as a regex string that always contains one
1235
- * or more characters that are not ASCII digits or a tilde.
1236
- */
1237
-
1238
- var SINGLE_IDD_PREFIX_REG_EXP = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/; // For regions that have multiple IDD prefixes
1239
- // a preferred IDD prefix is returned.
1240
-
1241
- function getIddPrefix(country, callingCode, metadata) {
1242
- var countryMetadata = new Metadata(metadata);
1243
- countryMetadata.selectNumberingPlan(country, callingCode);
1244
-
1245
- if (countryMetadata.defaultIDDPrefix()) {
1246
- return countryMetadata.defaultIDDPrefix();
1247
- }
1248
-
1249
- if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {
1250
- return countryMetadata.IDDPrefix();
1251
- }
1252
- }
1253
-
1254
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
1255
-
1256
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1257
- var DEFAULT_OPTIONS = {
1258
- formatExtension: function formatExtension(formattedNumber, extension, metadata) {
1259
- return "".concat(formattedNumber).concat(metadata.ext()).concat(extension);
1260
- } // Formats a phone number
1261
- //
1262
- // Example use cases:
1263
- //
1264
- // ```js
1265
- // formatNumber('8005553535', 'RU', 'INTERNATIONAL')
1266
- // formatNumber('8005553535', 'RU', 'INTERNATIONAL', metadata)
1267
- // formatNumber({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL')
1268
- // formatNumber({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', metadata)
1269
- // formatNumber('+78005553535', 'NATIONAL')
1270
- // formatNumber('+78005553535', 'NATIONAL', metadata)
1271
- // ```
1272
- //
1273
-
1274
- };
1275
- function formatNumber(input, format, options, metadata) {
1276
- // Apply default options.
1277
- if (options) {
1278
- options = _objectSpread({}, DEFAULT_OPTIONS, options);
1279
- } else {
1280
- options = DEFAULT_OPTIONS;
1281
- }
1282
-
1283
- metadata = new Metadata(metadata);
1284
-
1285
- if (input.country && input.country !== '001') {
1286
- // Validate `input.country`.
1287
- if (!metadata.hasCountry(input.country)) {
1288
- throw new Error("Unknown country: ".concat(input.country));
1289
- }
1290
-
1291
- metadata.country(input.country);
1292
- } else if (input.countryCallingCode) {
1293
- metadata.selectNumberingPlan(input.countryCallingCode);
1294
- } else return input.phone || '';
1295
-
1296
- var countryCallingCode = metadata.countryCallingCode();
1297
- var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // This variable should have been declared inside `case`s
1298
- // but Babel has a bug and it says "duplicate variable declaration".
1299
-
1300
- var number;
1301
-
1302
- switch (format) {
1303
- case 'NATIONAL':
1304
- // Legacy argument support.
1305
- // (`{ country: ..., phone: '' }`)
1306
- if (!nationalNumber) {
1307
- return '';
1308
- }
1309
-
1310
- number = formatNationalNumber(nationalNumber, input.carrierCode, 'NATIONAL', metadata, options);
1311
- return addExtension(number, input.ext, metadata, options.formatExtension);
1312
-
1313
- case 'INTERNATIONAL':
1314
- // Legacy argument support.
1315
- // (`{ country: ..., phone: '' }`)
1316
- if (!nationalNumber) {
1317
- return "+".concat(countryCallingCode);
1318
- }
1319
-
1320
- number = formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata, options);
1321
- number = "+".concat(countryCallingCode, " ").concat(number);
1322
- return addExtension(number, input.ext, metadata, options.formatExtension);
1323
-
1324
- case 'E.164':
1325
- // `E.164` doesn't define "phone number extensions".
1326
- return "+".concat(countryCallingCode).concat(nationalNumber);
1327
-
1328
- case 'RFC3966':
1329
- return formatRFC3966({
1330
- number: "+".concat(countryCallingCode).concat(nationalNumber),
1331
- ext: input.ext
1332
- });
1333
- // For reference, here's Google's IDD formatter:
1334
- // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546
1335
- // Not saying that this IDD formatter replicates it 1:1, but it seems to work.
1336
- // Who would even need to format phone numbers in IDD format anyway?
1337
-
1338
- case 'IDD':
1339
- if (!options.fromCountry) {
1340
- return; // throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')
1341
- }
1342
-
1343
- var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);
1344
- return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);
1345
-
1346
- default:
1347
- throw new Error("Unknown \"format\" argument passed to \"formatNumber()\": \"".concat(format, "\""));
1348
- }
1349
- }
1350
-
1351
- function formatNationalNumber(number, carrierCode, formatAs, metadata, options) {
1352
- var format = chooseFormatForNumber(metadata.formats(), number);
1353
-
1354
- if (!format) {
1355
- return number;
1356
- }
1357
-
1358
- return formatNationalNumberUsingFormat(number, format, {
1359
- useInternationalFormat: formatAs === 'INTERNATIONAL',
1360
- withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,
1361
- carrierCode: carrierCode,
1362
- metadata: metadata
1363
- });
1364
- }
1365
-
1366
- function chooseFormatForNumber(availableFormats, nationalNnumber) {
1367
- for (var _iterator = availableFormats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
1368
- var _ref;
1369
-
1370
- if (_isArray) {
1371
- if (_i >= _iterator.length) break;
1372
- _ref = _iterator[_i++];
1373
- } else {
1374
- _i = _iterator.next();
1375
- if (_i.done) break;
1376
- _ref = _i.value;
1377
- }
1378
-
1379
- var format = _ref;
1380
-
1381
- // Validate leading digits
1382
- if (format.leadingDigitsPatterns().length > 0) {
1383
- // The last leading_digits_pattern is used here, as it is the most detailed
1384
- var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1]; // If leading digits don't match then move on to the next phone number format
1385
-
1386
- if (nationalNnumber.search(lastLeadingDigitsPattern) !== 0) {
1387
- continue;
1388
- }
1389
- } // Check that the national number matches the phone number format regular expression
1390
-
1391
-
1392
- if (matchesEntirely(nationalNnumber, format.pattern())) {
1393
- return format;
1394
- }
1395
- }
1396
- }
1397
-
1398
- function addExtension(formattedNumber, ext, metadata, formatExtension) {
1399
- return ext ? formatExtension(formattedNumber, ext, metadata) : formattedNumber;
1400
- }
1401
-
1402
- function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {
1403
- var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata); // When calling within the same country calling code.
1404
-
1405
- if (fromCountryCallingCode === countryCallingCode) {
1406
- var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, 'NATIONAL', metadata); // For NANPA regions, return the national format for these regions
1407
- // but prefix it with the country calling code.
1408
-
1409
- if (countryCallingCode === '1') {
1410
- return countryCallingCode + ' ' + formattedNumber;
1411
- } // If regions share a country calling code, the country calling code need
1412
- // not be dialled. This also applies when dialling within a region, so this
1413
- // if clause covers both these cases. Technically this is the case for
1414
- // dialling from La Reunion to other overseas departments of France (French
1415
- // Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover
1416
- // this edge case for now and for those cases return the version including
1417
- // country calling code. Details here:
1418
- // http://www.petitfute.com/voyage/225-info-pratiques-reunion
1419
- //
1420
-
1421
-
1422
- return formattedNumber;
1423
- }
1424
-
1425
- var iddPrefix = getIddPrefix(fromCountry, undefined, metadata.metadata);
1426
-
1427
- if (iddPrefix) {
1428
- return "".concat(iddPrefix, " ").concat(countryCallingCode, " ").concat(formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata));
1429
- }
1430
- }
1431
-
1432
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$1(target, key, source[key]); }); } return target; }
1433
-
1434
- function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1435
-
1436
- function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1437
-
1438
- function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1439
-
1440
- function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
1441
-
1442
- var PhoneNumber =
1443
- /*#__PURE__*/
1444
- function () {
1445
- function PhoneNumber(countryCallingCode, nationalNumber, metadata) {
1446
- _classCallCheck$1(this, PhoneNumber);
1447
-
1448
- if (!countryCallingCode) {
1449
- throw new TypeError('`country` or `countryCallingCode` not passed');
1450
- }
1451
-
1452
- if (!nationalNumber) {
1453
- throw new TypeError('`nationalNumber` not passed');
1454
- }
1455
-
1456
- if (!metadata) {
1457
- throw new TypeError('`metadata` not passed');
1458
- }
1459
-
1460
- var _metadata = new Metadata(metadata); // If country code is passed then derive `countryCallingCode` from it.
1461
- // Also store the country code as `.country`.
1462
-
1463
-
1464
- if (isCountryCode(countryCallingCode)) {
1465
- this.country = countryCallingCode;
1466
-
1467
- _metadata.country(countryCallingCode);
1468
-
1469
- countryCallingCode = _metadata.countryCallingCode();
1470
- }
1471
-
1472
- this.countryCallingCode = countryCallingCode;
1473
- this.nationalNumber = nationalNumber;
1474
- this.number = '+' + this.countryCallingCode + this.nationalNumber;
1475
- this.metadata = metadata;
1476
- }
1477
-
1478
- _createClass$1(PhoneNumber, [{
1479
- key: "isPossible",
1480
- value: function isPossible() {
1481
- return isPossiblePhoneNumber(this, {
1482
- v2: true
1483
- }, this.metadata);
1484
- }
1485
- }, {
1486
- key: "isValid",
1487
- value: function isValid() {
1488
- return isValidNumber(this, {
1489
- v2: true
1490
- }, this.metadata);
1491
- }
1492
- }, {
1493
- key: "isNonGeographic",
1494
- value: function isNonGeographic() {
1495
- var metadata = new Metadata(this.metadata);
1496
- return metadata.isNonGeographicCallingCode(this.countryCallingCode);
1497
- }
1498
- }, {
1499
- key: "isEqual",
1500
- value: function isEqual(phoneNumber) {
1501
- return this.number === phoneNumber.number && this.ext === phoneNumber.ext;
1502
- } // // Is just an alias for `this.isValid() && this.country === country`.
1503
- // // https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion
1504
- // isValidForRegion(country) {
1505
- // return isValidNumberForRegion(this, country, { v2: true }, this.metadata)
1506
- // }
1507
-
1508
- }, {
1509
- key: "getType",
1510
- value: function getType() {
1511
- return getNumberType(this, {
1512
- v2: true
1513
- }, this.metadata);
1514
- }
1515
- }, {
1516
- key: "format",
1517
- value: function format(_format, options) {
1518
- return formatNumber(this, _format, options ? _objectSpread$1({}, options, {
1519
- v2: true
1520
- }) : {
1521
- v2: true
1522
- }, this.metadata);
1523
- }
1524
- }, {
1525
- key: "formatNational",
1526
- value: function formatNational(options) {
1527
- return this.format('NATIONAL', options);
1528
- }
1529
- }, {
1530
- key: "formatInternational",
1531
- value: function formatInternational(options) {
1532
- return this.format('INTERNATIONAL', options);
1533
- }
1534
- }, {
1535
- key: "getURI",
1536
- value: function getURI(options) {
1537
- return this.format('RFC3966', options);
1538
- }
1539
- }]);
1540
-
1541
- return PhoneNumber;
1542
- }();
1543
-
1544
- var isCountryCode = function isCountryCode(value) {
1545
- return /^[A-Z]{2}$/.test(value);
1546
- };
1547
-
1548
- var CAPTURING_DIGIT_PATTERN = new RegExp('([' + VALID_DIGITS + '])');
1549
- function stripIddPrefix(number, country, callingCode, metadata) {
1550
- if (!country) {
1551
- return;
1552
- } // Check if the number is IDD-prefixed.
1553
-
1554
-
1555
- var countryMetadata = new Metadata(metadata);
1556
- countryMetadata.selectNumberingPlan(country, callingCode);
1557
- var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());
1558
-
1559
- if (number.search(IDDPrefixPattern) !== 0) {
1560
- return;
1561
- } // Strip IDD prefix.
1562
-
1563
-
1564
- number = number.slice(number.match(IDDPrefixPattern)[0].length); // If there're any digits after an IDD prefix,
1565
- // then those digits are a country calling code.
1566
- // Since no country code starts with a `0`,
1567
- // the code below validates that the next digit (if present) is not `0`.
1568
-
1569
- var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);
1570
-
1571
- if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {
1572
- if (matchedGroups[1] === '0') {
1573
- return;
1574
- }
1575
- }
1576
-
1577
- return number;
1578
- }
1579
-
1580
- /**
1581
- * Strips any national prefix (such as 0, 1) present in a
1582
- * (possibly incomplete) number provided.
1583
- * "Carrier codes" are only used in Colombia and Brazil,
1584
- * and only when dialing within those countries from a mobile phone to a fixed line number.
1585
- * Sometimes it won't actually strip national prefix
1586
- * and will instead prepend some digits to the `number`:
1587
- * for example, when number `2345678` is passed with `VI` country selected,
1588
- * it will return `{ number: "3402345678" }`, because `340` area code is prepended.
1589
- * @param {string} number — National number digits.
1590
- * @param {object} metadata — Metadata with country selected.
1591
- * @return {object} `{ nationalNumber: string, nationalPrefix: string? carrierCode: string? }`.
1592
- */
1593
- function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {
1594
- if (number && metadata.numberingPlan.nationalPrefixForParsing()) {
1595
- // See METADATA.md for the description of
1596
- // `national_prefix_for_parsing` and `national_prefix_transform_rule`.
1597
- // Attempt to parse the first digits as a national prefix.
1598
- var prefixPattern = new RegExp('^(?:' + metadata.numberingPlan.nationalPrefixForParsing() + ')');
1599
- var prefixMatch = prefixPattern.exec(number);
1600
-
1601
- if (prefixMatch) {
1602
- var nationalNumber;
1603
- var carrierCode; // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule
1604
- // If a `national_prefix_for_parsing` has any "capturing groups"
1605
- // then it means that the national (significant) number is equal to
1606
- // those "capturing groups" transformed via `national_prefix_transform_rule`,
1607
- // and nothing could be said about the actual national prefix:
1608
- // what is it and was it even there.
1609
- // If a `national_prefix_for_parsing` doesn't have any "capturing groups",
1610
- // then everything it matches is a national prefix.
1611
- // To determine whether `national_prefix_for_parsing` matched any
1612
- // "capturing groups", the value of the result of calling `.exec()`
1613
- // is looked at, and if it has non-undefined values where there're
1614
- // "capturing groups" in the regular expression, then it means
1615
- // that "capturing groups" have been matched.
1616
- // It's not possible to tell whether there'll be any "capturing gropus"
1617
- // before the matching process, because a `national_prefix_for_parsing`
1618
- // could exhibit both behaviors.
1619
-
1620
- var capturedGroupsCount = prefixMatch.length - 1;
1621
- var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];
1622
-
1623
- if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {
1624
- nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule()); // If there's more than one captured group,
1625
- // then carrier code is the second one.
1626
-
1627
- if (capturedGroupsCount > 1) {
1628
- carrierCode = prefixMatch[1];
1629
- }
1630
- } // If there're no "capturing groups",
1631
- // or if there're "capturing groups" but no
1632
- // `national_prefix_transform_rule`,
1633
- // then just strip the national prefix from the number,
1634
- // and possibly a carrier code.
1635
- // Seems like there could be more.
1636
- else {
1637
- // `prefixBeforeNationalNumber` is the whole substring matched by
1638
- // the `national_prefix_for_parsing` regular expression.
1639
- // There seem to be no guarantees that it's just a national prefix.
1640
- // For example, if there's a carrier code, it's gonna be a
1641
- // part of `prefixBeforeNationalNumber` too.
1642
- var prefixBeforeNationalNumber = prefixMatch[0];
1643
- nationalNumber = number.slice(prefixBeforeNationalNumber.length); // If there's at least one captured group,
1644
- // then carrier code is the first one.
1645
-
1646
- if (hasCapturedGroups) {
1647
- carrierCode = prefixMatch[1];
1648
- }
1649
- } // Tries to guess whether a national prefix was present in the input.
1650
- // This is not something copy-pasted from Google's library:
1651
- // they don't seem to have an equivalent for that.
1652
- // So this isn't an "officially approved" way of doing something like that.
1653
- // But since there seems no other existing method, this library uses it.
1654
-
1655
-
1656
- var nationalPrefix;
1657
-
1658
- if (hasCapturedGroups) {
1659
- var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);
1660
- var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup); // Example: an Argentinian (AR) phone number `0111523456789`.
1661
- // `prefixMatch[0]` is `01115`, and `$1` is `11`,
1662
- // and the rest of the phone number is `23456789`.
1663
- // The national number is transformed via `9$1` to `91123456789`.
1664
- // National prefix `0` is detected being present at the start.
1665
- // if (possibleNationalPrefix.indexOf(metadata.numberingPlan.nationalPrefix()) === 0) {
1666
-
1667
- if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {
1668
- nationalPrefix = metadata.numberingPlan.nationalPrefix();
1669
- }
1670
- } else {
1671
- nationalPrefix = prefixMatch[0];
1672
- }
1673
-
1674
- return {
1675
- nationalNumber: nationalNumber,
1676
- nationalPrefix: nationalPrefix,
1677
- carrierCode: carrierCode
1678
- };
1679
- }
1680
- }
1681
-
1682
- return {
1683
- nationalNumber: number
1684
- };
1685
- }
1686
-
1687
- /**
1688
- * Strips national prefix and carrier code from a complete phone number.
1689
- * The difference from the non-"FromCompleteNumber" function is that
1690
- * it won't extract national prefix if the resultant number is too short
1691
- * to be a complete number for the selected phone numbering plan.
1692
- * @param {string} number — Complete phone number digits.
1693
- * @param {Metadata} metadata — Metadata with a phone numbering plan selected.
1694
- * @return {object} `{ nationalNumber: string, carrierCode: string? }`.
1695
- */
1696
-
1697
- function extractNationalNumber(number, metadata) {
1698
- // Parsing national prefixes and carrier codes
1699
- // is only required for local phone numbers
1700
- // but some people don't understand that
1701
- // and sometimes write international phone numbers
1702
- // with national prefixes (or maybe even carrier codes).
1703
- // http://ucken.blogspot.ru/2016/03/trunk-prefixes-in-skype4b.html
1704
- // Google's original library forgives such mistakes
1705
- // and so does this library, because it has been requested:
1706
- // https://github.com/catamphetamine/libphonenumber-js/issues/127
1707
- var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata),
1708
- nationalNumber = _extractNationalNumbe.nationalNumber,
1709
- carrierCode = _extractNationalNumbe.carrierCode;
1710
-
1711
- if (!shouldExtractNationalPrefix(number, nationalNumber, metadata)) {
1712
- // Don't strip the national prefix.
1713
- return {
1714
- nationalNumber: number
1715
- };
1716
- } // If a national prefix has been extracted, check to see
1717
- // if the resultant number isn't too short.
1718
- // Same code in Google's `libphonenumber`:
1719
- // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3291-L3302
1720
- // For some reason, they do this check right after the `national_number_pattern` check
1721
- // this library does in `shouldExtractNationalPrefix()` function.
1722
- // Why is there a second "resultant" number validity check?
1723
- // They don't provide an explanation.
1724
- // This library just copies the behavior.
1725
-
1726
-
1727
- if (number.length !== nationalNumber.length + (carrierCode ? carrierCode.length : 0)) {
1728
- // If not using legacy generated metadata (before version `1.0.18`)
1729
- // then it has "possible lengths", so use those to validate the number length.
1730
- if (metadata.possibleLengths()) {
1731
- // "We require that the NSN remaining after stripping the national prefix and
1732
- // carrier code be long enough to be a possible length for the region.
1733
- // Otherwise, we don't do the stripping, since the original number could be
1734
- // a valid short number."
1735
- // https://github.com/google/libphonenumber/blob/876268eb1ad6cdc1b7b5bef17fc5e43052702d57/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3236-L3250
1736
- switch (checkNumberLength(nationalNumber, metadata)) {
1737
- case 'TOO_SHORT':
1738
- case 'INVALID_LENGTH':
1739
- // case 'IS_POSSIBLE_LOCAL_ONLY':
1740
- // Don't strip the national prefix.
1741
- return {
1742
- nationalNumber: number
1743
- };
1744
- }
1745
- }
1746
- }
1747
-
1748
- return {
1749
- nationalNumber: nationalNumber,
1750
- carrierCode: carrierCode
1751
- };
1752
- } // In some countries, the same digit could be a national prefix
1753
- // or a leading digit of a valid phone number.
1754
- // For example, in Russia, national prefix is `8`,
1755
- // and also `800 555 35 35` is a valid number
1756
- // in which `8` is not a national prefix, but the first digit
1757
- // of a national (significant) number.
1758
- // Same's with Belarus:
1759
- // `82004910060` is a valid national (significant) number,
1760
- // but `2004910060` is not.
1761
- // To support such cases (to prevent the code from always stripping
1762
- // national prefix), a condition is imposed: a national prefix
1763
- // is not extracted when the original number is "viable" and the
1764
- // resultant number is not, a "viable" national number being the one
1765
- // that matches `national_number_pattern`.
1766
-
1767
- function shouldExtractNationalPrefix(number, nationalSignificantNumber, metadata) {
1768
- // The equivalent in Google's code is:
1769
- // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2969-L3004
1770
- if (matchesEntirely(number, metadata.nationalNumberPattern()) && !matchesEntirely(nationalSignificantNumber, metadata.nationalNumberPattern())) {
1771
- return false;
1772
- } // Just "possible" number check would be more relaxed, so it's not used.
1773
- // if (isPossibleNumber(number, metadata) &&
1774
- // !isPossibleNumber(numberWithNationalPrefixExtracted, metadata)) {
1775
- // return false
1776
- // }
1777
-
1778
-
1779
- return true;
1780
- }
1781
-
1782
- /**
1783
- * Sometimes some people incorrectly input international phone numbers
1784
- * without the leading `+`. This function corrects such input.
1785
- * @param {string} number — Phone number digits.
1786
- * @param {string?} country
1787
- * @param {string?} callingCode
1788
- * @param {object} metadata
1789
- * @return {object} `{ countryCallingCode: string?, number: string }`.
1790
- */
1791
-
1792
- function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata) {
1793
- var countryCallingCode = country ? getCountryCallingCode(country, metadata) : callingCode;
1794
-
1795
- if (number.indexOf(countryCallingCode) === 0) {
1796
- metadata = new Metadata(metadata);
1797
- metadata.selectNumberingPlan(country, callingCode);
1798
- var possibleShorterNumber = number.slice(countryCallingCode.length);
1799
-
1800
- var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, metadata),
1801
- possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;
1802
-
1803
- var _extractNationalNumbe2 = extractNationalNumber(number, metadata),
1804
- nationalNumber = _extractNationalNumbe2.nationalNumber; // If the number was not valid before but is valid now,
1805
- // or if it was too long before, we consider the number
1806
- // with the country calling code stripped to be a better result
1807
- // and keep that instead.
1808
- // For example, in Germany (+49), `49` is a valid area code,
1809
- // so if a number starts with `49`, it could be both a valid
1810
- // national German number or an international number without
1811
- // a leading `+`.
1812
-
1813
-
1814
- if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, metadata) === 'TOO_LONG') {
1815
- return {
1816
- countryCallingCode: countryCallingCode,
1817
- number: possibleShorterNumber
1818
- };
1819
- }
1820
- }
1821
-
1822
- return {
1823
- number: number
1824
- };
1825
- }
1826
-
1827
- /**
1828
- * Converts a phone number digits (possibly with a `+`)
1829
- * into a calling code and the rest phone number digits.
1830
- * The "rest phone number digits" could include
1831
- * a national prefix, carrier code, and national
1832
- * (significant) number.
1833
- * @param {string} number — Phone number digits (possibly with a `+`).
1834
- * @param {string} [country] — Default country.
1835
- * @param {string} [callingCode] — Default calling code (some phone numbering plans are non-geographic).
1836
- * @param {object} metadata
1837
- * @return {object} `{ countryCallingCode: string?, number: string }`
1838
- * @example
1839
- * // Returns `{ countryCallingCode: "1", number: "2133734253" }`.
1840
- * extractCountryCallingCode('2133734253', 'US', null, metadata)
1841
- * extractCountryCallingCode('2133734253', null, '1', metadata)
1842
- * extractCountryCallingCode('+12133734253', null, null, metadata)
1843
- * extractCountryCallingCode('+12133734253', 'RU', null, metadata)
1844
- */
1845
-
1846
- function extractCountryCallingCode(number, country, callingCode, metadata) {
1847
- if (!number) {
1848
- return {};
1849
- } // If this is not an international phone number,
1850
- // then either extract an "IDD" prefix, or extract a
1851
- // country calling code from a number by autocorrecting it
1852
- // by prepending a leading `+` in cases when it starts
1853
- // with the country calling code.
1854
- // https://wikitravel.org/en/International_dialling_prefix
1855
- // https://github.com/catamphetamine/libphonenumber-js/issues/376
1856
-
1857
-
1858
- if (number[0] !== '+') {
1859
- // Convert an "out-of-country" dialing phone number
1860
- // to a proper international phone number.
1861
- var numberWithoutIDD = stripIddPrefix(number, country, callingCode, metadata); // If an IDD prefix was stripped then
1862
- // convert the number to international one
1863
- // for subsequent parsing.
1864
-
1865
- if (numberWithoutIDD && numberWithoutIDD !== number) {
1866
- number = '+' + numberWithoutIDD;
1867
- } else {
1868
- // Check to see if the number starts with the country calling code
1869
- // for the default country. If so, we remove the country calling code,
1870
- // and do some checks on the validity of the number before and after.
1871
- // https://github.com/catamphetamine/libphonenumber-js/issues/376
1872
- if (country || callingCode) {
1873
- var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata),
1874
- countryCallingCode = _extractCountryCallin.countryCallingCode,
1875
- shorterNumber = _extractCountryCallin.number;
1876
-
1877
- if (countryCallingCode) {
1878
- return {
1879
- countryCallingCode: countryCallingCode,
1880
- number: shorterNumber
1881
- };
1882
- }
1883
- }
1884
-
1885
- return {
1886
- number: number
1887
- };
1888
- }
1889
- } // Fast abortion: country codes do not begin with a '0'
1890
-
1891
-
1892
- if (number[1] === '0') {
1893
- return {};
1894
- }
1895
-
1896
- metadata = new Metadata(metadata); // The thing with country phone codes
1897
- // is that they are orthogonal to each other
1898
- // i.e. there's no such country phone code A
1899
- // for which country phone code B exists
1900
- // where B starts with A.
1901
- // Therefore, while scanning digits,
1902
- // if a valid country code is found,
1903
- // that means that it is the country code.
1904
- //
1905
-
1906
- var i = 2;
1907
-
1908
- while (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {
1909
- var _countryCallingCode = number.slice(1, i);
1910
-
1911
- if (metadata.hasCallingCode(_countryCallingCode)) {
1912
- metadata.selectNumberingPlan(_countryCallingCode);
1913
- return {
1914
- countryCallingCode: _countryCallingCode,
1915
- number: number.slice(i)
1916
- };
1917
- }
1918
-
1919
- i++;
1920
- }
1921
-
1922
- return {};
1923
- }
1924
-
1925
- function getCountryByCallingCode(callingCode, nationalPhoneNumber, metadata) {
1926
-
1927
-
1928
- var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);
1929
-
1930
- if (!possibleCountries) {
1931
- return;
1932
- } // If there's just one country corresponding to the country code,
1933
- // then just return it, without further phone number digits validation.
1934
-
1935
-
1936
- if (possibleCountries.length === 1) {
1937
- return possibleCountries[0];
1938
- }
1939
-
1940
- return selectCountryFromList(possibleCountries, nationalPhoneNumber, metadata.metadata);
1941
- }
1942
-
1943
- function selectCountryFromList(possibleCountries, nationalPhoneNumber, metadata) {
1944
- // Re-create `metadata` because it will be selecting a `country`.
1945
- metadata = new Metadata(metadata);
1946
-
1947
- for (var _iterator = possibleCountries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
1948
- var _ref;
1949
-
1950
- if (_isArray) {
1951
- if (_i >= _iterator.length) break;
1952
- _ref = _iterator[_i++];
1953
- } else {
1954
- _i = _iterator.next();
1955
- if (_i.done) break;
1956
- _ref = _i.value;
1957
- }
1958
-
1959
- var country = _ref;
1960
- metadata.country(country); // Leading digits check would be the simplest one
1961
-
1962
- if (metadata.leadingDigits()) {
1963
- if (nationalPhoneNumber && nationalPhoneNumber.search(metadata.leadingDigits()) === 0) {
1964
- return country;
1965
- }
1966
- } // Else perform full validation with all of those
1967
- // fixed-line/mobile/etc regular expressions.
1968
- else if (getNumberType({
1969
- phone: nationalPhoneNumber,
1970
- country: country
1971
- }, undefined, metadata.metadata)) {
1972
- return country;
1973
- }
1974
- }
1975
- }
1976
-
1977
- function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1978
-
1979
- function _defineProperties$2(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1980
-
1981
- function _createClass$2(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$2(Constructor.prototype, protoProps); if (staticProps) _defineProperties$2(Constructor, staticProps); return Constructor; }
1982
-
1983
- function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1984
-
1985
- var AsYouTypeState =
1986
- /*#__PURE__*/
1987
- function () {
1988
- function AsYouTypeState(_ref) {
1989
- var _this = this;
1990
-
1991
- var onCountryChange = _ref.onCountryChange,
1992
- onCallingCodeChange = _ref.onCallingCodeChange;
1993
-
1994
- _classCallCheck$2(this, AsYouTypeState);
1995
-
1996
- _defineProperty$2(this, "update", function (properties) {
1997
- for (var _i = 0, _Object$keys = Object.keys(properties); _i < _Object$keys.length; _i++) {
1998
- var key = _Object$keys[_i];
1999
- _this[key] = properties[key];
2000
- }
2001
- });
2002
-
2003
- this.onCountryChange = onCountryChange;
2004
- this.onCallingCodeChange = onCallingCodeChange;
2005
- }
2006
-
2007
- _createClass$2(AsYouTypeState, [{
2008
- key: "reset",
2009
- value: function reset(defaultCountry, defaultCallingCode) {
2010
- this.international = false;
2011
- this.IDDPrefix = undefined;
2012
- this.missingPlus = undefined;
2013
- this.callingCode = undefined;
2014
- this.digits = '';
2015
- this.resetNationalSignificantNumber();
2016
- this.initCountryAndCallingCode(defaultCountry, defaultCallingCode);
2017
- }
2018
- }, {
2019
- key: "resetNationalSignificantNumber",
2020
- value: function resetNationalSignificantNumber() {
2021
- this.nationalSignificantNumber = this.getNationalDigits();
2022
- this.nationalSignificantNumberMatchesInput = true;
2023
- this.nationalPrefix = undefined;
2024
- this.carrierCode = undefined;
2025
- this.complexPrefixBeforeNationalSignificantNumber = undefined;
2026
- }
2027
- }, {
2028
- key: "initCountryAndCallingCode",
2029
- value: function initCountryAndCallingCode(country, callingCode) {
2030
- this.setCountry(country);
2031
- this.setCallingCode(callingCode);
2032
- }
2033
- }, {
2034
- key: "setCountry",
2035
- value: function setCountry(country) {
2036
- this.country = country;
2037
- this.onCountryChange(country);
2038
- }
2039
- }, {
2040
- key: "setCallingCode",
2041
- value: function setCallingCode(callingCode) {
2042
- this.callingCode = callingCode;
2043
- return this.onCallingCodeChange(this.country, callingCode);
2044
- }
2045
- }, {
2046
- key: "startInternationalNumber",
2047
- value: function startInternationalNumber() {
2048
- // Prepend the `+` to parsed input.
2049
- this.international = true; // If a default country was set then reset it
2050
- // because an explicitly international phone
2051
- // number is being entered.
2052
-
2053
- this.initCountryAndCallingCode();
2054
- }
2055
- }, {
2056
- key: "appendDigits",
2057
- value: function appendDigits(nextDigits) {
2058
- this.digits += nextDigits;
2059
- }
2060
- }, {
2061
- key: "appendNationalSignificantNumberDigits",
2062
- value: function appendNationalSignificantNumberDigits(nextDigits) {
2063
- this.nationalSignificantNumber += nextDigits;
2064
- }
2065
- /**
2066
- * Returns the part of `this.digits` that corresponds to the national number.
2067
- * Basically, all digits that have been input by the user, except for the
2068
- * international prefix and the country calling code part
2069
- * (if the number is an international one).
2070
- * @return {string}
2071
- */
2072
-
2073
- }, {
2074
- key: "getNationalDigits",
2075
- value: function getNationalDigits() {
2076
- if (this.international) {
2077
- return this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0));
2078
- }
2079
-
2080
- return this.digits;
2081
- }
2082
- }, {
2083
- key: "getDigitsWithoutInternationalPrefix",
2084
- value: function getDigitsWithoutInternationalPrefix() {
2085
- if (this.international) {
2086
- if (this.IDDPrefix) {
2087
- return this.digits.slice(this.IDDPrefix.length);
2088
- }
2089
- }
2090
-
2091
- return this.digits;
2092
- }
2093
- }]);
2094
-
2095
- return AsYouTypeState;
2096
- }();
2097
-
2098
- // Should be the same as `DIGIT_PLACEHOLDER` in `libphonenumber-metadata-generator`.
2099
- var DIGIT_PLACEHOLDER = 'x'; // '\u2008' (punctuation space)
2100
-
2101
- var DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER); // Counts all occurences of a symbol in a string.
2102
- // http://stackoverflow.com/questions/202605/repeat-string-javascript
2103
-
2104
- function repeat(string, times) {
2105
- if (times < 1) {
2106
- return '';
2107
- }
2108
-
2109
- var result = '';
2110
-
2111
- while (times > 1) {
2112
- if (times & 1) {
2113
- result += string;
2114
- }
2115
-
2116
- times >>= 1;
2117
- string += string;
2118
- }
2119
-
2120
- return result + string;
2121
- }
2122
- function cutAndStripNonPairedParens(string, cutBeforeIndex) {
2123
- if (string[cutBeforeIndex] === ')') {
2124
- cutBeforeIndex++;
2125
- }
2126
-
2127
- return stripNonPairedParens(string.slice(0, cutBeforeIndex));
2128
- }
2129
- function stripNonPairedParens(string) {
2130
- var dangling_braces = [];
2131
- var i = 0;
2132
-
2133
- while (i < string.length) {
2134
- if (string[i] === '(') {
2135
- dangling_braces.push(i);
2136
- } else if (string[i] === ')') {
2137
- dangling_braces.pop();
2138
- }
2139
-
2140
- i++;
2141
- }
2142
-
2143
- var start = 0;
2144
- var cleared_string = '';
2145
- dangling_braces.push(string.length);
2146
-
2147
- for (var _i2 = 0, _dangling_braces = dangling_braces; _i2 < _dangling_braces.length; _i2++) {
2148
- var index = _dangling_braces[_i2];
2149
- cleared_string += string.slice(start, index);
2150
- start = index + 1;
2151
- }
2152
-
2153
- return cleared_string;
2154
- }
2155
- function populateTemplateWithDigits(template, position, digits) {
2156
- // Using `.split('')` to iterate through a string here
2157
- // to avoid requiring `Symbol.iterator` polyfill.
2158
- // `.split('')` is generally not safe for Unicode,
2159
- // but in this particular case for `digits` it is safe.
2160
- // for (const digit of digits)
2161
- for (var _iterator2 = digits.split(''), _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
2162
- var _ref2;
2163
-
2164
- if (_isArray2) {
2165
- if (_i3 >= _iterator2.length) break;
2166
- _ref2 = _iterator2[_i3++];
2167
- } else {
2168
- _i3 = _iterator2.next();
2169
- if (_i3.done) break;
2170
- _ref2 = _i3.value;
2171
- }
2172
-
2173
- var digit = _ref2;
2174
-
2175
- // If there is room for more digits in current `template`,
2176
- // then set the next digit in the `template`,
2177
- // and return the formatted digits so far.
2178
- // If more digits are entered than the current format could handle.
2179
- if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {
2180
- return;
2181
- }
2182
-
2183
- position = template.search(DIGIT_PLACEHOLDER_MATCHER);
2184
- template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);
2185
- }
2186
-
2187
- return [template, position];
2188
- }
2189
-
2190
- function formatCompleteNumber(state, format, _ref) {
2191
- var metadata = _ref.metadata,
2192
- shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule,
2193
- getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix;
2194
- var matcher = new RegExp("^(?:".concat(format.pattern(), ")$"));
2195
-
2196
- if (matcher.test(state.nationalSignificantNumber)) {
2197
- return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, {
2198
- metadata: metadata,
2199
- shouldTryNationalPrefixFormattingRule: shouldTryNationalPrefixFormattingRule,
2200
- getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix
2201
- });
2202
- }
2203
- }
2204
- function canFormatCompleteNumber(nationalSignificantNumber, metadata) {
2205
- return checkNumberLength(nationalSignificantNumber, metadata) === 'IS_POSSIBLE';
2206
- }
2207
-
2208
- function formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, _ref2) {
2209
- var metadata = _ref2.metadata,
2210
- shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule,
2211
- getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;
2212
- // If the resulting formatted number is a valid formatted number, then return it.
2213
- //
2214
- // Google's AsYouType formatter is different in a way that it doesn't try
2215
- // to format using the "national prefix formatting rule", and instead it
2216
- // simply prepends a national prefix followed by a " " character.
2217
- // This code does that too, but as a fallback.
2218
- // The reason is that "national prefix formatting rule" may use parentheses,
2219
- // which wouldn't be included has it used the simpler Google's way.
2220
- //
2221
-
2222
- if (shouldTryNationalPrefixFormattingRule(format)) {
2223
- var formattedNumber = formatNationalNumber$1(state, format, {
2224
- useNationalPrefixFormattingRule: true,
2225
- getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,
2226
- metadata: metadata
2227
- });
2228
-
2229
- if (formattedNumber) {
2230
- return formattedNumber;
2231
- }
2232
- } // Format the number without using `national_prefix_formatting_rule`.
2233
-
2234
-
2235
- return formatNationalNumber$1(state, format, {
2236
- useNationalPrefixFormattingRule: false,
2237
- getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,
2238
- metadata: metadata
2239
- });
2240
- }
2241
-
2242
- function formatNationalNumber$1(state, format, _ref3) {
2243
- var metadata = _ref3.metadata,
2244
- useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule,
2245
- getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix;
2246
- var formattedNationalNumber = formatNationalNumberUsingFormat(state.nationalSignificantNumber, format, {
2247
- carrierCode: state.carrierCode,
2248
- useInternationalFormat: state.international,
2249
- withNationalPrefix: useNationalPrefixFormattingRule,
2250
- metadata: metadata
2251
- });
2252
-
2253
- if (!useNationalPrefixFormattingRule) {
2254
- if (state.nationalPrefix) {
2255
- // If a national prefix was extracted, then just prepend it,
2256
- // followed by a " " character.
2257
- formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format) + formattedNationalNumber;
2258
- } else if (state.complexPrefixBeforeNationalSignificantNumber) {
2259
- formattedNationalNumber = state.complexPrefixBeforeNationalSignificantNumber + ' ' + formattedNationalNumber;
2260
- }
2261
- }
2262
-
2263
- if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {
2264
- return formattedNationalNumber;
2265
- }
2266
- } // Check that the formatted phone number contains exactly
2267
- // the same digits that have been input by the user.
2268
- // For example, when "0111523456789" is input for `AR` country,
2269
- // the extracted `this.nationalSignificantNumber` is "91123456789",
2270
- // which means that the national part of `this.digits` isn't simply equal to
2271
- // `this.nationalPrefix` + `this.nationalSignificantNumber`.
2272
- //
2273
- // Also, a `format` can add extra digits to the `this.nationalSignificantNumber`
2274
- // being formatted via `metadata[country].national_prefix_transform_rule`.
2275
- // For example, for `VI` country, it prepends `340` to the national number,
2276
- // and if this check hasn't been implemented, then there would be a bug
2277
- // when `340` "area coude" is "duplicated" during input for `VI` country:
2278
- // https://github.com/catamphetamine/libphonenumber-js/issues/318
2279
- //
2280
- // So, all these "gotchas" are filtered out.
2281
- //
2282
- // In the original Google's code, the comments say:
2283
- // "Check that we didn't remove nor add any extra digits when we matched
2284
- // this formatting pattern. This usually happens after we entered the last
2285
- // digit during AYTF. Eg: In case of MX, we swallow mobile token (1) when
2286
- // formatted but AYTF should retain all the number entered and not change
2287
- // in order to match a format (of same leading digits and length) display
2288
- // in that way."
2289
- // "If it's the same (i.e entered number and format is same), then it's
2290
- // safe to return this in formatted number as nothing is lost / added."
2291
- // Otherwise, don't use this format.
2292
- // https://github.com/google/libphonenumber/commit/3e7c1f04f5e7200f87fb131e6f85c6e99d60f510#diff-9149457fa9f5d608a11bb975c6ef4bc5
2293
- // https://github.com/google/libphonenumber/commit/3ac88c7106e7dcb553bcc794b15f19185928a1c6#diff-2dcb77e833422ee304da348b905cde0b
2294
- //
2295
-
2296
-
2297
- function isValidFormattedNationalNumber(formattedNationalNumber, state) {
2298
- return parseDigits(formattedNationalNumber) === state.getNationalDigits();
2299
- }
2300
-
2301
- function _classCallCheck$3(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2302
-
2303
- function _defineProperties$3(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2304
-
2305
- function _createClass$3(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$3(Constructor.prototype, protoProps); if (staticProps) _defineProperties$3(Constructor, staticProps); return Constructor; }
2306
-
2307
- function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2308
- // Could be any digit, I guess.
2309
-
2310
- var DUMMY_DIGIT = '9'; // I don't know why is it exactly `15`
2311
-
2312
- var LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15; // Create a phone number consisting only of the digit 9 that matches the
2313
- // `number_pattern` by applying the pattern to the "longest phone number" string.
2314
-
2315
- var LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH); // A set of characters that, if found in a national prefix formatting rules, are an indicator to
2316
- // us that we should separate the national prefix from the number when formatting.
2317
-
2318
- var NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/; // Deprecated: Google has removed some formatting pattern related code from their repo.
2319
- // An example of a character class is "[1-4]".
2320
-
2321
- var CREATE_CHARACTER_CLASS_PATTERN = function () {
2322
- return /\[([^\[\]])*\]/g;
2323
- }; // Any digit in a regular expression that actually denotes a digit. For
2324
- // example, in the regular expression "80[0-2]\d{6,10}", the first 2 digits
2325
- // (8 and 0) are standalone digits, but the rest are not.
2326
- // Two look-aheads are needed because the number following \\d could be a
2327
- // two-digit number, since the phone number can be as long as 15 digits.
2328
-
2329
-
2330
- var CREATE_STANDALONE_DIGIT_PATTERN = function () {
2331
- return /\d(?=[^,}][^,}])/g;
2332
- }; // A regular expression that is used to determine if a `format` is
2333
- // suitable to be used in the "as you type formatter".
2334
- // A `format` is suitable when the resulting formatted number has
2335
- // the same digits as the user has entered.
2336
- //
2337
- // In the simplest case, that would mean that the format
2338
- // doesn't add any additional digits when formatting a number.
2339
- // Google says that it also shouldn't add "star" (`*`) characters,
2340
- // like it does in some Israeli formats.
2341
- // Such basic format would only contain "valid punctuation"
2342
- // and "captured group" identifiers ($1, $2, etc).
2343
- //
2344
- // An example of a format that adds additional digits:
2345
- //
2346
- // Country: `AR` (Argentina).
2347
- // Format:
2348
- // {
2349
- // "pattern": "(\\d)(\\d{2})(\\d{4})(\\d{4})",
2350
- // "leading_digits_patterns": ["91"],
2351
- // "national_prefix_formatting_rule": "0$1",
2352
- // "format": "$2 15-$3-$4",
2353
- // "international_format": "$1 $2 $3-$4"
2354
- // }
2355
- //
2356
- // In the format above, the `format` adds `15` to the digits when formatting a number.
2357
- // A sidenote: this format actually is suitable because `national_prefix_for_parsing`
2358
- // has previously removed `15` from a national number, so re-adding `15` in `format`
2359
- // doesn't actually result in any extra digits added to user's input.
2360
- // But verifying that would be a complex procedure, so the code chooses a simpler path:
2361
- // it simply filters out all `format`s that contain anything but "captured group" ids.
2362
- //
2363
- // This regular expression is called `ELIGIBLE_FORMAT_PATTERN` in Google's
2364
- // `libphonenumber` code.
2365
- //
2366
-
2367
-
2368
- var NON_ALTERING_FORMAT_REG_EXP = new RegExp('^' + '[' + VALID_PUNCTUATION + ']*' + '(\\$\\d[' + VALID_PUNCTUATION + ']*)+' + '$'); // This is the minimum length of the leading digits of a phone number
2369
- // to guarantee the first "leading digits pattern" for a phone number format
2370
- // to be preemptive.
2371
-
2372
- var MIN_LEADING_DIGITS_LENGTH = 3;
2373
-
2374
- var AsYouTypeFormatter =
2375
- /*#__PURE__*/
2376
- function () {
2377
- function AsYouTypeFormatter(_ref) {
2378
- var _this = this;
2379
-
2380
- var metadata = _ref.metadata;
2381
-
2382
- _classCallCheck$3(this, AsYouTypeFormatter);
2383
-
2384
- _defineProperty$3(this, "getSeparatorAfterNationalPrefix", function (format) {
2385
- // `US` metadata doesn't have a `national_prefix_formatting_rule`,
2386
- // so the `if` condition below doesn't apply to `US`,
2387
- // but in reality there shoudl be a separator
2388
- // between a national prefix and a national (significant) number.
2389
- // So `US` national prefix separator is a "special" "hardcoded" case.
2390
- if (_this.isNANP) {
2391
- return ' ';
2392
- } // If a `format` has a `national_prefix_formatting_rule`
2393
- // and that rule has a separator after a national prefix,
2394
- // then it means that there should be a separator
2395
- // between a national prefix and a national (significant) number.
2396
-
2397
-
2398
- if (format && format.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format.nationalPrefixFormattingRule())) {
2399
- return ' ';
2400
- } // At this point, there seems to be no clear evidence that
2401
- // there should be a separator between a national prefix
2402
- // and a national (significant) number. So don't insert one.
2403
-
2404
-
2405
- return '';
2406
- });
2407
-
2408
- _defineProperty$3(this, "shouldTryNationalPrefixFormattingRule", function (format, _ref2) {
2409
- var international = _ref2.international,
2410
- nationalPrefix = _ref2.nationalPrefix;
2411
-
2412
- if (format.nationalPrefixFormattingRule()) {
2413
- // In some countries, `national_prefix_formatting_rule` is `($1)`,
2414
- // so it applies even if the user hasn't input a national prefix.
2415
- // `format.usesNationalPrefix()` detects such cases.
2416
- var usesNationalPrefix = format.usesNationalPrefix();
2417
-
2418
- if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {
2419
- return true;
2420
- }
2421
- }
2422
- });
2423
-
2424
- this.metadata = metadata;
2425
- this.resetFormat();
2426
- }
2427
-
2428
- _createClass$3(AsYouTypeFormatter, [{
2429
- key: "resetFormat",
2430
- value: function resetFormat() {
2431
- this.chosenFormat = undefined;
2432
- this.template = undefined;
2433
- this.nationalNumberTemplate = undefined;
2434
- this.populatedNationalNumberTemplate = undefined;
2435
- this.populatedNationalNumberTemplatePosition = -1;
2436
- }
2437
- }, {
2438
- key: "reset",
2439
- value: function reset(numberingPlan, state) {
2440
- this.resetFormat();
2441
-
2442
- if (numberingPlan) {
2443
- this.isNANP = numberingPlan.callingCode() === '1';
2444
- this.matchingFormats = numberingPlan.formats();
2445
-
2446
- if (state.nationalSignificantNumber) {
2447
- this.narrowDownMatchingFormats(state);
2448
- }
2449
- } else {
2450
- this.isNANP = undefined;
2451
- this.matchingFormats = [];
2452
- }
2453
- }
2454
- }, {
2455
- key: "format",
2456
- value: function format(nextDigits, state) {
2457
- var _this2 = this;
2458
-
2459
- // See if the phone number digits can be formatted as a complete phone number.
2460
- // If not, use the results from `formatNationalNumberWithNextDigits()`,
2461
- // which formats based on the chosen formatting pattern.
2462
- //
2463
- // Attempting to format complete phone number first is how it's done
2464
- // in Google's `libphonenumber`, so this library just follows it.
2465
- // Google's `libphonenumber` code doesn't explain in detail why does it
2466
- // attempt to format digits as a complete phone number
2467
- // instead of just going with a previoulsy (or newly) chosen `format`:
2468
- //
2469
- // "Checks to see if there is an exact pattern match for these digits.
2470
- // If so, we should use this instead of any other formatting template
2471
- // whose leadingDigitsPattern also matches the input."
2472
- //
2473
- if (canFormatCompleteNumber(state.nationalSignificantNumber, this.metadata)) {
2474
- for (var _iterator = this.matchingFormats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
2475
- var _ref3;
2476
-
2477
- if (_isArray) {
2478
- if (_i >= _iterator.length) break;
2479
- _ref3 = _iterator[_i++];
2480
- } else {
2481
- _i = _iterator.next();
2482
- if (_i.done) break;
2483
- _ref3 = _i.value;
2484
- }
2485
-
2486
- var format = _ref3;
2487
- var formattedCompleteNumber = formatCompleteNumber(state, format, {
2488
- metadata: this.metadata,
2489
- shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format) {
2490
- return _this2.shouldTryNationalPrefixFormattingRule(format, {
2491
- international: state.international,
2492
- nationalPrefix: state.nationalPrefix
2493
- });
2494
- },
2495
- getSeparatorAfterNationalPrefix: this.getSeparatorAfterNationalPrefix
2496
- });
2497
-
2498
- if (formattedCompleteNumber) {
2499
- this.resetFormat();
2500
- this.chosenFormat = format;
2501
- this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\d/g, DIGIT_PLACEHOLDER), state);
2502
- this.populatedNationalNumberTemplate = formattedCompleteNumber; // With a new formatting template, the matched position
2503
- // using the old template needs to be reset.
2504
-
2505
- this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(DIGIT_PLACEHOLDER);
2506
- return formattedCompleteNumber;
2507
- }
2508
- }
2509
- } // Format the digits as a partial (incomplete) phone number
2510
- // using the previously chosen formatting pattern (or a newly chosen one).
2511
-
2512
-
2513
- return this.formatNationalNumberWithNextDigits(nextDigits, state);
2514
- } // Formats the next phone number digits.
2515
-
2516
- }, {
2517
- key: "formatNationalNumberWithNextDigits",
2518
- value: function formatNationalNumberWithNextDigits(nextDigits, state) {
2519
- var previouslyChosenFormat = this.chosenFormat; // Choose a format from the list of matching ones.
2520
-
2521
- var newlyChosenFormat = this.chooseFormat(state);
2522
-
2523
- if (newlyChosenFormat) {
2524
- if (newlyChosenFormat === previouslyChosenFormat) {
2525
- // If it can format the next (current) digits
2526
- // using the previously chosen phone number format
2527
- // then return the updated formatted number.
2528
- return this.formatNextNationalNumberDigits(nextDigits);
2529
- } else {
2530
- // If a more appropriate phone number format
2531
- // has been chosen for these "leading digits",
2532
- // then re-format the national phone number part
2533
- // using the newly selected format.
2534
- return this.formatNextNationalNumberDigits(state.getNationalDigits());
2535
- }
2536
- }
2537
- }
2538
- }, {
2539
- key: "narrowDownMatchingFormats",
2540
- value: function narrowDownMatchingFormats(_ref4) {
2541
- var _this3 = this;
2542
-
2543
- var nationalSignificantNumber = _ref4.nationalSignificantNumber,
2544
- nationalPrefix = _ref4.nationalPrefix,
2545
- international = _ref4.international;
2546
- var leadingDigits = nationalSignificantNumber; // "leading digits" pattern list starts with a
2547
- // "leading digits" pattern fitting a maximum of 3 leading digits.
2548
- // So, after a user inputs 3 digits of a national (significant) phone number
2549
- // this national (significant) number can already be formatted.
2550
- // The next "leading digits" pattern is for 4 leading digits max,
2551
- // and the "leading digits" pattern after it is for 5 leading digits max, etc.
2552
- // This implementation is different from Google's
2553
- // in that it searches for a fitting format
2554
- // even if the user has entered less than
2555
- // `MIN_LEADING_DIGITS_LENGTH` digits of a national number.
2556
- // Because some leading digit patterns already match for a single first digit.
2557
-
2558
- var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;
2559
-
2560
- if (leadingDigitsPatternIndex < 0) {
2561
- leadingDigitsPatternIndex = 0;
2562
- }
2563
-
2564
- this.matchingFormats = this.matchingFormats.filter(function (format) {
2565
- return _this3.formatSuits(format, international, nationalPrefix) && _this3.formatMatches(format, leadingDigits, leadingDigitsPatternIndex);
2566
- }); // If there was a phone number format chosen
2567
- // and it no longer holds given the new leading digits then reset it.
2568
- // The test for this `if` condition is marked as:
2569
- // "Reset a chosen format when it no longer holds given the new leading digits".
2570
- // To construct a valid test case for this one can find a country
2571
- // in `PhoneNumberMetadata.xml` yielding one format for 3 `<leadingDigits>`
2572
- // and yielding another format for 4 `<leadingDigits>` (Australia in this case).
2573
-
2574
- if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) {
2575
- this.resetFormat();
2576
- }
2577
- }
2578
- }, {
2579
- key: "formatSuits",
2580
- value: function formatSuits(format, international, nationalPrefix) {
2581
- // When a prefix before a national (significant) number is
2582
- // simply a national prefix, then it's parsed as `this.nationalPrefix`.
2583
- // In more complex cases, a prefix before national (significant) number
2584
- // could include a national prefix as well as some "capturing groups",
2585
- // and in that case there's no info whether a national prefix has been parsed.
2586
- // If national prefix is not used when formatting a phone number
2587
- // using this format, but a national prefix has been entered by the user,
2588
- // and was extracted, then discard such phone number format.
2589
- // In Google's "AsYouType" formatter code, the equivalent would be this part:
2590
- // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L175-L184
2591
- if (nationalPrefix && !format.usesNationalPrefix() && // !format.domesticCarrierCodeFormattingRule() &&
2592
- !format.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {
2593
- return false;
2594
- } // If national prefix is mandatory for this phone number format
2595
- // and there're no guarantees that a national prefix is present in user input
2596
- // then discard this phone number format as not suitable.
2597
- // In Google's "AsYouType" formatter code, the equivalent would be this part:
2598
- // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L185-L193
2599
-
2600
-
2601
- if (!international && !nationalPrefix && format.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {
2602
- return false;
2603
- }
2604
-
2605
- return true;
2606
- }
2607
- }, {
2608
- key: "formatMatches",
2609
- value: function formatMatches(format, leadingDigits, leadingDigitsPatternIndex) {
2610
- var leadingDigitsPatternsCount = format.leadingDigitsPatterns().length; // If this format is not restricted to a certain
2611
- // leading digits pattern then it fits.
2612
-
2613
- if (leadingDigitsPatternsCount === 0) {
2614
- return true;
2615
- } // Start excluding any non-matching formats only when the
2616
- // national number entered so far is at least 3 digits long,
2617
- // otherwise format matching would give false negatives.
2618
- // For example, when the digits entered so far are `2`
2619
- // and the leading digits pattern is `21` –
2620
- // it's quite obvious in this case that the format could be the one
2621
- // but due to the absence of further digits it would give false negative.
2622
-
2623
-
2624
- if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {
2625
- return true;
2626
- } // If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are available
2627
- // then format matching starts narrowing down the list of possible formats
2628
- // (only previously matched formats are considered for next digits).
2629
-
2630
-
2631
- leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);
2632
- var leadingDigitsPattern = format.leadingDigitsPatterns()[leadingDigitsPatternIndex]; // Brackets are required for `^` to be applied to
2633
- // all or-ed (`|`) parts, not just the first one.
2634
-
2635
- return new RegExp("^(".concat(leadingDigitsPattern, ")")).test(leadingDigits);
2636
- }
2637
- }, {
2638
- key: "getFormatFormat",
2639
- value: function getFormatFormat(format, international) {
2640
- return international ? format.internationalFormat() : format.format();
2641
- }
2642
- }, {
2643
- key: "chooseFormat",
2644
- value: function chooseFormat(state) {
2645
- var _this4 = this;
2646
-
2647
- var _loop2 = function _loop2() {
2648
- if (_isArray2) {
2649
- if (_i2 >= _iterator2.length) return "break";
2650
- _ref5 = _iterator2[_i2++];
2651
- } else {
2652
- _i2 = _iterator2.next();
2653
- if (_i2.done) return "break";
2654
- _ref5 = _i2.value;
2655
- }
2656
-
2657
- var format = _ref5;
2658
-
2659
- // If this format is currently being used
2660
- // and is still suitable, then stick to it.
2661
- if (_this4.chosenFormat === format) {
2662
- return "break";
2663
- } // Sometimes, a formatting rule inserts additional digits in a phone number,
2664
- // and "as you type" formatter can't do that: it should only use the digits
2665
- // that the user has input.
2666
- //
2667
- // For example, in Argentina, there's a format for mobile phone numbers:
2668
- //
2669
- // {
2670
- // "pattern": "(\\d)(\\d{2})(\\d{4})(\\d{4})",
2671
- // "leading_digits_patterns": ["91"],
2672
- // "national_prefix_formatting_rule": "0$1",
2673
- // "format": "$2 15-$3-$4",
2674
- // "international_format": "$1 $2 $3-$4"
2675
- // }
2676
- //
2677
- // In that format, `international_format` is used instead of `format`
2678
- // because `format` inserts `15` in the formatted number,
2679
- // and `AsYouType` formatter should only use the digits
2680
- // the user has actually input, without adding any extra digits.
2681
- // In this case, it wouldn't make a difference, because the `15`
2682
- // is first stripped when applying `national_prefix_for_parsing`
2683
- // and then re-added when using `format`, so in reality it doesn't
2684
- // add any new digits to the number, but to detect that, the code
2685
- // would have to be more complex: it would have to try formatting
2686
- // the digits using the format and then see if any digits have
2687
- // actually been added or removed, and then, every time a new digit
2688
- // is input, it should re-check whether the chosen format doesn't
2689
- // alter the digits.
2690
- //
2691
- // Google's code doesn't go that far, and so does this library:
2692
- // it simply requires that a `format` doesn't add any additonal
2693
- // digits to user's input.
2694
- //
2695
- // Also, people in general should move from inputting phone numbers
2696
- // in national format (possibly with national prefixes)
2697
- // and use international phone number format instead:
2698
- // it's a logical thing in the modern age of mobile phones,
2699
- // globalization and the internet.
2700
- //
2701
-
2702
- /* istanbul ignore if */
2703
-
2704
-
2705
- if (!NON_ALTERING_FORMAT_REG_EXP.test(_this4.getFormatFormat(format, state.international))) {
2706
- return "continue";
2707
- }
2708
-
2709
- if (!_this4.createTemplateForFormat(format, state)) {
2710
- // Remove the format if it can't generate a template.
2711
- _this4.matchingFormats = _this4.matchingFormats.filter(function (_) {
2712
- return _ !== format;
2713
- });
2714
- return "continue";
2715
- }
2716
-
2717
- _this4.chosenFormat = format;
2718
- return "break";
2719
- };
2720
-
2721
- // When there are multiple available formats, the formatter uses the first
2722
- // format where a formatting template could be created.
2723
- _loop: for (var _iterator2 = this.matchingFormats.slice(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
2724
- var _ref5;
2725
-
2726
- var _ret = _loop2();
2727
-
2728
- switch (_ret) {
2729
- case "break":
2730
- break _loop;
2731
-
2732
- case "continue":
2733
- continue;
2734
- }
2735
- }
2736
-
2737
- if (!this.chosenFormat) {
2738
- // No format matches the national (significant) phone number.
2739
- this.resetFormat();
2740
- }
2741
-
2742
- return this.chosenFormat;
2743
- }
2744
- }, {
2745
- key: "createTemplateForFormat",
2746
- value: function createTemplateForFormat(format, state) {
2747
- // The formatter doesn't format numbers when numberPattern contains '|', e.g.
2748
- // (20|3)\d{4}. In those cases we quickly return.
2749
- // (Though there's no such format in current metadata)
2750
-
2751
- /* istanbul ignore if */
2752
- if ( format.pattern().indexOf('|') >= 0) {
2753
- return;
2754
- } // Get formatting template for this phone number format
2755
-
2756
-
2757
- var template = this.getTemplateForFormat(format, state); // If the national number entered is too long
2758
- // for any phone number format, then abort.
2759
-
2760
- if (template) {
2761
- this.setNationalNumberTemplate(template, state);
2762
- return true;
2763
- }
2764
- }
2765
- }, {
2766
- key: "getInternationalPrefixBeforeCountryCallingCode",
2767
- value: function getInternationalPrefixBeforeCountryCallingCode(_ref6, options) {
2768
- var IDDPrefix = _ref6.IDDPrefix,
2769
- missingPlus = _ref6.missingPlus;
2770
-
2771
- if (IDDPrefix) {
2772
- return options && options.spacing === false ? IDDPrefix : IDDPrefix + ' ';
2773
- }
2774
-
2775
- if (missingPlus) {
2776
- return '';
2777
- }
2778
-
2779
- return '+';
2780
- }
2781
- }, {
2782
- key: "getTemplate",
2783
- value: function getTemplate(state) {
2784
- if (!this.template) {
2785
- return;
2786
- } // `this.template` holds the template for a "complete" phone number.
2787
- // The currently entered phone number is most likely not "complete",
2788
- // so trim all non-populated digits.
2789
-
2790
-
2791
- var index = -1;
2792
- var i = 0;
2793
- var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {
2794
- spacing: false
2795
- }) : '';
2796
-
2797
- while (i < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {
2798
- index = this.template.indexOf(DIGIT_PLACEHOLDER, index + 1);
2799
- i++;
2800
- }
2801
-
2802
- return cutAndStripNonPairedParens(this.template, index + 1);
2803
- }
2804
- }, {
2805
- key: "setNationalNumberTemplate",
2806
- value: function setNationalNumberTemplate(template, state) {
2807
- this.nationalNumberTemplate = template;
2808
- this.populatedNationalNumberTemplate = template; // With a new formatting template, the matched position
2809
- // using the old template needs to be reset.
2810
-
2811
- this.populatedNationalNumberTemplatePosition = -1; // For convenience, the public `.template` property
2812
- // contains the whole international number
2813
- // if the phone number being input is international:
2814
- // 'x' for the '+' sign, 'x'es for the country phone code,
2815
- // a spacebar and then the template for the formatted national number.
2816
-
2817
- if (state.international) {
2818
- this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\d\+]/g, DIGIT_PLACEHOLDER) + repeat(DIGIT_PLACEHOLDER, state.callingCode.length) + ' ' + template;
2819
- } else {
2820
- this.template = template;
2821
- }
2822
- }
2823
- /**
2824
- * Generates formatting template for a national phone number,
2825
- * optionally containing a national prefix, for a format.
2826
- * @param {Format} format
2827
- * @param {string} nationalPrefix
2828
- * @return {string}
2829
- */
2830
-
2831
- }, {
2832
- key: "getTemplateForFormat",
2833
- value: function getTemplateForFormat(format, _ref7) {
2834
- var nationalSignificantNumber = _ref7.nationalSignificantNumber,
2835
- international = _ref7.international,
2836
- nationalPrefix = _ref7.nationalPrefix,
2837
- complexPrefixBeforeNationalSignificantNumber = _ref7.complexPrefixBeforeNationalSignificantNumber;
2838
- var pattern = format.pattern();
2839
- /* istanbul ignore else */
2840
-
2841
- {
2842
- pattern = pattern // Replace anything in the form of [..] with \d
2843
- .replace(CREATE_CHARACTER_CLASS_PATTERN(), '\\d') // Replace any standalone digit (not the one in `{}`) with \d
2844
- .replace(CREATE_STANDALONE_DIGIT_PATTERN(), '\\d');
2845
- } // Generate a dummy national number (consisting of `9`s)
2846
- // that fits this format's `pattern`.
2847
- //
2848
- // This match will always succeed,
2849
- // because the "longest dummy phone number"
2850
- // has enough length to accomodate any possible
2851
- // national phone number format pattern.
2852
- //
2853
-
2854
-
2855
- var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0]; // If the national number entered is too long
2856
- // for any phone number format, then abort.
2857
-
2858
- if (nationalSignificantNumber.length > digits.length) {
2859
- return;
2860
- } // Get a formatting template which can be used to efficiently format
2861
- // a partial number where digits are added one by one.
2862
- // Below `strictPattern` is used for the
2863
- // regular expression (with `^` and `$`).
2864
- // This wasn't originally in Google's `libphonenumber`
2865
- // and I guess they don't really need it
2866
- // because they're not using "templates" to format phone numbers
2867
- // but I added `strictPattern` after encountering
2868
- // South Korean phone number formatting bug.
2869
- //
2870
- // Non-strict regular expression bug demonstration:
2871
- //
2872
- // this.nationalSignificantNumber : `111111111` (9 digits)
2873
- //
2874
- // pattern : (\d{2})(\d{3,4})(\d{4})
2875
- // format : `$1 $2 $3`
2876
- // digits : `9999999999` (10 digits)
2877
- //
2878
- // '9999999999'.replace(new RegExp(/(\d{2})(\d{3,4})(\d{4})/g), '$1 $2 $3') = "99 9999 9999"
2879
- //
2880
- // template : xx xxxx xxxx
2881
- //
2882
- // But the correct template in this case is `xx xxx xxxx`.
2883
- // The template was generated incorrectly because of the
2884
- // `{3,4}` variability in the `pattern`.
2885
- //
2886
- // The fix is, if `this.nationalSignificantNumber` has already sufficient length
2887
- // to satisfy the `pattern` completely then `this.nationalSignificantNumber`
2888
- // is used instead of `digits`.
2889
-
2890
-
2891
- var strictPattern = new RegExp('^' + pattern + '$');
2892
- var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\d/g, DUMMY_DIGIT); // If `this.nationalSignificantNumber` has already sufficient length
2893
- // to satisfy the `pattern` completely then use it
2894
- // instead of `digits`.
2895
-
2896
- if (strictPattern.test(nationalNumberDummyDigits)) {
2897
- digits = nationalNumberDummyDigits;
2898
- }
2899
-
2900
- var numberFormat = this.getFormatFormat(format, international);
2901
- var nationalPrefixIncludedInTemplate; // If a user did input a national prefix (and that's guaranteed),
2902
- // and if a `format` does have a national prefix formatting rule,
2903
- // then see if that national prefix formatting rule
2904
- // prepends exactly the same national prefix the user has input.
2905
- // If that's the case, then use the `format` with the national prefix formatting rule.
2906
- // Otherwise, use the `format` without the national prefix formatting rule,
2907
- // and prepend a national prefix manually to it.
2908
-
2909
- if (this.shouldTryNationalPrefixFormattingRule(format, {
2910
- international: international,
2911
- nationalPrefix: nationalPrefix
2912
- })) {
2913
- var numberFormatWithNationalPrefix = numberFormat.replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()); // If `national_prefix_formatting_rule` of a `format` simply prepends
2914
- // national prefix at the start of a national (significant) number,
2915
- // then such formatting can be used with `AsYouType` formatter.
2916
- // There seems to be no `else` case: everywhere in metadata,
2917
- // national prefix formatting rule is national prefix + $1,
2918
- // or `($1)`, in which case such format isn't even considered
2919
- // when the user has input a national prefix.
2920
-
2921
- /* istanbul ignore else */
2922
-
2923
- if (parseDigits(format.nationalPrefixFormattingRule()) === (nationalPrefix || '') + parseDigits('$1')) {
2924
- numberFormat = numberFormatWithNationalPrefix;
2925
- nationalPrefixIncludedInTemplate = true; // Replace all digits of the national prefix in the formatting template
2926
- // with `DIGIT_PLACEHOLDER`s.
2927
-
2928
- if (nationalPrefix) {
2929
- var i = nationalPrefix.length;
2930
-
2931
- while (i > 0) {
2932
- numberFormat = numberFormat.replace(/\d/, DIGIT_PLACEHOLDER);
2933
- i--;
2934
- }
2935
- }
2936
- }
2937
- } // Generate formatting template for this phone number format.
2938
-
2939
-
2940
- var template = digits // Format the dummy phone number according to the format.
2941
- .replace(new RegExp(pattern), numberFormat) // Replace each dummy digit with a DIGIT_PLACEHOLDER.
2942
- .replace(new RegExp(DUMMY_DIGIT, 'g'), DIGIT_PLACEHOLDER); // If a prefix of a national (significant) number is not as simple
2943
- // as just a basic national prefix, then just prepend such prefix
2944
- // before the national (significant) number, optionally spacing
2945
- // the two with a whitespace.
2946
-
2947
- if (!nationalPrefixIncludedInTemplate) {
2948
- if (complexPrefixBeforeNationalSignificantNumber) {
2949
- // Prepend the prefix to the template manually.
2950
- template = repeat(DIGIT_PLACEHOLDER, complexPrefixBeforeNationalSignificantNumber.length) + ' ' + template;
2951
- } else if (nationalPrefix) {
2952
- // Prepend national prefix to the template manually.
2953
- template = repeat(DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format) + template;
2954
- }
2955
- }
2956
-
2957
- if (international) {
2958
- template = applyInternationalSeparatorStyle(template);
2959
- }
2960
-
2961
- return template;
2962
- }
2963
- }, {
2964
- key: "formatNextNationalNumberDigits",
2965
- value: function formatNextNationalNumberDigits(digits) {
2966
- var result = populateTemplateWithDigits(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits);
2967
-
2968
- if (!result) {
2969
- // Reset the format.
2970
- this.resetFormat();
2971
- return;
2972
- }
2973
-
2974
- this.populatedNationalNumberTemplate = result[0];
2975
- this.populatedNationalNumberTemplatePosition = result[1]; // Return the formatted phone number so far.
2976
-
2977
- return cutAndStripNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1); // The old way which was good for `input-format` but is not so good
2978
- // for `react-phone-number-input`'s default input (`InputBasic`).
2979
- // return closeNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1)
2980
- // .replace(new RegExp(DIGIT_PLACEHOLDER, 'g'), ' ')
2981
- }
2982
- }]);
2983
-
2984
- return AsYouTypeFormatter;
2985
- }();
2986
-
2987
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
2988
-
2989
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
2990
-
2991
- function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2992
-
2993
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2994
-
2995
- function _classCallCheck$4(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2996
-
2997
- function _defineProperties$4(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2998
-
2999
- function _createClass$4(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$4(Constructor.prototype, protoProps); if (staticProps) _defineProperties$4(Constructor, staticProps); return Constructor; }
3000
- var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = '[' + VALID_PUNCTUATION + VALID_DIGITS + ']+';
3001
- var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp('^' + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + '$', 'i');
3002
- var VALID_FORMATTED_PHONE_NUMBER_PART = '(?:' + '[' + PLUS_CHARS + ']' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*' + '|' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']+' + ')';
3003
- var AFTER_PHONE_NUMBER_DIGITS_END_PATTERN = new RegExp('[^' + VALID_PUNCTUATION + VALID_DIGITS + ']+' + '.*' + '$'); // Tests whether `national_prefix_for_parsing` could match
3004
- // different national prefixes.
3005
- // Matches anything that's not a digit or a square bracket.
3006
-
3007
- var COMPLEX_NATIONAL_PREFIX = /[^\d\[\]]/;
3008
-
3009
- var AsYouTypeParser =
3010
- /*#__PURE__*/
3011
- function () {
3012
- function AsYouTypeParser(_ref) {
3013
- var defaultCountry = _ref.defaultCountry,
3014
- defaultCallingCode = _ref.defaultCallingCode,
3015
- metadata = _ref.metadata,
3016
- onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange;
3017
-
3018
- _classCallCheck$4(this, AsYouTypeParser);
3019
-
3020
- this.defaultCountry = defaultCountry;
3021
- this.defaultCallingCode = defaultCallingCode;
3022
- this.metadata = metadata;
3023
- this.onNationalSignificantNumberChange = onNationalSignificantNumberChange;
3024
- }
3025
-
3026
- _createClass$4(AsYouTypeParser, [{
3027
- key: "input",
3028
- value: function input(text, state) {
3029
- var _extractFormattedDigi = extractFormattedDigitsAndPlus(text),
3030
- _extractFormattedDigi2 = _slicedToArray(_extractFormattedDigi, 2),
3031
- formattedDigits = _extractFormattedDigi2[0],
3032
- hasPlus = _extractFormattedDigi2[1];
3033
-
3034
- var digits = parseDigits(formattedDigits); // Checks for a special case: just a leading `+` has been entered.
3035
-
3036
- var justLeadingPlus;
3037
-
3038
- if (hasPlus) {
3039
- if (!state.digits) {
3040
- state.startInternationalNumber();
3041
-
3042
- if (!digits) {
3043
- justLeadingPlus = true;
3044
- }
3045
- }
3046
- }
3047
-
3048
- if (digits) {
3049
- this.inputDigits(digits, state);
3050
- }
3051
-
3052
- return {
3053
- digits: digits,
3054
- justLeadingPlus: justLeadingPlus
3055
- };
3056
- }
3057
- /**
3058
- * Inputs "next" phone number digits.
3059
- * @param {string} digits
3060
- * @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means "don't format the national phone number at this stage".
3061
- */
3062
-
3063
- }, {
3064
- key: "inputDigits",
3065
- value: function inputDigits(nextDigits, state) {
3066
- var digits = state.digits;
3067
- var hasReceivedThreeLeadingDigits = digits.length < 3 && digits.length + nextDigits.length >= 3; // Append phone number digits.
3068
-
3069
- state.appendDigits(nextDigits); // Attempt to extract IDD prefix:
3070
- // Some users input their phone number in international format,
3071
- // but in an "out-of-country" dialing format instead of using the leading `+`.
3072
- // https://github.com/catamphetamine/libphonenumber-js/issues/185
3073
- // Detect such numbers as soon as there're at least 3 digits.
3074
- // Google's library attempts to extract IDD prefix at 3 digits,
3075
- // so this library just copies that behavior.
3076
- // I guess that's because the most commot IDD prefixes are
3077
- // `00` (Europe) and `011` (US).
3078
- // There exist really long IDD prefixes too:
3079
- // for example, in Australia the default IDD prefix is `0011`,
3080
- // and it could even be as long as `14880011`.
3081
- // An IDD prefix is extracted here, and then every time when
3082
- // there's a new digit and the number couldn't be formatted.
3083
-
3084
- if (hasReceivedThreeLeadingDigits) {
3085
- this.extractIddPrefix(state);
3086
- }
3087
-
3088
- if (this.isWaitingForCountryCallingCode(state)) {
3089
- if (!this.extractCountryCallingCode(state)) {
3090
- return;
3091
- }
3092
- } else {
3093
- state.appendNationalSignificantNumberDigits(nextDigits);
3094
- } // If a phone number is being input in international format,
3095
- // then it's not valid for it to have a national prefix.
3096
- // Still, some people incorrectly input such numbers with a national prefix.
3097
- // In such cases, only attempt to strip a national prefix if the number becomes too long.
3098
- // (but that is done later, not here)
3099
-
3100
-
3101
- if (!state.international) {
3102
- if (!this.hasExtractedNationalSignificantNumber) {
3103
- this.extractNationalSignificantNumber(state.getNationalDigits(), state.update);
3104
- }
3105
- }
3106
- }
3107
- }, {
3108
- key: "isWaitingForCountryCallingCode",
3109
- value: function isWaitingForCountryCallingCode(_ref2) {
3110
- var international = _ref2.international,
3111
- callingCode = _ref2.callingCode;
3112
- return international && !callingCode;
3113
- } // Extracts a country calling code from a number
3114
- // being entered in internatonal format.
3115
-
3116
- }, {
3117
- key: "extractCountryCallingCode",
3118
- value: function extractCountryCallingCode$1(state) {
3119
- var _extractCountryCallin = extractCountryCallingCode('+' + state.getDigitsWithoutInternationalPrefix(), this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),
3120
- countryCallingCode = _extractCountryCallin.countryCallingCode,
3121
- number = _extractCountryCallin.number;
3122
-
3123
- if (countryCallingCode) {
3124
- state.setCallingCode(countryCallingCode);
3125
- state.update({
3126
- nationalSignificantNumber: number
3127
- });
3128
- return true;
3129
- }
3130
- }
3131
- }, {
3132
- key: "reset",
3133
- value: function reset(numberingPlan) {
3134
- if (numberingPlan) {
3135
- this.hasSelectedNumberingPlan = true;
3136
-
3137
- var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing();
3138
-
3139
- this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing);
3140
- } else {
3141
- this.hasSelectedNumberingPlan = undefined;
3142
- this.couldPossiblyExtractAnotherNationalSignificantNumber = undefined;
3143
- }
3144
- }
3145
- /**
3146
- * Extracts a national (significant) number from user input.
3147
- * Google's library is different in that it only applies `national_prefix_for_parsing`
3148
- * and doesn't apply `national_prefix_transform_rule` after that.
3149
- * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539
3150
- * @return {boolean} [extracted]
3151
- */
3152
-
3153
- }, {
3154
- key: "extractNationalSignificantNumber",
3155
- value: function extractNationalSignificantNumber(nationalDigits, setState) {
3156
- if (!this.hasSelectedNumberingPlan) {
3157
- return;
3158
- }
3159
-
3160
- var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),
3161
- nationalPrefix = _extractNationalNumbe.nationalPrefix,
3162
- nationalNumber = _extractNationalNumbe.nationalNumber,
3163
- carrierCode = _extractNationalNumbe.carrierCode;
3164
-
3165
- if (nationalNumber === nationalDigits) {
3166
- return;
3167
- }
3168
-
3169
- this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);
3170
- return true;
3171
- }
3172
- /**
3173
- * In Google's code this function is called "attempt to extract longer NDD".
3174
- * "Some national prefixes are a substring of others", they say.
3175
- * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.
3176
- */
3177
-
3178
- }, {
3179
- key: "extractAnotherNationalSignificantNumber",
3180
- value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) {
3181
- if (!this.hasExtractedNationalSignificantNumber) {
3182
- return this.extractNationalSignificantNumber(nationalDigits, setState);
3183
- }
3184
-
3185
- if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) {
3186
- return;
3187
- }
3188
-
3189
- var _extractNationalNumbe2 = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),
3190
- nationalPrefix = _extractNationalNumbe2.nationalPrefix,
3191
- nationalNumber = _extractNationalNumbe2.nationalNumber,
3192
- carrierCode = _extractNationalNumbe2.carrierCode; // If a national prefix has been extracted previously,
3193
- // then it's always extracted as additional digits are added.
3194
- // That's assuming `extractNationalNumberFromPossiblyIncompleteNumber()`
3195
- // doesn't do anything different from what it currently does.
3196
- // So, just in case, here's this check, though it doesn't occur.
3197
-
3198
- /* istanbul ignore if */
3199
-
3200
-
3201
- if (nationalNumber === prevNationalSignificantNumber) {
3202
- return;
3203
- }
3204
-
3205
- this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);
3206
- return true;
3207
- }
3208
- }, {
3209
- key: "onExtractedNationalNumber",
3210
- value: function onExtractedNationalNumber(nationalPrefix, carrierCode, nationalSignificantNumber, nationalDigits, setState) {
3211
- var complexPrefixBeforeNationalSignificantNumber;
3212
- var nationalSignificantNumberMatchesInput; // This check also works with empty `this.nationalSignificantNumber`.
3213
-
3214
- var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber); // If the extracted national (significant) number is the
3215
- // last substring of the `digits`, then it means that it hasn't been altered:
3216
- // no digits have been removed from the national (significant) number
3217
- // while applying `national_prefix_transform_rule`.
3218
- // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule
3219
-
3220
- if (nationalSignificantNumberIndex >= 0 && nationalSignificantNumberIndex === nationalDigits.length - nationalSignificantNumber.length) {
3221
- nationalSignificantNumberMatchesInput = true; // If a prefix of a national (significant) number is not as simple
3222
- // as just a basic national prefix, then such prefix is stored in
3223
- // `this.complexPrefixBeforeNationalSignificantNumber` property and will be
3224
- // prepended "as is" to the national (significant) number to produce
3225
- // a formatted result.
3226
-
3227
- var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex); // `prefixBeforeNationalNumber` is always non-empty,
3228
- // because `onExtractedNationalNumber()` isn't called
3229
- // when a national (significant) number hasn't been actually "extracted":
3230
- // when a national (significant) number is equal to the national part of `digits`,
3231
- // then `onExtractedNationalNumber()` doesn't get called.
3232
-
3233
- if (prefixBeforeNationalNumber !== nationalPrefix) {
3234
- complexPrefixBeforeNationalSignificantNumber = prefixBeforeNationalNumber;
3235
- }
3236
- }
3237
-
3238
- setState({
3239
- nationalPrefix: nationalPrefix,
3240
- carrierCode: carrierCode,
3241
- nationalSignificantNumber: nationalSignificantNumber,
3242
- nationalSignificantNumberMatchesInput: nationalSignificantNumberMatchesInput,
3243
- complexPrefixBeforeNationalSignificantNumber: complexPrefixBeforeNationalSignificantNumber
3244
- }); // `onExtractedNationalNumber()` is only called when
3245
- // the national (significant) number actually did change.
3246
-
3247
- this.hasExtractedNationalSignificantNumber = true;
3248
- this.onNationalSignificantNumberChange();
3249
- }
3250
- }, {
3251
- key: "reExtractNationalSignificantNumber",
3252
- value: function reExtractNationalSignificantNumber(state) {
3253
- // Attempt to extract a national prefix.
3254
- //
3255
- // Some people incorrectly input national prefix
3256
- // in an international phone number.
3257
- // For example, some people write British phone numbers as `+44(0)...`.
3258
- //
3259
- // Also, in some rare cases, it is valid for a national prefix
3260
- // to be a part of an international phone number.
3261
- // For example, mobile phone numbers in Mexico are supposed to be
3262
- // dialled internationally using a `1` national prefix,
3263
- // so the national prefix will be part of an international number.
3264
- //
3265
- // Quote from:
3266
- // https://www.mexperience.com/dialing-cell-phones-in-mexico/
3267
- //
3268
- // "Dialing a Mexican cell phone from abroad
3269
- // When you are calling a cell phone number in Mexico from outside Mexico,
3270
- // it’s necessary to dial an additional “1” after Mexico’s country code
3271
- // (which is “52”) and before the area code.
3272
- // You also ignore the 045, and simply dial the area code and the
3273
- // cell phone’s number.
3274
- //
3275
- // If you don’t add the “1”, you’ll receive a recorded announcement
3276
- // asking you to redial using it.
3277
- //
3278
- // For example, if you are calling from the USA to a cell phone
3279
- // in Mexico City, you would dial +52 – 1 – 55 – 1234 5678.
3280
- // (Note that this is different to calling a land line in Mexico City
3281
- // from abroad, where the number dialed would be +52 – 55 – 1234 5678)".
3282
- //
3283
- // Google's demo output:
3284
- // https://libphonenumber.appspot.com/phonenumberparser?number=%2b5215512345678&country=MX
3285
- //
3286
- if (this.extractAnotherNationalSignificantNumber(state.getNationalDigits(), state.nationalSignificantNumber, state.update)) {
3287
- return true;
3288
- } // If no format matches the phone number, then it could be
3289
- // "a really long IDD" (quote from a comment in Google's library).
3290
- // An IDD prefix is first extracted when the user has entered at least 3 digits,
3291
- // and then here — every time when there's a new digit and the number
3292
- // couldn't be formatted.
3293
- // For example, in Australia the default IDD prefix is `0011`,
3294
- // and it could even be as long as `14880011`.
3295
- //
3296
- // Could also check `!hasReceivedThreeLeadingDigits` here
3297
- // to filter out the case when this check duplicates the one
3298
- // already performed when there're 3 leading digits,
3299
- // but it's not a big deal, and in most cases there
3300
- // will be a suitable `format` when there're 3 leading digits.
3301
- //
3302
-
3303
-
3304
- if (this.extractIddPrefix(state)) {
3305
- this.extractCallingCodeAndNationalSignificantNumber(state);
3306
- return true;
3307
- } // Google's AsYouType formatter supports sort of an "autocorrection" feature
3308
- // when it "autocorrects" numbers that have been input for a country
3309
- // with that country's calling code.
3310
- // Such "autocorrection" feature looks weird, but different people have been requesting it:
3311
- // https://github.com/catamphetamine/libphonenumber-js/issues/376
3312
- // https://github.com/catamphetamine/libphonenumber-js/issues/375
3313
- // https://github.com/catamphetamine/libphonenumber-js/issues/316
3314
-
3315
-
3316
- if (this.fixMissingPlus(state)) {
3317
- this.extractCallingCodeAndNationalSignificantNumber(state);
3318
- return true;
3319
- }
3320
- }
3321
- }, {
3322
- key: "extractIddPrefix",
3323
- value: function extractIddPrefix(state) {
3324
- // An IDD prefix can't be present in a number written with a `+`.
3325
- // Also, don't re-extract an IDD prefix if has already been extracted.
3326
- var international = state.international,
3327
- IDDPrefix = state.IDDPrefix,
3328
- digits = state.digits;
3329
-
3330
- if (international || IDDPrefix) {
3331
- return;
3332
- } // Some users input their phone number in "out-of-country"
3333
- // dialing format instead of using the leading `+`.
3334
- // https://github.com/catamphetamine/libphonenumber-js/issues/185
3335
- // Detect such numbers.
3336
-
3337
-
3338
- var numberWithoutIDD = stripIddPrefix(digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);
3339
-
3340
- if (numberWithoutIDD !== undefined && numberWithoutIDD !== digits) {
3341
- // If an IDD prefix was stripped then convert the IDD-prefixed number
3342
- // to international number for subsequent parsing.
3343
- state.update({
3344
- IDDPrefix: digits.slice(0, digits.length - numberWithoutIDD.length)
3345
- });
3346
- this.startInternationalNumber(state);
3347
- return true;
3348
- }
3349
- }
3350
- }, {
3351
- key: "fixMissingPlus",
3352
- value: function fixMissingPlus(state) {
3353
- if (!state.international) {
3354
- var _extractCountryCallin2 = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(state.digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),
3355
- newCallingCode = _extractCountryCallin2.countryCallingCode;
3356
-
3357
- if (newCallingCode) {
3358
- state.update({
3359
- missingPlus: true
3360
- });
3361
- this.startInternationalNumber(state);
3362
- return true;
3363
- }
3364
- }
3365
- }
3366
- }, {
3367
- key: "startInternationalNumber",
3368
- value: function startInternationalNumber(state) {
3369
- state.startInternationalNumber(); // If a national (significant) number has been extracted before, reset it.
3370
-
3371
- if (state.nationalSignificantNumber) {
3372
- state.resetNationalSignificantNumber();
3373
- this.onNationalSignificantNumberChange();
3374
- this.hasExtractedNationalSignificantNumber = undefined;
3375
- }
3376
- }
3377
- }, {
3378
- key: "extractCallingCodeAndNationalSignificantNumber",
3379
- value: function extractCallingCodeAndNationalSignificantNumber(state) {
3380
- if (this.extractCountryCallingCode(state)) {
3381
- // `this.extractCallingCode()` is currently called when the number
3382
- // couldn't be formatted during the standard procedure.
3383
- // Normally, the national prefix would be re-extracted
3384
- // for an international number if such number couldn't be formatted,
3385
- // but since it's already not able to be formatted,
3386
- // there won't be yet another retry, so also extract national prefix here.
3387
- this.extractNationalSignificantNumber(state.getNationalDigits(), state.update);
3388
- }
3389
- }
3390
- }]);
3391
-
3392
- return AsYouTypeParser;
3393
- }();
3394
-
3395
- function extractFormattedPhoneNumber(text) {
3396
- // Attempt to extract a possible number from the string passed in.
3397
- var startsAt = text.search(VALID_FORMATTED_PHONE_NUMBER_PART);
3398
-
3399
- if (startsAt < 0) {
3400
- return;
3401
- } // Trim everything to the left of the phone number.
3402
-
3403
-
3404
- text = text.slice(startsAt); // Trim the `+`.
3405
-
3406
- var hasPlus;
3407
-
3408
- if (text[0] === '+') {
3409
- hasPlus = true;
3410
- text = text.slice('+'.length);
3411
- } // Trim everything to the right of the phone number.
3412
-
3413
-
3414
- text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, ''); // Re-add the previously trimmed `+`.
3415
-
3416
- if (hasPlus) {
3417
- text = '+' + text;
3418
- }
3419
-
3420
- return text;
3421
- }
3422
- /**
3423
- * Extracts formatted phone number digits (and a `+`) from text (if there're any).
3424
- * @param {string} text
3425
- * @return {any[]}
3426
- */
3427
-
3428
-
3429
- function _extractFormattedDigitsAndPlus(text) {
3430
- // Extract a formatted phone number part from text.
3431
- var extractedNumber = extractFormattedPhoneNumber(text) || ''; // Trim a `+`.
3432
-
3433
- if (extractedNumber[0] === '+') {
3434
- return [extractedNumber.slice('+'.length), true];
3435
- }
3436
-
3437
- return [extractedNumber];
3438
- }
3439
- /**
3440
- * Extracts formatted phone number digits (and a `+`) from text (if there're any).
3441
- * @param {string} text
3442
- * @return {any[]}
3443
- */
3444
-
3445
-
3446
- function extractFormattedDigitsAndPlus(text) {
3447
- var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text),
3448
- _extractFormattedDigi4 = _slicedToArray(_extractFormattedDigi3, 2),
3449
- formattedDigits = _extractFormattedDigi4[0],
3450
- hasPlus = _extractFormattedDigi4[1]; // If the extracted phone number part
3451
- // can possibly be a part of some valid phone number
3452
- // then parse phone number characters from a formatted phone number.
3453
-
3454
-
3455
- if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) {
3456
- formattedDigits = '';
3457
- }
3458
-
3459
- return [formattedDigits, hasPlus];
3460
- }
3461
-
3462
- function _typeof$1(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
3463
-
3464
- function _slicedToArray$1(arr, i) { return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _nonIterableRest$1(); }
3465
-
3466
- function _nonIterableRest$1() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
3467
-
3468
- function _iterableToArrayLimit$1(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
3469
-
3470
- function _arrayWithHoles$1(arr) { if (Array.isArray(arr)) return arr; }
3471
-
3472
- function _classCallCheck$5(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3473
-
3474
- function _defineProperties$5(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3475
-
3476
- function _createClass$5(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$5(Constructor.prototype, protoProps); if (staticProps) _defineProperties$5(Constructor, staticProps); return Constructor; }
3477
-
3478
- var AsYouType =
3479
- /*#__PURE__*/
3480
- function () {
3481
- /**
3482
- * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.
3483
- * @param {Object} metadata
3484
- */
3485
- function AsYouType(optionsOrDefaultCountry, metadata) {
3486
- _classCallCheck$5(this, AsYouType);
3487
-
3488
- this.metadata = new Metadata(metadata);
3489
-
3490
- var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry),
3491
- _this$getCountryAndCa2 = _slicedToArray$1(_this$getCountryAndCa, 2),
3492
- defaultCountry = _this$getCountryAndCa2[0],
3493
- defaultCallingCode = _this$getCountryAndCa2[1];
3494
-
3495
- this.defaultCountry = defaultCountry;
3496
- this.defaultCallingCode = defaultCallingCode;
3497
- this.reset();
3498
- }
3499
-
3500
- _createClass$5(AsYouType, [{
3501
- key: "getCountryAndCallingCode",
3502
- value: function getCountryAndCallingCode(optionsOrDefaultCountry) {
3503
- // Set `defaultCountry` and `defaultCallingCode` options.
3504
- var defaultCountry;
3505
- var defaultCallingCode; // Turns out `null` also has type "object". Weird.
3506
-
3507
- if (optionsOrDefaultCountry) {
3508
- if (_typeof$1(optionsOrDefaultCountry) === 'object') {
3509
- defaultCountry = optionsOrDefaultCountry.defaultCountry;
3510
- defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;
3511
- } else {
3512
- defaultCountry = optionsOrDefaultCountry;
3513
- }
3514
- }
3515
-
3516
- if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {
3517
- defaultCountry = undefined;
3518
- }
3519
-
3520
- return [defaultCountry, defaultCallingCode];
3521
- }
3522
- /**
3523
- * Inputs "next" phone number characters.
3524
- * @param {string} text
3525
- * @return {string} Formatted phone number characters that have been input so far.
3526
- */
3527
-
3528
- }, {
3529
- key: "input",
3530
- value: function input(text) {
3531
- var _this$parser$input = this.parser.input(text, this.state),
3532
- digits = _this$parser$input.digits,
3533
- justLeadingPlus = _this$parser$input.justLeadingPlus;
3534
-
3535
- if (justLeadingPlus) {
3536
- this.formattedOutput = '+';
3537
- } else if (digits) {
3538
- this.determineTheCountryIfNeeded(); // Match the available formats by the currently available leading digits.
3539
-
3540
- if (this.state.nationalSignificantNumber) {
3541
- this.formatter.narrowDownMatchingFormats(this.state);
3542
- }
3543
-
3544
- var formattedNationalNumber;
3545
-
3546
- if (this.metadata.hasSelectedNumberingPlan()) {
3547
- formattedNationalNumber = this.formatter.format(digits, this.state);
3548
- }
3549
-
3550
- if (formattedNationalNumber === undefined) {
3551
- // See if another national (significant) number could be re-extracted.
3552
- if (this.parser.reExtractNationalSignificantNumber(this.state)) {
3553
- this.determineTheCountryIfNeeded(); // If it could, then re-try formatting the new national (significant) number.
3554
-
3555
- var nationalDigits = this.state.getNationalDigits();
3556
-
3557
- if (nationalDigits) {
3558
- formattedNationalNumber = this.formatter.format(nationalDigits, this.state);
3559
- }
3560
- }
3561
- }
3562
-
3563
- this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber();
3564
- }
3565
-
3566
- return this.formattedOutput;
3567
- }
3568
- }, {
3569
- key: "reset",
3570
- value: function reset() {
3571
- var _this = this;
3572
-
3573
- this.state = new AsYouTypeState({
3574
- onCountryChange: function onCountryChange(country) {
3575
- // Before version `1.6.0`, the official `AsYouType` formatter API
3576
- // included the `.country` property of an `AsYouType` instance.
3577
- // Since that property (along with the others) have been moved to
3578
- // `this.state`, `this.country` property is emulated for compatibility
3579
- // with the old versions.
3580
- _this.country = country;
3581
- },
3582
- onCallingCodeChange: function onCallingCodeChange(country, callingCode) {
3583
- _this.metadata.selectNumberingPlan(country, callingCode);
3584
-
3585
- _this.formatter.reset(_this.metadata.numberingPlan, _this.state);
3586
-
3587
- _this.parser.reset(_this.metadata.numberingPlan);
3588
- }
3589
- });
3590
- this.formatter = new AsYouTypeFormatter({
3591
- state: this.state,
3592
- metadata: this.metadata
3593
- });
3594
- this.parser = new AsYouTypeParser({
3595
- defaultCountry: this.defaultCountry,
3596
- defaultCallingCode: this.defaultCallingCode,
3597
- metadata: this.metadata,
3598
- state: this.state,
3599
- onNationalSignificantNumberChange: function onNationalSignificantNumberChange() {
3600
- _this.determineTheCountryIfNeeded();
3601
-
3602
- _this.formatter.reset(_this.metadata.numberingPlan, _this.state);
3603
- }
3604
- });
3605
- this.state.reset(this.defaultCountry, this.defaultCallingCode);
3606
- this.formattedOutput = '';
3607
- return this;
3608
- }
3609
- /**
3610
- * Returns `true` if the phone number is being input in international format.
3611
- * In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
3612
- * @return {boolean}
3613
- */
3614
-
3615
- }, {
3616
- key: "isInternational",
3617
- value: function isInternational() {
3618
- return this.state.international;
3619
- }
3620
- /**
3621
- * Returns the "country calling code" part of the phone number.
3622
- * Returns `undefined` if the number is not being input in international format.
3623
- * Returns "country calling code" for "non-geographic" phone numbering plans too.
3624
- * @return {string} [callingCode]
3625
- */
3626
-
3627
- }, {
3628
- key: "getCallingCode",
3629
- value: function getCallingCode() {
3630
- return this.state.callingCode;
3631
- } // A legacy alias.
3632
-
3633
- }, {
3634
- key: "getCountryCallingCode",
3635
- value: function getCountryCallingCode() {
3636
- return this.getCallingCode();
3637
- }
3638
- /**
3639
- * Returns a two-letter country code of the phone number.
3640
- * Returns `undefined` for "non-geographic" phone numbering plans.
3641
- * Returns `undefined` if no phone number has been input yet.
3642
- * @return {string} [country]
3643
- */
3644
-
3645
- }, {
3646
- key: "getCountry",
3647
- value: function getCountry() {
3648
- var _this$state = this.state,
3649
- digits = _this$state.digits,
3650
- country = _this$state.country; // If no digits have been input yet,
3651
- // then `this.country` is the `defaultCountry`.
3652
- // Won't return the `defaultCountry` in such case.
3653
-
3654
- if (!digits) {
3655
- return;
3656
- }
3657
-
3658
- var countryCode = country;
3659
-
3660
- return countryCode;
3661
- }
3662
- }, {
3663
- key: "determineTheCountryIfNeeded",
3664
- value: function determineTheCountryIfNeeded() {
3665
- // Suppose a user enters a phone number in international format,
3666
- // and there're several countries corresponding to that country calling code,
3667
- // and a country has been derived from the number, and then
3668
- // a user enters one more digit and the number is no longer
3669
- // valid for the derived country, so the country should be re-derived
3670
- // on every new digit in those cases.
3671
- //
3672
- // If the phone number is being input in national format,
3673
- // then it could be a case when `defaultCountry` wasn't specified
3674
- // when creating `AsYouType` instance, and just `defaultCallingCode` was specified,
3675
- // and that "calling code" could correspond to a "non-geographic entity",
3676
- // or there could be several countries corresponding to that country calling code.
3677
- // In those cases, `this.country` is `undefined` and should be derived
3678
- // from the number. Again, if country calling code is ambiguous, then
3679
- // `this.country` should be re-derived with each new digit.
3680
- //
3681
- if (!this.state.country || this.isCountryCallingCodeAmbiguous()) {
3682
- this.determineTheCountry();
3683
- }
3684
- } // Prepends `+CountryCode ` in case of an international phone number
3685
-
3686
- }, {
3687
- key: "getFullNumber",
3688
- value: function getFullNumber(formattedNationalNumber) {
3689
- var _this2 = this;
3690
-
3691
- if (this.isInternational()) {
3692
- var prefix = function prefix(text) {
3693
- return _this2.formatter.getInternationalPrefixBeforeCountryCallingCode(_this2.state, {
3694
- spacing: text ? true : false
3695
- }) + text;
3696
- };
3697
-
3698
- var callingCode = this.state.callingCode;
3699
-
3700
- if (!callingCode) {
3701
- return prefix("".concat(this.state.getDigitsWithoutInternationalPrefix()));
3702
- }
3703
-
3704
- if (!formattedNationalNumber) {
3705
- return prefix(callingCode);
3706
- }
3707
-
3708
- return prefix("".concat(callingCode, " ").concat(formattedNationalNumber));
3709
- }
3710
-
3711
- return formattedNationalNumber;
3712
- }
3713
- }, {
3714
- key: "getNonFormattedNationalNumberWithPrefix",
3715
- value: function getNonFormattedNationalNumberWithPrefix() {
3716
- var _this$state2 = this.state,
3717
- nationalSignificantNumber = _this$state2.nationalSignificantNumber,
3718
- complexPrefixBeforeNationalSignificantNumber = _this$state2.complexPrefixBeforeNationalSignificantNumber,
3719
- nationalPrefix = _this$state2.nationalPrefix;
3720
- var number = nationalSignificantNumber;
3721
- var prefix = complexPrefixBeforeNationalSignificantNumber || nationalPrefix;
3722
-
3723
- if (prefix) {
3724
- number = prefix + number;
3725
- }
3726
-
3727
- return number;
3728
- }
3729
- }, {
3730
- key: "getNonFormattedNumber",
3731
- value: function getNonFormattedNumber() {
3732
- var nationalSignificantNumberMatchesInput = this.state.nationalSignificantNumberMatchesInput;
3733
- return this.getFullNumber(nationalSignificantNumberMatchesInput ? this.getNonFormattedNationalNumberWithPrefix() : this.state.getNationalDigits());
3734
- }
3735
- }, {
3736
- key: "getNonFormattedTemplate",
3737
- value: function getNonFormattedTemplate() {
3738
- var number = this.getNonFormattedNumber();
3739
-
3740
- if (number) {
3741
- return number.replace(/[\+\d]/g, DIGIT_PLACEHOLDER);
3742
- }
3743
- }
3744
- }, {
3745
- key: "isCountryCallingCodeAmbiguous",
3746
- value: function isCountryCallingCodeAmbiguous() {
3747
- var callingCode = this.state.callingCode;
3748
- var countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode);
3749
- return countryCodes && countryCodes.length > 1;
3750
- } // Determines the country of the phone number
3751
- // entered so far based on the country phone code
3752
- // and the national phone number.
3753
-
3754
- }, {
3755
- key: "determineTheCountry",
3756
- value: function determineTheCountry() {
3757
- this.state.setCountry(getCountryByCallingCode(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, this.state.nationalSignificantNumber, this.metadata));
3758
- }
3759
- /**
3760
- * Returns an instance of `PhoneNumber` class.
3761
- * Will return `undefined` if no national (significant) number
3762
- * digits have been entered so far, or if no `defaultCountry` has been
3763
- * set and the user enters a phone number not in international format.
3764
- */
3765
-
3766
- }, {
3767
- key: "getNumber",
3768
- value: function getNumber() {
3769
- var _this$state3 = this.state,
3770
- nationalSignificantNumber = _this$state3.nationalSignificantNumber,
3771
- carrierCode = _this$state3.carrierCode;
3772
-
3773
- if (this.isInternational()) {
3774
- if (!this.state.callingCode) {
3775
- return;
3776
- }
3777
- } else {
3778
- if (!this.state.country && !this.defaultCallingCode) {
3779
- return;
3780
- }
3781
- }
3782
-
3783
- if (!nationalSignificantNumber) {
3784
- return;
3785
- }
3786
-
3787
- var countryCode = this.getCountry();
3788
- var callingCode = this.getCountryCallingCode() || this.defaultCallingCode;
3789
- var phoneNumber = new PhoneNumber(countryCode || callingCode, nationalSignificantNumber, this.metadata.metadata);
3790
-
3791
- if (carrierCode) {
3792
- phoneNumber.carrierCode = carrierCode;
3793
- } // Phone number extensions are not supported by "As You Type" formatter.
3794
-
3795
-
3796
- return phoneNumber;
3797
- }
3798
- /**
3799
- * Returns `true` if the phone number is "possible".
3800
- * Is just a shortcut for `PhoneNumber.isPossible()`.
3801
- * @return {boolean}
3802
- */
3803
-
3804
- }, {
3805
- key: "isPossible",
3806
- value: function isPossible() {
3807
- var phoneNumber = this.getNumber();
3808
-
3809
- if (!phoneNumber) {
3810
- return false;
3811
- }
3812
-
3813
- return phoneNumber.isPossible();
3814
- }
3815
- /**
3816
- * Returns `true` if the phone number is "valid".
3817
- * Is just a shortcut for `PhoneNumber.isValid()`.
3818
- * @return {boolean}
3819
- */
3820
-
3821
- }, {
3822
- key: "isValid",
3823
- value: function isValid() {
3824
- var phoneNumber = this.getNumber();
3825
-
3826
- if (!phoneNumber) {
3827
- return false;
3828
- }
3829
-
3830
- return phoneNumber.isValid();
3831
- }
3832
- /**
3833
- * @deprecated
3834
- * This method is used in `react-phone-number-input/source/input-control.js`
3835
- * in versions before `3.0.16`.
3836
- */
3837
-
3838
- }, {
3839
- key: "getNationalNumber",
3840
- value: function getNationalNumber() {
3841
- return this.state.nationalSignificantNumber;
3842
- }
3843
- /**
3844
- * Returns the phone number characters entered by the user.
3845
- * @return {string}
3846
- */
3847
-
3848
- }, {
3849
- key: "getChars",
3850
- value: function getChars() {
3851
- return (this.state.international ? '+' : '') + this.state.digits;
3852
- }
3853
- /**
3854
- * Returns the template for the formatted phone number.
3855
- * @return {string}
3856
- */
3857
-
3858
- }, {
3859
- key: "getTemplate",
3860
- value: function getTemplate() {
3861
- return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || '';
3862
- }
3863
- }]);
3864
-
3865
- return AsYouType;
3866
- }();
3867
-
3868
- function AsYouType$1(country) {
3869
- return AsYouType.call(this, country, metadata)
3870
- }
3871
-
3872
- AsYouType$1.prototype = Object.create(AsYouType.prototype, {});
3873
- AsYouType$1.prototype.constructor = AsYouType$1;
3874
-
3875
- const FORM_VALIDATION_CONTEXT = "sq:validation-state";
3876
- function useValidationState(formState) {
3877
- const host = P();
3878
- const [validationState, setValidationState] = y(host, FORM_VALIDATION_CONTEXT, formState);
3879
- return { validationState, setValidationState };
3880
- }
3881
-
3882
- export { AsYouType$1 as A, FORM_VALIDATION_CONTEXT as F, useValidationState as u };