@aws-amplify/geo 1.3.19-unstable.7 → 1.3.19

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.
@@ -253,12 +253,8 @@ __webpack_require__.r(__webpack_exports__);
253
253
  /* harmony import */ var _whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./whatwgEncodingApi */ "../../node_modules/@aws-crypto/util/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js");
254
254
 
255
255
 
256
- var fromUtf8 = function (input) {
257
- return typeof TextEncoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["fromUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["fromUtf8"])(input);
258
- };
259
- var toUtf8 = function (input) {
260
- return typeof TextDecoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["toUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["toUtf8"])(input);
261
- };
256
+ const fromUtf8 = (input) => typeof TextEncoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["fromUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["fromUtf8"])(input);
257
+ const toUtf8 = (input) => typeof TextDecoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["toUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["toUtf8"])(input);
262
258
 
263
259
 
264
260
  /***/ }),
@@ -274,44 +270,44 @@ var toUtf8 = function (input) {
274
270
  __webpack_require__.r(__webpack_exports__);
275
271
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromUtf8", function() { return fromUtf8; });
276
272
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUtf8", function() { return toUtf8; });
277
- var fromUtf8 = function (input) {
278
- var bytes = [];
279
- for (var i = 0, len = input.length; i < len; i++) {
280
- var value = input.charCodeAt(i);
273
+ const fromUtf8 = (input) => {
274
+ const bytes = [];
275
+ for (let i = 0, len = input.length; i < len; i++) {
276
+ const value = input.charCodeAt(i);
281
277
  if (value < 0x80) {
282
278
  bytes.push(value);
283
279
  }
284
280
  else if (value < 0x800) {
285
- bytes.push((value >> 6) | 192, (value & 63) | 128);
281
+ bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000);
286
282
  }
287
283
  else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
288
- var surrogatePair = 0x10000 + ((value & 1023) << 10) + (input.charCodeAt(++i) & 1023);
289
- bytes.push((surrogatePair >> 18) | 240, ((surrogatePair >> 12) & 63) | 128, ((surrogatePair >> 6) & 63) | 128, (surrogatePair & 63) | 128);
284
+ const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111);
285
+ bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000);
290
286
  }
291
287
  else {
292
- bytes.push((value >> 12) | 224, ((value >> 6) & 63) | 128, (value & 63) | 128);
288
+ bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000);
293
289
  }
294
290
  }
295
291
  return Uint8Array.from(bytes);
296
292
  };
297
- var toUtf8 = function (input) {
298
- var decoded = "";
299
- for (var i = 0, len = input.length; i < len; i++) {
300
- var byte = input[i];
293
+ const toUtf8 = (input) => {
294
+ let decoded = "";
295
+ for (let i = 0, len = input.length; i < len; i++) {
296
+ const byte = input[i];
301
297
  if (byte < 0x80) {
302
298
  decoded += String.fromCharCode(byte);
303
299
  }
304
- else if (192 <= byte && byte < 224) {
305
- var nextByte = input[++i];
306
- decoded += String.fromCharCode(((byte & 31) << 6) | (nextByte & 63));
300
+ else if (0b11000000 <= byte && byte < 0b11100000) {
301
+ const nextByte = input[++i];
302
+ decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111));
307
303
  }
308
- else if (240 <= byte && byte < 365) {
309
- var surrogatePair = [byte, input[++i], input[++i], input[++i]];
310
- var encoded = "%" + surrogatePair.map(function (byteValue) { return byteValue.toString(16); }).join("%");
304
+ else if (0b11110000 <= byte && byte < 0b101101101) {
305
+ const surrogatePair = [byte, input[++i], input[++i], input[++i]];
306
+ const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%");
311
307
  decoded += decodeURIComponent(encoded);
312
308
  }
313
309
  else {
314
- decoded += String.fromCharCode(((byte & 15) << 12) | ((input[++i] & 63) << 6) | (input[++i] & 63));
310
+ decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111));
315
311
  }
316
312
  }
317
313
  return decoded;
@@ -14366,7 +14362,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
14366
14362
  exports.Sha256 = void 0;
14367
14363
  var isEmptyData_1 = __webpack_require__(/*! ./isEmptyData */ "../../node_modules/@aws-sdk/client-location/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.js");
14368
14364
  var constants_1 = __webpack_require__(/*! ./constants */ "../../node_modules/@aws-sdk/client-location/node_modules/@aws-crypto/sha256-browser/build/constants.js");
14369
- var util_utf8_browser_1 = __webpack_require__(/*! @aws-sdk/util-utf8-browser */ "../../node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js");
14365
+ var util_utf8_browser_1 = __webpack_require__(/*! @aws-sdk/util-utf8-browser */ "../../node_modules/@aws-sdk/client-location/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js");
14370
14366
  var util_locate_window_1 = __webpack_require__(/*! @aws-sdk/util-locate-window */ "../../node_modules/@aws-sdk/util-locate-window/dist-es/index.js");
14371
14367
  var Sha256 = /** @class */ (function () {
14372
14368
  function Sha256(secret) {
@@ -14893,6 +14889,105 @@ function bufferFromSecret(secret) {
14893
14889
  }
14894
14890
  //# sourceMappingURL=jsSha256.js.map
14895
14891
 
14892
+ /***/ }),
14893
+
14894
+ /***/ "../../node_modules/@aws-sdk/client-location/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js":
14895
+ /*!***************************************************************************************************************************************************************!*\
14896
+ !*** /root/amplify-js/node_modules/@aws-sdk/client-location/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js ***!
14897
+ \***************************************************************************************************************************************************************/
14898
+ /*! exports provided: fromUtf8, toUtf8 */
14899
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
14900
+
14901
+ "use strict";
14902
+ __webpack_require__.r(__webpack_exports__);
14903
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromUtf8", function() { return fromUtf8; });
14904
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUtf8", function() { return toUtf8; });
14905
+ /* harmony import */ var _pureJs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pureJs */ "../../node_modules/@aws-sdk/client-location/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js");
14906
+ /* harmony import */ var _whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./whatwgEncodingApi */ "../../node_modules/@aws-sdk/client-location/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js");
14907
+
14908
+
14909
+ const fromUtf8 = (input) => typeof TextEncoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["fromUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["fromUtf8"])(input);
14910
+ const toUtf8 = (input) => typeof TextDecoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["toUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["toUtf8"])(input);
14911
+
14912
+
14913
+ /***/ }),
14914
+
14915
+ /***/ "../../node_modules/@aws-sdk/client-location/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js":
14916
+ /*!****************************************************************************************************************************************************************!*\
14917
+ !*** /root/amplify-js/node_modules/@aws-sdk/client-location/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js ***!
14918
+ \****************************************************************************************************************************************************************/
14919
+ /*! exports provided: fromUtf8, toUtf8 */
14920
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
14921
+
14922
+ "use strict";
14923
+ __webpack_require__.r(__webpack_exports__);
14924
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromUtf8", function() { return fromUtf8; });
14925
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUtf8", function() { return toUtf8; });
14926
+ const fromUtf8 = (input) => {
14927
+ const bytes = [];
14928
+ for (let i = 0, len = input.length; i < len; i++) {
14929
+ const value = input.charCodeAt(i);
14930
+ if (value < 0x80) {
14931
+ bytes.push(value);
14932
+ }
14933
+ else if (value < 0x800) {
14934
+ bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000);
14935
+ }
14936
+ else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
14937
+ const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111);
14938
+ bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000);
14939
+ }
14940
+ else {
14941
+ bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000);
14942
+ }
14943
+ }
14944
+ return Uint8Array.from(bytes);
14945
+ };
14946
+ const toUtf8 = (input) => {
14947
+ let decoded = "";
14948
+ for (let i = 0, len = input.length; i < len; i++) {
14949
+ const byte = input[i];
14950
+ if (byte < 0x80) {
14951
+ decoded += String.fromCharCode(byte);
14952
+ }
14953
+ else if (0b11000000 <= byte && byte < 0b11100000) {
14954
+ const nextByte = input[++i];
14955
+ decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111));
14956
+ }
14957
+ else if (0b11110000 <= byte && byte < 0b101101101) {
14958
+ const surrogatePair = [byte, input[++i], input[++i], input[++i]];
14959
+ const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%");
14960
+ decoded += decodeURIComponent(encoded);
14961
+ }
14962
+ else {
14963
+ decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111));
14964
+ }
14965
+ }
14966
+ return decoded;
14967
+ };
14968
+
14969
+
14970
+ /***/ }),
14971
+
14972
+ /***/ "../../node_modules/@aws-sdk/client-location/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js":
14973
+ /*!***************************************************************************************************************************************************************************!*\
14974
+ !*** /root/amplify-js/node_modules/@aws-sdk/client-location/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js ***!
14975
+ \***************************************************************************************************************************************************************************/
14976
+ /*! exports provided: fromUtf8, toUtf8 */
14977
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
14978
+
14979
+ "use strict";
14980
+ __webpack_require__.r(__webpack_exports__);
14981
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromUtf8", function() { return fromUtf8; });
14982
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUtf8", function() { return toUtf8; });
14983
+ function fromUtf8(input) {
14984
+ return new TextEncoder().encode(input);
14985
+ }
14986
+ function toUtf8(input) {
14987
+ return new TextDecoder("utf-8").decode(input);
14988
+ }
14989
+
14990
+
14896
14991
  /***/ }),
14897
14992
 
14898
14993
  /***/ "../../node_modules/@aws-sdk/client-location/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.js":
@@ -23695,7 +23790,7 @@ function __classPrivateFieldIn(state, receiver) {
23695
23790
  "use strict";
23696
23791
  __webpack_require__.r(__webpack_exports__);
23697
23792
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "locateWindow", function() { return locateWindow; });
23698
- var fallbackWindow = {};
23793
+ const fallbackWindow = {};
23699
23794
  function locateWindow() {
23700
23795
  if (typeof window !== "undefined") {
23701
23796
  return window;
@@ -27493,7 +27588,6 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
27493
27588
  resolve(value);
27494
27589
  });
27495
27590
  }
27496
-
27497
27591
  return new (P || (P = Promise))(function (resolve, reject) {
27498
27592
  function fulfilled(value) {
27499
27593
  try {
@@ -27502,7 +27596,6 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
27502
27596
  reject(e);
27503
27597
  }
27504
27598
  }
27505
-
27506
27599
  function rejected(value) {
27507
27600
  try {
27508
27601
  step(generator["throw"](value));
@@ -27510,29 +27603,26 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
27510
27603
  reject(e);
27511
27604
  }
27512
27605
  }
27513
-
27514
27606
  function step(result) {
27515
27607
  result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
27516
27608
  }
27517
-
27518
27609
  step((generator = generator.apply(thisArg, _arguments || [])).next());
27519
27610
  });
27520
27611
  };
