@rpcbase/ui 0.206.0 → 0.208.0

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 (232) hide show
  1. package/dist/index.js +7 -7
  2. package/dist/index19.js +1 -1
  3. package/dist/index19.js.map +1 -1
  4. package/dist/index200.js +56 -55
  5. package/dist/index200.js.map +1 -1
  6. package/dist/index201.js +60 -8
  7. package/dist/index201.js.map +1 -1
  8. package/dist/index202.js +7 -15
  9. package/dist/index202.js.map +1 -1
  10. package/dist/index203.js +15 -143
  11. package/dist/index203.js.map +1 -1
  12. package/dist/index204.js +145 -4
  13. package/dist/index204.js.map +1 -1
  14. package/dist/index205.js +4 -11
  15. package/dist/index205.js.map +1 -1
  16. package/dist/index206.js +10 -104
  17. package/dist/index206.js.map +1 -1
  18. package/dist/index207.js +94 -347
  19. package/dist/index207.js.map +1 -1
  20. package/dist/index208.js +349 -87
  21. package/dist/index208.js.map +1 -1
  22. package/dist/index209.js +73 -304
  23. package/dist/index209.js.map +1 -1
  24. package/dist/index210.js +309 -193
  25. package/dist/index210.js.map +1 -1
  26. package/dist/index211.js +211 -19
  27. package/dist/index211.js.map +1 -1
  28. package/dist/index212.js +18 -27
  29. package/dist/index212.js.map +1 -1
  30. package/dist/index213.js +27 -187
  31. package/dist/index213.js.map +1 -1
  32. package/dist/index214.js +186 -16
  33. package/dist/index214.js.map +1 -1
  34. package/dist/index215.js +18 -44
  35. package/dist/index215.js.map +1 -1
  36. package/dist/index216.js +60 -8
  37. package/dist/index216.js.map +1 -1
  38. package/dist/index217.js +42 -23
  39. package/dist/index217.js.map +1 -1
  40. package/dist/index218.js +9 -44
  41. package/dist/index218.js.map +1 -1
  42. package/dist/index219.js +25 -18
  43. package/dist/index219.js.map +1 -1
  44. package/dist/index220.js +45 -3
  45. package/dist/index220.js.map +1 -1
  46. package/dist/index221.js +17 -4
  47. package/dist/index221.js.map +1 -1
  48. package/dist/index222.js +3 -21
  49. package/dist/index222.js.map +1 -1
  50. package/dist/index223.js +4 -24
  51. package/dist/index223.js.map +1 -1
  52. package/dist/index224.js +17 -64
  53. package/dist/index224.js.map +1 -1
  54. package/dist/index225.js +23 -13
  55. package/dist/index225.js.map +1 -1
  56. package/dist/index226.js +68 -4
  57. package/dist/index226.js.map +1 -1
  58. package/dist/index227.js +14 -50
  59. package/dist/index227.js.map +1 -1
  60. package/dist/index228.js +4 -6
  61. package/dist/index228.js.map +1 -1
  62. package/dist/index229.js +50 -26
  63. package/dist/index229.js.map +1 -1
  64. package/dist/index230.js +5 -13
  65. package/dist/index230.js.map +1 -1
  66. package/dist/index231.js +25 -8
  67. package/dist/index231.js.map +1 -1
  68. package/dist/index232.js +17 -3
  69. package/dist/index232.js.map +1 -0
  70. package/dist/index233.js +8 -24
  71. package/dist/index233.js.map +1 -1
  72. package/dist/index234.js +2 -71
  73. package/dist/index235.js +29 -3
  74. package/dist/index235.js.map +1 -0
  75. package/dist/index236.js +69 -12
  76. package/dist/index236.js.map +1 -1
  77. package/dist/index237.js +3 -54
  78. package/dist/index238.js +11 -114
  79. package/dist/index238.js.map +1 -1
  80. package/dist/index239.js +51 -6
  81. package/dist/index239.js.map +1 -1
  82. package/dist/index240.js +115 -13
  83. package/dist/index240.js.map +1 -1
  84. package/dist/index241.js +6 -687
  85. package/dist/index241.js.map +1 -1
  86. package/dist/index242.js +13 -253
  87. package/dist/index242.js.map +1 -1
  88. package/dist/index243.js +662 -676
  89. package/dist/index243.js.map +1 -1
  90. package/dist/index244.js +252 -7430
  91. package/dist/index244.js.map +1 -1
  92. package/dist/index245.js +700 -6
  93. package/dist/index245.js.map +1 -1
  94. package/dist/index246.js +7429 -11
  95. package/dist/index246.js.map +1 -1
  96. package/dist/index247.js +5 -4
  97. package/dist/index247.js.map +1 -1
  98. package/dist/index248.js +11 -458
  99. package/dist/index248.js.map +1 -1
  100. package/dist/index249.js +5 -37
  101. package/dist/index249.js.map +1 -1
  102. package/dist/index250.js +458 -18
  103. package/dist/index250.js.map +1 -1
  104. package/dist/index251.js +34 -24
  105. package/dist/index251.js.map +1 -1
  106. package/dist/index252.js +19 -4
  107. package/dist/index252.js.map +1 -1
  108. package/dist/index253.js +23 -54
  109. package/dist/index253.js.map +1 -1
  110. package/dist/index254.js +4 -7
  111. package/dist/index254.js.map +1 -1
  112. package/dist/index255.js +57 -11
  113. package/dist/index255.js.map +1 -1
  114. package/dist/index256.js +8 -3
  115. package/dist/index256.js.map +1 -1
  116. package/dist/index257.js +12 -16
  117. package/dist/index257.js.map +1 -1
  118. package/dist/index258.js +3 -26
  119. package/dist/index258.js.map +1 -1
  120. package/dist/index259.js +15 -42
  121. package/dist/index259.js.map +1 -1
  122. package/dist/index260.js +25 -13
  123. package/dist/index260.js.map +1 -1
  124. package/dist/index261.js +40 -22
  125. package/dist/index261.js.map +1 -1
  126. package/dist/index262.js +13 -17
  127. package/dist/index262.js.map +1 -1
  128. package/dist/index263.js +24 -34
  129. package/dist/index263.js.map +1 -1
  130. package/dist/index264.js +17 -5
  131. package/dist/index264.js.map +1 -1
  132. package/dist/index265.js +35 -9
  133. package/dist/index265.js.map +1 -1
  134. package/dist/index266.js +5 -8
  135. package/dist/index266.js.map +1 -1
  136. package/dist/index267.js +9 -9
  137. package/dist/index267.js.map +1 -1
  138. package/dist/index268.js +8 -10
  139. package/dist/index268.js.map +1 -1
  140. package/dist/index269.js +9 -7
  141. package/dist/index269.js.map +1 -1
  142. package/dist/index270.js +9 -72
  143. package/dist/index270.js.map +1 -1
  144. package/dist/index271.js +7 -171
  145. package/dist/index271.js.map +1 -1
  146. package/dist/index272.js +63 -104
  147. package/dist/index272.js.map +1 -1
  148. package/dist/index273.js +169 -12
  149. package/dist/index273.js.map +1 -1
  150. package/dist/index274.js +109 -75
  151. package/dist/index274.js.map +1 -1
  152. package/dist/index275.js +12 -44
  153. package/dist/index275.js.map +1 -1
  154. package/dist/index276.js +79 -12
  155. package/dist/index276.js.map +1 -1
  156. package/dist/index277.js +45 -15
  157. package/dist/index277.js.map +1 -1
  158. package/dist/index278.js +12 -98
  159. package/dist/index278.js.map +1 -1
  160. package/dist/index279.js +15 -55
  161. package/dist/index279.js.map +1 -1
  162. package/dist/index280.js +89 -98
  163. package/dist/index280.js.map +1 -1
  164. package/dist/index281.js +27 -42
  165. package/dist/index281.js.map +1 -1
  166. package/dist/index282.js +92 -97
  167. package/dist/index282.js.map +1 -1
  168. package/dist/index283.js +62 -46
  169. package/dist/index283.js.map +1 -1
  170. package/dist/index284.js +108 -38
  171. package/dist/index284.js.map +1 -1
  172. package/dist/index285.js +48 -135
  173. package/dist/index285.js.map +1 -1
  174. package/dist/index286.js +43 -139
  175. package/dist/index286.js.map +1 -1
  176. package/dist/index287.js +105 -217
  177. package/dist/index287.js.map +1 -1
  178. package/dist/index288.js +109 -210
  179. package/dist/index288.js.map +1 -1
  180. package/dist/index289.js +168 -212
  181. package/dist/index289.js.map +1 -1
  182. package/dist/index290.js +240 -5
  183. package/dist/index290.js.map +1 -1
  184. package/dist/index291.js +298 -6
  185. package/dist/index291.js.map +1 -1
  186. package/dist/index292.js +5 -7
  187. package/dist/index292.js.map +1 -1
  188. package/dist/index293.js +4 -4
  189. package/dist/index293.js.map +1 -1
  190. package/dist/index294.js +7 -6
  191. package/dist/index294.js.map +1 -1
  192. package/dist/index295.js +6 -21
  193. package/dist/index295.js.map +1 -1
  194. package/dist/index296.js +6 -10
  195. package/dist/index296.js.map +1 -1
  196. package/dist/index297.js +18 -123
  197. package/dist/index297.js.map +1 -1
  198. package/dist/index298.js +10 -164
  199. package/dist/index298.js.map +1 -1
  200. package/dist/index299.js +116 -58
  201. package/dist/index299.js.map +1 -1
  202. package/dist/index300.js +161 -106
  203. package/dist/index300.js.map +1 -1
  204. package/dist/index301.js +66 -489
  205. package/dist/index301.js.map +1 -1
  206. package/dist/index302.js +106 -59
  207. package/dist/index302.js.map +1 -1
  208. package/dist/index303.js +492 -4
  209. package/dist/index303.js.map +1 -1
  210. package/dist/index304.js +62 -27
  211. package/dist/index304.js.map +1 -1
  212. package/dist/index305.js +4 -66
  213. package/dist/index305.js.map +1 -1
  214. package/dist/index306.js +27 -152
  215. package/dist/index306.js.map +1 -1
  216. package/dist/index307.js +59 -555
  217. package/dist/index307.js.map +1 -1
  218. package/dist/index308.js +143 -201
  219. package/dist/index308.js.map +1 -1
  220. package/dist/index309.js +56 -326
  221. package/dist/index309.js.map +1 -1
  222. package/dist/index310.js +553 -260
  223. package/dist/index310.js.map +1 -1
  224. package/dist/index311.js +214 -0
  225. package/dist/index311.js.map +1 -0
  226. package/dist/index312.js +335 -0
  227. package/dist/index312.js.map +1 -0
  228. package/dist/index313.js +272 -0
  229. package/dist/index313.js.map +1 -0
  230. package/package.json +2 -2
  231. package/dist/index234.js.map +0 -1
  232. package/dist/index237.js.map +0 -1
