pixel-react 1.15.11 → 1.15.12

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 (249) hide show
  1. package/README.md +75 -75
  2. package/lib/ThirdPartyPackages/JanusGateway.js +5 -2
  3. package/lib/ThirdPartyPackages/JanusGateway.js.map +1 -1
  4. package/lib/_virtual/index10.js +2 -2
  5. package/lib/_virtual/index11.js +2 -2
  6. package/lib/_virtual/index12.js +2 -2
  7. package/lib/_virtual/index9.js +2 -2
  8. package/lib/assets/icons/spinner.svg.js +1 -1
  9. package/lib/assets/icons/spinner.svg.js.map +1 -1
  10. package/lib/components/Editor/VariableDropdown.js +2 -2
  11. package/lib/index.cjs +7209 -4574
  12. package/lib/index.cjs.map +1 -1
  13. package/lib/index.js +1 -1
  14. package/lib/node_modules/@date-fns/tz/date/index.js +19 -1
  15. package/lib/node_modules/@date-fns/tz/date/index.js.map +1 -1
  16. package/lib/node_modules/@date-fns/tz/date/mini.js +6 -34
  17. package/lib/node_modules/@date-fns/tz/date/mini.js.map +1 -1
  18. package/lib/node_modules/@date-fns/tz/tzOffset/index.js +5 -6
  19. package/lib/node_modules/@date-fns/tz/tzOffset/index.js.map +1 -1
  20. package/lib/node_modules/janus-gateway/npm/dist/janus.es.js +3241 -0
  21. package/lib/node_modules/janus-gateway/npm/dist/janus.es.js.map +1 -0
  22. package/lib/node_modules/js-beautify/js/src/css/index.js +1 -1
  23. package/lib/node_modules/js-beautify/js/src/css/options.js +1 -1
  24. package/lib/node_modules/js-beautify/js/src/html/beautifier.js +1 -1
  25. package/lib/node_modules/js-beautify/js/src/html/index.js +1 -1
  26. package/lib/node_modules/js-beautify/js/src/html/options.js +1 -1
  27. package/lib/node_modules/js-beautify/js/src/html/tokenizer.js +1 -1
  28. package/lib/node_modules/js-beautify/js/src/javascript/beautifier.js +1 -1
  29. package/lib/node_modules/js-beautify/js/src/javascript/index.js +1 -1
  30. package/lib/node_modules/js-beautify/js/src/javascript/options.js +1 -1
  31. package/lib/node_modules/js-beautify/js/src/javascript/tokenizer.js +1 -1
  32. package/lib/node_modules/libphonenumber-js/es6/AsYouType.js +82 -115
  33. package/lib/node_modules/libphonenumber-js/es6/AsYouType.js.map +1 -1
  34. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js +58 -68
  35. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
  36. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js +23 -36
  37. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js.map +1 -1
  38. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js +9 -13
  39. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js.map +1 -1
  40. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js +187 -226
  41. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js.map +1 -1
  42. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js +27 -21
  43. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js.map +1 -1
  44. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeParser.js +117 -150
  45. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeParser.js.map +1 -1
  46. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeState.js +38 -57
  47. package/lib/node_modules/libphonenumber-js/es6/AsYouTypeState.js.map +1 -1
  48. package/lib/node_modules/libphonenumber-js/es6/ParseError.js +109 -70
  49. package/lib/node_modules/libphonenumber-js/es6/ParseError.js.map +1 -1
  50. package/lib/node_modules/libphonenumber-js/es6/PhoneNumber.js +57 -72
  51. package/lib/node_modules/libphonenumber-js/es6/PhoneNumber.js.map +1 -1
  52. package/lib/node_modules/libphonenumber-js/es6/constants.js +9 -15
  53. package/lib/node_modules/libphonenumber-js/es6/constants.js.map +1 -1
  54. package/lib/node_modules/libphonenumber-js/es6/format.js +93 -67
  55. package/lib/node_modules/libphonenumber-js/es6/format.js.map +1 -1
  56. package/lib/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.js +1 -0
  57. package/lib/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.js.map +1 -1
  58. package/lib/node_modules/libphonenumber-js/es6/getCountries.js.map +1 -1
  59. package/lib/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +1 -0
  60. package/lib/node_modules/libphonenumber-js/es6/helpers/RFC3966.js.map +1 -1
  61. package/lib/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +1 -1
  62. package/lib/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js.map +1 -1
  63. package/lib/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +10 -49
  64. package/lib/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js.map +1 -1
  65. package/lib/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +32 -20
  66. package/lib/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js.map +1 -1
  67. package/lib/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +4 -5
  68. package/lib/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js.map +1 -1
  69. package/lib/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +18 -25
  70. package/lib/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js.map +1 -1
  71. package/lib/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +11 -12
  72. package/lib/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map +1 -1
  73. package/lib/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +11 -13
  74. package/lib/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map +1 -1
  75. package/lib/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +11 -21
  76. package/lib/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js.map +1 -1
  77. package/lib/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +11 -12
  78. package/lib/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js.map +1 -1
  79. package/lib/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +12 -15
  80. package/lib/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js.map +1 -1
  81. package/lib/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +1 -1
  82. package/lib/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js.map +1 -1
  83. package/lib/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +4 -4
  84. package/lib/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js.map +1 -1
  85. package/lib/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +35 -59
  86. package/lib/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js.map +1 -1
  87. package/lib/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +2 -2
  88. package/lib/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js.map +1 -1
  89. package/lib/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +36 -38
  90. package/lib/node_modules/libphonenumber-js/es6/helpers/getNumberType.js.map +1 -1
  91. package/lib/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +1 -0
  92. package/lib/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js.map +1 -1
  93. package/lib/node_modules/libphonenumber-js/es6/helpers/isObject.js.map +1 -1
  94. package/lib/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +10 -14
  95. package/lib/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js.map +1 -1
  96. package/lib/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +4 -4
  97. package/lib/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js.map +1 -1
  98. package/lib/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +27 -22
  99. package/lib/node_modules/libphonenumber-js/es6/helpers/parseDigits.js.map +1 -1
  100. package/lib/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +6 -6
  101. package/lib/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js.map +1 -1
  102. package/lib/node_modules/libphonenumber-js/es6/isPossible.js +7 -6
  103. package/lib/node_modules/libphonenumber-js/es6/isPossible.js.map +1 -1
  104. package/lib/node_modules/libphonenumber-js/es6/isValid.js +5 -6
  105. package/lib/node_modules/libphonenumber-js/es6/isValid.js.map +1 -1
  106. package/lib/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js +26 -44
  107. package/lib/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js.map +1 -1
  108. package/lib/node_modules/libphonenumber-js/es6/metadata.js +69 -120
  109. package/lib/node_modules/libphonenumber-js/es6/metadata.js.map +1 -1
  110. package/lib/node_modules/libphonenumber-js/es6/normalizeArguments.js +68 -87
  111. package/lib/node_modules/libphonenumber-js/es6/normalizeArguments.js.map +1 -1
  112. package/lib/node_modules/libphonenumber-js/es6/parse.js +40 -58
  113. package/lib/node_modules/libphonenumber-js/es6/parse.js.map +1 -1
  114. package/lib/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +36 -32
  115. package/lib/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js.map +1 -1
  116. package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumber.js.map +1 -1
  117. package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +26 -44
  118. package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js.map +1 -1
  119. package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +28 -46
  120. package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js.map +1 -1
  121. package/lib/node_modules/libphonenumber-js/es6/tools/semver-compare.js.map +1 -1
  122. package/lib/node_modules/libphonenumber-js/metadata.min.json.js +18 -18
  123. package/lib/node_modules/libphonenumber-js/metadata.min.json.js.map +1 -1
  124. package/lib/node_modules/prop-types/index.js +1 -1
  125. package/lib/node_modules/react-day-picker/dist/esm/DayPicker.js +64 -88
  126. package/lib/node_modules/react-day-picker/dist/esm/DayPicker.js.map +1 -1
  127. package/lib/node_modules/react-day-picker/dist/esm/UI.js.map +1 -1
  128. package/lib/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js.map +1 -1
  129. package/lib/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js.map +1 -1
  130. package/lib/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js.map +1 -1
  131. package/lib/node_modules/react-day-picker/dist/esm/classes/DateLib.js +6 -71
  132. package/lib/node_modules/react-day-picker/dist/esm/classes/DateLib.js.map +1 -1
  133. package/lib/node_modules/react-day-picker/dist/esm/components/Button.js.map +1 -1
  134. package/lib/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js.map +1 -1
  135. package/lib/node_modules/react-day-picker/dist/esm/components/Chevron.js +14 -18
  136. package/lib/node_modules/react-day-picker/dist/esm/components/Chevron.js.map +1 -1
  137. package/lib/node_modules/react-day-picker/dist/esm/components/Day.js.map +1 -1
  138. package/lib/node_modules/react-day-picker/dist/esm/components/DayButton.js.map +1 -1
  139. package/lib/node_modules/react-day-picker/dist/esm/components/Dropdown.js.map +1 -1
  140. package/lib/node_modules/react-day-picker/dist/esm/components/DropdownNav.js.map +1 -1
  141. package/lib/node_modules/react-day-picker/dist/esm/components/Footer.js.map +1 -1
  142. package/lib/node_modules/react-day-picker/dist/esm/components/Month.js.map +1 -1
  143. package/lib/node_modules/react-day-picker/dist/esm/components/MonthCaption.js.map +1 -1
  144. package/lib/node_modules/react-day-picker/dist/esm/components/MonthGrid.js.map +1 -1
  145. package/lib/node_modules/react-day-picker/dist/esm/components/Months.js.map +1 -1
  146. package/lib/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js.map +1 -1
  147. package/lib/node_modules/react-day-picker/dist/esm/components/Nav.js.map +1 -1
  148. package/lib/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js.map +1 -1
  149. package/lib/node_modules/react-day-picker/dist/esm/components/Option.js.map +1 -1
  150. package/lib/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js.map +1 -1
  151. package/lib/node_modules/react-day-picker/dist/esm/components/Root.js.map +1 -1
  152. package/lib/node_modules/react-day-picker/dist/esm/components/Select.js.map +1 -1
  153. package/lib/node_modules/react-day-picker/dist/esm/components/Week.js.map +1 -1
  154. package/lib/node_modules/react-day-picker/dist/esm/components/WeekNumber.js.map +1 -1
  155. package/lib/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js.map +1 -1
  156. package/lib/node_modules/react-day-picker/dist/esm/components/Weekday.js.map +1 -1
  157. package/lib/node_modules/react-day-picker/dist/esm/components/Weekdays.js.map +1 -1
  158. package/lib/node_modules/react-day-picker/dist/esm/components/Weeks.js.map +1 -1
  159. package/lib/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js.map +1 -1
  160. package/lib/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +2 -3
  161. package/lib/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js.map +1 -1
  162. package/lib/node_modules/react-day-picker/dist/esm/formatters/formatDay.js.map +1 -1
  163. package/lib/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js.map +1 -1
  164. package/lib/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js.map +1 -1
  165. package/lib/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js.map +1 -1
  166. package/lib/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js.map +1 -1
  167. package/lib/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js.map +1 -1
  168. package/lib/node_modules/react-day-picker/dist/esm/formatters/index.js +1 -1
  169. package/lib/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js.map +1 -1
  170. package/lib/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js.map +1 -1
  171. package/lib/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js.map +1 -1
  172. package/lib/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js.map +1 -1
  173. package/lib/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js.map +1 -1
  174. package/lib/node_modules/react-day-picker/dist/esm/helpers/getComponents.js.map +1 -1
  175. package/lib/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js.map +1 -1
  176. package/lib/node_modules/react-day-picker/dist/esm/helpers/getDates.js.map +1 -1
  177. package/lib/node_modules/react-day-picker/dist/esm/helpers/getDays.js +4 -4
  178. package/lib/node_modules/react-day-picker/dist/esm/helpers/getDays.js.map +1 -1
  179. package/lib/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js.map +1 -1
  180. package/lib/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js.map +1 -1
  181. package/lib/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js.map +1 -1
  182. package/lib/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js.map +1 -1
  183. package/lib/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js.map +1 -1
  184. package/lib/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js.map +1 -1
  185. package/lib/node_modules/react-day-picker/dist/esm/helpers/getMonths.js.map +1 -1
  186. package/lib/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js.map +1 -1
  187. package/lib/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js.map +1 -1
  188. package/lib/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js.map +1 -1
  189. package/lib/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js.map +1 -1
  190. package/lib/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js.map +1 -1
  191. package/lib/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js.map +1 -1
  192. package/lib/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +2 -2
  193. package/lib/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js.map +1 -1
  194. package/lib/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +11 -9
  195. package/lib/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js.map +1 -1
  196. package/lib/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js.map +1 -1
  197. package/lib/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js.map +1 -1
  198. package/lib/node_modules/react-day-picker/dist/esm/labels/index.js +2 -2
  199. package/lib/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js.map +1 -1
  200. package/lib/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +2 -3
  201. package/lib/node_modules/react-day-picker/dist/esm/labels/labelGrid.js.map +1 -1
  202. package/lib/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js.map +1 -1
  203. package/lib/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +1 -1
  204. package/lib/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js.map +1 -1
  205. package/lib/node_modules/react-day-picker/dist/esm/labels/labelNav.js.map +1 -1
  206. package/lib/node_modules/react-day-picker/dist/esm/labels/labelNext.js +1 -1
  207. package/lib/node_modules/react-day-picker/dist/esm/labels/labelNext.js.map +1 -1
  208. package/lib/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +1 -1
  209. package/lib/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js.map +1 -1
  210. package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +1 -1
  211. package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js.map +1 -1
  212. package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +1 -1
  213. package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js.map +1 -1
  214. package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js.map +1 -1
  215. package/lib/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +1 -1
  216. package/lib/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js.map +1 -1
  217. package/lib/node_modules/react-day-picker/dist/esm/selection/useMulti.js.map +1 -1
  218. package/lib/node_modules/react-day-picker/dist/esm/selection/useRange.js.map +1 -1
  219. package/lib/node_modules/react-day-picker/dist/esm/selection/useSingle.js.map +1 -1
  220. package/lib/node_modules/react-day-picker/dist/esm/useAnimation.js +1 -1
  221. package/lib/node_modules/react-day-picker/dist/esm/useAnimation.js.map +1 -1
  222. package/lib/node_modules/react-day-picker/dist/esm/useCalendar.js +1 -1
  223. package/lib/node_modules/react-day-picker/dist/esm/useCalendar.js.map +1 -1
  224. package/lib/node_modules/react-day-picker/dist/esm/useDayPicker.js.map +1 -1
  225. package/lib/node_modules/react-day-picker/dist/esm/useFocus.js +0 -6
  226. package/lib/node_modules/react-day-picker/dist/esm/useFocus.js.map +1 -1
  227. package/lib/node_modules/react-day-picker/dist/esm/useSelection.js.map +1 -1
  228. package/lib/node_modules/react-day-picker/dist/esm/utils/addToRange.js +1 -6
  229. package/lib/node_modules/react-day-picker/dist/esm/utils/addToRange.js.map +1 -1
  230. package/lib/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js.map +1 -1
  231. package/lib/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js.map +1 -1
  232. package/lib/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js.map +1 -1
  233. package/lib/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js.map +1 -1
  234. package/lib/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js.map +1 -1
  235. package/lib/node_modules/react-day-picker/dist/esm/utils/typeguards.js.map +1 -1
  236. package/lib/node_modules/react-hook-form/dist/index.esm.js +44 -67
  237. package/lib/node_modules/react-hook-form/dist/index.esm.js.map +1 -1
  238. package/lib/node_modules/react-virtuoso/dist/index.js +1200 -1246
  239. package/lib/node_modules/react-virtuoso/dist/index.js.map +1 -1
  240. package/lib/node_modules/ua-parser-js/src/ua-parser.js +71 -85
  241. package/lib/node_modules/ua-parser-js/src/ua-parser.js.map +1 -1
  242. package/lib/styles.css +1 -1
  243. package/lib/styles.css.map +1 -1
  244. package/lib/tsconfig.tsbuildinfo +1 -1
  245. package/package.json +106 -106
  246. package/lib/node_modules/@date-fns/tz/tzName/index.js +0 -40
  247. package/lib/node_modules/@date-fns/tz/tzName/index.js.map +0 -1
  248. package/lib/node_modules/react-day-picker/node_modules/date-fns/eachYearOfInterval.js +0 -64
  249. package/lib/node_modules/react-day-picker/node_modules/date-fns/eachYearOfInterval.js.map +0 -1