27521
-
27522
27612
  var __generator = undefined && undefined.__generator || function (thisArg, body) {
27523
27613
  var _ = {
27524
- label: 0,
27525
- sent: function sent() {
27526
- if (t[0] & 1) throw t[1];
27527
- return t[1];
27614
+ label: 0,
27615
+ sent: function sent() {
27616
+ if (t[0] & 1) throw t[1];
27617
+ return t[1];
27618
+ },
27619
+ trys: [],
27620
+ ops: []
27528
27621
  },
27529
- trys: [],
27530
- ops: []
27531
- },
27532
- f,
27533
- y,
27534
- t,
27535
- g;
27622
+ f,
27623
+ y,
27624
+ t,
27625
+ g;
27536
27626
  return g = {
27537
27627
  next: verb(0),
27538
27628
  "throw": verb(1),
@@ -27540,79 +27630,60 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
27540
27630
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
27541
27631
  return this;
27542
27632
  }), g;
27543
-
27544
27633
  function verb(n) {
27545
27634
  return function (v) {
27546
27635
  return step([n, v]);
27547
27636
  };
27548
27637
  }
27549
-
27550
27638
  function step(op) {
27551
27639
  if (f) throw new TypeError("Generator is already executing.");
27552
-
27553
27640
  while (_) {
27554
27641
  try {
27555
27642
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
27556
27643
  if (y = 0, t) op = [op[0] & 2, t.value];
27557
-
27558
27644
  switch (op[0]) {
27559
27645
  case 0:
27560
27646
  case 1:
27561
27647
  t = op;
27562
27648
  break;
27563
-
27564
27649
  case 4:
27565
27650
  _.label++;
27566
27651
  return {
27567
27652
  value: op[1],
27568
27653
  done: false
27569
27654
  };
27570
-
27571
27655
  case 5:
27572
27656
  _.label++;
27573
27657
  y = op[1];
27574
27658
  op = [0];
27575
27659
  continue;
27576
-
27577
27660
  case 7:
27578
27661
  op = _.ops.pop();
27579
-
27580
27662
  _.trys.pop();
27581
-
27582
27663
  continue;
27583
-
27584
27664
  default:
27585
27665
  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
27586
27666
  _ = 0;
27587
27667
  continue;
27588
27668
  }
27589
-
27590
27669
  if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
27591
27670
  _.label = op[1];
27592
27671
  break;
27593
27672
  }
27594
-
27595
27673
  if (op[0] === 6 && _.label < t[1]) {
27596
27674
  _.label = t[1];
27597
27675
  t = op;
27598
27676
  break;
27599
27677
  }
27600
-
27601
27678
  if (t && _.label < t[2]) {
27602
27679
  _.label = t[2];
27603
-
27604
27680
  _.ops.push(op);
27605
-
27606
27681
  break;
27607
27682
  }
27608
-
27609
27683
  if (t[2]) _.ops.pop();
27610
-
27611
27684
  _.trys.pop();
27612
-
27613
27685
  continue;
27614
27686
  }
27615
-
27616
27687
  op = body.call(thisArg, _);
27617
27688
  } catch (e) {
27618
27689
  op = [6, e];
@@ -27621,7 +27692,6 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
27621
27692
  f = t = 0;
27622
27693
  }
27623
27694
  }
27624
-
27625
27695
  if (op[0] & 5) throw op[1];
27626
27696
  return {
27627
27697
  value: op[0] ? op[1] : void 0,
@@ -27629,15 +27699,13 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
27629
27699
  };
27630
27700
  }
27631
27701
  };
27632
-
27633
27702
  var __read = undefined && undefined.__read || function (o, n) {
27634
27703
  var m = typeof Symbol === "function" && o[Symbol.iterator];
27635
27704
  if (!m) return o;
27636
27705
  var i = m.call(o),
27637
- r,
27638
- ar = [],
27639
- e;
27640
-
27706
+ r,
27707
+ ar = [],
27708
+ e;
27641
27709
  try {
27642
27710
  while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
27643
27711
  ar.push(r.value);
@@ -27653,7 +27721,6 @@ var __read = undefined && undefined.__read || function (o, n) {
27653
27721
  if (e) throw e.error;
27654
27722
  }
27655
27723
  }
27656
-
27657
27724
  return ar;
27658
27725
  };
