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 +1 @@
1
- {"version":3,"file":"AsYouTypeFormatter.js","sources":["../../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js"],"sourcesContent":["function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { DIGIT_PLACEHOLDER, countOccurences, repeat, cutAndStripNonPairedParens, closeNonPairedParens, stripNonPairedParens, populateTemplateWithDigits } from './AsYouTypeFormatter.util.js';\nimport formatCompleteNumber, { canFormatCompleteNumber } from './AsYouTypeFormatter.complete.js';\nimport PatternMatcher from './AsYouTypeFormatter.PatternMatcher.js';\nimport parseDigits from './helpers/parseDigits.js';\nexport { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.util.js';\nimport { FIRST_GROUP_PATTERN } from './helpers/formatNationalNumberUsingFormat.js';\nimport { VALID_PUNCTUATION } from './constants.js';\nimport applyInternationalSeparatorStyle from './helpers/applyInternationalSeparatorStyle.js';\n\n// Used in phone number format template creation.\n// Could be any digit, I guess.\nvar DUMMY_DIGIT = '9';\n// I don't know why is it exactly `15`\nvar LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15;\n// Create a phone number consisting only of the digit 9 that matches the\n// `number_pattern` by applying the pattern to the \"longest phone number\" string.\nvar LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH);\n\n// A set of characters that, if found in a national prefix formatting rules, are an indicator to\n// us that we should separate the national prefix from the number when formatting.\nvar NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/;\n\n// Deprecated: Google has removed some formatting pattern related code from their repo.\n// https://github.com/googlei18n/libphonenumber/commit/a395b4fef3caf57c4bc5f082e1152a4d2bd0ba4c\n// \"We no longer have numbers in formatting matching patterns, only \\d.\"\n// Because this library supports generating custom metadata\n// some users may still be using old metadata so the relevant\n// code seems to stay until some next major version update.\nvar SUPPORT_LEGACY_FORMATTING_PATTERNS = true;\n\n// A pattern that is used to match character classes in regular expressions.\n// An example of a character class is \"[1-4]\".\nvar CREATE_CHARACTER_CLASS_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\[([^\\[\\]])*\\]/g;\n};\n\n// Any digit in a regular expression that actually denotes a digit. For\n// example, in the regular expression \"80[0-2]\\d{6,10}\", the first 2 digits\n// (8 and 0) are standalone digits, but the rest are not.\n// Two look-aheads are needed because the number following \\\\d could be a\n// two-digit number, since the phone number can be as long as 15 digits.\nvar CREATE_STANDALONE_DIGIT_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\d(?=[^,}][^,}])/g;\n};\n\n// A regular expression that is used to determine if a `format` is\n// suitable to be used in the \"as you type formatter\".\n// A `format` is suitable when the resulting formatted number has\n// the same digits as the user has entered.\n//\n// In the simplest case, that would mean that the format\n// doesn't add any additional digits when formatting a number.\n// Google says that it also shouldn't add \"star\" (`*`) characters,\n// like it does in some Israeli formats.\n// Such basic format would only contain \"valid punctuation\"\n// and \"captured group\" identifiers ($1, $2, etc).\n//\n// An example of a format that adds additional digits:\n//\n// Country: `AR` (Argentina).\n// Format:\n// {\n// \"pattern\": \"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\n// \"leading_digits_patterns\": [\"91\"],\n// \"national_prefix_formatting_rule\": \"0$1\",\n// \"format\": \"$2 15-$3-$4\",\n// \"international_format\": \"$1 $2 $3-$4\"\n// }\n//\n// In the format above, the `format` adds `15` to the digits when formatting a number.\n// A sidenote: this format actually is suitable because `national_prefix_for_parsing`\n// has previously removed `15` from a national number, so re-adding `15` in `format`\n// doesn't actually result in any extra digits added to user's input.\n// But verifying that would be a complex procedure, so the code chooses a simpler path:\n// it simply filters out all `format`s that contain anything but \"captured group\" ids.\n//\n// This regular expression is called `ELIGIBLE_FORMAT_PATTERN` in Google's\n// `libphonenumber` code.\n//\nvar NON_ALTERING_FORMAT_REG_EXP = new RegExp('[' + VALID_PUNCTUATION + ']*' +\n// Google developers say:\n// \"We require that the first matching group is present in the\n// output pattern to ensure no data is lost while formatting.\"\n'\\\\$1' + '[' + VALID_PUNCTUATION + ']*' + '(\\\\$\\\\d[' + VALID_PUNCTUATION + ']*)*' + '$');\n\n// This is the minimum length of the leading digits of a phone number\n// to guarantee the first \"leading digits pattern\" for a phone number format\n// to be preemptive.\nvar MIN_LEADING_DIGITS_LENGTH = 3;\nvar AsYouTypeFormatter = /*#__PURE__*/function () {\n function AsYouTypeFormatter(_ref) {\n var state = _ref.state,\n metadata = _ref.metadata;\n _classCallCheck(this, AsYouTypeFormatter);\n this.metadata = metadata;\n this.resetFormat();\n }\n return _createClass(AsYouTypeFormatter, [{\n key: \"resetFormat\",\n value: function resetFormat() {\n this.chosenFormat = undefined;\n this.template = undefined;\n this.nationalNumberTemplate = undefined;\n this.populatedNationalNumberTemplate = undefined;\n this.populatedNationalNumberTemplatePosition = -1;\n }\n }, {\n key: \"reset\",\n value: function reset(numberingPlan, state) {\n this.resetFormat();\n if (numberingPlan) {\n this.isNANP = numberingPlan.callingCode() === '1';\n this.matchingFormats = numberingPlan.formats();\n if (state.nationalSignificantNumber) {\n this.narrowDownMatchingFormats(state);\n }\n } else {\n this.isNANP = undefined;\n this.matchingFormats = [];\n }\n }\n\n /**\r\n * Formats an updated phone number.\r\n * @param {string} nextDigits — Additional phone number digits.\r\n * @param {object} state — `AsYouType` state.\r\n * @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats.\r\n */\n }, {\n key: \"format\",\n value: function format(nextDigits, state) {\n var _this = this;\n // See if the phone number digits can be formatted as a complete phone number.\n // If not, use the results from `formatNationalNumberWithNextDigits()`,\n // which formats based on the chosen formatting pattern.\n //\n // Attempting to format complete phone number first is how it's done\n // in Google's `libphonenumber`, so this library just follows it.\n // Google's `libphonenumber` code doesn't explain in detail why does it\n // attempt to format digits as a complete phone number\n // instead of just going with a previoulsy (or newly) chosen `format`:\n //\n // \"Checks to see if there is an exact pattern match for these digits.\n // If so, we should use this instead of any other formatting template\n // whose leadingDigitsPattern also matches the input.\"\n //\n if (canFormatCompleteNumber(state.nationalSignificantNumber, state.country, this.metadata)) {\n for (var _iterator = _createForOfIteratorHelperLoose(this.matchingFormats), _step; !(_step = _iterator()).done;) {\n var _format = _step.value;\n var formattedCompleteNumber = formatCompleteNumber(state, _format, {\n metadata: this.metadata,\n shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format) {\n return _this.shouldTryNationalPrefixFormattingRule(format, {\n international: state.international,\n nationalPrefix: state.nationalPrefix\n });\n },\n getSeparatorAfterNationalPrefix: function getSeparatorAfterNationalPrefix(format) {\n return _this.getSeparatorAfterNationalPrefix(format);\n }\n });\n if (formattedCompleteNumber) {\n this.resetFormat();\n this.chosenFormat = _format;\n this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\\d/g, DIGIT_PLACEHOLDER), state);\n this.populatedNationalNumberTemplate = formattedCompleteNumber;\n // With a new formatting template, the matched position\n // using the old template needs to be reset.\n this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(DIGIT_PLACEHOLDER);\n return formattedCompleteNumber;\n }\n }\n }\n // Format the digits as a partial (incomplete) phone number\n // using the previously chosen formatting pattern (or a newly chosen one).\n return this.formatNationalNumberWithNextDigits(nextDigits, state);\n }\n\n // Formats the next phone number digits.\n }, {\n key: \"formatNationalNumberWithNextDigits\",\n value: function formatNationalNumberWithNextDigits(nextDigits, state) {\n var previouslyChosenFormat = this.chosenFormat;\n\n // Choose a format from the list of matching ones.\n var newlyChosenFormat = this.chooseFormat(state);\n if (newlyChosenFormat) {\n if (newlyChosenFormat === previouslyChosenFormat) {\n // If it can format the next (current) digits\n // using the previously chosen phone number format\n // then return the updated formatted number.\n return this.formatNextNationalNumberDigits(nextDigits);\n } else {\n // If a more appropriate phone number format\n // has been chosen for these \"leading digits\",\n // then re-format the national phone number part\n // using the newly selected format.\n return this.formatNextNationalNumberDigits(state.getNationalDigits());\n }\n }\n }\n }, {\n key: \"narrowDownMatchingFormats\",\n value: function narrowDownMatchingFormats(_ref2) {\n var _this2 = this;\n var nationalSignificantNumber = _ref2.nationalSignificantNumber,\n nationalPrefix = _ref2.nationalPrefix,\n international = _ref2.international;\n var leadingDigits = nationalSignificantNumber;\n\n // \"leading digits\" pattern list starts with a\n // \"leading digits\" pattern fitting a maximum of 3 leading digits.\n // So, after a user inputs 3 digits of a national (significant) phone number\n // this national (significant) number can already be formatted.\n // The next \"leading digits\" pattern is for 4 leading digits max,\n // and the \"leading digits\" pattern after it is for 5 leading digits max, etc.\n\n // This implementation is different from Google's\n // in that it searches for a fitting format\n // even if the user has entered less than\n // `MIN_LEADING_DIGITS_LENGTH` digits of a national number.\n // Because some leading digit patterns already match for a single first digit.\n var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;\n if (leadingDigitsPatternIndex < 0) {\n leadingDigitsPatternIndex = 0;\n }\n this.matchingFormats = this.matchingFormats.filter(function (format) {\n return _this2.formatSuits(format, international, nationalPrefix) && _this2.formatMatches(format, leadingDigits, leadingDigitsPatternIndex);\n });\n\n // If there was a phone number format chosen\n // and it no longer holds given the new leading digits then reset it.\n // The test for this `if` condition is marked as:\n // \"Reset a chosen format when it no longer holds given the new leading digits\".\n // To construct a valid test case for this one can find a country\n // in `PhoneNumberMetadata.xml` yielding one format for 3 `<leadingDigits>`\n // and yielding another format for 4 `<leadingDigits>` (Australia in this case).\n if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) {\n this.resetFormat();\n }\n }\n }, {\n key: \"formatSuits\",\n value: function formatSuits(format, international, nationalPrefix) {\n // When a prefix before a national (significant) number is\n // simply a national prefix, then it's parsed as `this.nationalPrefix`.\n // In more complex cases, a prefix before national (significant) number\n // could include a national prefix as well as some \"capturing groups\",\n // and in that case there's no info whether a national prefix has been parsed.\n // If national prefix is not used when formatting a phone number\n // using this format, but a national prefix has been entered by the user,\n // and was extracted, then discard such phone number format.\n // In Google's \"AsYouType\" formatter code, the equivalent would be this part:\n // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L175-L184\n if (nationalPrefix && !format.usesNationalPrefix() &&\n // !format.domesticCarrierCodeFormattingRule() &&\n !format.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {\n return false;\n }\n // If national prefix is mandatory for this phone number format\n // and there're no guarantees that a national prefix is present in user input\n // then discard this phone number format as not suitable.\n // In Google's \"AsYouType\" formatter code, the equivalent would be this part:\n // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L185-L193\n if (!international && !nationalPrefix && format.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {\n return false;\n }\n return true;\n }\n }, {\n key: \"formatMatches\",\n value: function formatMatches(format, leadingDigits, leadingDigitsPatternIndex) {\n var leadingDigitsPatternsCount = format.leadingDigitsPatterns().length;\n\n // If this format is not restricted to a certain\n // leading digits pattern then it fits.\n // The test case could be found by searching for \"leadingDigitsPatternsCount === 0\".\n if (leadingDigitsPatternsCount === 0) {\n return true;\n }\n\n // Start narrowing down the list of possible formats based on the leading digits.\n // (only previously matched formats take part in the narrowing down process)\n\n // `leading_digits_patterns` start with 3 digits min\n // and then go up from there one digit at a time.\n leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);\n var leadingDigitsPattern = format.leadingDigitsPatterns()[leadingDigitsPatternIndex];\n\n // Google imposes a requirement on the leading digits\n // to be minimum 3 digits long in order to be eligible\n // for checking those with a leading digits pattern.\n //\n // Since `leading_digits_patterns` start with 3 digits min,\n // Google's original `libphonenumber` library only starts\n // excluding any non-matching formats only when the\n // national number entered so far is at least 3 digits long,\n // otherwise format matching would give false negatives.\n //\n // For example, when the digits entered so far are `2`\n // and the leading digits pattern is `21` –\n // it's quite obvious in this case that the format could be the one\n // but due to the absence of further digits it would give false negative.\n //\n // Also, `leading_digits_patterns` doesn't always correspond to a single\n // digits count. For example, `60|8` pattern would already match `8`\n // but the `60` part would require having at least two leading digits,\n // so the whole pattern would require inputting two digits first in order to\n // decide on whether it matches the input, even when the input is \"80\".\n //\n // This library — `libphonenumber-js` — allows filtering by `leading_digits_patterns`\n // even when there's only 1 or 2 digits of the national (significant) number.\n // To do that, it uses a non-strict pattern matcher written specifically for that.\n //\n if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {\n // Before leading digits < 3 matching was implemented:\n // return true\n //\n // After leading digits < 3 matching was implemented:\n try {\n return new PatternMatcher(leadingDigitsPattern).match(leadingDigits, {\n allowOverflow: true\n }) !== undefined;\n } catch (error) /* istanbul ignore next */{\n // There's a slight possibility that there could be some undiscovered bug\n // in the pattern matcher code. Since the \"leading digits < 3 matching\"\n // feature is not \"essential\" for operation, it can fall back to the old way\n // in case of any issues rather than halting the application's execution.\n console.error(error);\n return true;\n }\n }\n\n // If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are\n // available then use the usual regular expression matching.\n //\n // The whole pattern is wrapped in round brackets (`()`) because\n // the pattern can use \"or\" operator (`|`) at the top level of the pattern.\n //\n return new RegExp(\"^(\".concat(leadingDigitsPattern, \")\")).test(leadingDigits);\n }\n }, {\n key: \"getFormatFormat\",\n value: function getFormatFormat(format, international) {\n return international ? format.internationalFormat() : format.format();\n }\n }, {\n key: \"chooseFormat\",\n value: function chooseFormat(state) {\n var _this3 = this;\n var _loop = function _loop() {\n var format = _step2.value;\n // If this format is currently being used\n // and is still suitable, then stick to it.\n if (_this3.chosenFormat === format) {\n return 0; // break\n }\n // Sometimes, a formatting rule inserts additional digits in a phone number,\n // and \"as you type\" formatter can't do that: it should only use the digits\n // that the user has input.\n //\n // For example, in Argentina, there's a format for mobile phone numbers:\n //\n // {\n // \"pattern\": \"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\n // \"leading_digits_patterns\": [\"91\"],\n // \"national_prefix_formatting_rule\": \"0$1\",\n // \"format\": \"$2 15-$3-$4\",\n // \"international_format\": \"$1 $2 $3-$4\"\n // }\n //\n // In that format, `international_format` is used instead of `format`\n // because `format` inserts `15` in the formatted number,\n // and `AsYouType` formatter should only use the digits\n // the user has actually input, without adding any extra digits.\n // In this case, it wouldn't make a difference, because the `15`\n // is first stripped when applying `national_prefix_for_parsing`\n // and then re-added when using `format`, so in reality it doesn't\n // add any new digits to the number, but to detect that, the code\n // would have to be more complex: it would have to try formatting\n // the digits using the format and then see if any digits have\n // actually been added or removed, and then, every time a new digit\n // is input, it should re-check whether the chosen format doesn't\n // alter the digits.\n //\n // Google's code doesn't go that far, and so does this library:\n // it simply requires that a `format` doesn't add any additonal\n // digits to user's input.\n //\n // Also, people in general should move from inputting phone numbers\n // in national format (possibly with national prefixes)\n // and use international phone number format instead:\n // it's a logical thing in the modern age of mobile phones,\n // globalization and the internet.\n //\n /* istanbul ignore if */\n if (!NON_ALTERING_FORMAT_REG_EXP.test(_this3.getFormatFormat(format, state.international))) {\n return 1; // continue\n }\n if (!_this3.createTemplateForFormat(format, state)) {\n // Remove the format if it can't generate a template.\n _this3.matchingFormats = _this3.matchingFormats.filter(function (_) {\n return _ !== format;\n });\n return 1; // continue\n }\n _this3.chosenFormat = format;\n return 0; // break\n },\n _ret;\n // When there are multiple available formats, the formatter uses the first\n // format where a formatting template could be created.\n //\n // For some weird reason, `istanbul` says \"else path not taken\"\n // for the `for of` line below. Supposedly that means that\n // the loop doesn't ever go over the last element in the list.\n // That's true because there always is `this.chosenFormat`\n // when `this.matchingFormats` is non-empty.\n // And, for some weird reason, it doesn't think that the case\n // with empty `this.matchingFormats` qualifies for a valid \"else\" path.\n // So simply muting this `istanbul` warning.\n // It doesn't skip the contents of the `for of` loop,\n // it just skips the `for of` line.\n //\n /* istanbul ignore next */\n for (var _iterator2 = _createForOfIteratorHelperLoose(this.matchingFormats.slice()), _step2; !(_step2 = _iterator2()).done;) {\n _ret = _loop();\n if (_ret === 0) break;\n if (_ret === 1) continue;\n }\n if (!this.chosenFormat) {\n // No format matches the national (significant) phone number.\n this.resetFormat();\n }\n return this.chosenFormat;\n }\n }, {\n key: \"createTemplateForFormat\",\n value: function createTemplateForFormat(format, state) {\n // The formatter doesn't format numbers when numberPattern contains '|', e.g.\n // (20|3)\\d{4}. In those cases we quickly return.\n // (Though there's no such format in current metadata)\n /* istanbul ignore if */\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS && format.pattern().indexOf('|') >= 0) {\n return;\n }\n // Get formatting template for this phone number format\n var template = this.getTemplateForFormat(format, state);\n // If the national number entered is too long\n // for any phone number format, then abort.\n if (template) {\n this.setNationalNumberTemplate(template, state);\n return true;\n }\n }\n }, {\n key: \"getSeparatorAfterNationalPrefix\",\n value: function getSeparatorAfterNationalPrefix(format) {\n // `US` metadata doesn't have a `national_prefix_formatting_rule`,\n // so the `if` condition below doesn't apply to `US`,\n // but in reality there shoudl be a separator\n // between a national prefix and a national (significant) number.\n // So `US` national prefix separator is a \"special\" \"hardcoded\" case.\n if (this.isNANP) {\n return ' ';\n }\n // If a `format` has a `national_prefix_formatting_rule`\n // and that rule has a separator after a national prefix,\n // then it means that there should be a separator\n // between a national prefix and a national (significant) number.\n if (format && format.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format.nationalPrefixFormattingRule())) {\n return ' ';\n }\n // At this point, there seems to be no clear evidence that\n // there should be a separator between a national prefix\n // and a national (significant) number. So don't insert one.\n return '';\n }\n }, {\n key: \"getInternationalPrefixBeforeCountryCallingCode\",\n value: function getInternationalPrefixBeforeCountryCallingCode(_ref3, options) {\n var IDDPrefix = _ref3.IDDPrefix,\n missingPlus = _ref3.missingPlus;\n if (IDDPrefix) {\n return options && options.spacing === false ? IDDPrefix : IDDPrefix + ' ';\n }\n if (missingPlus) {\n return '';\n }\n return '+';\n }\n }, {\n key: \"getTemplate\",\n value: function getTemplate(state) {\n if (!this.template) {\n return;\n }\n // `this.template` holds the template for a \"complete\" phone number.\n // The currently entered phone number is most likely not \"complete\",\n // so trim all non-populated digits.\n var index = -1;\n var i = 0;\n var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {\n spacing: false\n }) : '';\n while (i < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {\n index = this.template.indexOf(DIGIT_PLACEHOLDER, index + 1);\n i++;\n }\n return cutAndStripNonPairedParens(this.template, index + 1);\n }\n }, {\n key: \"setNationalNumberTemplate\",\n value: function setNationalNumberTemplate(template, state) {\n this.nationalNumberTemplate = template;\n this.populatedNationalNumberTemplate = template;\n // With a new formatting template, the matched position\n // using the old template needs to be reset.\n this.populatedNationalNumberTemplatePosition = -1;\n // For convenience, the public `.template` property\n // contains the whole international number\n // if the phone number being input is international:\n // 'x' for the '+' sign, 'x'es for the country phone code,\n // a spacebar and then the template for the formatted national number.\n if (state.international) {\n this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\\d\\+]/g, DIGIT_PLACEHOLDER) + repeat(DIGIT_PLACEHOLDER, state.callingCode.length) + ' ' + template;\n } else {\n this.template = template;\n }\n }\n\n /**\r\n * Generates formatting template for a national phone number,\r\n * optionally containing a national prefix, for a format.\r\n * @param {Format} format\r\n * @param {string} nationalPrefix\r\n * @return {string}\r\n */\n }, {\n key: \"getTemplateForFormat\",\n value: function getTemplateForFormat(format, _ref4) {\n var nationalSignificantNumber = _ref4.nationalSignificantNumber,\n international = _ref4.international,\n nationalPrefix = _ref4.nationalPrefix,\n prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = _ref4.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix;\n var pattern = format.pattern();\n\n /* istanbul ignore else */\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS) {\n pattern = pattern\n // Replace anything in the form of [..] with \\d\n .replace(CREATE_CHARACTER_CLASS_PATTERN(), '\\\\d')\n // Replace any standalone digit (not the one in `{}`) with \\d\n .replace(CREATE_STANDALONE_DIGIT_PATTERN(), '\\\\d');\n }\n\n // Generate a dummy national number (consisting of `9`s)\n // that fits this format's `pattern`.\n //\n // This match will always succeed,\n // because the \"longest dummy phone number\"\n // has enough length to accomodate any possible\n // national phone number format pattern.\n //\n var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0];\n\n // If the national number entered is too long\n // for any phone number format, then abort.\n if (nationalSignificantNumber.length > digits.length) {\n return;\n }\n\n // Get a formatting template which can be used to efficiently format\n // a partial number where digits are added one by one.\n\n // Below `strictPattern` is used for the\n // regular expression (with `^` and `$`).\n // This wasn't originally in Google's `libphonenumber`\n // and I guess they don't really need it\n // because they're not using \"templates\" to format phone numbers\n // but I added `strictPattern` after encountering\n // South Korean phone number formatting bug.\n //\n // Non-strict regular expression bug demonstration:\n //\n // this.nationalSignificantNumber : `111111111` (9 digits)\n //\n // pattern : (\\d{2})(\\d{3,4})(\\d{4})\n // format : `$1 $2 $3`\n // digits : `9999999999` (10 digits)\n //\n // '9999999999'.replace(new RegExp(/(\\d{2})(\\d{3,4})(\\d{4})/g), '$1 $2 $3') = \"99 9999 9999\"\n //\n // template : xx xxxx xxxx\n //\n // But the correct template in this case is `xx xxx xxxx`.\n // The template was generated incorrectly because of the\n // `{3,4}` variability in the `pattern`.\n //\n // The fix is, if `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then `this.nationalSignificantNumber`\n // is used instead of `digits`.\n\n var strictPattern = new RegExp('^' + pattern + '$');\n var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\\d/g, DUMMY_DIGIT);\n\n // If `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then use it\n // instead of `digits`.\n if (strictPattern.test(nationalNumberDummyDigits)) {\n digits = nationalNumberDummyDigits;\n }\n var numberFormat = this.getFormatFormat(format, international);\n var nationalPrefixIncludedInTemplate;\n\n // If a user did input a national prefix (and that's guaranteed),\n // and if a `format` does have a national prefix formatting rule,\n // then see if that national prefix formatting rule\n // prepends exactly the same national prefix the user has input.\n // If that's the case, then use the `format` with the national prefix formatting rule.\n // Otherwise, use the `format` without the national prefix formatting rule,\n // and prepend a national prefix manually to it.\n if (this.shouldTryNationalPrefixFormattingRule(format, {\n international: international,\n nationalPrefix: nationalPrefix\n })) {\n var numberFormatWithNationalPrefix = numberFormat.replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule());\n // If `national_prefix_formatting_rule` of a `format` simply prepends\n // national prefix at the start of a national (significant) number,\n // then such formatting can be used with `AsYouType` formatter.\n // There seems to be no `else` case: everywhere in metadata,\n // national prefix formatting rule is national prefix + $1,\n // or `($1)`, in which case such format isn't even considered\n // when the user has input a national prefix.\n /* istanbul ignore else */\n if (parseDigits(format.nationalPrefixFormattingRule()) === (nationalPrefix || '') + parseDigits('$1')) {\n numberFormat = numberFormatWithNationalPrefix;\n nationalPrefixIncludedInTemplate = true;\n // Replace all digits of the national prefix in the formatting template\n // with `DIGIT_PLACEHOLDER`s.\n if (nationalPrefix) {\n var i = nationalPrefix.length;\n while (i > 0) {\n numberFormat = numberFormat.replace(/\\d/, DIGIT_PLACEHOLDER);\n i--;\n }\n }\n }\n }\n\n // Generate formatting template for this phone number format.\n var template = digits\n // Format the dummy phone number according to the format.\n .replace(new RegExp(pattern), numberFormat)\n // Replace each dummy digit with a DIGIT_PLACEHOLDER.\n .replace(new RegExp(DUMMY_DIGIT, 'g'), DIGIT_PLACEHOLDER);\n\n // If a prefix of a national (significant) number is not as simple\n // as just a basic national prefix, then just prepend such prefix\n // before the national (significant) number, optionally spacing\n // the two with a whitespace.\n if (!nationalPrefixIncludedInTemplate) {\n if (prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix) {\n // Prepend the prefix to the template manually.\n template = repeat(DIGIT_PLACEHOLDER, prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix.length) + ' ' + template;\n } else if (nationalPrefix) {\n // Prepend national prefix to the template manually.\n template = repeat(DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format) + template;\n }\n }\n if (international) {\n template = applyInternationalSeparatorStyle(template);\n }\n return template;\n }\n }, {\n key: \"formatNextNationalNumberDigits\",\n value: function formatNextNationalNumberDigits(digits) {\n var result = populateTemplateWithDigits(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits);\n if (!result) {\n // Reset the format.\n this.resetFormat();\n return;\n }\n this.populatedNationalNumberTemplate = result[0];\n this.populatedNationalNumberTemplatePosition = result[1];\n\n // Return the formatted phone number so far.\n return cutAndStripNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1);\n\n // The old way which was good for `input-format` but is not so good\n // for `react-phone-number-input`'s default input (`InputBasic`).\n // return closeNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1)\n // \t.replace(new RegExp(DIGIT_PLACEHOLDER, 'g'), ' ')\n }\n }, {\n key: \"shouldTryNationalPrefixFormattingRule\",\n value: function shouldTryNationalPrefixFormattingRule(format, _ref5) {\n var international = _ref5.international,\n nationalPrefix = _ref5.nationalPrefix;\n if (format.nationalPrefixFormattingRule()) {\n // In some countries, `national_prefix_formatting_rule` is `($1)`,\n // so it applies even if the user hasn't input a national prefix.\n // `format.usesNationalPrefix()` detects such cases.\n var usesNationalPrefix = format.usesNationalPrefix();\n if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {\n return true;\n }\n }\n }\n }]);\n}();\nexport { AsYouTypeFormatter as default };\n//# sourceMappingURL=AsYouTypeFormatter.js.map"],"names":["DUMMY_DIGIT","LONGEST_NATIONAL_PHONE_NUMBER_LENGTH","LONGEST_DUMMY_PHONE_NUMBER","repeat","NATIONAL_PREFIX_SEPARATORS_PATTERN","CREATE_CHARACTER_CLASS_PATTERN","CREATE_STANDALONE_DIGIT_PATTERN","NON_ALTERING_FORMAT_REG_EXP","RegExp","VALID_PUNCTUATION","MIN_LEADING_DIGITS_LENGTH","AsYouTypeFormatter","_ref","state","metadata","_classCallCheck","resetFormat","_createClass","key","value","chosenFormat","undefined","template","nationalNumberTemplate","populatedNationalNumberTemplate","populatedNationalNumberTemplatePosition","reset","numberingPlan","isNANP","callingCode","matchingFormats","formats","nationalSignificantNumber","narrowDownMatchingFormats","format","nextDigits","_this","canFormatCompleteNumber","country","_iterator","_createForOfIteratorHelperLoose","_step","done","_format","formattedCompleteNumber","formatCompleteNumber","shouldTryNationalPrefixFormattingRule","international","nationalPrefix","getSeparatorAfterNationalPrefix","setNationalNumberTemplate","replace","DIGIT_PLACEHOLDER","lastIndexOf","formatNationalNumberWithNextDigits","previouslyChosenFormat","newlyChosenFormat","chooseFormat","formatNextNationalNumberDigits","getNationalDigits","_ref2","_this2","leadingDigits","leadingDigitsPatternIndex","length","filter","formatSuits","formatMatches","indexOf","usesNationalPrefix","nationalPrefixIsOptionalWhenFormattingInNationalFormat","nationalPrefixIsMandatoryWhenFormattingInNationalFormat","leadingDigitsPatternsCount","leadingDigitsPatterns","Math","min","leadingDigitsPattern","PatternMatcher","match","allowOverflow","error","console","concat","test","getFormatFormat","internationalFormat","_this3","_loop","_step2","createTemplateForFormat","_","_ret","_iterator2","slice","pattern","getTemplateForFormat","nationalPrefixFormattingRule","getInternationalPrefixBeforeCountryCallingCode","_ref3","options","IDDPrefix","missingPlus","spacing","getTemplate","index","i","internationalPrefix","getDigitsWithoutInternationalPrefix","cutAndStripNonPairedParens","_ref4","prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix","digits","strictPattern","nationalNumberDummyDigits","numberFormat","nationalPrefixIncludedInTemplate","numberFormatWithNationalPrefix","FIRST_GROUP_PATTERN","parseDigits","applyInternationalSeparatorStyle","result","populateTemplateWithDigits","_ref5"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;AACA,IAAMA,WAAW,GAAG,GAAG;AACvB;AACA,IAAMC,oCAAoC,GAAG,EAAE;AAC/C;AACA;AACA,IAAMC,0BAA0B,GAAGC,MAAM,CAACH,WAAW,EAAEC,oCAAoC,CAAC;;AAE5F;AACA;AACA,IAAMG,kCAAkC,GAAG,MAAM;;AAUjD;AACA;AACA,IAAMC,8BAA8B,GAA0C,YAAA;AAAA,EAAA,OAAM,iBAAiB;AAAA,CAAC;;AAEtG;AACA;AACA;AACA;AACA;AACA,IAAMC,+BAA+B,GAA0C,YAAA;AAAA,EAAA,OAAM,mBAAmB;AAAA,CAAC;;AAEzG;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,IAAMC,2BAA2B,GAAG,IAAIC,MAAM,CAC7C,GAAG,GAAGC,iBAAiB,GAAG,IAAI;AAC9B;AACA;AACA;AACA,MAAM,GACN,GAAG,GAAGA,iBAAiB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,QAAA;AACD,MAAA;AACD,IAAA;AAAC,GAAA,CAAA,CAAA;AAAA,CAAA;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"AsYouTypeFormatter.js","sources":["../../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport { DIGIT_PLACEHOLDER, countOccurences, repeat, cutAndStripNonPairedParens, closeNonPairedParens, stripNonPairedParens, populateTemplateWithDigits } from './AsYouTypeFormatter.util.js';\nimport formatCompleteNumber, { canFormatCompleteNumber } from './AsYouTypeFormatter.complete.js';\nimport PatternMatcher from './AsYouTypeFormatter.PatternMatcher.js';\nimport parseDigits from './helpers/parseDigits.js';\nexport { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.util.js';\nimport { FIRST_GROUP_PATTERN } from './helpers/formatNationalNumberUsingFormat.js';\nimport { VALID_PUNCTUATION } from './constants.js';\nimport applyInternationalSeparatorStyle from './helpers/applyInternationalSeparatorStyle.js'; // Used in phone number format template creation.\n// Could be any digit, I guess.\n\nvar DUMMY_DIGIT = '9'; // I don't know why is it exactly `15`\n\nvar LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15; // Create a phone number consisting only of the digit 9 that matches the\n// `number_pattern` by applying the pattern to the \"longest phone number\" string.\n\nvar LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH); // A set of characters that, if found in a national prefix formatting rules, are an indicator to\n// us that we should separate the national prefix from the number when formatting.\n\nvar NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/; // Deprecated: Google has removed some formatting pattern related code from their repo.\n// https://github.com/googlei18n/libphonenumber/commit/a395b4fef3caf57c4bc5f082e1152a4d2bd0ba4c\n// \"We no longer have numbers in formatting matching patterns, only \\d.\"\n// Because this library supports generating custom metadata\n// some users may still be using old metadata so the relevant\n// code seems to stay until some next major version update.\n\nvar SUPPORT_LEGACY_FORMATTING_PATTERNS = true; // A pattern that is used to match character classes in regular expressions.\n// An example of a character class is \"[1-4]\".\n\nvar CREATE_CHARACTER_CLASS_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\[([^\\[\\]])*\\]/g;\n}; // Any digit in a regular expression that actually denotes a digit. For\n// example, in the regular expression \"80[0-2]\\d{6,10}\", the first 2 digits\n// (8 and 0) are standalone digits, but the rest are not.\n// Two look-aheads are needed because the number following \\\\d could be a\n// two-digit number, since the phone number can be as long as 15 digits.\n\n\nvar CREATE_STANDALONE_DIGIT_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\d(?=[^,}][^,}])/g;\n}; // A regular expression that is used to determine if a `format` is\n// suitable to be used in the \"as you type formatter\".\n// A `format` is suitable when the resulting formatted number has\n// the same digits as the user has entered.\n//\n// In the simplest case, that would mean that the format\n// doesn't add any additional digits when formatting a number.\n// Google says that it also shouldn't add \"star\" (`*`) characters,\n// like it does in some Israeli formats.\n// Such basic format would only contain \"valid punctuation\"\n// and \"captured group\" identifiers ($1, $2, etc).\n//\n// An example of a format that adds additional digits:\n//\n// Country: `AR` (Argentina).\n// Format:\n// {\n// \"pattern\": \"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\n// \"leading_digits_patterns\": [\"91\"],\n// \"national_prefix_formatting_rule\": \"0$1\",\n// \"format\": \"$2 15-$3-$4\",\n// \"international_format\": \"$1 $2 $3-$4\"\n// }\n//\n// In the format above, the `format` adds `15` to the digits when formatting a number.\n// A sidenote: this format actually is suitable because `national_prefix_for_parsing`\n// has previously removed `15` from a national number, so re-adding `15` in `format`\n// doesn't actually result in any extra digits added to user's input.\n// But verifying that would be a complex procedure, so the code chooses a simpler path:\n// it simply filters out all `format`s that contain anything but \"captured group\" ids.\n//\n// This regular expression is called `ELIGIBLE_FORMAT_PATTERN` in Google's\n// `libphonenumber` code.\n//\n\n\nvar NON_ALTERING_FORMAT_REG_EXP = new RegExp('[' + VALID_PUNCTUATION + ']*' + // Google developers say:\n// \"We require that the first matching group is present in the\n// output pattern to ensure no data is lost while formatting.\"\n'\\\\$1' + '[' + VALID_PUNCTUATION + ']*' + '(\\\\$\\\\d[' + VALID_PUNCTUATION + ']*)*' + '$'); // This is the minimum length of the leading digits of a phone number\n// to guarantee the first \"leading digits pattern\" for a phone number format\n// to be preemptive.\n\nvar MIN_LEADING_DIGITS_LENGTH = 3;\n\nvar AsYouTypeFormatter = /*#__PURE__*/function () {\n function AsYouTypeFormatter(_ref) {\n var state = _ref.state,\n metadata = _ref.metadata;\n\n _classCallCheck(this, AsYouTypeFormatter);\n\n this.metadata = metadata;\n this.resetFormat();\n }\n\n _createClass(AsYouTypeFormatter, [{\n key: \"resetFormat\",\n value: function resetFormat() {\n this.chosenFormat = undefined;\n this.template = undefined;\n this.nationalNumberTemplate = undefined;\n this.populatedNationalNumberTemplate = undefined;\n this.populatedNationalNumberTemplatePosition = -1;\n }\n }, {\n key: \"reset\",\n value: function reset(numberingPlan, state) {\n this.resetFormat();\n\n if (numberingPlan) {\n this.isNANP = numberingPlan.callingCode() === '1';\n this.matchingFormats = numberingPlan.formats();\n\n if (state.nationalSignificantNumber) {\n this.narrowDownMatchingFormats(state);\n }\n } else {\n this.isNANP = undefined;\n this.matchingFormats = [];\n }\n }\n /**\r\n * Formats an updated phone number.\r\n * @param {string} nextDigits — Additional phone number digits.\r\n * @param {object} state — `AsYouType` state.\r\n * @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats.\r\n */\n\n }, {\n key: \"format\",\n value: function format(nextDigits, state) {\n var _this = this;\n\n // See if the phone number digits can be formatted as a complete phone number.\n // If not, use the results from `formatNationalNumberWithNextDigits()`,\n // which formats based on the chosen formatting pattern.\n //\n // Attempting to format complete phone number first is how it's done\n // in Google's `libphonenumber`, so this library just follows it.\n // Google's `libphonenumber` code doesn't explain in detail why does it\n // attempt to format digits as a complete phone number\n // instead of just going with a previoulsy (or newly) chosen `format`:\n //\n // \"Checks to see if there is an exact pattern match for these digits.\n // If so, we should use this instead of any other formatting template\n // whose leadingDigitsPattern also matches the input.\"\n //\n if (canFormatCompleteNumber(state.nationalSignificantNumber, this.metadata)) {\n for (var _iterator = _createForOfIteratorHelperLoose(this.matchingFormats), _step; !(_step = _iterator()).done;) {\n var format = _step.value;\n var formattedCompleteNumber = formatCompleteNumber(state, format, {\n metadata: this.metadata,\n shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format) {\n return _this.shouldTryNationalPrefixFormattingRule(format, {\n international: state.international,\n nationalPrefix: state.nationalPrefix\n });\n },\n getSeparatorAfterNationalPrefix: function getSeparatorAfterNationalPrefix(format) {\n return _this.getSeparatorAfterNationalPrefix(format);\n }\n });\n\n if (formattedCompleteNumber) {\n this.resetFormat();\n this.chosenFormat = format;\n this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\\d/g, DIGIT_PLACEHOLDER), state);\n this.populatedNationalNumberTemplate = formattedCompleteNumber; // With a new formatting template, the matched position\n // using the old template needs to be reset.\n\n this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(DIGIT_PLACEHOLDER);\n return formattedCompleteNumber;\n }\n }\n } // Format the digits as a partial (incomplete) phone number\n // using the previously chosen formatting pattern (or a newly chosen one).\n\n\n return this.formatNationalNumberWithNextDigits(nextDigits, state);\n } // Formats the next phone number digits.\n\n }, {\n key: \"formatNationalNumberWithNextDigits\",\n value: function formatNationalNumberWithNextDigits(nextDigits, state) {\n var previouslyChosenFormat = this.chosenFormat; // Choose a format from the list of matching ones.\n\n var newlyChosenFormat = this.chooseFormat(state);\n\n if (newlyChosenFormat) {\n if (newlyChosenFormat === previouslyChosenFormat) {\n // If it can format the next (current) digits\n // using the previously chosen phone number format\n // then return the updated formatted number.\n return this.formatNextNationalNumberDigits(nextDigits);\n } else {\n // If a more appropriate phone number format\n // has been chosen for these \"leading digits\",\n // then re-format the national phone number part\n // using the newly selected format.\n return this.formatNextNationalNumberDigits(state.getNationalDigits());\n }\n }\n }\n }, {\n key: \"narrowDownMatchingFormats\",\n value: function narrowDownMatchingFormats(_ref2) {\n var _this2 = this;\n\n var nationalSignificantNumber = _ref2.nationalSignificantNumber,\n nationalPrefix = _ref2.nationalPrefix,\n international = _ref2.international;\n var leadingDigits = nationalSignificantNumber; // \"leading digits\" pattern list starts with a\n // \"leading digits\" pattern fitting a maximum of 3 leading digits.\n // So, after a user inputs 3 digits of a national (significant) phone number\n // this national (significant) number can already be formatted.\n // The next \"leading digits\" pattern is for 4 leading digits max,\n // and the \"leading digits\" pattern after it is for 5 leading digits max, etc.\n // This implementation is different from Google's\n // in that it searches for a fitting format\n // even if the user has entered less than\n // `MIN_LEADING_DIGITS_LENGTH` digits of a national number.\n // Because some leading digit patterns already match for a single first digit.\n\n var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;\n\n if (leadingDigitsPatternIndex < 0) {\n leadingDigitsPatternIndex = 0;\n }\n\n this.matchingFormats = this.matchingFormats.filter(function (format) {\n return _this2.formatSuits(format, international, nationalPrefix) && _this2.formatMatches(format, leadingDigits, leadingDigitsPatternIndex);\n }); // If there was a phone number format chosen\n // and it no longer holds given the new leading digits then reset it.\n // The test for this `if` condition is marked as:\n // \"Reset a chosen format when it no longer holds given the new leading digits\".\n // To construct a valid test case for this one can find a country\n // in `PhoneNumberMetadata.xml` yielding one format for 3 `<leadingDigits>`\n // and yielding another format for 4 `<leadingDigits>` (Australia in this case).\n\n if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) {\n this.resetFormat();\n }\n }\n }, {\n key: \"formatSuits\",\n value: function formatSuits(format, international, nationalPrefix) {\n // When a prefix before a national (significant) number is\n // simply a national prefix, then it's parsed as `this.nationalPrefix`.\n // In more complex cases, a prefix before national (significant) number\n // could include a national prefix as well as some \"capturing groups\",\n // and in that case there's no info whether a national prefix has been parsed.\n // If national prefix is not used when formatting a phone number\n // using this format, but a national prefix has been entered by the user,\n // and was extracted, then discard such phone number format.\n // In Google's \"AsYouType\" formatter code, the equivalent would be this part:\n // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L175-L184\n if (nationalPrefix && !format.usesNationalPrefix() && // !format.domesticCarrierCodeFormattingRule() &&\n !format.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {\n return false;\n } // If national prefix is mandatory for this phone number format\n // and there're no guarantees that a national prefix is present in user input\n // then discard this phone number format as not suitable.\n // In Google's \"AsYouType\" formatter code, the equivalent would be this part:\n // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L185-L193\n\n\n if (!international && !nationalPrefix && format.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {\n return false;\n }\n\n return true;\n }\n }, {\n key: \"formatMatches\",\n value: function formatMatches(format, leadingDigits, leadingDigitsPatternIndex) {\n var leadingDigitsPatternsCount = format.leadingDigitsPatterns().length; // If this format is not restricted to a certain\n // leading digits pattern then it fits.\n // The test case could be found by searching for \"leadingDigitsPatternsCount === 0\".\n\n if (leadingDigitsPatternsCount === 0) {\n return true;\n } // Start narrowing down the list of possible formats based on the leading digits.\n // (only previously matched formats take part in the narrowing down process)\n // `leading_digits_patterns` start with 3 digits min\n // and then go up from there one digit at a time.\n\n\n leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);\n var leadingDigitsPattern = format.leadingDigitsPatterns()[leadingDigitsPatternIndex]; // Google imposes a requirement on the leading digits\n // to be minimum 3 digits long in order to be eligible\n // for checking those with a leading digits pattern.\n //\n // Since `leading_digits_patterns` start with 3 digits min,\n // Google's original `libphonenumber` library only starts\n // excluding any non-matching formats only when the\n // national number entered so far is at least 3 digits long,\n // otherwise format matching would give false negatives.\n //\n // For example, when the digits entered so far are `2`\n // and the leading digits pattern is `21` –\n // it's quite obvious in this case that the format could be the one\n // but due to the absence of further digits it would give false negative.\n //\n // Also, `leading_digits_patterns` doesn't always correspond to a single\n // digits count. For example, `60|8` pattern would already match `8`\n // but the `60` part would require having at least two leading digits,\n // so the whole pattern would require inputting two digits first in order to\n // decide on whether it matches the input, even when the input is \"80\".\n //\n // This library — `libphonenumber-js` — allows filtering by `leading_digits_patterns`\n // even when there's only 1 or 2 digits of the national (significant) number.\n // To do that, it uses a non-strict pattern matcher written specifically for that.\n //\n\n if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {\n // Before leading digits < 3 matching was implemented:\n // return true\n //\n // After leading digits < 3 matching was implemented:\n try {\n return new PatternMatcher(leadingDigitsPattern).match(leadingDigits, {\n allowOverflow: true\n }) !== undefined;\n } catch (error)\n /* istanbul ignore next */\n {\n // There's a slight possibility that there could be some undiscovered bug\n // in the pattern matcher code. Since the \"leading digits < 3 matching\"\n // feature is not \"essential\" for operation, it can fall back to the old way\n // in case of any issues rather than halting the application's execution.\n console.error(error);\n return true;\n }\n } // If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are\n // available then use the usual regular expression matching.\n //\n // The whole pattern is wrapped in round brackets (`()`) because\n // the pattern can use \"or\" operator (`|`) at the top level of the pattern.\n //\n\n\n return new RegExp(\"^(\".concat(leadingDigitsPattern, \")\")).test(leadingDigits);\n }\n }, {\n key: \"getFormatFormat\",\n value: function getFormatFormat(format, international) {\n return international ? format.internationalFormat() : format.format();\n }\n }, {\n key: \"chooseFormat\",\n value: function chooseFormat(state) {\n var _this3 = this;\n\n var _loop = function _loop() {\n var format = _step2.value;\n\n // If this format is currently being used\n // and is still suitable, then stick to it.\n if (_this3.chosenFormat === format) {\n return \"break\";\n } // Sometimes, a formatting rule inserts additional digits in a phone number,\n // and \"as you type\" formatter can't do that: it should only use the digits\n // that the user has input.\n //\n // For example, in Argentina, there's a format for mobile phone numbers:\n //\n // {\n // \"pattern\": \"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\n // \"leading_digits_patterns\": [\"91\"],\n // \"national_prefix_formatting_rule\": \"0$1\",\n // \"format\": \"$2 15-$3-$4\",\n // \"international_format\": \"$1 $2 $3-$4\"\n // }\n //\n // In that format, `international_format` is used instead of `format`\n // because `format` inserts `15` in the formatted number,\n // and `AsYouType` formatter should only use the digits\n // the user has actually input, without adding any extra digits.\n // In this case, it wouldn't make a difference, because the `15`\n // is first stripped when applying `national_prefix_for_parsing`\n // and then re-added when using `format`, so in reality it doesn't\n // add any new digits to the number, but to detect that, the code\n // would have to be more complex: it would have to try formatting\n // the digits using the format and then see if any digits have\n // actually been added or removed, and then, every time a new digit\n // is input, it should re-check whether the chosen format doesn't\n // alter the digits.\n //\n // Google's code doesn't go that far, and so does this library:\n // it simply requires that a `format` doesn't add any additonal\n // digits to user's input.\n //\n // Also, people in general should move from inputting phone numbers\n // in national format (possibly with national prefixes)\n // and use international phone number format instead:\n // it's a logical thing in the modern age of mobile phones,\n // globalization and the internet.\n //\n\n /* istanbul ignore if */\n\n\n if (!NON_ALTERING_FORMAT_REG_EXP.test(_this3.getFormatFormat(format, state.international))) {\n return \"continue\";\n }\n\n if (!_this3.createTemplateForFormat(format, state)) {\n // Remove the format if it can't generate a template.\n _this3.matchingFormats = _this3.matchingFormats.filter(function (_) {\n return _ !== format;\n });\n return \"continue\";\n }\n\n _this3.chosenFormat = format;\n return \"break\";\n };\n\n // When there are multiple available formats, the formatter uses the first\n // format where a formatting template could be created.\n //\n // For some weird reason, `istanbul` says \"else path not taken\"\n // for the `for of` line below. Supposedly that means that\n // the loop doesn't ever go over the last element in the list.\n // That's true because there always is `this.chosenFormat`\n // when `this.matchingFormats` is non-empty.\n // And, for some weird reason, it doesn't think that the case\n // with empty `this.matchingFormats` qualifies for a valid \"else\" path.\n // So simply muting this `istanbul` warning.\n // It doesn't skip the contents of the `for of` loop,\n // it just skips the `for of` line.\n //\n\n /* istanbul ignore next */\n for (var _iterator2 = _createForOfIteratorHelperLoose(this.matchingFormats.slice()), _step2; !(_step2 = _iterator2()).done;) {\n var _ret = _loop();\n\n if (_ret === \"break\") break;\n if (_ret === \"continue\") continue;\n }\n\n if (!this.chosenFormat) {\n // No format matches the national (significant) phone number.\n this.resetFormat();\n }\n\n return this.chosenFormat;\n }\n }, {\n key: \"createTemplateForFormat\",\n value: function createTemplateForFormat(format, state) {\n // The formatter doesn't format numbers when numberPattern contains '|', e.g.\n // (20|3)\\d{4}. In those cases we quickly return.\n // (Though there's no such format in current metadata)\n\n /* istanbul ignore if */\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS && format.pattern().indexOf('|') >= 0) {\n return;\n } // Get formatting template for this phone number format\n\n\n var template = this.getTemplateForFormat(format, state); // If the national number entered is too long\n // for any phone number format, then abort.\n\n if (template) {\n this.setNationalNumberTemplate(template, state);\n return true;\n }\n }\n }, {\n key: \"getSeparatorAfterNationalPrefix\",\n value: function getSeparatorAfterNationalPrefix(format) {\n // `US` metadata doesn't have a `national_prefix_formatting_rule`,\n // so the `if` condition below doesn't apply to `US`,\n // but in reality there shoudl be a separator\n // between a national prefix and a national (significant) number.\n // So `US` national prefix separator is a \"special\" \"hardcoded\" case.\n if (this.isNANP) {\n return ' ';\n } // If a `format` has a `national_prefix_formatting_rule`\n // and that rule has a separator after a national prefix,\n // then it means that there should be a separator\n // between a national prefix and a national (significant) number.\n\n\n if (format && format.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format.nationalPrefixFormattingRule())) {\n return ' ';\n } // At this point, there seems to be no clear evidence that\n // there should be a separator between a national prefix\n // and a national (significant) number. So don't insert one.\n\n\n return '';\n }\n }, {\n key: \"getInternationalPrefixBeforeCountryCallingCode\",\n value: function getInternationalPrefixBeforeCountryCallingCode(_ref3, options) {\n var IDDPrefix = _ref3.IDDPrefix,\n missingPlus = _ref3.missingPlus;\n\n if (IDDPrefix) {\n return options && options.spacing === false ? IDDPrefix : IDDPrefix + ' ';\n }\n\n if (missingPlus) {\n return '';\n }\n\n return '+';\n }\n }, {\n key: \"getTemplate\",\n value: function getTemplate(state) {\n if (!this.template) {\n return;\n } // `this.template` holds the template for a \"complete\" phone number.\n // The currently entered phone number is most likely not \"complete\",\n // so trim all non-populated digits.\n\n\n var index = -1;\n var i = 0;\n var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {\n spacing: false\n }) : '';\n\n while (i < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {\n index = this.template.indexOf(DIGIT_PLACEHOLDER, index + 1);\n i++;\n }\n\n return cutAndStripNonPairedParens(this.template, index + 1);\n }\n }, {\n key: \"setNationalNumberTemplate\",\n value: function setNationalNumberTemplate(template, state) {\n this.nationalNumberTemplate = template;\n this.populatedNationalNumberTemplate = template; // With a new formatting template, the matched position\n // using the old template needs to be reset.\n\n this.populatedNationalNumberTemplatePosition = -1; // For convenience, the public `.template` property\n // contains the whole international number\n // if the phone number being input is international:\n // 'x' for the '+' sign, 'x'es for the country phone code,\n // a spacebar and then the template for the formatted national number.\n\n if (state.international) {\n this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\\d\\+]/g, DIGIT_PLACEHOLDER) + repeat(DIGIT_PLACEHOLDER, state.callingCode.length) + ' ' + template;\n } else {\n this.template = template;\n }\n }\n /**\r\n * Generates formatting template for a national phone number,\r\n * optionally containing a national prefix, for a format.\r\n * @param {Format} format\r\n * @param {string} nationalPrefix\r\n * @return {string}\r\n */\n\n }, {\n key: \"getTemplateForFormat\",\n value: function getTemplateForFormat(format, _ref4) {\n var nationalSignificantNumber = _ref4.nationalSignificantNumber,\n international = _ref4.international,\n nationalPrefix = _ref4.nationalPrefix,\n complexPrefixBeforeNationalSignificantNumber = _ref4.complexPrefixBeforeNationalSignificantNumber;\n var pattern = format.pattern();\n /* istanbul ignore else */\n\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS) {\n pattern = pattern // Replace anything in the form of [..] with \\d\n .replace(CREATE_CHARACTER_CLASS_PATTERN(), '\\\\d') // Replace any standalone digit (not the one in `{}`) with \\d\n .replace(CREATE_STANDALONE_DIGIT_PATTERN(), '\\\\d');\n } // Generate a dummy national number (consisting of `9`s)\n // that fits this format's `pattern`.\n //\n // This match will always succeed,\n // because the \"longest dummy phone number\"\n // has enough length to accomodate any possible\n // national phone number format pattern.\n //\n\n\n var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0]; // If the national number entered is too long\n // for any phone number format, then abort.\n\n if (nationalSignificantNumber.length > digits.length) {\n return;\n } // Get a formatting template which can be used to efficiently format\n // a partial number where digits are added one by one.\n // Below `strictPattern` is used for the\n // regular expression (with `^` and `$`).\n // This wasn't originally in Google's `libphonenumber`\n // and I guess they don't really need it\n // because they're not using \"templates\" to format phone numbers\n // but I added `strictPattern` after encountering\n // South Korean phone number formatting bug.\n //\n // Non-strict regular expression bug demonstration:\n //\n // this.nationalSignificantNumber : `111111111` (9 digits)\n //\n // pattern : (\\d{2})(\\d{3,4})(\\d{4})\n // format : `$1 $2 $3`\n // digits : `9999999999` (10 digits)\n //\n // '9999999999'.replace(new RegExp(/(\\d{2})(\\d{3,4})(\\d{4})/g), '$1 $2 $3') = \"99 9999 9999\"\n //\n // template : xx xxxx xxxx\n //\n // But the correct template in this case is `xx xxx xxxx`.\n // The template was generated incorrectly because of the\n // `{3,4}` variability in the `pattern`.\n //\n // The fix is, if `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then `this.nationalSignificantNumber`\n // is used instead of `digits`.\n\n\n var strictPattern = new RegExp('^' + pattern + '$');\n var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\\d/g, DUMMY_DIGIT); // If `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then use it\n // instead of `digits`.\n\n if (strictPattern.test(nationalNumberDummyDigits)) {\n digits = nationalNumberDummyDigits;\n }\n\n var numberFormat = this.getFormatFormat(format, international);\n var nationalPrefixIncludedInTemplate; // If a user did input a national prefix (and that's guaranteed),\n // and if a `format` does have a national prefix formatting rule,\n // then see if that national prefix formatting rule\n // prepends exactly the same national prefix the user has input.\n // If that's the case, then use the `format` with the national prefix formatting rule.\n // Otherwise, use the `format` without the national prefix formatting rule,\n // and prepend a national prefix manually to it.\n\n if (this.shouldTryNationalPrefixFormattingRule(format, {\n international: international,\n nationalPrefix: nationalPrefix\n })) {\n var numberFormatWithNationalPrefix = numberFormat.replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()); // If `national_prefix_formatting_rule` of a `format` simply prepends\n // national prefix at the start of a national (significant) number,\n // then such formatting can be used with `AsYouType` formatter.\n // There seems to be no `else` case: everywhere in metadata,\n // national prefix formatting rule is national prefix + $1,\n // or `($1)`, in which case such format isn't even considered\n // when the user has input a national prefix.\n\n /* istanbul ignore else */\n\n if (parseDigits(format.nationalPrefixFormattingRule()) === (nationalPrefix || '') + parseDigits('$1')) {\n numberFormat = numberFormatWithNationalPrefix;\n nationalPrefixIncludedInTemplate = true; // Replace all digits of the national prefix in the formatting template\n // with `DIGIT_PLACEHOLDER`s.\n\n if (nationalPrefix) {\n var i = nationalPrefix.length;\n\n while (i > 0) {\n numberFormat = numberFormat.replace(/\\d/, DIGIT_PLACEHOLDER);\n i--;\n }\n }\n }\n } // Generate formatting template for this phone number format.\n\n\n var template = digits // Format the dummy phone number according to the format.\n .replace(new RegExp(pattern), numberFormat) // Replace each dummy digit with a DIGIT_PLACEHOLDER.\n .replace(new RegExp(DUMMY_DIGIT, 'g'), DIGIT_PLACEHOLDER); // If a prefix of a national (significant) number is not as simple\n // as just a basic national prefix, then just prepend such prefix\n // before the national (significant) number, optionally spacing\n // the two with a whitespace.\n\n if (!nationalPrefixIncludedInTemplate) {\n if (complexPrefixBeforeNationalSignificantNumber) {\n // Prepend the prefix to the template manually.\n template = repeat(DIGIT_PLACEHOLDER, complexPrefixBeforeNationalSignificantNumber.length) + ' ' + template;\n } else if (nationalPrefix) {\n // Prepend national prefix to the template manually.\n template = repeat(DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format) + template;\n }\n }\n\n if (international) {\n template = applyInternationalSeparatorStyle(template);\n }\n\n return template;\n }\n }, {\n key: \"formatNextNationalNumberDigits\",\n value: function formatNextNationalNumberDigits(digits) {\n var result = populateTemplateWithDigits(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits);\n\n if (!result) {\n // Reset the format.\n this.resetFormat();\n return;\n }\n\n this.populatedNationalNumberTemplate = result[0];\n this.populatedNationalNumberTemplatePosition = result[1]; // Return the formatted phone number so far.\n\n return cutAndStripNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1); // The old way which was good for `input-format` but is not so good\n // for `react-phone-number-input`'s default input (`InputBasic`).\n // return closeNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1)\n // \t.replace(new RegExp(DIGIT_PLACEHOLDER, 'g'), ' ')\n }\n }, {\n key: \"shouldTryNationalPrefixFormattingRule\",\n value: function shouldTryNationalPrefixFormattingRule(format, _ref5) {\n var international = _ref5.international,\n nationalPrefix = _ref5.nationalPrefix;\n\n if (format.nationalPrefixFormattingRule()) {\n // In some countries, `national_prefix_formatting_rule` is `($1)`,\n // so it applies even if the user hasn't input a national prefix.\n // `format.usesNationalPrefix()` detects such cases.\n var usesNationalPrefix = format.usesNationalPrefix();\n\n if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {\n return true;\n }\n }\n }\n }]);\n\n return AsYouTypeFormatter;\n}();\n\nexport { AsYouTypeFormatter as default };\n//# sourceMappingURL=AsYouTypeFormatter.js.map"],"names":["DUMMY_DIGIT","LONGEST_NATIONAL_PHONE_NUMBER_LENGTH","LONGEST_DUMMY_PHONE_NUMBER","repeat","NATIONAL_PREFIX_SEPARATORS_PATTERN","CREATE_CHARACTER_CLASS_PATTERN","CREATE_STANDALONE_DIGIT_PATTERN","NON_ALTERING_FORMAT_REG_EXP","RegExp","VALID_PUNCTUATION","MIN_LEADING_DIGITS_LENGTH","AsYouTypeFormatter","_ref","state","metadata","_classCallCheck","resetFormat","chosenFormat","undefined","template","nationalNumberTemplate","populatedNationalNumberTemplate","populatedNationalNumberTemplatePosition","reset","numberingPlan","isNANP","callingCode","matchingFormats","formats","nationalSignificantNumber","narrowDownMatchingFormats","format","nextDigits","_this","canFormatCompleteNumber","_iterator","_createForOfIteratorHelperLoose","_step","done","value","formattedCompleteNumber","formatCompleteNumber","shouldTryNationalPrefixFormattingRule","international","nationalPrefix","getSeparatorAfterNationalPrefix","setNationalNumberTemplate","replace","DIGIT_PLACEHOLDER","lastIndexOf","formatNationalNumberWithNextDigits","previouslyChosenFormat","newlyChosenFormat","chooseFormat","formatNextNationalNumberDigits","getNationalDigits","_ref2","_this2","leadingDigits","leadingDigitsPatternIndex","length","filter","formatSuits","formatMatches","indexOf","usesNationalPrefix","nationalPrefixIsOptionalWhenFormattingInNationalFormat","nationalPrefixIsMandatoryWhenFormattingInNationalFormat","leadingDigitsPatternsCount","leadingDigitsPatterns","Math","min","leadingDigitsPattern","PatternMatcher","match","allowOverflow","error","console","concat","test","getFormatFormat","internationalFormat","_this3","_loop","_step2","createTemplateForFormat","_","_iterator2","slice","_ret","pattern","getTemplateForFormat","nationalPrefixFormattingRule","getInternationalPrefixBeforeCountryCallingCode","_ref3","options","IDDPrefix","missingPlus","spacing","getTemplate","index","i","internationalPrefix","getDigitsWithoutInternationalPrefix","cutAndStripNonPairedParens","_ref4","complexPrefixBeforeNationalSignificantNumber","digits","strictPattern","nationalNumberDummyDigits","numberFormat","nationalPrefixIncludedInTemplate","numberFormatWithNationalPrefix","FIRST_GROUP_PATTERN","parseDigits","applyInternationalSeparatorStyle","result","populateTemplateWithDigits","_ref5"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;AACA,IAAMA,WAAW,GAAG,GAApB;;AAEA,IAAMC,oCAAoC,GAAG,EAA7C;AAEA;;AACA,IAAMC,0BAA0B,GAAGC,MAAM,CAACH,WAAD,EAAcC,oCAAd,CAAzC;AAGA;;AACA,IAAMG,kCAAkC,GAAG,MAA3C;AAWA;;AACA,IAAMC,8BAA8B,GAA0C,YAAA;AAAA,EAAA,OAAM,iBAAN;AAAA,C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A,IAAA;;;WAED,SAAAmC,8BAAAA,CAA+BqD,MAA/B,EAAuC;MACtC,IAAMS,MAAM,GAAGC,0BAA0B,CACxC,IAAA,CAAKhG,+BADmC,EAExC,IAAA,CAAKC,uCAFmC,EAGxCqF,MAHwC,CAAzC;MAMA,IAAI,CAACS,MAAL,EAAa;AACZ;AACA,QAAA,IAAA,CAAKpG,WAAL,EAAA;AACA,QAAA;AACA,MAAA;AAED,MAAA,IAAA,CAAKK,+BAAL,GAAuC+F,MAAM,CAAC,CAAD,CAA7C;AACA,MAAA,IAAA,CAAK9F,uCAAL,GAA+C8F,MAAM,CAAC,CAAD,CAArD,CAdsC;;MAiBtC,OAAOZ,0BAA0B,CAAC,IAAA,CAAKnF,+BAAN,EAAuC,IAAA,CAAKC,uCAAL,GAA+C,CAAtF,CAAjC,CAjBsC;AAoBtC;AACA;AACA;AACA,IAAA;;;AAED,IAAA,KAAA,EAAA,SAAAoB,qCAAAA,CAAsCX,MAAtC,EAAAuF,KAAA,EAAiF;AAAA,MAAA,IAAjC3E,aAAiC,GAAA2E,KAAA,CAAjC3E,aAAiC;QAAlBC,cAAkB,GAAA0E,KAAA,CAAlB1E,cAAkB;AAChF,MAAA,IAAIb,MAAM,CAAC6D,4BAAP,EAAJ,EAA2C;AAC1C;AACA;AACA;AACA,QAAA,IAAM3B,kBAAkB,GAAGlC,MAAM,CAACkC,kBAAP,EAA3B;QACA,IAAKA,kBAAkB,IAAIrB,cAAvB,IACF,CAACqB,kBAAD,IAAuB,CAACtB,aAD1B,EAC0C;AACzC,UAAA,OAAO,IAAP;AACA,QAAA;AACD,MAAA;AACD,IAAA;;;;;;;","x_google_ignoreList":[0]}
@@ -1,38 +1,43 @@
1
- function _createForOfIteratorHelperLoose(r, e) {
2
- var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
3
- if (t) return (t = t.call(r)).next.bind(t);
4
- if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
5
- t && (r = t);
6
- var o = 0;
1
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
2
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
3
+ if (it) return (it = it.call(o)).next.bind(it);
4
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) {
5
+ if (it) o = it;
6
+ var i = 0;
7
7
  return function () {
8
- return o >= r.length ? {
8
+ if (i >= o.length) return {
9
9
  done: true
10
- } : {
10
+ };
11
+ return {
11
12
  done: false,
12
- value: r[o++]
13
+ value: o[i++]
13
14
  };
14
15
  };
15
16
  }
16
17
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
17
18
  }
18
- function _unsupportedIterableToArray(r, a) {
19
- if (r) {
20
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
21
- var t = {}.toString.call(r).slice(8, -1);
22
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
23
- }
19
+ function _unsupportedIterableToArray(o, minLen) {
20
+ if (!o) return;
21
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
22
+ var n = Object.prototype.toString.call(o).slice(8, -1);
23
+ if (n === "Object" && o.constructor) n = o.constructor.name;
24
+ if (n === "Map" || n === "Set") return Array.from(o);
25
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
24
26
  }
25
- function _arrayLikeToArray(r, a) {
26
- (null == a || a > r.length) && (a = r.length);
27
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
28
- return n;
27
+ function _arrayLikeToArray(arr, len) {
28
+ if (len == null || len > arr.length) len = arr.length;
29
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
30
+ arr2[i] = arr[i];
31
+ }
32
+ return arr2;
29
33
  }
34
+
30
35
  // Should be the same as `DIGIT_PLACEHOLDER` in `libphonenumber-metadata-generator`.
31
36
  var DIGIT_PLACEHOLDER = 'x'; // '\u2008' (punctuation space)
32
- var DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER);
33
37
 
34
- // Repeats a string (or a symbol) N times.
38
+ var DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER); // Counts all occurences of a symbol in a string.
35
39
  // http://stackoverflow.com/questions/202605/repeat-string-javascript
40
+
36
41
  function repeat(string, times) {
37
42
  if (times < 1) {
38
43
  return '';
@@ -82,6 +87,7 @@ function populateTemplateWithDigits(template, position, digits) {
82
87
  // for (const digit of digits)
83
88
  for (var _iterator2 = _createForOfIteratorHelperLoose(digits.split('')), _step2; !(_step2 = _iterator2()).done;) {
84
89
  var digit = _step2.value;
90
+
85
91
  // If there is room for more digits in current `template`,
86
92
  // then set the next digit in the `template`,
87
93
  // and return the formatted digits so far.
@@ -1 +1 @@
1
- {"version":3,"file":"AsYouTypeFormatter.util.js","sources":["../../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\n// Should be the same as `DIGIT_PLACEHOLDER` in `libphonenumber-metadata-generator`.\nexport var DIGIT_PLACEHOLDER = 'x'; // '\\u2008' (punctuation space)\nvar DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER);\n\n// Counts all occurences of a symbol in a string.\n// Unicode-unsafe (because using `.split()`).\nexport function countOccurences(symbol, string) {\n var count = 0;\n // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for counting brackets it is safe.\n // for (const character of string)\n for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n if (character === symbol) {\n count++;\n }\n }\n return count;\n}\n\n// Repeats a string (or a symbol) N times.\n// http://stackoverflow.com/questions/202605/repeat-string-javascript\nexport function repeat(string, times) {\n if (times < 1) {\n return '';\n }\n var result = '';\n while (times > 1) {\n if (times & 1) {\n result += string;\n }\n times >>= 1;\n string += string;\n }\n return result + string;\n}\nexport function cutAndStripNonPairedParens(string, cutBeforeIndex) {\n if (string[cutBeforeIndex] === ')') {\n cutBeforeIndex++;\n }\n return stripNonPairedParens(string.slice(0, cutBeforeIndex));\n}\nexport function closeNonPairedParens(template, cut_before) {\n var retained_template = template.slice(0, cut_before);\n var opening_braces = countOccurences('(', retained_template);\n var closing_braces = countOccurences(')', retained_template);\n var dangling_braces = opening_braces - closing_braces;\n while (dangling_braces > 0 && cut_before < template.length) {\n if (template[cut_before] === ')') {\n dangling_braces--;\n }\n cut_before++;\n }\n return template.slice(0, cut_before);\n}\nexport function stripNonPairedParens(string) {\n var dangling_braces = [];\n var i = 0;\n while (i < string.length) {\n if (string[i] === '(') {\n dangling_braces.push(i);\n } else if (string[i] === ')') {\n dangling_braces.pop();\n }\n i++;\n }\n var start = 0;\n var cleared_string = '';\n dangling_braces.push(string.length);\n for (var _i = 0, _dangling_braces = dangling_braces; _i < _dangling_braces.length; _i++) {\n var index = _dangling_braces[_i];\n cleared_string += string.slice(start, index);\n start = index + 1;\n }\n return cleared_string;\n}\nexport function populateTemplateWithDigits(template, position, digits) {\n // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for `digits` it is safe.\n // for (const digit of digits)\n for (var _iterator2 = _createForOfIteratorHelperLoose(digits.split('')), _step2; !(_step2 = _iterator2()).done;) {\n var digit = _step2.value;\n // If there is room for more digits in current `template`,\n // then set the next digit in the `template`,\n // and return the formatted digits so far.\n // If more digits are entered than the current format could handle.\n if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {\n return;\n }\n position = template.search(DIGIT_PLACEHOLDER_MATCHER);\n template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);\n }\n return [template, position];\n}\n//# sourceMappingURL=AsYouTypeFormatter.util.js.map"],"names":["DIGIT_PLACEHOLDER","DIGIT_PLACEHOLDER_MATCHER","RegExp","repeat","string","times","result","cutAndStripNonPairedParens","cutBeforeIndex","stripNonPairedParens","slice","dangling_braces","i","length","push","pop","start","cleared_string","_i","_dangling_braces","index","populateTemplateWithDigits","template","position","digits","_iterator2","_createForOfIteratorHelperLoose","split","_step2","done","digit","value","search","replace"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACO,IAAMA,iBAAiB,GAAG,IAAG;AACpC,IAAMC,yBAAyB,GAAG,IAAIC,MAAM,CAACF,iBAAiB,CAAC;;AAmB/D;AACA;AACO,SAASG,MAAMA,CAACC,MAAM,EAAEC,KAAK,EAAE;EACrC,IAAIA,KAAK,GAAG,CAAC,EAAE;AACd,IAAA,OAAO,EAAE;AACV,EAAA;EACA,IAAIC,MAA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fD,cAAc,IAAIb,MAAM,CAACM,KAAK,CAACM,KAAK,EAAEI,KAAK,CAAC;IAC5CJ,KAAK,GAAGI,KAAK,GAAG,CAAC;AAClB,EAAA;AACA,EAAA,OAAOH,cAAc;AACtB;AAEO,SAASI,0BAA0BA,CAACC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,EAAE;AACtE;AACA;AACA;AACA;AACA;AACA,EAAA,KAAA,IAAAC,UAAA,GAAAC,+BAAA,CAAoBF,MAAM,CAACG,KAAK,CAAC,EAAE,CAAC,CAAA,EAAAC,MAAA,EAAA,CAAA,CAAAA,MAAA,GAAAH,UAAA,EAAA,EAAAI,IAAA,GAAE;AAAA,IAAA,IAA3BC,KAAK,GAAAF,MAAA,CAAAG,KAAA;AACf;AACA;AACA;AACA;AACA,IAAA,IAAIT,QAAQ,CAACZ,KAAK,CAACa,QAAQ,GAAG,CAAC,CAAC,CAACS,MAAM,CAAC/B,yBAAyB,CAAC,GAAG,CAAC,EAAE;AACvE,MAAA;AACD,IAAA;AACAsB,IAAAA,QAAQ,GAAGD,QAAQ,CAACU,MAAM,CAAC/B,yBAAyB,CAAC;IACrDqB,QAAQ,GAAGA,QAAQ,CAACW,OAAO,CAAChC,yBAAyB,EAAE6B,KAAK,CAAC;AAC9D,EAAA;AACA,EAAA,OAAO,CAACR,QAAQ,EAAEC,QAAQ,CAAC;AAC5B;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"AsYouTypeFormatter.util.js","sources":["../../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n// Should be the same as `DIGIT_PLACEHOLDER` in `libphonenumber-metadata-generator`.\nexport var DIGIT_PLACEHOLDER = 'x'; // '\\u2008' (punctuation space)\n\nvar DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER); // Counts all occurences of a symbol in a string.\n// Unicode-unsafe (because using `.split()`).\n\nexport function countOccurences(symbol, string) {\n var count = 0; // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for counting brackets it is safe.\n // for (const character of string)\n\n for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n\n if (character === symbol) {\n count++;\n }\n }\n\n return count;\n} // Repeats a string (or a symbol) N times.\n// http://stackoverflow.com/questions/202605/repeat-string-javascript\n\nexport function repeat(string, times) {\n if (times < 1) {\n return '';\n }\n\n var result = '';\n\n while (times > 1) {\n if (times & 1) {\n result += string;\n }\n\n times >>= 1;\n string += string;\n }\n\n return result + string;\n}\nexport function cutAndStripNonPairedParens(string, cutBeforeIndex) {\n if (string[cutBeforeIndex] === ')') {\n cutBeforeIndex++;\n }\n\n return stripNonPairedParens(string.slice(0, cutBeforeIndex));\n}\nexport function closeNonPairedParens(template, cut_before) {\n var retained_template = template.slice(0, cut_before);\n var opening_braces = countOccurences('(', retained_template);\n var closing_braces = countOccurences(')', retained_template);\n var dangling_braces = opening_braces - closing_braces;\n\n while (dangling_braces > 0 && cut_before < template.length) {\n if (template[cut_before] === ')') {\n dangling_braces--;\n }\n\n cut_before++;\n }\n\n return template.slice(0, cut_before);\n}\nexport function stripNonPairedParens(string) {\n var dangling_braces = [];\n var i = 0;\n\n while (i < string.length) {\n if (string[i] === '(') {\n dangling_braces.push(i);\n } else if (string[i] === ')') {\n dangling_braces.pop();\n }\n\n i++;\n }\n\n var start = 0;\n var cleared_string = '';\n dangling_braces.push(string.length);\n\n for (var _i = 0, _dangling_braces = dangling_braces; _i < _dangling_braces.length; _i++) {\n var index = _dangling_braces[_i];\n cleared_string += string.slice(start, index);\n start = index + 1;\n }\n\n return cleared_string;\n}\nexport function populateTemplateWithDigits(template, position, digits) {\n // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for `digits` it is safe.\n // for (const digit of digits)\n for (var _iterator2 = _createForOfIteratorHelperLoose(digits.split('')), _step2; !(_step2 = _iterator2()).done;) {\n var digit = _step2.value;\n\n // If there is room for more digits in current `template`,\n // then set the next digit in the `template`,\n // and return the formatted digits so far.\n // If more digits are entered than the current format could handle.\n if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {\n return;\n }\n\n position = template.search(DIGIT_PLACEHOLDER_MATCHER);\n template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);\n }\n\n return [template, position];\n}\n//# sourceMappingURL=AsYouTypeFormatter.util.js.map"],"names":["DIGIT_PLACEHOLDER","DIGIT_PLACEHOLDER_MATCHER","RegExp","repeat","string","times","result","cutAndStripNonPairedParens","cutBeforeIndex","stripNonPairedParens","slice","dangling_braces","i","length","push","pop","start","cleared_string","_i","_dangling_braces","index","populateTemplateWithDigits","template","position","digits","_iterator2","_createForOfIterator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