@@ -1,17 +1,15 @@
1
1
  import { VALID_DIGITS } from '../../constants.js';
2
2
 
3
- // The RFC 3966 format for extensions.
4
3
  var RFC3966_EXTN_PREFIX = ';ext=';
5
-
6
4
  /**
7
5
  * Helper method for constructing regular expressions for parsing. Creates
8
6
  * an expression that captures up to max_length digits.
9
7
  * @return {string} RegEx pattern to capture extension digits.
10
8
  */
9
+
11
10
  var getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {
12
11
  return "([".concat(VALID_DIGITS, "]{1,").concat(maxLength, "})");
13
12
  };
14
-
15
13
  /**
16
14
  * Helper initialiser method to create the regular-expression pattern to match
17
15
  * extensions.
@@ -19,66 +17,79 @@ var getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {
19
17
  * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766
20
18
  * @return {string} RegEx pattern to capture extensions.
21
19
  */
20
+
22
21
  function createExtensionPattern(purpose) {
23
22
  // We cap the maximum length of an extension based on the ambiguity of the way
24
23
  // the extension is prefixed. As per ITU, the officially allowed length for
25
24
  // extensions is actually 40, but we don't support this since we haven't seen real
26
25
  // examples and this introduces many false interpretations as the extension labels
27
26
  // are not standardized.
27
+
28
28
  /** @type {string} */
29
29
  var extLimitAfterExplicitLabel = '20';
30
30
  /** @type {string} */
31
+
31
32
  var extLimitAfterLikelyLabel = '15';
32
33
  /** @type {string} */
34
+
33
35
  var extLimitAfterAmbiguousChar = '9';
34
36
  /** @type {string} */
35
- var extLimitWhenNotSure = '6';
36
37
 
38
+ var extLimitWhenNotSure = '6';
37
39
  /** @type {string} */
38
- var possibleSeparatorsBetweenNumberAndExtLabel = "[ \xA0\\t,]*";
39
- // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.
40
+
41
+ var possibleSeparatorsBetweenNumberAndExtLabel = "[ \xA0\\t,]*"; // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.
42
+
40
43
  /** @type {string} */
44
+
41
45
  var possibleCharsAfterExtLabel = "[:\\.\uFF0E]?[ \xA0\\t,-]*";
42
46
  /** @type {string} */
43
- var optionalExtnSuffix = "#?";
44
47
 
45
- // Here the extension is called out in more explicit way, i.e mentioning it obvious
48
+ var optionalExtnSuffix = "#?"; // Here the extension is called out in more explicit way, i.e mentioning it obvious
46
49
  // patterns like "ext.".
50
+
47
51
  /** @type {string} */
48
- var explicitExtLabels = "(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)";
49
- // One-character symbols that can be used to indicate an extension, and less
52
+
53
+ var explicitExtLabels = "(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)"; // One-character symbols that can be used to indicate an extension, and less
50
54
  // commonly used or more ambiguous extension labels.
55
+
51
56
  /** @type {string} */
52
- var ambiguousExtLabels = "(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)";
53
- // When extension is not separated clearly.
57
+
58
+ var ambiguousExtLabels = "(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)"; // When extension is not separated clearly.
59
+
54
60
  /** @type {string} */
55
- var ambiguousSeparator = "[- ]+";
56
- // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching
61
+
62
+ var ambiguousSeparator = "[- ]+"; // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching
57
63
  // comma as extension label may have it.
64
+
58
65
  /** @type {string} */
59
- var possibleSeparatorsNumberExtLabelNoComma = "[ \xA0\\t]*";
60
- // ",," is commonly used for auto dialling the extension when connected. First
66
+
67
+ var possibleSeparatorsNumberExtLabelNoComma = "[ \xA0\\t]*"; // ",," is commonly used for auto dialling the extension when connected. First
61
68
  // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do
62
69
  // not repeat it here. Semi-colon works in Iphone and Android also to pop up a
63
70
  // button with the extension number following.
71
+
64
72
  /** @type {string} */
65
- var autoDiallingAndExtLabelsFound = "(?:,{2}|;)";
66
73
 
74
+ var autoDiallingAndExtLabelsFound = "(?:,{2}|;)";
67
75
  /** @type {string} */
76
+
68
77
  var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);
69
78
  /** @type {string} */
79
+
70
80
  var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;
71
81
  /** @type {string} */
82
+
72
83
  var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
73
84
  /** @type {string} */
74
- var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + "#";
75
85
 
86
+ var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + "#";
76
87
  /** @type {string} */
88
+
77
89
  var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;
78
90
  /** @type {string} */
79
- var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + "(?:,)+" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
80
91
 
81
- // The first regular expression covers RFC 3966 format, where the extension is added
92
+ var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + "(?:,)+" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix; // The first regular expression covers RFC 3966 format, where the extension is added
82
93
  // using ";ext=". The second more generic where extension is mentioned with explicit
83
94
  // labels like "ext:". In both the above cases we allow more numbers in extension than
84
95
  // any other extension labels. The third one captures when single character extension
@@ -90,6 +101,7 @@ function createExtensionPattern(purpose) {
90
101
  // autodialling formats which are used when dialling and in this case we accept longer
91
102
  // extensions. The last one is more liberal on the number of commas that acts as
92
103
  // extension labels, so we have a strict cap on the number of digits in such extensions.
104
+
93
105
  return rfcExtn + "|" + explicitExtn + "|" + ambiguousExtn + "|" + americanStyleExtnWithSuffix + "|" + autoDiallingExtn + "|" + onlyCommasExtn;
94
106
  }
95
107
 