package/dist/index266.js CHANGED
@@ -1,12 +1,9 @@
1
- import { Metadata as e } from "./index248.js";
2
- //#region ../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js
3
- var t = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
4
- function n(n, r, i) {
5
- var a = new e(i);
6
- if (a.selectNumberingPlan(n, r), a.defaultIDDPrefix()) return a.defaultIDDPrefix();
7
- if (t.test(a.IDDPrefix())) return a.IDDPrefix();
1
+ import { VALID_PUNCTUATION as e } from "./index258.js";
2
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js
3
+ function t(t) {
4
+ return t.replace(RegExp(`[${e}]+`, "g"), " ").trim();
8
5
  }
9
6
  //#endregion
10
- export { n as default };
7
+ export { t as default };
11
8
 
12
9
  //# sourceMappingURL=index266.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index266.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js"],"sourcesContent":["import Metadata from '../metadata.js';\n\n/**\r\n * Pattern that makes it easy to distinguish whether a region has a single\r\n * international dialing prefix or not. If a region has a single international\r\n * prefix (e.g. 011 in USA), it will be represented as a string that contains\r\n * a sequence of ASCII digits, and possibly a tilde, which signals waiting for\r\n * the tone. If there are multiple available international prefixes in a\r\n * region, they will be represented as a regex string that always contains one\r\n * or more characters that are not ASCII digits or a tilde.\r\n */\nvar SINGLE_IDD_PREFIX_REG_EXP = /^[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?$/;\n\n// If the `country` supports IDD calling, it returns a preferred IDD prefix.\n// If the `country` doesn't support IDD calling, it returns `undefined`.\nexport default function getIddPrefix(country, callingCode, metadata) {\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country, callingCode);\n if (countryMetadata.defaultIDDPrefix()) {\n return countryMetadata.defaultIDDPrefix();\n }\n if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {\n return countryMetadata.IDDPrefix();\n }\n}\n//# sourceMappingURL=getIddPrefix.js.map"],"x_google_ignoreList":[0],"mappings":";;AAWA,IAAI,IAA4B;AAIhC,SAAwB,EAAa,GAAS,GAAa,GAAU;CACnE,IAAI,IAAkB,IAAI,EAAS,EAAS;AAE5C,KADA,EAAgB,oBAAoB,GAAS,EAAY,EACrD,EAAgB,kBAAkB,CACpC,QAAO,EAAgB,kBAAkB;AAE3C,KAAI,EAA0B,KAAK,EAAgB,WAAW,CAAC,CAC7D,QAAO,EAAgB,WAAW"}
1
+ {"version":3,"file":"index266.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js"],"sourcesContent":["import { VALID_PUNCTUATION } from '../constants.js';\n\n// Removes brackets and replaces dashes with spaces.\n//\n// E.g. \"(999) 111-22-33\" -> \"999 111 22 33\"\n//\n// For some reason Google's metadata contains `<intlFormat/>`s with brackets and dashes.\n// Meanwhile, there's no single opinion about using punctuation in international phone numbers.\n//\n// For example, Google's `<intlFormat/>` for USA is `+1 213-373-4253`.\n// And here's a quote from WikiPedia's \"North American Numbering Plan\" page:\n// https://en.wikipedia.org/wiki/North_American_Numbering_Plan\n//\n// \"The country calling code for all countries participating in the NANP is 1.\n// In international format, an NANP number should be listed as +1 301 555 01 00,\n// where 301 is an area code (Maryland).\"\n//\n// I personally prefer the international format without any punctuation.\n// For example, brackets are remnants of the old age, meaning that the\n// phone number part in brackets (so called \"area code\") can be omitted\n// if dialing within the same \"area\".\n// And hyphens were clearly introduced for splitting local numbers into memorizable groups.\n// For example, remembering \"5553535\" is difficult but \"555-35-35\" is much simpler.\n// Imagine a man taking a bus from home to work and seeing an ad with a phone number.\n// He has a couple of seconds to memorize that number until it passes by.\n// If it were spaces instead of hyphens the man wouldn't necessarily get it,\n// but with hyphens instead of spaces the grouping is more explicit.\n// I personally think that hyphens introduce visual clutter,\n// so I prefer replacing them with spaces in international numbers.\n// In the modern age all output is done on displays where spaces are clearly distinguishable\n// so hyphens can be safely replaced with spaces without losing any legibility.\n//\nexport default function applyInternationalSeparatorStyle(formattedNumber) {\n return formattedNumber.replace(new RegExp(\"[\".concat(VALID_PUNCTUATION, \"]+\"), 'g'), ' ').trim();\n}\n//# sourceMappingURL=applyInternationalSeparatorStyle.js.map"],"x_google_ignoreList":[0],"mappings":";;AAgCA,SAAwB,EAAiC,GAAiB;AACxE,QAAO,EAAgB,QAAY,OAAO,IAAW,OAA0B,IAAI,EAAE,IAAI,CAAC,MAAM"}
package/dist/index267.js CHANGED
@@ -1,13 +1,13 @@
1
- import { VALID_DIGITS as e } from "./index256.js";
2
- //#region ../../node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js
3
- var t = ";ext=", n = function(t) {
4
- return `([${e}]{1,${t}})`;
5
- };
6
- function r(e) {
7
- var r = "20", i = "15", a = "9", o = "6", s = "[ \xA0\\t,]*", c = "[:\\..]?[ \xA0\\t,-]*", l = "#?", u = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", d = "(?:[xx##~~]|int|int)", f = "[- ]+", p = "[ \xA0\\t]*", m = "(?:,{2}|;)", h = t + n(r), g = s + u + c + n(r) + l, _ = s + d + c + n(a) + l, v = f + n(o) + "#", y = p + m + c + n(i) + l, b = p + "(?:,)+" + c + n(a) + l;
8
- return h + "|" + g + "|" + _ + "|" + v + "|" + y + "|" + b;
1
+ import e from "./index266.js";
2
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js
3
+ var t = /(\$\d)/;
4
+ function n(n, r, i) {
5
+ var a = i.useInternationalFormat, o = i.withNationalPrefix;
6
+ i.carrierCode, i.metadata;
7
+ var s = n.replace(new RegExp(r.pattern()), a ? r.internationalFormat() : o && r.nationalPrefixFormattingRule() ? r.format().replace(t, r.nationalPrefixFormattingRule()) : r.format());
8
+ return a ? e(s) : s;
9
9
  }
10
10
  //#endregion
11
- export { r as default };
11
+ export { t as FIRST_GROUP_PATTERN, n as default };
12
12
 
13
13
  //# sourceMappingURL=index267.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index267.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js"],"sourcesContent":["import { VALID_DIGITS } from '../../constants.js';\n\n// The RFC 3966 format for extensions.\nvar RFC3966_EXTN_PREFIX = ';ext=';\n\n/**\r\n * Helper method for constructing regular expressions for parsing. Creates\r\n * an expression that captures up to max_length digits.\r\n * @return {string} RegEx pattern to capture extension digits.\r\n */\nvar getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {\n return \"([\".concat(VALID_DIGITS, \"]{1,\").concat(maxLength, \"})\");\n};\n\n/**\r\n * Helper initialiser method to create the regular-expression pattern to match\r\n * extensions.\r\n * Copy-pasted from Google's `libphonenumber`:\r\n * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766\r\n * @return {string} RegEx pattern to capture extensions.\r\n */\nexport default function createExtensionPattern(purpose) {\n // We cap the maximum length of an extension based on the ambiguity of the way\n // the extension is prefixed. As per ITU, the officially allowed length for\n // extensions is actually 40, but we don't support this since we haven't seen real\n // examples and this introduces many false interpretations as the extension labels\n // are not standardized.\n /** @type {string} */\n var extLimitAfterExplicitLabel = '20';\n /** @type {string} */\n var extLimitAfterLikelyLabel = '15';\n /** @type {string} */\n var extLimitAfterAmbiguousChar = '9';\n /** @type {string} */\n var extLimitWhenNotSure = '6';\n\n /** @type {string} */\n var possibleSeparatorsBetweenNumberAndExtLabel = \"[ \\xA0\\\\t,]*\";\n // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.\n /** @type {string} */\n var possibleCharsAfterExtLabel = \"[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*\";\n /** @type {string} */\n var optionalExtnSuffix = \"#?\";\n\n // Here the extension is called out in more explicit way, i.e mentioning it obvious\n // patterns like \"ext.\".\n /** @type {string} */\n var explicitExtLabels = \"(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|\\u0434\\u043E\\u0431|anexo)\";\n // One-character symbols that can be used to indicate an extension, and less\n // commonly used or more ambiguous extension labels.\n /** @type {string} */\n var ambiguousExtLabels = \"(?:[x\\uFF58#\\uFF03~\\uFF5E]|int|\\uFF49\\uFF4E\\uFF54)\";\n // When extension is not separated clearly.\n /** @type {string} */\n var ambiguousSeparator = \"[- ]+\";\n // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching\n // comma as extension label may have it.\n /** @type {string} */\n var possibleSeparatorsNumberExtLabelNoComma = \"[ \\xA0\\\\t]*\";\n // \",,\" is commonly used for auto dialling the extension when connected. First\n // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do\n // not repeat it here. Semi-colon works in Iphone and Android also to pop up a\n // button with the extension number following.\n /** @type {string} */\n var autoDiallingAndExtLabelsFound = \"(?:,{2}|;)\";\n\n /** @type {string} */\n var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);\n /** @type {string} */\n var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;\n /** @type {string} */\n var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n /** @type {string} */\n var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + \"#\";\n\n /** @type {string} */\n var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;\n /** @type {string} */\n var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + \"(?:,)+\" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n\n // The first regular expression covers RFC 3966 format, where the extension is added\n // using \";ext=\". The second more generic where extension is mentioned with explicit\n // labels like \"ext:\". In both the above cases we allow more numbers in extension than\n // any other extension labels. The third one captures when single character extension\n // labels or less commonly used labels are used. In such cases we capture fewer\n // extension digits in order to reduce the chance of falsely interpreting two\n // numbers beside each other as a number + extension. The fourth one covers the\n // special case of American numbers where the extension is written with a hash\n // at the end, such as \"- 503#\". The fifth one is exclusively for extension\n // autodialling formats which are used when dialling and in this case we accept longer\n // extensions. The last one is more liberal on the number of commas that acts as\n // extension labels, so we have a strict cap on the number of digits in such extensions.\n return rfcExtn + \"|\" + explicitExtn + \"|\" + ambiguousExtn + \"|\" + americanStyleExtnWithSuffix + \"|\" + autoDiallingExtn + \"|\" + onlyCommasExtn;\n}\n//# sourceMappingURL=createExtensionPattern.js.map"],"x_google_ignoreList":[0],"mappings":";;AAGA,IAAI,IAAsB,SAOtB,IAA4B,SAAmC,GAAW;AAC5E,QAAO,KAAY,QAA6B;;AAUlD,SAAwB,EAAuB,GAAS;CAOtD,IAAI,IAA6B,MAE7B,IAA2B,MAE3B,IAA6B,KAE7B,IAAsB,KAGtB,IAA6C,gBAG7C,IAA6B,yBAE7B,IAAqB,MAKrB,IAAoB,iDAIpB,IAAqB,wBAGrB,IAAqB,SAIrB,IAA0C,eAM1C,IAAgC,cAGhC,IAAU,IAAsB,EAA0B,EAA2B,EAErF,IAAe,IAA6C,IAAoB,IAA6B,EAA0B,EAA2B,GAAG,GAErK,IAAgB,IAA6C,IAAqB,IAA6B,EAA0B,EAA2B,GAAG,GAEvK,IAA8B,IAAqB,EAA0B,EAAoB,GAAG,KAGpG,IAAmB,IAA0C,IAAgC,IAA6B,EAA0B,EAAyB,GAAG,GAEhL,IAAiB,IAA0C,WAAW,IAA6B,EAA0B,EAA2B,GAAG;AAc/J,QAAO,IAAU,MAAM,IAAe,MAAM,IAAgB,MAAM,IAA8B,MAAM,IAAmB,MAAM"}
1
+ {"version":3,"file":"index267.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js"],"sourcesContent":["import applyInternationalSeparatorStyle from './applyInternationalSeparatorStyle.js';\n\n// This was originally set to $1 but there are some countries for which the\n// first group is not used in the national pattern (e.g. Argentina) so the $1\n// group does not match correctly. Therefore, we use `\\d`, so that the first\n// group actually used in the pattern will be matched.\nexport var FIRST_GROUP_PATTERN = /(\\$\\d)/;\nexport default function formatNationalNumberUsingFormat(number, format, _ref) {\n var useInternationalFormat = _ref.useInternationalFormat,\n withNationalPrefix = _ref.withNationalPrefix,\n carrierCode = _ref.carrierCode,\n metadata = _ref.metadata;\n var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() :\n // This library doesn't use `domestic_carrier_code_formatting_rule`,\n // because that one is only used when formatting phone numbers\n // for dialing from a mobile phone, and this is not a dialing library.\n // carrierCode && format.domesticCarrierCodeFormattingRule()\n // \t// First, replace the $CC in the formatting rule with the desired carrier code.\n // \t// Then, replace the $FG in the formatting rule with the first group\n // \t// and the carrier code combined in the appropriate way.\n // \t? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))\n // \t: (\n // \t\twithNationalPrefix && format.nationalPrefixFormattingRule()\n // \t\t\t? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())\n // \t\t\t: format.format()\n // \t)\n withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format());\n if (useInternationalFormat) {\n return applyInternationalSeparatorStyle(formattedNumber);\n }\n return formattedNumber;\n}\n//# sourceMappingURL=formatNationalNumberUsingFormat.js.map"],"x_google_ignoreList":[0],"mappings":";;AAMA,IAAW,IAAsB;AACjC,SAAwB,EAAgC,GAAQ,GAAQ,GAAM;CAC5E,IAAI,IAAyB,EAAK,wBAChC,IAAqB,EAAK;AAEf,CADG,EAAK,aACR,EAAK;CAClB,IAAI,IAAkB,EAAO,QAAQ,IAAI,OAAO,EAAO,SAAS,CAAC,EAAE,IAAyB,EAAO,qBAAqB,GAcxH,KAAsB,EAAO,8BAA8B,GAAG,EAAO,QAAQ,CAAC,QAAQ,GAAqB,EAAO,8BAA8B,CAAC,GAAG,EAAO,QAAQ,CAAC;AAIpK,QAHI,IACK,EAAiC,EAAgB,GAEnD"}
package/dist/index268.js CHANGED
@@ -1,14 +1,12 @@
1
- import { PLUS_CHARS as e, VALID_DIGITS as t, VALID_PUNCTUATION as n } from "./index256.js";
2
- import r from "./index267.js";
3
- //#region ../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js
4
- var i = "[" + t + "]{2}", a = "[" + e + "]{0,1}(?:[" + n + "]*[" + t + "]){3,}[" + n + t + "]*", o = RegExp("^[" + e + "]{0,1}(?:[" + n + "]*[" + t + "]){1,2}$", "i"), s = a + "(?:" + r() + ")?", c = RegExp("^" + i + "$|^" + s + "$", "i");
5
- function l(e) {
6
- return e.length >= 2 && c.test(e);
7
- }
8
- function u(e) {
9
- return o.test(e);
1
+ import { Metadata as e } from "./index250.js";
2
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js
3
+ var t = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
4
+ function n(n, r, i) {
5
+ var a = new e(i);
6
+ if (a.selectNumberingPlan(n, r), a.defaultIDDPrefix()) return a.defaultIDDPrefix();
7
+ if (t.test(a.IDDPrefix())) return a.IDDPrefix();
10
8
  }
11
9
  //#endregion
12
- export { l as default, u as isViablePhoneNumberStart };
10
+ export { n as default };
13
11
 
14
12
  //# sourceMappingURL=index268.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index268.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js"],"sourcesContent":["import { MIN_LENGTH_FOR_NSN, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from '../constants.js';\nimport createExtensionPattern from './extension/createExtensionPattern.js';\n\n// Regular expression of viable phone numbers. This is location independent.\n// Checks we have at least three leading digits, and only valid punctuation,\n// alpha characters and digits in the phone number. Does not include extension\n// data. The symbol 'x' is allowed here as valid punctuation since it is often\n// used as a placeholder for carrier codes, for example in Brazilian phone\n// numbers. We also allow multiple '+' characters at the start.\n//\n// Corresponds to the following:\n// [digits]{minLengthNsn}|\n// plus_sign*\n// (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*\n//\n// The first reg-ex is to allow short numbers (two digits long) to be parsed if\n// they are entered as \"15\" etc, but only if there is no punctuation in them.\n// The second expression restricts the number of digits to three or more, but\n// then allows them to be in international form, and to have alpha-characters\n// and punctuation. We split up the two reg-exes here and combine them when\n// creating the reg-ex VALID_PHONE_NUMBER_PATTERN itself so we can prefix it\n// with ^ and append $ to each branch.\n//\n// \"Note VALID_PUNCTUATION starts with a -,\n// so must be the first in the range\" (c) Google devs.\n// (wtf did they mean by saying that; probably nothing)\n//\nvar MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + VALID_DIGITS + ']{' + MIN_LENGTH_FOR_NSN + '}';\n//\n// And this is the second reg-exp:\n// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)\n//\nexport var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\n\n// This regular expression isn't present in Google's `libphonenumber`\n// and is only used to determine whether the phone number being input\n// is too short for it to even consider it a \"valid\" number.\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\nvar VALID_PHONE_NUMBER_START_REG_EXP = new RegExp('^' + '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){1,2}' + '$', 'i');\nexport var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER +\n// Phone number extensions\n'(?:' + createExtensionPattern() + ')?';\n\n// The combined regular expression for valid phone numbers:\n//\nvar VALID_PHONE_NUMBER_PATTERN = new RegExp(\n// Either a short two-digit-only phone number\n'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' +\n// Or a longer fully parsed phone number (min 3 characters)\n'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i');\n\n// Checks to see if the string of characters could possibly be a phone number at\n// all. At the moment, checks to see that the string begins with at least 2\n// digits, ignoring any punctuation commonly found in phone numbers. This method\n// does not require the number to be normalized in advance - but does assume\n// that leading non-number symbols have been removed, such as by the method\n// `extract_possible_number`.\n//\nexport default function isViablePhoneNumber(number) {\n return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);\n}\n\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\nexport function isViablePhoneNumberStart(number) {\n return VALID_PHONE_NUMBER_START_REG_EXP.test(number);\n}\n//# sourceMappingURL=isViablePhoneNumber.js.map"],"x_google_ignoreList":[0],"mappings":";;;AA2BA,IAAI,IAAkC,MAAM,IAAe,QAKhD,IAAqB,MAAM,IAAa,eAAyB,IAAoB,QAAa,IAAe,YAAsB,IAAoB,IAAe,MAWjL,IAAuC,OAAO,OAAY,IAAa,eAAyB,IAAoB,QAAa,IAAe,YAAsB,IAAI,EACnK,IAAoC,IAE/C,QAAQ,GAAwB,GAAG,MAI/B,IAAiC,OAErC,MAAM,IAAkC,QAElC,IAAoC,KAAK,IAAI;AASnD,SAAwB,EAAoB,GAAQ;AAClD,QAAO,EAAO,UAAA,KAAgC,EAA2B,KAAK,EAAO;;AASvF,SAAgB,EAAyB,GAAQ;AAC/C,QAAO,EAAiC,KAAK,EAAO"}
1
+ {"version":3,"file":"index268.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js"],"sourcesContent":["import Metadata from '../metadata.js';\n\n/**\r\n * Pattern that makes it easy to distinguish whether a region has a single\r\n * international dialing prefix or not. If a region has a single international\r\n * prefix (e.g. 011 in USA), it will be represented as a string that contains\r\n * a sequence of ASCII digits, and possibly a tilde, which signals waiting for\r\n * the tone. If there are multiple available international prefixes in a\r\n * region, they will be represented as a regex string that always contains one\r\n * or more characters that are not ASCII digits or a tilde.\r\n */\nvar SINGLE_IDD_PREFIX_REG_EXP = /^[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?$/;\n\n// If the `country` supports IDD calling, it returns a preferred IDD prefix.\n// If the `country` doesn't support IDD calling, it returns `undefined`.\nexport default function getIddPrefix(country, callingCode, metadata) {\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country, callingCode);\n if (countryMetadata.defaultIDDPrefix()) {\n return countryMetadata.defaultIDDPrefix();\n }\n if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {\n return countryMetadata.IDDPrefix();\n }\n}\n//# sourceMappingURL=getIddPrefix.js.map"],"x_google_ignoreList":[0],"mappings":";;AAWA,IAAI,IAA4B;AAIhC,SAAwB,EAAa,GAAS,GAAa,GAAU;CACnE,IAAI,IAAkB,IAAI,EAAS,EAAS;AAE5C,KADA,EAAgB,oBAAoB,GAAS,EAAY,EACrD,EAAgB,kBAAkB,CACpC,QAAO,EAAgB,kBAAkB;AAE3C,KAAI,EAA0B,KAAK,EAAgB,WAAW,CAAC,CAC7D,QAAO,EAAgB,WAAW"}
package/dist/index269.js CHANGED
@@ -1,11 +1,13 @@
1
- //#region ../../node_modules/libphonenumber-js/es6/helpers/RFC3966.js
2
- function e(e) {
3
- var t = e.number, n = e.ext;
4
- if (!t) return "";
5
- if (t[0] !== "+") throw Error("\"formatRFC3966()\" expects \"number\" to be in E.164 format.");
6
- return `tel:${t}${n ? ";ext=" + n : ""}`;
1
+ import { VALID_DIGITS as e } from "./index258.js";
2
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js
3
+ var t = ";ext=", n = function(t) {
4
+ return `([${e}]{1,${t}})`;
5
+ };
6
+ function r(e) {
7
+ var r = "20", i = "15", a = "9", o = "6", s = "[ \xA0\\t,]*", c = "[:\\..]?[ \xA0\\t,-]*", l = "#?", u = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", d = "(?:[xx##~~]|int|int)", f = "[- ]+", p = "[ \xA0\\t]*", m = "(?:,{2}|;)", h = t + n(r), g = s + u + c + n(r) + l, _ = s + d + c + n(a) + l, v = f + n(o) + "#", y = p + m + c + n(i) + l, b = p + "(?:,)+" + c + n(a) + l;
8
+ return h + "|" + g + "|" + _ + "|" + v + "|" + y + "|" + b;
7
9
  }
8
10
  //#endregion
9
- export { e as formatRFC3966 };
11
+ export { r as default };
10
12
 
11
13
  //# sourceMappingURL=index269.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index269.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/RFC3966.js"],"sourcesContent":["function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\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; }\nimport isViablePhoneNumber from './isViablePhoneNumber.js';\n\n// https://www.ietf.org/rfc/rfc3966.txt\n\n/**\r\n * @param {string} text - Phone URI (RFC 3966).\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\nexport function parseRFC3966(text) {\n var number;\n var ext;\n\n // Replace \"tel:\" with \"tel=\" for parsing convenience.\n text = text.replace(/^tel:/, 'tel=');\n for (var _iterator = _createForOfIteratorHelperLoose(text.split(';')), _step; !(_step = _iterator()).done;) {\n var part = _step.value;\n var _part$split = part.split('='),\n _part$split2 = _slicedToArray(_part$split, 2),\n name = _part$split2[0],\n value = _part$split2[1];\n switch (name) {\n case 'tel':\n number = value;\n break;\n case 'ext':\n ext = value;\n break;\n case 'phone-context':\n // Only \"country contexts\" are supported.\n // \"Domain contexts\" are ignored.\n if (value[0] === '+') {\n number = value + number;\n }\n break;\n }\n }\n\n // If the phone number is not viable, then abort.\n if (!isViablePhoneNumber(number)) {\n return {};\n }\n var result = {\n number: number\n };\n if (ext) {\n result.ext = ext;\n }\n return result;\n}\n\n/**\r\n * @param {object} - `{ ?number, ?extension }`.\r\n * @return {string} Phone URI (RFC 3966).\r\n */\nexport function formatRFC3966(_ref) {\n var number = _ref.number,\n ext = _ref.ext;\n if (!number) {\n return '';\n }\n if (number[0] !== '+') {\n throw new Error(\"\\\"formatRFC3966()\\\" expects \\\"number\\\" to be in E.164 format.\");\n }\n return \"tel:\".concat(number).concat(ext ? ';ext=' + ext : '');\n}\n//# sourceMappingURL=RFC3966.js.map"],"x_google_ignoreList":[0],"mappings":";AA6DA,SAAgB,EAAc,GAAM;CAClC,IAAI,IAAS,EAAK,QAChB,IAAM,EAAK;AACb,KAAI,CAAC,EACH,QAAO;AAET,KAAI,EAAO,OAAO,IAChB,OAAU,MAAM,gEAAgE;AAElF,QAAO,OAAc,IAAe,IAAM,UAAU,IAAM"}
1
+ {"version":3,"file":"index269.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js"],"sourcesContent":["import { VALID_DIGITS } from '../../constants.js';\n\n// The RFC 3966 format for extensions.\nvar RFC3966_EXTN_PREFIX = ';ext=';\n\n/**\r\n * Helper method for constructing regular expressions for parsing. Creates\r\n * an expression that captures up to max_length digits.\r\n * @return {string} RegEx pattern to capture extension digits.\r\n */\nvar getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {\n return \"([\".concat(VALID_DIGITS, \"]{1,\").concat(maxLength, \"})\");\n};\n\n/**\r\n * Helper initialiser method to create the regular-expression pattern to match\r\n * extensions.\r\n * Copy-pasted from Google's `libphonenumber`:\r\n * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766\r\n * @return {string} RegEx pattern to capture extensions.\r\n */\nexport default function createExtensionPattern(purpose) {\n // We cap the maximum length of an extension based on the ambiguity of the way\n // the extension is prefixed. As per ITU, the officially allowed length for\n // extensions is actually 40, but we don't support this since we haven't seen real\n // examples and this introduces many false interpretations as the extension labels\n // are not standardized.\n /** @type {string} */\n var extLimitAfterExplicitLabel = '20';\n /** @type {string} */\n var extLimitAfterLikelyLabel = '15';\n /** @type {string} */\n var extLimitAfterAmbiguousChar = '9';\n /** @type {string} */\n var extLimitWhenNotSure = '6';\n\n /** @type {string} */\n var possibleSeparatorsBetweenNumberAndExtLabel = \"[ \\xA0\\\\t,]*\";\n // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.\n /** @type {string} */\n var possibleCharsAfterExtLabel = \"[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*\";\n /** @type {string} */\n var optionalExtnSuffix = \"#?\";\n\n // Here the extension is called out in more explicit way, i.e mentioning it obvious\n // patterns like \"ext.\".\n /** @type {string} */\n var explicitExtLabels = \"(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|\\u0434\\u043E\\u0431|anexo)\";\n // One-character symbols that can be used to indicate an extension, and less\n // commonly used or more ambiguous extension labels.\n /** @type {string} */\n var ambiguousExtLabels = \"(?:[x\\uFF58#\\uFF03~\\uFF5E]|int|\\uFF49\\uFF4E\\uFF54)\";\n // When extension is not separated clearly.\n /** @type {string} */\n var ambiguousSeparator = \"[- ]+\";\n // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching\n // comma as extension label may have it.\n /** @type {string} */\n var possibleSeparatorsNumberExtLabelNoComma = \"[ \\xA0\\\\t]*\";\n // \",,\" is commonly used for auto dialling the extension when connected. First\n // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do\n // not repeat it here. Semi-colon works in Iphone and Android also to pop up a\n // button with the extension number following.\n /** @type {string} */\n var autoDiallingAndExtLabelsFound = \"(?:,{2}|;)\";\n\n /** @type {string} */\n var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);\n /** @type {string} */\n var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;\n /** @type {string} */\n var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n /** @type {string} */\n var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + \"#\";\n\n /** @type {string} */\n var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;\n /** @type {string} */\n var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + \"(?:,)+\" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n\n // The first regular expression covers RFC 3966 format, where the extension is added\n // using \";ext=\". The second more generic where extension is mentioned with explicit\n // labels like \"ext:\". In both the above cases we allow more numbers in extension than\n // any other extension labels. The third one captures when single character extension\n // labels or less commonly used labels are used. In such cases we capture fewer\n // extension digits in order to reduce the chance of falsely interpreting two\n // numbers beside each other as a number + extension. The fourth one covers the\n // special case of American numbers where the extension is written with a hash\n // at the end, such as \"- 503#\". The fifth one is exclusively for extension\n // autodialling formats which are used when dialling and in this case we accept longer\n // extensions. The last one is more liberal on the number of commas that acts as\n // extension labels, so we have a strict cap on the number of digits in such extensions.\n return rfcExtn + \"|\" + explicitExtn + \"|\" + ambiguousExtn + \"|\" + americanStyleExtnWithSuffix + \"|\" + autoDiallingExtn + \"|\" + onlyCommasExtn;\n}\n//# sourceMappingURL=createExtensionPattern.js.map"],"x_google_ignoreList":[0],"mappings":";;AAGA,IAAI,IAAsB,SAOtB,IAA4B,SAAmC,GAAW;AAC5E,QAAO,KAAY,QAA6B;;AAUlD,SAAwB,EAAuB,GAAS;CAOtD,IAAI,IAA6B,MAE7B,IAA2B,MAE3B,IAA6B,KAE7B,IAAsB,KAGtB,IAA6C,gBAG7C,IAA6B,yBAE7B,IAAqB,MAKrB,IAAoB,iDAIpB,IAAqB,wBAGrB,IAAqB,SAIrB,IAA0C,eAM1C,IAAgC,cAGhC,IAAU,IAAsB,EAA0B,EAA2B,EAErF,IAAe,IAA6C,IAAoB,IAA6B,EAA0B,EAA2B,GAAG,GAErK,IAAgB,IAA6C,IAAqB,IAA6B,EAA0B,EAA2B,GAAG,GAEvK,IAA8B,IAAqB,EAA0B,EAAoB,GAAG,KAGpG,IAAmB,IAA0C,IAAgC,IAA6B,EAA0B,EAAyB,GAAG,GAEhL,IAAiB,IAA0C,WAAW,IAA6B,EAA0B,EAA2B,GAAG;AAc/J,QAAO,IAAU,MAAM,IAAe,MAAM,IAAgB,MAAM,IAA8B,MAAM,IAAmB,MAAM"}
package/dist/index270.js CHANGED
@@ -1,77 +1,14 @@
1
- import { Metadata as e, getCountryCallingCode as t } from "./index248.js";
2
- import n from "./index252.js";
3
- import r from "./index265.js";
4
- import i from "./index266.js";
5
- import { formatRFC3966 as a } from "./index269.js";
6
- //#region ../../node_modules/libphonenumber-js/es6/format.js
7
- var o = { formatExtension: function(e, t, n) {
8
- return `${e}${n.ext()}${t}`;
9
- } };
10
- function s(t, n, r, i) {
11
- if (r = r ? f({}, o, r) : o, i = new e(i), t.country && t.country !== "001") {
12
- if (!i.hasCountry(t.country)) throw Error(`Unknown country: ${t.country}`);
13
- i.selectNumberingPlan(t.country);
14
- } else if (t.countryCallingCode) i.selectNumberingPlan(t.countryCallingCode);
15
- else return t.phone || "";
16
- var s = i.countryCallingCode(), l = r.v2 ? t.nationalNumber : t.phone, p;
17
- switch (n) {
18
- case "NATIONAL": return l ? (p = c(l, t.carrierCode, "NATIONAL", i, r), u(p, t.ext, i, r.formatExtension)) : "";
19
- case "INTERNATIONAL": return l ? (p = c(l, null, "INTERNATIONAL", i, r), p = `+${s} ${p}`, u(p, t.ext, i, r.formatExtension)) : `+${s}`;
20
- case "E.164": return `+${s}${l}`;
21
- case "RFC3966": return a({
22
- number: `+${s}${l}`,
23
- ext: t.ext
24
- });
25
- case "IDD":
26
- if (!r.fromCountry) return;
27
- var m = d(l, t.carrierCode, s, r.fromCountry, i);
28
- return m ? u(m, t.ext, i, r.formatExtension) : void 0;
29
- default: throw Error(`Unknown "format" argument passed to "formatNumber()": "${n}"`);
30
- }
1
+ import { PLUS_CHARS as e, VALID_DIGITS as t, VALID_PUNCTUATION as n } from "./index258.js";
2
+ import r from "./index269.js";
3
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js
4
+ var i = "[" + t + "]{2}", a = "[" + e + "]{0,1}(?:[" + n + "]*[" + t + "]){3,}[" + n + t + "]*", o = RegExp("^[" + e + "]{0,1}(?:[" + n + "]*[" + t + "]){1,2}$", "i"), s = a + "(?:" + r() + ")?", c = RegExp("^" + i + "$|^" + s + "$", "i");
5
+ function l(e) {
6
+ return e.length >= 2 && c.test(e);
31
7
  }
32
- function c(e, t, n, i, a) {
33
- var o = l(i.formats(), e);
34
- return o ? r(e, o, {
35
- useInternationalFormat: n === "INTERNATIONAL",
36
- withNationalPrefix: !(o.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && a && a.nationalPrefix === !1),
37
- carrierCode: t,
38
- metadata: i
39
- }) : e;
40
- }
41
- function l(e, t) {
42
- return p(e, function(e) {
43
- if (e.leadingDigitsPatterns().length > 0) {
44
- var r = e.leadingDigitsPatterns()[e.leadingDigitsPatterns().length - 1];
45
- if (t.search(r) !== 0) return !1;
46
- }
47
- return n(t, e.pattern());
48
- });
49
- }
50
- function u(e, t, n, r) {
51
- return t ? r(e, t, n) : e;
52
- }
53
- function d(e, n, r, a, o) {
54
- if (t(a, o.metadata) === r) {
55
- var s = c(e, n, "NATIONAL", o);
56
- return r === "1" ? r + " " + s : s;
57
- }
58
- var l = i(a, void 0, o.metadata);
59
- if (l) return `${l} ${r} ${c(e, null, "INTERNATIONAL", o)}`;
60
- }
61
- function f() {
62
- for (var e = 1, t = [...arguments]; e < t.length;) {
63
- if (t[e]) for (var n in t[e]) t[0][n] = t[e][n];
64
- e++;
65
- }
66
- return t[0];
67
- }
68
- function p(e, t) {
69
- for (var n = 0; n < e.length;) {
70
- if (t(e[n])) return e[n];
71
- n++;
72
- }
8
+ function u(e) {
9
+ return o.test(e);
73
10
  }
74
11
  //#endregion
75
- export { s as default };
12
+ export { l as default, u as isViablePhoneNumberStart };
76
13
 
77
14
  //# sourceMappingURL=index270.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index270.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/format.js"],"sourcesContent":["// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of December 31th, 2018.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\n\nimport matchesEntirely from './helpers/matchesEntirely.js';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat.js';\nimport Metadata, { getCountryCallingCode } from './metadata.js';\nimport getIddPrefix from './helpers/getIddPrefix.js';\nimport { formatRFC3966 } from './helpers/RFC3966.js';\nvar DEFAULT_OPTIONS = {\n formatExtension: function formatExtension(formattedNumber, extension, metadata) {\n return \"\".concat(formattedNumber).concat(metadata.ext()).concat(extension);\n }\n};\n\n/**\r\n * Formats a phone number.\r\n *\r\n * format(phoneNumberInstance, 'INTERNATIONAL', { ..., v2: true }, metadata)\r\n * format(phoneNumberInstance, 'NATIONAL', { ..., v2: true }, metadata)\r\n *\r\n * format({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', { ... }, metadata)\r\n * format({ phone: '8005553535', country: 'RU' }, 'NATIONAL', undefined, metadata)\r\n *\r\n * @param {object|PhoneNumber} input — If `options.v2: true` flag is passed, the `input` should be a `PhoneNumber` instance. Otherwise, it should be an object of shape `{ phone: '...', country: '...' }`.\r\n * @param {string} format\r\n * @param {object} [options]\r\n * @param {object} metadata\r\n * @return {string}\r\n */\nexport default function formatNumber(input, format, options, metadata) {\n // Apply default options.\n if (options) {\n // Using ES6 \"rest spread\" syntax here didn't work with `babel`/`istanbul`\n // for some weird reason: this line of code would cause the code coverage\n // to show as not 100%. That's because `babel`/`istanbul`, for some weird reason,\n // apparently doesn't know how to properly exclude Babel polyfills from code coverage.\n //\n // options = { ...DEFAULT_OPTIONS, ...options }\n //\n options = merge({}, DEFAULT_OPTIONS, options);\n } else {\n options = DEFAULT_OPTIONS;\n }\n metadata = new Metadata(metadata);\n\n // Normally, the `input` object is supposed to be a `PhoneNumber` class instance.\n // Also, according to the `PhoneNumber` class source code, `country` can't be \"001\".\n // It means that normally `input.country` or `input.countryCallingCode` is supposed\n // to be present because either of the two is always required to exist in a `PhoneNumber` instance.\n // This means that realistically, it's gonna step into either the first `if`\n // or the following `else if`, and normally it won't even reach the legacy-compatibility\n // `else return input.phone || ''` part.\n // So normally, it won't ever return an empty string here.\n if (input.country && input.country !== '001') {\n // Validate `input.country`.\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n metadata.selectNumberingPlan(input.country);\n } else if (input.countryCallingCode) {\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else return input.phone || '';\n var countryCallingCode = metadata.countryCallingCode();\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone;\n\n // This variable should have been declared inside `case`s\n // but Babel has a bug and it says \"duplicate variable declaration\".\n var number;\n switch (format) {\n case 'NATIONAL':\n // Normally, the `input` object is supposed to be a `PhoneNumber` class instance,\n // and a `PhoneNumber` class instance is always required to have a `nationalNumber`.\n // This means that the `if (!nationalNumber)` below is just for legacy-compatibility\n // and it normally can't really happen, so normally it won't ever return an empty string here.\n if (!nationalNumber) {\n return '';\n }\n number = formatNationalNumber(nationalNumber, input.carrierCode, 'NATIONAL', metadata, options);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n case 'INTERNATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return \"+\".concat(countryCallingCode);\n }\n number = formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata, options);\n number = \"+\".concat(countryCallingCode, \" \").concat(number);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n case 'E.164':\n // `E.164` doesn't define \"phone number extensions\".\n return \"+\".concat(countryCallingCode).concat(nationalNumber);\n case 'RFC3966':\n return formatRFC3966({\n number: \"+\".concat(countryCallingCode).concat(nationalNumber),\n ext: input.ext\n });\n\n // For reference, here's Google's IDD formatter:\n // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546\n // Not saying that this IDD formatter replicates it 1:1, but it seems to work.\n // Who would even need to format phone numbers in IDD format anyway?\n case 'IDD':\n // If the required `fromCountry` parameter is not passed, it will return `undefined`.\n if (!options.fromCountry) {\n return;\n // throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')\n }\n var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);\n // If the country of the phone number doesn't support IDD calling, it will return `undefined`.\n if (!formattedNumber) {\n return;\n }\n return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);\n default:\n throw new Error(\"Unknown \\\"format\\\" argument passed to \\\"formatNumber()\\\": \\\"\".concat(format, \"\\\"\"));\n }\n}\nfunction formatNationalNumber(number, carrierCode, formatAs, metadata, options) {\n var format = chooseFormatForNumber(metadata.formats(), number);\n if (!format) {\n return number;\n }\n return formatNationalNumberUsingFormat(number, format, {\n useInternationalFormat: formatAs === 'INTERNATIONAL',\n withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,\n carrierCode: carrierCode,\n metadata: metadata\n });\n}\nexport function chooseFormatForNumber(availableFormats, nationalNumber) {\n // Using a `for ... of` loop here didn't work with `babel`/`istanbul`:\n // for some weird reason, it showed code coverage less than 100%.\n // That's because `babel`/`istanbul`, for some weird reason,\n // apparently doesn't know how to properly exclude Babel polyfills from code coverage.\n //\n // for (const format of availableFormats) { ... }\n //\n return pickFirstMatchingElement(availableFormats, function (format) {\n // Validate leading digits.\n // The test case for \"else path\" could be found by searching for\n // \"format.leadingDigitsPatterns().length === 0\".\n if (format.leadingDigitsPatterns().length > 0) {\n // The last leading_digits_pattern is used here, as it is the most detailed\n var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1];\n // If leading digits don't match then move on to the next phone number format\n if (nationalNumber.search(lastLeadingDigitsPattern) !== 0) {\n return false;\n }\n }\n // Check that the national number matches the phone number format regular expression\n return matchesEntirely(nationalNumber, format.pattern());\n });\n}\nfunction addExtension(formattedNumber, ext, metadata, formatExtension) {\n return ext ? formatExtension(formattedNumber, ext, metadata) : formattedNumber;\n}\nfunction formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {\n var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata);\n // When calling within the same country calling code.\n if (fromCountryCallingCode === countryCallingCode) {\n var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, 'NATIONAL', metadata);\n // For NANPA regions, return the national format for these regions\n // but prefix it with the country calling code.\n if (countryCallingCode === '1') {\n return countryCallingCode + ' ' + formattedNumber;\n }\n // If regions share a country calling code, the country calling code need\n // not be dialled. This also applies when dialling within a region, so this\n // if clause covers both these cases. Technically this is the case for\n // dialling from La Reunion to other overseas departments of France (French\n // Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover\n // this edge case for now and for those cases return the version including\n // country calling code. Details here:\n // http://www.petitfute.com/voyage/225-info-pratiques-reunion\n //\n return formattedNumber;\n }\n var iddPrefix = getIddPrefix(fromCountry, undefined, metadata.metadata);\n if (iddPrefix) {\n return \"\".concat(iddPrefix, \" \").concat(countryCallingCode, \" \").concat(formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata));\n }\n}\nfunction merge() {\n var i = 1;\n for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {\n objects[_key] = arguments[_key];\n }\n while (i < objects.length) {\n if (objects[i]) {\n for (var key in objects[i]) {\n objects[0][key] = objects[i][key];\n }\n }\n i++;\n }\n return objects[0];\n}\nfunction pickFirstMatchingElement(elements, testFunction) {\n var i = 0;\n while (i < elements.length) {\n if (testFunction(elements[i])) {\n return elements[i];\n }\n i++;\n }\n}\n//# sourceMappingURL=format.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;AAUA,IAAI,IAAkB,EACpB,iBAAiB,SAAyB,GAAiB,GAAW,GAAU;AAC9E,QAAO,GAA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AAS,GAAG,CAC3B,QAAO,EAAS;AAElB"}
1
+ {"version":3,"file":"index270.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js"],"sourcesContent":["import { MIN_LENGTH_FOR_NSN, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from '../constants.js';\nimport createExtensionPattern from './extension/createExtensionPattern.js';\n\n// Regular expression of viable phone numbers. This is location independent.\n// Checks we have at least three leading digits, and only valid punctuation,\n// alpha characters and digits in the phone number. Does not include extension\n// data. The symbol 'x' is allowed here as valid punctuation since it is often\n// used as a placeholder for carrier codes, for example in Brazilian phone\n// numbers. We also allow multiple '+' characters at the start.\n//\n// Corresponds to the following:\n// [digits]{minLengthNsn}|\n// plus_sign*\n// (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*\n//\n// The first reg-ex is to allow short numbers (two digits long) to be parsed if\n// they are entered as \"15\" etc, but only if there is no punctuation in them.\n// The second expression restricts the number of digits to three or more, but\n// then allows them to be in international form, and to have alpha-characters\n// and punctuation. We split up the two reg-exes here and combine them when\n// creating the reg-ex VALID_PHONE_NUMBER_PATTERN itself so we can prefix it\n// with ^ and append $ to each branch.\n//\n// \"Note VALID_PUNCTUATION starts with a -,\n// so must be the first in the range\" (c) Google devs.\n// (wtf did they mean by saying that; probably nothing)\n//\nvar MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + VALID_DIGITS + ']{' + MIN_LENGTH_FOR_NSN + '}';\n//\n// And this is the second reg-exp:\n// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)\n//\nexport var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\n\n// This regular expression isn't present in Google's `libphonenumber`\n// and is only used to determine whether the phone number being input\n// is too short for it to even consider it a \"valid\" number.\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\nvar VALID_PHONE_NUMBER_START_REG_EXP = new RegExp('^' + '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){1,2}' + '$', 'i');\nexport var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER +\n// Phone number extensions\n'(?:' + createExtensionPattern() + ')?';\n\n// The combined regular expression for valid phone numbers:\n//\nvar VALID_PHONE_NUMBER_PATTERN = new RegExp(\n// Either a short two-digit-only phone number\n'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' +\n// Or a longer fully parsed phone number (min 3 characters)\n'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i');\n\n// Checks to see if the string of characters could possibly be a phone number at\n// all. At the moment, checks to see that the string begins with at least 2\n// digits, ignoring any punctuation commonly found in phone numbers. This method\n// does not require the number to be normalized in advance - but does assume\n// that leading non-number symbols have been removed, such as by the method\n// `extract_possible_number`.\n//\nexport default function isViablePhoneNumber(number) {\n return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);\n}\n\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\nexport function isViablePhoneNumberStart(number) {\n return VALID_PHONE_NUMBER_START_REG_EXP.test(number);\n}\n//# sourceMappingURL=isViablePhoneNumber.js.map"],"x_google_ignoreList":[0],"mappings":";;;AA2BA,IAAI,IAAkC,MAAM,IAAe,QAKhD,IAAqB,MAAM,IAAa,eAAyB,IAAoB,QAAa,IAAe,YAAsB,IAAoB,IAAe,MAWjL,IAAuC,OAAO,OAAY,IAAa,eAAyB,IAAoB,QAAa,IAAe,YAAsB,IAAI,EACnK,IAAoC,IAE/C,QAAQ,GAAwB,GAAG,MAI/B,IAAiC,OAErC,MAAM,IAAkC,QAElC,IAAoC,KAAK,IAAI;AASnD,SAAwB,EAAoB,GAAQ;AAClD,QAAO,EAAO,UAAA,KAAgC,EAA2B,KAAK,EAAO;;AASvF,SAAgB,EAAyB,GAAQ;AAC/C,QAAO,EAAiC,KAAK,EAAO"}
package/dist/index271.js CHANGED
@@ -1,175 +1,11 @@
1
- import e from "./index247.js";
2
- import { Metadata as t, validateMetadata as n } from "./index248.js";
3
- import r from "./index251.js";
4
- import i from "./index253.js";
5
- import a from "./index254.js";
6
- import o from "./index255.js";
7
- import s from "./index263.js";
8
- import c from "./index270.js";
9
- //#region ../../node_modules/libphonenumber-js/es6/PhoneNumber.js
10
- function l(e) {
11
- "@babel/helpers - typeof";
12
- return l = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
13
- return typeof e;
14
- } : function(e) {
15
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
16
- }, l(e);
1
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/RFC3966.js
2
+ function e(e) {
3
+ var t = e.number, n = e.ext;
4
+ if (!t) return "";
5
+ if (t[0] !== "+") throw Error("\"formatRFC3966()\" expects \"number\" to be in E.164 format.");
6
+ return `tel:${t}${n ? ";ext=" + n : ""}`;
17
7
  }
18
- function u(e, t) {
19
- var n = Object.keys(e);
20
- if (Object.getOwnPropertySymbols) {
21
- var r = Object.getOwnPropertySymbols(e);
22
- t && (r = r.filter(function(t) {
23
- return Object.getOwnPropertyDescriptor(e, t).enumerable;
24
- })), n.push.apply(n, r);
25
- }
26
- return n;
27
- }
28
- function d(e) {
29
- for (var t = 1; t < arguments.length; t++) {
30
- var n = arguments[t] == null ? {} : arguments[t];
31
- t % 2 ? u(Object(n), !0).forEach(function(t) {
32
- f(e, t, n[t]);
33
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : u(Object(n)).forEach(function(t) {
34
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
35
- });
36
- }
37
- return e;
38
- }
39
- function f(e, t, n) {
40
- return (t = g(t)) in e ? Object.defineProperty(e, t, {
41
- value: n,
42
- enumerable: !0,
43
- configurable: !0,
44
- writable: !0
45
- }) : e[t] = n, e;
46
- }
47
- function p(e, t) {
48
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
49
- }
50
- function m(e, t) {
51
- for (var n = 0; n < t.length; n++) {
52
- var r = t[n];
53
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, g(r.key), r);
54
- }
55
- }
56
- function h(e, t, n) {
57
- return t && m(e.prototype, t), n && m(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
58
- }
59
- function g(e) {
60
- var t = _(e, "string");
61
- return l(t) == "symbol" ? t : t + "";
62
- }
63
- function _(e, t) {
64
- if (l(e) != "object" || !e) return e;
65
- var n = e[Symbol.toPrimitive];
66
- if (n !== void 0) {
67
- var r = n.call(e, t || "default");
68
- if (l(r) != "object") return r;
69
- throw TypeError("@@toPrimitive must return a primitive value.");
70
- }
71
- return (t === "string" ? String : Number)(e);
72
- }
73
- var v = !1, y = /* @__PURE__ */ function() {
74
- function l(t, r, i) {
75
- if (p(this, l), !t) throw TypeError("First argument is required");
76
- if (typeof t != "string") throw TypeError("First argument must be a string");
77
- if (t[0] === "+" && !r) throw TypeError("`metadata` argument not passed");
78
- if (e(r) && e(r.countries)) {
79
- i = r;
80
- var a = t;
81
- if (!S.test(a)) throw Error("Invalid `number` argument passed: must consist of a \"+\" followed by digits");
82
- var o = s(a, void 0, void 0, void 0, i), c = o.countryCallingCode;
83
- if (r = o.number, t = c, !r) throw Error("Invalid `number` argument passed: too short");
84
- }
85
- if (!r) throw TypeError("`nationalNumber` argument is required");
86
- if (typeof r != "string") throw TypeError("`nationalNumber` argument must be a string");
87
- n(i);
88
- var u = x(t, i), d = u.country, f = u.countryCallingCode;
89
- this.country = d, this.countryCallingCode = f, this.nationalNumber = r, this.number = "+" + this.countryCallingCode + this.nationalNumber, this.getMetadata = function() {
90
- return i;
91
- };
92
- }
93
- return h(l, [
94
- {
95
- key: "setExt",
96
- value: function(e) {
97
- this.ext = e;
98
- }
99
- },
100
- {
101
- key: "getPossibleCountries",
102
- value: function() {
103
- return this.country ? [this.country] : o(this.countryCallingCode, this.nationalNumber, this.getMetadata());
104
- }
105
- },
106
- {
107
- key: "isPossible",
108
- value: function() {
109
- return r(this, { v2: !0 }, this.getMetadata());
110
- }
111
- },
112
- {
113
- key: "isValid",
114
- value: function() {
115
- return a(this, { v2: !0 }, this.getMetadata());
116
- }
117
- },
118
- {
119
- key: "isNonGeographic",
120
- value: function() {
121
- return new t(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode);
122
- }
123
- },
124
- {
125
- key: "isEqual",
126
- value: function(e) {
127
- return this.number === e.number && this.ext === e.ext;
128
- }
129
- },
130
- {
131
- key: "getType",
132
- value: function() {
133
- return i(this, { v2: !0 }, this.getMetadata());
134
- }
135
- },
136
- {
137
- key: "format",
138
- value: function(e, t) {
139
- return c(this, e, t ? d(d({}, t), {}, { v2: !0 }) : { v2: !0 }, this.getMetadata());
140
- }
141
- },
142
- {
143
- key: "formatNational",
144
- value: function(e) {
145
- return this.format("NATIONAL", e);
146
- }
147
- },
148
- {
149
- key: "formatInternational",
150
- value: function(e) {
151
- return this.format("INTERNATIONAL", e);
152
- }
153
- },
154
- {
155
- key: "getURI",
156
- value: function(e) {
157
- return this.format("RFC3966", e);
158
- }
159
- }
160
- ]);
161
- }(), b = function(e) {
162
- return /^[A-Z]{2}$/.test(e);
163
- };
164
- function x(e, n) {
165
- var r, i, a = new t(n);
166
- return b(e) ? (r = e, a.selectNumberingPlan(r), i = a.countryCallingCode()) : (i = e, v && a.isNonGeographicCallingCode(i) && (r = "001")), {
167
- country: r,
168
- countryCallingCode: i
169
- };
170
- }
171
- var S = /^\+\d+$/;
172
8
  //#endregion
173
- export { y as PhoneNumber };
9
+ export { e as formatRFC3966 };
174
10
 
175
11
  //# sourceMappingURL=index271.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index271.js","names":["isPossibleNumber"],"sources":["../../../node_modules/libphonenumber-js/es6/PhoneNumber.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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\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 Metadata, { validateMetadata } from './metadata.js';\nimport isPossibleNumber from './isPossible.js';\nimport isValidNumber from './isValid.js';\nimport getNumberType from './helpers/getNumberType.js';\nimport getPossibleCountriesForNumber from './helpers/getPossibleCountriesForNumber.js';\nimport extractCountryCallingCode from './helpers/extractCountryCallingCode.js';\nimport isObject from './helpers/isObject.js';\nimport formatNumber from './format.js';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\nvar PhoneNumber = /*#__PURE__*/function () {\n /**\r\n * @param {string} countryOrCountryCallingCode\r\n * @param {string} nationalNumber\r\n * @param {object} metadata — Metadata JSON\r\n * @return {PhoneNumber}\r\n */\n function PhoneNumber(countryOrCountryCallingCode, nationalNumber, metadata) {\n _classCallCheck(this, PhoneNumber);\n // Validate `countryOrCountryCallingCode` argument.\n if (!countryOrCountryCallingCode) {\n throw new TypeError('First argument is required');\n }\n if (typeof countryOrCountryCallingCode !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n // In case of public API use: `constructor(number, metadata)`.\n // Transform the arguments from `constructor(number, metadata)` to\n // `constructor(countryOrCountryCallingCode, nationalNumber, metadata)`.\n if (countryOrCountryCallingCode[0] === '+' && !nationalNumber) {\n throw new TypeError('`metadata` argument not passed');\n }\n if (isObject(nationalNumber) && isObject(nationalNumber.countries)) {\n metadata = nationalNumber;\n var e164Number = countryOrCountryCallingCode;\n if (!E164_NUMBER_REGEXP.test(e164Number)) {\n throw new Error('Invalid `number` argument passed: must consist of a \"+\" followed by digits');\n }\n var _extractCountryCallin = extractCountryCallingCode(e164Number, undefined, undefined, undefined, metadata),\n _countryCallingCode = _extractCountryCallin.countryCallingCode,\n number = _extractCountryCallin.number;\n nationalNumber = number;\n countryOrCountryCallingCode = _countryCallingCode;\n if (!nationalNumber) {\n throw new Error('Invalid `number` argument passed: too short');\n }\n }\n\n // Validate `nationalNumber` argument.\n if (!nationalNumber) {\n throw new TypeError('`nationalNumber` argument is required');\n }\n if (typeof nationalNumber !== 'string') {\n throw new TypeError('`nationalNumber` argument must be a string');\n }\n\n // Validate `metadata` argument.\n validateMetadata(metadata);\n\n // Initialize properties.\n var _getCountryAndCountry = getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadata),\n country = _getCountryAndCountry.country,\n countryCallingCode = _getCountryAndCountry.countryCallingCode;\n this.country = country;\n this.countryCallingCode = countryCallingCode;\n this.nationalNumber = nationalNumber;\n this.number = '+' + this.countryCallingCode + this.nationalNumber;\n // Exclude `metadata` property output from `PhoneNumber.toString()`\n // so that it doesn't clutter the console output of Node.js.\n // Previously, when Node.js did `console.log(new PhoneNumber(...))`,\n // it would output the whole internal structure of the `metadata` object.\n this.getMetadata = function () {\n return metadata;\n };\n }\n return _createClass(PhoneNumber, [{\n key: \"setExt\",\n value: function setExt(ext) {\n this.ext = ext;\n }\n }, {\n key: \"getPossibleCountries\",\n value: function getPossibleCountries() {\n if (this.country) {\n return [this.country];\n }\n return getPossibleCountriesForNumber(this.countryCallingCode, this.nationalNumber, this.getMetadata());\n }\n }, {\n key: \"isPossible\",\n value: function isPossible() {\n return isPossibleNumber(this, {\n v2: true\n }, this.getMetadata());\n }\n }, {\n key: \"isValid\",\n value: function isValid() {\n return isValidNumber(this, {\n v2: true\n }, this.getMetadata());\n }\n }, {\n key: \"isNonGeographic\",\n value: function isNonGeographic() {\n var metadata = new Metadata(this.getMetadata());\n return metadata.isNonGeographicCallingCode(this.countryCallingCode);\n }\n }, {\n key: \"isEqual\",\n value: function isEqual(phoneNumber) {\n return this.number === phoneNumber.number && this.ext === phoneNumber.ext;\n }\n\n // This function was originally meant to be an equivalent for `validatePhoneNumberLength()`,\n // but later it was found out that it doesn't include the possible `TOO_SHORT` result\n // returned from `parsePhoneNumberWithError()` in the original `validatePhoneNumberLength()`,\n // so eventually I simply commented out this method from the `PhoneNumber` class\n // and just left the `validatePhoneNumberLength()` function, even though that one would require\n // and additional step to also validate the actual country / calling code of the phone number.\n // validateLength() {\n // \tconst metadata = new Metadata(this.getMetadata())\n // \tmetadata.selectNumberingPlan(this.countryCallingCode)\n // \tconst result = checkNumberLength(this.nationalNumber, metadata)\n // \tif (result !== 'IS_POSSIBLE') {\n // \t\treturn result\n // \t}\n // }\n }, {\n key: \"getType\",\n value: function getType() {\n return getNumberType(this, {\n v2: true\n }, this.getMetadata());\n }\n }, {\n key: \"format\",\n value: function format(_format, options) {\n return formatNumber(this, _format, options ? _objectSpread(_objectSpread({}, options), {}, {\n v2: true\n }) : {\n v2: true\n }, this.getMetadata());\n }\n }, {\n key: \"formatNational\",\n value: function formatNational(options) {\n return this.format('NATIONAL', options);\n }\n }, {\n key: \"formatInternational\",\n value: function formatInternational(options) {\n return this.format('INTERNATIONAL', options);\n }\n }, {\n key: \"getURI\",\n value: function getURI(options) {\n return this.format('RFC3966', options);\n }\n }]);\n}();\nexport { PhoneNumber as default };\nvar isCountryCode = function isCountryCode(value) {\n return /^[A-Z]{2}$/.test(value);\n};\nfunction getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadataJson) {\n var country;\n var countryCallingCode;\n var metadata = new Metadata(metadataJson);\n // If country code is passed then derive `countryCallingCode` from it.\n // Also store the country code as `.country`.\n if (isCountryCode(countryOrCountryCallingCode)) {\n country = countryOrCountryCallingCode;\n metadata.selectNumberingPlan(country);\n countryCallingCode = metadata.countryCallingCode();\n } else {\n countryCallingCode = countryOrCountryCallingCode;\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(countryCallingCode)) {\n country = '001';\n }\n }\n }\n return {\n country: country,\n countryCallingCode: countryCallingCode\n };\n}\nvar E164_NUMBER_REGEXP = /^\\+\\d+$/;\n//# sourceMappingURL=PhoneNumber.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AAAA,SAAS,EAAQ,GAAG;AAAE;AAA2B,QAAO,IAAwB,OAAO,UAArB,cAA2C,OAAO,OAAO,YAA1B,WAAqC,SAAU,GAAG;AAAE,SAAO,OAAO;KAAO,SAAU,GAAG;AAAE,SAAO,KAAmB,OAAO,UAArB,cAA+B,EAAE,gBAAgB,UAAU,MAAM,OAAO,YAAY,WAAW,OAAO;IAAM,EAAQ,EAAE;;AAC3T,SAAS,EAAQ,GAAG,GAAG;CAAE,IAAI,IAAI,OAAO,KAAK,EAAE;AAAE,KAAI,OAAO,uBAAuB;EAAE,IAAI,IAAI,OAAO,sBAAsB,EAAE;AAAE,QAAM,IAAI,EAAE,OAAO,SAAU,GAAG;AAAE,UAAO,OAAO,yBAAyB,GAAG,EAAE,CAAC;IAAc,GAAG,EAAE,KAAK,MAAM,GAAG,EAAE;;AAAI,QAAO;;AAC3P,SAAS,EAAc,GAAG;AAAE,MAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;EAAE,IAAI,IAAY,UAAU,MAAlB,OAAsC,EAAE,GAAjB,UAAU;AAAS,MAAI,IAAI,EAAQ,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,SAAU,GAAG;AAAE,KAAgB,GAAG,GAAG,EAAE,GAAG;IAAI,GAAG,OAAO,4BAA4B,OAAO,iBAAiB,GAAG,OAAO,0BAA0B,EAAE,CAAC,GAAG,EAAQ,OAAO,EAAE,CAAC,CAAC,QAAQ,SAAU,GAAG;AAAE,UAAO,eAAe,GAAG,GAAG,OAAO,yBAAyB,GAAG,EAAE,CAAC;IA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IAAU,SAIT;EACI;EACW;EACrB;;AAEH,IAAI,IAAqB"}
1
+ {"version":3,"file":"index271.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/RFC3966.js"],"sourcesContent":["function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\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; }\nimport isViablePhoneNumber from './isViablePhoneNumber.js';\n\n// https://www.ietf.org/rfc/rfc3966.txt\n\n/**\r\n * @param {string} text - Phone URI (RFC 3966).\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\nexport function parseRFC3966(text) {\n var number;\n var ext;\n\n // Replace \"tel:\" with \"tel=\" for parsing convenience.\n text = text.replace(/^tel:/, 'tel=');\n for (var _iterator = _createForOfIteratorHelperLoose(text.split(';')), _step; !(_step = _iterator()).done;) {\n var part = _step.value;\n var _part$split = part.split('='),\n _part$split2 = _slicedToArray(_part$split, 2),\n name = _part$split2[0],\n value = _part$split2[1];\n switch (name) {\n case 'tel':\n number = value;\n break;\n case 'ext':\n ext = value;\n break;\n case 'phone-context':\n // Only \"country contexts\" are supported.\n // \"Domain contexts\" are ignored.\n if (value[0] === '+') {\n number = value + number;\n }\n break;\n }\n }\n\n // If the phone number is not viable, then abort.\n if (!isViablePhoneNumber(number)) {\n return {};\n }\n var result = {\n number: number\n };\n if (ext) {\n result.ext = ext;\n }\n return result;\n}\n\n/**\r\n * @param {object} - `{ ?number, ?extension }`.\r\n * @return {string} Phone URI (RFC 3966).\r\n */\nexport function formatRFC3966(_ref) {\n var number = _ref.number,\n ext = _ref.ext;\n if (!number) {\n return '';\n }\n if (number[0] !== '+') {\n throw new Error(\"\\\"formatRFC3966()\\\" expects \\\"number\\\" to be in E.164 format.\");\n }\n return \"tel:\".concat(number).concat(ext ? ';ext=' + ext : '');\n}\n//# sourceMappingURL=RFC3966.js.map"],"x_google_ignoreList":[0],"mappings":";AA6DA,SAAgB,EAAc,GAAM;CAClC,IAAI,IAAS,EAAK,QAChB,IAAM,EAAK;AACb,KAAI,CAAC,EACH,QAAO;AAET,KAAI,EAAO,OAAO,IAChB,OAAU,MAAM,gEAAgE;AAElF,QAAO,OAAc,IAAe,IAAM,UAAU,IAAM"}