27659
27726
  /*
@@ -27671,14 +27738,9 @@ var __read = undefined && undefined.__read || function (o, n) {
27671
27738
 
27672
27739
 
27673
27740
 
27674
-
27675
-
27676
27741
  var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Geo');
27677
27742
  var DEFAULT_PROVIDER = 'AmazonLocationService';
27678
-
27679
- var GeoClass =
27680
- /** @class */
27681
- function () {
27743
+ var GeoClass = /** @class */function () {
27682
27744
  function GeoClass() {
27683
27745
  this._config = {};
27684
27746
  this._pluggables = [];
@@ -27688,8 +27750,6 @@ function () {
27688
27750
  * get the name of the module category
27689
27751
  * @returns {string} name of the module category
27690
27752
  */
27691
-
27692
-
27693
27753
  GeoClass.prototype.getModuleName = function () {
27694
27754
  return GeoClass.MODULE;
27695
27755
  };
@@ -27697,12 +27757,9 @@ function () {
27697
27757
  * add plugin into Geo category
27698
27758
  * @param {Object} pluggable - an instance of the plugin
27699
27759
  */
27700
-
27701
-
27702
27760
  GeoClass.prototype.addPluggable = function (pluggable) {
27703
27761
  if (pluggable && pluggable.getCategory() === 'Geo') {
27704
27762
  this._pluggables.push(pluggable);
27705
-
27706
27763
  var config = pluggable.configure(this._config[pluggable.getProviderName()]);
27707
27764
  return config;
27708
27765
  }
@@ -27711,13 +27768,10 @@ function () {
27711
27768
  * Get the plugin object
27712
27769
  * @param providerName - the name of the plugin
27713
27770
  */
27714
-
27715
-
27716
27771
  GeoClass.prototype.getPluggable = function (providerName) {
27717
27772
  var pluggable = this._pluggables.find(function (pluggable) {
27718
27773
  return pluggable.getProviderName() === providerName;
27719
27774
  });
27720
-
27721
27775
  if (pluggable === undefined) {
27722
27776
  logger.debug('No plugin found with providerName', providerName);
27723
27777
  throw new Error('No plugin found in Geo for the provider');
@@ -27727,8 +27781,6 @@ function () {
27727
27781
  * Remove the plugin object
27728
27782
  * @param providerName - the name of the plugin
27729
27783
  */
27730
-
27731
-
27732
27784
  GeoClass.prototype.removePluggable = function (providerName) {
27733
27785
  this._pluggables = this._pluggables.filter(function (pluggable) {
27734
27786
  return pluggable.getProviderName() !== providerName;
@@ -27740,24 +27792,18 @@ function () {
27740
27792
  * @param {Object} config - Configuration object for Geo
27741
27793
  * @return {Object} - Current configuration
27742
27794
  */
27743
-
27744
-
27745
27795
  GeoClass.prototype.configure = function (config) {
27746
27796
  var _this = this;
27747
-
27748
27797
  logger.debug('configure Geo');
27749
27798
  if (!config) return this._config;
27750
27799
  var amplifyConfig = Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["parseMobileHubConfig"])(config);
27751
27800
  this._config = Object.assign({}, this._config, amplifyConfig.Geo, config);
27752
-
27753
27801
  this._pluggables.forEach(function (pluggable) {
27754
27802
  pluggable.configure(_this._config[pluggable.getProviderName()]);
27755
27803
  });
27756
-
27757
27804
  if (this._pluggables.length === 0) {
27758
27805
  this.addPluggable(new _Providers_AmazonLocationServiceProvider__WEBPACK_IMPORTED_MODULE_1__["AmazonLocationServiceProvider"]());
27759
27806
  }
27760
-
27761
27807
  return this._config;
27762
27808
  };
27763
27809
  /**
@@ -27765,13 +27811,10 @@ function () {
27765
27811
  * @param {string} provider
27766
27812
  * @returns - Array of available map resources
27767
27813
  */
27768
-
27769
-
27770
27814
  GeoClass.prototype.getAvailableMaps = function (provider) {
27771
27815
  if (provider === void 0) {
27772
27816
  provider = DEFAULT_PROVIDER;
27773
27817
  }
27774
-
27775
27818
  var prov = this.getPluggable(provider);
27776
27819
  return prov.getAvailableMaps();
27777
27820
  };
@@ -27780,13 +27823,10 @@ function () {
27780
27823
  * @param {string} provider
27781
27824
  * @returns - Map resource set as the default in amplify config
27782
27825
  */
27783
-
27784
-
27785
27826
  GeoClass.prototype.getDefaultMap = function (provider) {
27786
27827
  if (provider === void 0) {
27787
27828
  provider = DEFAULT_PROVIDER;
27788
27829
  }
27789
-
27790
27830
  var prov = this.getPluggable(provider);
27791
27831
  return prov.getDefaultMap();
27792
27832
  };
@@ -27796,40 +27836,26 @@ function () {
27796
27836
  * @param {SearchByTextOptions} options? - Optional parameters to the search
27797
27837
  * @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters
27798
27838
  */
27799
-
27800
-
27801
27839
  GeoClass.prototype.searchByText = function (text, options) {
27802
27840
  return __awaiter(this, void 0, void 0, function () {
27803
27841
  var _a, providerName, prov, error_1;
27804
-
27805
27842
  return __generator(this, function (_b) {
27806
27843
  switch (_b.label) {
27807
27844
  case 0:
27808
27845
  _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
27809
27846
  prov = this.getPluggable(providerName);
27810
27847
  _b.label = 1;
27811
-
27812
27848
  case 1:
27813
27849
  _b.trys.push([1, 3,, 4]);
27814
-
27815
- return [4
27816
- /*yield*/
27817
- , prov.searchByText(text, options)];
27818
-
27850
+ return [4 /*yield*/, prov.searchByText(text, options)];
27819
27851
  case 2:
27820
- return [2
27821
- /*return*/
27822
- , _b.sent()];
27823
-
27852
+ return [2 /*return*/, _b.sent()];
27824
27853
  case 3:
27825
27854
  error_1 = _b.sent();
27826
27855
  logger.debug(error_1);
27827
27856
  throw error_1;
27828
-
27829
27857
  case 4:
27830
- return [2
27831
- /*return*/
27832
- ];
27858
+ return [2 /*return*/];
27833
27859
  }
27834
27860
  });
27835
27861
  });
@@ -27840,40 +27866,26 @@ function () {
27840
27866
  * @param {SearchByTextOptions} options? - Optional parameters to the search
27841
27867
  * @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
27842
27868
  */
27843
-
27844
-
27845
27869
  GeoClass.prototype.searchForSuggestions = function (text, options) {
27846
27870
  return __awaiter(this, void 0, void 0, function () {
27847
27871
  var _a, providerName, prov, error_2;
27848
-
27849
27872
  return __generator(this, function (_b) {
27850
27873
  switch (_b.label) {
27851
27874
  case 0:
27852
27875
  _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
27853
27876
  prov = this.getPluggable(providerName);
27854
27877
  _b.label = 1;
27855
-
27856
27878
  case 1:
27857
27879
  _b.trys.push([1, 3,, 4]);
27858
-
27859
- return [4
27860
- /*yield*/
27861
- , prov.searchForSuggestions(text, options)];
27862
-
27880
+ return [4 /*yield*/, prov.searchForSuggestions(text, options)];
27863
27881
  case 2:
27864
- return [2
27865
- /*return*/
27866
- , _b.sent()];
27867
-
27882
+ return [2 /*return*/, _b.sent()];
27868
27883
  case 3:
27869
27884
  error_2 = _b.sent();
27870
27885
  logger.debug(error_2);
27871
27886
  throw error_2;
27872
-
27873
27887
  case 4:
27874
- return [2
27875
- /*return*/
27876
- ];
27888
+ return [2 /*return*/];
27877
27889
  }
27878
27890
  });
27879
27891
  });
@@ -27884,8 +27896,6 @@ function () {
27884
27896
  * @param {searchByPlaceIdOptions} options? - Optional parameters to the search
27885
27897
  * @returns {Promise<Place>} - Resolves to a place with the given placeId
27886
27898
  */
27887
-
27888
-
27889
27899
  GeoClass.prototype.searchByPlaceId = function (placeId, options) {
27890
27900
  return __awaiter(this, void 0, void 0, function () {
27891
27901
  var providerName, prov, error_3;
@@ -27895,28 +27905,17 @@ function () {
27895
27905
  providerName = DEFAULT_PROVIDER;
27896
27906
  prov = this.getPluggable(providerName);
27897
27907
  _a.label = 1;
27898
-
27899
27908
  case 1:
27900
27909
  _a.trys.push([1, 3,, 4]);
27901
-
27902
- return [4
27903
- /*yield*/
27904
- , prov.searchByPlaceId(placeId, options)];
27905
-
27910
+ return [4 /*yield*/, prov.searchByPlaceId(placeId, options)];
27906
27911
  case 2:
27907
- return [2
27908
- /*return*/
27909
- , _a.sent()];
27910
-
27912
+ return [2 /*return*/, _a.sent()];
27911
27913
  case 3:
27912
27914
  error_3 = _a.sent();
27913
27915
  logger.debug(error_3);
27914
27916
  throw error_3;
27915
-
27916
27917
  case 4:
27917
- return [2
27918
- /*return*/
27919
- ];
27918
+ return [2 /*return*/];
27920
27919
  }
27921
27920
  });
27922
27921
  });
@@ -27927,12 +27926,9 @@ function () {
27927
27926
  * @param options - Options parameters for the search
27928
27927
  * @returns {Promise<Place>} - Promise that resolves to a place matching search coordinates
27929
27928
  */
27930
-
27931
-
27932
27929
  GeoClass.prototype.searchByCoordinates = function (coordinates, options) {
27933
27930
  return __awaiter(this, void 0, void 0, function () {
27934
27931
  var _a, providerName, prov, _b, lng, lat, error_4;
27935
-
27936
27932
  return __generator(this, function (_c) {
27937
27933
  switch (_c.label) {
27938
27934
  case 0:
@@ -27940,29 +27936,18 @@ function () {
27940
27936
  prov = this.getPluggable(providerName);
27941
27937
  _b = __read(coordinates, 2), lng = _b[0], lat = _b[1];
27942
27938
  _c.label = 1;
27943
-
27944
27939
  case 1:
27945
27940
  _c.trys.push([1, 3,, 4]);
27946
-
27947
27941
  Object(_util__WEBPACK_IMPORTED_MODULE_2__["validateCoordinates"])(lng, lat);
27948
- return [4
27949
- /*yield*/
27950
- , prov.searchByCoordinates(coordinates, options)];
27951
-
27942
+ return [4 /*yield*/, prov.searchByCoordinates(coordinates, options)];
27952
27943
  case 2:
27953
- return [2
27954
- /*return*/
27955
- , _c.sent()];
27956
-
27944
+ return [2 /*return*/, _c.sent()];
27957
27945
  case 3:
27958
27946
  error_4 = _c.sent();
27959
27947
  logger.debug(error_4);
27960
27948
  throw error_4;
27961
-
27962
27949
  case 4:
27963
- return [2
27964
- /*return*/
27965
- ];
27950
+ return [2 /*return*/];
27966
27951
  }
27967
27952
  });
27968
27953
  });
@@ -27975,47 +27960,31 @@ function () {
27975
27960
  * successes: list of geofences successfully created
27976
27961
  * errors: list of geofences that failed to create
27977
27962
  */
27978
-
27979
-
27980
27963
  GeoClass.prototype.saveGeofences = function (geofences, options) {
27981
27964
  return __awaiter(this, void 0, void 0, function () {
27982
27965
  var _a, providerName, prov, geofenceInputArray, error_5;
27983
-
27984
27966
  return __generator(this, function (_b) {
27985
27967
  switch (_b.label) {
27986
27968
  case 0:
27987
27969
  _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
27988
27970
  prov = this.getPluggable(providerName);
27989
-
27990
27971
  if (!Array.isArray(geofences)) {
27991
27972
  geofenceInputArray = [geofences];
27992
27973
  } else {
27993
27974
  geofenceInputArray = geofences;
27994
27975
  }
27995
-
27996
27976
  _b.label = 1;
27997
-
27998
27977
  case 1:
27999
27978
  _b.trys.push([1, 3,, 4]);
28000
-
28001
- return [4
28002
- /*yield*/
28003
- , prov.saveGeofences(geofenceInputArray, options)];
28004
-
27979
+ return [4 /*yield*/, prov.saveGeofences(geofenceInputArray, options)];
28005
27980
  case 2:
28006
- return [2
28007
- /*return*/
28008
- , _b.sent()];
28009
-
27981
+ return [2 /*return*/, _b.sent()];
28010
27982
  case 3:
28011
27983
  error_5 = _b.sent();
28012
27984
  logger.debug(error_5);
28013
27985
  throw error_5;
28014
-
28015
27986
  case 4:
28016
- return [2
28017
- /*return*/
28018
- ];
27987
+ return [2 /*return*/];
28019
27988
  }
28020
27989
  });
28021
27990
  });
@@ -28026,40 +27995,26 @@ function () {
28026
27995
  * @param options?: GeofenceOptions - Optional parameters for getting a geofence
28027
27996
  * @returns Promise<Geofence> - Promise that resolves to a geofence object
28028
27997
  */
28029
-
28030
-
28031
27998
  GeoClass.prototype.getGeofence = function (geofenceId, options) {
28032
27999
  return __awaiter(this, void 0, void 0, function () {
28033
28000
  var _a, providerName, prov, error_6;
28034
-
28035
28001
  return __generator(this, function (_b) {
28036
28002
  switch (_b.label) {
28037
28003
  case 0:
28038
28004
  _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
28039
28005
  prov = this.getPluggable(providerName);
28040
28006
  _b.label = 1;
28041
-
28042
28007
  case 1:
28043
28008
  _b.trys.push([1, 3,, 4]);
28044
-
28045
- return [4
28046
- /*yield*/
28047
- , prov.getGeofence(geofenceId, options)];
28048
-
28009
+ return [4 /*yield*/, prov.getGeofence(geofenceId, options)];
28049
28010
  case 2:
28050
- return [2
28051
- /*return*/
28052
- , _b.sent()];
28053
-
28011
+ return [2 /*return*/, _b.sent()];
28054
28012
  case 3:
28055
28013
  error_6 = _b.sent();
28056
28014
  logger.debug(error_6);
28057
28015
  throw error_6;
28058
-
28059
28016
  case 4:
28060
- return [2
28061
- /*return*/
28062
- ];
28017
+ return [2 /*return*/];
28063
28018
  }
28064
28019
  });
28065
28020
  });
@@ -28071,40 +28026,26 @@ function () {
28071
28026
  * entries: list of geofences - 100 geofences are listed per page
28072
28027
  * nextToken: token for next page of geofences
28073
28028
  */
28074
-
28075
-
28076
28029
  GeoClass.prototype.listGeofences = function (options) {
28077
28030
  return __awaiter(this, void 0, void 0, function () {
28078
28031
  var _a, providerName, prov, error_7;
28079
-
28080
28032
  return __generator(this, function (_b) {
28081
28033
  switch (_b.label) {
28082
28034
  case 0:
28083
28035
  _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
28084
28036
  prov = this.getPluggable(providerName);
28085
28037
  _b.label = 1;
28086
-
28087
28038
  case 1:
28088
28039
  _b.trys.push([1, 3,, 4]);
28089
-
28090
- return [4
28091
- /*yield*/
28092
- , prov.listGeofences(options)];
28093
-
28040
+ return [4 /*yield*/, prov.listGeofences(options)];
28094
28041
  case 2:
28095
- return [2
28096
- /*return*/
28097
- , _b.sent()];
28098
-
28042
+ return [2 /*return*/, _b.sent()];
28099
28043
  case 3:
28100
28044
  error_7 = _b.sent();
28101
28045
  logger.debug(error_7);
28102
28046
  throw error_7;
28103
-
28104
28047
  case 4:
28105
- return [2
28106
- /*return*/
28107
- ];
28048
+ return [2 /*return*/];
28108
28049
  }
28109
28050
  });
28110
28051
  });
@@ -28117,47 +28058,31 @@ function () {
28117
28058
  * successes: list of geofences successfully deleted
28118
28059
  * errors: list of geofences that failed to delete
28119
28060
  */
28120
-
28121
-
28122
28061
  GeoClass.prototype.deleteGeofences = function (geofenceIds, options) {
28123
28062
  return __awaiter(this, void 0, void 0, function () {
28124
28063
  var _a, providerName, prov, geofenceIdsInputArray, error_8;
28125
-
28126
28064
  return __generator(this, function (_b) {
28127
28065
  switch (_b.label) {
28128
28066
  case 0:
28129
28067
  _a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
28130
28068
  prov = this.getPluggable(providerName);
28131
-
28132
28069
  if (!Array.isArray(geofenceIds)) {
28133
28070
  geofenceIdsInputArray = [geofenceIds];
28134
28071
  } else {
28135
28072
  geofenceIdsInputArray = geofenceIds;
28136
28073
  }
28137
-
28138
28074
  _b.label = 1;
28139
-
28140
28075
  case 1:
28141
28076
  _b.trys.push([1, 3,, 4]);
28142
-
28143
- return [4
28144
- /*yield*/
28145
- , prov.deleteGeofences(geofenceIdsInputArray, options)];
28146
-
28077
+ return [4 /*yield*/, prov.deleteGeofences(geofenceIdsInputArray, options)];
28147
28078
  case 2:
28148
- return [2
28149
- /*return*/
28150
- , _b.sent()];
28151
-
28079
+ return [2 /*return*/, _b.sent()];
28152
28080
  case 3:
28153
28081
  error_8 = _b.sent();
28154
28082
  logger.debug(error_8);
28155
28083
  throw error_8;
28156
-
28157
28084
  case 4:
28158
- return [2
28159
- /*return*/
28160
- ];
28085
+ return [2 /*return*/];
28161
28086
  }
28162
28087
  });
28163
28088
  });
@@ -28167,7 +28092,6 @@ function () {
28167
28092
  return GeoClass;
28168
28093
  }();
28169
28094
 
28170
-
28171
28095
  var Geo = new GeoClass();
28172
28096
  _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Amplify"].register(Geo);
28173
28097
 
@@ -28193,25 +28117,20 @@ var __assign = undefined && undefined.__assign || function () {
28193
28117
  __assign = Object.assign || function (t) {
28194
28118
  for (var s, i = 1, n = arguments.length; i < n; i++) {
28195
28119
  s = arguments[i];
28196
-
28197
28120
  for (var p in s) {
28198
28121
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
28199
28122
  }
28200
28123
  }
28201
-
28202
28124
  return t;
28203
28125
  };
28204
-
28205
28126
  return __assign.apply(this, arguments);
28206
28127
  };
28207
-
28208
28128
  var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
28209
28129
  function adopt(value) {
28210
28130
  return value instanceof P ? value : new P(function (resolve) {
28211
28131
  resolve(value);
28212
28132
  });
28213
28133
  }
28214
-
28215
28134
  return new (P || (P = Promise))(function (resolve, reject) {
28216
28135
  function fulfilled(value) {
28217
28136
  try {
@@ -28220,7 +28139,6 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
28220
28139
  reject(e);
28221
28140
  }
28222
28141
  }
28223
-
28224
28142
  function rejected(value) {
28225
28143
  try {
28226
28144
  step(generator["throw"](value));
@@ -28228,29 +28146,26 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
28228
28146
  reject(e);
28229
28147
  }
28230
28148
  }
28231
-
28232
28149
  function step(result) {
28233
28150
  result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
28234
28151
  }
28235
-
28236
28152
  step((generator = generator.apply(thisArg, _arguments || [])).next());
28237
28153
  });
28238
28154
  };
28239
-
28240
28155
  var __generator = undefined && undefined.__generator || function (thisArg, body) {
28241
28156
  var _ = {
28242
- label: 0,
28243
- sent: function sent() {
28244
- if (t[0] & 1) throw t[1];
28245
- return t[1];
28157
+ label: 0,
28158
+ sent: function sent() {
28159
+ if (t[0] & 1) throw t[1];
28160
+ return t[1];
28161
+ },
28162
+ trys: [],
28163
+ ops: []
28246
28164
  },
28247
- trys: [],
28248
- ops: []
28249
- },
28250
- f,
28251
- y,
28252
- t,
28253
- g;
28165
+ f,
28166
+ y,
28167
+ t,
28168
+ g;
28254
28169
  return g = {
28255
28170
  next: verb(0),
28256
28171
  "throw": verb(1),
@@ -28258,79 +28173,60 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
28258
28173
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
28259
28174
  return this;
28260
28175
  }), g;
28261
-
28262
28176
  function verb(n) {
28263
28177
  return function (v) {
28264
28178
  return step([n, v]);
28265
28179
  };
28266
28180
  }
28267
-
28268
28181
  function step(op) {
28269
28182
  if (f) throw new TypeError("Generator is already executing.");
28270
-
28271
28183
  while (_) {
28272
28184
  try {
28273
28185
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
28274
28186
  if (y = 0, t) op = [op[0] & 2, t.value];
28275
-
28276
28187
  switch (op[0]) {
28277
28188
  case 0:
28278
28189
  case 1:
28279
28190
  t = op;
28280
28191
  break;
28281
-
28282
28192
  case 4:
28283
28193
  _.label++;
28284
28194
  return {
28285
28195
  value: op[1],
28286
28196
  done: false
28287
28197
  };
28288
-
28289
28198
  case 5:
28290
28199
  _.label++;
28291
28200
  y = op[1];
28292
28201
  op = [0];
28293
28202
  continue;
28294
-
28295
28203
  case 7:
28296
28204
  op = _.ops.pop();
28297
-
28298
28205
  _.trys.pop();
28299
-
28300
28206
  continue;
28301
-
28302
28207
  default:
28303
28208
  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
28304
28209
  _ = 0;
28305
28210
  continue;
28306
28211
  }
28307
-
28308
28212
  if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
28309
28213
  _.label = op[1];
28310
28214
  break;
28311
28215
  }
28312
-
28313
28216
  if (op[0] === 6 && _.label < t[1]) {
28314
28217
  _.label = t[1];
28315
28218
  t = op;
28316
28219
  break;
28317
28220
  }
28318
-
28319
28221
  if (t && _.label < t[2]) {
28320
28222
  _.label = t[2];
28321
-
28322
28223
  _.ops.push(op);
28323
-
28324
28224
  break;
28325
28225
  }
28326
-
28327
28226
  if (t[2]) _.ops.pop();
28328
-
28329
28227
  _.trys.pop();
28330
-
28331
28228
  continue;
28332
28229
  }
28333
-
28334
28230
  op = body.call(thisArg, _);
28335
28231
  } catch (e) {
28336
28232
  op = [6, e];
@@ -28339,7 +28235,6 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
28339
28235
  f = t = 0;
28340
28236
  }
28341
28237
  }
28342
-
28343
28238
  if (op[0] & 5) throw op[1];
28344
28239
  return {
28345
28240
  value: op[0] ? op[1] : void 0,
@@ -28347,15 +28242,13 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
28347
28242
  };
28348
28243
  }
28349
28244
  };
28350
-
28351
28245
  var __read = undefined && undefined.__read || function (o, n) {
28352
28246
  var m = typeof Symbol === "function" && o[Symbol.iterator];
28353
28247
  if (!m) return o;
28354
28248
  var i = m.call(o),
28355
- r,
28356
- ar = [],
28357
- e;
28358
-
28249
+ r,
28250
+ ar = [],
28251
+ e;
28359
28252
  try {
28360
28253
  while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
28361
28254
  ar.push(r.value);
@@ -28371,15 +28264,12 @@ var __read = undefined && undefined.__read || function (o, n) {
28371
28264
  if (e) throw e.error;
28372
28265
  }
28373
28266
  }
28374
-
28375
28267
  return ar;
28376
28268
  };
28377
-
28378
28269
  var __spread = undefined && undefined.__spread || function () {
28379
28270
  for (var ar = [], i = 0; i < arguments.length; i++) {
28380
28271
  ar = ar.concat(__read(arguments[i]));
28381
28272
  }
28382
-
28383
28273
  return ar;
28384
28274
  };
28385
28275
  /*
@@ -28398,13 +28288,8 @@ var __spread = undefined && undefined.__spread || function () {
28398
28288
 
28399
28289
 
28400
28290
 
28401
-
28402
-
28403
28291
  var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["ConsoleLogger"]('AmazonLocationServiceProvider');
28404
-
28405
- var AmazonLocationServiceProvider =
28406
- /** @class */
28407
- function () {
28292
+ var AmazonLocationServiceProvider = /** @class */function () {
28408
28293
  /**
28409
28294
  * Initialize Geo with AWS configurations
28410
28295
  * @param {Object} config - Configuration object for Geo
@@ -28417,8 +28302,6 @@ function () {
28417
28302
  * get the category of the plugin
28418
28303
  * @returns {string} name of the category
28419
28304
  */
28420
-
28421
-
28422
28305
  AmazonLocationServiceProvider.prototype.getCategory = function () {
28423
28306
  return AmazonLocationServiceProvider.CATEGORY;
28424
28307
  };
@@ -28426,8 +28309,6 @@ function () {
28426
28309
  * get provider name of the plugin
28427
28310
  * @returns {string} name of the provider
28428
28311
  */
28429
-
28430
-
28431
28312
  AmazonLocationServiceProvider.prototype.getProviderName = function () {
28432
28313
  return AmazonLocationServiceProvider.PROVIDER_NAME;
28433
28314
  };
@@ -28436,8 +28317,6 @@ function () {
28436
28317
  * @param {Object} config - Configuration of the Geo
28437
28318
  * @return {Object} - Current configuration
28438
28319
  */
28439
-
28440
-
28441
28320
  AmazonLocationServiceProvider.prototype.configure = function (config) {
28442
28321
  logger.debug('configure Amazon Location Service Provider', config);
28443
28322
  if (!config) return this._config;
@@ -28448,15 +28327,11 @@ function () {
28448
28327
  * Get the map resources that are currently available through the provider
28449
28328
  * @returns {AmazonLocationServiceMapStyle[]}- Array of available map resources
28450
28329
  */
28451
-
28452
-
28453
28330
  AmazonLocationServiceProvider.prototype.getAvailableMaps = function () {
28454
28331
  this._verifyMapResources();
28455
-
28456
28332
  var mapStyles = [];
28457
28333
  var availableMaps = this._config.maps.items;
28458
28334
  var region = this._config.region;
28459
-
28460
28335
  for (var mapName in availableMaps) {
28461
28336
  var style = availableMaps[mapName].style;
28462
28337
  mapStyles.push({
@@ -28465,18 +28340,14 @@ function () {
28465
28340
  region: region
28466
28341
  });
28467
28342
  }
28468
-
28469
28343
  return mapStyles;
28470
28344
  };
28471
28345
  /**
28472
28346
  * Get the map resource set as default in amplify config
28473
28347
  * @returns {AmazonLocationServiceMapStyle} - Map resource set as the default in amplify config
28474
28348
  */
28475
-
28476
-
28477
28349
  AmazonLocationServiceProvider.prototype.getDefaultMap = function () {
28478
28350
  this._verifyMapResources();
28479
-
28480
28351
  var mapName = this._config.maps["default"];
28481
28352
  var style = this._config.maps.items[mapName].style;
28482
28353
  var region = this._config.region;
@@ -28492,27 +28363,19 @@ function () {
28492
28363
  * @param {SearchByTextOptions} options? - Optional parameters to the search
28493
28364
  * @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters
28494
28365
  */
28495
-
28496
-
28497
28366
  AmazonLocationServiceProvider.prototype.searchByText = function (text, options) {
28498
28367
  return __awaiter(this, void 0, void 0, function () {
28499
28368
  var credentialsOK, locationServiceInput, client, command, response, error_1, PascalResults, results;
28500
28369
  return __generator(this, function (_a) {
28501
28370
  switch (_a.label) {
28502
28371
  case 0:
28503
- return [4
28504
- /*yield*/
28505
- , this._ensureCredentials()];
28506
-
28372
+ return [4 /*yield*/, this._ensureCredentials()];
28507
28373
  case 1:
28508
28374
  credentialsOK = _a.sent();
28509
-
28510
28375
  if (!credentialsOK) {
28511
28376
  throw new Error('No credentials');
28512
28377
  }
28513
-
28514
28378
  this._verifySearchIndex(options === null || options === void 0 ? void 0 : options.searchIndexName);
28515
-
28516
28379
  locationServiceInput = {
28517
28380
  Text: text,
28518
28381
  IndexName: this._config.search_indices["default"]
@@ -28520,11 +28383,9 @@ function () {
28520
28383
  /**
28521
28384
  * Map search options to Amazon Location Service input object
28522
28385
  */
28523
-
28524
28386
  if (options) {
28525
28387
  locationServiceInput = __assign(__assign({}, locationServiceInput), Object(_util__WEBPACK_IMPORTED_MODULE_3__["mapSearchOptions"])(options, locationServiceInput));
28526
28388
  }
28527
-
28528
28389
  client = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["LocationClient"]({
28529
28390
  credentials: this._config.credentials,
28530
28391
  region: this._config.region,
@@ -28532,25 +28393,16 @@ function () {
28532
28393
  });
28533
28394
  command = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["SearchPlaceIndexForTextCommand"](locationServiceInput);
28534
28395
  _a.label = 2;
28535
-
28536
28396
  case 2:
28537
28397
  _a.trys.push([2, 4,, 5]);
28538
-
28539
- return [4
28540
- /*yield*/
28541
- , client.send(command)];
28542
-
28398
+ return [4 /*yield*/, client.send(command)];
28543
28399
  case 3:
28544
28400
  response = _a.sent();
28545
- return [3
28546
- /*break*/
28547
- , 5];
28548
-
28401
+ return [3 /*break*/, 5];
28549
28402
  case 4:
28550
28403
  error_1 = _a.sent();
28551
28404
  logger.debug(error_1);
28552
28405
  throw error_1;
28553
-
28554
28406
  case 5:
28555
28407
  PascalResults = response.Results.map(function (result) {
28556
28408
  return result.Place;
@@ -28558,9 +28410,7 @@ function () {
28558
28410
  results = camelcase_keys__WEBPACK_IMPORTED_MODULE_0___default()(PascalResults, {
28559
28411
  deep: true
28560
28412
  });
28561
- return [2
28562
- /*return*/
28563
- , results];
28413
+ return [2 /*return*/, results];
28564
28414
  }
28565
28415
  });
28566
28416
  });
@@ -28571,27 +28421,19 @@ function () {
28571
28421
  * @param {SearchByTextOptions} options? - Optional parameters to the search
28572
28422
  * @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
28573
28423
  */
28574
-
28575
-
28576
28424
  AmazonLocationServiceProvider.prototype.searchForSuggestions = function (text, options) {
28577
28425
  return __awaiter(this, void 0, void 0, function () {
28578
28426
  var credentialsOK, locationServiceInput, client, command, response, error_2, results;
28579
28427
  return __generator(this, function (_a) {
28580
28428
  switch (_a.label) {
28581
28429
  case 0:
28582
- return [4
28583
- /*yield*/
28584
- , this._ensureCredentials()];
28585
-
28430
+ return [4 /*yield*/, this._ensureCredentials()];
28586
28431
  case 1:
28587
28432
  credentialsOK = _a.sent();
28588
-
28589
28433
  if (!credentialsOK) {
28590
28434
  throw new Error('No credentials');
28591
28435
  }
28592
-
28593
28436
  this._verifySearchIndex(options === null || options === void 0 ? void 0 : options.searchIndexName);
28594
-
28595
28437
  locationServiceInput = {
28596
28438
  Text: text,
28597
28439
  IndexName: this._config.search_indices["default"]
@@ -28599,11 +28441,9 @@ function () {
28599
28441
  /**
28600
28442
  * Map search options to Amazon Location Service input object
28601
28443
  */
28602
-
28603
28444
  if (options) {
28604
28445
  locationServiceInput = __assign(__assign({}, locationServiceInput), Object(_util__WEBPACK_IMPORTED_MODULE_3__["mapSearchOptions"])(options, locationServiceInput));
28605
28446
  }
28606
-
28607
28447
  client = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["LocationClient"]({
28608
28448
  credentials: this._config.credentials,
28609
28449
  region: this._config.region,
@@ -28611,25 +28451,16 @@ function () {
28611
28451
  });
28612
28452
  command = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["SearchPlaceIndexForSuggestionsCommand"](locationServiceInput);
28613
28453
  _a.label = 2;
28614
-
28615
28454
  case 2:
28616
28455
  _a.trys.push([2, 4,, 5]);
28617
-
28618
- return [4
28619
- /*yield*/
28620
- , client.send(command)];
28621
-
28456
+ return [4 /*yield*/, client.send(command)];
28622
28457
  case 3:
28623
28458
  response = _a.sent();
28624
- return [3
28625
- /*break*/
28626
- , 5];
28627
-
28459
+ return [3 /*break*/, 5];
28628
28460
  case 4:
28629
28461
  error_2 = _a.sent();
28630
28462
  logger.debug(error_2);
28631
28463
  throw error_2;
28632
-
28633
28464
  case 5:
28634
28465
  results = response.Results.map(function (result) {
28635
28466
  return {
@@ -28637,14 +28468,11 @@ function () {
28637
28468
  placeId: result.PlaceId
28638
28469
  };
28639
28470
  });
28640
- return [2
28641
- /*return*/
28642
- , results];
28471
+ return [2 /*return*/, results];
28643
28472
  }
28644
28473
  });
28645
28474
  });
28646
28475
  };
28647
-
28648
28476
  AmazonLocationServiceProvider.prototype._verifyPlaceId = function (placeId) {
28649
28477
  if (placeId.length === 0) {
28650
28478
  var errorString = 'PlaceId cannot be an empty string.';
@@ -28652,28 +28480,20 @@ function () {
28652
28480
  throw new Error(errorString);
28653
28481
  }
28654
28482
  };
28655
-
28656
28483
  AmazonLocationServiceProvider.prototype.searchByPlaceId = function (placeId, options) {
28657
28484
  return __awaiter(this, void 0, void 0, function () {
28658
28485
  var credentialsOK, client, searchByPlaceIdInput, command, response, error_3, place;
28659
28486
  return __generator(this, function (_a) {
28660
28487
  switch (_a.label) {
28661
28488
  case 0:
28662
- return [4
28663
- /*yield*/
28664
- , this._ensureCredentials()];
28665
-
28489
+ return [4 /*yield*/, this._ensureCredentials()];
28666
28490
  case 1:
28667
28491
  credentialsOK = _a.sent();
28668
-
28669
28492
  if (!credentialsOK) {
28670
28493
  throw new Error('No credentials');
28671
28494
  }
28672
-
28673
28495
  this._verifySearchIndex(options === null || options === void 0 ? void 0 : options.searchIndexName);
28674
-
28675
28496
  this._verifyPlaceId(placeId);
28676
-
28677
28497
  client = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["LocationClient"]({
28678
28498
  credentials: this._config.credentials,
28679
28499
  region: this._config.region,
@@ -28685,39 +28505,24 @@ function () {
28685
28505
  };
28686
28506
  command = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["GetPlaceCommand"](searchByPlaceIdInput);
28687
28507
  _a.label = 2;
28688
-
28689
28508
  case 2:
28690
28509
  _a.trys.push([2, 4,, 5]);
28691
-
28692
- return [4
28693
- /*yield*/
28694
- , client.send(command)];
28695
-
28510
+ return [4 /*yield*/, client.send(command)];
28696
28511
  case 3:
28697
28512
  response = _a.sent();
28698
- return [3
28699
- /*break*/
28700
- , 5];
28701
-
28513
+ return [3 /*break*/, 5];
28702
28514
  case 4:
28703
28515
  error_3 = _a.sent();
28704
28516
  logger.debug(error_3);
28705
28517
  throw error_3;
28706
-
28707
28518
  case 5:
28708
28519
  place = response.Place;
28709
-
28710
28520
  if (place) {
28711
- return [2
28712
- /*return*/
28713
- , camelcase_keys__WEBPACK_IMPORTED_MODULE_0___default()(place, {
28521
+ return [2 /*return*/, camelcase_keys__WEBPACK_IMPORTED_MODULE_0___default()(place, {
28714
28522
  deep: true
28715
28523
  })];
28716
28524
  }
28717
-
28718
- return [2
28719
- /*return*/
28720
- ];
28525
+ return [2 /*return*/];
28721
28526
  }
28722
28527
  });
28723
28528
  });
@@ -28728,40 +28533,29 @@ function () {
28728
28533
  * @param options - Options parameters for the search
28729
28534
  * @returns {Promise<Place>} - Promise that resolves to a place matching search coordinates
28730
28535
  */
28731
-
28732
-
28733
28536
  AmazonLocationServiceProvider.prototype.searchByCoordinates = function (coordinates, options) {
28734
28537
  return __awaiter(this, void 0, void 0, function () {
28735
28538
  var credentialsOK, locationServiceInput, client, command, response, error_4, PascalResults, results;
28736
28539
  return __generator(this, function (_a) {
28737
28540
  switch (_a.label) {
28738
28541
  case 0:
28739
- return [4
28740
- /*yield*/
28741
- , this._ensureCredentials()];
28742
-
28542
+ return [4 /*yield*/, this._ensureCredentials()];
28743
28543
  case 1:
28744
28544
  credentialsOK = _a.sent();
28745
-
28746
28545
  if (!credentialsOK) {
28747
28546
  throw new Error('No credentials');
28748
28547
  }
28749
-
28750
28548
  this._verifySearchIndex(options === null || options === void 0 ? void 0 : options.searchIndexName);
28751
-
28752
28549
  locationServiceInput = {
28753
28550
  Position: coordinates,
28754
28551
  IndexName: this._config.search_indices["default"]
28755
28552
  };
28756
-
28757
28553
  if (options) {
28758
28554
  if (options.searchIndexName) {
28759
28555
  locationServiceInput.IndexName = options.searchIndexName;
28760
28556
  }
28761
-
28762
28557
  locationServiceInput.MaxResults = options.maxResults;
28763
28558
  }
28764
-
28765
28559
  client = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["LocationClient"]({
28766
28560
  credentials: this._config.credentials,
28767
28561
  region: this._config.region,
@@ -28769,25 +28563,16 @@ function () {
28769
28563
  });
28770
28564
  command = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["SearchPlaceIndexForPositionCommand"](locationServiceInput);
28771
28565
  _a.label = 2;
28772
-
28773
28566
  case 2:
28774
28567
  _a.trys.push([2, 4,, 5]);
28775
-
28776
- return [4
28777
- /*yield*/
28778
- , client.send(command)];
28779
-
28568
+ return [4 /*yield*/, client.send(command)];
28780
28569
  case 3:
28781
28570
  response = _a.sent();
28782
- return [3
28783
- /*break*/
28784
- , 5];
28785
-
28571
+ return [3 /*break*/, 5];
28786
28572
  case 4:
28787
28573
  error_4 = _a.sent();
28788
28574
  logger.debug(error_4);
28789
28575
  throw error_4;
28790
-
28791
28576
  case 5:
28792
28577
  PascalResults = response.Results.map(function (result) {
28793
28578
  return result.Place;
@@ -28795,9 +28580,7 @@ function () {
28795
28580
  results = camelcase_keys__WEBPACK_IMPORTED_MODULE_0___default()(PascalResults[0], {
28796
28581
  deep: true
28797
28582
  });
28798
- return [2
28799
- /*return*/
28800
- , results];
28583
+ return [2 /*return*/, results];
28801
28584
  }
28802
28585
  });
28803
28586
  });
@@ -28810,44 +28593,33 @@ function () {
28810
28593
  * successes: list of geofences successfully created
28811
28594
  * errors: list of geofences that failed to create
28812
28595
  */
28813
-
28814
-
28815
28596
  AmazonLocationServiceProvider.prototype.saveGeofences = function (geofences, options) {
28816
28597
  return __awaiter(this, void 0, void 0, function () {
28817
28598
  var credentialsOK, PascalGeofences, results, geofenceBatches, apiLimit;
28818
-
28819
28599
  var _this = this;
28820
-
28821
28600
  return __generator(this, function (_a) {
28822
28601
  switch (_a.label) {
28823
28602
  case 0:
28824
28603
  if (geofences.length < 1) {
28825
28604
  throw new Error('Geofence input array is empty');
28826
28605
  }
28827
-
28828
- return [4
28829
- /*yield*/
28830
- , this._ensureCredentials()];
28831
-
28606
+ return [4 /*yield*/, this._ensureCredentials()];
28832
28607
  case 1:
28833
28608
  credentialsOK = _a.sent();
28834
-
28835
28609
  if (!credentialsOK) {
28836
28610
  throw new Error('No credentials');
28837
- } // Verify geofence collection exists in aws-config.js
28838
-
28839
-
28611
+ }
28612
+ // Verify geofence collection exists in aws-config.js
28840
28613
  try {
28841
28614
  this._verifyGeofenceCollections(options === null || options === void 0 ? void 0 : options.collectionName);
28842
28615
  } catch (error) {
28843
28616
  logger.debug(error);
28844
28617
  throw error;
28845
28618
  }
28846
-
28847
28619
  Object(_util__WEBPACK_IMPORTED_MODULE_3__["validateGeofencesInput"])(geofences);
28848
28620
  PascalGeofences = geofences.map(function (_a) {
28849
28621
  var geofenceId = _a.geofenceId,
28850
- polygon = _a.geometry.polygon;
28622
+ polygon = _a.geometry.polygon;
28851
28623
  return {
28852
28624
  GeofenceId: geofenceId,
28853
28625
  Geometry: {
@@ -28860,35 +28632,24 @@ function () {
28860
28632
  errors: []
28861
28633
  };
28862
28634
  geofenceBatches = [];
28863
-
28864
28635
  while (PascalGeofences.length > 0) {
28865
28636
  apiLimit = 10;
28866
28637
  geofenceBatches.push(PascalGeofences.splice(0, apiLimit));
28867
28638
  }
28868
-
28869
- return [4
28870
- /*yield*/
28871
- , Promise.all(geofenceBatches.map(function (batch) {
28639
+ return [4 /*yield*/, Promise.all(geofenceBatches.map(function (batch) {
28872
28640
  return __awaiter(_this, void 0, void 0, function () {
28873
28641
  var response, error_5;
28874
28642
  return __generator(this, function (_a) {
28875
28643
  switch (_a.label) {
28876
28644
  case 0:
28877
28645
  _a.trys.push([0, 2,, 3]);
28878
-
28879
- return [4
28880
- /*yield*/
28881
- , this._AmazonLocationServiceBatchPutGeofenceCall(batch, (options === null || options === void 0 ? void 0 : options.collectionName) || this._config.geofenceCollections["default"])];
28882
-
28646
+ return [4 /*yield*/, this._AmazonLocationServiceBatchPutGeofenceCall(batch, (options === null || options === void 0 ? void 0 : options.collectionName) || this._config.geofenceCollections["default"])];
28883
28647
  case 1:
28884
28648
  response = _a.sent();
28885
- return [3
28886
- /*break*/
28887
- , 3];
28888
-
28649
+ return [3 /*break*/, 3];
28889
28650
  case 2:
28890
- error_5 = _a.sent(); // If the API call fails, add the geofences to the errors array and move to next batch
28891
-
28651
+ error_5 = _a.sent();
28652
+ // If the API call fails, add the geofences to the errors array and move to next batch
28892
28653
  batch.forEach(function (geofence) {
28893
28654
  results.errors.push({
28894
28655
  geofenceId: geofence.GeofenceId,
@@ -28898,28 +28659,25 @@ function () {
28898
28659
  }
28899
28660
  });
28900
28661
  });
28901
- return [2
28902
- /*return*/
28903
- ];
28904
-
28662
+ return [2 /*return*/];
28905
28663
  case 3:
28906
28664
  // Push all successes to results
28907
28665
  response.Successes.forEach(function (success) {
28908
28666
  var GeofenceId = success.GeofenceId,
28909
- CreateTime = success.CreateTime,
28910
- UpdateTime = success.UpdateTime;
28667
+ CreateTime = success.CreateTime,
28668
+ UpdateTime = success.UpdateTime;
28911
28669
  results.successes.push({
28912
28670
  geofenceId: GeofenceId,
28913
28671
  createTime: CreateTime,
28914
28672
  updateTime: UpdateTime
28915
28673
  });
28916
- }); // Push all errors to results
28917
-
28674
+ });
28675
+ // Push all errors to results
28918
28676
  response.Errors.forEach(function (error) {
28919
28677
  var _a = error.Error,
28920
- Code = _a.Code,
28921
- Message = _a.Message,
28922
- GeofenceId = error.GeofenceId;
28678
+ Code = _a.Code,
28679
+ Message = _a.Message,
28680
+ GeofenceId = error.GeofenceId;
28923
28681
  results.errors.push({
28924
28682
  error: {
28925
28683
  code: Code,
@@ -28928,9 +28686,7 @@ function () {
28928
28686
  geofenceId: GeofenceId
28929
28687
  });
28930
28688
  });
28931
- return [2
28932
- /*return*/
28933
- ];
28689
+ return [2 /*return*/];
28934
28690
  }
28935
28691
  });
28936
28692
  });
@@ -28938,10 +28694,7 @@ function () {
28938
28694
 
28939
28695
  case 2:
28940
28696
  _a.sent();
28941
-
28942
- return [2
28943
- /*return*/
28944
- , results];
28697
+ return [2 /*return*/, results];
28945
28698
  }
28946
28699
  });
28947
28700
  });
@@ -28952,33 +28705,25 @@ function () {
28952
28705
  * @param options?: Optional parameters for getGeofence
28953
28706
  * @returns {Promise<AmazonLocationServiceGeofence>} - Promise that resolves to a geofence object
28954
28707
  */
28955
-
28956
-
28957
28708
  AmazonLocationServiceProvider.prototype.getGeofence = function (geofenceId, options) {
28958
28709
  return __awaiter(this, void 0, void 0, function () {
28959
28710
  var credentialsOK, client, commandInput, command, response, error_6, GeofenceId, CreateTime, UpdateTime, Status, Geometry, geofence;
28960
28711
  return __generator(this, function (_a) {
28961
28712
  switch (_a.label) {
28962
28713
  case 0:
28963
- return [4
28964
- /*yield*/
28965
- , this._ensureCredentials()];
28966
-
28714
+ return [4 /*yield*/, this._ensureCredentials()];
28967
28715
  case 1:
28968
28716
  credentialsOK = _a.sent();
28969
-
28970
28717
  if (!credentialsOK) {
28971
28718
  throw new Error('No credentials');
28972
- } // Verify geofence collection exists in aws-config.js
28973
-
28974
-
28719
+ }
28720
+ // Verify geofence collection exists in aws-config.js
28975
28721
  try {
28976
28722
  this._verifyGeofenceCollections(options === null || options === void 0 ? void 0 : options.collectionName);
28977
28723
  } catch (error) {
28978
28724
  logger.debug(error);
28979
28725
  throw error;
28980
28726
  }
28981
-
28982
28727
  Object(_util__WEBPACK_IMPORTED_MODULE_3__["validateGeofenceId"])(geofenceId);
28983
28728
  client = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["LocationClient"]({
28984
28729
  credentials: this._config.credentials,
@@ -28991,25 +28736,16 @@ function () {
28991
28736
  };
28992
28737
  command = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["GetGeofenceCommand"](commandInput);
28993
28738
  _a.label = 2;
28994
-
28995
28739
  case 2:
28996
28740
  _a.trys.push([2, 4,, 5]);
28997
-
28998
- return [4
28999
- /*yield*/
29000
- , client.send(command)];
29001
-
28741
+ return [4 /*yield*/, client.send(command)];
29002
28742
  case 3:
29003
28743
  response = _a.sent();
29004
- return [3
29005
- /*break*/
29006
- , 5];
29007
-
28744
+ return [3 /*break*/, 5];
29008
28745
  case 4:
29009
28746
  error_6 = _a.sent();
29010
28747
  logger.debug(error_6);
29011
28748
  throw error_6;
29012
-
29013
28749
  case 5:
29014
28750
  GeofenceId = response.GeofenceId, CreateTime = response.CreateTime, UpdateTime = response.UpdateTime, Status = response.Status, Geometry = response.Geometry;
29015
28751
  geofence = {
@@ -29021,9 +28757,7 @@ function () {
29021
28757
  status: Status,
29022
28758
  updateTime: UpdateTime
29023
28759
  };
29024
- return [2
29025
- /*return*/
29026
- , geofence];
28760
+ return [2 /*return*/, geofence];
29027
28761
  }
29028
28762
  });
29029
28763
  });
@@ -29035,33 +28769,25 @@ function () {
29035
28769
  * entries: list of geofences - 100 geofences are listed per page
29036
28770
  * nextToken: token for next page of geofences
29037
28771
  */
29038
-
29039
-
29040
28772
  AmazonLocationServiceProvider.prototype.listGeofences = function (options) {
29041
28773
  return __awaiter(this, void 0, void 0, function () {
29042
28774
  var credentialsOK, client, listGeofencesInput, command, response, error_7, NextToken, Entries, results;
29043
28775
  return __generator(this, function (_a) {
29044
28776
  switch (_a.label) {
29045
28777
  case 0:
29046
- return [4
29047
- /*yield*/
29048
- , this._ensureCredentials()];
29049
-
28778
+ return [4 /*yield*/, this._ensureCredentials()];
29050
28779
  case 1:
29051
28780
  credentialsOK = _a.sent();
29052
-
29053
28781
  if (!credentialsOK) {
29054
28782
  throw new Error('No credentials');
29055
- } // Verify geofence collection exists in aws-config.js
29056
-
29057
-
28783
+ }
28784
+ // Verify geofence collection exists in aws-config.js
29058
28785
  try {
29059
28786
  this._verifyGeofenceCollections(options === null || options === void 0 ? void 0 : options.collectionName);
29060
28787
  } catch (error) {
29061
28788
  logger.debug(error);
29062
28789
  throw error;
29063
28790
  }
29064
-
29065
28791
  client = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["LocationClient"]({
29066
28792
  credentials: this._config.credentials,
29067
28793
  region: this._config.region,
@@ -29073,34 +28799,25 @@ function () {
29073
28799
  };
29074
28800
  command = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["ListGeofencesCommand"](listGeofencesInput);
29075
28801
  _a.label = 2;
29076
-
29077
28802
  case 2:
29078
28803
  _a.trys.push([2, 4,, 5]);
29079
-
29080
- return [4
29081
- /*yield*/
29082
- , client.send(command)];
29083
-
28804
+ return [4 /*yield*/, client.send(command)];
29084
28805
  case 3:
29085
28806
  response = _a.sent();
29086
- return [3
29087
- /*break*/
29088
- , 5];
29089
-
28807
+ return [3 /*break*/, 5];
29090
28808
  case 4:
29091
28809
  error_7 = _a.sent();
29092
28810
  logger.debug(error_7);
29093
28811
  throw error_7;
29094
-
29095
28812
  case 5:
29096
28813
  NextToken = response.NextToken, Entries = response.Entries;
29097
28814
  results = {
29098
28815
  entries: Entries.map(function (_a) {
29099
28816
  var GeofenceId = _a.GeofenceId,
29100
- CreateTime = _a.CreateTime,
29101
- UpdateTime = _a.UpdateTime,
29102
- Status = _a.Status,
29103
- Polygon = _a.Geometry.Polygon;
28817
+ CreateTime = _a.CreateTime,
28818
+ UpdateTime = _a.UpdateTime,
28819
+ Status = _a.Status,
28820
+ Polygon = _a.Geometry.Polygon;
29104
28821
  return {
29105
28822
  geofenceId: GeofenceId,
29106
28823
  createTime: CreateTime,
@@ -29113,9 +28830,7 @@ function () {
29113
28830
  }),
29114
28831
  nextToken: NextToken
29115
28832
  };
29116
- return [2
29117
- /*return*/
29118
- , results];
28833
+ return [2 /*return*/, results];
29119
28834
  }
29120
28835
  });
29121
28836
  });
@@ -29128,34 +28843,23 @@ function () {
29128
28843
  * successes: list of geofences successfully deleted
29129
28844
  * errors: list of geofences that failed to delete
29130
28845
  */
29131
-
29132
-
29133
28846
  AmazonLocationServiceProvider.prototype.deleteGeofences = function (geofenceIds, options) {
29134
28847
  return __awaiter(this, void 0, void 0, function () {
29135
28848
  var credentialsOK, badGeofenceIds, results, geofenceIdBatches, count;
29136
-
29137
28849
  var _this = this;
29138
-
29139
28850
  return __generator(this, function (_a) {
29140
28851
  switch (_a.label) {
29141
28852
  case 0:
29142
28853
  if (geofenceIds.length < 1) {
29143
28854
  throw new Error('GeofenceId input array is empty');
29144
28855
  }
29145
-
29146
- return [4
29147
- /*yield*/
29148
- , this._ensureCredentials()];
29149
-
28856
+ return [4 /*yield*/, this._ensureCredentials()];
29150
28857
  case 1:
29151
28858
  credentialsOK = _a.sent();
29152
-
29153
28859
  if (!credentialsOK) {
29154
28860
  throw new Error('No credentials');
29155
28861
  }
29156
-
29157
28862
  this._verifyGeofenceCollections(options === null || options === void 0 ? void 0 : options.collectionName);
29158
-
29159
28863
  badGeofenceIds = geofenceIds.filter(function (geofenceId) {
29160
28864
  try {
29161
28865
  Object(_util__WEBPACK_IMPORTED_MODULE_3__["validateGeofenceId"])(geofenceId);
@@ -29163,48 +28867,33 @@ function () {
29163
28867
  return true;
29164
28868
  }
29165
28869
  });
29166
-
29167
28870
  if (badGeofenceIds.length > 0) {
29168
28871
  throw new Error("Invalid geofence ids: " + badGeofenceIds.join(', '));
29169
28872
  }
29170
-
29171
28873
  results = {
29172
28874
  successes: [],
29173
28875
  errors: []
29174
28876
  };
29175
28877
  geofenceIdBatches = [];
29176
28878
  count = 0;
29177
-
29178
28879
  while (count < geofenceIds.length) {
29179
28880
  geofenceIdBatches.push(geofenceIds.slice(count, count += 10));
29180
28881
  }
29181
-
29182
- return [4
29183
- /*yield*/
29184
- , Promise.all(geofenceIdBatches.map(function (batch) {
28882
+ return [4 /*yield*/, Promise.all(geofenceIdBatches.map(function (batch) {
29185
28883
  return __awaiter(_this, void 0, void 0, function () {
29186
28884
  var response, error_8, badGeofenceIds;
29187
-
29188
28885
  var _a;
29189
-
29190
28886
  return __generator(this, function (_b) {
29191
28887
  switch (_b.label) {
29192
28888
  case 0:
29193
28889
  _b.trys.push([0, 2,, 3]);
29194
-
29195
- return [4
29196
- /*yield*/
29197
- , this._AmazonLocationServiceBatchDeleteGeofenceCall(batch, (options === null || options === void 0 ? void 0 : options.collectionName) || this._config.geofenceCollections["default"])];
29198
-
28890
+ return [4 /*yield*/, this._AmazonLocationServiceBatchDeleteGeofenceCall(batch, (options === null || options === void 0 ? void 0 : options.collectionName) || this._config.geofenceCollections["default"])];
29199
28891
  case 1:
29200
28892
  response = _b.sent();
29201
- return [3
29202
- /*break*/
29203
- , 3];
29204
-
28893
+ return [3 /*break*/, 3];
29205
28894
  case 2:
29206
- error_8 = _b.sent(); // If the API call fails, add the geofences to the errors array and move to next batch
29207
-
28895
+ error_8 = _b.sent();
28896
+ // If the API call fails, add the geofences to the errors array and move to next batch
29208
28897
  batch.forEach(function (geofenceId) {
29209
28898
  var errorObject = {
29210
28899
  geofenceId: geofenceId,
@@ -29215,23 +28904,16 @@ function () {
29215
28904
  };
29216
28905
  results.errors.push(errorObject);
29217
28906
  });
29218
- return [2
29219
- /*return*/
29220
- ];
29221
-
28907
+ return [2 /*return*/];
29222
28908
  case 3:
29223
28909
  badGeofenceIds = response.Errors.map(function (_a) {
29224
28910
  var geofenceId = _a.geofenceId;
29225
28911
  return geofenceId;
29226
28912
  });
29227
-
29228
28913
  (_a = results.successes).push.apply(_a, __spread(batch.filter(function (Id) {
29229
28914
  return !badGeofenceIds.includes(Id);
29230
28915
  })));
29231
-
29232
- return [2
29233
- /*return*/
29234
- ];
28916
+ return [2 /*return*/];
29235
28917
  }
29236
28918
  });
29237
28919
  });
@@ -29239,10 +28921,7 @@ function () {
29239
28921
 
29240
28922
  case 2:
29241
28923
  _a.sent();
29242
-
29243
- return [2
29244
- /*return*/
29245
- , results];
28924
+ return [2 /*return*/, results];
29246
28925
  }
29247
28926
  });
29248
28927
  });
@@ -29250,8 +28929,6 @@ function () {
29250
28929
  /**
29251
28930
  * @private
29252
28931
  */
29253
-
29254
-
29255
28932
  AmazonLocationServiceProvider.prototype._ensureCredentials = function () {
29256
28933
  return __awaiter(this, void 0, void 0, function () {
29257
28934
  var credentials, cred, error_9;
@@ -29259,34 +28936,20 @@ function () {
29259
28936
  switch (_a.label) {
29260
28937
  case 0:
29261
28938
  _a.trys.push([0, 2,, 3]);
29262
-
29263
- return [4
29264
- /*yield*/
29265
- , _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Credentials"].get()];
29266
-
28939
+ return [4 /*yield*/, _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Credentials"].get()];
29267
28940
  case 1:
29268
28941
  credentials = _a.sent();
29269
- if (!credentials) return [2
29270
- /*return*/
29271
- , false];
28942
+ if (!credentials) return [2 /*return*/, false];
29272
28943
  cred = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Credentials"].shear(credentials);
29273
28944
  logger.debug('Set credentials for storage. Credentials are:', cred);
29274
28945
  this._config.credentials = cred;
29275
- return [2
29276
- /*return*/
29277
- , true];
29278
-
28946
+ return [2 /*return*/, true];
29279
28947
  case 2:
29280
28948
  error_9 = _a.sent();
29281
28949
  logger.debug('Ensure credentials error. Credentials are:', error_9);
29282
- return [2
29283
- /*return*/
29284
- , false];
29285
-
28950
+ return [2 /*return*/, false];
29286
28951
  case 3:
29287
- return [2
29288
- /*return*/
29289
- ];
28952
+ return [2 /*return*/];
29290
28953
  }
29291
28954
  });
29292
28955
  });
@@ -29298,14 +28961,12 @@ function () {
29298
28961
  logger.debug(errorString);
29299
28962
  throw new Error(errorString);
29300
28963
  }
29301
-
29302
28964
  if (!this._config.maps["default"]) {
29303
28965
  var errorString = "No default map resource found in amplify config, run 'amplify add geo' to create one and run `amplify push` after";
29304
28966
  logger.debug(errorString);
29305
28967
  throw new Error(errorString);
29306
28968
  }
29307
28969
  };
29308
-
29309
28970
  AmazonLocationServiceProvider.prototype._verifySearchIndex = function (optionalSearchIndex) {
29310
28971
  if ((!this._config.search_indices || !this._config.search_indices["default"]) && !optionalSearchIndex) {
29311
28972
  var errorString = 'No Search Index found in amplify config, please run `amplify add geo` to create one and run `amplify push` after.';
@@ -29313,7 +28974,6 @@ function () {
29313
28974
  throw new Error(errorString);
29314
28975
  }
29315
28976
  };
29316
-
29317
28977
  AmazonLocationServiceProvider.prototype._verifyGeofenceCollections = function (optionalGeofenceCollectionName) {
29318
28978
  if ((!this._config.geofenceCollections || !this._config.geofenceCollections["default"]) && !optionalGeofenceCollectionName) {
29319
28979
  var errorString = 'No Geofence Collections found, please run `amplify add geo` to create one and run `amplify push` after.';
@@ -29321,7 +28981,6 @@ function () {
29321
28981
  throw new Error(errorString);
29322
28982
  }
29323
28983
  };
29324
-
29325
28984
  AmazonLocationServiceProvider.prototype._AmazonLocationServiceBatchPutGeofenceCall = function (PascalGeofences, collectionName) {
29326
28985
  return __awaiter(this, void 0, void 0, function () {
29327
28986
  var geofenceInput, client, command, response, error_10;
@@ -29339,33 +28998,21 @@ function () {
29339
28998
  });
29340
28999
  command = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["BatchPutGeofenceCommand"](geofenceInput);
29341
29000
  _a.label = 1;
29342
-
29343
29001
  case 1:
29344
29002
  _a.trys.push([1, 3,, 4]);
29345
-
29346
- return [4
29347
- /*yield*/
29348
- , client.send(command)];
29349
-
29003
+ return [4 /*yield*/, client.send(command)];
29350
29004
  case 2:
29351
29005
  response = _a.sent();
29352
- return [3
29353
- /*break*/
29354
- , 4];
29355
-
29006
+ return [3 /*break*/, 4];
29356
29007
  case 3:
29357
29008
  error_10 = _a.sent();
29358
29009
  throw error_10;
29359
-
29360
29010
  case 4:
29361
- return [2
29362
- /*return*/
29363
- , response];
29011
+ return [2 /*return*/, response];
29364
29012
  }
29365
29013
  });
29366
29014
  });
29367
29015
  };
29368
-
29369
29016
  AmazonLocationServiceProvider.prototype._AmazonLocationServiceBatchDeleteGeofenceCall = function (geofenceIds, collectionName) {
29370
29017
  return __awaiter(this, void 0, void 0, function () {
29371
29018
  var deleteGeofencesInput, client, command, response, error_11;
@@ -29383,40 +29030,27 @@ function () {
29383
29030
  });
29384
29031
  command = new _aws_sdk_client_location__WEBPACK_IMPORTED_MODULE_2__["BatchDeleteGeofenceCommand"](deleteGeofencesInput);
29385
29032
  _a.label = 1;
29386
-
29387
29033
  case 1:
29388
29034
  _a.trys.push([1, 3,, 4]);
29389
-
29390
- return [4
29391
- /*yield*/
29392
- , client.send(command)];
29393
-
29035
+ return [4 /*yield*/, client.send(command)];
29394
29036
  case 2:
29395
29037
  response = _a.sent();
29396
- return [3
29397
- /*break*/
29398
- , 4];
29399
-
29038
+ return [3 /*break*/, 4];
29400
29039
  case 3:
29401
29040
  error_11 = _a.sent();
29402
29041
  throw error_11;
29403
-
29404
29042
  case 4:
29405
- return [2
29406
- /*return*/
29407
- , response];
29043
+ return [2 /*return*/, response];
29408
29044
  }
29409
29045
  });
29410
29046
  });
29411
29047
  };
29412
-
29413
29048
  AmazonLocationServiceProvider.CATEGORY = 'Geo';
29414
29049
  AmazonLocationServiceProvider.PROVIDER_NAME = 'AmazonLocationService';
29415
29050
  return AmazonLocationServiceProvider;
29416
29051
  }();
29417
29052
 
29418
29053
 
29419
-
29420
29054
  /***/ }),
29421
29055
 
29422
29056
  /***/ "./lib-esm/index.js":
@@ -29455,26 +29089,21 @@ var __assign = undefined && undefined.__assign || function () {
29455
29089
  __assign = Object.assign || function (t) {
29456
29090
  for (var s, i = 1, n = arguments.length; i < n; i++) {
29457
29091
  s = arguments[i];
29458
-
29459
29092
  for (var p in s) {
29460
29093
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
29461
29094
  }
29462
29095
  }
29463
-
29464
29096
  return t;
29465
29097
  };
29466
-
29467
29098
  return __assign.apply(this, arguments);
29468
29099
  };
29469
-
29470
29100
  var __read = undefined && undefined.__read || function (o, n) {
29471
29101
  var m = typeof Symbol === "function" && o[Symbol.iterator];
29472
29102
  if (!m) return o;
29473
29103
  var i = m.call(o),
29474
- r,
29475
- ar = [],
29476
- e;
29477
-
29104
+ r,
29105
+ ar = [],
29106
+ e;
29478
29107
  try {
29479
29108
  while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
29480
29109
  ar.push(r.value);
@@ -29490,7 +29119,6 @@ var __read = undefined && undefined.__read || function (o, n) {
29490
29119
  if (e) throw e.error;
29491
29120
  }
29492
29121
  }
29493
-
29494
29122
  return ar;
29495
29123
  };
29496
29124
  /*
@@ -29506,13 +29134,10 @@ var __read = undefined && undefined.__read || function (o, n) {
29506
29134
  * and limitations under the License.
29507
29135
  */
29508
29136
 
29509
-
29510
-
29511
29137
  function validateCoordinates(lng, lat) {
29512
29138
  if (!Number.isFinite(lng) || !Number.isFinite(lat)) {
29513
29139
  throw new Error("Invalid coordinates: [" + lng + "," + lat + "]");
29514
29140
  }
29515
-
29516
29141
  if (lat < -90 || 90 < lat) {
29517
29142
  throw new Error('Latitude must be between -90 and 90 degrees inclusive.');
29518
29143
  } else if (lng < -180 || 180 < lng) {
@@ -29520,20 +29145,19 @@ function validateCoordinates(lng, lat) {
29520
29145
  }
29521
29146
  }
29522
29147
  function validateGeofenceId(geofenceId) {
29523
- var geofenceIdRegex = /^(?:[\x2D\.0-9A-Z_a-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDF50-\uDF59\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDCD0-\uDCEB\uDCF0-\uDCF9\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])+$/i; // Check if geofenceId is valid
29524
-
29148
+ var geofenceIdRegex = /^(?:[\x2D\.0-9A-Z_a-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDF50-\uDF59\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDCD0-\uDCEB\uDCF0-\uDCF9\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])+$/i;
29149
+ // Check if geofenceId is valid
29525
29150
  if (!geofenceIdRegex.test(geofenceId)) {
29526
29151
  throw new Error("Invalid geofenceId: '" + geofenceId + "' - IDs can only contain alphanumeric characters, hyphens, underscores and periods.");
29527
29152
  }
29528
29153
  }
29529
29154
  function validateLinearRing(linearRing, geofenceId) {
29530
- var errorPrefix = geofenceId ? geofenceId + ": " : ''; // Validate LinearRing size, must be at least 4 points
29531
-
29155
+ var errorPrefix = geofenceId ? geofenceId + ": " : '';
29156
+ // Validate LinearRing size, must be at least 4 points
29532
29157
  if (linearRing.length < 4) {
29533
29158
  throw new Error(errorPrefix + "LinearRing must contain 4 or more coordinates.");
29534
- } // Validate all coordinates are valid, error with which ones are bad
29535
-
29536
-
29159
+ }
29160
+ // Validate all coordinates are valid, error with which ones are bad
29537
29161
  var badCoordinates = [];
29538
29162
  linearRing.forEach(function (coordinates) {
29539
29163
  try {
@@ -29545,51 +29169,40 @@ function validateLinearRing(linearRing, geofenceId) {
29545
29169
  });
29546
29170
  }
29547
29171
  });
29548
-
29549
29172
  if (badCoordinates.length > 0) {
29550
29173
  throw new Error(errorPrefix + "One or more of the coordinates in the Polygon LinearRing are not valid: " + JSON.stringify(badCoordinates));
29551
- } // Validate first and last coordinates are the same
29552
-
29553
-
29174
+ }
29175
+ // Validate first and last coordinates are the same
29554
29176
  var _a = __read(linearRing[0], 2),
29555
- lngA = _a[0],
29556
- latA = _a[1];
29557
-
29177
+ lngA = _a[0],
29178
+ latA = _a[1];
29558
29179
  var _b = __read(linearRing[linearRing.length - 1], 2),
29559
- lngB = _b[0],
29560
- latB = _b[1];
29561
-
29180
+ lngB = _b[0],
29181
+ latB = _b[1];
29562
29182
  if (lngA !== lngB || latA !== latB) {
29563
29183
  throw new Error(errorPrefix + "LinearRing's first and last coordinates are not the same");
29564
29184
  }
29565
-
29566
29185
  if (Object(_turf_boolean_clockwise__WEBPACK_IMPORTED_MODULE_0__["default"])(linearRing)) {
29567
29186
  throw new Error(errorPrefix + "LinearRing coordinates must be wound counterclockwise");
29568
29187
  }
29569
29188
  }
29570
29189
  function validatePolygon(polygon, geofenceId) {
29571
29190
  var errorPrefix = geofenceId ? geofenceId + ": " : '';
29572
-
29573
29191
  if (!Array.isArray(polygon)) {
29574
29192
  throw new Error(errorPrefix + "Polygon is of incorrect structure. It should be an array of LinearRings");
29575
29193
  }
29576
-
29577
29194
  if (polygon.length < 1) {
29578
29195
  throw new Error(errorPrefix + "Polygon must have a single LinearRing array.");
29579
29196
  }
29580
-
29581
29197
  if (polygon.length > 1) {
29582
29198
  throw new Error(errorPrefix + "Polygon must have a single LinearRing array. Note: We do not currently support polygons with holes, multipolygons, polygons that are wound clockwise, or that cross the antimeridian.");
29583
29199
  }
29584
-
29585
29200
  var verticesCount = polygon.reduce(function (prev, linearRing) {
29586
29201
  return prev + linearRing.length;
29587
29202
  }, 0);
29588
-
29589
29203
  if (verticesCount > 1000) {
29590
29204
  throw new Error(errorPrefix + "Polygon has more than the maximum 1000 vertices.");
29591
29205
  }
29592
-
29593
29206
  polygon.forEach(function (linearRing) {
29594
29207
  validateLinearRing(linearRing, geofenceId);
29595
29208
  });
@@ -29602,66 +29215,54 @@ function validateGeofencesInput(geofences) {
29602
29215
  if (!geofence.geofenceId) {
29603
29216
  throw new Error("Geofence '" + geofence + "' is missing geofenceId");
29604
29217
  }
29605
-
29606
29218
  var geofenceId = geofence.geofenceId;
29607
- validateGeofenceId(geofenceId); // Validate geofenceId is unique
29608
-
29219
+ validateGeofenceId(geofenceId);
29220
+ // Validate geofenceId is unique
29609
29221
  if (geofenceIds[geofenceId]) {
29610
29222
  throw new Error("Duplicate geofenceId: " + geofenceId);
29611
29223
  } else {
29612
29224
  geofenceIds[geofenceId] = true;
29613
- } // Validate geometry exists
29614
-
29615
-
29225
+ }
29226
+ // Validate geometry exists
29616
29227
  if (!geofence.geometry) {
29617
29228
  throw new Error("Geofence '" + geofenceId + "' is missing geometry");
29618
29229
  }
29619
-
29620
- var geometry = geofence.geometry; // Validate polygon exists
29621
-
29230
+ var geometry = geofence.geometry;
29231
+ // Validate polygon exists
29622
29232
  if (!geometry.polygon) {
29623
29233
  throw new Error("Geofence '" + geofenceId + "' is missing geometry.polygon");
29624
29234
  }
29625
-
29626
- var polygon = geometry.polygon; // Validate polygon length and structure
29627
-
29235
+ var polygon = geometry.polygon;
29236
+ // Validate polygon length and structure
29628
29237
  try {
29629
29238
  validatePolygon(polygon, geofenceId);
29630
29239
  } catch (error) {
29631
29240
  if (error.message.includes('Polygon has more than the maximum 1000 vertices.')) {
29632
29241
  throw new Error("Geofence '" + geofenceId + "' has more than the maximum of 1000 vertices");
29633
29242
  }
29634
- } // Validate LinearRing length, structure, and coordinates
29635
-
29636
-
29243
+ }
29244
+ // Validate LinearRing length, structure, and coordinates
29637
29245
  var _a = __read(polygon, 1),
29638
- linearRing = _a[0];
29639
-
29246
+ linearRing = _a[0];
29640
29247
  validateLinearRing(linearRing, geofenceId);
29641
29248
  });
29642
29249
  }
29643
29250
  function mapSearchOptions(options, locationServiceInput) {
29644
29251
  var locationServiceModifiedInput = __assign({}, locationServiceInput);
29645
-
29646
29252
  locationServiceModifiedInput.FilterCountries = options.countries;
29647
29253
  locationServiceModifiedInput.MaxResults = options.maxResults;
29648
-
29649
29254
  if (options.searchIndexName) {
29650
29255
  locationServiceModifiedInput.IndexName = options.searchIndexName;
29651
29256
  }
29652
-
29653
29257
  if (options['biasPosition'] && options['searchAreaConstraints']) {
29654
29258
  throw new Error('BiasPosition and SearchAreaConstraints are mutually exclusive, please remove one or the other from the options object');
29655
29259
  }
29656
-
29657
29260
  if (options['biasPosition']) {
29658
29261
  locationServiceModifiedInput.BiasPosition = options['biasPosition'];
29659
29262
  }
29660
-
29661
29263
  if (options['searchAreaConstraints']) {
29662
29264
  locationServiceModifiedInput.FilterBBox = options['searchAreaConstraints'];
29663
29265
  }
29664
-
29665
29266
  return locationServiceModifiedInput;
29666
29267
  }
29667
29268