@@ -1 +1 @@
1
- {"version":3,"file":"createExtensionPattern.js","sources":["../../../../../../node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js"],"sourcesContent":["import { VALID_DIGITS } from '../../constants.js';\n\n// The RFC 3966 format for extensions.\nvar RFC3966_EXTN_PREFIX = ';ext=';\n\n/**\r\n * Helper method for constructing regular expressions for parsing. Creates\r\n * an expression that captures up to max_length digits.\r\n * @return {string} RegEx pattern to capture extension digits.\r\n */\nvar getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {\n return \"([\".concat(VALID_DIGITS, \"]{1,\").concat(maxLength, \"})\");\n};\n\n/**\r\n * Helper initialiser method to create the regular-expression pattern to match\r\n * extensions.\r\n * Copy-pasted from Google's `libphonenumber`:\r\n * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766\r\n * @return {string} RegEx pattern to capture extensions.\r\n */\nexport default function createExtensionPattern(purpose) {\n // We cap the maximum length of an extension based on the ambiguity of the way\n // the extension is prefixed. As per ITU, the officially allowed length for\n // extensions is actually 40, but we don't support this since we haven't seen real\n // examples and this introduces many false interpretations as the extension labels\n // are not standardized.\n /** @type {string} */\n var extLimitAfterExplicitLabel = '20';\n /** @type {string} */\n var extLimitAfterLikelyLabel = '15';\n /** @type {string} */\n var extLimitAfterAmbiguousChar = '9';\n /** @type {string} */\n var extLimitWhenNotSure = '6';\n\n /** @type {string} */\n var possibleSeparatorsBetweenNumberAndExtLabel = \"[ \\xA0\\\\t,]*\";\n // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.\n /** @type {string} */\n var possibleCharsAfterExtLabel = \"[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*\";\n /** @type {string} */\n var optionalExtnSuffix = \"#?\";\n\n // Here the extension is called out in more explicit way, i.e mentioning it obvious\n // patterns like \"ext.\".\n /** @type {string} */\n var explicitExtLabels = \"(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|\\u0434\\u043E\\u0431|anexo)\";\n // One-character symbols that can be used to indicate an extension, and less\n // commonly used or more ambiguous extension labels.\n /** @type {string} */\n var ambiguousExtLabels = \"(?:[x\\uFF58#\\uFF03~\\uFF5E]|int|\\uFF49\\uFF4E\\uFF54)\";\n // When extension is not separated clearly.\n /** @type {string} */\n var ambiguousSeparator = \"[- ]+\";\n // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching\n // comma as extension label may have it.\n /** @type {string} */\n var possibleSeparatorsNumberExtLabelNoComma = \"[ \\xA0\\\\t]*\";\n // \",,\" is commonly used for auto dialling the extension when connected. First\n // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do\n // not repeat it here. Semi-colon works in Iphone and Android also to pop up a\n // button with the extension number following.\n /** @type {string} */\n var autoDiallingAndExtLabelsFound = \"(?:,{2}|;)\";\n\n /** @type {string} */\n var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);\n /** @type {string} */\n var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;\n /** @type {string} */\n var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n /** @type {string} */\n var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + \"#\";\n\n /** @type {string} */\n var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;\n /** @type {string} */\n var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + \"(?:,)+\" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n\n // The first regular expression covers RFC 3966 format, where the extension is added\n // using \";ext=\". The second more generic where extension is mentioned with explicit\n // labels like \"ext:\". In both the above cases we allow more numbers in extension than\n // any other extension labels. The third one captures when single character extension\n // labels or less commonly used labels are used. In such cases we capture fewer\n // extension digits in order to reduce the chance of falsely interpreting two\n // numbers beside each other as a number + extension. The fourth one covers the\n // special case of American numbers where the extension is written with a hash\n // at the end, such as \"- 503#\". The fifth one is exclusively for extension\n // autodialling formats which are used when dialling and in this case we accept longer\n // extensions. The last one is more liberal on the number of commas that acts as\n // extension labels, so we have a strict cap on the number of digits in such extensions.\n return rfcExtn + \"|\" + explicitExtn + \"|\" + ambiguousExtn + \"|\" + americanStyleExtnWithSuffix + \"|\" + autoDiallingExtn + \"|\" + onlyCommasExtn;\n}\n//# sourceMappingURL=createExtensionPattern.js.map"],"names":["RFC3966_EXTN_PREFIX","getExtensionDigitsPattern","maxLength","concat","VALID_DIGITS","createExtensionPattern","purpose","extLimitAfterExplicitLabel","extLimitAfterLikelyLabel","extLimitAfterAmbiguousChar","extLimitWhenNotSure","possibleSeparatorsBetweenNumberAndExtLabel","possibleCharsAfterExtLabel","optionalExtnSuffix","explicitExtLabels","ambiguousExtLabels","ambiguousSeparator","possibleSeparatorsNumberExtLabelNoComma","autoDiallingAndExtLabelsFound","rfcExtn","explicitExtn","ambiguousExtn","americanStyleExtnWithSuffix","autoDiallingExtn","onlyCommasExtn"],"mappings":";;AAEA;AACA,IAAMA,mBAAmB,GAAG,OAAO;;AAEnC;AACA;AACA;AACA;AACA;AACA,IAAMC,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAIC,SAAS,EAAA;AAAA,EAAA,OAAA,IAAA,CAAAC,MAAA,CAAUC,YAAY,EAAA,MAAA,CAAA,CAAAD,MAAA,CAAOD,SAAS,EAAA,IAAA,CAAA;AAAA,CAAI;;AAEtF;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,sBAAsBA,CAACC,OAAO,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;EACA,IAAIC,0BAA0B,GAAG,IAAI;AACrC;EACA,IAAIC,wBAAwB,GAAG,IAAI;AACnC;EACA,IAAIC,0BAA0B,GAAG,GAAG;AACpC;EACA,IAAIC,mBAAmB,GAAG,GAAG;;AAE7B;EACA,IAAIC,0CAA0C,GAAG,cAAgB;AACjE;AACA;EACA,IAAIC,0BAA0B,GAAG,4BAA8B;AAC/D;EACA,IAAIC,kBAAkB,GAAG,IAAI;;AAE7B;AACA;AACA;EACA,IAAIC,iBAAiB,GACnB,0FAA4F;AAC9F;AACA;AACA;EACA,IAAIC,kBAAkB,GAAG,oDAAoD;AAC7E;AACA;EACA,IAAIC,kBAAkB,GAAG,OAAO;AAChC;AACA;AACA;EACA,IAAIC,uCAAuC,GAAG,aAAe;AAC7D;AACA;AACA;AACA;AACA;EACA,IAAIC,6BAA6B,GAAG,YAAY;;AAEhD;AACA,EAAA,IAAIC,OAAO,GAAGnB,mBAAmB,GAC1BC,yBAAyB,CAACM,0BAA0B,CAAC;AAC5D;AACA,EAAA,IAAIa,YAAY,GAAGT,0CAA0C,GAAGG,iBAAiB,GAC1EF,0BAA0B,GAC1BX,yBAAyB,CAACM,0BAA0B,CAAC,GACrDM,kBAAkB;AACzB;AACA,EAAA,IAAIQ,aAAa,GAAGV,0CAA0C,GAAGI,kBAAkB,GAC5EH,0BAA0B,GAC/BX,yBAAyB,CAACQ,0BAA0B,CAAC,GACrDI,kBAAkB;AACpB;EACA,IAAIS,2BAA2B,GAAGN,kBAAkB,GAClDf,yBAAyB,CAACS,mBAAmB,CAAC,GAAG,GAAG;;AAEtD;AACA,EAAA,IAAIa,gBAAgB,GAAGN,uCAAuC,GACvDC,6BAA6B,GAAGN,0BAA0B,GAC1DX,yBAAyB,CAACO,wBAAwB,CAAC,GACxDK,kBAAkB;AACpB;AACA,EAAA,IAAIW,cAAc,GAAGP,uCAAuC,GACtD,QAAQ,GAAGL,0BAA0B,GACrCX,yBAAyB,CAACQ,0BAA0B,CAAC,GACrDI,kBAAkB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACA,OAAOM,OAAO,GAAG,GAAG,GACXC,YAAY,GAAG,GAAG,GAClBC,aAAa,GAAG,GAAG,GACnBC,2BAA2B,GAAG,GAAG,GACjCC,gBAAgB,GAAG,GAAG,GACtBC,cAAc;AACxB;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"createExtensionPattern.js","sources":["../../../../../../node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js"],"sourcesContent":["import { VALID_DIGITS } from '../../constants.js'; // The RFC 3966 format for extensions.\n\nvar RFC3966_EXTN_PREFIX = ';ext=';\n/**\r\n * Helper method for constructing regular expressions for parsing. Creates\r\n * an expression that captures up to max_length digits.\r\n * @return {string} RegEx pattern to capture extension digits.\r\n */\n\nvar getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {\n return \"([\".concat(VALID_DIGITS, \"]{1,\").concat(maxLength, \"})\");\n};\n/**\r\n * Helper initialiser method to create the regular-expression pattern to match\r\n * extensions.\r\n * Copy-pasted from Google's `libphonenumber`:\r\n * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766\r\n * @return {string} RegEx pattern to capture extensions.\r\n */\n\n\nexport default function createExtensionPattern(purpose) {\n // We cap the maximum length of an extension based on the ambiguity of the way\n // the extension is prefixed. As per ITU, the officially allowed length for\n // extensions is actually 40, but we don't support this since we haven't seen real\n // examples and this introduces many false interpretations as the extension labels\n // are not standardized.\n\n /** @type {string} */\n var extLimitAfterExplicitLabel = '20';\n /** @type {string} */\n\n var extLimitAfterLikelyLabel = '15';\n /** @type {string} */\n\n var extLimitAfterAmbiguousChar = '9';\n /** @type {string} */\n\n var extLimitWhenNotSure = '6';\n /** @type {string} */\n\n var possibleSeparatorsBetweenNumberAndExtLabel = \"[ \\xA0\\\\t,]*\"; // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.\n\n /** @type {string} */\n\n var possibleCharsAfterExtLabel = \"[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*\";\n /** @type {string} */\n\n var optionalExtnSuffix = \"#?\"; // Here the extension is called out in more explicit way, i.e mentioning it obvious\n // patterns like \"ext.\".\n\n /** @type {string} */\n\n var explicitExtLabels = \"(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|\\u0434\\u043E\\u0431|anexo)\"; // One-character symbols that can be used to indicate an extension, and less\n // commonly used or more ambiguous extension labels.\n\n /** @type {string} */\n\n var ambiguousExtLabels = \"(?:[x\\uFF58#\\uFF03~\\uFF5E]|int|\\uFF49\\uFF4E\\uFF54)\"; // When extension is not separated clearly.\n\n /** @type {string} */\n\n var ambiguousSeparator = \"[- ]+\"; // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching\n // comma as extension label may have it.\n\n /** @type {string} */\n\n var possibleSeparatorsNumberExtLabelNoComma = \"[ \\xA0\\\\t]*\"; // \",,\" is commonly used for auto dialling the extension when connected. First\n // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do\n // not repeat it here. Semi-colon works in Iphone and Android also to pop up a\n // button with the extension number following.\n\n /** @type {string} */\n\n var autoDiallingAndExtLabelsFound = \"(?:,{2}|;)\";\n /** @type {string} */\n\n var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);\n /** @type {string} */\n\n var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;\n /** @type {string} */\n\n var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n /** @type {string} */\n\n var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + \"#\";\n /** @type {string} */\n\n var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;\n /** @type {string} */\n\n var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + \"(?:,)+\" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix; // The first regular expression covers RFC 3966 format, where the extension is added\n // using \";ext=\". The second more generic where extension is mentioned with explicit\n // labels like \"ext:\". In both the above cases we allow more numbers in extension than\n // any other extension labels. The third one captures when single character extension\n // labels or less commonly used labels are used. In such cases we capture fewer\n // extension digits in order to reduce the chance of falsely interpreting two\n // numbers beside each other as a number + extension. The fourth one covers the\n // special case of American numbers where the extension is written with a hash\n // at the end, such as \"- 503#\". The fifth one is exclusively for extension\n // autodialling formats which are used when dialling and in this case we accept longer\n // extensions. The last one is more liberal on the number of commas that acts as\n // extension labels, so we have a strict cap on the number of digits in such extensions.\n\n return rfcExtn + \"|\" + explicitExtn + \"|\" + ambiguousExtn + \"|\" + americanStyleExtnWithSuffix + \"|\" + autoDiallingExtn + \"|\" + onlyCommasExtn;\n}\n//# sourceMappingURL=createExtensionPattern.js.map"],"names":["RFC3966_EXTN_PREFIX","getExtensionDigitsPattern","maxLength","concat","VALID_DIGITS","createExtensionPattern","purpose","extLimitAfterExplicitLabel","extLimitAfterLikelyLabel","extLimitAfterAmbiguousChar","extLimitWhenNotSure","possibleSeparatorsBetweenNumberAndExtLabel","possibleCharsAfterExtLabel","optionalExtnSuffix","explicitExtLabels","ambiguousExtLabels","ambiguousSeparator","possibleSeparatorsNumberExtLabelNoComma","autoDiallingAndExtLabelsFound","rfcExtn","explicitExtn","ambiguousExtn","americanStyleExtnWithSuffix","autoDiallingExtn","onlyCommasExtn"],"mappings":";;AAGA,IAAMA,mBAAmB,GAAG,OAA5B;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,yBAAyB,GAAG,SAA5BA,yBAA4BA,CAACC,SAAD,EAAA;AAAA,EAAA,OAAA,IAAA,CAAAC,MAAA,CAAoBC,YAApB,EAAA,MAAA,CAAA,CAAAD,MAAA,CAAuCD,SAAvC,EAAA,IAAA,CAAA;AAAA,CAAlC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASG,sBAATA,CAAgCC,OAAhC,EAAyC;AACvD;AACA;AACA;AACA;AACA;;AACA;EACA,IAAIC,0BAA0B,GAAG,IAAjC;AACA;;EACA,IAAIC,wBAAwB,GAAG,IAA/B;AACA;;EACA,IAAIC,0BAA0B,GAAG,GAAjC;AACA;;EACA,IAAIC,mBAAmB,GAAG,GAA1B;AAEA;;AACA,EAAA,IAAIC,0CAA0C,GAAG,cAAjD,CAhBuD;;AAkBvD;;EACA,IAAIC,0BAA0B,GAAG,4BAAjC;AACA;;AACA,EAAA,IAAIC,kBAAkB,GAAG,IAAzB,CArBuD;AAwBvD;;AACA;;AACA,EAAA,IAAIC,iBAAiB,GACnB,0FADF,CA1BuD;AA6BvD;;AACA;;AACA,EAAA,IAAIC,kBAAkB,GAAG,oDAAzB,CA/BuD;;AAiCvD;;AACA,EAAA,IAAIC,kBAAkB,GAAG,OAAzB,CAlCuD;AAoCvD;;AACA;;AACA,EAAA,IAAIC,uCAAuC,GAAG,aAA9C,CAtCuD;AAwCvD;AACA;AACA;;AACA;;EACA,IAAIC,6BAA6B,GAAG,YAApC;AAEA;;AACA,EAAA,IAAIC,OAAO,GAAGnB,mBAAmB,GAC1BC,yBAAyB,CAACM,0BAAD,CADhC;AAEA;;AACA,EAAA,IAAIa,YAAY,GAAGT,0CAA0C,GAAGG,iBAA7C,GACZF,0BADY,GAEZX,yBAAyB,CAACM,0BAAD,CAFb,GAGZM,kBAHP;AAIA;;AACA,EAAA,IAAIQ,aAAa,GAAGV,0CAA0C,GAAGI,kBAA7C,GACbH,0BADa,GAElBX,yBAAyB,CAACQ,0BAAD,CAFP,GAGlBI,kBAHF;AAIA;;EACA,IAAIS,2BAA2B,GAAGN,kBAAkB,GAClDf,yBAAyB,CAACS,mBAAD,CADO,GACiB,GADnD;AAGA;;AACA,EAAA,IAAIa,gBAAgB,GAAGN,uCAAuC,GACvDC,6BADgB,GACgBN,0BADhB,GAEhBX,yBAAyB,CAACO,wBAAD,CAFT,GAGrBK,kBAHF;AAIA;;AACA,EAAA,IAAIW,cAAc,GAAGP,uCAAuC,GACtD,QADe,GACJL,0BADI,GAEfX,yBAAyB,CAACQ,0BAAD,CAFV,GAGfI,kBAHN,CArEuD;AA2EvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EACA,OAAOM,OAAO,GAAG,GAAV,GACEC,YADF,GACiB,GADjB,GAEEC,aAFF,GAEkB,GAFlB,GAGEC,2BAHF,GAGgC,GAHhC,GAIEC,gBAJF,GAIqB,GAJrB,GAKEC,cALT;AAMA;;;;","x_google_ignoreList":[0]}
@@ -1,19 +1,18 @@
1
1
  import createExtensionPattern from './createExtensionPattern.js';
2
2
 
3
- // Regexp of all known extension prefixes used by different regions followed by
4
3
  // 1 or more valid digits, for use when parsing.
5
- var EXTN_PATTERN = new RegExp('(?:' + createExtensionPattern() + ')$', 'i');
6
4
 
7
- // Strips any extension (as in, the part of the number dialled after the call is
5
+ var EXTN_PATTERN = new RegExp('(?:' + createExtensionPattern() + ')$', 'i'); // Strips any extension (as in, the part of the number dialled after the call is
8
6
  // connected, usually indicated with extn, ext, x or similar) from the end of
9
7
  // the number, and returns it.
8
+
10
9
  function extractExtension(number) {
11
10
  var start = number.search(EXTN_PATTERN);
12
11
  if (start < 0) {
13
12
  return {};
14
- }
15
- // If we find a potential extension, and the number preceding this is a viable
13
+ } // If we find a potential extension, and the number preceding this is a viable
16
14
  // number, we assume it is an extension.
15
+
17
16
  var numberWithoutExtension = number.slice(0, start);
18
17
  var matches = number.match(EXTN_PATTERN);
19
18
  var i = 1;
@@ -1 +1 @@
1
- {"version":3,"file":"extractExtension.js","sources":["../../../../../../node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js"],"sourcesContent":["import createExtensionPattern from './createExtensionPattern.js';\n\n// Regexp of all known extension prefixes used by different regions followed by\n// 1 or more valid digits, for use when parsing.\nvar EXTN_PATTERN = new RegExp('(?:' + createExtensionPattern() + ')$', 'i');\n\n// Strips any extension (as in, the part of the number dialled after the call is\n// connected, usually indicated with extn, ext, x or similar) from the end of\n// the number, and returns it.\nexport default function extractExtension(number) {\n var start = number.search(EXTN_PATTERN);\n if (start < 0) {\n return {};\n }\n // If we find a potential extension, and the number preceding this is a viable\n // number, we assume it is an extension.\n var numberWithoutExtension = number.slice(0, start);\n var matches = number.match(EXTN_PATTERN);\n var i = 1;\n while (i < matches.length) {\n if (matches[i]) {\n return {\n number: numberWithoutExtension,\n ext: matches[i]\n };\n }\n i++;\n }\n}\n//# sourceMappingURL=extractExtension.js.map"],"names":["EXTN_PATTERN","RegExp","createExtensionPattern","extractExtension","number","start","search","numberWithoutExtension","slice","matches","match","i","length","ext"],"mappings":";;AAEA;AACA;AACA,IAAMA,YAAY,GAAG,IAAIC,MAAM,CAAC,KAAK,GAAGC,sBAAsB,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC;;AAE7E;AACA;AACA;AACe,SAASC,gBAAgBA,CAACC,MAAM,EAAE;AAChD,EAAA,IAAMC,KAAK,GAAGD,MAAM,CAACE,MAAM,CAACN,YAAY,CAAC;EACzC,IAAIK,KAAK,GAAG,CAAC,EAAE;AACd,IAAA,OAAO,EAAE;AACV,EAAA;AACA;AACA;EACA,IAAME,sBAAsB,GAAGH,MAAM,CAACI,KAAK,CAAC,CAAC,EAAEH,KAAK,CAAC;AACrD,EAAA,IAAMI,OAAO,GAAGL,MAAM,CAACM,KAAK,CAACV,YAAY,CAAC;EAC1C,IAAIW,CAAC,GAAG,CAAC;AACT,EAAA,OAAOA,CAAC,GAAGF,OAAO,CAACG,MAAM,EAAE;AAC1B,IAAA,IAAIH,OAAO,CAACE,CAAC,CAAC,EAAE;MACf,OAAO;AACNP,QAAAA,MAAM,EAAEG,sBAAsB;QAC9BM,GAAG,EAAEJ,OAAO,CAACE,CAAC;OACd;AACF,IAAA;AACAA,IAAAA,CAAC,EAAE;AACJ,EAAA;AACD;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"extractExtension.js","sources":["../../../../../../node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js"],"sourcesContent":["import createExtensionPattern from './createExtensionPattern.js'; // Regexp of all known extension prefixes used by different regions followed by\n// 1 or more valid digits, for use when parsing.\n\nvar EXTN_PATTERN = new RegExp('(?:' + createExtensionPattern() + ')$', 'i'); // Strips any extension (as in, the part of the number dialled after the call is\n// connected, usually indicated with extn, ext, x or similar) from the end of\n// the number, and returns it.\n\nexport default function extractExtension(number) {\n var start = number.search(EXTN_PATTERN);\n\n if (start < 0) {\n return {};\n } // If we find a potential extension, and the number preceding this is a viable\n // number, we assume it is an extension.\n\n\n var numberWithoutExtension = number.slice(0, start);\n var matches = number.match(EXTN_PATTERN);\n var i = 1;\n\n while (i < matches.length) {\n if (matches[i]) {\n return {\n number: numberWithoutExtension,\n ext: matches[i]\n };\n }\n\n i++;\n }\n}\n//# sourceMappingURL=extractExtension.js.map"],"names":["EXTN_PATTERN","RegExp","createExtensionPattern","extractExtension","number","start","search","numberWithoutExtension","slice","matches","match","i","length","ext"],"mappings":";;AAGA;;AACA,IAAMA,YAAY,GAAG,IAAIC,MAAJ,CAAW,KAAA,GAAQC,sBAAsB,EAA9B,GAAmC,IAA9C,EAAoD,GAApD,CAArB;AAGA;AACA;;AACe,SAASC,gBAATA,CAA0BC,MAA1B,EAAkC;AAChD,EAAA,IAAMC,KAAK,GAAGD,MAAM,CAACE,MAAP,CAAcN,YAAd,CAAd;EACA,IAAIK,KAAK,GAAG,CAAZ,EAAe;AACd,IAAA,OAAO,EAAP;AACA,EAAA,CAJ+C;AAMhD;;EACA,IAAME,sBAAsB,GAAGH,MAAM,CAACI,KAAP,CAAa,CAAb,EAAgBH,KAAhB,CAA/B;AACA,EAAA,IAAMI,OAAO,GAAGL,MAAM,CAACM,KAAP,CAAaV,YAAb,CAAhB;EACA,IAAIW,CAAC,GAAG,CAAR;AACA,EAAA,OAAOA,CAAC,GAAGF,OAAO,CAACG,MAAnB,EAA2B;AAC1B,IAAA,IAAIH,OAAO,CAACE,CAAD,CAAX,EAAgB;MACf,OAAO;AACNP,QAAAA,MAAM,EAAEG,sBADF;QAENM,GAAG,EAAEJ,OAAO,CAACE,CAAD;OAFb;AAIA,IAAA;IACDA,CAAC,EAAA;AACD,EAAA;AACD;;;;","x_google_ignoreList":[0]}
@@ -10,38 +10,37 @@ import { MAX_LENGTH_COUNTRY_CODE } from '../constants.js';
10
10
  * a national prefix, carrier code, and national
11
11
  * (significant) number.
12
12
  * @param {string} number — Phone number digits (possibly with a `+`).
13
- * @param {string} [country] — Country.
14
- * @param {string} [defaultCountry] — Default country.
15
- * @param {string} [defaultCallingCode] — Default calling code (some phone numbering plans are non-geographic).
13
+ * @param {string} [country] — Default country.
14
+ * @param {string} [callingCode] — Default calling code (some phone numbering plans are non-geographic).
16
15
  * @param {object} metadata
17
16
  * @return {object} `{ countryCallingCodeSource: string?, countryCallingCode: string?, number: string }`
18
17
  * @example
19
18
  * // Returns `{ countryCallingCode: "1", number: "2133734253" }`.
20
- * extractCountryCallingCode('2133734253', null, 'US', null, metadata)
21
- * extractCountryCallingCode('2133734253', null, null, '1', metadata)
22
- * extractCountryCallingCode('+12133734253', null, null, null, metadata)
23
- * extractCountryCallingCode('+12133734253', null, 'RU', null, metadata)
19
+ * extractCountryCallingCode('2133734253', 'US', null, metadata)
20
+ * extractCountryCallingCode('2133734253', null, '1', metadata)
21
+ * extractCountryCallingCode('+12133734253', null, null, metadata)
22
+ * extractCountryCallingCode('+12133734253', 'RU', null, metadata)
24
23
  */
25
- function extractCountryCallingCode(number, country, defaultCountry, defaultCallingCode, metadata) {
24
+
25
+ function extractCountryCallingCode(number, country, callingCode, metadata) {
26
26
  if (!number) {
27
27
  return {};
28
28
  }
29
- var isNumberWithIddPrefix;
30
-
31
- // If this is not an international phone number,
29
+ var isNumberWithIddPrefix; // If this is not an international phone number,
32
30
  // then either extract an "IDD" prefix, or extract a
33
31
  // country calling code from a number by autocorrecting it
34
32
  // by prepending a leading `+` in cases when it starts
35
33
  // with the country calling code.
36
34
  // https://wikitravel.org/en/International_dialling_prefix
37
35
  // https://github.com/catamphetamine/libphonenumber-js/issues/376
36
+
38
37
  if (number[0] !== '+') {
39
38
  // Convert an "out-of-country" dialing phone number
40
39
  // to a proper international phone number.
41
- var numberWithoutIDD = stripIddPrefix(number, country || defaultCountry, defaultCallingCode, metadata);
42
- // If an IDD prefix was stripped then
40
+ var numberWithoutIDD = stripIddPrefix(number, country, callingCode, metadata); // If an IDD prefix was stripped then
43
41
  // convert the number to international one
44
42
  // for subsequent parsing.
43
+
45
44
  if (numberWithoutIDD && numberWithoutIDD !== number) {
46
45
  isNumberWithIddPrefix = true;
47
46
  number = '+' + numberWithoutIDD;
@@ -50,8 +49,8 @@ function extractCountryCallingCode(number, country, defaultCountry, defaultCalli
50
49
  // for the default country. If so, we remove the country calling code,
51
50
  // and do some checks on the validity of the number before and after.
52
51
  // https://github.com/catamphetamine/libphonenumber-js/issues/376
53
- if (country || defaultCountry || defaultCallingCode) {
54
- var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadata),
52
+ if (country || callingCode) {
53
+ var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata),
55
54
  countryCallingCode = _extractCountryCallin.countryCallingCode,
56
55
  shorterNumber = _extractCountryCallin.number;
57
56
  if (countryCallingCode) {
@@ -68,17 +67,12 @@ function extractCountryCallingCode(number, country, defaultCountry, defaultCalli
68
67
  number: number
69
68
  };
70
69
  }
71
- }
70
+ } // Fast abortion: country codes do not begin with a '0'
72
71
 
73
- // `number` can only be international at this point.
74
-
75
- // Fast abortion: country codes do not begin with a '0'
76
72
  if (number[1] === '0') {
77
73
  return {};
78
74
  }
79
- metadata = new Metadata(metadata);
80
-
81
- // The thing with country phone codes
75
+ metadata = new Metadata(metadata); // The thing with country phone codes
82
76
  // is that they are orthogonal to each other
83
77
  // i.e. there's no such country phone code A
84
78
  // for which country phone code B exists
@@ -87,6 +81,7 @@ function extractCountryCallingCode(number, country, defaultCountry, defaultCalli
87
81
  // if a valid country code is found,
88
82
  // that means that it is the country code.
89
83
  //
84
+
90
85
  var i = 2;
91
86
  while (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {
92
87
  var _countryCallingCode = number.slice(1, i);
@@ -101,9 +96,7 @@ function extractCountryCallingCode(number, country, defaultCountry, defaultCalli
101
96
  i++;
102
97
  }
103
98
  return {};
104
- }
105
-
106
- // The possible values for the returned `countryCallingCodeSource` are:
99
+ } // The possible values for the returned `countryCallingCodeSource` are:
107
100
  //
108
101
  // Copy-pasted from:
109
102
  // https://github.com/google/libphonenumber/blob/master/resources/phonenumber.proto
@@ -1 +1 @@
1
- {"version":3,"file":"extractCountryCallingCode.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js"],"sourcesContent":["import stripIddPrefix from './stripIddPrefix.js';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js';\nimport Metadata from '../metadata.js';\nimport { MAX_LENGTH_COUNTRY_CODE } from '../constants.js';\n\n/**\r\n * Converts a phone number digits (possibly with a `+`)\r\n * into a calling code and the rest phone number digits.\r\n * The \"rest phone number digits\" could include\r\n * a national prefix, carrier code, and national\r\n * (significant) number.\r\n * @param {string} number — Phone number digits (possibly with a `+`).\r\n * @param {string} [country] — Country.\r\n * @param {string} [defaultCountry] — Default country.\r\n * @param {string} [defaultCallingCode] — Default calling code (some phone numbering plans are non-geographic).\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCodeSource: string?, countryCallingCode: string?, number: string }`\r\n * @example\r\n * // Returns `{ countryCallingCode: \"1\", number: \"2133734253\" }`.\r\n * extractCountryCallingCode('2133734253', null, 'US', null, metadata)\r\n * extractCountryCallingCode('2133734253', null, null, '1', metadata)\r\n * extractCountryCallingCode('+12133734253', null, null, null, metadata)\r\n * extractCountryCallingCode('+12133734253', null, 'RU', null, metadata)\r\n */\nexport default function extractCountryCallingCode(number, country, defaultCountry, defaultCallingCode, metadata) {\n if (!number) {\n return {};\n }\n var isNumberWithIddPrefix;\n\n // If this is not an international phone number,\n // then either extract an \"IDD\" prefix, or extract a\n // country calling code from a number by autocorrecting it\n // by prepending a leading `+` in cases when it starts\n // with the country calling code.\n // https://wikitravel.org/en/International_dialling_prefix\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (number[0] !== '+') {\n // Convert an \"out-of-country\" dialing phone number\n // to a proper international phone number.\n var numberWithoutIDD = stripIddPrefix(number, country || defaultCountry, defaultCallingCode, metadata);\n // If an IDD prefix was stripped then\n // convert the number to international one\n // for subsequent parsing.\n if (numberWithoutIDD && numberWithoutIDD !== number) {\n isNumberWithIddPrefix = true;\n number = '+' + numberWithoutIDD;\n } else {\n // Check to see if the number starts with the country calling code\n // for the default country. If so, we remove the country calling code,\n // and do some checks on the validity of the number before and after.\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (country || defaultCountry || defaultCallingCode) {\n var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n shorterNumber = _extractCountryCallin.number;\n if (countryCallingCode) {\n return {\n countryCallingCodeSource: 'FROM_NUMBER_WITHOUT_PLUS_SIGN',\n countryCallingCode: countryCallingCode,\n number: shorterNumber\n };\n }\n }\n return {\n // No need to set it to `UNSPECIFIED`. It can be just `undefined`.\n // countryCallingCodeSource: 'UNSPECIFIED',\n number: number\n };\n }\n }\n\n // `number` can only be international at this point.\n\n // Fast abortion: country codes do not begin with a '0'\n if (number[1] === '0') {\n return {};\n }\n metadata = new Metadata(metadata);\n\n // The thing with country phone codes\n // is that they are orthogonal to each other\n // i.e. there's no such country phone code A\n // for which country phone code B exists\n // where B starts with A.\n // Therefore, while scanning digits,\n // if a valid country code is found,\n // that means that it is the country code.\n //\n var i = 2;\n while (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {\n var _countryCallingCode = number.slice(1, i);\n if (metadata.hasCallingCode(_countryCallingCode)) {\n metadata.selectNumberingPlan(_countryCallingCode);\n return {\n countryCallingCodeSource: isNumberWithIddPrefix ? 'FROM_NUMBER_WITH_IDD' : 'FROM_NUMBER_WITH_PLUS_SIGN',\n countryCallingCode: _countryCallingCode,\n number: number.slice(i)\n };\n }\n i++;\n }\n return {};\n}\n\n// The possible values for the returned `countryCallingCodeSource` are:\n//\n// Copy-pasted from:\n// https://github.com/google/libphonenumber/blob/master/resources/phonenumber.proto\n//\n// // The source from which the country_code is derived. This is not set in the\n// // general parsing method, but in the method that parses and keeps raw_input.\n// // New fields could be added upon request.\n// enum CountryCodeSource {\n// // Default value returned if this is not set, because the phone number was\n// // created using parse, not parseAndKeepRawInput. hasCountryCodeSource will\n// // return false if this is the case.\n// UNSPECIFIED = 0;\n//\n// // The country_code is derived based on a phone number with a leading \"+\",\n// // e.g. the French number \"+33 1 42 68 53 00\".\n// FROM_NUMBER_WITH_PLUS_SIGN = 1;\n//\n// // The country_code is derived based on a phone number with a leading IDD,\n// // e.g. the French number \"011 33 1 42 68 53 00\", as it is dialled from US.\n// FROM_NUMBER_WITH_IDD = 5;\n//\n// // The country_code is derived based on a phone number without a leading\n// // \"+\", e.g. the French number \"33 1 42 68 53 00\" when defaultCountry is\n// // supplied as France.\n// FROM_NUMBER_WITHOUT_PLUS_SIGN = 10;\n//\n// // The country_code is derived NOT based on the phone number itself, but\n// // from the defaultCountry parameter provided in the parsing function by the\n// // clients. This happens mostly for numbers written in the national format\n// // (without country code). For example, this would be set when parsing the\n// // French number \"01 42 68 53 00\", when defaultCountry is supplied as\n// // France.\n// FROM_DEFAULT_COUNTRY = 20;\n// }\n//# sourceMappingURL=extractCountryCallingCode.js.map"],"names":["extractCountryCallingCode","number","country","defaultCountry","defaultCallingCode","metadata","isNumberWithIddPrefix","numberWithoutIDD","stripIddPrefix","_extractCountryCallin","extractCountryCallingCodeFromInternationalNumberWithoutPlusSign","countryCallingCode","shorterNumber","countryCallingCodeSource","Metadata","i","MAX_LENGTH_COUNTRY_CODE","length","_countryCallingCode","slice","hasCallingCode","selectNumberingPlan"],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,yBAAyBA,CAChDC,MAAM,EACNC,OAAO,EACPC,cAAc,EACdC,kBAAkB,EAClBC,QAAQ,EACP;EACD,IAAI,CAACJ,MAAM,EAAE;AACZ,IAAA,OAAO,EAAE;AACV,EAAA;AAEA,EAAA,IAAIK,qBAAqB;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,IAAIL,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;AACtB;AACA;AACA,IAAA,IAAMM,gBAAgB,GAAGC,cAAc,CAACP,MAAM,EAAEC,OAAO,IAAIC,cAAc,EAAEC,kBAAkB,EAAEC,QAAQ,CAAC;AACxG;AACA;AACA;AACA,IAAA,IAAIE,gBAAgB,IAAIA,gBAAgB,KAAKN,MAAM,EAAE;AACpDK,MAAAA,qBAAqB,GAAG,IAAI;MAC5BL,MAAM,GAAG,GAAG,GAAGM,gBAAgB;AAChC,IAAA,CAAC,MAAM;AACN;AACA;AACA;AACA;AACA,MAAA,IAAIL,OAAO,IAAIC,cAAc,IAAIC,kBAAkB,EAAE;AACpD,QAAA,IAAAK,qBAAA,GAGIC,+DAA+D,CAClET,MAAM,EACNC,OAAO,EACPC,cAAc,EACdC,kBAAkB,EAClBC,QACD,CAAC;UARAM,kBAAkB,GAAAF,qBAAA,CAAlBE,kBAAkB;UACVC,aAAa,GAAAH,qBAAA,CAArBR,MAAM;AAQP,QAAA,IAAIU,kBAAkB,EAAE;UACvB,OAAO;AACNE,YAAAA,wBAAwB,EAAE,+BAA+B;AACzDF,YAAAA,kBAAkB,EAAlBA,kBAAkB;AAClBV,YAAAA,MAAM,EAAEW;WACR;AACF,QAAA;AACD,MAAA;MACA,OAAO;AACN;AACA;AACAX,QAAAA,MAAM,EAANA;OACA;AACF,IAAA;AACD,EAAA;;AAEA;;AAEA;AACA,EAAA,IAAIA,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;AACtB,IAAA,OAAO,EAAE;AACV,EAAA;AAEAI,EAAAA,QAAQ,GAAG,IAAIS,QAAQ,CAACT,QAAQ,CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACA,IAAIU,CAAC,GAAG,CAAC;EACT,OAAOA,CAAC,GAAG,CAAC,IAAIC,uBAAuB,IAAID,CAAC,IAAId,MAAM,CAACgB,MAAM,EAAE;IAC9D,IAAMC,mBAAkB,GAAGjB,MAAM,CAACkB,KAAK,CAAC,CAAC,EAAEJ,CAAC,CAAC;AAC7C,IAAA,IAAIV,QAAQ,CAACe,cAAc,CAACF,mBAAkB,CAAC,EAAE;AAChDb,MAAAA,QAAQ,CAACgB,mBAAmB,CAACH,mBAAkB,CAAC;MAChD,OAAO;AACNL,QAAAA,wBAAwB,EAAEP,qBAAqB,GAAG,sBAAsB,GAAG,4BAA4B;AACvGK,QAAAA,kBAAkB,EAAlBO,mBAAkB;AAClBjB,QAAAA,MAAM,EAAEA,MAAM,CAACkB,KAAK,CAACJ,CAAC;OACtB;AACF,IAAA;AACAA,IAAAA,CAAC,EAAE;AACJ,EAAA;AAEA,EAAA,OAAO,EAAE;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"extractCountryCallingCode.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js"],"sourcesContent":["import stripIddPrefix from './stripIddPrefix.js';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js';\nimport Metadata from '../metadata.js';\nimport { MAX_LENGTH_COUNTRY_CODE } from '../constants.js';\n/**\r\n * Converts a phone number digits (possibly with a `+`)\r\n * into a calling code and the rest phone number digits.\r\n * The \"rest phone number digits\" could include\r\n * a national prefix, carrier code, and national\r\n * (significant) number.\r\n * @param {string} number — Phone number digits (possibly with a `+`).\r\n * @param {string} [country] — Default country.\r\n * @param {string} [callingCode] — Default calling code (some phone numbering plans are non-geographic).\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCodeSource: string?, countryCallingCode: string?, number: string }`\r\n * @example\r\n * // Returns `{ countryCallingCode: \"1\", number: \"2133734253\" }`.\r\n * extractCountryCallingCode('2133734253', 'US', null, metadata)\r\n * extractCountryCallingCode('2133734253', null, '1', metadata)\r\n * extractCountryCallingCode('+12133734253', null, null, metadata)\r\n * extractCountryCallingCode('+12133734253', 'RU', null, metadata)\r\n */\n\nexport default function extractCountryCallingCode(number, country, callingCode, metadata) {\n if (!number) {\n return {};\n }\n\n var isNumberWithIddPrefix; // If this is not an international phone number,\n // then either extract an \"IDD\" prefix, or extract a\n // country calling code from a number by autocorrecting it\n // by prepending a leading `+` in cases when it starts\n // with the country calling code.\n // https://wikitravel.org/en/International_dialling_prefix\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n\n if (number[0] !== '+') {\n // Convert an \"out-of-country\" dialing phone number\n // to a proper international phone number.\n var numberWithoutIDD = stripIddPrefix(number, country, callingCode, metadata); // If an IDD prefix was stripped then\n // convert the number to international one\n // for subsequent parsing.\n\n if (numberWithoutIDD && numberWithoutIDD !== number) {\n isNumberWithIddPrefix = true;\n number = '+' + numberWithoutIDD;\n } else {\n // Check to see if the number starts with the country calling code\n // for the default country. If so, we remove the country calling code,\n // and do some checks on the validity of the number before and after.\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (country || callingCode) {\n var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n shorterNumber = _extractCountryCallin.number;\n\n if (countryCallingCode) {\n return {\n countryCallingCodeSource: 'FROM_NUMBER_WITHOUT_PLUS_SIGN',\n countryCallingCode: countryCallingCode,\n number: shorterNumber\n };\n }\n }\n\n return {\n // No need to set it to `UNSPECIFIED`. It can be just `undefined`.\n // countryCallingCodeSource: 'UNSPECIFIED',\n number: number\n };\n }\n } // Fast abortion: country codes do not begin with a '0'\n\n\n if (number[1] === '0') {\n return {};\n }\n\n metadata = new Metadata(metadata); // The thing with country phone codes\n // is that they are orthogonal to each other\n // i.e. there's no such country phone code A\n // for which country phone code B exists\n // where B starts with A.\n // Therefore, while scanning digits,\n // if a valid country code is found,\n // that means that it is the country code.\n //\n\n var i = 2;\n\n while (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {\n var _countryCallingCode = number.slice(1, i);\n\n if (metadata.hasCallingCode(_countryCallingCode)) {\n metadata.selectNumberingPlan(_countryCallingCode);\n return {\n countryCallingCodeSource: isNumberWithIddPrefix ? 'FROM_NUMBER_WITH_IDD' : 'FROM_NUMBER_WITH_PLUS_SIGN',\n countryCallingCode: _countryCallingCode,\n number: number.slice(i)\n };\n }\n\n i++;\n }\n\n return {};\n} // The possible values for the returned `countryCallingCodeSource` are:\n//\n// Copy-pasted from:\n// https://github.com/google/libphonenumber/blob/master/resources/phonenumber.proto\n//\n// // The source from which the country_code is derived. This is not set in the\n// // general parsing method, but in the method that parses and keeps raw_input.\n// // New fields could be added upon request.\n// enum CountryCodeSource {\n// // Default value returned if this is not set, because the phone number was\n// // created using parse, not parseAndKeepRawInput. hasCountryCodeSource will\n// // return false if this is the case.\n// UNSPECIFIED = 0;\n//\n// // The country_code is derived based on a phone number with a leading \"+\",\n// // e.g. the French number \"+33 1 42 68 53 00\".\n// FROM_NUMBER_WITH_PLUS_SIGN = 1;\n//\n// // The country_code is derived based on a phone number with a leading IDD,\n// // e.g. the French number \"011 33 1 42 68 53 00\", as it is dialled from US.\n// FROM_NUMBER_WITH_IDD = 5;\n//\n// // The country_code is derived based on a phone number without a leading\n// // \"+\", e.g. the French number \"33 1 42 68 53 00\" when defaultCountry is\n// // supplied as France.\n// FROM_NUMBER_WITHOUT_PLUS_SIGN = 10;\n//\n// // The country_code is derived NOT based on the phone number itself, but\n// // from the defaultCountry parameter provided in the parsing function by the\n// // clients. This happens mostly for numbers written in the national format\n// // (without country code). For example, this would be set when parsing the\n// // French number \"01 42 68 53 00\", when defaultCountry is supplied as\n// // France.\n// FROM_DEFAULT_COUNTRY = 20;\n// }\n//# sourceMappingURL=extractCountryCallingCode.js.map"],"names":["extractCountryCallingCode","number","country","callingCode","metadata","isNumberWithIddPrefix","numberWithoutIDD","stripIddPrefix","_extractCountryCallin","extractCountryCallingCodeFromInternationalNumberWithoutPlusSign","countryCallingCode","shorterNumber","countryCallingCodeSource","Metadata","i","MAX_LENGTH_COUNTRY_CODE","length","_countryCallingCode","slice","hasCallingCode","selectNumberingPlan"],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASA,yBAATA,CACdC,MADc,EAEdC,OAFc,EAGdC,WAHc,EAIdC,QAJc,EAKb;EACD,IAAI,CAACH,MAAL,EAAa;AACZ,IAAA,OAAO,EAAP;AACA,EAAA;EAED,IAAII,qBAAJ,CALC;AAQD;AACA;AACA;AACA;AACA;AACA;;AACA,EAAA,IAAIJ,MAAM,CAAC,CAAD,CAAN,KAAc,GAAlB,EAAuB;AACtB;AACA;AACA,IAAA,IAAMK,gBAAgB,GAAGC,cAAc,CAACN,MAAD,EAASC,OAAT,EAAkBC,WAAlB,EAA+BC,QAA/B,CAAvC,CAHsB;AAKtB;AACA;;AACA,IAAA,IAAIE,gBAAgB,IAAIA,gBAAgB,KAAKL,MAA7C,EAAqD;AACpDI,MAAAA,qBAAqB,GAAG,IAAxB;MACAJ,MAAM,GAAG,MAAMK,gBAAf;AACA,IAAA,CAHD,MAGO;AACN;AACA;AACA;AACA;MACA,IAAIJ,OAAO,IAAIC,WAAf,EAA4B;QAC3B,IAAAK,qBAAA,GAGIC,+DAA+D,CAClER,MADkE,EAElEC,OAFkE,EAGlEC,WAHkE,EAIlEC,QAJkE,CAHnE;UACCM,kBADD,GAAAF,qBAAA,CACCE,kBADD;UAESC,aAFT,GAAAH,qBAAA,CAECP,MAFD;AASA,QAAA,IAAIS,kBAAJ,EAAwB;UACvB,OAAO;AACNE,YAAAA,wBAAwB,EAAE,+BADpB;AAENF,YAAAA,kBAAkB,EAAlBA,kBAFM;AAGNT,YAAAA,MAAM,EAAEU;WAHT;AAKA,QAAA;AACD,MAAA;MACD,OAAO;AACN;AACA;AACAV,QAAAA,MAAM,EAANA;OAHD;AAKA,IAAA;AACD,EAAA,CArDA;;AAwDD,EAAA,IAAIA,MAAM,CAAC,CAAD,CAAN,KAAc,GAAlB,EAAuB;AACtB,IAAA,OAAO,EAAP;AACA,EAAA;AAEDG,EAAAA,QAAQ,GAAG,IAAIS,QAAJ,CAAaT,QAAb,CAAX,CA5DC;AA+DD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EACA,IAAIU,CAAC,GAAG,CAAR;EACA,OAAOA,CAAC,GAAG,CAAJ,IAASC,uBAAT,IAAoCD,CAAC,IAAIb,MAAM,CAACe,MAAvD,EAA+D;IAC9D,IAAMC,mBAAkB,GAAGhB,MAAM,CAACiB,KAAP,CAAa,CAAb,EAAgBJ,CAAhB,CAA3B;AACA,IAAA,IAAIV,QAAQ,CAACe,cAAT,CAAwBF,mBAAxB,CAAJ,EAAiD;MAChDb,QAAQ,CAACgB,mBAAT,CAA6BH,mBAA7B,CAAA;MACA,OAAO;AACNL,QAAAA,wBAAwB,EAAEP,qBAAqB,GAAG,sBAAH,GAA4B,4BADrE;AAENK,QAAAA,kBAAkB,EAAlBO,mBAFM;AAGNhB,QAAAA,MAAM,EAAEA,MAAM,CAACiB,KAAP,CAAaJ,CAAb;OAHT;AAKA,IAAA;IACDA,CAAC,EAAA;AACD,EAAA;AAED,EAAA,OAAO,EAAP;AACA;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;","x_google_ignoreList":[0]}
@@ -7,24 +7,22 @@ import checkNumberLength from './checkNumberLength.js';
7
7
  * Sometimes some people incorrectly input international phone numbers
8
8
  * without the leading `+`. This function corrects such input.
9
9
  * @param {string} number — Phone number digits.
10
- * @param {string} [country] — Exact country of the phone number.
11
- * @param {string} [defaultCountry]
12
- * @param {string} [defaultCallingCode]
10
+ * @param {string?} country
11
+ * @param {string?} callingCode
13
12
  * @param {object} metadata
14
13
  * @return {object} `{ countryCallingCode: string?, number: string }`.
15
14
  */
16
- function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadata) {
17
- var countryCallingCode = country || defaultCountry ? getCountryCallingCode(country || defaultCountry, metadata) : defaultCallingCode;
15
+
16
+ function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata) {
17
+ var countryCallingCode = country ? getCountryCallingCode(country, metadata) : callingCode;
18
18
  if (number.indexOf(countryCallingCode) === 0) {
19
19
  metadata = new Metadata(metadata);
20
- metadata.selectNumberingPlan(country || defaultCountry, countryCallingCode);
20
+ metadata.selectNumberingPlan(country, callingCode);
21
21
  var possibleShorterNumber = number.slice(countryCallingCode.length);
22
- var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, country, metadata),
22
+ var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, metadata),
23
23
  possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;
24
- var _extractNationalNumbe2 = extractNationalNumber(number, country, metadata),
25
- nationalNumber = _extractNationalNumbe2.nationalNumber;
26
-
27
- // If the number was not valid before but is valid now,
24
+ var _extractNationalNumbe2 = extractNationalNumber(number, metadata),
25
+ nationalNumber = _extractNationalNumbe2.nationalNumber; // If the number was not valid before but is valid now,
28
26
  // or if it was too long before, we consider the number
29
27
  // with the country calling code stripped to be a better result
30
28
  // and keep that instead.
@@ -32,7 +30,8 @@ function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number,
32
30
  // so if a number starts with `49`, it could be both a valid
33
31
  // national German number or an international number without
34
32
  // a leading `+`.
35
- if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, country, metadata) === 'TOO_LONG') {
33
+
34
+ if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, metadata) === 'TOO_LONG') {
36
35
  return {
37
36
  countryCallingCode: countryCallingCode,
38
37
  number: possibleShorterNumber
@@ -1 +1 @@
1
- {"version":3,"file":"extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js"],"sourcesContent":["import Metadata from '../metadata.js';\nimport matchesEntirely from './matchesEntirely.js';\nimport extractNationalNumber from './extractNationalNumber.js';\nimport checkNumberLength from './checkNumberLength.js';\nimport getCountryCallingCode from '../getCountryCallingCode.js';\n\n/**\r\n * Sometimes some people incorrectly input international phone numbers\r\n * without the leading `+`. This function corrects such input.\r\n * @param {string} number — Phone number digits.\r\n * @param {string} [country] — Exact country of the phone number.\r\n * @param {string} [defaultCountry]\r\n * @param {string} [defaultCallingCode]\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCode: string?, number: string }`.\r\n */\nexport default function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadata) {\n var countryCallingCode = country || defaultCountry ? getCountryCallingCode(country || defaultCountry, metadata) : defaultCallingCode;\n if (number.indexOf(countryCallingCode) === 0) {\n metadata = new Metadata(metadata);\n metadata.selectNumberingPlan(country || defaultCountry, countryCallingCode);\n var possibleShorterNumber = number.slice(countryCallingCode.length);\n var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, country, metadata),\n possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;\n var _extractNationalNumbe2 = extractNationalNumber(number, country, metadata),\n nationalNumber = _extractNationalNumbe2.nationalNumber;\n\n // If the number was not valid before but is valid now,\n // or if it was too long before, we consider the number\n // with the country calling code stripped to be a better result\n // and keep that instead.\n // For example, in Germany (+49), `49` is a valid area code,\n // so if a number starts with `49`, it could be both a valid\n // national German number or an international number without\n // a leading `+`.\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, country, metadata) === 'TOO_LONG') {\n return {\n countryCallingCode: countryCallingCode,\n number: possibleShorterNumber\n };\n }\n }\n return {\n number: number\n };\n}\n//# sourceMappingURL=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map"],"names":["extractCountryCallingCodeFromInternationalNumberWithoutPlusSign","number","country","defaultCountry","defaultCallingCode","metadata","countryCallingCode","getCountryCallingCode","indexOf","Metadata","selectNumberingPlan","possibleShorterNumber","slice","length","_extractNationalNumbe","extractNationalNumber","possibleShorterNationalNumber","nationalNumber","_extractNationalNumbe2","matchesEntirely","nationalNumberPattern","checkNumberLength"],"mappings":";;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,+DAA+DA,CACtFC,MAAM,EACNC,OAAO,EACPC,cAAc,EACdC,kBAAkB,EAClBC,QAAQ,EACP;AACD,EAAA,IAAMC,kBAAkB,GAAGJ,OAAO,IAAIC,cAAc,GACjDI,qBAAqB,CAACL,OAAO,IAAIC,cAAc,EAAEE,QAAQ,CAAC,GAC1DD,kBAAkB;EAErB,IAAIH,MAAM,CAACO,OAAO,CAACF,kBAAkB,CAAC,KAAK,CAAC,EAAE;AAC7CD,IAAAA,QAAQ,GAAG,IAAII,QAAQ,CAACJ,QAAQ,CAAC;IACjCA,QAAQ,CAACK,mBAAmB,CAACR,OAAO,IAAIC,cAAc,EAAEG,kBAAkB,CAAC;IAE3E,IAAMK,qBAAqB,GAAGV,MAAM,CAACW,KAAK,CAACN,kBAAkB,CAACO,MAAM,CAAC;IAErE,IAAAC,qBAAA,GAEIC,qBAAqB,CACxBJ,qBAAqB,EACrBT,OAAO,EACPG,QACD,CAAC;MALgBW,6BAA6B,GAAAF,qBAAA,CAA7CG,cAAc;IAOf,IAAAC,sBAAA,GAEIH,qBAAqB,CACxBd,MAAM,EACNC,OAAO,EACPG,QACD,CAAC;MALAY,cAAc,GAAAC,sBAAA,CAAdD,cAAc;;AAOf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAA,IAEE,CAACE,eAAe,CAACF,cAAc,EAAEZ,QAAQ,CAACe,qBAAqB,EAAE,CAAC,IAClED,eAAe,CAACH,6BAA6B,EAAEX,QAAQ,CAACe,qBAAqB,EAAE,CAAC,IAGjFC,iBAAiB,CAACJ,cAAc,EAAEf,OAAO,EAAEG,QAAQ,CAAC,KAAK,UAAU,EAClE;MACD,OAAO;AACNC,QAAAA,kBAAkB,EAAlBA,kBAAkB;AAClBL,QAAAA,MAAM,EAAEU;OACR;AACF,IAAA;AACD,EAAA;EAEA,OAAO;AAAEV,IAAAA,MAAM,EAANA;GAAQ;AAClB;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js"],"sourcesContent":["import Metadata from '../metadata.js';\nimport matchesEntirely from './matchesEntirely.js';\nimport extractNationalNumber from './extractNationalNumber.js';\nimport checkNumberLength from './checkNumberLength.js';\nimport getCountryCallingCode from '../getCountryCallingCode.js';\n/**\r\n * Sometimes some people incorrectly input international phone numbers\r\n * without the leading `+`. This function corrects such input.\r\n * @param {string} number — Phone number digits.\r\n * @param {string?} country\r\n * @param {string?} callingCode\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCode: string?, number: string }`.\r\n */\n\nexport default function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata) {\n var countryCallingCode = country ? getCountryCallingCode(country, metadata) : callingCode;\n\n if (number.indexOf(countryCallingCode) === 0) {\n metadata = new Metadata(metadata);\n metadata.selectNumberingPlan(country, callingCode);\n var possibleShorterNumber = number.slice(countryCallingCode.length);\n\n var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, metadata),\n possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;\n\n var _extractNationalNumbe2 = extractNationalNumber(number, metadata),\n nationalNumber = _extractNationalNumbe2.nationalNumber; // If the number was not valid before but is valid now,\n // or if it was too long before, we consider the number\n // with the country calling code stripped to be a better result\n // and keep that instead.\n // For example, in Germany (+49), `49` is a valid area code,\n // so if a number starts with `49`, it could be both a valid\n // national German number or an international number without\n // a leading `+`.\n\n\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, metadata) === 'TOO_LONG') {\n return {\n countryCallingCode: countryCallingCode,\n number: possibleShorterNumber\n };\n }\n }\n\n return {\n number: number\n };\n}\n//# sourceMappingURL=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map"],"names":["extractCountryCallingCodeFromInternationalNumberWithoutPlusSign","number","country","callingCode","metadata","countryCallingCode","getCountryCallingCode","indexOf","Metadata","selectNumberingPlan","possibleShorterNumber","slice","length","_extractNationalNumbe","extractNationalNumber","possibleShorterNationalNumber","nationalNumber","_extractNationalNumbe2","matchesEntirely","nationalNumberPattern","checkNumberLength"],"mappings":";;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASA,+DAATA,CACdC,MADc,EAEdC,OAFc,EAGdC,WAHc,EAIdC,QAJc,EAKb;EACD,IAAMC,kBAAkB,GAAGH,OAAO,GAAGI,qBAAqB,CAACJ,OAAD,EAAUE,QAAV,CAAxB,GAA8CD,WAAhF;AACA,EAAA,IAAIF,MAAM,CAACM,OAAP,CAAeF,kBAAf,CAAA,KAAuC,CAA3C,EAA8C;AAC7CD,IAAAA,QAAQ,GAAG,IAAII,QAAJ,CAAaJ,QAAb,CAAX;AACAA,IAAAA,QAAQ,CAACK,mBAAT,CAA6BP,OAA7B,EAAsCC,WAAtC,CAAA;IACA,IAAMO,qBAAqB,GAAGT,MAAM,CAACU,KAAP,CAAaN,kBAAkB,CAACO,MAAhC,CAA9B;AACA,IAAA,IAAAC,qBAAA,GAEIC,qBAAqB,CACxBJ,qBADwB,EAExBN,QAFwB,CAFzB;MACiBW,6BADjB,GAAAF,qBAAA,CACCG,cADD;AAMA,IAAA,IAAAC,sBAAA,GAEIH,qBAAqB,CACxBb,MADwB,EAExBG,QAFwB,CAFzB;AACCY,MAAAA,cADD,GAAAC,sBAAA,CACCD,cADD,CAV6C;AAiB7C;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAA,IAEE,CAACE,eAAe,CAACF,cAAD,EAAiBZ,QAAQ,CAACe,qBAAT,EAAjB,CAAhB,IAEAD,eAAe,CAACH,6BAAD,EAAgCX,QAAQ,CAACe,qBAAT,EAAhC,CAHhB,IAMAC,iBAAiB,CAACJ,cAAD,EAAiBZ,QAAjB,CAAjB,KAAgD,UAPjD,EAQE;MACD,OAAO;AACNC,QAAAA,kBAAkB,EAAlBA,kBADM;AAENJ,QAAAA,MAAM,EAAES;OAFT;AAIA,IAAA;AACD,EAAA;EACD,OAAO;AAAET,IAAAA,MAAM,EAANA;GAAT;AACA;;;;","x_google_ignoreList":[0]}
@@ -6,6 +6,7 @@ import ParseError from '../ParseError.js';
6
6
  * @param {string} nationalNumber
7
7
  * @return {}
8
8
  */
9
+
9
10
  function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {
10
11
  var extractFormattedPhoneNumber = _ref.extractFormattedPhoneNumber;
11
12
  var phoneContext = extractPhoneContext(numberToParse);
@@ -18,24 +19,23 @@ function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse,
18
19
  // (this strips leading characters that could not be the start of a phone number)
19
20
  phoneNumberString = extractFormattedPhoneNumber(numberToParse) || '';
20
21
  } else {
21
- phoneNumberString = '';
22
-
23
- // If the phone context contains a phone number prefix, we need to capture
22
+ phoneNumberString = ''; // If the phone context contains a phone number prefix, we need to capture
24
23
  // it, whereas domains will be ignored.
24
+
25
25
  if (phoneContext.charAt(0) === PLUS_SIGN) {
26
26
  phoneNumberString += phoneContext;
27
- }
28
-
29
- // Now append everything between the "tel:" prefix and the phone-context.
27
+ } // Now append everything between the "tel:" prefix and the phone-context.
30
28
  // This should include the national number, an optional extension or
31
29
  // isdn-subaddress component. Note we also handle the case when "tel:" is
32
30
  // missing, as we have seen in some of the phone number inputs.
33
31
  // In that case, we append everything from the beginning.
32
+
34
33
  var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);
