@opengeoweb/form-fields 9.20.2 → 9.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1118,176 +1118,12 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
1118
1118
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
1119
1119
  };
1120
1120
 
1121
- var wellKnownSymbol$9 = wellKnownSymbol$b;
1122
-
1123
- var TO_STRING_TAG$2 = wellKnownSymbol$9('toStringTag');
1124
- var test = {};
1125
-
1126
- test[TO_STRING_TAG$2] = 'z';
1127
-
1128
- var toStringTagSupport = String(test) === '[object z]';
1129
-
1130
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1131
- var isCallable$5 = isCallable$g;
1132
- var classofRaw = classofRaw$1;
1133
- var wellKnownSymbol$8 = wellKnownSymbol$b;
1134
-
1135
- var TO_STRING_TAG$1 = wellKnownSymbol$8('toStringTag');
1136
- var $Object$1 = Object;
1137
-
1138
- // ES3 wrong here
1139
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
1140
-
1141
- // fallback for IE11 Script Access Denied error
1142
- var tryGet = function (it, key) {
1143
- try {
1144
- return it[key];
1145
- } catch (error) { /* empty */ }
1146
- };
1147
-
1148
- // getting tag from ES6+ `Object.prototype.toString`
1149
- var classof$4 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1150
- var O, tag, result;
1151
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1152
- // @@toStringTag case
1153
- : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
1154
- // builtinTag case
1155
- : CORRECT_ARGUMENTS ? classofRaw(O)
1156
- // ES3 arguments fallback
1157
- : (result = classofRaw(O)) === 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
1158
- };
1159
-
1160
- var classof$3 = classof$4;
1161
-
1162
- var $String$1 = String;
1163
-
1164
- var toString$8 = function (argument) {
1165
- if (classof$3(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1166
- return $String$1(argument);
1167
- };
1168
-
1169
- // a string of all valid unicode whitespaces
1170
- var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1171
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1172
-
1173
- var uncurryThis$6 = functionUncurryThis;
1174
- var requireObjectCoercible$4 = requireObjectCoercible$7;
1175
- var toString$7 = toString$8;
1176
- var whitespaces$3 = whitespaces$4;
1177
-
1178
- var replace$1 = uncurryThis$6(''.replace);
1179
- var ltrim = RegExp('^[' + whitespaces$3 + ']+');
1180
- var rtrim = RegExp('(^|[^' + whitespaces$3 + '])[' + whitespaces$3 + ']+$');
1181
-
1182
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1183
- var createMethod$2 = function (TYPE) {
1184
- return function ($this) {
1185
- var string = toString$7(requireObjectCoercible$4($this));
1186
- if (TYPE & 1) string = replace$1(string, ltrim, '');
1187
- if (TYPE & 2) string = replace$1(string, rtrim, '$1');
1188
- return string;
1189
- };
1190
- };
1191
-
1192
- var stringTrim = {
1193
- // `String.prototype.{ trimLeft, trimStart }` methods
1194
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1195
- start: createMethod$2(1),
1196
- // `String.prototype.{ trimRight, trimEnd }` methods
1197
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
1198
- end: createMethod$2(2),
1199
- // `String.prototype.trim` method
1200
- // https://tc39.es/ecma262/#sec-string.prototype.trim
1201
- trim: createMethod$2(3)
1202
- };
1203
-
1204
- var global$7 = global$h;
1205
- var fails$b = fails$l;
1206
- var uncurryThis$5 = functionUncurryThis;
1207
- var toString$6 = toString$8;
1208
- var trim$1 = stringTrim.trim;
1209
- var whitespaces$2 = whitespaces$4;
1210
-
1211
- var charAt$3 = uncurryThis$5(''.charAt);
1212
- var $parseFloat$1 = global$7.parseFloat;
1213
- var Symbol$2 = global$7.Symbol;
1214
- var ITERATOR$4 = Symbol$2 && Symbol$2.iterator;
1215
- var FORCED$2 = 1 / $parseFloat$1(whitespaces$2 + '-0') !== -Infinity
1216
- // MS Edge 18- broken with boxed symbols
1217
- || (ITERATOR$4 && !fails$b(function () { $parseFloat$1(Object(ITERATOR$4)); }));
1218
-
1219
- // `parseFloat` method
1220
- // https://tc39.es/ecma262/#sec-parsefloat-string
1221
- var numberParseFloat = FORCED$2 ? function parseFloat(string) {
1222
- var trimmedString = trim$1(toString$6(string));
1223
- var result = $parseFloat$1(trimmedString);
1224
- return result === 0 && charAt$3(trimmedString, 0) === '-' ? -0 : result;
1225
- } : $parseFloat$1;
1226
-
1227
- var $$8 = _export;
1228
- var $parseFloat = numberParseFloat;
1229
-
1230
- // `parseFloat` method
1231
- // https://tc39.es/ecma262/#sec-parsefloat-string
1232
- $$8({ global: true, forced: parseFloat !== $parseFloat }, {
1233
- parseFloat: $parseFloat
1234
- });
1235
-
1236
- var anObject$6 = anObject$9;
1237
-
1238
- // `RegExp.prototype.flags` getter implementation
1239
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1240
- var regexpFlags$1 = function () {
1241
- var that = anObject$6(this);
1242
- var result = '';
1243
- if (that.hasIndices) result += 'd';
1244
- if (that.global) result += 'g';
1245
- if (that.ignoreCase) result += 'i';
1246
- if (that.multiline) result += 'm';
1247
- if (that.dotAll) result += 's';
1248
- if (that.unicode) result += 'u';
1249
- if (that.unicodeSets) result += 'v';
1250
- if (that.sticky) result += 'y';
1251
- return result;
1252
- };
1253
-
1254
- var fails$a = fails$l;
1255
- var global$6 = global$h;
1256
-
1257
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1258
- var $RegExp$2 = global$6.RegExp;
1259
-
1260
- var UNSUPPORTED_Y$1 = fails$a(function () {
1261
- var re = $RegExp$2('a', 'y');
1262
- re.lastIndex = 2;
1263
- return re.exec('abcd') !== null;
1264
- });
1265
-
1266
- // UC Browser bug
1267
- // https://github.com/zloirock/core-js/issues/1008
1268
- var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$a(function () {
1269
- return !$RegExp$2('a', 'y').sticky;
1270
- });
1271
-
1272
- var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$a(function () {
1273
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1274
- var re = $RegExp$2('^r', 'gy');
1275
- re.lastIndex = 2;
1276
- return re.exec('str') !== null;
1277
- });
1278
-
1279
- var regexpStickyHelpers = {
1280
- BROKEN_CARET: BROKEN_CARET,
1281
- MISSED_STICKY: MISSED_STICKY,
1282
- UNSUPPORTED_Y: UNSUPPORTED_Y$1
1283
- };
1284
-
1285
1121
  var objectDefineProperties = {};
1286
1122
 
1287
1123
  var DESCRIPTORS$1 = descriptors;
1288
1124
  var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1289
1125
  var definePropertyModule = objectDefineProperty;
1290
- var anObject$5 = anObject$9;
1126
+ var anObject$6 = anObject$9;
1291
1127
  var toIndexedObject$1 = toIndexedObject$5;
1292
1128
  var objectKeys = objectKeys$2;
1293
1129
 
@@ -1295,7 +1131,7 @@ var objectKeys = objectKeys$2;
1295
1131
  // https://tc39.es/ecma262/#sec-object.defineproperties
1296
1132
  // eslint-disable-next-line es/no-object-defineproperties -- safe
1297
1133
  objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1298
- anObject$5(O);
1134
+ anObject$6(O);
1299
1135
  var props = toIndexedObject$1(Properties);
1300
1136
  var keys = objectKeys(Properties);
1301
1137
  var length = keys.length;
@@ -1310,7 +1146,7 @@ var getBuiltIn = getBuiltIn$3;
1310
1146
  var html$1 = getBuiltIn('document', 'documentElement');
1311
1147
 
1312
1148
  /* global ActiveXObject -- old IE, WSH */
1313
- var anObject$4 = anObject$9;
1149
+ var anObject$5 = anObject$9;
1314
1150
  var definePropertiesModule = objectDefineProperties;
1315
1151
  var enumBugKeys = enumBugKeys$3;
1316
1152
  var hiddenKeys = hiddenKeys$4;
@@ -1384,7 +1220,7 @@ hiddenKeys[IE_PROTO$1] = true;
1384
1220
  var objectCreate = Object.create || function create(O, Properties) {
1385
1221
  var result;
1386
1222
  if (O !== null) {
1387
- EmptyConstructor[PROTOTYPE] = anObject$4(O);
1223
+ EmptyConstructor[PROTOTYPE] = anObject$5(O);
1388
1224
  result = new EmptyConstructor();
1389
1225
  EmptyConstructor[PROTOTYPE] = null;
1390
1226
  // add "__proto__" for Object.getPrototypeOf polyfill
@@ -1393,1190 +1229,1459 @@ var objectCreate = Object.create || function create(O, Properties) {
1393
1229
  return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1394
1230
  };
1395
1231
 
1396
- var fails$9 = fails$l;
1397
- var global$5 = global$h;
1232
+ var wellKnownSymbol$9 = wellKnownSymbol$b;
1233
+ var create$2 = objectCreate;
1234
+ var defineProperty$2 = objectDefineProperty.f;
1398
1235
 
1399
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1400
- var $RegExp$1 = global$5.RegExp;
1236
+ var UNSCOPABLES = wellKnownSymbol$9('unscopables');
1237
+ var ArrayPrototype = Array.prototype;
1401
1238
 
1402
- var regexpUnsupportedDotAll = fails$9(function () {
1403
- var re = $RegExp$1('.', 's');
1404
- return !(re.dotAll && re.test('\n') && re.flags === 's');
1405
- });
1239
+ // Array.prototype[@@unscopables]
1240
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1241
+ if (ArrayPrototype[UNSCOPABLES] === undefined) {
1242
+ defineProperty$2(ArrayPrototype, UNSCOPABLES, {
1243
+ configurable: true,
1244
+ value: create$2(null)
1245
+ });
1246
+ }
1406
1247
 
1407
- var fails$8 = fails$l;
1408
- var global$4 = global$h;
1248
+ // add a key to Array.prototype[@@unscopables]
1249
+ var addToUnscopables$2 = function (key) {
1250
+ ArrayPrototype[UNSCOPABLES][key] = true;
1251
+ };
1409
1252
 
1410
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1411
- var $RegExp = global$4.RegExp;
1253
+ var iterators = {};
1412
1254
 
1413
- var regexpUnsupportedNcg = fails$8(function () {
1414
- var re = $RegExp('(?<a>b)', 'g');
1415
- return re.exec('b').groups.a !== 'b' ||
1416
- 'b'.replace(re, '$<a>c') !== 'bc';
1417
- });
1255
+ var fails$b = fails$l;
1418
1256
 
1419
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1420
- /* eslint-disable regexp/no-useless-quantifier -- testing */
1421
- var call$6 = functionCall;
1422
- var uncurryThis$4 = functionUncurryThis;
1423
- var toString$5 = toString$8;
1424
- var regexpFlags = regexpFlags$1;
1425
- var stickyHelpers = regexpStickyHelpers;
1426
- var shared = shared$4;
1427
- var create$2 = objectCreate;
1428
- var getInternalState$1 = internalState.get;
1429
- var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
1430
- var UNSUPPORTED_NCG = regexpUnsupportedNcg;
1257
+ var correctPrototypeGetter = !fails$b(function () {
1258
+ function F() { /* empty */ }
1259
+ F.prototype.constructor = null;
1260
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1261
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1262
+ });
1431
1263
 
1432
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
1433
- var nativeExec = RegExp.prototype.exec;
1434
- var patchedExec = nativeExec;
1435
- var charAt$2 = uncurryThis$4(''.charAt);
1436
- var indexOf = uncurryThis$4(''.indexOf);
1437
- var replace = uncurryThis$4(''.replace);
1438
- var stringSlice$1 = uncurryThis$4(''.slice);
1264
+ var hasOwn$2 = hasOwnProperty_1;
1265
+ var isCallable$5 = isCallable$g;
1266
+ var toObject$1 = toObject$4;
1267
+ var sharedKey = sharedKey$3;
1268
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1439
1269
 
1440
- var UPDATES_LAST_INDEX_WRONG = (function () {
1441
- var re1 = /a/;
1442
- var re2 = /b*/g;
1443
- call$6(nativeExec, re1, 'a');
1444
- call$6(nativeExec, re2, 'a');
1445
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1446
- })();
1270
+ var IE_PROTO = sharedKey('IE_PROTO');
1271
+ var $Object$1 = Object;
1272
+ var ObjectPrototype = $Object$1.prototype;
1447
1273
 
1448
- var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
1274
+ // `Object.getPrototypeOf` method
1275
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1276
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
1277
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1278
+ var object = toObject$1(O);
1279
+ if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1280
+ var constructor = object.constructor;
1281
+ if (isCallable$5(constructor) && object instanceof constructor) {
1282
+ return constructor.prototype;
1283
+ } return object instanceof $Object$1 ? ObjectPrototype : null;
1284
+ };
1449
1285
 
1450
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
1451
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1286
+ var fails$a = fails$l;
1287
+ var isCallable$4 = isCallable$g;
1288
+ var isObject$3 = isObject$9;
1289
+ var getPrototypeOf$1 = objectGetPrototypeOf;
1290
+ var defineBuiltIn$3 = defineBuiltIn$5;
1291
+ var wellKnownSymbol$8 = wellKnownSymbol$b;
1452
1292
 
1453
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
1293
+ var ITERATOR$4 = wellKnownSymbol$8('iterator');
1294
+ var BUGGY_SAFARI_ITERATORS$1 = false;
1454
1295
 
1455
- if (PATCH) {
1456
- patchedExec = function exec(string) {
1457
- var re = this;
1458
- var state = getInternalState$1(re);
1459
- var str = toString$5(string);
1460
- var raw = state.raw;
1461
- var result, reCopy, lastIndex, match, i, object, group;
1296
+ // `%IteratorPrototype%` object
1297
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1298
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1462
1299
 
1463
- if (raw) {
1464
- raw.lastIndex = re.lastIndex;
1465
- result = call$6(patchedExec, raw, str);
1466
- re.lastIndex = raw.lastIndex;
1467
- return result;
1468
- }
1300
+ /* eslint-disable es/no-array-prototype-keys -- safe */
1301
+ if ([].keys) {
1302
+ arrayIterator = [].keys();
1303
+ // Safari 8 has buggy iterators w/o `next`
1304
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1305
+ else {
1306
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1307
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1308
+ }
1309
+ }
1469
1310
 
1470
- var groups = state.groups;
1471
- var sticky = UNSUPPORTED_Y && re.sticky;
1472
- var flags = call$6(regexpFlags, re);
1473
- var source = re.source;
1474
- var charsAdded = 0;
1475
- var strCopy = str;
1476
-
1477
- if (sticky) {
1478
- flags = replace(flags, 'y', '');
1479
- if (indexOf(flags, 'g') === -1) {
1480
- flags += 'g';
1481
- }
1482
-
1483
- strCopy = stringSlice$1(str, re.lastIndex);
1484
- // Support anchored sticky behavior.
1485
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$2(str, re.lastIndex - 1) !== '\n')) {
1486
- source = '(?: ' + source + ')';
1487
- strCopy = ' ' + strCopy;
1488
- charsAdded++;
1489
- }
1490
- // ^(? + rx + ) is needed, in combination with some str slicing, to
1491
- // simulate the 'y' flag.
1492
- reCopy = new RegExp('^(?:' + source + ')', flags);
1493
- }
1311
+ var NEW_ITERATOR_PROTOTYPE = !isObject$3(IteratorPrototype$2) || fails$a(function () {
1312
+ var test = {};
1313
+ // FF44- legacy iterators case
1314
+ return IteratorPrototype$2[ITERATOR$4].call(test) !== test;
1315
+ });
1494
1316
 
1495
- if (NPCG_INCLUDED) {
1496
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1497
- }
1498
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1317
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1499
1318
 
1500
- match = call$6(nativeExec, sticky ? reCopy : re, strCopy);
1319
+ // `%IteratorPrototype%[@@iterator]()` method
1320
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1321
+ if (!isCallable$4(IteratorPrototype$2[ITERATOR$4])) {
1322
+ defineBuiltIn$3(IteratorPrototype$2, ITERATOR$4, function () {
1323
+ return this;
1324
+ });
1325
+ }
1501
1326
 
1502
- if (sticky) {
1503
- if (match) {
1504
- match.input = stringSlice$1(match.input, charsAdded);
1505
- match[0] = stringSlice$1(match[0], charsAdded);
1506
- match.index = re.lastIndex;
1507
- re.lastIndex += match[0].length;
1508
- } else re.lastIndex = 0;
1509
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
1510
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1511
- }
1512
- if (NPCG_INCLUDED && match && match.length > 1) {
1513
- // Fix browsers whose `exec` methods don't consistently return `undefined`
1514
- // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
1515
- call$6(nativeReplace, match[0], reCopy, function () {
1516
- for (i = 1; i < arguments.length - 2; i++) {
1517
- if (arguments[i] === undefined) match[i] = undefined;
1518
- }
1519
- });
1520
- }
1327
+ var iteratorsCore = {
1328
+ IteratorPrototype: IteratorPrototype$2,
1329
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1330
+ };
1521
1331
 
1522
- if (match && groups) {
1523
- match.groups = object = create$2(null);
1524
- for (i = 0; i < groups.length; i++) {
1525
- group = groups[i];
1526
- object[group[0]] = match[group[1]];
1527
- }
1528
- }
1332
+ var defineProperty$1 = objectDefineProperty.f;
1333
+ var hasOwn$1 = hasOwnProperty_1;
1334
+ var wellKnownSymbol$7 = wellKnownSymbol$b;
1529
1335
 
1530
- return match;
1531
- };
1532
- }
1336
+ var TO_STRING_TAG$2 = wellKnownSymbol$7('toStringTag');
1533
1337
 
1534
- var regexpExec$2 = patchedExec;
1338
+ var setToStringTag$3 = function (target, TAG, STATIC) {
1339
+ if (target && !STATIC) target = target.prototype;
1340
+ if (target && !hasOwn$1(target, TO_STRING_TAG$2)) {
1341
+ defineProperty$1(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
1342
+ }
1343
+ };
1535
1344
 
1536
- var $$7 = _export;
1537
- var exec$1 = regexpExec$2;
1345
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1346
+ var create$1 = objectCreate;
1347
+ var createPropertyDescriptor = createPropertyDescriptor$3;
1348
+ var setToStringTag$2 = setToStringTag$3;
1349
+ var Iterators$2 = iterators;
1538
1350
 
1539
- // `RegExp.prototype.exec` method
1540
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1541
- $$7({ target: 'RegExp', proto: true, forced: /./.exec !== exec$1 }, {
1542
- exec: exec$1
1543
- });
1351
+ var returnThis$1 = function () { return this; };
1544
1352
 
1545
- // TODO: Remove from `core-js@4` since it's moved to entry points
1353
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1354
+ var TO_STRING_TAG = NAME + ' Iterator';
1355
+ IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1356
+ setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
1357
+ Iterators$2[TO_STRING_TAG] = returnThis$1;
1358
+ return IteratorConstructor;
1359
+ };
1546
1360
 
1547
- var $$6 = _export;
1548
- var call$5 = functionCall;
1549
- var isCallable$4 = isCallable$g;
1550
- var anObject$3 = anObject$9;
1551
- var toString$4 = toString$8;
1361
+ var uncurryThis$6 = functionUncurryThis;
1362
+ var aCallable$1 = aCallable$3;
1552
1363
 
1553
- var DELEGATES_TO_EXEC = function () {
1554
- var execCalled = false;
1555
- var re = /[ac]/;
1556
- re.exec = function () {
1557
- execCalled = true;
1558
- return /./.exec.apply(this, arguments);
1559
- };
1560
- return re.test('abc') === true && execCalled;
1561
- }();
1364
+ var functionUncurryThisAccessor = function (object, key, method) {
1365
+ try {
1366
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1367
+ return uncurryThis$6(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
1368
+ } catch (error) { /* empty */ }
1369
+ };
1562
1370
 
1563
- var nativeTest = /./.test;
1371
+ var isObject$2 = isObject$9;
1564
1372
 
1565
- // `RegExp.prototype.test` method
1566
- // https://tc39.es/ecma262/#sec-regexp.prototype.test
1567
- $$6({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {
1568
- test: function (S) {
1569
- var R = anObject$3(this);
1570
- var string = toString$4(S);
1571
- var exec = R.exec;
1572
- if (!isCallable$4(exec)) return call$5(nativeTest, R, string);
1573
- var result = call$5(exec, R, string);
1574
- if (result === null) return false;
1575
- anObject$3(result);
1576
- return true;
1577
- }
1578
- });
1373
+ var isPossiblePrototype$1 = function (argument) {
1374
+ return isObject$2(argument) || argument === null;
1375
+ };
1579
1376
 
1580
- var call$4 = functionCall;
1581
- var hasOwn$2 = hasOwnProperty_1;
1582
- var isPrototypeOf = objectIsPrototypeOf;
1583
- var regExpFlags = regexpFlags$1;
1377
+ var isPossiblePrototype = isPossiblePrototype$1;
1584
1378
 
1585
- var RegExpPrototype$2 = RegExp.prototype;
1379
+ var $String$1 = String;
1380
+ var $TypeError$3 = TypeError;
1586
1381
 
1587
- var regexpGetFlags = function (R) {
1588
- var flags = R.flags;
1589
- return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwn$2(R, 'flags') && isPrototypeOf(RegExpPrototype$2, R)
1590
- ? call$4(regExpFlags, R) : flags;
1382
+ var aPossiblePrototype$1 = function (argument) {
1383
+ if (isPossiblePrototype(argument)) return argument;
1384
+ throw new $TypeError$3("Can't set " + $String$1(argument) + ' as a prototype');
1591
1385
  };
1592
1386
 
1593
- var PROPER_FUNCTION_NAME$2 = functionName.PROPER;
1594
- var defineBuiltIn$3 = defineBuiltIn$5;
1595
- var anObject$2 = anObject$9;
1596
- var $toString = toString$8;
1597
- var fails$7 = fails$l;
1598
- var getRegExpFlags = regexpGetFlags;
1387
+ /* eslint-disable no-proto -- safe */
1388
+ var uncurryThisAccessor = functionUncurryThisAccessor;
1389
+ var isObject$1 = isObject$9;
1390
+ var requireObjectCoercible$4 = requireObjectCoercible$7;
1391
+ var aPossiblePrototype = aPossiblePrototype$1;
1599
1392
 
1600
- var TO_STRING = 'toString';
1601
- var RegExpPrototype$1 = RegExp.prototype;
1602
- var nativeToString = RegExpPrototype$1[TO_STRING];
1393
+ // `Object.setPrototypeOf` method
1394
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1395
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1396
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
1397
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1398
+ var CORRECT_SETTER = false;
1399
+ var test = {};
1400
+ var setter;
1401
+ try {
1402
+ setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
1403
+ setter(test, []);
1404
+ CORRECT_SETTER = test instanceof Array;
1405
+ } catch (error) { /* empty */ }
1406
+ return function setPrototypeOf(O, proto) {
1407
+ requireObjectCoercible$4(O);
1408
+ aPossiblePrototype(proto);
1409
+ if (!isObject$1(O)) return O;
1410
+ if (CORRECT_SETTER) setter(O, proto);
1411
+ else O.__proto__ = proto;
1412
+ return O;
1413
+ };
1414
+ }() : undefined);
1603
1415
 
1604
- var NOT_GENERIC = fails$7(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
1605
- // FF44- RegExp#toString has a wrong name
1606
- var INCORRECT_NAME = PROPER_FUNCTION_NAME$2 && nativeToString.name !== TO_STRING;
1416
+ var $$8 = _export;
1417
+ var call$6 = functionCall;
1418
+ var FunctionName = functionName;
1419
+ var isCallable$3 = isCallable$g;
1420
+ var createIteratorConstructor = iteratorCreateConstructor;
1421
+ var getPrototypeOf = objectGetPrototypeOf;
1422
+ var setPrototypeOf = objectSetPrototypeOf;
1423
+ var setToStringTag$1 = setToStringTag$3;
1424
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
1425
+ var defineBuiltIn$2 = defineBuiltIn$5;
1426
+ var wellKnownSymbol$6 = wellKnownSymbol$b;
1427
+ var Iterators$1 = iterators;
1428
+ var IteratorsCore = iteratorsCore;
1607
1429
 
1608
- // `RegExp.prototype.toString` method
1609
- // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
1610
- if (NOT_GENERIC || INCORRECT_NAME) {
1611
- defineBuiltIn$3(RegExpPrototype$1, TO_STRING, function toString() {
1612
- var R = anObject$2(this);
1613
- var pattern = $toString(R.source);
1614
- var flags = $toString(getRegExpFlags(R));
1615
- return '/' + pattern + '/' + flags;
1616
- }, { unsafe: true });
1617
- }
1430
+ var PROPER_FUNCTION_NAME$2 = FunctionName.PROPER;
1431
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1432
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
1433
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1434
+ var ITERATOR$3 = wellKnownSymbol$6('iterator');
1435
+ var KEYS = 'keys';
1436
+ var VALUES = 'values';
1437
+ var ENTRIES = 'entries';
1618
1438
 
1619
- var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
1620
- var fails$6 = fails$l;
1621
- var whitespaces$1 = whitespaces$4;
1439
+ var returnThis = function () { return this; };
1622
1440
 
1623
- var non = '\u200B\u0085\u180E';
1441
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1442
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1624
1443
 
1625
- // check that a method works with the correct list
1626
- // of whitespaces and has a correct name
1627
- var stringTrimForced = function (METHOD_NAME) {
1628
- return fails$6(function () {
1629
- return !!whitespaces$1[METHOD_NAME]()
1630
- || non[METHOD_NAME]() !== non
1631
- || (PROPER_FUNCTION_NAME$1 && whitespaces$1[METHOD_NAME].name !== METHOD_NAME);
1632
- });
1633
- };
1444
+ var getIterationMethod = function (KIND) {
1445
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1446
+ if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
1634
1447
 
1635
- var $$5 = _export;
1636
- var $trim = stringTrim.trim;
1637
- var forcedStringTrimMethod = stringTrimForced;
1448
+ switch (KIND) {
1449
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1450
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1451
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1452
+ }
1638
1453
 
1639
- // `String.prototype.trim` method
1640
- // https://tc39.es/ecma262/#sec-string.prototype.trim
1641
- $$5({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1642
- trim: function trim() {
1643
- return $trim(this);
1644
- }
1645
- });
1454
+ return function () { return new IteratorConstructor(this); };
1455
+ };
1646
1456
 
1647
- const defaultProps = {
1648
- shouldUnregister: false
1649
- };
1650
- const errorMessages = {
1651
- required: 'This field is required',
1652
- isValidDate: 'Not a valid date',
1653
- isAfter: 'Date should not be before',
1654
- isXHoursBefore: 'Date is too far in the past',
1655
- isXHoursAfter: 'Date is too far in the future',
1656
- isBefore: 'Timestamp too late',
1657
- minLevel: 'The minimum level is 1',
1658
- isLatitude: 'Invalid latitude, expected number with maximum two decimal degrees between -90.00 and 90.00',
1659
- isLongitude: 'Invalid longitude, expected number with maximum two decimal degrees between -180.00 and 180.00',
1660
- isValidMax: 'The maximum value is exceeded',
1661
- isLevelLower: 'The lower level has to be below the upper level',
1662
- isNonOrBothCoordinates: 'Please enter both coordinates',
1663
- isInteger: 'Invalid entry, enter a non-decimal number',
1664
- isNumeric: 'Invalid entry, enter a numeric value'
1665
- };
1666
- const regexMaxTwoDecimals = /^\s*-?\d+(\.\d{1,2})?\s*$/;
1667
- // validations
1668
- const isEmpty = value => {
1669
- if (typeof value === 'string' && !value.trim().length || value === null || value === undefined) {
1670
- return true;
1671
- }
1672
- return false;
1673
- };
1674
- const isXHoursBefore = (ownDate, otherDate, hours = 4) => {
1675
- if (isEmpty(ownDate) || isEmpty(otherDate)) {
1676
- return true;
1457
+ var TO_STRING_TAG = NAME + ' Iterator';
1458
+ var INCORRECT_VALUES_NAME = false;
1459
+ var IterablePrototype = Iterable.prototype;
1460
+ var nativeIterator = IterablePrototype[ITERATOR$3]
1461
+ || IterablePrototype['@@iterator']
1462
+ || DEFAULT && IterablePrototype[DEFAULT];
1463
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1464
+ var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1465
+ var CurrentIteratorPrototype, methods, KEY;
1466
+
1467
+ // fix native
1468
+ if (anyNativeIterator) {
1469
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1470
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1471
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1472
+ if (setPrototypeOf) {
1473
+ setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1474
+ } else if (!isCallable$3(CurrentIteratorPrototype[ITERATOR$3])) {
1475
+ defineBuiltIn$2(CurrentIteratorPrototype, ITERATOR$3, returnThis);
1476
+ }
1477
+ }
1478
+ // Set @@toStringTag to native iterators
1479
+ setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
1480
+ }
1677
1481
  }
1678
- const duration = dateUtils.differenceInHours(dateUtils.utc(otherDate), dateUtils.utc(ownDate), 'ceil');
1679
- return duration <= hours;
1680
- };
1681
- const isXHoursAfter = (ownDate, otherDate, hours = 4) => {
1682
- if (isEmpty(ownDate) || isEmpty(otherDate)) {
1683
- return true;
1482
+
1483
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1484
+ if (PROPER_FUNCTION_NAME$2 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1485
+ if (CONFIGURABLE_FUNCTION_NAME) {
1486
+ createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
1487
+ } else {
1488
+ INCORRECT_VALUES_NAME = true;
1489
+ defaultIterator = function values() { return call$6(nativeIterator, this); };
1490
+ }
1684
1491
  }
1685
- const duration = dateUtils.differenceInHours(dateUtils.utc(ownDate), dateUtils.utc(otherDate), 'ceil');
1686
- return duration <= hours;
1687
- };
1688
- const isLatitude = lat => {
1689
- if (!lat) {
1690
- return true;
1492
+
1493
+ // export additional methods
1494
+ if (DEFAULT) {
1495
+ methods = {
1496
+ values: getIterationMethod(VALUES),
1497
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1498
+ entries: getIterationMethod(ENTRIES)
1499
+ };
1500
+ if (FORCED) for (KEY in methods) {
1501
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1502
+ defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
1503
+ }
1504
+ } else $$8({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1691
1505
  }
1692
- return isFinite(lat) && Math.abs(lat) <= 90 && regexMaxTwoDecimals.test(lat.toString());
1693
- };
1694
- const isLongitude = lng => {
1695
- if (!lng) {
1696
- return true;
1506
+
1507
+ // define iterator
1508
+ if (IterablePrototype[ITERATOR$3] !== defaultIterator) {
1509
+ defineBuiltIn$2(IterablePrototype, ITERATOR$3, defaultIterator, { name: DEFAULT });
1697
1510
  }
1698
- return isFinite(lng) && Math.abs(lng) <= 180 && lng >= -180 && regexMaxTwoDecimals.test(lng.toString());
1511
+ Iterators$1[NAME] = defaultIterator;
1512
+
1513
+ return methods;
1699
1514
  };
1700
- // Pass null if no maxValue
1701
- const isValidMax = (value, maxValue) => {
1702
- if (isEmpty(value) || maxValue === null) {
1703
- return true;
1704
- }
1705
- return !(value > maxValue);
1515
+
1516
+ // `CreateIterResultObject` abstract operation
1517
+ // https://tc39.es/ecma262/#sec-createiterresultobject
1518
+ var createIterResultObject$1 = function (value, done) {
1519
+ return { value: value, done: done };
1706
1520
  };
1707
- // Pass null if no minValue
1708
- const isValidMin = (value, minValue) => {
1709
- if (isEmpty(value) || minValue === null) {
1710
- return true;
1521
+
1522
+ var toIndexedObject = toIndexedObject$5;
1523
+ var addToUnscopables$1 = addToUnscopables$2;
1524
+ var Iterators = iterators;
1525
+ var InternalStateModule = internalState;
1526
+ var defineProperty = objectDefineProperty.f;
1527
+ var defineIterator = iteratorDefine;
1528
+ var createIterResultObject = createIterResultObject$1;
1529
+ var DESCRIPTORS = descriptors;
1530
+
1531
+ var ARRAY_ITERATOR = 'Array Iterator';
1532
+ var setInternalState = InternalStateModule.set;
1533
+ var getInternalState$1 = InternalStateModule.getterFor(ARRAY_ITERATOR);
1534
+
1535
+ // `Array.prototype.entries` method
1536
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
1537
+ // `Array.prototype.keys` method
1538
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
1539
+ // `Array.prototype.values` method
1540
+ // https://tc39.es/ecma262/#sec-array.prototype.values
1541
+ // `Array.prototype[@@iterator]` method
1542
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1543
+ // `CreateArrayIterator` internal method
1544
+ // https://tc39.es/ecma262/#sec-createarrayiterator
1545
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1546
+ setInternalState(this, {
1547
+ type: ARRAY_ITERATOR,
1548
+ target: toIndexedObject(iterated), // target
1549
+ index: 0, // next index
1550
+ kind: kind // kind
1551
+ });
1552
+ // `%ArrayIteratorPrototype%.next` method
1553
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1554
+ }, function () {
1555
+ var state = getInternalState$1(this);
1556
+ var target = state.target;
1557
+ var index = state.index++;
1558
+ if (!target || index >= target.length) {
1559
+ state.target = undefined;
1560
+ return createIterResultObject(undefined, true);
1711
1561
  }
1712
- return !(value < minValue);
1562
+ switch (state.kind) {
1563
+ case 'keys': return createIterResultObject(index, false);
1564
+ case 'values': return createIterResultObject(target[index], false);
1565
+ } return createIterResultObject([index, target[index]], false);
1566
+ }, 'values');
1567
+
1568
+ // argumentsList[@@iterator] is %ArrayProto_values%
1569
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1570
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1571
+ var values = Iterators.Arguments = Iterators.Array;
1572
+
1573
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1574
+ addToUnscopables$1('keys');
1575
+ addToUnscopables$1('values');
1576
+ addToUnscopables$1('entries');
1577
+
1578
+ // V8 ~ Chrome 45- bug
1579
+ if (DESCRIPTORS && values.name !== 'values') try {
1580
+ defineProperty(values, 'name', { value: 'values' });
1581
+ } catch (error) { /* empty */ }
1582
+
1583
+ var wellKnownSymbol$5 = wellKnownSymbol$b;
1584
+
1585
+ var TO_STRING_TAG$1 = wellKnownSymbol$5('toStringTag');
1586
+ var test = {};
1587
+
1588
+ test[TO_STRING_TAG$1] = 'z';
1589
+
1590
+ var toStringTagSupport = String(test) === '[object z]';
1591
+
1592
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1593
+ var isCallable$2 = isCallable$g;
1594
+ var classofRaw = classofRaw$1;
1595
+ var wellKnownSymbol$4 = wellKnownSymbol$b;
1596
+
1597
+ var TO_STRING_TAG = wellKnownSymbol$4('toStringTag');
1598
+ var $Object = Object;
1599
+
1600
+ // ES3 wrong here
1601
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
1602
+
1603
+ // fallback for IE11 Script Access Denied error
1604
+ var tryGet = function (it, key) {
1605
+ try {
1606
+ return it[key];
1607
+ } catch (error) { /* empty */ }
1713
1608
  };
1714
- const hasValidGeometry = geojson => {
1715
- if (!geojson || !geojson.features || !geojson.features.length || !geojson.features[0].geometry ||
1716
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1717
- // @ts-ignore
1718
- !geojson.features[0].geometry.coordinates || !geojson.features[0].geometry.type) {
1719
- return false;
1720
- }
1721
- return true;
1609
+
1610
+ // getting tag from ES6+ `Object.prototype.toString`
1611
+ var classof$4 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1612
+ var O, tag, result;
1613
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1614
+ // @@toStringTag case
1615
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1616
+ // builtinTag case
1617
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1618
+ // ES3 arguments fallback
1619
+ : (result = classofRaw(O)) === 'Object' && isCallable$2(O.callee) ? 'Arguments' : result;
1722
1620
  };
1723
- const isValidGeoJsonCoordinates = geojson => {
1724
- const hasGeometry = hasValidGeometry(geojson);
1725
- if (!hasGeometry) {
1726
- return false;
1727
- }
1728
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1729
- // @ts-ignore
1730
- const {
1731
- coordinates,
1732
- type
1733
- } = geojson.features[0].geometry;
1734
- // For type POINT coordinates is an array of 2
1735
- if (coordinates.length === 2 && type === 'Point') {
1736
- return true;
1737
- }
1738
- // For type POLYGON coordinates is an array of arrays
1739
- if (coordinates.length === 1 && coordinates[0].length > 0 && type === 'Polygon') {
1740
- return true;
1741
- }
1742
- return false;
1621
+
1622
+ var classof$3 = classof$4;
1623
+
1624
+ var $String = String;
1625
+
1626
+ var toString$8 = function (argument) {
1627
+ if (classof$3(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1628
+ return $String(argument);
1743
1629
  };
1744
- const isMaximumOneDrawing = geojson => {
1745
- const hasGeometry = hasValidGeometry(geojson);
1746
- if (!hasGeometry) {
1747
- return true; // no need to check further when there is no drawing yet
1748
- }
1749
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1750
- // @ts-ignore
1751
- const {
1752
- coordinates,
1753
- type
1754
- } = geojson.features[0].geometry;
1755
- // For type POLYGON only one array of coordinates is allowed
1756
- if (type === 'Polygon' && coordinates.length > 1) {
1757
- return false;
1758
- }
1759
- return true;
1760
- };
1761
- const hasIntersectionWithFIR = (geojson, intersection) => {
1762
- if (!hasValidGeometry(geojson) ||
1763
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1764
- // @ts-ignore
1765
- !geojson.features[0].geometry.coordinates.length || geojson.features[0].geometry.type === 'Polygon' && !geojson.features[0].geometry.coordinates[0].length) {
1766
- return true; // no need to check further when there is no drawing yet
1767
- }
1768
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1769
- // @ts-ignore
1770
- const {
1771
- coordinates,
1772
- type
1773
- } = intersection.features[0].geometry;
1774
- if (type === 'Point' && coordinates.length === 0) {
1775
- return false;
1776
- }
1777
- if (type !== 'Point' && coordinates.length > 0 && coordinates[0].length === 0) {
1778
- return false;
1779
- }
1780
- return true;
1781
- };
1782
- const hasMulitpleIntersections = geojson => {
1783
- const hasGeometry = hasValidGeometry(geojson);
1784
- if (!hasGeometry) {
1785
- return false;
1786
- }
1787
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1788
- // @ts-ignore
1789
- const {
1790
- coordinates,
1791
- type
1792
- } = geojson.features[0].geometry;
1793
- if (type === 'MultiPolygon' || coordinates.length > 1 && type !== 'Point') {
1794
- return true;
1795
- }
1796
- return false;
1797
- };
1798
- const isGeometryDirty = (geoJSON, formGeoJSON) => {
1799
- if (geoJSON === (undefined) || formGeoJSON === (undefined) || !hasValidGeometry(geoJSON) || !hasValidGeometry(formGeoJSON)) {
1800
- return false;
1801
- }
1802
- return !isEqual(
1803
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1804
- // @ts-ignore
1805
- geoJSON.features[0].geometry.coordinates,
1806
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1807
- // @ts-ignore
1808
- formGeoJSON.features[0].geometry.coordinates);
1809
- };
1810
- const isInteger = value => {
1811
- if (isEmpty(value)) {
1812
- return true;
1813
- }
1814
- return Number.isInteger(value);
1815
- };
1816
- const isNonOrBothCoordinates = (coordinate, otherCoordinate) => {
1817
- if (typeof coordinate === 'number' && typeof otherCoordinate === 'number' || coordinate === null && otherCoordinate === null || coordinate === undefined && otherCoordinate === undefined) {
1818
- return true;
1819
- }
1820
- if (typeof coordinate === 'number') {
1821
- return true;
1822
- }
1823
- return false;
1630
+
1631
+ // a string of all valid unicode whitespaces
1632
+ var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1633
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1634
+
1635
+ var uncurryThis$5 = functionUncurryThis;
1636
+ var requireObjectCoercible$3 = requireObjectCoercible$7;
1637
+ var toString$7 = toString$8;
1638
+ var whitespaces$3 = whitespaces$4;
1639
+
1640
+ var replace$1 = uncurryThis$5(''.replace);
1641
+ var ltrim = RegExp('^[' + whitespaces$3 + ']+');
1642
+ var rtrim = RegExp('(^|[^' + whitespaces$3 + '])[' + whitespaces$3 + ']+$');
1643
+
1644
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1645
+ var createMethod$2 = function (TYPE) {
1646
+ return function ($this) {
1647
+ var string = toString$7(requireObjectCoercible$3($this));
1648
+ if (TYPE & 1) string = replace$1(string, ltrim, '');
1649
+ if (TYPE & 2) string = replace$1(string, rtrim, '$1');
1650
+ return string;
1651
+ };
1824
1652
  };
1825
1653
 
1826
- const radioCheckboxStyle = {
1827
- // hides unchecked values
1828
- display: 'none',
1829
- '&+.MuiFormControlLabel-label': {
1830
- display: 'none'
1831
- },
1832
- // shows checked value
1833
- '&.Mui-checked': {
1834
- display: 'inherit',
1835
- '&+.MuiFormControlLabel-label': {
1836
- display: 'inherit'
1837
- }
1838
- },
1839
- '&.Mui-checked+.MuiFormControlLabel-label': {
1840
- color: 'geowebColors.typographyAndIcons.text'
1841
- },
1842
- '&.Mui-disabled.Mui-checked': {
1843
- color: 'geowebColors.typographyAndIcons.iconLinkActive'
1844
- }
1845
- };
1846
- const getErrorMessage = errors => {
1847
- if (errors && errors.message && typeof errors.message === 'string') {
1848
- return errors.message;
1849
- }
1850
- if (errors && errors.type && typeof errors.type === 'string') {
1851
- return errorMessages[errors.type];
1852
- }
1853
- return '';
1854
- };
1855
- const ReactHookFormFormControl = _a => {
1856
- var {
1857
- children,
1858
- errors,
1859
- isReadOnly,
1860
- sx = {},
1861
- className = '',
1862
- size = 'medium'
1863
- } = _a,
1864
- props = __rest(_a, ["children", "errors", "isReadOnly", "sx", "className", "size"]);
1865
- return jsxs(FormControl, Object.assign({
1866
- fullWidth: true,
1867
- error: !!errors,
1868
- className: `${isReadOnly ? 'is-read-only' : ''} ${className}`,
1869
- size: size,
1870
- sx: Object.assign(Object.assign({}, isReadOnly && {
1871
- // Radio input
1872
- '.MuiRadio-root': radioCheckboxStyle,
1873
- // Checkbox input
1874
- '.MuiCheckbox-root': radioCheckboxStyle,
1875
- // Select input
1876
- '.MuiSelect-select.Mui-disabled': {
1877
- color: 'geowebColors.typographyAndIcons.text',
1878
- WebkitTextFillColor: 'inherit',
1879
- '&:before': {
1880
- borderColor: 'transparent'
1881
- }
1882
- },
1883
- '.MuiSelect-nativeInput+.MuiSvgIcon-root': {
1884
- display: 'none'
1885
- },
1886
- '.Mui-disabled:before': {
1887
- border: 'transparent'
1888
- }
1889
- }), sx)
1890
- }, props, {
1891
- children: [children, errors && jsx(FormHelperText, Object.assign({
1892
- variant: "filled",
1893
- role: "alert"
1894
- }, {
1895
- children: getErrorMessage(errors)
1896
- }))]
1897
- }));
1654
+ var stringTrim = {
1655
+ // `String.prototype.{ trimLeft, trimStart }` methods
1656
+ // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1657
+ start: createMethod$2(1),
1658
+ // `String.prototype.{ trimRight, trimEnd }` methods
1659
+ // https://tc39.es/ecma262/#sec-string.prototype.trimend
1660
+ end: createMethod$2(2),
1661
+ // `String.prototype.trim` method
1662
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
1663
+ trim: createMethod$2(3)
1898
1664
  };
1899
1665
 
1900
- var aCallable$1 = aCallable$3;
1901
- var toObject$1 = toObject$4;
1902
- var IndexedObject = indexedObject;
1903
- var lengthOfArrayLike = lengthOfArrayLike$2;
1666
+ var global$7 = global$h;
1667
+ var fails$9 = fails$l;
1668
+ var uncurryThis$4 = functionUncurryThis;
1669
+ var toString$6 = toString$8;
1670
+ var trim$1 = stringTrim.trim;
1671
+ var whitespaces$2 = whitespaces$4;
1904
1672
 
1905
- var $TypeError$3 = TypeError;
1673
+ var charAt$3 = uncurryThis$4(''.charAt);
1674
+ var $parseFloat$1 = global$7.parseFloat;
1675
+ var Symbol$2 = global$7.Symbol;
1676
+ var ITERATOR$2 = Symbol$2 && Symbol$2.iterator;
1677
+ var FORCED$2 = 1 / $parseFloat$1(whitespaces$2 + '-0') !== -Infinity
1678
+ // MS Edge 18- broken with boxed symbols
1679
+ || (ITERATOR$2 && !fails$9(function () { $parseFloat$1(Object(ITERATOR$2)); }));
1906
1680
 
1907
- var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
1681
+ // `parseFloat` method
1682
+ // https://tc39.es/ecma262/#sec-parsefloat-string
1683
+ var numberParseFloat = FORCED$2 ? function parseFloat(string) {
1684
+ var trimmedString = trim$1(toString$6(string));
1685
+ var result = $parseFloat$1(trimmedString);
1686
+ return result === 0 && charAt$3(trimmedString, 0) === '-' ? -0 : result;
1687
+ } : $parseFloat$1;
1908
1688
 
1909
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
1910
- var createMethod$1 = function (IS_RIGHT) {
1911
- return function (that, callbackfn, argumentsLength, memo) {
1912
- var O = toObject$1(that);
1913
- var self = IndexedObject(O);
1914
- var length = lengthOfArrayLike(O);
1915
- aCallable$1(callbackfn);
1916
- if (length === 0 && argumentsLength < 2) throw new $TypeError$3(REDUCE_EMPTY);
1917
- var index = IS_RIGHT ? length - 1 : 0;
1918
- var i = IS_RIGHT ? -1 : 1;
1919
- if (argumentsLength < 2) while (true) {
1920
- if (index in self) {
1921
- memo = self[index];
1922
- index += i;
1923
- break;
1924
- }
1925
- index += i;
1926
- if (IS_RIGHT ? index < 0 : length <= index) {
1927
- throw new $TypeError$3(REDUCE_EMPTY);
1928
- }
1929
- }
1930
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
1931
- memo = callbackfn(memo, self[index], index, O);
1932
- }
1933
- return memo;
1934
- };
1935
- };
1689
+ var $$7 = _export;
1690
+ var $parseFloat = numberParseFloat;
1936
1691
 
1937
- var arrayReduce = {
1938
- // `Array.prototype.reduce` method
1939
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
1940
- left: createMethod$1(false),
1941
- // `Array.prototype.reduceRight` method
1942
- // https://tc39.es/ecma262/#sec-array.prototype.reduceright
1943
- right: createMethod$1(true)
1944
- };
1692
+ // `parseFloat` method
1693
+ // https://tc39.es/ecma262/#sec-parsefloat-string
1694
+ $$7({ global: true, forced: parseFloat !== $parseFloat }, {
1695
+ parseFloat: $parseFloat
1696
+ });
1945
1697
 
1946
- var fails$5 = fails$l;
1698
+ var anObject$4 = anObject$9;
1947
1699
 
1948
- var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1949
- var method = [][METHOD_NAME];
1950
- return !!method && fails$5(function () {
1951
- // eslint-disable-next-line no-useless-call -- required for testing
1952
- method.call(null, argument || function () { return 1; }, 1);
1953
- });
1700
+ // `RegExp.prototype.flags` getter implementation
1701
+ // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1702
+ var regexpFlags$1 = function () {
1703
+ var that = anObject$4(this);
1704
+ var result = '';
1705
+ if (that.hasIndices) result += 'd';
1706
+ if (that.global) result += 'g';
1707
+ if (that.ignoreCase) result += 'i';
1708
+ if (that.multiline) result += 'm';
1709
+ if (that.dotAll) result += 's';
1710
+ if (that.unicode) result += 'u';
1711
+ if (that.unicodeSets) result += 'v';
1712
+ if (that.sticky) result += 'y';
1713
+ return result;
1954
1714
  };
1955
1715
 
1956
- var global$3 = global$h;
1957
- var classof$2 = classofRaw$1;
1716
+ var fails$8 = fails$l;
1717
+ var global$6 = global$h;
1958
1718
 
1959
- var engineIsNode = classof$2(global$3.process) === 'process';
1719
+ // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1720
+ var $RegExp$2 = global$6.RegExp;
1960
1721
 
1961
- var $$4 = _export;
1962
- var $reduce = arrayReduce.left;
1963
- var arrayMethodIsStrict = arrayMethodIsStrict$1;
1964
- var CHROME_VERSION = engineV8Version;
1965
- var IS_NODE = engineIsNode;
1722
+ var UNSUPPORTED_Y$1 = fails$8(function () {
1723
+ var re = $RegExp$2('a', 'y');
1724
+ re.lastIndex = 2;
1725
+ return re.exec('abcd') !== null;
1726
+ });
1966
1727
 
1967
- // Chrome 80-82 has a critical bug
1968
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
1969
- var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
1970
- var FORCED$1 = CHROME_BUG || !arrayMethodIsStrict('reduce');
1728
+ // UC Browser bug
1729
+ // https://github.com/zloirock/core-js/issues/1008
1730
+ var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$8(function () {
1731
+ return !$RegExp$2('a', 'y').sticky;
1732
+ });
1971
1733
 
1972
- // `Array.prototype.reduce` method
1973
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
1974
- $$4({ target: 'Array', proto: true, forced: FORCED$1 }, {
1975
- reduce: function reduce(callbackfn /* , initialValue */) {
1976
- var length = arguments.length;
1977
- return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
1978
- }
1734
+ var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$8(function () {
1735
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1736
+ var re = $RegExp$2('^r', 'gy');
1737
+ re.lastIndex = 2;
1738
+ return re.exec('str') !== null;
1979
1739
  });
1980
1740
 
1981
- function getDeepProperty(p, o) {
1982
- return p.reduce((xs, x) => xs && xs[x] ? xs[x] : null, o);
1983
- }
1984
- const getErrors = (name, errors) => {
1985
- const nameAsArray = name.split('.');
1986
- return getDeepProperty(nameAsArray, errors);
1741
+ var regexpStickyHelpers = {
1742
+ BROKEN_CARET: BROKEN_CARET,
1743
+ MISSED_STICKY: MISSED_STICKY,
1744
+ UNSUPPORTED_Y: UNSUPPORTED_Y$1
1987
1745
  };
1988
1746
 
1989
- const ReactHookFormSelect = _a => {
1990
- var {
1991
- name,
1992
- label,
1993
- defaultValue = '',
1994
- children,
1995
- rules,
1996
- onChange = () => {},
1997
- disabled,
1998
- className,
1999
- sx,
2000
- isReadOnly,
2001
- size = 'medium'
2002
- } = _a,
2003
- otherProps = __rest(_a, ["name", "label", "defaultValue", "children", "rules", "onChange", "disabled", "className", "sx", "isReadOnly", "size"]);
2004
- const labelId = `${name}-label`;
2005
- const {
2006
- control
2007
- } = useFormContext();
2008
- const {
2009
- field: {
2010
- onChange: onChangeField,
2011
- value,
2012
- ref
2013
- },
2014
- formState: {
2015
- errors: formErrors
1747
+ var fails$7 = fails$l;
1748
+ var global$5 = global$h;
1749
+
1750
+ // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1751
+ var $RegExp$1 = global$5.RegExp;
1752
+
1753
+ var regexpUnsupportedDotAll = fails$7(function () {
1754
+ var re = $RegExp$1('.', 's');
1755
+ return !(re.dotAll && re.test('\n') && re.flags === 's');
1756
+ });
1757
+
1758
+ var fails$6 = fails$l;
1759
+ var global$4 = global$h;
1760
+
1761
+ // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1762
+ var $RegExp = global$4.RegExp;
1763
+
1764
+ var regexpUnsupportedNcg = fails$6(function () {
1765
+ var re = $RegExp('(?<a>b)', 'g');
1766
+ return re.exec('b').groups.a !== 'b' ||
1767
+ 'b'.replace(re, '$<a>c') !== 'bc';
1768
+ });
1769
+
1770
+ /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1771
+ /* eslint-disable regexp/no-useless-quantifier -- testing */
1772
+ var call$5 = functionCall;
1773
+ var uncurryThis$3 = functionUncurryThis;
1774
+ var toString$5 = toString$8;
1775
+ var regexpFlags = regexpFlags$1;
1776
+ var stickyHelpers = regexpStickyHelpers;
1777
+ var shared = shared$4;
1778
+ var create = objectCreate;
1779
+ var getInternalState = internalState.get;
1780
+ var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
1781
+ var UNSUPPORTED_NCG = regexpUnsupportedNcg;
1782
+
1783
+ var nativeReplace = shared('native-string-replace', String.prototype.replace);
1784
+ var nativeExec = RegExp.prototype.exec;
1785
+ var patchedExec = nativeExec;
1786
+ var charAt$2 = uncurryThis$3(''.charAt);
1787
+ var indexOf = uncurryThis$3(''.indexOf);
1788
+ var replace = uncurryThis$3(''.replace);
1789
+ var stringSlice$1 = uncurryThis$3(''.slice);
1790
+
1791
+ var UPDATES_LAST_INDEX_WRONG = (function () {
1792
+ var re1 = /a/;
1793
+ var re2 = /b*/g;
1794
+ call$5(nativeExec, re1, 'a');
1795
+ call$5(nativeExec, re2, 'a');
1796
+ return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1797
+ })();
1798
+
1799
+ var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
1800
+
1801
+ // nonparticipating capturing group, copied from es5-shim's String#split patch.
1802
+ var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1803
+
1804
+ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
1805
+
1806
+ if (PATCH) {
1807
+ patchedExec = function exec(string) {
1808
+ var re = this;
1809
+ var state = getInternalState(re);
1810
+ var str = toString$5(string);
1811
+ var raw = state.raw;
1812
+ var result, reCopy, lastIndex, match, i, object, group;
1813
+
1814
+ if (raw) {
1815
+ raw.lastIndex = re.lastIndex;
1816
+ result = call$5(patchedExec, raw, str);
1817
+ re.lastIndex = raw.lastIndex;
1818
+ return result;
2016
1819
  }
2017
- } = useController(Object.assign({
2018
- name,
2019
- control,
2020
- rules,
2021
- defaultValue
2022
- }, defaultProps));
2023
- const errors = getErrors(name, formErrors);
2024
- return jsxs(ReactHookFormFormControl, Object.assign({
2025
- className: className,
2026
- sx: sx,
2027
- disabled: disabled,
2028
- errors: errors,
2029
- isReadOnly: isReadOnly,
2030
- size: size
2031
- }, {
2032
- children: [jsx(InputLabel, Object.assign({
2033
- variant: "filled",
2034
- id: labelId
2035
- }, {
2036
- children: label
2037
- })), jsx(Select, Object.assign({
2038
- labelId: labelId,
2039
- label: label,
2040
- inputRef: ref,
2041
- name: name,
2042
- onChange: changeEvent => {
2043
- onChangeField(changeEvent.target.value);
2044
- // default props
2045
- onChange(changeEvent);
2046
- },
2047
- value: value || '',
2048
- variant: "filled"
2049
- }, otherProps, {
2050
- children: children
2051
- }))]
2052
- }));
2053
- };
2054
1820
 
2055
- const ReactHookFormRadioGroup = _a => {
2056
- var {
2057
- name,
2058
- label,
2059
- defaultValue = '',
2060
- children,
2061
- rules,
2062
- disabled = false,
2063
- onChange = () => {},
2064
- isReadOnly
2065
- } = _a,
2066
- otherProps = __rest(_a, ["name", "label", "defaultValue", "children", "rules", "disabled", "onChange", "isReadOnly"]);
2067
- const labelId = `${name}-label`;
2068
- const {
2069
- control
2070
- } = useFormContext();
2071
- const {
2072
- field: {
2073
- onChange: onChangeField,
2074
- value,
2075
- ref
2076
- },
2077
- formState: {
2078
- errors: formErrors
1821
+ var groups = state.groups;
1822
+ var sticky = UNSUPPORTED_Y && re.sticky;
1823
+ var flags = call$5(regexpFlags, re);
1824
+ var source = re.source;
1825
+ var charsAdded = 0;
1826
+ var strCopy = str;
1827
+
1828
+ if (sticky) {
1829
+ flags = replace(flags, 'y', '');
1830
+ if (indexOf(flags, 'g') === -1) {
1831
+ flags += 'g';
1832
+ }
1833
+
1834
+ strCopy = stringSlice$1(str, re.lastIndex);
1835
+ // Support anchored sticky behavior.
1836
+ if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$2(str, re.lastIndex - 1) !== '\n')) {
1837
+ source = '(?: ' + source + ')';
1838
+ strCopy = ' ' + strCopy;
1839
+ charsAdded++;
1840
+ }
1841
+ // ^(? + rx + ) is needed, in combination with some str slicing, to
1842
+ // simulate the 'y' flag.
1843
+ reCopy = new RegExp('^(?:' + source + ')', flags);
2079
1844
  }
2080
- } = useController(Object.assign({
2081
- name,
2082
- control,
2083
- rules,
2084
- defaultValue
2085
- }, defaultProps));
2086
- const errors = getErrors(name, formErrors);
2087
- React.useEffect(() => {
2088
- if (errors) {
2089
- const firstError = Object.keys(formErrors)[0];
2090
- if (firstError === name) {
2091
- // if first error in form is same, focus on that input
2092
- const inputNode = document.querySelector(`[name="${name}"]`);
2093
- if (inputNode !== null) {
2094
- inputNode.focus();
1845
+
1846
+ if (NPCG_INCLUDED) {
1847
+ reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1848
+ }
1849
+ if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1850
+
1851
+ match = call$5(nativeExec, sticky ? reCopy : re, strCopy);
1852
+
1853
+ if (sticky) {
1854
+ if (match) {
1855
+ match.input = stringSlice$1(match.input, charsAdded);
1856
+ match[0] = stringSlice$1(match[0], charsAdded);
1857
+ match.index = re.lastIndex;
1858
+ re.lastIndex += match[0].length;
1859
+ } else re.lastIndex = 0;
1860
+ } else if (UPDATES_LAST_INDEX_WRONG && match) {
1861
+ re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1862
+ }
1863
+ if (NPCG_INCLUDED && match && match.length > 1) {
1864
+ // Fix browsers whose `exec` methods don't consistently return `undefined`
1865
+ // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
1866
+ call$5(nativeReplace, match[0], reCopy, function () {
1867
+ for (i = 1; i < arguments.length - 2; i++) {
1868
+ if (arguments[i] === undefined) match[i] = undefined;
2095
1869
  }
1870
+ });
1871
+ }
1872
+
1873
+ if (match && groups) {
1874
+ match.groups = object = create(null);
1875
+ for (i = 0; i < groups.length; i++) {
1876
+ group = groups[i];
1877
+ object[group[0]] = match[group[1]];
2096
1878
  }
2097
1879
  }
2098
- }, [errors, formErrors, name]);
2099
- return jsxs(ReactHookFormFormControl, Object.assign({
2100
- disabled: disabled,
2101
- errors: errors,
2102
- isReadOnly: isReadOnly
2103
- }, {
2104
- children: [jsx(InputLabel, Object.assign({
2105
- id: labelId
2106
- }, {
2107
- children: label
2108
- })), jsx(RadioGroup, Object.assign({
2109
- value: value,
2110
- onChange: changeEvent => {
2111
- onChangeField(changeEvent.target.value);
2112
- onChange(changeEvent, changeEvent.target.value);
2113
- },
2114
- ref: ref,
2115
- name: name
2116
- }, otherProps, {
2117
- children: children
2118
- }))]
2119
- }));
2120
- };
2121
1880
 
2122
- const convertTextInputValue = (value, inCapitals) => {
2123
- return inCapitals ? value.toUpperCase() : value;
2124
- };
2125
- const ReactHookFormTextField = _a => {
2126
- var {
2127
- name,
2128
- label,
2129
- defaultValue = '',
2130
- rules,
2131
- disabled = false,
2132
- upperCase = false,
2133
- helperText = '',
2134
- className,
2135
- sx,
2136
- onChange = () => {},
2137
- isReadOnly,
2138
- InputProps
2139
- } = _a,
2140
- otherProps = __rest(_a, ["name", "label", "defaultValue", "rules", "disabled", "upperCase", "helperText", "className", "sx", "onChange", "isReadOnly", "InputProps"]);
1881
+ return match;
1882
+ };
1883
+ }
1884
+
1885
+ var regexpExec$2 = patchedExec;
1886
+
1887
+ var $$6 = _export;
1888
+ var exec$1 = regexpExec$2;
1889
+
1890
+ // `RegExp.prototype.exec` method
1891
+ // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1892
+ $$6({ target: 'RegExp', proto: true, forced: /./.exec !== exec$1 }, {
1893
+ exec: exec$1
1894
+ });
1895
+
1896
+ // TODO: Remove from `core-js@4` since it's moved to entry points
1897
+
1898
+ var $$5 = _export;
1899
+ var call$4 = functionCall;
1900
+ var isCallable$1 = isCallable$g;
1901
+ var anObject$3 = anObject$9;
1902
+ var toString$4 = toString$8;
1903
+
1904
+ var DELEGATES_TO_EXEC = function () {
1905
+ var execCalled = false;
1906
+ var re = /[ac]/;
1907
+ re.exec = function () {
1908
+ execCalled = true;
1909
+ return /./.exec.apply(this, arguments);
1910
+ };
1911
+ return re.test('abc') === true && execCalled;
1912
+ }();
1913
+
1914
+ var nativeTest = /./.test;
1915
+
1916
+ // `RegExp.prototype.test` method
1917
+ // https://tc39.es/ecma262/#sec-regexp.prototype.test
1918
+ $$5({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {
1919
+ test: function (S) {
1920
+ var R = anObject$3(this);
1921
+ var string = toString$4(S);
1922
+ var exec = R.exec;
1923
+ if (!isCallable$1(exec)) return call$4(nativeTest, R, string);
1924
+ var result = call$4(exec, R, string);
1925
+ if (result === null) return false;
1926
+ anObject$3(result);
1927
+ return true;
1928
+ }
1929
+ });
1930
+
1931
+ var call$3 = functionCall;
1932
+ var hasOwn = hasOwnProperty_1;
1933
+ var isPrototypeOf = objectIsPrototypeOf;
1934
+ var regExpFlags = regexpFlags$1;
1935
+
1936
+ var RegExpPrototype$2 = RegExp.prototype;
1937
+
1938
+ var regexpGetFlags = function (R) {
1939
+ var flags = R.flags;
1940
+ return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype$2, R)
1941
+ ? call$3(regExpFlags, R) : flags;
1942
+ };
1943
+
1944
+ var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
1945
+ var defineBuiltIn$1 = defineBuiltIn$5;
1946
+ var anObject$2 = anObject$9;
1947
+ var $toString = toString$8;
1948
+ var fails$5 = fails$l;
1949
+ var getRegExpFlags = regexpGetFlags;
1950
+
1951
+ var TO_STRING = 'toString';
1952
+ var RegExpPrototype$1 = RegExp.prototype;
1953
+ var nativeToString = RegExpPrototype$1[TO_STRING];
1954
+
1955
+ var NOT_GENERIC = fails$5(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
1956
+ // FF44- RegExp#toString has a wrong name
1957
+ var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name !== TO_STRING;
1958
+
1959
+ // `RegExp.prototype.toString` method
1960
+ // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
1961
+ if (NOT_GENERIC || INCORRECT_NAME) {
1962
+ defineBuiltIn$1(RegExpPrototype$1, TO_STRING, function toString() {
1963
+ var R = anObject$2(this);
1964
+ var pattern = $toString(R.source);
1965
+ var flags = $toString(getRegExpFlags(R));
1966
+ return '/' + pattern + '/' + flags;
1967
+ }, { unsafe: true });
1968
+ }
1969
+
1970
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
1971
+ var fails$4 = fails$l;
1972
+ var whitespaces$1 = whitespaces$4;
1973
+
1974
+ var non = '\u200B\u0085\u180E';
1975
+
1976
+ // check that a method works with the correct list
1977
+ // of whitespaces and has a correct name
1978
+ var stringTrimForced = function (METHOD_NAME) {
1979
+ return fails$4(function () {
1980
+ return !!whitespaces$1[METHOD_NAME]()
1981
+ || non[METHOD_NAME]() !== non
1982
+ || (PROPER_FUNCTION_NAME && whitespaces$1[METHOD_NAME].name !== METHOD_NAME);
1983
+ });
1984
+ };
1985
+
1986
+ var $$4 = _export;
1987
+ var $trim = stringTrim.trim;
1988
+ var forcedStringTrimMethod = stringTrimForced;
1989
+
1990
+ // `String.prototype.trim` method
1991
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
1992
+ $$4({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1993
+ trim: function trim() {
1994
+ return $trim(this);
1995
+ }
1996
+ });
1997
+
1998
+ // iterable DOM collections
1999
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2000
+ var domIterables = {
2001
+ CSSRuleList: 0,
2002
+ CSSStyleDeclaration: 0,
2003
+ CSSValueList: 0,
2004
+ ClientRectList: 0,
2005
+ DOMRectList: 0,
2006
+ DOMStringList: 0,
2007
+ DOMTokenList: 1,
2008
+ DataTransferItemList: 0,
2009
+ FileList: 0,
2010
+ HTMLAllCollection: 0,
2011
+ HTMLCollection: 0,
2012
+ HTMLFormElement: 0,
2013
+ HTMLSelectElement: 0,
2014
+ MediaList: 0,
2015
+ MimeTypeArray: 0,
2016
+ NamedNodeMap: 0,
2017
+ NodeList: 1,
2018
+ PaintRequestList: 0,
2019
+ Plugin: 0,
2020
+ PluginArray: 0,
2021
+ SVGLengthList: 0,
2022
+ SVGNumberList: 0,
2023
+ SVGPathSegList: 0,
2024
+ SVGPointList: 0,
2025
+ SVGStringList: 0,
2026
+ SVGTransformList: 0,
2027
+ SourceBufferList: 0,
2028
+ StyleSheetList: 0,
2029
+ TextTrackCueList: 0,
2030
+ TextTrackList: 0,
2031
+ TouchList: 0
2032
+ };
2033
+
2034
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
2035
+ var documentCreateElement = documentCreateElement$2;
2036
+
2037
+ var classList = documentCreateElement('span').classList;
2038
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
2039
+
2040
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
2041
+
2042
+ var global$3 = global$h;
2043
+ var DOMIterables = domIterables;
2044
+ var DOMTokenListPrototype = domTokenListPrototype;
2045
+ var ArrayIteratorMethods = es_array_iterator;
2046
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
2047
+ var setToStringTag = setToStringTag$3;
2048
+ var wellKnownSymbol$3 = wellKnownSymbol$b;
2049
+
2050
+ var ITERATOR$1 = wellKnownSymbol$3('iterator');
2051
+ var ArrayValues = ArrayIteratorMethods.values;
2052
+
2053
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
2054
+ if (CollectionPrototype) {
2055
+ // some Chrome versions have non-configurable methods on DOMTokenList
2056
+ if (CollectionPrototype[ITERATOR$1] !== ArrayValues) try {
2057
+ createNonEnumerableProperty$1(CollectionPrototype, ITERATOR$1, ArrayValues);
2058
+ } catch (error) {
2059
+ CollectionPrototype[ITERATOR$1] = ArrayValues;
2060
+ }
2061
+ setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
2062
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
2063
+ // some Chrome versions have non-configurable methods on DOMTokenList
2064
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
2065
+ createNonEnumerableProperty$1(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
2066
+ } catch (error) {
2067
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
2068
+ }
2069
+ }
2070
+ }
2071
+ };
2072
+
2073
+ for (var COLLECTION_NAME in DOMIterables) {
2074
+ handlePrototype(global$3[COLLECTION_NAME] && global$3[COLLECTION_NAME].prototype, COLLECTION_NAME);
2075
+ }
2076
+
2077
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
2078
+
2079
+ const defaultProps = {
2080
+ shouldUnregister: false
2081
+ };
2082
+ const errorMessages = {
2083
+ required: 'This field is required',
2084
+ isValidDate: 'Not a valid date',
2085
+ isAfter: 'Date should not be before',
2086
+ isXHoursBefore: 'Date is too far in the past',
2087
+ isXHoursAfter: 'Date is too far in the future',
2088
+ isBefore: 'Timestamp too late',
2089
+ minLevel: 'The minimum level is 1',
2090
+ isLatitude: 'Invalid latitude, expected number with maximum two decimal degrees between -90.00 and 90.00',
2091
+ isLongitude: 'Invalid longitude, expected number with maximum two decimal degrees between -180.00 and 180.00',
2092
+ isValidMax: 'The maximum value is exceeded',
2093
+ isLevelLower: 'The lower level has to be below the upper level',
2094
+ isNonOrBothCoordinates: 'Please enter both coordinates',
2095
+ isInteger: 'Invalid entry, enter a non-decimal number',
2096
+ isNumeric: 'Invalid entry, enter a numeric value'
2097
+ };
2098
+ const regexMaxTwoDecimals = /^\s*-?\d+(\.\d{1,2})?\s*$/;
2099
+ // validations
2100
+ const isEmpty = value => {
2101
+ if (typeof value === 'string' && !value.trim().length || value === null || value === undefined) {
2102
+ return true;
2103
+ }
2104
+ return false;
2105
+ };
2106
+ const isXHoursBefore = (ownDate, otherDate, hours = 4) => {
2107
+ if (isEmpty(ownDate) || isEmpty(otherDate)) {
2108
+ return true;
2109
+ }
2110
+ const duration = dateUtils.differenceInHours(dateUtils.utc(otherDate), dateUtils.utc(ownDate), 'ceil');
2111
+ return duration <= hours;
2112
+ };
2113
+ const isXHoursAfter = (ownDate, otherDate, hours = 4) => {
2114
+ if (isEmpty(ownDate) || isEmpty(otherDate)) {
2115
+ return true;
2116
+ }
2117
+ const duration = dateUtils.differenceInHours(dateUtils.utc(ownDate), dateUtils.utc(otherDate), 'ceil');
2118
+ return duration <= hours;
2119
+ };
2120
+ const isLatitude = lat => {
2121
+ if (!lat) {
2122
+ return true;
2123
+ }
2124
+ return isFinite(lat) && Math.abs(lat) <= 90 && regexMaxTwoDecimals.test(lat.toString());
2125
+ };
2126
+ const isLongitude = lng => {
2127
+ if (!lng) {
2128
+ return true;
2129
+ }
2130
+ return isFinite(lng) && Math.abs(lng) <= 180 && lng >= -180 && regexMaxTwoDecimals.test(lng.toString());
2131
+ };
2132
+ // Pass null if no maxValue
2133
+ const isValidMax = (value, maxValue) => {
2134
+ if (isEmpty(value) || maxValue === null) {
2135
+ return true;
2136
+ }
2137
+ return !(value > maxValue);
2138
+ };
2139
+ // Pass null if no minValue
2140
+ const isValidMin = (value, minValue) => {
2141
+ if (isEmpty(value) || minValue === null) {
2142
+ return true;
2143
+ }
2144
+ return !(value < minValue);
2145
+ };
2146
+ const hasValidGeometry = geojson => {
2147
+ if (!geojson || !geojson.features || !geojson.features.length || !geojson.features[0].geometry ||
2148
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2149
+ // @ts-ignore
2150
+ !geojson.features[0].geometry.coordinates || !geojson.features[0].geometry.type) {
2151
+ return false;
2152
+ }
2153
+ return true;
2154
+ };
2155
+ const isValidGeoJsonCoordinates = geojson => {
2156
+ const hasGeometry = hasValidGeometry(geojson);
2157
+ if (!hasGeometry) {
2158
+ return false;
2159
+ }
2160
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2161
+ // @ts-ignore
2141
2162
  const {
2142
- control
2143
- } = useFormContext();
2163
+ coordinates,
2164
+ type
2165
+ } = geojson.features[0].geometry;
2166
+ // For type POINT coordinates is an array of 2
2167
+ if (coordinates.length === 2 && type === 'Point') {
2168
+ return true;
2169
+ }
2170
+ // For type POLYGON coordinates is an array of arrays
2171
+ if (coordinates.length === 1 && coordinates[0].length > 0 && type === 'Polygon') {
2172
+ return true;
2173
+ }
2174
+ return false;
2175
+ };
2176
+ const isMaximumOneDrawing = geojson => {
2177
+ const hasGeometry = hasValidGeometry(geojson);
2178
+ if (!hasGeometry) {
2179
+ return true; // no need to check further when there is no drawing yet
2180
+ }
2181
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2182
+ // @ts-ignore
2144
2183
  const {
2145
- field: {
2146
- onChange: onChangeField,
2147
- value,
2148
- ref
2149
- },
2150
- formState: {
2151
- errors: formErrors
2152
- }
2153
- } = useController(Object.assign({
2154
- name,
2155
- control,
2156
- rules,
2157
- defaultValue
2158
- }, defaultProps));
2159
- const errors = getErrors(name, formErrors);
2160
- return jsx(ReactHookFormFormControl, Object.assign({
2161
- className: className,
2162
- sx: sx,
2163
- disabled: disabled,
2164
- errors: errors,
2165
- isReadOnly: isReadOnly
2166
- }, {
2167
- children: jsx(TextField, Object.assign({
2168
- label: label,
2169
- error: !!errors,
2170
- helperText: helperText,
2171
- value: value,
2172
- variant: "filled",
2173
- type: "text",
2174
- name: name,
2175
- onChange: evt => {
2176
- const {
2177
- value
2178
- } = evt.target;
2179
- const convertedValue = convertTextInputValue(value, upperCase);
2180
- onChangeField(convertedValue);
2181
- onChange(null);
2182
- },
2183
- disabled: disabled,
2184
- inputRef: ref,
2185
- InputProps: Object.assign(Object.assign({}, InputProps), isReadOnly && {
2186
- readOnly: true
2187
- })
2188
- }, otherProps))
2189
- }));
2184
+ coordinates,
2185
+ type
2186
+ } = geojson.features[0].geometry;
2187
+ // For type POLYGON only one array of coordinates is allowed
2188
+ if (type === 'Polygon' && coordinates.length > 1) {
2189
+ return false;
2190
+ }
2191
+ return true;
2192
+ };
2193
+ const hasIntersectionWithFIR = (geojson, intersection) => {
2194
+ if (!hasValidGeometry(geojson) ||
2195
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2196
+ // @ts-ignore
2197
+ !geojson.features[0].geometry.coordinates.length || geojson.features[0].geometry.type === 'Polygon' && !geojson.features[0].geometry.coordinates[0].length) {
2198
+ return true; // no need to check further when there is no drawing yet
2199
+ }
2200
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2201
+ // @ts-ignore
2202
+ const {
2203
+ coordinates,
2204
+ type
2205
+ } = intersection.features[0].geometry;
2206
+ if (type === 'Point' && coordinates.length === 0) {
2207
+ return false;
2208
+ }
2209
+ if (type !== 'Point' && coordinates.length > 0 && coordinates[0].length === 0) {
2210
+ return false;
2211
+ }
2212
+ return true;
2190
2213
  };
2191
-
2192
- var wellKnownSymbol$7 = wellKnownSymbol$b;
2193
- var create$1 = objectCreate;
2194
- var defineProperty$2 = objectDefineProperty.f;
2195
-
2196
- var UNSCOPABLES = wellKnownSymbol$7('unscopables');
2197
- var ArrayPrototype = Array.prototype;
2198
-
2199
- // Array.prototype[@@unscopables]
2200
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2201
- if (ArrayPrototype[UNSCOPABLES] === undefined) {
2202
- defineProperty$2(ArrayPrototype, UNSCOPABLES, {
2203
- configurable: true,
2204
- value: create$1(null)
2214
+ const hasMulitpleIntersections = geojson => {
2215
+ const hasGeometry = hasValidGeometry(geojson);
2216
+ if (!hasGeometry) {
2217
+ return false;
2218
+ }
2219
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2220
+ // @ts-ignore
2221
+ const {
2222
+ coordinates,
2223
+ type
2224
+ } = geojson.features[0].geometry;
2225
+ if (type === 'MultiPolygon' || coordinates.length > 1 && type !== 'Point') {
2226
+ return true;
2227
+ }
2228
+ return false;
2229
+ };
2230
+ const countIntersectionPoints = (geojson, intersection) => {
2231
+ var _a, _b;
2232
+ if (!(geojson === null || geojson === void 0 ? void 0 : geojson.features) || !((_a = geojson.features[0]) === null || _a === void 0 ? void 0 : _a.geometry) || !(intersection === null || intersection === void 0 ? void 0 : intersection.features) || !((_b = intersection.features[0]) === null || _b === void 0 ? void 0 : _b.geometry)) {
2233
+ return 0;
2234
+ }
2235
+ const geojsonGeometry = geojson.features[0].geometry;
2236
+ const intersectionGeometry = intersection.features[0].geometry;
2237
+ if (geojsonGeometry.type !== 'Polygon' || intersectionGeometry.type !== 'Polygon') {
2238
+ return 0;
2239
+ }
2240
+ const geojsonCoordinates = geojsonGeometry.coordinates[0];
2241
+ const intersectionCoordinates = intersectionGeometry.coordinates[0];
2242
+ // If both arrays are empty, return 0
2243
+ if (!geojsonCoordinates && !intersectionCoordinates) {
2244
+ return 0;
2245
+ }
2246
+ const intersectionPoints = intersectionCoordinates.map(point => [point[0], point[1]]);
2247
+ const uniqueIntersectionPoints = intersectionPoints.filter((point, index, self) => index === self.findIndex(p => p[0] === point[0] && p[1] === point[1]));
2248
+ const collisionPoints = uniqueIntersectionPoints.filter(point => {
2249
+ const [x, y] = point;
2250
+ return !geojsonCoordinates.some(originalPoint => originalPoint[0] === x && originalPoint[1] === y);
2205
2251
  });
2206
- }
2207
-
2208
- // add a key to Array.prototype[@@unscopables]
2209
- var addToUnscopables$2 = function (key) {
2210
- ArrayPrototype[UNSCOPABLES][key] = true;
2252
+ return collisionPoints.length;
2211
2253
  };
2212
-
2213
- var $$3 = _export;
2214
- var $includes = arrayIncludes.includes;
2215
- var fails$4 = fails$l;
2216
- var addToUnscopables$1 = addToUnscopables$2;
2217
-
2218
- // FF99+ bug
2219
- var BROKEN_ON_SPARSE = fails$4(function () {
2220
- // eslint-disable-next-line es/no-array-prototype-includes -- detection
2221
- return !Array(1).includes();
2222
- });
2223
-
2224
- // `Array.prototype.includes` method
2225
- // https://tc39.es/ecma262/#sec-array.prototype.includes
2226
- $$3({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2227
- includes: function includes(el /* , fromIndex = 0 */) {
2228
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2254
+ const isGeometryDirty = (geoJSON, formGeoJSON) => {
2255
+ if (geoJSON === (undefined) || formGeoJSON === (undefined) || !hasValidGeometry(geoJSON) || !hasValidGeometry(formGeoJSON)) {
2256
+ return false;
2229
2257
  }
2230
- });
2231
-
2232
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2233
- addToUnscopables$1('includes');
2234
-
2235
- var iterators = {};
2236
-
2237
- var fails$3 = fails$l;
2238
-
2239
- var correctPrototypeGetter = !fails$3(function () {
2240
- function F() { /* empty */ }
2241
- F.prototype.constructor = null;
2242
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
2243
- return Object.getPrototypeOf(new F()) !== F.prototype;
2244
- });
2245
-
2246
- var hasOwn$1 = hasOwnProperty_1;
2247
- var isCallable$3 = isCallable$g;
2248
- var toObject = toObject$4;
2249
- var sharedKey = sharedKey$3;
2250
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
2251
-
2252
- var IE_PROTO = sharedKey('IE_PROTO');
2253
- var $Object = Object;
2254
- var ObjectPrototype = $Object.prototype;
2255
-
2256
- // `Object.getPrototypeOf` method
2257
- // https://tc39.es/ecma262/#sec-object.getprototypeof
2258
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
2259
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
2260
- var object = toObject(O);
2261
- if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
2262
- var constructor = object.constructor;
2263
- if (isCallable$3(constructor) && object instanceof constructor) {
2264
- return constructor.prototype;
2265
- } return object instanceof $Object ? ObjectPrototype : null;
2258
+ return !isEqual(
2259
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2260
+ // @ts-ignore
2261
+ geoJSON.features[0].geometry.coordinates,
2262
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2263
+ // @ts-ignore
2264
+ formGeoJSON.features[0].geometry.coordinates);
2266
2265
  };
2267
-
2268
- var fails$2 = fails$l;
2269
- var isCallable$2 = isCallable$g;
2270
- var isObject$3 = isObject$9;
2271
- var getPrototypeOf$1 = objectGetPrototypeOf;
2272
- var defineBuiltIn$2 = defineBuiltIn$5;
2273
- var wellKnownSymbol$6 = wellKnownSymbol$b;
2274
-
2275
- var ITERATOR$3 = wellKnownSymbol$6('iterator');
2276
- var BUGGY_SAFARI_ITERATORS$1 = false;
2277
-
2278
- // `%IteratorPrototype%` object
2279
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
2280
- var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
2281
-
2282
- /* eslint-disable es/no-array-prototype-keys -- safe */
2283
- if ([].keys) {
2284
- arrayIterator = [].keys();
2285
- // Safari 8 has buggy iterators w/o `next`
2286
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
2287
- else {
2288
- PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
2289
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
2266
+ const isInteger = value => {
2267
+ if (isEmpty(value)) {
2268
+ return true;
2290
2269
  }
2291
- }
2292
-
2293
- var NEW_ITERATOR_PROTOTYPE = !isObject$3(IteratorPrototype$2) || fails$2(function () {
2294
- var test = {};
2295
- // FF44- legacy iterators case
2296
- return IteratorPrototype$2[ITERATOR$3].call(test) !== test;
2297
- });
2298
-
2299
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
2300
-
2301
- // `%IteratorPrototype%[@@iterator]()` method
2302
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
2303
- if (!isCallable$2(IteratorPrototype$2[ITERATOR$3])) {
2304
- defineBuiltIn$2(IteratorPrototype$2, ITERATOR$3, function () {
2305
- return this;
2306
- });
2307
- }
2308
-
2309
- var iteratorsCore = {
2310
- IteratorPrototype: IteratorPrototype$2,
2311
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
2270
+ return Number.isInteger(value);
2312
2271
  };
2313
-
2314
- var defineProperty$1 = objectDefineProperty.f;
2315
- var hasOwn = hasOwnProperty_1;
2316
- var wellKnownSymbol$5 = wellKnownSymbol$b;
2317
-
2318
- var TO_STRING_TAG = wellKnownSymbol$5('toStringTag');
2319
-
2320
- var setToStringTag$3 = function (target, TAG, STATIC) {
2321
- if (target && !STATIC) target = target.prototype;
2322
- if (target && !hasOwn(target, TO_STRING_TAG)) {
2323
- defineProperty$1(target, TO_STRING_TAG, { configurable: true, value: TAG });
2272
+ const isNonOrBothCoordinates = (coordinate, otherCoordinate) => {
2273
+ if (typeof coordinate === 'number' && typeof otherCoordinate === 'number' || coordinate === null && otherCoordinate === null || coordinate === undefined && otherCoordinate === undefined) {
2274
+ return true;
2275
+ }
2276
+ if (typeof coordinate === 'number') {
2277
+ return true;
2324
2278
  }
2279
+ return false;
2325
2280
  };
2326
2281
 
2327
- var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
2328
- var create = objectCreate;
2329
- var createPropertyDescriptor = createPropertyDescriptor$3;
2330
- var setToStringTag$2 = setToStringTag$3;
2331
- var Iterators$2 = iterators;
2332
-
2333
- var returnThis$1 = function () { return this; };
2334
-
2335
- var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
2336
- var TO_STRING_TAG = NAME + ' Iterator';
2337
- IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
2338
- setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
2339
- Iterators$2[TO_STRING_TAG] = returnThis$1;
2340
- return IteratorConstructor;
2282
+ const radioCheckboxStyle = {
2283
+ // hides unchecked values
2284
+ display: 'none',
2285
+ '&+.MuiFormControlLabel-label': {
2286
+ display: 'none'
2287
+ },
2288
+ // shows checked value
2289
+ '&.Mui-checked': {
2290
+ display: 'inherit',
2291
+ '&+.MuiFormControlLabel-label': {
2292
+ display: 'inherit'
2293
+ }
2294
+ },
2295
+ '&.Mui-checked+.MuiFormControlLabel-label': {
2296
+ color: 'geowebColors.typographyAndIcons.text'
2297
+ },
2298
+ '&.Mui-disabled.Mui-checked': {
2299
+ color: 'geowebColors.typographyAndIcons.iconLinkActive'
2300
+ }
2301
+ };
2302
+ const getErrorMessage = errors => {
2303
+ if (errors && errors.message && typeof errors.message === 'string') {
2304
+ return errors.message;
2305
+ }
2306
+ if (errors && errors.type && typeof errors.type === 'string') {
2307
+ return errorMessages[errors.type];
2308
+ }
2309
+ return '';
2310
+ };
2311
+ const ReactHookFormFormControl = _a => {
2312
+ var {
2313
+ children,
2314
+ errors,
2315
+ isReadOnly,
2316
+ sx = {},
2317
+ className = '',
2318
+ size = 'medium'
2319
+ } = _a,
2320
+ props = __rest(_a, ["children", "errors", "isReadOnly", "sx", "className", "size"]);
2321
+ return jsxs(FormControl, Object.assign({
2322
+ fullWidth: true,
2323
+ error: !!errors,
2324
+ className: `${isReadOnly ? 'is-read-only' : ''} ${className}`,
2325
+ size: size,
2326
+ sx: Object.assign(Object.assign({}, isReadOnly && {
2327
+ // Radio input
2328
+ '.MuiRadio-root': radioCheckboxStyle,
2329
+ // Checkbox input
2330
+ '.MuiCheckbox-root': radioCheckboxStyle,
2331
+ // Select input
2332
+ '.MuiSelect-select.Mui-disabled': {
2333
+ color: 'geowebColors.typographyAndIcons.text',
2334
+ WebkitTextFillColor: 'inherit',
2335
+ '&:before': {
2336
+ borderColor: 'transparent'
2337
+ }
2338
+ },
2339
+ '.MuiSelect-nativeInput+.MuiSvgIcon-root': {
2340
+ display: 'none'
2341
+ },
2342
+ '.Mui-disabled:before': {
2343
+ border: 'transparent'
2344
+ }
2345
+ }), sx)
2346
+ }, props, {
2347
+ children: [children, errors && jsx(FormHelperText, Object.assign({
2348
+ variant: "filled",
2349
+ role: "alert"
2350
+ }, {
2351
+ children: getErrorMessage(errors)
2352
+ }))]
2353
+ }));
2341
2354
  };
2342
2355
 
2343
- var uncurryThis$3 = functionUncurryThis;
2344
2356
  var aCallable = aCallable$3;
2357
+ var toObject = toObject$4;
2358
+ var IndexedObject = indexedObject;
2359
+ var lengthOfArrayLike = lengthOfArrayLike$2;
2345
2360
 
2346
- var functionUncurryThisAccessor = function (object, key, method) {
2347
- try {
2348
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2349
- return uncurryThis$3(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
2350
- } catch (error) { /* empty */ }
2361
+ var $TypeError$2 = TypeError;
2362
+
2363
+ var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
2364
+
2365
+ // `Array.prototype.{ reduce, reduceRight }` methods implementation
2366
+ var createMethod$1 = function (IS_RIGHT) {
2367
+ return function (that, callbackfn, argumentsLength, memo) {
2368
+ var O = toObject(that);
2369
+ var self = IndexedObject(O);
2370
+ var length = lengthOfArrayLike(O);
2371
+ aCallable(callbackfn);
2372
+ if (length === 0 && argumentsLength < 2) throw new $TypeError$2(REDUCE_EMPTY);
2373
+ var index = IS_RIGHT ? length - 1 : 0;
2374
+ var i = IS_RIGHT ? -1 : 1;
2375
+ if (argumentsLength < 2) while (true) {
2376
+ if (index in self) {
2377
+ memo = self[index];
2378
+ index += i;
2379
+ break;
2380
+ }
2381
+ index += i;
2382
+ if (IS_RIGHT ? index < 0 : length <= index) {
2383
+ throw new $TypeError$2(REDUCE_EMPTY);
2384
+ }
2385
+ }
2386
+ for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
2387
+ memo = callbackfn(memo, self[index], index, O);
2388
+ }
2389
+ return memo;
2390
+ };
2351
2391
  };
2352
2392
 
2353
- var isObject$2 = isObject$9;
2354
-
2355
- var isPossiblePrototype$1 = function (argument) {
2356
- return isObject$2(argument) || argument === null;
2393
+ var arrayReduce = {
2394
+ // `Array.prototype.reduce` method
2395
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
2396
+ left: createMethod$1(false),
2397
+ // `Array.prototype.reduceRight` method
2398
+ // https://tc39.es/ecma262/#sec-array.prototype.reduceright
2399
+ right: createMethod$1(true)
2357
2400
  };
2358
2401
 
2359
- var isPossiblePrototype = isPossiblePrototype$1;
2360
-
2361
- var $String = String;
2362
- var $TypeError$2 = TypeError;
2402
+ var fails$3 = fails$l;
2363
2403
 
2364
- var aPossiblePrototype$1 = function (argument) {
2365
- if (isPossiblePrototype(argument)) return argument;
2366
- throw new $TypeError$2("Can't set " + $String(argument) + ' as a prototype');
2404
+ var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
2405
+ var method = [][METHOD_NAME];
2406
+ return !!method && fails$3(function () {
2407
+ // eslint-disable-next-line no-useless-call -- required for testing
2408
+ method.call(null, argument || function () { return 1; }, 1);
2409
+ });
2367
2410
  };
2368
2411
 
2369
- /* eslint-disable no-proto -- safe */
2370
- var uncurryThisAccessor = functionUncurryThisAccessor;
2371
- var isObject$1 = isObject$9;
2372
- var requireObjectCoercible$3 = requireObjectCoercible$7;
2373
- var aPossiblePrototype = aPossiblePrototype$1;
2374
-
2375
- // `Object.setPrototypeOf` method
2376
- // https://tc39.es/ecma262/#sec-object.setprototypeof
2377
- // Works with __proto__ only. Old v8 can't work with null proto objects.
2378
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
2379
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
2380
- var CORRECT_SETTER = false;
2381
- var test = {};
2382
- var setter;
2383
- try {
2384
- setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
2385
- setter(test, []);
2386
- CORRECT_SETTER = test instanceof Array;
2387
- } catch (error) { /* empty */ }
2388
- return function setPrototypeOf(O, proto) {
2389
- requireObjectCoercible$3(O);
2390
- aPossiblePrototype(proto);
2391
- if (!isObject$1(O)) return O;
2392
- if (CORRECT_SETTER) setter(O, proto);
2393
- else O.__proto__ = proto;
2394
- return O;
2395
- };
2396
- }() : undefined);
2397
-
2398
- var $$2 = _export;
2399
- var call$3 = functionCall;
2400
- var FunctionName = functionName;
2401
- var isCallable$1 = isCallable$g;
2402
- var createIteratorConstructor = iteratorCreateConstructor;
2403
- var getPrototypeOf = objectGetPrototypeOf;
2404
- var setPrototypeOf = objectSetPrototypeOf;
2405
- var setToStringTag$1 = setToStringTag$3;
2406
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
2407
- var defineBuiltIn$1 = defineBuiltIn$5;
2408
- var wellKnownSymbol$4 = wellKnownSymbol$b;
2409
- var Iterators$1 = iterators;
2410
- var IteratorsCore = iteratorsCore;
2411
-
2412
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
2413
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
2414
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
2415
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
2416
- var ITERATOR$2 = wellKnownSymbol$4('iterator');
2417
- var KEYS = 'keys';
2418
- var VALUES = 'values';
2419
- var ENTRIES = 'entries';
2420
-
2421
- var returnThis = function () { return this; };
2412
+ var global$2 = global$h;
2413
+ var classof$2 = classofRaw$1;
2422
2414
 
2423
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
2424
- createIteratorConstructor(IteratorConstructor, NAME, next);
2415
+ var engineIsNode = classof$2(global$2.process) === 'process';
2425
2416
 
2426
- var getIterationMethod = function (KIND) {
2427
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
2428
- if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
2417
+ var $$3 = _export;
2418
+ var $reduce = arrayReduce.left;
2419
+ var arrayMethodIsStrict = arrayMethodIsStrict$1;
2420
+ var CHROME_VERSION = engineV8Version;
2421
+ var IS_NODE = engineIsNode;
2429
2422
 
2430
- switch (KIND) {
2431
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
2432
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
2433
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
2434
- }
2423
+ // Chrome 80-82 has a critical bug
2424
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
2425
+ var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
2426
+ var FORCED$1 = CHROME_BUG || !arrayMethodIsStrict('reduce');
2435
2427
 
2436
- return function () { return new IteratorConstructor(this); };
2437
- };
2428
+ // `Array.prototype.reduce` method
2429
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
2430
+ $$3({ target: 'Array', proto: true, forced: FORCED$1 }, {
2431
+ reduce: function reduce(callbackfn /* , initialValue */) {
2432
+ var length = arguments.length;
2433
+ return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
2434
+ }
2435
+ });
2438
2436
 
2439
- var TO_STRING_TAG = NAME + ' Iterator';
2440
- var INCORRECT_VALUES_NAME = false;
2441
- var IterablePrototype = Iterable.prototype;
2442
- var nativeIterator = IterablePrototype[ITERATOR$2]
2443
- || IterablePrototype['@@iterator']
2444
- || DEFAULT && IterablePrototype[DEFAULT];
2445
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
2446
- var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
2447
- var CurrentIteratorPrototype, methods, KEY;
2437
+ function getDeepProperty(p, o) {
2438
+ return p.reduce((xs, x) => xs && xs[x] ? xs[x] : null, o);
2439
+ }
2440
+ const getErrors = (name, errors) => {
2441
+ const nameAsArray = name.split('.');
2442
+ return getDeepProperty(nameAsArray, errors);
2443
+ };
2448
2444
 
2449
- // fix native
2450
- if (anyNativeIterator) {
2451
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
2452
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
2453
- if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
2454
- if (setPrototypeOf) {
2455
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
2456
- } else if (!isCallable$1(CurrentIteratorPrototype[ITERATOR$2])) {
2457
- defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$2, returnThis);
2458
- }
2459
- }
2460
- // Set @@toStringTag to native iterators
2461
- setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
2445
+ const ReactHookFormSelect = _a => {
2446
+ var {
2447
+ name,
2448
+ label,
2449
+ defaultValue = '',
2450
+ children,
2451
+ rules,
2452
+ onChange = () => {},
2453
+ disabled,
2454
+ className,
2455
+ sx,
2456
+ isReadOnly,
2457
+ size = 'medium'
2458
+ } = _a,
2459
+ otherProps = __rest(_a, ["name", "label", "defaultValue", "children", "rules", "onChange", "disabled", "className", "sx", "isReadOnly", "size"]);
2460
+ const labelId = `${name}-label`;
2461
+ const {
2462
+ control
2463
+ } = useFormContext();
2464
+ const {
2465
+ field: {
2466
+ onChange: onChangeField,
2467
+ value,
2468
+ ref
2469
+ },
2470
+ formState: {
2471
+ errors: formErrors
2462
2472
  }
2463
- }
2473
+ } = useController(Object.assign({
2474
+ name,
2475
+ control,
2476
+ rules,
2477
+ defaultValue
2478
+ }, defaultProps));
2479
+ const errors = getErrors(name, formErrors);
2480
+ return jsxs(ReactHookFormFormControl, Object.assign({
2481
+ className: className,
2482
+ sx: sx,
2483
+ disabled: disabled,
2484
+ errors: errors,
2485
+ isReadOnly: isReadOnly,
2486
+ size: size
2487
+ }, {
2488
+ children: [jsx(InputLabel, Object.assign({
2489
+ variant: "filled",
2490
+ id: labelId
2491
+ }, {
2492
+ children: label
2493
+ })), jsx(Select, Object.assign({
2494
+ labelId: labelId,
2495
+ label: label,
2496
+ inputRef: ref,
2497
+ name: name,
2498
+ onChange: changeEvent => {
2499
+ onChangeField(changeEvent.target.value);
2500
+ // default props
2501
+ onChange(changeEvent);
2502
+ },
2503
+ value: value || '',
2504
+ variant: "filled"
2505
+ }, otherProps, {
2506
+ children: children
2507
+ }))]
2508
+ }));
2509
+ };
2464
2510
 
2465
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
2466
- if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
2467
- if (CONFIGURABLE_FUNCTION_NAME) {
2468
- createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
2469
- } else {
2470
- INCORRECT_VALUES_NAME = true;
2471
- defaultIterator = function values() { return call$3(nativeIterator, this); };
2511
+ const ReactHookFormRadioGroup = _a => {
2512
+ var {
2513
+ name,
2514
+ label,
2515
+ defaultValue = '',
2516
+ children,
2517
+ rules,
2518
+ disabled = false,
2519
+ onChange = () => {},
2520
+ isReadOnly
2521
+ } = _a,
2522
+ otherProps = __rest(_a, ["name", "label", "defaultValue", "children", "rules", "disabled", "onChange", "isReadOnly"]);
2523
+ const labelId = `${name}-label`;
2524
+ const {
2525
+ control
2526
+ } = useFormContext();
2527
+ const {
2528
+ field: {
2529
+ onChange: onChangeField,
2530
+ value,
2531
+ ref
2532
+ },
2533
+ formState: {
2534
+ errors: formErrors
2472
2535
  }
2473
- }
2474
-
2475
- // export additional methods
2476
- if (DEFAULT) {
2477
- methods = {
2478
- values: getIterationMethod(VALUES),
2479
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
2480
- entries: getIterationMethod(ENTRIES)
2481
- };
2482
- if (FORCED) for (KEY in methods) {
2483
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
2484
- defineBuiltIn$1(IterablePrototype, KEY, methods[KEY]);
2536
+ } = useController(Object.assign({
2537
+ name,
2538
+ control,
2539
+ rules,
2540
+ defaultValue
2541
+ }, defaultProps));
2542
+ const errors = getErrors(name, formErrors);
2543
+ React.useEffect(() => {
2544
+ if (errors) {
2545
+ const firstError = Object.keys(formErrors)[0];
2546
+ if (firstError === name) {
2547
+ // if first error in form is same, focus on that input
2548
+ const inputNode = document.querySelector(`[name="${name}"]`);
2549
+ if (inputNode !== null) {
2550
+ inputNode.focus();
2551
+ }
2485
2552
  }
2486
- } else $$2({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
2487
- }
2488
-
2489
- // define iterator
2490
- if (IterablePrototype[ITERATOR$2] !== defaultIterator) {
2491
- defineBuiltIn$1(IterablePrototype, ITERATOR$2, defaultIterator, { name: DEFAULT });
2492
- }
2493
- Iterators$1[NAME] = defaultIterator;
2494
-
2495
- return methods;
2553
+ }
2554
+ }, [errors, formErrors, name]);
2555
+ return jsxs(ReactHookFormFormControl, Object.assign({
2556
+ disabled: disabled,
2557
+ errors: errors,
2558
+ isReadOnly: isReadOnly
2559
+ }, {
2560
+ children: [jsx(InputLabel, Object.assign({
2561
+ id: labelId
2562
+ }, {
2563
+ children: label
2564
+ })), jsx(RadioGroup, Object.assign({
2565
+ value: value,
2566
+ onChange: changeEvent => {
2567
+ onChangeField(changeEvent.target.value);
2568
+ onChange(changeEvent, changeEvent.target.value);
2569
+ },
2570
+ ref: ref,
2571
+ name: name
2572
+ }, otherProps, {
2573
+ children: children
2574
+ }))]
2575
+ }));
2496
2576
  };
2497
2577
 
2498
- // `CreateIterResultObject` abstract operation
2499
- // https://tc39.es/ecma262/#sec-createiterresultobject
2500
- var createIterResultObject$1 = function (value, done) {
2501
- return { value: value, done: done };
2578
+ const convertTextInputValue = (value, inCapitals) => {
2579
+ return inCapitals ? value.toUpperCase() : value;
2580
+ };
2581
+ const ReactHookFormTextField = _a => {
2582
+ var {
2583
+ name,
2584
+ label,
2585
+ defaultValue = '',
2586
+ rules,
2587
+ disabled = false,
2588
+ upperCase = false,
2589
+ helperText = '',
2590
+ className,
2591
+ sx,
2592
+ onChange = () => {},
2593
+ isReadOnly,
2594
+ InputProps
2595
+ } = _a,
2596
+ otherProps = __rest(_a, ["name", "label", "defaultValue", "rules", "disabled", "upperCase", "helperText", "className", "sx", "onChange", "isReadOnly", "InputProps"]);
2597
+ const {
2598
+ control
2599
+ } = useFormContext();
2600
+ const {
2601
+ field: {
2602
+ onChange: onChangeField,
2603
+ value,
2604
+ ref
2605
+ },
2606
+ formState: {
2607
+ errors: formErrors
2608
+ }
2609
+ } = useController(Object.assign({
2610
+ name,
2611
+ control,
2612
+ rules,
2613
+ defaultValue
2614
+ }, defaultProps));
2615
+ const errors = getErrors(name, formErrors);
2616
+ return jsx(ReactHookFormFormControl, Object.assign({
2617
+ className: className,
2618
+ sx: sx,
2619
+ disabled: disabled,
2620
+ errors: errors,
2621
+ isReadOnly: isReadOnly
2622
+ }, {
2623
+ children: jsx(TextField, Object.assign({
2624
+ label: label,
2625
+ error: !!errors,
2626
+ helperText: helperText,
2627
+ value: value,
2628
+ variant: "filled",
2629
+ type: "text",
2630
+ name: name,
2631
+ onChange: evt => {
2632
+ const {
2633
+ value
2634
+ } = evt.target;
2635
+ const convertedValue = convertTextInputValue(value, upperCase);
2636
+ onChangeField(convertedValue);
2637
+ onChange(null);
2638
+ },
2639
+ disabled: disabled,
2640
+ inputRef: ref,
2641
+ InputProps: Object.assign(Object.assign({}, InputProps), isReadOnly && {
2642
+ readOnly: true
2643
+ })
2644
+ }, otherProps))
2645
+ }));
2502
2646
  };
2503
2647
 
2504
- var toIndexedObject = toIndexedObject$5;
2648
+ var $$2 = _export;
2649
+ var $includes = arrayIncludes.includes;
2650
+ var fails$2 = fails$l;
2505
2651
  var addToUnscopables = addToUnscopables$2;
2506
- var Iterators = iterators;
2507
- var InternalStateModule = internalState;
2508
- var defineProperty = objectDefineProperty.f;
2509
- var defineIterator = iteratorDefine;
2510
- var createIterResultObject = createIterResultObject$1;
2511
- var DESCRIPTORS = descriptors;
2512
2652
 
2513
- var ARRAY_ITERATOR = 'Array Iterator';
2514
- var setInternalState = InternalStateModule.set;
2515
- var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
2653
+ // FF99+ bug
2654
+ var BROKEN_ON_SPARSE = fails$2(function () {
2655
+ // eslint-disable-next-line es/no-array-prototype-includes -- detection
2656
+ return !Array(1).includes();
2657
+ });
2516
2658
 
2517
- // `Array.prototype.entries` method
2518
- // https://tc39.es/ecma262/#sec-array.prototype.entries
2519
- // `Array.prototype.keys` method
2520
- // https://tc39.es/ecma262/#sec-array.prototype.keys
2521
- // `Array.prototype.values` method
2522
- // https://tc39.es/ecma262/#sec-array.prototype.values
2523
- // `Array.prototype[@@iterator]` method
2524
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
2525
- // `CreateArrayIterator` internal method
2526
- // https://tc39.es/ecma262/#sec-createarrayiterator
2527
- var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
2528
- setInternalState(this, {
2529
- type: ARRAY_ITERATOR,
2530
- target: toIndexedObject(iterated), // target
2531
- index: 0, // next index
2532
- kind: kind // kind
2533
- });
2534
- // `%ArrayIteratorPrototype%.next` method
2535
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
2536
- }, function () {
2537
- var state = getInternalState(this);
2538
- var target = state.target;
2539
- var index = state.index++;
2540
- if (!target || index >= target.length) {
2541
- state.target = undefined;
2542
- return createIterResultObject(undefined, true);
2659
+ // `Array.prototype.includes` method
2660
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
2661
+ $$2({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2662
+ includes: function includes(el /* , fromIndex = 0 */) {
2663
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2543
2664
  }
2544
- switch (state.kind) {
2545
- case 'keys': return createIterResultObject(index, false);
2546
- case 'values': return createIterResultObject(target[index], false);
2547
- } return createIterResultObject([index, target[index]], false);
2548
- }, 'values');
2549
-
2550
- // argumentsList[@@iterator] is %ArrayProto_values%
2551
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
2552
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
2553
- var values = Iterators.Arguments = Iterators.Array;
2665
+ });
2554
2666
 
2555
2667
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2556
- addToUnscopables('keys');
2557
- addToUnscopables('values');
2558
- addToUnscopables('entries');
2559
-
2560
- // V8 ~ Chrome 45- bug
2561
- if (DESCRIPTORS && values.name !== 'values') try {
2562
- defineProperty(values, 'name', { value: 'values' });
2563
- } catch (error) { /* empty */ }
2668
+ addToUnscopables('includes');
2564
2669
 
2565
- var global$2 = global$h;
2670
+ var global$1 = global$h;
2566
2671
  var fails$1 = fails$l;
2567
2672
  var uncurryThis$2 = functionUncurryThis;
2568
2673
  var toString$3 = toString$8;
2569
2674
  var trim = stringTrim.trim;
2570
2675
  var whitespaces = whitespaces$4;
2571
2676
 
2572
- var $parseInt$1 = global$2.parseInt;
2573
- var Symbol$1 = global$2.Symbol;
2574
- var ITERATOR$1 = Symbol$1 && Symbol$1.iterator;
2677
+ var $parseInt$1 = global$1.parseInt;
2678
+ var Symbol$1 = global$1.Symbol;
2679
+ var ITERATOR = Symbol$1 && Symbol$1.iterator;
2575
2680
  var hex = /^[+-]?0x/i;
2576
2681
  var exec = uncurryThis$2(hex.exec);
2577
2682
  var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
2578
2683
  // MS Edge 18- broken with boxed symbols
2579
- || (ITERATOR$1 && !fails$1(function () { $parseInt$1(Object(ITERATOR$1)); }));
2684
+ || (ITERATOR && !fails$1(function () { $parseInt$1(Object(ITERATOR)); }));
2580
2685
 
2581
2686
  // `parseInt` method
2582
2687
  // https://tc39.es/ecma262/#sec-parseint-string-radix
@@ -2596,9 +2701,9 @@ $$1({ global: true, forced: parseInt !== $parseInt }, {
2596
2701
 
2597
2702
  var isObject = isObject$9;
2598
2703
  var classof$1 = classofRaw$1;
2599
- var wellKnownSymbol$3 = wellKnownSymbol$b;
2704
+ var wellKnownSymbol$2 = wellKnownSymbol$b;
2600
2705
 
2601
- var MATCH$1 = wellKnownSymbol$3('match');
2706
+ var MATCH$1 = wellKnownSymbol$2('match');
2602
2707
 
2603
2708
  // `IsRegExp` abstract operation
2604
2709
  // https://tc39.es/ecma262/#sec-isregexp
@@ -2617,9 +2722,9 @@ var notARegexp = function (it) {
2617
2722
  } return it;
2618
2723
  };
2619
2724
 
2620
- var wellKnownSymbol$2 = wellKnownSymbol$b;
2725
+ var wellKnownSymbol$1 = wellKnownSymbol$b;
2621
2726
 
2622
- var MATCH = wellKnownSymbol$2('match');
2727
+ var MATCH = wellKnownSymbol$1('match');
2623
2728
 
2624
2729
  var correctIsRegexpLogic = function (METHOD_NAME) {
2625
2730
  var regexp = /./;
@@ -2660,14 +2765,14 @@ var call$2 = functionCall;
2660
2765
  var defineBuiltIn = defineBuiltIn$5;
2661
2766
  var regexpExec$1 = regexpExec$2;
2662
2767
  var fails = fails$l;
2663
- var wellKnownSymbol$1 = wellKnownSymbol$b;
2664
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
2768
+ var wellKnownSymbol = wellKnownSymbol$b;
2769
+ var createNonEnumerableProperty = createNonEnumerableProperty$5;
2665
2770
 
2666
- var SPECIES = wellKnownSymbol$1('species');
2771
+ var SPECIES = wellKnownSymbol('species');
2667
2772
  var RegExpPrototype = RegExp.prototype;
2668
2773
 
2669
2774
  var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2670
- var SYMBOL = wellKnownSymbol$1(KEY);
2775
+ var SYMBOL = wellKnownSymbol(KEY);
2671
2776
 
2672
2777
  var DELEGATES_TO_SYMBOL = !fails(function () {
2673
2778
  // String methods call symbol-named RegExp methods
@@ -2727,7 +2832,7 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2727
2832
  defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
2728
2833
  }
2729
2834
 
2730
- if (SHAM) createNonEnumerableProperty$1(RegExpPrototype[SYMBOL], 'sham', true);
2835
+ if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
2731
2836
  };
2732
2837
 
2733
2838
  var uncurryThis = functionUncurryThis;
@@ -2844,87 +2949,6 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa
2844
2949
  ];
2845
2950
  });
2846
2951
 
2847
- // iterable DOM collections
2848
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2849
- var domIterables = {
2850
- CSSRuleList: 0,
2851
- CSSStyleDeclaration: 0,
2852
- CSSValueList: 0,
2853
- ClientRectList: 0,
2854
- DOMRectList: 0,
2855
- DOMStringList: 0,
2856
- DOMTokenList: 1,
2857
- DataTransferItemList: 0,
2858
- FileList: 0,
2859
- HTMLAllCollection: 0,
2860
- HTMLCollection: 0,
2861
- HTMLFormElement: 0,
2862
- HTMLSelectElement: 0,
2863
- MediaList: 0,
2864
- MimeTypeArray: 0,
2865
- NamedNodeMap: 0,
2866
- NodeList: 1,
2867
- PaintRequestList: 0,
2868
- Plugin: 0,
2869
- PluginArray: 0,
2870
- SVGLengthList: 0,
2871
- SVGNumberList: 0,
2872
- SVGPathSegList: 0,
2873
- SVGPointList: 0,
2874
- SVGStringList: 0,
2875
- SVGTransformList: 0,
2876
- SourceBufferList: 0,
2877
- StyleSheetList: 0,
2878
- TextTrackCueList: 0,
2879
- TextTrackList: 0,
2880
- TouchList: 0
2881
- };
2882
-
2883
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
2884
- var documentCreateElement = documentCreateElement$2;
2885
-
2886
- var classList = documentCreateElement('span').classList;
2887
- var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
2888
-
2889
- var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
2890
-
2891
- var global$1 = global$h;
2892
- var DOMIterables = domIterables;
2893
- var DOMTokenListPrototype = domTokenListPrototype;
2894
- var ArrayIteratorMethods = es_array_iterator;
2895
- var createNonEnumerableProperty = createNonEnumerableProperty$5;
2896
- var setToStringTag = setToStringTag$3;
2897
- var wellKnownSymbol = wellKnownSymbol$b;
2898
-
2899
- var ITERATOR = wellKnownSymbol('iterator');
2900
- var ArrayValues = ArrayIteratorMethods.values;
2901
-
2902
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
2903
- if (CollectionPrototype) {
2904
- // some Chrome versions have non-configurable methods on DOMTokenList
2905
- if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
2906
- createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
2907
- } catch (error) {
2908
- CollectionPrototype[ITERATOR] = ArrayValues;
2909
- }
2910
- setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
2911
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
2912
- // some Chrome versions have non-configurable methods on DOMTokenList
2913
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
2914
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
2915
- } catch (error) {
2916
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
2917
- }
2918
- }
2919
- }
2920
- };
2921
-
2922
- for (var COLLECTION_NAME in DOMIterables) {
2923
- handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
2924
- }
2925
-
2926
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
2927
-
2928
2952
  const convertNumericInputValue = (value, inputMode) => {
2929
2953
  if (value !== '' && !isNaN(parseFloat(value))) {
2930
2954
  return inputMode === 'numeric' ? parseInt(value, 10) : parseFloat(value);
@@ -3270,4 +3294,4 @@ const useDraftFormHelpers = (isDefaultDraft = false) => {
3270
3294
  };
3271
3295
  };
3272
3296
 
3273
- export { HIDDEN_INPUT_HELPER_IS_DRAFT, ReactHookKeyboardDateTimePicker as ReactHookFormDateTime, ReactHookFormFormControl, ReactHookFormHiddenInput, ReactHookFormNumberField, ReactHookFormProviderWrapper as ReactHookFormProvider, ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormTextField, defaultFormOptions, errorMessages, getDateValue, getDeepProperty, getFormattedValueForDatePicker, hasIntersectionWithFIR, hasMulitpleIntersections, hasValidGeometry, isEmpty, isGeometryDirty, isInteger, isLatitude, isLongitude, isMaximumOneDrawing, isNonOrBothCoordinates, isValidGeoJsonCoordinates, isValidMax, isValidMin, isXHoursAfter, isXHoursBefore, useDraftFormHelpers };
3297
+ export { HIDDEN_INPUT_HELPER_IS_DRAFT, ReactHookKeyboardDateTimePicker as ReactHookFormDateTime, ReactHookFormFormControl, ReactHookFormHiddenInput, ReactHookFormNumberField, ReactHookFormProviderWrapper as ReactHookFormProvider, ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormTextField, countIntersectionPoints, defaultFormOptions, errorMessages, getDateValue, getDeepProperty, getFormattedValueForDatePicker, hasIntersectionWithFIR, hasMulitpleIntersections, hasValidGeometry, isEmpty, isGeometryDirty, isInteger, isLatitude, isLongitude, isMaximumOneDrawing, isNonOrBothCoordinates, isValidGeoJsonCoordinates, isValidMax, isValidMin, isXHoursAfter, isXHoursBefore, useDraftFormHelpers };