@reachfive/identity-ui 1.20.1 → 1.21.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.
@@ -16,14 +16,12 @@ var styled__default = _interopDefault(styled);
16
16
  var reactTransitionGroup = require('react-transition-group');
17
17
  var classes = _interopDefault(require('classnames'));
18
18
  var remarkable = require('remarkable');
19
- var validator = require('validator');
20
- var validator__default = _interopDefault(validator);
19
+ var validator = _interopDefault(require('validator'));
21
20
  var libphonenumber = require('libphonenumber-js');
22
21
  var lodashEs = require('lodash-es');
23
22
  var luxon = require('luxon');
24
23
  var charInfo = require('char-info');
25
24
  var zxcvbn = _interopDefault(require('@reachfive/zxcvbn'));
26
- require('Buffer');
27
25
 
28
26
  function ownKeys(object, enumerableOnly) {
29
27
  var keys = Object.keys(object);
@@ -4137,7 +4135,7 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
4137
4135
  }
4138
4136
 
4139
4137
  /** Built-in value references. */
4140
- var Uint8Array = root.Uint8Array;
4138
+ var Uint8Array$1 = root.Uint8Array;
4141
4139
 
4142
4140
  /**
4143
4141
  * Converts `map` to its key-value pairs.
@@ -4202,7 +4200,7 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
4202
4200
  object = object.buffer;
4203
4201
  other = other.buffer;
4204
4202
  case arrayBufferTag:
4205
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
4203
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
4206
4204
  return false;
4207
4205
  }
4208
4206
  return true;
@@ -6287,75 +6285,88 @@ var paypal = {
6287
6285
  icon: icon$e
6288
6286
  };
6289
6287
 
6290
- var icon$f = "data:image/svg+xml,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M270%20806q-8-19-8-52%200-20%2011-49t24-45q-1-22%207.5-53t22.5-43q0-139%2092.5-288.5t217.5-209.5q139-66%20324-66%20133%200%20266%2055%2049%2021%2090%2048t71%2056%2055%2068%2042%2074%2032.5%2084.5%2025.5%2089.5%2022%2098l1%205q55%2083%2055%20150%200%2014-9%2040t-9%2038q0%201%201.5%203.5t3.5%205%202%203.5q77%20114%20120.5%20214.5t43.5%20208.5q0%2043-19.5%20100t-55.5%2057q-9%200-19.5-7.5t-19-17.5-19-26-16-26.5-13.5-26-9-17.5q-1-1-3-1l-5%204q-59%20154-132%20223%2020%2020%2061.5%2038.5t69%2041.5%2035.5%2065q-2%204-4%2016t-7%2018q-64%2097-302%2097-53%200-110.5-9t-98-20-104.5-30q-15-5-23-7-14-4-46-4.5t-40-1.5q-41%2045-127.5%2065t-168.5%2020q-35%200-69-1.5t-93-9-101-20.5-74.5-40-32.5-64q0-40%2010-59.5t41-48.5q11-2%2040.5-13t49.5-12q4%200%2014-2%202-2%202-4l-2-3q-48-11-108-105.5t-73-156.5l-5-3q-4%200-12%2020-18%2041-54.5%2074.5t-77.5%2037.5h-1q-4%200-6-4.5t-5-5.5q-23-54-23-100%200-275%20252-466z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
6288
+ var icon$f = "data:image/svg+xml,%3Csvg%20width%3D%22800px%22%20height%3D%22800px%22%20viewBox%3D%220%200%20128%20128%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20aria-hidden%3D%22true%22%20role%3D%22img%22%20class%3D%22iconify%20iconify--noto%22%20preserveAspectRatio%3D%22xMidYMid%20meet%22%3E%3Cpath%20d%3D%22M72.51%2015.42H34.65c-.15%200-.28.06-.42.08h-6.47c-1.24%200-2.24%201-2.24%202.24v100.97c0%201.24%201%202.24%202.24%202.24h21.9c1.24%200%202.24-1%202.24-2.24V86.63h20.61c19.83%200%2035.96-15.97%2035.96-35.6c.01-19.63-16.13-35.61-35.96-35.61zm-1.72%2050.22c-.35.03-.7.06-1.06.06H52.28c-.05%200-.09-.04-.14-.06a.513.513%200%200%201-.24-.1a.577.577%200%200%201-.21-.43V36.94c0-.18.09-.32.21-.43c.06-.06.14-.07.22-.09c.06-.02.09-.06.15-.06h17.45c.4%200%20.8.03%201.19.06c7.25.63%2012.97%206.94%2012.97%2014.61c.01%207.71-5.77%2014.05-13.09%2014.61z%22%20fill%3D%22%23fff%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E";
6289
+
6290
+ var ping = {
6291
+ key: 'ping',
6292
+ name: 'Ping',
6293
+ color: '#c90917',
6294
+ icon: icon$f,
6295
+ windowSize: {
6296
+ width: 450,
6297
+ height: 400
6298
+ }
6299
+ };
6300
+
6301
+ var icon$g = "data:image/svg+xml,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M270%20806q-8-19-8-52%200-20%2011-49t24-45q-1-22%207.5-53t22.5-43q0-139%2092.5-288.5t217.5-209.5q139-66%20324-66%20133%200%20266%2055%2049%2021%2090%2048t71%2056%2055%2068%2042%2074%2032.5%2084.5%2025.5%2089.5%2022%2098l1%205q55%2083%2055%20150%200%2014-9%2040t-9%2038q0%201%201.5%203.5t3.5%205%202%203.5q77%20114%20120.5%20214.5t43.5%20208.5q0%2043-19.5%20100t-55.5%2057q-9%200-19.5-7.5t-19-17.5-19-26-16-26.5-13.5-26-9-17.5q-1-1-3-1l-5%204q-59%20154-132%20223%2020%2020%2061.5%2038.5t69%2041.5%2035.5%2065q-2%204-4%2016t-7%2018q-64%2097-302%2097-53%200-110.5-9t-98-20-104.5-30q-15-5-23-7-14-4-46-4.5t-40-1.5q-41%2045-127.5%2065t-168.5%2020q-35%200-69-1.5t-93-9-101-20.5-74.5-40-32.5-64q0-40%2010-59.5t41-48.5q11-2%2040.5-13t49.5-12q4%200%2014-2%202-2%202-4l-2-3q-48-11-108-105.5t-73-156.5l-5-3q-4%200-12%2020-18%2041-54.5%2074.5t-77.5%2037.5h-1q-4%200-6-4.5t-5-5.5q-23-54-23-100%200-275%20252-466z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
6291
6302
 
6292
6303
  var qq = {
6293
6304
  key: 'qq',
6294
6305
  name: 'QQ',
6295
6306
  color: '#0071c3',
6296
- icon: icon$f,
6307
+ icon: icon$g,
6297
6308
  windowSize: {
6298
6309
  width: 450,
6299
6310
  height: 400
6300
6311
  }
6301
6312
  };
6302
6313
 
6303
- var icon$g = "data:image/svg+xml,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1684%20408q-67%2098-162%20167%201%2014%201%2042%200%20130-38%20259.5t-115.5%20248.5-184.5%20210.5-258%20146-323%2054.5q-271%200-496-145%2035%204%2078%204%20225%200%20401-138-105-2-188-64.5t-114-159.5q33%205%2061%205%2043%200%2085-11-112-23-185.5-111.5t-73.5-205.5v-4q68%2038%20146%2041-66-44-105-115t-39-154q0-88%2044-163%20121%20149%20294.5%20238.5t371.5%2099.5q-8-38-8-74%200-134%2094.5-228.5t228.5-94.5q140%200%20236%20102%20109-21%20205-78-37%20115-142%20178%2093-10%20186-50z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
6314
+ var icon$h = "data:image/svg+xml,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1684%20408q-67%2098-162%20167%201%2014%201%2042%200%20130-38%20259.5t-115.5%20248.5-184.5%20210.5-258%20146-323%2054.5q-271%200-496-145%2035%204%2078%204%20225%200%20401-138-105-2-188-64.5t-114-159.5q33%205%2061%205%2043%200%2085-11-112-23-185.5-111.5t-73.5-205.5v-4q68%2038%20146%2041-66-44-105-115t-39-154q0-88%2044-163%20121%20149%20294.5%20238.5t371.5%2099.5q-8-38-8-74%200-134%2094.5-228.5t228.5-94.5q140%200%20236%20102%20109-21%20205-78-37%20115-142%20178%2093-10%20186-50z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
6304
6315
 
6305
6316
  var twitter = {
6306
6317
  key: 'twitter',
6307
6318
  name: 'Twitter',
6308
6319
  color: '#55acee',
6309
- icon: icon$g,
6320
+ icon: icon$h,
6310
6321
  windowSize: {
6311
6322
  width: 800,
6312
6323
  height: 440
6313
6324
  }
6314
6325
  };
6315
6326
 
6316
- var icon$h = "data:image/svg+xml,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1853%20520q23%2064-150%20294-24%2032-65%2085-78%20100-90%20131-17%2041%2014%2081%2017%2021%2081%2082h1l1%201%201%201%202%202q141%20131%20191%20221%203%205%206.5%2012.5t7%2026.5-.5%2034-25%2027.5-59%2012.5l-256%204q-24%205-56-5t-52-22l-20-12q-30-21-70-64t-68.5-77.5-61-58-56.5-15.5q-3%201-8%203.5t-17%2014.5-21.5%2029.5-17%2052-6.5%2077.5q0%2015-3.5%2027.5t-7.5%2018.5l-4%205q-18%2019-53%2022h-115q-71%204-146-16.5t-131.5-53-103-66-70.5-57.5l-25-24q-10-10-27.5-30t-71.5-91-106-151-122.5-211-130.5-272q-6-16-6-27t3-16l4-6q15-19%2057-19l274-2q12%202%2023%206.5t16%208.5l5%203q16%2011%2024%2032%2020%2050%2046%20103.5t41%2081.5l16%2029q29%2060%2056%20104t48.5%2068.5%2041.5%2038.5%2034%2014%2027-5q2-1%205-5t12-22%2013.5-47%209.5-81%200-125q-2-40-9-73t-14-46l-6-12q-25-34-85-43-13-2%205-24%2017-19%2038-30%2053-26%20239-24%2082%201%20135%2013%2020%205%2033.5%2013.5t20.5%2024%2010.5%2032%203.5%2045.5-1%2055-2.5%2070.5-1.5%2082.5q0%2011-1%2042t-.5%2048%203.5%2040.5%2011.5%2039%2022.5%2024.5q8%202%2017%204t26-11%2038-34.5%2052-67%2068-107.5q60-104%20107-225%204-10%2010-17.5t11-10.5l4-3%205-2.5%2013-3%2020-.5%20288-2q39-5%2064%202.5t31%2016.5z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
6327
+ var icon$i = "data:image/svg+xml,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1853%20520q23%2064-150%20294-24%2032-65%2085-78%20100-90%20131-17%2041%2014%2081%2017%2021%2081%2082h1l1%201%201%201%202%202q141%20131%20191%20221%203%205%206.5%2012.5t7%2026.5-.5%2034-25%2027.5-59%2012.5l-256%204q-24%205-56-5t-52-22l-20-12q-30-21-70-64t-68.5-77.5-61-58-56.5-15.5q-3%201-8%203.5t-17%2014.5-21.5%2029.5-17%2052-6.5%2077.5q0%2015-3.5%2027.5t-7.5%2018.5l-4%205q-18%2019-53%2022h-115q-71%204-146-16.5t-131.5-53-103-66-70.5-57.5l-25-24q-10-10-27.5-30t-71.5-91-106-151-122.5-211-130.5-272q-6-16-6-27t3-16l4-6q15-19%2057-19l274-2q12%202%2023%206.5t16%208.5l5%203q16%2011%2024%2032%2020%2050%2046%20103.5t41%2081.5l16%2029q29%2060%2056%20104t48.5%2068.5%2041.5%2038.5%2034%2014%2027-5q2-1%205-5t12-22%2013.5-47%209.5-81%200-125q-2-40-9-73t-14-46l-6-12q-25-34-85-43-13-2%205-24%2017-19%2038-30%2053-26%20239-24%2082%201%20135%2013%2020%205%2033.5%2013.5t20.5%2024%2010.5%2032%203.5%2045.5-1%2055-2.5%2070.5-1.5%2082.5q0%2011-1%2042t-.5%2048%203.5%2040.5%2011.5%2039%2022.5%2024.5q8%202%2017%204t26-11%2038-34.5%2052-67%2068-107.5q60-104%20107-225%204-10%2010-17.5t11-10.5l4-3%205-2.5%2013-3%2020-.5%20288-2q39-5%2064%202.5t31%2016.5z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
6317
6328
 
6318
6329
  var vkontakte = {
6319
6330
  key: 'vkontakte',
6320
6331
  fontKey: 'vk',
6321
6332
  name: 'VKontakte',
6322
6333
  color: '#45668e',
6323
- icon: icon$h,
6334
+ icon: icon$i,
6324
6335
  windowSize: {
6325
6336
  width: 655,
6326
6337
  height: 430
6327
6338
  }
6328
6339
  };
6329
6340
 
6330
- var icon$i = "data:image/svg+xml,%3Csvg%20width%3D%222048%22%20height%3D%221792%22%20viewBox%3D%220%200%202048%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M580%20461q0-41-25-66t-66-25q-43%200-76%2025.5t-33%2065.5q0%2039%2033%2064.5t76%2025.5q41%200%2066-24.5t25-65.5zm743%20507q0-28-25.5-50t-65.5-22q-27%200-49.5%2022.5t-22.5%2049.5q0%2028%2022.5%2050.5t49.5%2022.5q40%200%2065.5-22t25.5-51zm-236-507q0-41-24.5-66t-65.5-25q-43%200-76%2025.5t-33%2065.5q0%2039%2033%2064.5t76%2025.5q41%200%2065.5-24.5t24.5-65.5zm635%20507q0-28-26-50t-65-22q-27%200-49.5%2022.5t-22.5%2049.5q0%2028%2022.5%2050.5t49.5%2022.5q39%200%2065-22t26-51zm-266-397q-31-4-70-4-169%200-311%2077t-223.5%20208.5-81.5%20287.5q0%2078%2023%20152-35%203-68%203-26%200-50-1.5t-55-6.5-44.5-7-54.5-10.5-50-10.5l-253%20127%2072-218q-290-203-290-490%200-169%2097.5-311t264-223.5%20363.5-81.5q176%200%20332.5%2066t262%20182.5%20136.5%20260.5zm592%20561q0%20117-68.5%20223.5t-185.5%20193.5l55%20181-199-109q-150%2037-218%2037-169%200-311-70.5t-223.5-191.5-81.5-264%2081.5-264%20223.5-191.5%20311-70.5q161%200%20303%2070.5t227.5%20192%2085.5%20263.5z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
6341
+ var icon$j = "data:image/svg+xml,%3Csvg%20width%3D%222048%22%20height%3D%221792%22%20viewBox%3D%220%200%202048%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M580%20461q0-41-25-66t-66-25q-43%200-76%2025.5t-33%2065.5q0%2039%2033%2064.5t76%2025.5q41%200%2066-24.5t25-65.5zm743%20507q0-28-25.5-50t-65.5-22q-27%200-49.5%2022.5t-22.5%2049.5q0%2028%2022.5%2050.5t49.5%2022.5q40%200%2065.5-22t25.5-51zm-236-507q0-41-24.5-66t-65.5-25q-43%200-76%2025.5t-33%2065.5q0%2039%2033%2064.5t76%2025.5q41%200%2065.5-24.5t24.5-65.5zm635%20507q0-28-26-50t-65-22q-27%200-49.5%2022.5t-22.5%2049.5q0%2028%2022.5%2050.5t49.5%2022.5q39%200%2065-22t26-51zm-266-397q-31-4-70-4-169%200-311%2077t-223.5%20208.5-81.5%20287.5q0%2078%2023%20152-35%203-68%203-26%200-50-1.5t-55-6.5-44.5-7-54.5-10.5-50-10.5l-253%20127%2072-218q-290-203-290-490%200-169%2097.5-311t264-223.5%20363.5-81.5q176%200%20332.5%2066t262%20182.5%20136.5%20260.5zm592%20561q0%20117-68.5%20223.5t-185.5%20193.5l55%20181-199-109q-150%2037-218%2037-169%200-311-70.5t-223.5-191.5-81.5-264%2081.5-264%20223.5-191.5%20311-70.5q161%200%20303%2070.5t227.5%20192%2085.5%20263.5z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
6331
6342
 
6332
6343
  var wechat = {
6333
6344
  key: 'wechat',
6334
6345
  name: 'WeChat',
6335
6346
  color: '#44b549',
6336
- icon: icon$i,
6347
+ icon: icon$j,
6337
6348
  windowSize: {
6338
6349
  width: 450,
6339
6350
  height: 400
6340
6351
  }
6341
6352
  };
6342
6353
 
6343
- var icon$j = "data:image/svg+xml,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M675%201284q21-34%2011-69t-45-50q-34-14-73-1t-60%2046q-22%2034-13%2068.5t43%2050.5%2074.5%202.5%2062.5-47.5zm94-121q8-13%203.5-26.5t-17.5-18.5q-14-5-28.5.5t-21.5%2018.5q-17%2031%2013%2045%2014%205%2029-.5t22-18.5zm174%20107q-45%20102-158%20150t-224%2012q-107-34-147.5-126.5t6.5-187.5q47-93%20151.5-139t210.5-19q111%2029%20158.5%20119.5t2.5%20190.5zm312-160q-9-96-89-170t-208.5-109-274.5-21q-223%2023-369.5%20141.5t-132.5%20264.5q9%2096%2089%20170t208.5%20109%20274.5%2021q223-23%20369.5-141.5t132.5-264.5zm308%204q0%2068-37%20139.5t-109%20137-168.5%20117.5-226%2083-270.5%2031-275-33.5-240.5-93-171.5-151-65-199.5q0-115%2069.5-245t197.5-258q169-169%20341.5-236t246.5%207q65%2064%2020%20209-4%2014-1%2020t10%207%2014.5-.5%2013.5-3.5l6-2q139-59%20246-59t153%2061q45%2063%200%20178-2%2013-4.5%2020t4.5%2012.5%2012%207.5%2017%206q57%2018%20103%2047t80%2081.5%2034%20116.5zm-74-624q42%2047%2054.5%20108.5t-6.5%20117.5q-8%2023-29.5%2034t-44.5%204q-23-8-34-29.5t-4-44.5q20-63-24-111t-107-35q-24%205-45-8t-25-37q-5-24%208-44.5t37-25.5q60-13%20119%205.5t101%2065.5zm181-163q87%2096%20112.5%20222.5t-13.5%20241.5q-9%2027-34%2040t-52%204-40-34-5-52q28-82%2010-172t-80-158q-62-69-148-95.5t-173-8.5q-28%206-52-9.5t-30-43.5%209.5-51.5%2043.5-29.5q123-26%20244%2011.5t208%20134.5z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
6354
+ var icon$k = "data:image/svg+xml,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M675%201284q21-34%2011-69t-45-50q-34-14-73-1t-60%2046q-22%2034-13%2068.5t43%2050.5%2074.5%202.5%2062.5-47.5zm94-121q8-13%203.5-26.5t-17.5-18.5q-14-5-28.5.5t-21.5%2018.5q-17%2031%2013%2045%2014%205%2029-.5t22-18.5zm174%20107q-45%20102-158%20150t-224%2012q-107-34-147.5-126.5t6.5-187.5q47-93%20151.5-139t210.5-19q111%2029%20158.5%20119.5t2.5%20190.5zm312-160q-9-96-89-170t-208.5-109-274.5-21q-223%2023-369.5%20141.5t-132.5%20264.5q9%2096%2089%20170t208.5%20109%20274.5%2021q223-23%20369.5-141.5t132.5-264.5zm308%204q0%2068-37%20139.5t-109%20137-168.5%20117.5-226%2083-270.5%2031-275-33.5-240.5-93-171.5-151-65-199.5q0-115%2069.5-245t197.5-258q169-169%20341.5-236t246.5%207q65%2064%2020%20209-4%2014-1%2020t10%207%2014.5-.5%2013.5-3.5l6-2q139-59%20246-59t153%2061q45%2063%200%20178-2%2013-4.5%2020t4.5%2012.5%2012%207.5%2017%206q57%2018%20103%2047t80%2081.5%2034%20116.5zm-74-624q42%2047%2054.5%20108.5t-6.5%20117.5q-8%2023-29.5%2034t-44.5%204q-23-8-34-29.5t-4-44.5q20-63-24-111t-107-35q-24%205-45-8t-25-37q-5-24%208-44.5t37-25.5q60-13%20119%205.5t101%2065.5zm181-163q87%2096%20112.5%20222.5t-13.5%20241.5q-9%2027-34%2040t-52%204-40-34-5-52q28-82%2010-172t-80-158q-62-69-148-95.5t-173-8.5q-28%206-52-9.5t-30-43.5%209.5-51.5%2043.5-29.5q123-26%20244%2011.5t208%20134.5z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
6344
6355
 
6345
6356
  var weibo = {
6346
6357
  key: 'weibo',
6347
6358
  name: 'Weibo',
6348
6359
  color: '#e71d34',
6349
- icon: icon$j
6360
+ icon: icon$k
6350
6361
  };
6351
6362
 
6352
- var icon$k = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M937%201004l266-499h-112l-157%20312q-24%2048-44%2092l-42-92-155-312h-120l263%20493v324h101v-318zm727-588v960q0%20119-84.5%20203.5t-203.5%2084.5h-960q-119%200-203.5-84.5t-84.5-203.5v-960q0-119%2084.5-203.5t203.5-84.5h960q119%200%20203.5%2084.5t84.5%20203.5z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
6363
+ var icon$l = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M937%201004l266-499h-112l-157%20312q-24%2048-44%2092l-42-92-155-312h-120l263%20493v324h101v-318zm727-588v960q0%20119-84.5%20203.5t-203.5%2084.5h-960q-119%200-203.5-84.5t-84.5-203.5v-960q0-119%2084.5-203.5t203.5-84.5h960q119%200%20203.5%2084.5t84.5%20203.5z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
6353
6364
 
6354
6365
  var yandex = {
6355
6366
  key: 'yandex',
6356
6367
  name: 'Yandex',
6357
6368
  color: '#d43b2f',
6358
- icon: icon$k,
6369
+ icon: icon$l,
6359
6370
  windowSize: {
6360
6371
  width: 655,
6361
6372
  height: 700
@@ -6379,6 +6390,7 @@ var providers = /*#__PURE__*/Object.freeze({
6379
6390
  oney: oney,
6380
6391
  orange: orange,
6381
6392
  paypal: paypal,
6393
+ ping: ping,
6382
6394
  qq: qq,
6383
6395
  twitter: twitter,
6384
6396
  vkontakte: vkontakte,
@@ -7413,15 +7425,15 @@ var checked = new Validator({
7413
7425
  hint: 'checked'
7414
7426
  });
7415
7427
  var email = new Validator({
7416
- rule: validator__default.isEmail,
7428
+ rule: validator.isEmail,
7417
7429
  hint: 'email'
7418
7430
  });
7419
7431
  var integer = new Validator({
7420
- rule: validator__default.isInt,
7432
+ rule: validator.isInt,
7421
7433
  hint: 'integer'
7422
7434
  });
7423
7435
  var _float = new Validator({
7424
- rule: validator__default.isFloat,
7436
+ rule: validator.isFloat,
7425
7437
  hint: 'float'
7426
7438
  });
7427
7439
 
@@ -7834,7 +7846,7 @@ function initCloneArray(array) {
7834
7846
  */
7835
7847
  function cloneArrayBuffer(arrayBuffer) {
7836
7848
  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
7837
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
7849
+ new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
7838
7850
  return result;
7839
7851
  }
7840
7852
 
@@ -8703,6 +8715,7 @@ var IdentifierField = /*#__PURE__*/function (_React$Component) {
8703
8715
  var _this$props$value = this.props.value,
8704
8716
  userInput = _this$props$value.userInput,
8705
8717
  country = _this$props$value.country;
8718
+ if (!userInput) return;
8706
8719
  try {
8707
8720
  var parsed = libphonenumber.parse(userInput, country);
8708
8721
  var phoneValue = country === parsed.country ? libphonenumber.format(parsed, 'National') : userInput;
@@ -9648,7 +9661,7 @@ function dateField(config) {
9648
9661
  validator: new Validator({
9649
9662
  rule: function rule(value) {
9650
9663
  var date = formatDate(value);
9651
- return !date || validator__default(date);
9664
+ return !date || validator.isISO8601(date);
9652
9665
  },
9653
9666
  hint: 'date'
9654
9667
  })
@@ -12760,6 +12773,1939 @@ var UiClient = /*#__PURE__*/function () {
12760
12773
  return UiClient;
12761
12774
  }();
12762
12775
 
12776
+ var byteLength_1 = byteLength;
12777
+ var toByteArray_1 = toByteArray;
12778
+ var fromByteArray_1 = fromByteArray;
12779
+ var lookup = [];
12780
+ var revLookup = [];
12781
+ var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
12782
+ var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
12783
+ for (var i = 0, len = code.length; i < len; ++i) {
12784
+ lookup[i] = code[i];
12785
+ revLookup[code.charCodeAt(i)] = i;
12786
+ }
12787
+
12788
+ // Support decoding URL-safe base64 strings, as Node.js does.
12789
+ // See: https://en.wikipedia.org/wiki/Base64#URL_applications
12790
+ revLookup['-'.charCodeAt(0)] = 62;
12791
+ revLookup['_'.charCodeAt(0)] = 63;
12792
+ function getLens(b64) {
12793
+ var len = b64.length;
12794
+ if (len % 4 > 0) {
12795
+ throw new Error('Invalid string. Length must be a multiple of 4');
12796
+ }
12797
+
12798
+ // Trim off extra bytes after placeholder bytes are found
12799
+ // See: https://github.com/beatgammit/base64-js/issues/42
12800
+ var validLen = b64.indexOf('=');
12801
+ if (validLen === -1) validLen = len;
12802
+ var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;
12803
+ return [validLen, placeHoldersLen];
12804
+ }
12805
+
12806
+ // base64 is 4/3 + up to two characters of the original data
12807
+ function byteLength(b64) {
12808
+ var lens = getLens(b64);
12809
+ var validLen = lens[0];
12810
+ var placeHoldersLen = lens[1];
12811
+ return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
12812
+ }
12813
+ function _byteLength(b64, validLen, placeHoldersLen) {
12814
+ return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
12815
+ }
12816
+ function toByteArray(b64) {
12817
+ var tmp;
12818
+ var lens = getLens(b64);
12819
+ var validLen = lens[0];
12820
+ var placeHoldersLen = lens[1];
12821
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
12822
+ var curByte = 0;
12823
+
12824
+ // if there are placeholders, only get up to the last complete 4 chars
12825
+ var len = placeHoldersLen > 0 ? validLen - 4 : validLen;
12826
+ var i;
12827
+ for (i = 0; i < len; i += 4) {
12828
+ tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
12829
+ arr[curByte++] = tmp >> 16 & 0xFF;
12830
+ arr[curByte++] = tmp >> 8 & 0xFF;
12831
+ arr[curByte++] = tmp & 0xFF;
12832
+ }
12833
+ if (placeHoldersLen === 2) {
12834
+ tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
12835
+ arr[curByte++] = tmp & 0xFF;
12836
+ }
12837
+ if (placeHoldersLen === 1) {
12838
+ tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
12839
+ arr[curByte++] = tmp >> 8 & 0xFF;
12840
+ arr[curByte++] = tmp & 0xFF;
12841
+ }
12842
+ return arr;
12843
+ }
12844
+ function tripletToBase64(num) {
12845
+ return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
12846
+ }
12847
+ function encodeChunk(uint8, start, end) {
12848
+ var tmp;
12849
+ var output = [];
12850
+ for (var i = start; i < end; i += 3) {
12851
+ tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF);
12852
+ output.push(tripletToBase64(tmp));
12853
+ }
12854
+ return output.join('');
12855
+ }
12856
+ function fromByteArray(uint8) {
12857
+ var tmp;
12858
+ var len = uint8.length;
12859
+ var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
12860
+ var parts = [];
12861
+ var maxChunkLength = 16383; // must be multiple of 3
12862
+
12863
+ // go through the array every three bytes, we'll deal with trailing stuff later
12864
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
12865
+ parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
12866
+ }
12867
+
12868
+ // pad the end with zeros, but make sure to not forget the extra bytes
12869
+ if (extraBytes === 1) {
12870
+ tmp = uint8[len - 1];
12871
+ parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '==');
12872
+ } else if (extraBytes === 2) {
12873
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1];
12874
+ parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '=');
12875
+ }
12876
+ return parts.join('');
12877
+ }
12878
+ var base64Js = {
12879
+ byteLength: byteLength_1,
12880
+ toByteArray: toByteArray_1,
12881
+ fromByteArray: fromByteArray_1
12882
+ };
12883
+
12884
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
12885
+ var read = function read(buffer, offset, isLE, mLen, nBytes) {
12886
+ var e, m;
12887
+ var eLen = nBytes * 8 - mLen - 1;
12888
+ var eMax = (1 << eLen) - 1;
12889
+ var eBias = eMax >> 1;
12890
+ var nBits = -7;
12891
+ var i = isLE ? nBytes - 1 : 0;
12892
+ var d = isLE ? -1 : 1;
12893
+ var s = buffer[offset + i];
12894
+ i += d;
12895
+ e = s & (1 << -nBits) - 1;
12896
+ s >>= -nBits;
12897
+ nBits += eLen;
12898
+ for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
12899
+ m = e & (1 << -nBits) - 1;
12900
+ e >>= -nBits;
12901
+ nBits += mLen;
12902
+ for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
12903
+ if (e === 0) {
12904
+ e = 1 - eBias;
12905
+ } else if (e === eMax) {
12906
+ return m ? NaN : (s ? -1 : 1) * Infinity;
12907
+ } else {
12908
+ m = m + Math.pow(2, mLen);
12909
+ e = e - eBias;
12910
+ }
12911
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
12912
+ };
12913
+ var write = function write(buffer, value, offset, isLE, mLen, nBytes) {
12914
+ var e, m, c;
12915
+ var eLen = nBytes * 8 - mLen - 1;
12916
+ var eMax = (1 << eLen) - 1;
12917
+ var eBias = eMax >> 1;
12918
+ var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
12919
+ var i = isLE ? 0 : nBytes - 1;
12920
+ var d = isLE ? 1 : -1;
12921
+ var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
12922
+ value = Math.abs(value);
12923
+ if (isNaN(value) || value === Infinity) {
12924
+ m = isNaN(value) ? 1 : 0;
12925
+ e = eMax;
12926
+ } else {
12927
+ e = Math.floor(Math.log(value) / Math.LN2);
12928
+ if (value * (c = Math.pow(2, -e)) < 1) {
12929
+ e--;
12930
+ c *= 2;
12931
+ }
12932
+ if (e + eBias >= 1) {
12933
+ value += rt / c;
12934
+ } else {
12935
+ value += rt * Math.pow(2, 1 - eBias);
12936
+ }
12937
+ if (value * c >= 2) {
12938
+ e++;
12939
+ c /= 2;
12940
+ }
12941
+ if (e + eBias >= eMax) {
12942
+ m = 0;
12943
+ e = eMax;
12944
+ } else if (e + eBias >= 1) {
12945
+ m = (value * c - 1) * Math.pow(2, mLen);
12946
+ e = e + eBias;
12947
+ } else {
12948
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
12949
+ e = 0;
12950
+ }
12951
+ }
12952
+ for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
12953
+ e = e << mLen | m;
12954
+ eLen += mLen;
12955
+ for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
12956
+ buffer[offset + i - d] |= s * 128;
12957
+ };
12958
+ var ieee754 = {
12959
+ read: read,
12960
+ write: write
12961
+ };
12962
+
12963
+ var buffer = createCommonjsModule(function (module, exports) {
12964
+
12965
+ var customInspectSymbol = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' // eslint-disable-line dot-notation
12966
+ ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
12967
+ : null;
12968
+ exports.Buffer = Buffer;
12969
+ exports.SlowBuffer = SlowBuffer;
12970
+ exports.INSPECT_MAX_BYTES = 50;
12971
+ var K_MAX_LENGTH = 0x7fffffff;
12972
+ exports.kMaxLength = K_MAX_LENGTH;
12973
+
12974
+ /**
12975
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
12976
+ * === true Use Uint8Array implementation (fastest)
12977
+ * === false Print warning and recommend using `buffer` v4.x which has an Object
12978
+ * implementation (most compatible, even IE6)
12979
+ *
12980
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
12981
+ * Opera 11.6+, iOS 4.2+.
12982
+ *
12983
+ * We report that the browser does not support typed arrays if the are not subclassable
12984
+ * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
12985
+ * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
12986
+ * for __proto__ and has a buggy typed array implementation.
12987
+ */
12988
+ Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport();
12989
+ if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') {
12990
+ console.error('This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.');
12991
+ }
12992
+ function typedArraySupport() {
12993
+ // Can typed array instances can be augmented?
12994
+ try {
12995
+ var arr = new Uint8Array(1);
12996
+ var proto = {
12997
+ foo: function foo() {
12998
+ return 42;
12999
+ }
13000
+ };
13001
+ Object.setPrototypeOf(proto, Uint8Array.prototype);
13002
+ Object.setPrototypeOf(arr, proto);
13003
+ return arr.foo() === 42;
13004
+ } catch (e) {
13005
+ return false;
13006
+ }
13007
+ }
13008
+ Object.defineProperty(Buffer.prototype, 'parent', {
13009
+ enumerable: true,
13010
+ get: function get() {
13011
+ if (!Buffer.isBuffer(this)) return undefined;
13012
+ return this.buffer;
13013
+ }
13014
+ });
13015
+ Object.defineProperty(Buffer.prototype, 'offset', {
13016
+ enumerable: true,
13017
+ get: function get() {
13018
+ if (!Buffer.isBuffer(this)) return undefined;
13019
+ return this.byteOffset;
13020
+ }
13021
+ });
13022
+ function createBuffer(length) {
13023
+ if (length > K_MAX_LENGTH) {
13024
+ throw new RangeError('The value "' + length + '" is invalid for option "size"');
13025
+ }
13026
+ // Return an augmented `Uint8Array` instance
13027
+ var buf = new Uint8Array(length);
13028
+ Object.setPrototypeOf(buf, Buffer.prototype);
13029
+ return buf;
13030
+ }
13031
+
13032
+ /**
13033
+ * The Buffer constructor returns instances of `Uint8Array` that have their
13034
+ * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
13035
+ * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
13036
+ * and the `Uint8Array` methods. Square bracket notation works as expected -- it
13037
+ * returns a single octet.
13038
+ *
13039
+ * The `Uint8Array` prototype remains unmodified.
13040
+ */
13041
+
13042
+ function Buffer(arg, encodingOrOffset, length) {
13043
+ // Common case.
13044
+ if (typeof arg === 'number') {
13045
+ if (typeof encodingOrOffset === 'string') {
13046
+ throw new TypeError('The "string" argument must be of type string. Received type number');
13047
+ }
13048
+ return allocUnsafe(arg);
13049
+ }
13050
+ return from(arg, encodingOrOffset, length);
13051
+ }
13052
+ Buffer.poolSize = 8192; // not used by this implementation
13053
+
13054
+ function from(value, encodingOrOffset, length) {
13055
+ if (typeof value === 'string') {
13056
+ return fromString(value, encodingOrOffset);
13057
+ }
13058
+ if (ArrayBuffer.isView(value)) {
13059
+ return fromArrayView(value);
13060
+ }
13061
+ if (value == null) {
13062
+ throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + _typeof(value));
13063
+ }
13064
+ if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {
13065
+ return fromArrayBuffer(value, encodingOrOffset, length);
13066
+ }
13067
+ if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) {
13068
+ return fromArrayBuffer(value, encodingOrOffset, length);
13069
+ }
13070
+ if (typeof value === 'number') {
13071
+ throw new TypeError('The "value" argument must not be of type number. Received type number');
13072
+ }
13073
+ var valueOf = value.valueOf && value.valueOf();
13074
+ if (valueOf != null && valueOf !== value) {
13075
+ return Buffer.from(valueOf, encodingOrOffset, length);
13076
+ }
13077
+ var b = fromObject(value);
13078
+ if (b) return b;
13079
+ if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') {
13080
+ return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length);
13081
+ }
13082
+ throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + _typeof(value));
13083
+ }
13084
+
13085
+ /**
13086
+ * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
13087
+ * if value is a number.
13088
+ * Buffer.from(str[, encoding])
13089
+ * Buffer.from(array)
13090
+ * Buffer.from(buffer)
13091
+ * Buffer.from(arrayBuffer[, byteOffset[, length]])
13092
+ **/
13093
+ Buffer.from = function (value, encodingOrOffset, length) {
13094
+ return from(value, encodingOrOffset, length);
13095
+ };
13096
+
13097
+ // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
13098
+ // https://github.com/feross/buffer/pull/148
13099
+ Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype);
13100
+ Object.setPrototypeOf(Buffer, Uint8Array);
13101
+ function assertSize(size) {
13102
+ if (typeof size !== 'number') {
13103
+ throw new TypeError('"size" argument must be of type number');
13104
+ } else if (size < 0) {
13105
+ throw new RangeError('The value "' + size + '" is invalid for option "size"');
13106
+ }
13107
+ }
13108
+ function alloc(size, fill, encoding) {
13109
+ assertSize(size);
13110
+ if (size <= 0) {
13111
+ return createBuffer(size);
13112
+ }
13113
+ if (fill !== undefined) {
13114
+ // Only pay attention to encoding if it's a string. This
13115
+ // prevents accidentally sending in a number that would
13116
+ // be interpreted as a start offset.
13117
+ return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);
13118
+ }
13119
+ return createBuffer(size);
13120
+ }
13121
+
13122
+ /**
13123
+ * Creates a new filled Buffer instance.
13124
+ * alloc(size[, fill[, encoding]])
13125
+ **/
13126
+ Buffer.alloc = function (size, fill, encoding) {
13127
+ return alloc(size, fill, encoding);
13128
+ };
13129
+ function allocUnsafe(size) {
13130
+ assertSize(size);
13131
+ return createBuffer(size < 0 ? 0 : checked(size) | 0);
13132
+ }
13133
+
13134
+ /**
13135
+ * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
13136
+ * */
13137
+ Buffer.allocUnsafe = function (size) {
13138
+ return allocUnsafe(size);
13139
+ };
13140
+ /**
13141
+ * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
13142
+ */
13143
+ Buffer.allocUnsafeSlow = function (size) {
13144
+ return allocUnsafe(size);
13145
+ };
13146
+ function fromString(string, encoding) {
13147
+ if (typeof encoding !== 'string' || encoding === '') {
13148
+ encoding = 'utf8';
13149
+ }
13150
+ if (!Buffer.isEncoding(encoding)) {
13151
+ throw new TypeError('Unknown encoding: ' + encoding);
13152
+ }
13153
+ var length = byteLength(string, encoding) | 0;
13154
+ var buf = createBuffer(length);
13155
+ var actual = buf.write(string, encoding);
13156
+ if (actual !== length) {
13157
+ // Writing a hex string, for example, that contains invalid characters will
13158
+ // cause everything after the first invalid character to be ignored. (e.g.
13159
+ // 'abxxcd' will be treated as 'ab')
13160
+ buf = buf.slice(0, actual);
13161
+ }
13162
+ return buf;
13163
+ }
13164
+ function fromArrayLike(array) {
13165
+ var length = array.length < 0 ? 0 : checked(array.length) | 0;
13166
+ var buf = createBuffer(length);
13167
+ for (var i = 0; i < length; i += 1) {
13168
+ buf[i] = array[i] & 255;
13169
+ }
13170
+ return buf;
13171
+ }
13172
+ function fromArrayView(arrayView) {
13173
+ if (isInstance(arrayView, Uint8Array)) {
13174
+ var copy = new Uint8Array(arrayView);
13175
+ return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);
13176
+ }
13177
+ return fromArrayLike(arrayView);
13178
+ }
13179
+ function fromArrayBuffer(array, byteOffset, length) {
13180
+ if (byteOffset < 0 || array.byteLength < byteOffset) {
13181
+ throw new RangeError('"offset" is outside of buffer bounds');
13182
+ }
13183
+ if (array.byteLength < byteOffset + (length || 0)) {
13184
+ throw new RangeError('"length" is outside of buffer bounds');
13185
+ }
13186
+ var buf;
13187
+ if (byteOffset === undefined && length === undefined) {
13188
+ buf = new Uint8Array(array);
13189
+ } else if (length === undefined) {
13190
+ buf = new Uint8Array(array, byteOffset);
13191
+ } else {
13192
+ buf = new Uint8Array(array, byteOffset, length);
13193
+ }
13194
+
13195
+ // Return an augmented `Uint8Array` instance
13196
+ Object.setPrototypeOf(buf, Buffer.prototype);
13197
+ return buf;
13198
+ }
13199
+ function fromObject(obj) {
13200
+ if (Buffer.isBuffer(obj)) {
13201
+ var len = checked(obj.length) | 0;
13202
+ var buf = createBuffer(len);
13203
+ if (buf.length === 0) {
13204
+ return buf;
13205
+ }
13206
+ obj.copy(buf, 0, 0, len);
13207
+ return buf;
13208
+ }
13209
+ if (obj.length !== undefined) {
13210
+ if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
13211
+ return createBuffer(0);
13212
+ }
13213
+ return fromArrayLike(obj);
13214
+ }
13215
+ if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
13216
+ return fromArrayLike(obj.data);
13217
+ }
13218
+ }
13219
+ function checked(length) {
13220
+ // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
13221
+ // length is NaN (which is otherwise coerced to zero.)
13222
+ if (length >= K_MAX_LENGTH) {
13223
+ throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes');
13224
+ }
13225
+ return length | 0;
13226
+ }
13227
+ function SlowBuffer(length) {
13228
+ if (+length != length) {
13229
+ // eslint-disable-line eqeqeq
13230
+ length = 0;
13231
+ }
13232
+ return Buffer.alloc(+length);
13233
+ }
13234
+ Buffer.isBuffer = function isBuffer(b) {
13235
+ return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false
13236
+ };
13237
+
13238
+ Buffer.compare = function compare(a, b) {
13239
+ if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength);
13240
+ if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength);
13241
+ if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
13242
+ throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
13243
+ }
13244
+ if (a === b) return 0;
13245
+ var x = a.length;
13246
+ var y = b.length;
13247
+ for (var i = 0, len = Math.min(x, y); i < len; ++i) {
13248
+ if (a[i] !== b[i]) {
13249
+ x = a[i];
13250
+ y = b[i];
13251
+ break;
13252
+ }
13253
+ }
13254
+ if (x < y) return -1;
13255
+ if (y < x) return 1;
13256
+ return 0;
13257
+ };
13258
+ Buffer.isEncoding = function isEncoding(encoding) {
13259
+ switch (String(encoding).toLowerCase()) {
13260
+ case 'hex':
13261
+ case 'utf8':
13262
+ case 'utf-8':
13263
+ case 'ascii':
13264
+ case 'latin1':
13265
+ case 'binary':
13266
+ case 'base64':
13267
+ case 'ucs2':
13268
+ case 'ucs-2':
13269
+ case 'utf16le':
13270
+ case 'utf-16le':
13271
+ return true;
13272
+ default:
13273
+ return false;
13274
+ }
13275
+ };
13276
+ Buffer.concat = function concat(list, length) {
13277
+ if (!Array.isArray(list)) {
13278
+ throw new TypeError('"list" argument must be an Array of Buffers');
13279
+ }
13280
+ if (list.length === 0) {
13281
+ return Buffer.alloc(0);
13282
+ }
13283
+ var i;
13284
+ if (length === undefined) {
13285
+ length = 0;
13286
+ for (i = 0; i < list.length; ++i) {
13287
+ length += list[i].length;
13288
+ }
13289
+ }
13290
+ var buffer = Buffer.allocUnsafe(length);
13291
+ var pos = 0;
13292
+ for (i = 0; i < list.length; ++i) {
13293
+ var buf = list[i];
13294
+ if (isInstance(buf, Uint8Array)) {
13295
+ if (pos + buf.length > buffer.length) {
13296
+ if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf);
13297
+ buf.copy(buffer, pos);
13298
+ } else {
13299
+ Uint8Array.prototype.set.call(buffer, buf, pos);
13300
+ }
13301
+ } else if (!Buffer.isBuffer(buf)) {
13302
+ throw new TypeError('"list" argument must be an Array of Buffers');
13303
+ } else {
13304
+ buf.copy(buffer, pos);
13305
+ }
13306
+ pos += buf.length;
13307
+ }
13308
+ return buffer;
13309
+ };
13310
+ function byteLength(string, encoding) {
13311
+ if (Buffer.isBuffer(string)) {
13312
+ return string.length;
13313
+ }
13314
+ if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
13315
+ return string.byteLength;
13316
+ }
13317
+ if (typeof string !== 'string') {
13318
+ throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + _typeof(string));
13319
+ }
13320
+ var len = string.length;
13321
+ var mustMatch = arguments.length > 2 && arguments[2] === true;
13322
+ if (!mustMatch && len === 0) return 0;
13323
+
13324
+ // Use a for loop to avoid recursion
13325
+ var loweredCase = false;
13326
+ for (;;) {
13327
+ switch (encoding) {
13328
+ case 'ascii':
13329
+ case 'latin1':
13330
+ case 'binary':
13331
+ return len;
13332
+ case 'utf8':
13333
+ case 'utf-8':
13334
+ return utf8ToBytes(string).length;
13335
+ case 'ucs2':
13336
+ case 'ucs-2':
13337
+ case 'utf16le':
13338
+ case 'utf-16le':
13339
+ return len * 2;
13340
+ case 'hex':
13341
+ return len >>> 1;
13342
+ case 'base64':
13343
+ return base64ToBytes(string).length;
13344
+ default:
13345
+ if (loweredCase) {
13346
+ return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8
13347
+ }
13348
+
13349
+ encoding = ('' + encoding).toLowerCase();
13350
+ loweredCase = true;
13351
+ }
13352
+ }
13353
+ }
13354
+ Buffer.byteLength = byteLength;
13355
+ function slowToString(encoding, start, end) {
13356
+ var loweredCase = false;
13357
+
13358
+ // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
13359
+ // property of a typed array.
13360
+
13361
+ // This behaves neither like String nor Uint8Array in that we set start/end
13362
+ // to their upper/lower bounds if the value passed is out of range.
13363
+ // undefined is handled specially as per ECMA-262 6th Edition,
13364
+ // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
13365
+ if (start === undefined || start < 0) {
13366
+ start = 0;
13367
+ }
13368
+ // Return early if start > this.length. Done here to prevent potential uint32
13369
+ // coercion fail below.
13370
+ if (start > this.length) {
13371
+ return '';
13372
+ }
13373
+ if (end === undefined || end > this.length) {
13374
+ end = this.length;
13375
+ }
13376
+ if (end <= 0) {
13377
+ return '';
13378
+ }
13379
+
13380
+ // Force coercion to uint32. This will also coerce falsey/NaN values to 0.
13381
+ end >>>= 0;
13382
+ start >>>= 0;
13383
+ if (end <= start) {
13384
+ return '';
13385
+ }
13386
+ if (!encoding) encoding = 'utf8';
13387
+ while (true) {
13388
+ switch (encoding) {
13389
+ case 'hex':
13390
+ return hexSlice(this, start, end);
13391
+ case 'utf8':
13392
+ case 'utf-8':
13393
+ return utf8Slice(this, start, end);
13394
+ case 'ascii':
13395
+ return asciiSlice(this, start, end);
13396
+ case 'latin1':
13397
+ case 'binary':
13398
+ return latin1Slice(this, start, end);
13399
+ case 'base64':
13400
+ return base64Slice(this, start, end);
13401
+ case 'ucs2':
13402
+ case 'ucs-2':
13403
+ case 'utf16le':
13404
+ case 'utf-16le':
13405
+ return utf16leSlice(this, start, end);
13406
+ default:
13407
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
13408
+ encoding = (encoding + '').toLowerCase();
13409
+ loweredCase = true;
13410
+ }
13411
+ }
13412
+ }
13413
+
13414
+ // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
13415
+ // to detect a Buffer instance. It's not possible to use `instanceof Buffer`
13416
+ // reliably in a browserify context because there could be multiple different
13417
+ // copies of the 'buffer' package in use. This method works even for Buffer
13418
+ // instances that were created from another copy of the `buffer` package.
13419
+ // See: https://github.com/feross/buffer/issues/154
13420
+ Buffer.prototype._isBuffer = true;
13421
+ function swap(b, n, m) {
13422
+ var i = b[n];
13423
+ b[n] = b[m];
13424
+ b[m] = i;
13425
+ }
13426
+ Buffer.prototype.swap16 = function swap16() {
13427
+ var len = this.length;
13428
+ if (len % 2 !== 0) {
13429
+ throw new RangeError('Buffer size must be a multiple of 16-bits');
13430
+ }
13431
+ for (var i = 0; i < len; i += 2) {
13432
+ swap(this, i, i + 1);
13433
+ }
13434
+ return this;
13435
+ };
13436
+ Buffer.prototype.swap32 = function swap32() {
13437
+ var len = this.length;
13438
+ if (len % 4 !== 0) {
13439
+ throw new RangeError('Buffer size must be a multiple of 32-bits');
13440
+ }
13441
+ for (var i = 0; i < len; i += 4) {
13442
+ swap(this, i, i + 3);
13443
+ swap(this, i + 1, i + 2);
13444
+ }
13445
+ return this;
13446
+ };
13447
+ Buffer.prototype.swap64 = function swap64() {
13448
+ var len = this.length;
13449
+ if (len % 8 !== 0) {
13450
+ throw new RangeError('Buffer size must be a multiple of 64-bits');
13451
+ }
13452
+ for (var i = 0; i < len; i += 8) {
13453
+ swap(this, i, i + 7);
13454
+ swap(this, i + 1, i + 6);
13455
+ swap(this, i + 2, i + 5);
13456
+ swap(this, i + 3, i + 4);
13457
+ }
13458
+ return this;
13459
+ };
13460
+ Buffer.prototype.toString = function toString() {
13461
+ var length = this.length;
13462
+ if (length === 0) return '';
13463
+ if (arguments.length === 0) return utf8Slice(this, 0, length);
13464
+ return slowToString.apply(this, arguments);
13465
+ };
13466
+ Buffer.prototype.toLocaleString = Buffer.prototype.toString;
13467
+ Buffer.prototype.equals = function equals(b) {
13468
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer');
13469
+ if (this === b) return true;
13470
+ return Buffer.compare(this, b) === 0;
13471
+ };
13472
+ Buffer.prototype.inspect = function inspect() {
13473
+ var str = '';
13474
+ var max = exports.INSPECT_MAX_BYTES;
13475
+ str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim();
13476
+ if (this.length > max) str += ' ... ';
13477
+ return '<Buffer ' + str + '>';
13478
+ };
13479
+ if (customInspectSymbol) {
13480
+ Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect;
13481
+ }
13482
+ Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
13483
+ if (isInstance(target, Uint8Array)) {
13484
+ target = Buffer.from(target, target.offset, target.byteLength);
13485
+ }
13486
+ if (!Buffer.isBuffer(target)) {
13487
+ throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + _typeof(target));
13488
+ }
13489
+ if (start === undefined) {
13490
+ start = 0;
13491
+ }
13492
+ if (end === undefined) {
13493
+ end = target ? target.length : 0;
13494
+ }
13495
+ if (thisStart === undefined) {
13496
+ thisStart = 0;
13497
+ }
13498
+ if (thisEnd === undefined) {
13499
+ thisEnd = this.length;
13500
+ }
13501
+ if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
13502
+ throw new RangeError('out of range index');
13503
+ }
13504
+ if (thisStart >= thisEnd && start >= end) {
13505
+ return 0;
13506
+ }
13507
+ if (thisStart >= thisEnd) {
13508
+ return -1;
13509
+ }
13510
+ if (start >= end) {
13511
+ return 1;
13512
+ }
13513
+ start >>>= 0;
13514
+ end >>>= 0;
13515
+ thisStart >>>= 0;
13516
+ thisEnd >>>= 0;
13517
+ if (this === target) return 0;
13518
+ var x = thisEnd - thisStart;
13519
+ var y = end - start;
13520
+ var len = Math.min(x, y);
13521
+ var thisCopy = this.slice(thisStart, thisEnd);
13522
+ var targetCopy = target.slice(start, end);
13523
+ for (var i = 0; i < len; ++i) {
13524
+ if (thisCopy[i] !== targetCopy[i]) {
13525
+ x = thisCopy[i];
13526
+ y = targetCopy[i];
13527
+ break;
13528
+ }
13529
+ }
13530
+ if (x < y) return -1;
13531
+ if (y < x) return 1;
13532
+ return 0;
13533
+ };
13534
+
13535
+ // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
13536
+ // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
13537
+ //
13538
+ // Arguments:
13539
+ // - buffer - a Buffer to search
13540
+ // - val - a string, Buffer, or number
13541
+ // - byteOffset - an index into `buffer`; will be clamped to an int32
13542
+ // - encoding - an optional encoding, relevant is val is a string
13543
+ // - dir - true for indexOf, false for lastIndexOf
13544
+ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
13545
+ // Empty buffer means no match
13546
+ if (buffer.length === 0) return -1;
13547
+
13548
+ // Normalize byteOffset
13549
+ if (typeof byteOffset === 'string') {
13550
+ encoding = byteOffset;
13551
+ byteOffset = 0;
13552
+ } else if (byteOffset > 0x7fffffff) {
13553
+ byteOffset = 0x7fffffff;
13554
+ } else if (byteOffset < -0x80000000) {
13555
+ byteOffset = -0x80000000;
13556
+ }
13557
+ byteOffset = +byteOffset; // Coerce to Number.
13558
+ if (numberIsNaN(byteOffset)) {
13559
+ // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
13560
+ byteOffset = dir ? 0 : buffer.length - 1;
13561
+ }
13562
+
13563
+ // Normalize byteOffset: negative offsets start from the end of the buffer
13564
+ if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
13565
+ if (byteOffset >= buffer.length) {
13566
+ if (dir) return -1;else byteOffset = buffer.length - 1;
13567
+ } else if (byteOffset < 0) {
13568
+ if (dir) byteOffset = 0;else return -1;
13569
+ }
13570
+
13571
+ // Normalize val
13572
+ if (typeof val === 'string') {
13573
+ val = Buffer.from(val, encoding);
13574
+ }
13575
+
13576
+ // Finally, search either indexOf (if dir is true) or lastIndexOf
13577
+ if (Buffer.isBuffer(val)) {
13578
+ // Special case: looking for empty string/buffer always fails
13579
+ if (val.length === 0) {
13580
+ return -1;
13581
+ }
13582
+ return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
13583
+ } else if (typeof val === 'number') {
13584
+ val = val & 0xFF; // Search for a byte value [0-255]
13585
+ if (typeof Uint8Array.prototype.indexOf === 'function') {
13586
+ if (dir) {
13587
+ return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
13588
+ } else {
13589
+ return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
13590
+ }
13591
+ }
13592
+ return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
13593
+ }
13594
+ throw new TypeError('val must be string, number or Buffer');
13595
+ }
13596
+ function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
13597
+ var indexSize = 1;
13598
+ var arrLength = arr.length;
13599
+ var valLength = val.length;
13600
+ if (encoding !== undefined) {
13601
+ encoding = String(encoding).toLowerCase();
13602
+ if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') {
13603
+ if (arr.length < 2 || val.length < 2) {
13604
+ return -1;
13605
+ }
13606
+ indexSize = 2;
13607
+ arrLength /= 2;
13608
+ valLength /= 2;
13609
+ byteOffset /= 2;
13610
+ }
13611
+ }
13612
+ function read(buf, i) {
13613
+ if (indexSize === 1) {
13614
+ return buf[i];
13615
+ } else {
13616
+ return buf.readUInt16BE(i * indexSize);
13617
+ }
13618
+ }
13619
+ var i;
13620
+ if (dir) {
13621
+ var foundIndex = -1;
13622
+ for (i = byteOffset; i < arrLength; i++) {
13623
+ if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
13624
+ if (foundIndex === -1) foundIndex = i;
13625
+ if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
13626
+ } else {
13627
+ if (foundIndex !== -1) i -= i - foundIndex;
13628
+ foundIndex = -1;
13629
+ }
13630
+ }
13631
+ } else {
13632
+ if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
13633
+ for (i = byteOffset; i >= 0; i--) {
13634
+ var found = true;
13635
+ for (var j = 0; j < valLength; j++) {
13636
+ if (read(arr, i + j) !== read(val, j)) {
13637
+ found = false;
13638
+ break;
13639
+ }
13640
+ }
13641
+ if (found) return i;
13642
+ }
13643
+ }
13644
+ return -1;
13645
+ }
13646
+ Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
13647
+ return this.indexOf(val, byteOffset, encoding) !== -1;
13648
+ };
13649
+ Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
13650
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
13651
+ };
13652
+ Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
13653
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
13654
+ };
13655
+ function hexWrite(buf, string, offset, length) {
13656
+ offset = Number(offset) || 0;
13657
+ var remaining = buf.length - offset;
13658
+ if (!length) {
13659
+ length = remaining;
13660
+ } else {
13661
+ length = Number(length);
13662
+ if (length > remaining) {
13663
+ length = remaining;
13664
+ }
13665
+ }
13666
+ var strLen = string.length;
13667
+ if (length > strLen / 2) {
13668
+ length = strLen / 2;
13669
+ }
13670
+ var i;
13671
+ for (i = 0; i < length; ++i) {
13672
+ var parsed = parseInt(string.substr(i * 2, 2), 16);
13673
+ if (numberIsNaN(parsed)) return i;
13674
+ buf[offset + i] = parsed;
13675
+ }
13676
+ return i;
13677
+ }
13678
+ function utf8Write(buf, string, offset, length) {
13679
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
13680
+ }
13681
+ function asciiWrite(buf, string, offset, length) {
13682
+ return blitBuffer(asciiToBytes(string), buf, offset, length);
13683
+ }
13684
+ function base64Write(buf, string, offset, length) {
13685
+ return blitBuffer(base64ToBytes(string), buf, offset, length);
13686
+ }
13687
+ function ucs2Write(buf, string, offset, length) {
13688
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
13689
+ }
13690
+ Buffer.prototype.write = function write(string, offset, length, encoding) {
13691
+ // Buffer#write(string)
13692
+ if (offset === undefined) {
13693
+ encoding = 'utf8';
13694
+ length = this.length;
13695
+ offset = 0;
13696
+ // Buffer#write(string, encoding)
13697
+ } else if (length === undefined && typeof offset === 'string') {
13698
+ encoding = offset;
13699
+ length = this.length;
13700
+ offset = 0;
13701
+ // Buffer#write(string, offset[, length][, encoding])
13702
+ } else if (isFinite(offset)) {
13703
+ offset = offset >>> 0;
13704
+ if (isFinite(length)) {
13705
+ length = length >>> 0;
13706
+ if (encoding === undefined) encoding = 'utf8';
13707
+ } else {
13708
+ encoding = length;
13709
+ length = undefined;
13710
+ }
13711
+ } else {
13712
+ throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');
13713
+ }
13714
+ var remaining = this.length - offset;
13715
+ if (length === undefined || length > remaining) length = remaining;
13716
+ if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
13717
+ throw new RangeError('Attempt to write outside buffer bounds');
13718
+ }
13719
+ if (!encoding) encoding = 'utf8';
13720
+ var loweredCase = false;
13721
+ for (;;) {
13722
+ switch (encoding) {
13723
+ case 'hex':
13724
+ return hexWrite(this, string, offset, length);
13725
+ case 'utf8':
13726
+ case 'utf-8':
13727
+ return utf8Write(this, string, offset, length);
13728
+ case 'ascii':
13729
+ case 'latin1':
13730
+ case 'binary':
13731
+ return asciiWrite(this, string, offset, length);
13732
+ case 'base64':
13733
+ // Warning: maxLength not taken into account in base64Write
13734
+ return base64Write(this, string, offset, length);
13735
+ case 'ucs2':
13736
+ case 'ucs-2':
13737
+ case 'utf16le':
13738
+ case 'utf-16le':
13739
+ return ucs2Write(this, string, offset, length);
13740
+ default:
13741
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
13742
+ encoding = ('' + encoding).toLowerCase();
13743
+ loweredCase = true;
13744
+ }
13745
+ }
13746
+ };
13747
+ Buffer.prototype.toJSON = function toJSON() {
13748
+ return {
13749
+ type: 'Buffer',
13750
+ data: Array.prototype.slice.call(this._arr || this, 0)
13751
+ };
13752
+ };
13753
+ function base64Slice(buf, start, end) {
13754
+ if (start === 0 && end === buf.length) {
13755
+ return base64Js.fromByteArray(buf);
13756
+ } else {
13757
+ return base64Js.fromByteArray(buf.slice(start, end));
13758
+ }
13759
+ }
13760
+ function utf8Slice(buf, start, end) {
13761
+ end = Math.min(buf.length, end);
13762
+ var res = [];
13763
+ var i = start;
13764
+ while (i < end) {
13765
+ var firstByte = buf[i];
13766
+ var codePoint = null;
13767
+ var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1;
13768
+ if (i + bytesPerSequence <= end) {
13769
+ var secondByte = void 0,
13770
+ thirdByte = void 0,
13771
+ fourthByte = void 0,
13772
+ tempCodePoint = void 0;
13773
+ switch (bytesPerSequence) {
13774
+ case 1:
13775
+ if (firstByte < 0x80) {
13776
+ codePoint = firstByte;
13777
+ }
13778
+ break;
13779
+ case 2:
13780
+ secondByte = buf[i + 1];
13781
+ if ((secondByte & 0xC0) === 0x80) {
13782
+ tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F;
13783
+ if (tempCodePoint > 0x7F) {
13784
+ codePoint = tempCodePoint;
13785
+ }
13786
+ }
13787
+ break;
13788
+ case 3:
13789
+ secondByte = buf[i + 1];
13790
+ thirdByte = buf[i + 2];
13791
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
13792
+ tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F;
13793
+ if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
13794
+ codePoint = tempCodePoint;
13795
+ }
13796
+ }
13797
+ break;
13798
+ case 4:
13799
+ secondByte = buf[i + 1];
13800
+ thirdByte = buf[i + 2];
13801
+ fourthByte = buf[i + 3];
13802
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
13803
+ tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F;
13804
+ if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
13805
+ codePoint = tempCodePoint;
13806
+ }
13807
+ }
13808
+ }
13809
+ }
13810
+ if (codePoint === null) {
13811
+ // we did not generate a valid codePoint so insert a
13812
+ // replacement char (U+FFFD) and advance only 1 byte
13813
+ codePoint = 0xFFFD;
13814
+ bytesPerSequence = 1;
13815
+ } else if (codePoint > 0xFFFF) {
13816
+ // encode to utf16 (surrogate pair dance)
13817
+ codePoint -= 0x10000;
13818
+ res.push(codePoint >>> 10 & 0x3FF | 0xD800);
13819
+ codePoint = 0xDC00 | codePoint & 0x3FF;
13820
+ }
13821
+ res.push(codePoint);
13822
+ i += bytesPerSequence;
13823
+ }
13824
+ return decodeCodePointsArray(res);
13825
+ }
13826
+
13827
+ // Based on http://stackoverflow.com/a/22747272/680742, the browser with
13828
+ // the lowest limit is Chrome, with 0x10000 args.
13829
+ // We go 1 magnitude less, for safety
13830
+ var MAX_ARGUMENTS_LENGTH = 0x1000;
13831
+ function decodeCodePointsArray(codePoints) {
13832
+ var len = codePoints.length;
13833
+ if (len <= MAX_ARGUMENTS_LENGTH) {
13834
+ return String.fromCharCode.apply(String, codePoints); // avoid extra slice()
13835
+ }
13836
+
13837
+ // Decode in chunks to avoid "call stack size exceeded".
13838
+ var res = '';
13839
+ var i = 0;
13840
+ while (i < len) {
13841
+ res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
13842
+ }
13843
+ return res;
13844
+ }
13845
+ function asciiSlice(buf, start, end) {
13846
+ var ret = '';
13847
+ end = Math.min(buf.length, end);
13848
+ for (var i = start; i < end; ++i) {
13849
+ ret += String.fromCharCode(buf[i] & 0x7F);
13850
+ }
13851
+ return ret;
13852
+ }
13853
+ function latin1Slice(buf, start, end) {
13854
+ var ret = '';
13855
+ end = Math.min(buf.length, end);
13856
+ for (var i = start; i < end; ++i) {
13857
+ ret += String.fromCharCode(buf[i]);
13858
+ }
13859
+ return ret;
13860
+ }
13861
+ function hexSlice(buf, start, end) {
13862
+ var len = buf.length;
13863
+ if (!start || start < 0) start = 0;
13864
+ if (!end || end < 0 || end > len) end = len;
13865
+ var out = '';
13866
+ for (var i = start; i < end; ++i) {
13867
+ out += hexSliceLookupTable[buf[i]];
13868
+ }
13869
+ return out;
13870
+ }
13871
+ function utf16leSlice(buf, start, end) {
13872
+ var bytes = buf.slice(start, end);
13873
+ var res = '';
13874
+ // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)
13875
+ for (var i = 0; i < bytes.length - 1; i += 2) {
13876
+ res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
13877
+ }
13878
+ return res;
13879
+ }
13880
+ Buffer.prototype.slice = function slice(start, end) {
13881
+ var len = this.length;
13882
+ start = ~~start;
13883
+ end = end === undefined ? len : ~~end;
13884
+ if (start < 0) {
13885
+ start += len;
13886
+ if (start < 0) start = 0;
13887
+ } else if (start > len) {
13888
+ start = len;
13889
+ }
13890
+ if (end < 0) {
13891
+ end += len;
13892
+ if (end < 0) end = 0;
13893
+ } else if (end > len) {
13894
+ end = len;
13895
+ }
13896
+ if (end < start) end = start;
13897
+ var newBuf = this.subarray(start, end);
13898
+ // Return an augmented `Uint8Array` instance
13899
+ Object.setPrototypeOf(newBuf, Buffer.prototype);
13900
+ return newBuf;
13901
+ };
13902
+
13903
+ /*
13904
+ * Need to make sure that buffer isn't trying to write out of bounds.
13905
+ */
13906
+ function checkOffset(offset, ext, length) {
13907
+ if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint');
13908
+ if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');
13909
+ }
13910
+ Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
13911
+ offset = offset >>> 0;
13912
+ byteLength = byteLength >>> 0;
13913
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
13914
+ var val = this[offset];
13915
+ var mul = 1;
13916
+ var i = 0;
13917
+ while (++i < byteLength && (mul *= 0x100)) {
13918
+ val += this[offset + i] * mul;
13919
+ }
13920
+ return val;
13921
+ };
13922
+ Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
13923
+ offset = offset >>> 0;
13924
+ byteLength = byteLength >>> 0;
13925
+ if (!noAssert) {
13926
+ checkOffset(offset, byteLength, this.length);
13927
+ }
13928
+ var val = this[offset + --byteLength];
13929
+ var mul = 1;
13930
+ while (byteLength > 0 && (mul *= 0x100)) {
13931
+ val += this[offset + --byteLength] * mul;
13932
+ }
13933
+ return val;
13934
+ };
13935
+ Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
13936
+ offset = offset >>> 0;
13937
+ if (!noAssert) checkOffset(offset, 1, this.length);
13938
+ return this[offset];
13939
+ };
13940
+ Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
13941
+ offset = offset >>> 0;
13942
+ if (!noAssert) checkOffset(offset, 2, this.length);
13943
+ return this[offset] | this[offset + 1] << 8;
13944
+ };
13945
+ Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
13946
+ offset = offset >>> 0;
13947
+ if (!noAssert) checkOffset(offset, 2, this.length);
13948
+ return this[offset] << 8 | this[offset + 1];
13949
+ };
13950
+ Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
13951
+ offset = offset >>> 0;
13952
+ if (!noAssert) checkOffset(offset, 4, this.length);
13953
+ return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000;
13954
+ };
13955
+ Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
13956
+ offset = offset >>> 0;
13957
+ if (!noAssert) checkOffset(offset, 4, this.length);
13958
+ return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
13959
+ };
13960
+ Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {
13961
+ offset = offset >>> 0;
13962
+ validateNumber(offset, 'offset');
13963
+ var first = this[offset];
13964
+ var last = this[offset + 7];
13965
+ if (first === undefined || last === undefined) {
13966
+ boundsError(offset, this.length - 8);
13967
+ }
13968
+ var lo = first + this[++offset] * Math.pow(2, 8) + this[++offset] * Math.pow(2, 16) + this[++offset] * Math.pow(2, 24);
13969
+ var hi = this[++offset] + this[++offset] * Math.pow(2, 8) + this[++offset] * Math.pow(2, 16) + last * Math.pow(2, 24);
13970
+ return BigInt(lo) + (BigInt(hi) << BigInt(32));
13971
+ });
13972
+ Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {
13973
+ offset = offset >>> 0;
13974
+ validateNumber(offset, 'offset');
13975
+ var first = this[offset];
13976
+ var last = this[offset + 7];
13977
+ if (first === undefined || last === undefined) {
13978
+ boundsError(offset, this.length - 8);
13979
+ }
13980
+ var hi = first * Math.pow(2, 24) + this[++offset] * Math.pow(2, 16) + this[++offset] * Math.pow(2, 8) + this[++offset];
13981
+ var lo = this[++offset] * Math.pow(2, 24) + this[++offset] * Math.pow(2, 16) + this[++offset] * Math.pow(2, 8) + last;
13982
+ return (BigInt(hi) << BigInt(32)) + BigInt(lo);
13983
+ });
13984
+ Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
13985
+ offset = offset >>> 0;
13986
+ byteLength = byteLength >>> 0;
13987
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
13988
+ var val = this[offset];
13989
+ var mul = 1;
13990
+ var i = 0;
13991
+ while (++i < byteLength && (mul *= 0x100)) {
13992
+ val += this[offset + i] * mul;
13993
+ }
13994
+ mul *= 0x80;
13995
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength);
13996
+ return val;
13997
+ };
13998
+ Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
13999
+ offset = offset >>> 0;
14000
+ byteLength = byteLength >>> 0;
14001
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
14002
+ var i = byteLength;
14003
+ var mul = 1;
14004
+ var val = this[offset + --i];
14005
+ while (i > 0 && (mul *= 0x100)) {
14006
+ val += this[offset + --i] * mul;
14007
+ }
14008
+ mul *= 0x80;
14009
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength);
14010
+ return val;
14011
+ };
14012
+ Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
14013
+ offset = offset >>> 0;
14014
+ if (!noAssert) checkOffset(offset, 1, this.length);
14015
+ if (!(this[offset] & 0x80)) return this[offset];
14016
+ return (0xff - this[offset] + 1) * -1;
14017
+ };
14018
+ Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
14019
+ offset = offset >>> 0;
14020
+ if (!noAssert) checkOffset(offset, 2, this.length);
14021
+ var val = this[offset] | this[offset + 1] << 8;
14022
+ return val & 0x8000 ? val | 0xFFFF0000 : val;
14023
+ };
14024
+ Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
14025
+ offset = offset >>> 0;
14026
+ if (!noAssert) checkOffset(offset, 2, this.length);
14027
+ var val = this[offset + 1] | this[offset] << 8;
14028
+ return val & 0x8000 ? val | 0xFFFF0000 : val;
14029
+ };
14030
+ Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
14031
+ offset = offset >>> 0;
14032
+ if (!noAssert) checkOffset(offset, 4, this.length);
14033
+ return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
14034
+ };
14035
+ Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
14036
+ offset = offset >>> 0;
14037
+ if (!noAssert) checkOffset(offset, 4, this.length);
14038
+ return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
14039
+ };
14040
+ Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {
14041
+ offset = offset >>> 0;
14042
+ validateNumber(offset, 'offset');
14043
+ var first = this[offset];
14044
+ var last = this[offset + 7];
14045
+ if (first === undefined || last === undefined) {
14046
+ boundsError(offset, this.length - 8);
14047
+ }
14048
+ var val = this[offset + 4] + this[offset + 5] * Math.pow(2, 8) + this[offset + 6] * Math.pow(2, 16) + (last << 24); // Overflow
14049
+
14050
+ return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * Math.pow(2, 8) + this[++offset] * Math.pow(2, 16) + this[++offset] * Math.pow(2, 24));
14051
+ });
14052
+ Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {
14053
+ offset = offset >>> 0;
14054
+ validateNumber(offset, 'offset');
14055
+ var first = this[offset];
14056
+ var last = this[offset + 7];
14057
+ if (first === undefined || last === undefined) {
14058
+ boundsError(offset, this.length - 8);
14059
+ }
14060
+ var val = (first << 24) +
14061
+ // Overflow
14062
+ this[++offset] * Math.pow(2, 16) + this[++offset] * Math.pow(2, 8) + this[++offset];
14063
+ return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * Math.pow(2, 24) + this[++offset] * Math.pow(2, 16) + this[++offset] * Math.pow(2, 8) + last);
14064
+ });
14065
+ Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
14066
+ offset = offset >>> 0;
14067
+ if (!noAssert) checkOffset(offset, 4, this.length);
14068
+ return ieee754.read(this, offset, true, 23, 4);
14069
+ };
14070
+ Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
14071
+ offset = offset >>> 0;
14072
+ if (!noAssert) checkOffset(offset, 4, this.length);
14073
+ return ieee754.read(this, offset, false, 23, 4);
14074
+ };
14075
+ Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
14076
+ offset = offset >>> 0;
14077
+ if (!noAssert) checkOffset(offset, 8, this.length);
14078
+ return ieee754.read(this, offset, true, 52, 8);
14079
+ };
14080
+ Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
14081
+ offset = offset >>> 0;
14082
+ if (!noAssert) checkOffset(offset, 8, this.length);
14083
+ return ieee754.read(this, offset, false, 52, 8);
14084
+ };
14085
+ function checkInt(buf, value, offset, ext, max, min) {
14086
+ if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
14087
+ if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
14088
+ if (offset + ext > buf.length) throw new RangeError('Index out of range');
14089
+ }
14090
+ Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
14091
+ value = +value;
14092
+ offset = offset >>> 0;
14093
+ byteLength = byteLength >>> 0;
14094
+ if (!noAssert) {
14095
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1;
14096
+ checkInt(this, value, offset, byteLength, maxBytes, 0);
14097
+ }
14098
+ var mul = 1;
14099
+ var i = 0;
14100
+ this[offset] = value & 0xFF;
14101
+ while (++i < byteLength && (mul *= 0x100)) {
14102
+ this[offset + i] = value / mul & 0xFF;
14103
+ }
14104
+ return offset + byteLength;
14105
+ };
14106
+ Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
14107
+ value = +value;
14108
+ offset = offset >>> 0;
14109
+ byteLength = byteLength >>> 0;
14110
+ if (!noAssert) {
14111
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1;
14112
+ checkInt(this, value, offset, byteLength, maxBytes, 0);
14113
+ }
14114
+ var i = byteLength - 1;
14115
+ var mul = 1;
14116
+ this[offset + i] = value & 0xFF;
14117
+ while (--i >= 0 && (mul *= 0x100)) {
14118
+ this[offset + i] = value / mul & 0xFF;
14119
+ }
14120
+ return offset + byteLength;
14121
+ };
14122
+ Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
14123
+ value = +value;
14124
+ offset = offset >>> 0;
14125
+ if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
14126
+ this[offset] = value & 0xff;
14127
+ return offset + 1;
14128
+ };
14129
+ Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
14130
+ value = +value;
14131
+ offset = offset >>> 0;
14132
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
14133
+ this[offset] = value & 0xff;
14134
+ this[offset + 1] = value >>> 8;
14135
+ return offset + 2;
14136
+ };
14137
+ Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
14138
+ value = +value;
14139
+ offset = offset >>> 0;
14140
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
14141
+ this[offset] = value >>> 8;
14142
+ this[offset + 1] = value & 0xff;
14143
+ return offset + 2;
14144
+ };
14145
+ Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
14146
+ value = +value;
14147
+ offset = offset >>> 0;
14148
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
14149
+ this[offset + 3] = value >>> 24;
14150
+ this[offset + 2] = value >>> 16;
14151
+ this[offset + 1] = value >>> 8;
14152
+ this[offset] = value & 0xff;
14153
+ return offset + 4;
14154
+ };
14155
+ Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
14156
+ value = +value;
14157
+ offset = offset >>> 0;
14158
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
14159
+ this[offset] = value >>> 24;
14160
+ this[offset + 1] = value >>> 16;
14161
+ this[offset + 2] = value >>> 8;
14162
+ this[offset + 3] = value & 0xff;
14163
+ return offset + 4;
14164
+ };
14165
+ function wrtBigUInt64LE(buf, value, offset, min, max) {
14166
+ checkIntBI(value, min, max, buf, offset, 7);
14167
+ var lo = Number(value & BigInt(0xffffffff));
14168
+ buf[offset++] = lo;
14169
+ lo = lo >> 8;
14170
+ buf[offset++] = lo;
14171
+ lo = lo >> 8;
14172
+ buf[offset++] = lo;
14173
+ lo = lo >> 8;
14174
+ buf[offset++] = lo;
14175
+ var hi = Number(value >> BigInt(32) & BigInt(0xffffffff));
14176
+ buf[offset++] = hi;
14177
+ hi = hi >> 8;
14178
+ buf[offset++] = hi;
14179
+ hi = hi >> 8;
14180
+ buf[offset++] = hi;
14181
+ hi = hi >> 8;
14182
+ buf[offset++] = hi;
14183
+ return offset;
14184
+ }
14185
+ function wrtBigUInt64BE(buf, value, offset, min, max) {
14186
+ checkIntBI(value, min, max, buf, offset, 7);
14187
+ var lo = Number(value & BigInt(0xffffffff));
14188
+ buf[offset + 7] = lo;
14189
+ lo = lo >> 8;
14190
+ buf[offset + 6] = lo;
14191
+ lo = lo >> 8;
14192
+ buf[offset + 5] = lo;
14193
+ lo = lo >> 8;
14194
+ buf[offset + 4] = lo;
14195
+ var hi = Number(value >> BigInt(32) & BigInt(0xffffffff));
14196
+ buf[offset + 3] = hi;
14197
+ hi = hi >> 8;
14198
+ buf[offset + 2] = hi;
14199
+ hi = hi >> 8;
14200
+ buf[offset + 1] = hi;
14201
+ hi = hi >> 8;
14202
+ buf[offset] = hi;
14203
+ return offset + 8;
14204
+ }
14205
+ Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value) {
14206
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
14207
+ return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'));
14208
+ });
14209
+ Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value) {
14210
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
14211
+ return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'));
14212
+ });
14213
+ Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
14214
+ value = +value;
14215
+ offset = offset >>> 0;
14216
+ if (!noAssert) {
14217
+ var limit = Math.pow(2, 8 * byteLength - 1);
14218
+ checkInt(this, value, offset, byteLength, limit - 1, -limit);
14219
+ }
14220
+ var i = 0;
14221
+ var mul = 1;
14222
+ var sub = 0;
14223
+ this[offset] = value & 0xFF;
14224
+ while (++i < byteLength && (mul *= 0x100)) {
14225
+ if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
14226
+ sub = 1;
14227
+ }
14228
+ this[offset + i] = (value / mul >> 0) - sub & 0xFF;
14229
+ }
14230
+ return offset + byteLength;
14231
+ };
14232
+ Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
14233
+ value = +value;
14234
+ offset = offset >>> 0;
14235
+ if (!noAssert) {
14236
+ var limit = Math.pow(2, 8 * byteLength - 1);
14237
+ checkInt(this, value, offset, byteLength, limit - 1, -limit);
14238
+ }
14239
+ var i = byteLength - 1;
14240
+ var mul = 1;
14241
+ var sub = 0;
14242
+ this[offset + i] = value & 0xFF;
14243
+ while (--i >= 0 && (mul *= 0x100)) {
14244
+ if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
14245
+ sub = 1;
14246
+ }
14247
+ this[offset + i] = (value / mul >> 0) - sub & 0xFF;
14248
+ }
14249
+ return offset + byteLength;
14250
+ };
14251
+ Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
14252
+ value = +value;
14253
+ offset = offset >>> 0;
14254
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
14255
+ if (value < 0) value = 0xff + value + 1;
14256
+ this[offset] = value & 0xff;
14257
+ return offset + 1;
14258
+ };
14259
+ Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
14260
+ value = +value;
14261
+ offset = offset >>> 0;
14262
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
14263
+ this[offset] = value & 0xff;
14264
+ this[offset + 1] = value >>> 8;
14265
+ return offset + 2;
14266
+ };
14267
+ Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
14268
+ value = +value;
14269
+ offset = offset >>> 0;
14270
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
14271
+ this[offset] = value >>> 8;
14272
+ this[offset + 1] = value & 0xff;
14273
+ return offset + 2;
14274
+ };
14275
+ Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
14276
+ value = +value;
14277
+ offset = offset >>> 0;
14278
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
14279
+ this[offset] = value & 0xff;
14280
+ this[offset + 1] = value >>> 8;
14281
+ this[offset + 2] = value >>> 16;
14282
+ this[offset + 3] = value >>> 24;
14283
+ return offset + 4;
14284
+ };
14285
+ Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
14286
+ value = +value;
14287
+ offset = offset >>> 0;
14288
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
14289
+ if (value < 0) value = 0xffffffff + value + 1;
14290
+ this[offset] = value >>> 24;
14291
+ this[offset + 1] = value >>> 16;
14292
+ this[offset + 2] = value >>> 8;
14293
+ this[offset + 3] = value & 0xff;
14294
+ return offset + 4;
14295
+ };
14296
+ Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value) {
14297
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
14298
+ return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'));
14299
+ });
14300
+ Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value) {
14301
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
14302
+ return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'));
14303
+ });
14304
+ function checkIEEE754(buf, value, offset, ext, max, min) {
14305
+ if (offset + ext > buf.length) throw new RangeError('Index out of range');
14306
+ if (offset < 0) throw new RangeError('Index out of range');
14307
+ }
14308
+ function writeFloat(buf, value, offset, littleEndian, noAssert) {
14309
+ value = +value;
14310
+ offset = offset >>> 0;
14311
+ if (!noAssert) {
14312
+ checkIEEE754(buf, value, offset, 4);
14313
+ }
14314
+ ieee754.write(buf, value, offset, littleEndian, 23, 4);
14315
+ return offset + 4;
14316
+ }
14317
+ Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
14318
+ return writeFloat(this, value, offset, true, noAssert);
14319
+ };
14320
+ Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
14321
+ return writeFloat(this, value, offset, false, noAssert);
14322
+ };
14323
+ function writeDouble(buf, value, offset, littleEndian, noAssert) {
14324
+ value = +value;
14325
+ offset = offset >>> 0;
14326
+ if (!noAssert) {
14327
+ checkIEEE754(buf, value, offset, 8);
14328
+ }
14329
+ ieee754.write(buf, value, offset, littleEndian, 52, 8);
14330
+ return offset + 8;
14331
+ }
14332
+ Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
14333
+ return writeDouble(this, value, offset, true, noAssert);
14334
+ };
14335
+ Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
14336
+ return writeDouble(this, value, offset, false, noAssert);
14337
+ };
14338
+
14339
+ // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
14340
+ Buffer.prototype.copy = function copy(target, targetStart, start, end) {
14341
+ if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer');
14342
+ if (!start) start = 0;
14343
+ if (!end && end !== 0) end = this.length;
14344
+ if (targetStart >= target.length) targetStart = target.length;
14345
+ if (!targetStart) targetStart = 0;
14346
+ if (end > 0 && end < start) end = start;
14347
+
14348
+ // Copy 0 bytes; we're done
14349
+ if (end === start) return 0;
14350
+ if (target.length === 0 || this.length === 0) return 0;
14351
+
14352
+ // Fatal error conditions
14353
+ if (targetStart < 0) {
14354
+ throw new RangeError('targetStart out of bounds');
14355
+ }
14356
+ if (start < 0 || start >= this.length) throw new RangeError('Index out of range');
14357
+ if (end < 0) throw new RangeError('sourceEnd out of bounds');
14358
+
14359
+ // Are we oob?
14360
+ if (end > this.length) end = this.length;
14361
+ if (target.length - targetStart < end - start) {
14362
+ end = target.length - targetStart + start;
14363
+ }
14364
+ var len = end - start;
14365
+ if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
14366
+ // Use built-in when available, missing from IE11
14367
+ this.copyWithin(targetStart, start, end);
14368
+ } else {
14369
+ Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart);
14370
+ }
14371
+ return len;
14372
+ };
14373
+
14374
+ // Usage:
14375
+ // buffer.fill(number[, offset[, end]])
14376
+ // buffer.fill(buffer[, offset[, end]])
14377
+ // buffer.fill(string[, offset[, end]][, encoding])
14378
+ Buffer.prototype.fill = function fill(val, start, end, encoding) {
14379
+ // Handle string cases:
14380
+ if (typeof val === 'string') {
14381
+ if (typeof start === 'string') {
14382
+ encoding = start;
14383
+ start = 0;
14384
+ end = this.length;
14385
+ } else if (typeof end === 'string') {
14386
+ encoding = end;
14387
+ end = this.length;
14388
+ }
14389
+ if (encoding !== undefined && typeof encoding !== 'string') {
14390
+ throw new TypeError('encoding must be a string');
14391
+ }
14392
+ if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
14393
+ throw new TypeError('Unknown encoding: ' + encoding);
14394
+ }
14395
+ if (val.length === 1) {
14396
+ var code = val.charCodeAt(0);
14397
+ if (encoding === 'utf8' && code < 128 || encoding === 'latin1') {
14398
+ // Fast path: If `val` fits into a single byte, use that numeric value.
14399
+ val = code;
14400
+ }
14401
+ }
14402
+ } else if (typeof val === 'number') {
14403
+ val = val & 255;
14404
+ } else if (typeof val === 'boolean') {
14405
+ val = Number(val);
14406
+ }
14407
+
14408
+ // Invalid ranges are not set to a default, so can range check early.
14409
+ if (start < 0 || this.length < start || this.length < end) {
14410
+ throw new RangeError('Out of range index');
14411
+ }
14412
+ if (end <= start) {
14413
+ return this;
14414
+ }
14415
+ start = start >>> 0;
14416
+ end = end === undefined ? this.length : end >>> 0;
14417
+ if (!val) val = 0;
14418
+ var i;
14419
+ if (typeof val === 'number') {
14420
+ for (i = start; i < end; ++i) {
14421
+ this[i] = val;
14422
+ }
14423
+ } else {
14424
+ var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding);
14425
+ var len = bytes.length;
14426
+ if (len === 0) {
14427
+ throw new TypeError('The value "' + val + '" is invalid for argument "value"');
14428
+ }
14429
+ for (i = 0; i < end - start; ++i) {
14430
+ this[i + start] = bytes[i % len];
14431
+ }
14432
+ }
14433
+ return this;
14434
+ };
14435
+
14436
+ // CUSTOM ERRORS
14437
+ // =============
14438
+
14439
+ // Simplified versions from Node, changed for Buffer-only usage
14440
+ var errors = {};
14441
+ function E(sym, getMessage, Base) {
14442
+ errors[sym] = /*#__PURE__*/function (_Base) {
14443
+ _inherits(NodeError, _Base);
14444
+ var _super = _createSuper(NodeError);
14445
+ function NodeError() {
14446
+ var _this;
14447
+ _classCallCheck(this, NodeError);
14448
+ _this = _super.call(this);
14449
+ Object.defineProperty(_assertThisInitialized(_this), 'message', {
14450
+ value: getMessage.apply(_assertThisInitialized(_this), arguments),
14451
+ writable: true,
14452
+ configurable: true
14453
+ });
14454
+
14455
+ // Add the error code to the name to include it in the stack trace.
14456
+ _this.name = "".concat(_this.name, " [").concat(sym, "]");
14457
+ // Access the stack to generate the error message including the error code
14458
+ // from the name.
14459
+ _this.stack; // eslint-disable-line no-unused-expressions
14460
+ // Reset the name to the actual name.
14461
+ delete _this.name;
14462
+ return _this;
14463
+ }
14464
+ _createClass(NodeError, [{
14465
+ key: "code",
14466
+ get: function get() {
14467
+ return sym;
14468
+ },
14469
+ set: function set(value) {
14470
+ Object.defineProperty(this, 'code', {
14471
+ configurable: true,
14472
+ enumerable: true,
14473
+ value: value,
14474
+ writable: true
14475
+ });
14476
+ }
14477
+ }, {
14478
+ key: "toString",
14479
+ value: function toString() {
14480
+ return "".concat(this.name, " [").concat(sym, "]: ").concat(this.message);
14481
+ }
14482
+ }]);
14483
+ return NodeError;
14484
+ }(Base);
14485
+ }
14486
+ E('ERR_BUFFER_OUT_OF_BOUNDS', function (name) {
14487
+ if (name) {
14488
+ return "".concat(name, " is outside of buffer bounds");
14489
+ }
14490
+ return 'Attempt to access memory outside buffer bounds';
14491
+ }, RangeError);
14492
+ E('ERR_INVALID_ARG_TYPE', function (name, actual) {
14493
+ return "The \"".concat(name, "\" argument must be of type number. Received type ").concat(_typeof(actual));
14494
+ }, TypeError);
14495
+ E('ERR_OUT_OF_RANGE', function (str, range, input) {
14496
+ var msg = "The value of \"".concat(str, "\" is out of range.");
14497
+ var received = input;
14498
+ if (Number.isInteger(input) && Math.abs(input) > Math.pow(2, 32)) {
14499
+ received = addNumericalSeparator(String(input));
14500
+ } else if (typeof input === 'bigint') {
14501
+ received = String(input);
14502
+ if (input > Math.pow(BigInt(2), BigInt(32)) || input < -Math.pow(BigInt(2), BigInt(32))) {
14503
+ received = addNumericalSeparator(received);
14504
+ }
14505
+ received += 'n';
14506
+ }
14507
+ msg += " It must be ".concat(range, ". Received ").concat(received);
14508
+ return msg;
14509
+ }, RangeError);
14510
+ function addNumericalSeparator(val) {
14511
+ var res = '';
14512
+ var i = val.length;
14513
+ var start = val[0] === '-' ? 1 : 0;
14514
+ for (; i >= start + 4; i -= 3) {
14515
+ res = "_".concat(val.slice(i - 3, i)).concat(res);
14516
+ }
14517
+ return "".concat(val.slice(0, i)).concat(res);
14518
+ }
14519
+
14520
+ // CHECK FUNCTIONS
14521
+ // ===============
14522
+
14523
+ function checkBounds(buf, offset, byteLength) {
14524
+ validateNumber(offset, 'offset');
14525
+ if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {
14526
+ boundsError(offset, buf.length - (byteLength + 1));
14527
+ }
14528
+ }
14529
+ function checkIntBI(value, min, max, buf, offset, byteLength) {
14530
+ if (value > max || value < min) {
14531
+ var n = typeof min === 'bigint' ? 'n' : '';
14532
+ var range;
14533
+ if (byteLength > 3) {
14534
+ if (min === 0 || min === BigInt(0)) {
14535
+ range = ">= 0".concat(n, " and < 2").concat(n, " ** ").concat((byteLength + 1) * 8).concat(n);
14536
+ } else {
14537
+ range = ">= -(2".concat(n, " ** ").concat((byteLength + 1) * 8 - 1).concat(n, ") and < 2 ** ") + "".concat((byteLength + 1) * 8 - 1).concat(n);
14538
+ }
14539
+ } else {
14540
+ range = ">= ".concat(min).concat(n, " and <= ").concat(max).concat(n);
14541
+ }
14542
+ throw new errors.ERR_OUT_OF_RANGE('value', range, value);
14543
+ }
14544
+ checkBounds(buf, offset, byteLength);
14545
+ }
14546
+ function validateNumber(value, name) {
14547
+ if (typeof value !== 'number') {
14548
+ throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value);
14549
+ }
14550
+ }
14551
+ function boundsError(value, length, type) {
14552
+ if (Math.floor(value) !== value) {
14553
+ validateNumber(value, type);
14554
+ throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value);
14555
+ }
14556
+ if (length < 0) {
14557
+ throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();
14558
+ }
14559
+ throw new errors.ERR_OUT_OF_RANGE(type || 'offset', ">= ".concat(type ? 1 : 0, " and <= ").concat(length), value);
14560
+ }
14561
+
14562
+ // HELPER FUNCTIONS
14563
+ // ================
14564
+
14565
+ var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;
14566
+ function base64clean(str) {
14567
+ // Node takes equal signs as end of the Base64 encoding
14568
+ str = str.split('=')[0];
14569
+ // Node strips out invalid characters like \n and \t from the string, base64-js does not
14570
+ str = str.trim().replace(INVALID_BASE64_RE, '');
14571
+ // Node converts strings with length < 2 to ''
14572
+ if (str.length < 2) return '';
14573
+ // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
14574
+ while (str.length % 4 !== 0) {
14575
+ str = str + '=';
14576
+ }
14577
+ return str;
14578
+ }
14579
+ function utf8ToBytes(string, units) {
14580
+ units = units || Infinity;
14581
+ var codePoint;
14582
+ var length = string.length;
14583
+ var leadSurrogate = null;
14584
+ var bytes = [];
14585
+ for (var i = 0; i < length; ++i) {
14586
+ codePoint = string.charCodeAt(i);
14587
+
14588
+ // is surrogate component
14589
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
14590
+ // last char was a lead
14591
+ if (!leadSurrogate) {
14592
+ // no lead yet
14593
+ if (codePoint > 0xDBFF) {
14594
+ // unexpected trail
14595
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
14596
+ continue;
14597
+ } else if (i + 1 === length) {
14598
+ // unpaired lead
14599
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
14600
+ continue;
14601
+ }
14602
+
14603
+ // valid lead
14604
+ leadSurrogate = codePoint;
14605
+ continue;
14606
+ }
14607
+
14608
+ // 2 leads in a row
14609
+ if (codePoint < 0xDC00) {
14610
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
14611
+ leadSurrogate = codePoint;
14612
+ continue;
14613
+ }
14614
+
14615
+ // valid surrogate pair
14616
+ codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
14617
+ } else if (leadSurrogate) {
14618
+ // valid bmp char, but last char was a lead
14619
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
14620
+ }
14621
+ leadSurrogate = null;
14622
+
14623
+ // encode utf8
14624
+ if (codePoint < 0x80) {
14625
+ if ((units -= 1) < 0) break;
14626
+ bytes.push(codePoint);
14627
+ } else if (codePoint < 0x800) {
14628
+ if ((units -= 2) < 0) break;
14629
+ bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);
14630
+ } else if (codePoint < 0x10000) {
14631
+ if ((units -= 3) < 0) break;
14632
+ bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
14633
+ } else if (codePoint < 0x110000) {
14634
+ if ((units -= 4) < 0) break;
14635
+ bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
14636
+ } else {
14637
+ throw new Error('Invalid code point');
14638
+ }
14639
+ }
14640
+ return bytes;
14641
+ }
14642
+ function asciiToBytes(str) {
14643
+ var byteArray = [];
14644
+ for (var i = 0; i < str.length; ++i) {
14645
+ // Node's code seems to be doing this and not & 0x7F..
14646
+ byteArray.push(str.charCodeAt(i) & 0xFF);
14647
+ }
14648
+ return byteArray;
14649
+ }
14650
+ function utf16leToBytes(str, units) {
14651
+ var c, hi, lo;
14652
+ var byteArray = [];
14653
+ for (var i = 0; i < str.length; ++i) {
14654
+ if ((units -= 2) < 0) break;
14655
+ c = str.charCodeAt(i);
14656
+ hi = c >> 8;
14657
+ lo = c % 256;
14658
+ byteArray.push(lo);
14659
+ byteArray.push(hi);
14660
+ }
14661
+ return byteArray;
14662
+ }
14663
+ function base64ToBytes(str) {
14664
+ return base64Js.toByteArray(base64clean(str));
14665
+ }
14666
+ function blitBuffer(src, dst, offset, length) {
14667
+ var i;
14668
+ for (i = 0; i < length; ++i) {
14669
+ if (i + offset >= dst.length || i >= src.length) break;
14670
+ dst[i + offset] = src[i];
14671
+ }
14672
+ return i;
14673
+ }
14674
+
14675
+ // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
14676
+ // the `instanceof` check but they should be treated as of that type.
14677
+ // See: https://github.com/feross/buffer/issues/166
14678
+ function isInstance(obj, type) {
14679
+ return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;
14680
+ }
14681
+ function numberIsNaN(obj) {
14682
+ // For IE11 support
14683
+ return obj !== obj; // eslint-disable-line no-self-compare
14684
+ }
14685
+
14686
+ // Create lookup table for `toString('hex')`
14687
+ // See: https://github.com/feross/buffer/issues/219
14688
+ var hexSliceLookupTable = function () {
14689
+ var alphabet = '0123456789abcdef';
14690
+ var table = new Array(256);
14691
+ for (var i = 0; i < 16; ++i) {
14692
+ var i16 = i * 16;
14693
+ for (var j = 0; j < 16; ++j) {
14694
+ table[i16 + j] = alphabet[i] + alphabet[j];
14695
+ }
14696
+ }
14697
+ return table;
14698
+ }();
14699
+
14700
+ // Return not function with Error if BigInt not supported
14701
+ function defineBigIntMethod(fn) {
14702
+ return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn;
14703
+ }
14704
+ function BufferBigIntNotDefined() {
14705
+ throw new Error('BigInt not supported');
14706
+ }
14707
+ });
14708
+
12763
14709
  /**
12764
14710
  * return an decoded URL Safe Base64 as UTF-8 encoded string
12765
14711
  */