35
- var indexOfNationalNumber;
36
- // RFC 3966 "tel:" prefix is preset at this stage because
34
+ var indexOfNationalNumber; // RFC 3966 "tel:" prefix is preset at this stage because
37
35
  // `isPhoneContextValid()` requires it to be present.
36
+
38
37
  /* istanbul ignore else */
38
+
39
39
  if (indexOfRfc3966Prefix >= 0) {
40
40
  indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;
41
41
  } else {
@@ -43,16 +43,14 @@ function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse,
43
43
  }
44
44
  var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);
45
45
  phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);
46
- }
47
-
48
- // Delete the isdn-subaddress and everything after it if it is present.
46
+ } // Delete the isdn-subaddress and everything after it if it is present.
49
47
  // Note extension won't appear at the same time with isdn-subaddress
50
48
  // according to paragraph 5.3 of the RFC3966 spec.
49
+
51
50
  var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);
52
51
  if (indexOfIsdn > 0) {
53
52
  phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);
54
- }
55
- // If both phone context and isdn-subaddress are absent but other
53
+ } // If both phone context and isdn-subaddress are absent but other
56
54
  // parameters are present, the parameters are left in nationalNumber.
57
55
  // This is because we are concerned about deleting content from a potential
58
56
  // number string when there is no strong evidence that the number is
@@ -1 +1 @@
1
- {"version":3,"file":"extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js"],"sourcesContent":["import extractPhoneContext, { isPhoneContextValid, PLUS_SIGN, RFC3966_PREFIX_, RFC3966_PHONE_CONTEXT_, RFC3966_ISDN_SUBADDRESS_ } from './extractPhoneContext.js';\nimport ParseError from '../ParseError.js';\n\n/**\r\n * @param {string} numberToParse\r\n * @param {string} nationalNumber\r\n * @return {}\r\n */\nexport default function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {\n var extractFormattedPhoneNumber = _ref.extractFormattedPhoneNumber;\n var phoneContext = extractPhoneContext(numberToParse);\n if (!isPhoneContextValid(phoneContext)) {\n throw new ParseError('NOT_A_NUMBER');\n }\n var phoneNumberString;\n if (phoneContext === null) {\n // Extract a possible number from the string passed in.\n // (this strips leading characters that could not be the start of a phone number)\n phoneNumberString = extractFormattedPhoneNumber(numberToParse) || '';\n } else {\n phoneNumberString = '';\n\n // If the phone context contains a phone number prefix, we need to capture\n // it, whereas domains will be ignored.\n if (phoneContext.charAt(0) === PLUS_SIGN) {\n phoneNumberString += phoneContext;\n }\n\n // Now append everything between the \"tel:\" prefix and the phone-context.\n // This should include the national number, an optional extension or\n // isdn-subaddress component. Note we also handle the case when \"tel:\" is\n // missing, as we have seen in some of the phone number inputs.\n // In that case, we append everything from the beginning.\n var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);\n var indexOfNationalNumber;\n // RFC 3966 \"tel:\" prefix is preset at this stage because\n // `isPhoneContextValid()` requires it to be present.\n /* istanbul ignore else */\n if (indexOfRfc3966Prefix >= 0) {\n indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;\n } else {\n indexOfNationalNumber = 0;\n }\n var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);\n phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);\n }\n\n // Delete the isdn-subaddress and everything after it if it is present.\n // Note extension won't appear at the same time with isdn-subaddress\n // according to paragraph 5.3 of the RFC3966 spec.\n var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);\n if (indexOfIsdn > 0) {\n phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);\n }\n // If both phone context and isdn-subaddress are absent but other\n // parameters are present, the parameters are left in nationalNumber.\n // This is because we are concerned about deleting content from a potential\n // number string when there is no strong evidence that the number is\n // actually written in RFC3966.\n\n if (phoneNumberString !== '') {\n return phoneNumberString;\n }\n}\n//# sourceMappingURL=extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map"],"names":["extractFormattedPhoneNumberFromPossibleRfc3966NumberUri","numberToParse","_ref","extractFormattedPhoneNumber","phoneContext","extractPhoneContext","isPhoneContextValid","ParseError","phoneNumberString","charAt","PLUS_SIGN","indexOfRfc3966Prefix","indexOf","RFC3966_PREFIX_","indexOfNationalNumber","length","indexOfPhoneContext","RFC3966_PHONE_CONTEXT_","substring","indexOfIsdn","RFC3966_ISDN_SUBADDRESS_"],"mappings":";;;AAUA;AACA;AACA;AACA;AACA;AACe,SAASA,uDAAuDA,CAACC,aAAa,EAAAC,IAAA,EAE1F;AAAA,EAAA,IADFC,2BAA2B,GAAAD,IAAA,CAA3BC,2BAA2B;AAE3B,EAAA,IAAMC,YAAY,GAAGC,mBAAmB,CAACJ,aAAa,CAAC;AACvD,EAAA,IAAI,CAACK,mBAAmB,CAACF,YAAY,CAAC,EAAE;AACvC,IAAA,MAAM,IAAIG,UAAU,CAAC,cAAc,CAAC;AACrC,EAAA;AAEA,EAAA,IAAIC,iBAAiB;EAErB,IAAIJ,YAAY,KAAK,IAAI,EAAE;AAC1B;AACA;AACAI,IAAAA,iBAAiB,GAAGL,2BAA2B,CAACF,aAAa,CAAC,IAAI,EAAE;AACrE,EAAA,CAAC,MAAM;AACNO,IAAAA,iBAAiB,GAAG,EAAE;;AAEtB;AACA;IACA,IAAIJ,YAAY,CAACK,MAAM,CAAC,CAAC,CAAC,KAAKC,SAAS,EAAE;AACzCF,MAAAA,iBAAiB,IAAIJ,YAAY;AAClC,IAAA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAA,IAAMO,oBAAoB,GAAGV,aAAa,CAACW,OAAO,CAACC,eAAe,CAAC;AACnE,IAAA,IAAIC,qBAAqB;AACzB;AACA;AACA;IACA,IAAIH,oBAAoB,IAAI,CAAC,EAAE;AAC9BG,MAAAA,qBAAqB,GAAGH,oBAAoB,GAAGE,eAAe,CAACE,MAAM;AACtE,IAAA,CAAC,MAAM;AACND,MAAAA,qBAAqB,GAAG,CAAC;AAC1B,IAAA;AACA,IAAA,IAAME,mBAAmB,GAAGf,aAAa,CAACW,OAAO,CAACK,sBAAsB,CAAC;IACzET,iBAAiB,IAAIP,aAAa,CAACiB,SAAS,CAACJ,qBAAqB,EAAEE,mBAAmB,CAAC;AACzF,EAAA;;AAEA;AACA;AACA;AACA,EAAA,IAAMG,WAAW,GAAGX,iBAAiB,CAACI,OAAO,CAACQ,wBAAwB,CAAC;EACvE,IAAID,WAAW,GAAG,CAAC,EAAE;IACpBX,iBAAiB,GAAGA,iBAAiB,CAACU,SAAS,CAAC,CAAC,EAAEC,WAAW,CAAC;AAChE,EAAA;AACA;AACA;AACA;AACA;AACA;;EAEA,IAAIX,iBAAiB,KAAK,EAAE,EAAE;AAC7B,IAAA,OAAOA,iBAAiB;AACzB,EAAA;AACD;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js"],"sourcesContent":["import extractPhoneContext, { isPhoneContextValid, PLUS_SIGN, RFC3966_PREFIX_, RFC3966_PHONE_CONTEXT_, RFC3966_ISDN_SUBADDRESS_ } from './extractPhoneContext.js';\nimport ParseError from '../ParseError.js';\n/**\r\n * @param {string} numberToParse\r\n * @param {string} nationalNumber\r\n * @return {}\r\n */\n\nexport default function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {\n var extractFormattedPhoneNumber = _ref.extractFormattedPhoneNumber;\n var phoneContext = extractPhoneContext(numberToParse);\n\n if (!isPhoneContextValid(phoneContext)) {\n throw new ParseError('NOT_A_NUMBER');\n }\n\n var phoneNumberString;\n\n if (phoneContext === null) {\n // Extract a possible number from the string passed in.\n // (this strips leading characters that could not be the start of a phone number)\n phoneNumberString = extractFormattedPhoneNumber(numberToParse) || '';\n } else {\n phoneNumberString = ''; // If the phone context contains a phone number prefix, we need to capture\n // it, whereas domains will be ignored.\n\n if (phoneContext.charAt(0) === PLUS_SIGN) {\n phoneNumberString += phoneContext;\n } // Now append everything between the \"tel:\" prefix and the phone-context.\n // This should include the national number, an optional extension or\n // isdn-subaddress component. Note we also handle the case when \"tel:\" is\n // missing, as we have seen in some of the phone number inputs.\n // In that case, we append everything from the beginning.\n\n\n var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);\n var indexOfNationalNumber; // RFC 3966 \"tel:\" prefix is preset at this stage because\n // `isPhoneContextValid()` requires it to be present.\n\n /* istanbul ignore else */\n\n if (indexOfRfc3966Prefix >= 0) {\n indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;\n } else {\n indexOfNationalNumber = 0;\n }\n\n var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);\n phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);\n } // Delete the isdn-subaddress and everything after it if it is present.\n // Note extension won't appear at the same time with isdn-subaddress\n // according to paragraph 5.3 of the RFC3966 spec.\n\n\n var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);\n\n if (indexOfIsdn > 0) {\n phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);\n } // If both phone context and isdn-subaddress are absent but other\n // parameters are present, the parameters are left in nationalNumber.\n // This is because we are concerned about deleting content from a potential\n // number string when there is no strong evidence that the number is\n // actually written in RFC3966.\n\n\n if (phoneNumberString !== '') {\n return phoneNumberString;\n }\n}\n//# sourceMappingURL=extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map"],"names":["extractFormattedPhoneNumberFromPossibleRfc3966NumberUri","numberToParse","_ref","extractFormattedPhoneNumber","phoneContext","extractPhoneContext","isPhoneContextValid","ParseError","phoneNumberString","charAt","PLUS_SIGN","indexOfRfc3966Prefix","indexOf","RFC3966_PREFIX_","indexOfNationalNumber","length","indexOfPhoneContext","RFC3966_PHONE_CONTEXT_","substring","indexOfIsdn","RFC3966_ISDN_SUBADDRESS_"],"mappings":";;;AAUA;AACA;AACA;AACA;AACA;;AACe,SAASA,uDAATA,CAAiEC,aAAjE,EAAAC,IAAA,EAEZ;AAAA,EAAA,IADFC,2BACE,GAAAD,IAAA,CADFC,2BACE;AACF,EAAA,IAAMC,YAAY,GAAGC,mBAAmB,CAACJ,aAAD,CAAxC;AACA,EAAA,IAAI,CAACK,mBAAmB,CAACF,YAAD,CAAxB,EAAwC;AACvC,IAAA,MAAM,IAAIG,UAAJ,CAAe,cAAf,CAAN;AACA,EAAA;AAED,EAAA,IAAIC,iBAAJ;EAEA,IAAIJ,YAAY,KAAK,IAArB,EAA2B;AAC1B;AACA;AACAI,IAAAA,iBAAiB,GAAGL,2BAA2B,CAACF,aAAD,CAA3B,IAA8C,EAAlE;AACA,EAAA,CAJD,MAIO;IACNO,iBAAiB,GAAG,EAApB,CADM;AAIN;;AACA,IAAA,IAAIJ,YAAY,CAACK,MAAb,CAAoB,CAApB,CAAA,KAA2BC,SAA/B,EAA0C;AACzCF,MAAAA,iBAAiB,IAAIJ,YAArB;AACA,IAAA,CAPK;AAUN;AACA;AACA;AACA;;AACA,IAAA,IAAMO,oBAAoB,GAAGV,aAAa,CAACW,OAAd,CAAsBC,eAAtB,CAA7B;IACA,IAAIC,qBAAJ,CAfM;AAiBN;;AACA;;IACA,IAAIH,oBAAoB,IAAI,CAA5B,EAA+B;AAC9BG,MAAAA,qBAAqB,GAAGH,oBAAoB,GAAGE,eAAe,CAACE,MAA/D;AACA,IAAA,CAFD,MAEO;AACND,MAAAA,qBAAqB,GAAG,CAAxB;AACA,IAAA;AACD,IAAA,IAAME,mBAAmB,GAAGf,aAAa,CAACW,OAAd,CAAsBK,sBAAtB,CAA5B;IACAT,iBAAiB,IAAIP,aAAa,CAACiB,SAAd,CAAwBJ,qBAAxB,EAA+CE,mBAA/C,CAArB;AACA,EAAA,CAtCC;AAyCF;AACA;;AACA,EAAA,IAAMG,WAAW,GAAGX,iBAAiB,CAACI,OAAlB,CAA0BQ,wBAA1B,CAApB;EACA,IAAID,WAAW,GAAG,CAAlB,EAAqB;IACpBX,iBAAiB,GAAGA,iBAAiB,CAACU,SAAlB,CAA4B,CAA5B,EAA+BC,WAA/B,CAApB;AACA,EAAA,CA9CC;AAgDF;AACA;AACA;AACA;;EAEA,IAAIX,iBAAiB,KAAK,EAA1B,EAA8B;AAC7B,IAAA,OAAOA,iBAAP;AACA,EAAA;AACD;;;;","x_google_ignoreList":[0]}