@vention/vention-cli 0.34.15 → 0.35.1

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/main.esm.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command, Option } from 'commander';
3
3
  import chalk from 'chalk';
4
- import fs, { promises } from 'fs';
5
4
  import { z } from 'zod';
5
+ import fs, { promises } from 'fs';
6
6
  import path$2 from 'path';
7
7
  import { createRequire } from 'module';
8
8
  import { select, password } from '@inquirer/prompts';
@@ -11,6 +11,11 @@ import http from 'http';
11
11
  import { URLSearchParams as URLSearchParams$2 } from 'url';
12
12
  import { once } from 'events';
13
13
  import crypto from 'crypto';
14
+ import { spawn } from 'node:child_process';
15
+ import { release } from 'node:os';
16
+ import { createHash, randomBytes } from 'node:crypto';
17
+ import { once as once$1 } from 'node:events';
18
+ import { createServer } from 'node:http';
14
19
 
15
20
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
16
21
 
@@ -69,15 +74,15 @@ var objectPropertyIsEnumerable = {};
69
74
 
70
75
  var $propertyIsEnumerable = {}.propertyIsEnumerable;
71
76
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
72
- var getOwnPropertyDescriptor$5 = Object.getOwnPropertyDescriptor;
77
+ var getOwnPropertyDescriptor$6 = Object.getOwnPropertyDescriptor;
73
78
 
74
79
  // Nashorn ~ JDK8 bug
75
- var NASHORN_BUG = getOwnPropertyDescriptor$5 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
80
+ var NASHORN_BUG = getOwnPropertyDescriptor$6 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
76
81
 
77
82
  // `Object.prototype.propertyIsEnumerable` method implementation
78
83
  // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
79
84
  objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
80
- var descriptor = getOwnPropertyDescriptor$5(this, V);
85
+ var descriptor = getOwnPropertyDescriptor$6(this, V);
81
86
  return !!descriptor && descriptor.enumerable;
82
87
  } : $propertyIsEnumerable;
83
88
 
@@ -103,21 +108,21 @@ var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
103
108
  };
104
109
  };
105
110
 
106
- var uncurryThis$M = functionUncurryThis;
111
+ var uncurryThis$N = functionUncurryThis;
107
112
 
108
- var toString$k = uncurryThis$M({}.toString);
109
- var stringSlice$b = uncurryThis$M(''.slice);
113
+ var toString$l = uncurryThis$N({}.toString);
114
+ var stringSlice$b = uncurryThis$N(''.slice);
110
115
 
111
116
  var classofRaw$2 = function (it) {
112
- return stringSlice$b(toString$k(it), 8, -1);
117
+ return stringSlice$b(toString$l(it), 8, -1);
113
118
  };
114
119
 
115
- var uncurryThis$L = functionUncurryThis;
120
+ var uncurryThis$M = functionUncurryThis;
116
121
  var fails$C = fails$F;
117
122
  var classof$h = classofRaw$2;
118
123
 
119
124
  var $Object$4 = Object;
120
- var split$3 = uncurryThis$L(''.split);
125
+ var split$3 = uncurryThis$M(''.split);
121
126
 
122
127
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
123
128
  var indexedObject = fails$C(function () {
@@ -140,17 +145,17 @@ var $TypeError$q = TypeError;
140
145
 
141
146
  // `RequireObjectCoercible` abstract operation
142
147
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
143
- var requireObjectCoercible$a = function (it) {
148
+ var requireObjectCoercible$b = function (it) {
144
149
  if (isNullOrUndefined$3(it)) throw new $TypeError$q("Can't call method on " + it);
145
150
  return it;
146
151
  };
147
152
 
148
153
  // toObject with fallback for non-array-like ES3 strings
149
154
  var IndexedObject$3 = indexedObject;
150
- var requireObjectCoercible$9 = requireObjectCoercible$a;
155
+ var requireObjectCoercible$a = requireObjectCoercible$b;
151
156
 
152
157
  var toIndexedObject$6 = function (it) {
153
- return IndexedObject$3(requireObjectCoercible$9(it));
158
+ return IndexedObject$3(requireObjectCoercible$a(it));
154
159
  };
155
160
 
156
161
  // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
@@ -182,9 +187,9 @@ var getBuiltIn$c = function (namespace, method) {
182
187
  return arguments.length < 2 ? aFunction(globalThis$R[namespace]) : globalThis$R[namespace] && globalThis$R[namespace][method];
183
188
  };
184
189
 
185
- var uncurryThis$K = functionUncurryThis;
190
+ var uncurryThis$L = functionUncurryThis;
186
191
 
187
- var objectIsPrototypeOf = uncurryThis$K({}.isPrototypeOf);
192
+ var objectIsPrototypeOf = uncurryThis$L({}.isPrototypeOf);
188
193
 
189
194
  var globalThis$Q = globalThis_1;
190
195
 
@@ -347,20 +352,20 @@ var shared$4 = function (key, value) {
347
352
  return store$2[key] || (store$2[key] = value || {});
348
353
  };
349
354
 
350
- var requireObjectCoercible$8 = requireObjectCoercible$a;
355
+ var requireObjectCoercible$9 = requireObjectCoercible$b;
351
356
 
352
357
  var $Object$2 = Object;
353
358
 
354
359
  // `ToObject` abstract operation
355
360
  // https://tc39.es/ecma262/#sec-toobject
356
361
  var toObject$b = function (argument) {
357
- return $Object$2(requireObjectCoercible$8(argument));
362
+ return $Object$2(requireObjectCoercible$9(argument));
358
363
  };
359
364
 
360
- var uncurryThis$J = functionUncurryThis;
365
+ var uncurryThis$K = functionUncurryThis;
361
366
  var toObject$a = toObject$b;
362
367
 
363
- var hasOwnProperty = uncurryThis$J({}.hasOwnProperty);
368
+ var hasOwnProperty = uncurryThis$K({}.hasOwnProperty);
364
369
 
365
370
  // `HasOwnProperty` abstract operation
366
371
  // https://tc39.es/ecma262/#sec-hasownproperty
@@ -369,14 +374,14 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
369
374
  return hasOwnProperty(toObject$a(it), key);
370
375
  };
371
376
 
372
- var uncurryThis$I = functionUncurryThis;
377
+ var uncurryThis$J = functionUncurryThis;
373
378
 
374
379
  var id = 0;
375
380
  var postfix = Math.random();
376
- var toString$j = uncurryThis$I(1.1.toString);
381
+ var toString$k = uncurryThis$J(1.1.toString);
377
382
 
378
383
  var uid$4 = function (key) {
379
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$j(++id + postfix, 36);
384
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$k(++id + postfix, 36);
380
385
  };
381
386
 
382
387
  var globalThis$L = globalThis_1;
@@ -580,11 +585,11 @@ var functionName = {
580
585
  CONFIGURABLE: CONFIGURABLE
581
586
  };
582
587
 
583
- var uncurryThis$H = functionUncurryThis;
588
+ var uncurryThis$I = functionUncurryThis;
584
589
  var isCallable$n = isCallable$t;
585
590
  var store$1 = sharedStoreExports;
586
591
 
587
- var functionToString = uncurryThis$H(Function.toString);
592
+ var functionToString = uncurryThis$I(Function.toString);
588
593
 
589
594
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
590
595
  if (!isCallable$n(store$1.inspectSource)) {
@@ -684,7 +689,7 @@ var internalState = {
684
689
  getterFor: getterFor
685
690
  };
686
691
 
687
- var uncurryThis$G = functionUncurryThis;
692
+ var uncurryThis$H = functionUncurryThis;
688
693
  var fails$y = fails$F;
689
694
  var isCallable$l = isCallable$t;
690
695
  var hasOwn$h = hasOwnProperty_1;
@@ -698,9 +703,9 @@ var getInternalState$7 = InternalStateModule$9.get;
698
703
  var $String$4 = String;
699
704
  // eslint-disable-next-line es/no-object-defineproperty -- safe
700
705
  var defineProperty$6 = Object.defineProperty;
701
- var stringSlice$a = uncurryThis$G(''.slice);
702
- var replace$a = uncurryThis$G(''.replace);
703
- var join$5 = uncurryThis$G([].join);
706
+ var stringSlice$a = uncurryThis$H(''.slice);
707
+ var replace$a = uncurryThis$H(''.replace);
708
+ var join$5 = uncurryThis$H([].join);
704
709
 
705
710
  var CONFIGURABLE_LENGTH = DESCRIPTORS$m && !fails$y(function () {
706
711
  return defineProperty$6(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
@@ -795,33 +800,33 @@ var toIntegerOrInfinity$b = function (argument) {
795
800
  var toIntegerOrInfinity$a = toIntegerOrInfinity$b;
796
801
 
797
802
  var max$3 = Math.max;
798
- var min$5 = Math.min;
803
+ var min$6 = Math.min;
799
804
 
800
805
  // Helper for a popular repeating case of the spec:
801
806
  // Let integer be ? ToInteger(index).
802
807
  // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
803
808
  var toAbsoluteIndex$4 = function (index, length) {
804
809
  var integer = toIntegerOrInfinity$a(index);
805
- return integer < 0 ? max$3(integer + length, 0) : min$5(integer, length);
810
+ return integer < 0 ? max$3(integer + length, 0) : min$6(integer, length);
806
811
  };
807
812
 
808
813
  var toIntegerOrInfinity$9 = toIntegerOrInfinity$b;
809
814
 
810
- var min$4 = Math.min;
815
+ var min$5 = Math.min;
811
816
 
812
817
  // `ToLength` abstract operation
813
818
  // https://tc39.es/ecma262/#sec-tolength
814
- var toLength$6 = function (argument) {
819
+ var toLength$7 = function (argument) {
815
820
  var len = toIntegerOrInfinity$9(argument);
816
- return len > 0 ? min$4(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
821
+ return len > 0 ? min$5(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
817
822
  };
818
823
 
819
- var toLength$5 = toLength$6;
824
+ var toLength$6 = toLength$7;
820
825
 
821
826
  // `LengthOfArrayLike` abstract operation
822
827
  // https://tc39.es/ecma262/#sec-lengthofarraylike
823
828
  var lengthOfArrayLike$g = function (obj) {
824
- return toLength$5(obj.length);
829
+ return toLength$6(obj.length);
825
830
  };
826
831
 
827
832
  var toIndexedObject$4 = toIndexedObject$6;
@@ -858,13 +863,13 @@ var arrayIncludes = {
858
863
  indexOf: createMethod$5(false)
859
864
  };
860
865
 
861
- var uncurryThis$F = functionUncurryThis;
866
+ var uncurryThis$G = functionUncurryThis;
862
867
  var hasOwn$g = hasOwnProperty_1;
863
868
  var toIndexedObject$3 = toIndexedObject$6;
864
869
  var indexOf$1 = arrayIncludes.indexOf;
865
870
  var hiddenKeys$2 = hiddenKeys$4;
866
871
 
867
- var push$8 = uncurryThis$F([].push);
872
+ var push$8 = uncurryThis$G([].push);
868
873
 
869
874
  var objectKeysInternal = function (object, names) {
870
875
  var O = toIndexedObject$3(object);
@@ -908,12 +913,12 @@ var objectGetOwnPropertySymbols = {};
908
913
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
909
914
 
910
915
  var getBuiltIn$a = getBuiltIn$c;
911
- var uncurryThis$E = functionUncurryThis;
916
+ var uncurryThis$F = functionUncurryThis;
912
917
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
913
918
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
914
919
  var anObject$n = anObject$p;
915
920
 
916
- var concat$2 = uncurryThis$E([].concat);
921
+ var concat$2 = uncurryThis$F([].concat);
917
922
 
918
923
  // all object keys, includes non-enumerable and symbols
919
924
  var ownKeys$1 = getBuiltIn$a('Reflect', 'ownKeys') || function ownKeys(it) {
@@ -963,7 +968,7 @@ var POLYFILL = isForced$3.POLYFILL = 'P';
963
968
  var isForced_1 = isForced$3;
964
969
 
965
970
  var globalThis$H = globalThis_1;
966
- var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
971
+ var getOwnPropertyDescriptor$5 = objectGetOwnPropertyDescriptor.f;
967
972
  var createNonEnumerableProperty$b = createNonEnumerableProperty$d;
968
973
  var defineBuiltIn$d = defineBuiltIn$e;
969
974
  var defineGlobalProperty = defineGlobalProperty$3;
@@ -1000,7 +1005,7 @@ var _export = function (options, source) {
1000
1005
  if (target) for (key in source) {
1001
1006
  sourceProperty = source[key];
1002
1007
  if (options.dontCallGetSet) {
1003
- descriptor = getOwnPropertyDescriptor$4(target, key);
1008
+ descriptor = getOwnPropertyDescriptor$5(target, key);
1004
1009
  targetProperty = descriptor && descriptor.value;
1005
1010
  } else targetProperty = target[key];
1006
1011
  FORCED = isForced$2(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
@@ -1060,7 +1065,7 @@ var classof$f = classof$g;
1060
1065
 
1061
1066
  var $String$3 = String;
1062
1067
 
1063
- var toString$i = function (argument) {
1068
+ var toString$j = function (argument) {
1064
1069
  if (classof$f(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1065
1070
  return $String$3(argument);
1066
1071
  };
@@ -1074,15 +1079,15 @@ var defineBuiltInAccessor$c = function (target, name, descriptor) {
1074
1079
  return defineProperty$5.f(target, name, descriptor);
1075
1080
  };
1076
1081
 
1077
- var $$M = _export;
1082
+ var $$N = _export;
1078
1083
  var DESCRIPTORS$l = descriptors;
1079
1084
  var globalThis$G = globalThis_1;
1080
1085
  var call$x = functionCall;
1081
- var uncurryThis$D = functionUncurryThis;
1086
+ var uncurryThis$E = functionUncurryThis;
1082
1087
  var hasOwn$e = hasOwnProperty_1;
1083
1088
  var isCallable$h = isCallable$t;
1084
1089
  var isPrototypeOf$7 = objectIsPrototypeOf;
1085
- var toString$h = toString$i;
1090
+ var toString$i = toString$j;
1086
1091
  var defineBuiltInAccessor$b = defineBuiltInAccessor$c;
1087
1092
  var copyConstructorProperties$2 = copyConstructorProperties$4;
1088
1093
 
@@ -1096,7 +1101,7 @@ if (DESCRIPTORS$l && isCallable$h(NativeSymbol) && (!('description' in SymbolPro
1096
1101
  var EmptyStringDescriptionStore = {};
1097
1102
  // wrap Symbol constructor for correct work with undefined description
1098
1103
  var SymbolWrapper = function Symbol() {
1099
- var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$h(arguments[0]);
1104
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$i(arguments[0]);
1100
1105
  var result = isPrototypeOf$7(SymbolPrototype, this)
1101
1106
  // eslint-disable-next-line sonarjs/inconsistent-function-call -- ok
1102
1107
  ? new NativeSymbol(description)
@@ -1110,7 +1115,7 @@ if (DESCRIPTORS$l && isCallable$h(NativeSymbol) && (!('description' in SymbolPro
1110
1115
  // wrap Symbol.for for correct handling of empty string descriptions
1111
1116
  var nativeFor = SymbolWrapper['for'];
1112
1117
  SymbolWrapper['for'] = { 'for': function (key) {
1113
- var stringKey = toString$h(key);
1118
+ var stringKey = toString$i(key);
1114
1119
  var symbol = call$x(nativeFor, this, stringKey);
1115
1120
  if (stringKey === '') EmptyStringDescriptionStore[symbol] = true;
1116
1121
  return symbol;
@@ -1119,11 +1124,11 @@ if (DESCRIPTORS$l && isCallable$h(NativeSymbol) && (!('description' in SymbolPro
1119
1124
  SymbolPrototype.constructor = SymbolWrapper;
1120
1125
 
1121
1126
  var NATIVE_SYMBOL$2 = String(NativeSymbol('description detection')) === 'Symbol(description detection)';
1122
- var thisSymbolValue = uncurryThis$D(SymbolPrototype.valueOf);
1123
- var symbolDescriptiveString = uncurryThis$D(SymbolPrototype.toString);
1127
+ var thisSymbolValue = uncurryThis$E(SymbolPrototype.valueOf);
1128
+ var symbolDescriptiveString = uncurryThis$E(SymbolPrototype.toString);
1124
1129
  var regexp = /^Symbol\((.*)\)[^)]+$/;
1125
- var replace$9 = uncurryThis$D(''.replace);
1126
- var stringSlice$9 = uncurryThis$D(''.slice);
1130
+ var replace$9 = uncurryThis$E(''.replace);
1131
+ var stringSlice$9 = uncurryThis$E(''.slice);
1127
1132
 
1128
1133
  defineBuiltInAccessor$b(SymbolPrototype, 'description', {
1129
1134
  configurable: true,
@@ -1136,7 +1141,7 @@ if (DESCRIPTORS$l && isCallable$h(NativeSymbol) && (!('description' in SymbolPro
1136
1141
  }
1137
1142
  });
1138
1143
 
1139
- $$M({ global: true, constructor: true, forced: true }, {
1144
+ $$N({ global: true, constructor: true, forced: true }, {
1140
1145
  Symbol: SymbolWrapper
1141
1146
  });
1142
1147
  }
@@ -1284,7 +1289,7 @@ var addToUnscopables$3 = function (key) {
1284
1289
  ArrayPrototype$1[UNSCOPABLES][key] = true;
1285
1290
  };
1286
1291
 
1287
- var $$L = _export;
1292
+ var $$M = _export;
1288
1293
  var $includes = arrayIncludes.includes;
1289
1294
  var fails$w = fails$F;
1290
1295
  var addToUnscopables$2 = addToUnscopables$3;
@@ -1303,7 +1308,7 @@ var BROKEN_ON_SPARSE_WITH_FROM_INDEX = fails$w(function () {
1303
1308
 
1304
1309
  // `Array.prototype.includes` method
1305
1310
  // https://tc39.es/ecma262/#sec-array.prototype.includes
1306
- $$L({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {
1311
+ $$M({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {
1307
1312
  includes: function includes(el /* , fromIndex = 0 */) {
1308
1313
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
1309
1314
  }
@@ -1341,13 +1346,13 @@ var globalThis$E = globalThis_1;
1341
1346
 
1342
1347
  var path$1 = globalThis$E;
1343
1348
 
1344
- var uncurryThis$C = functionUncurryThis;
1349
+ var uncurryThis$D = functionUncurryThis;
1345
1350
  var aCallable$h = aCallable$j;
1346
1351
 
1347
1352
  var functionUncurryThisAccessor = function (object, key, method) {
1348
1353
  try {
1349
1354
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1350
- return uncurryThis$C(aCallable$h(Object.getOwnPropertyDescriptor(object, key)[method]));
1355
+ return uncurryThis$D(aCallable$h(Object.getOwnPropertyDescriptor(object, key)[method]));
1351
1356
  } catch (error) { /* empty */ }
1352
1357
  };
1353
1358
 
@@ -1370,7 +1375,7 @@ var aPossiblePrototype$1 = function (argument) {
1370
1375
  /* eslint-disable no-proto -- safe */
1371
1376
  var uncurryThisAccessor$3 = functionUncurryThisAccessor;
1372
1377
  var isObject$f = isObject$m;
1373
- var requireObjectCoercible$7 = requireObjectCoercible$a;
1378
+ var requireObjectCoercible$8 = requireObjectCoercible$b;
1374
1379
  var aPossiblePrototype = aPossiblePrototype$1;
1375
1380
 
1376
1381
  // `Object.setPrototypeOf` method
@@ -1387,7 +1392,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1387
1392
  CORRECT_SETTER = test instanceof Array;
1388
1393
  } catch (error) { /* empty */ }
1389
1394
  return function setPrototypeOf(O, proto) {
1390
- requireObjectCoercible$7(O);
1395
+ requireObjectCoercible$8(O);
1391
1396
  aPossiblePrototype(proto);
1392
1397
  if (!isObject$f(O)) return O;
1393
1398
  if (CORRECT_SETTER) setter(O, proto);
@@ -1436,7 +1441,7 @@ var anInstance$6 = function (it, Prototype) {
1436
1441
  throw new $TypeError$j('Incorrect invocation');
1437
1442
  };
1438
1443
 
1439
- var uncurryThis$B = functionUncurryThis;
1444
+ var uncurryThis$C = functionUncurryThis;
1440
1445
  var fails$v = fails$F;
1441
1446
  var isCallable$g = isCallable$t;
1442
1447
  var classof$d = classof$g;
@@ -1446,7 +1451,7 @@ var inspectSource$1 = inspectSource$3;
1446
1451
  var noop = function () { /* empty */ };
1447
1452
  var construct = getBuiltIn$7('Reflect', 'construct');
1448
1453
  var constructorRegExp = /^\s*(?:class|function)\b/;
1449
- var exec$8 = uncurryThis$B(constructorRegExp.exec);
1454
+ var exec$8 = uncurryThis$C(constructorRegExp.exec);
1450
1455
  var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
1451
1456
 
1452
1457
  var isConstructorModern = function isConstructor(argument) {
@@ -1526,20 +1531,20 @@ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$
1526
1531
  });
1527
1532
 
1528
1533
  var classofRaw = classofRaw$2;
1529
- var uncurryThis$A = functionUncurryThis;
1534
+ var uncurryThis$B = functionUncurryThis;
1530
1535
 
1531
1536
  var functionUncurryThisClause = function (fn) {
1532
1537
  // Nashorn bug:
1533
1538
  // https://github.com/zloirock/core-js/issues/1128
1534
1539
  // https://github.com/zloirock/core-js/issues/1130
1535
- if (classofRaw(fn) === 'Function') return uncurryThis$A(fn);
1540
+ if (classofRaw(fn) === 'Function') return uncurryThis$B(fn);
1536
1541
  };
1537
1542
 
1538
- var uncurryThis$z = functionUncurryThisClause;
1543
+ var uncurryThis$A = functionUncurryThisClause;
1539
1544
  var aCallable$g = aCallable$j;
1540
1545
  var NATIVE_BIND = functionBindNative;
1541
1546
 
1542
- var bind$b = uncurryThis$z(uncurryThis$z.bind);
1547
+ var bind$b = uncurryThis$A(uncurryThis$A.bind);
1543
1548
 
1544
1549
  // optional / simple context binding
1545
1550
  var functionBindContext = function (fn, that) {
@@ -1549,9 +1554,9 @@ var functionBindContext = function (fn, that) {
1549
1554
  };
1550
1555
  };
1551
1556
 
1552
- var uncurryThis$y = functionUncurryThis;
1557
+ var uncurryThis$z = functionUncurryThis;
1553
1558
 
1554
- var arraySlice$6 = uncurryThis$y([].slice);
1559
+ var arraySlice$6 = uncurryThis$z([].slice);
1555
1560
 
1556
1561
  var $TypeError$h = TypeError;
1557
1562
 
@@ -1683,12 +1688,12 @@ var globalThis$C = globalThis_1;
1683
1688
  var DESCRIPTORS$i = descriptors;
1684
1689
 
1685
1690
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1686
- var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
1691
+ var getOwnPropertyDescriptor$4 = Object.getOwnPropertyDescriptor;
1687
1692
 
1688
1693
  // Avoid NodeJS experimental warning
1689
1694
  var safeGetBuiltIn$2 = function (name) {
1690
1695
  if (!DESCRIPTORS$i) return globalThis$C[name];
1691
- var descriptor = getOwnPropertyDescriptor$3(globalThis$C, name);
1696
+ var descriptor = getOwnPropertyDescriptor$4(globalThis$C, name);
1692
1697
  return descriptor && descriptor.value;
1693
1698
  };
1694
1699
 
@@ -1890,7 +1895,7 @@ newPromiseCapability$2.f = function (C) {
1890
1895
  return new PromiseCapability(C);
1891
1896
  };
1892
1897
 
1893
- var $$K = _export;
1898
+ var $$L = _export;
1894
1899
  var IS_NODE$1 = environmentIsNode;
1895
1900
  var globalThis$y = globalThis_1;
1896
1901
  var path = path$1;
@@ -2173,7 +2178,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
2173
2178
 
2174
2179
  // `Promise` constructor
2175
2180
  // https://tc39.es/ecma262/#sec-promise-executor
2176
- $$K({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
2181
+ $$L({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
2177
2182
  Promise: PromiseConstructor
2178
2183
  });
2179
2184
 
@@ -2372,7 +2377,7 @@ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCor
2372
2377
  NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
2373
2378
  });
2374
2379
 
2375
- var $$J = _export;
2380
+ var $$K = _export;
2376
2381
  var call$r = functionCall;
2377
2382
  var aCallable$c = aCallable$j;
2378
2383
  var newPromiseCapabilityModule$2 = newPromiseCapability$2;
@@ -2382,7 +2387,7 @@ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
2382
2387
 
2383
2388
  // `Promise.all` method
2384
2389
  // https://tc39.es/ecma262/#sec-promise.all
2385
- $$J({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2390
+ $$K({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2386
2391
  all: function all(iterable) {
2387
2392
  var C = this;
2388
2393
  var capability = newPromiseCapabilityModule$2.f(C);
@@ -2411,7 +2416,7 @@ $$J({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
2411
2416
  }
2412
2417
  });
2413
2418
 
2414
- var $$I = _export;
2419
+ var $$J = _export;
2415
2420
  var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2416
2421
  var NativePromiseConstructor = promiseNativeConstructor;
2417
2422
  var getBuiltIn$6 = getBuiltIn$c;
@@ -2422,7 +2427,7 @@ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructo
2422
2427
 
2423
2428
  // `Promise.prototype.catch` method
2424
2429
  // https://tc39.es/ecma262/#sec-promise.prototype.catch
2425
- $$I({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2430
+ $$J({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2426
2431
  'catch': function (onRejected) {
2427
2432
  return this.then(undefined, onRejected);
2428
2433
  }
@@ -2436,7 +2441,7 @@ if (isCallable$c(NativePromiseConstructor)) {
2436
2441
  }
2437
2442
  }
2438
2443
 
2439
- var $$H = _export;
2444
+ var $$I = _export;
2440
2445
  var call$q = functionCall;
2441
2446
  var aCallable$b = aCallable$j;
2442
2447
  var newPromiseCapabilityModule$1 = newPromiseCapability$2;
@@ -2446,7 +2451,7 @@ var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
2446
2451
 
2447
2452
  // `Promise.race` method
2448
2453
  // https://tc39.es/ecma262/#sec-promise.race
2449
- $$H({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2454
+ $$I({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2450
2455
  race: function race(iterable) {
2451
2456
  var C = this;
2452
2457
  var capability = newPromiseCapabilityModule$1.f(C);
@@ -2462,13 +2467,13 @@ $$H({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
2462
2467
  }
2463
2468
  });
2464
2469
 
2465
- var $$G = _export;
2470
+ var $$H = _export;
2466
2471
  var newPromiseCapabilityModule = newPromiseCapability$2;
2467
2472
  var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2468
2473
 
2469
2474
  // `Promise.reject` method
2470
2475
  // https://tc39.es/ecma262/#sec-promise.reject
2471
- $$G({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2476
+ $$H({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2472
2477
  reject: function reject(r) {
2473
2478
  var capability = newPromiseCapabilityModule.f(this);
2474
2479
  var capabilityReject = capability.reject;
@@ -2490,7 +2495,7 @@ var promiseResolve$1 = function (C, x) {
2490
2495
  return promiseCapability.promise;
2491
2496
  };
2492
2497
 
2493
- var $$F = _export;
2498
+ var $$G = _export;
2494
2499
  var getBuiltIn$5 = getBuiltIn$c;
2495
2500
  var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2496
2501
  var promiseResolve = promiseResolve$1;
@@ -2499,7 +2504,7 @@ getBuiltIn$5('Promise');
2499
2504
 
2500
2505
  // `Promise.resolve` method
2501
2506
  // https://tc39.es/ecma262/#sec-promise.resolve
2502
- $$F({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2507
+ $$G({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2503
2508
  resolve: function resolve(x) {
2504
2509
  return promiseResolve(this, x);
2505
2510
  }
@@ -2544,22 +2549,22 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
2544
2549
  } return false;
2545
2550
  };
2546
2551
 
2547
- var $$E = _export;
2548
- var uncurryThis$x = functionUncurryThis;
2549
- var notARegExp$1 = notARegexp;
2550
- var requireObjectCoercible$6 = requireObjectCoercible$a;
2551
- var toString$g = toString$i;
2552
- var correctIsRegExpLogic$1 = correctIsRegexpLogic;
2552
+ var $$F = _export;
2553
+ var uncurryThis$y = functionUncurryThis;
2554
+ var notARegExp$2 = notARegexp;
2555
+ var requireObjectCoercible$7 = requireObjectCoercible$b;
2556
+ var toString$h = toString$j;
2557
+ var correctIsRegExpLogic$2 = correctIsRegexpLogic;
2553
2558
 
2554
- var stringIndexOf$2 = uncurryThis$x(''.indexOf);
2559
+ var stringIndexOf$2 = uncurryThis$y(''.indexOf);
2555
2560
 
2556
2561
  // `String.prototype.includes` method
2557
2562
  // https://tc39.es/ecma262/#sec-string.prototype.includes
2558
- $$E({ target: 'String', proto: true, forced: !correctIsRegExpLogic$1('includes') }, {
2563
+ $$F({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, {
2559
2564
  includes: function includes(searchString /* , position = 0 */) {
2560
2565
  return !!~stringIndexOf$2(
2561
- toString$g(requireObjectCoercible$6(this)),
2562
- toString$g(notARegExp$1(searchString)),
2566
+ toString$h(requireObjectCoercible$7(this)),
2567
+ toString$h(notARegExp$2(searchString)),
2563
2568
  arguments.length > 1 ? arguments[1] : undefined
2564
2569
  );
2565
2570
  }
@@ -2669,7 +2674,7 @@ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUME
2669
2674
  return IteratorConstructor;
2670
2675
  };
2671
2676
 
2672
- var $$D = _export;
2677
+ var $$E = _export;
2673
2678
  var call$p = functionCall;
2674
2679
  var FunctionName$1 = functionName;
2675
2680
  var isCallable$9 = isCallable$t;
@@ -2757,7 +2762,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
2757
2762
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
2758
2763
  defineBuiltIn$9(IterablePrototype, KEY, methods[KEY]);
2759
2764
  }
2760
- } else $$D({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
2765
+ } else $$E({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
2761
2766
  }
2762
2767
 
2763
2768
  // define iterator
@@ -2845,7 +2850,7 @@ var createProperty$6 = function (object, key, value) {
2845
2850
  else object[key] = value;
2846
2851
  };
2847
2852
 
2848
- var $$C = _export;
2853
+ var $$D = _export;
2849
2854
  var globalThis$x = globalThis_1;
2850
2855
  var anInstance$4 = anInstance$6;
2851
2856
  var anObject$f = anObject$p;
@@ -2904,7 +2909,7 @@ IteratorConstructor.prototype = IteratorPrototype$1;
2904
2909
 
2905
2910
  // `Iterator` constructor
2906
2911
  // https://tc39.es/ecma262/#sec-iterator
2907
- $$C({ global: true, constructor: true, forced: FORCED$9 }, {
2912
+ $$D({ global: true, constructor: true, forced: FORCED$9 }, {
2908
2913
  Iterator: IteratorConstructor
2909
2914
  });
2910
2915
 
@@ -3077,7 +3082,7 @@ var iteratorHelperWithoutClosingOnEarlyError$5 = function (METHOD_NAME, Expected
3077
3082
  if (!CLOSED) return method;
3078
3083
  };
3079
3084
 
3080
- var $$B = _export;
3085
+ var $$C = _export;
3081
3086
  var call$n = functionCall;
3082
3087
  var aCallable$a = aCallable$j;
3083
3088
  var anObject$d = anObject$p;
@@ -3103,7 +3108,7 @@ var IteratorProxy$2 = createIteratorProxy$2(function () {
3103
3108
 
3104
3109
  // `Iterator.prototype.map` method
3105
3110
  // https://tc39.es/ecma262/#sec-iterator.prototype.map
3106
- $$B({ target: 'Iterator', proto: true, real: true, forced: FORCED$8 }, {
3111
+ $$C({ target: 'Iterator', proto: true, real: true, forced: FORCED$8 }, {
3107
3112
  map: function map(mapper) {
3108
3113
  anObject$d(this);
3109
3114
  try {
@@ -3138,15 +3143,15 @@ var isRawJson = function isRawJSON(O) {
3138
3143
  return !!state && state.type === 'RawJSON';
3139
3144
  };
3140
3145
 
3141
- var uncurryThis$w = functionUncurryThis;
3146
+ var uncurryThis$x = functionUncurryThis;
3142
3147
  var hasOwn$9 = hasOwnProperty_1;
3143
3148
 
3144
3149
  var $SyntaxError = SyntaxError;
3145
3150
  var $parseInt$1 = parseInt;
3146
3151
  var fromCharCode$3 = String.fromCharCode;
3147
- var at$2 = uncurryThis$w(''.charAt);
3148
- var slice$4 = uncurryThis$w(''.slice);
3149
- var exec$7 = uncurryThis$w(/./.exec);
3152
+ var at$2 = uncurryThis$x(''.charAt);
3153
+ var slice$5 = uncurryThis$x(''.slice);
3154
+ var exec$7 = uncurryThis$x(/./.exec);
3150
3155
 
3151
3156
  var codePoints = {
3152
3157
  '\\"': '"',
@@ -3169,13 +3174,13 @@ var parseJsonString = function (source, i) {
3169
3174
  while (i < source.length) {
3170
3175
  var chr = at$2(source, i);
3171
3176
  if (chr === '\\') {
3172
- var twoChars = slice$4(source, i, i + 2);
3177
+ var twoChars = slice$5(source, i, i + 2);
3173
3178
  if (hasOwn$9(codePoints, twoChars)) {
3174
3179
  value += codePoints[twoChars];
3175
3180
  i += 2;
3176
3181
  } else if (twoChars === '\\u') {
3177
3182
  i += 2;
3178
- var fourHexDigits = slice$4(source, i, i + 4);
3183
+ var fourHexDigits = slice$5(source, i, i + 4);
3179
3184
  if (!exec$7(IS_4_HEX_DIGITS, fourHexDigits)) throw new $SyntaxError('Bad Unicode escape at: ' + i);
3180
3185
  value += fromCharCode$3($parseInt$1(fourHexDigits, 16));
3181
3186
  i += 4;
@@ -3205,18 +3210,18 @@ var nativeRawJson = !fails$q(function () {
3205
3210
  return !JSON.isRawJSON(raw) || JSON.stringify(raw) !== unsafeInt;
3206
3211
  });
3207
3212
 
3208
- var $$A = _export;
3213
+ var $$B = _export;
3209
3214
  var getBuiltIn$4 = getBuiltIn$c;
3210
3215
  var apply$3 = functionApply;
3211
3216
  var call$m = functionCall;
3212
- var uncurryThis$v = functionUncurryThis;
3217
+ var uncurryThis$w = functionUncurryThis;
3213
3218
  var fails$p = fails$F;
3214
3219
  var isArray$4 = isArray$5;
3215
3220
  var isCallable$7 = isCallable$t;
3216
3221
  var isRawJSON = isRawJson;
3217
3222
  var isSymbol$1 = isSymbol$4;
3218
3223
  var classof$9 = classofRaw$2;
3219
- var toString$f = toString$i;
3224
+ var toString$g = toString$j;
3220
3225
  var arraySlice$4 = arraySlice$6;
3221
3226
  var parseJSONString$1 = parseJsonString;
3222
3227
  var uid$1 = uid$4;
@@ -3225,13 +3230,13 @@ var NATIVE_RAW_JSON = nativeRawJson;
3225
3230
 
3226
3231
  var $String$1 = String;
3227
3232
  var $stringify = getBuiltIn$4('JSON', 'stringify');
3228
- var exec$6 = uncurryThis$v(/./.exec);
3229
- var charAt$9 = uncurryThis$v(''.charAt);
3230
- var charCodeAt$2 = uncurryThis$v(''.charCodeAt);
3231
- var replace$8 = uncurryThis$v(''.replace);
3232
- var slice$3 = uncurryThis$v(''.slice);
3233
- var push$7 = uncurryThis$v([].push);
3234
- var numberToString$2 = uncurryThis$v(1.1.toString);
3233
+ var exec$6 = uncurryThis$w(/./.exec);
3234
+ var charAt$9 = uncurryThis$w(''.charAt);
3235
+ var charCodeAt$2 = uncurryThis$w(''.charCodeAt);
3236
+ var replace$8 = uncurryThis$w(''.replace);
3237
+ var slice$4 = uncurryThis$w(''.slice);
3238
+ var push$7 = uncurryThis$w([].push);
3239
+ var numberToString$2 = uncurryThis$w(1.1.toString);
3235
3240
 
3236
3241
  var surrogates = /[\uD800-\uDFFF]/g;
3237
3242
  var leadingSurrogates = /^[\uD800-\uDBFF]$/;
@@ -3287,7 +3292,7 @@ var getReplacerFunction = function (replacer) {
3287
3292
  for (var i = 0; i < rawLength; i++) {
3288
3293
  var element = replacer[i];
3289
3294
  if (typeof element == 'string') push$7(keys, element);
3290
- else if (typeof element == 'number' || classof$9(element) === 'Number' || classof$9(element) === 'String') push$7(keys, toString$f(element));
3295
+ else if (typeof element == 'number' || classof$9(element) === 'Number' || classof$9(element) === 'String') push$7(keys, toString$g(element));
3291
3296
  }
3292
3297
  var keysLength = keys.length;
3293
3298
  var root = true;
@@ -3304,7 +3309,7 @@ var getReplacerFunction = function (replacer) {
3304
3309
  // `JSON.stringify` method
3305
3310
  // https://tc39.es/ecma262/#sec-json.stringify
3306
3311
  // https://github.com/tc39/proposal-json-parse-with-source
3307
- if ($stringify) $$A({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE || !NATIVE_RAW_JSON }, {
3312
+ if ($stringify) $$B({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE || !NATIVE_RAW_JSON }, {
3308
3313
  stringify: function stringify(text, replacer, space) {
3309
3314
  var replacerFunction = getReplacerFunction(replacer);
3310
3315
  var rawStrings = [];
@@ -3328,9 +3333,9 @@ if ($stringify) $$A({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOL
3328
3333
  var chr = charAt$9(json, i);
3329
3334
  if (chr === '"') {
3330
3335
  var end = parseJSONString$1(json, ++i).end - 1;
3331
- var string = slice$3(json, i, end);
3332
- result += slice$3(string, 0, MARK_LENGTH) === MARK
3333
- ? rawStrings[slice$3(string, MARK_LENGTH)]
3336
+ var string = slice$4(json, i, end);
3337
+ result += slice$4(string, 0, MARK_LENGTH) === MARK
3338
+ ? rawStrings[slice$4(string, MARK_LENGTH)]
3334
3339
  : '"' + string + '"';
3335
3340
  i = end;
3336
3341
  } else result += chr;
@@ -3341,7 +3346,7 @@ if ($stringify) $$A({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOL
3341
3346
  });
3342
3347
 
3343
3348
  var DESCRIPTORS$e = descriptors;
3344
- var uncurryThis$u = functionUncurryThis;
3349
+ var uncurryThis$v = functionUncurryThis;
3345
3350
  var call$l = functionCall;
3346
3351
  var fails$o = fails$F;
3347
3352
  var objectKeys = objectKeys$2;
@@ -3354,7 +3359,7 @@ var IndexedObject$2 = indexedObject;
3354
3359
  var $assign = Object.assign;
3355
3360
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
3356
3361
  var defineProperty$1 = Object.defineProperty;
3357
- var concat$1 = uncurryThis$u([].concat);
3362
+ var concat$1 = uncurryThis$v([].concat);
3358
3363
 
3359
3364
  // `Object.assign` method
3360
3365
  // https://tc39.es/ecma262/#sec-object.assign
@@ -3398,23 +3403,23 @@ var objectAssign = !$assign || fails$o(function () {
3398
3403
  } return T;
3399
3404
  } : $assign;
3400
3405
 
3401
- var $$z = _export;
3406
+ var $$A = _export;
3402
3407
  var assign$1 = objectAssign;
3403
3408
 
3404
3409
  // `Object.assign` method
3405
3410
  // https://tc39.es/ecma262/#sec-object.assign
3406
3411
  // eslint-disable-next-line es/no-object-assign -- required for testing
3407
- $$z({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign$1 }, {
3412
+ $$A({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign$1 }, {
3408
3413
  assign: assign$1
3409
3414
  });
3410
3415
 
3411
- var $$y = _export;
3416
+ var $$z = _export;
3412
3417
  var iterate$4 = iterate$7;
3413
3418
  var createProperty$4 = createProperty$6;
3414
3419
 
3415
3420
  // `Object.fromEntries` method
3416
3421
  // https://tc39.es/ecma262/#sec-object.fromentries
3417
- $$y({ target: 'Object', stat: true }, {
3422
+ $$z({ target: 'Object', stat: true }, {
3418
3423
  fromEntries: function fromEntries(iterable) {
3419
3424
  var obj = {};
3420
3425
  iterate$4(iterable, function (k, v) {
@@ -3586,17 +3591,17 @@ for (var COLLECTION_NAME in DOMIterables) {
3586
3591
 
3587
3592
  handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
3588
3593
 
3589
- var $$x = _export;
3594
+ var $$y = _export;
3590
3595
  var DESCRIPTORS$c = descriptors;
3591
3596
  var globalThis$t = globalThis_1;
3592
3597
  var getBuiltIn$3 = getBuiltIn$c;
3593
- var uncurryThis$t = functionUncurryThis;
3598
+ var uncurryThis$u = functionUncurryThis;
3594
3599
  var call$k = functionCall;
3595
3600
  var isCallable$6 = isCallable$t;
3596
3601
  var isObject$9 = isObject$m;
3597
3602
  var isArray$3 = isArray$5;
3598
3603
  var hasOwn$8 = hasOwnProperty_1;
3599
- var toString$e = toString$i;
3604
+ var toString$f = toString$j;
3600
3605
  var lengthOfArrayLike$d = lengthOfArrayLike$g;
3601
3606
  var createProperty$3 = createProperty$6;
3602
3607
  var fails$m = fails$F;
@@ -3609,11 +3614,11 @@ var SyntaxError$4 = globalThis$t.SyntaxError;
3609
3614
  var nativeParse = JSON$1 && JSON$1.parse;
3610
3615
  var enumerableOwnProperties = getBuiltIn$3('Object', 'keys');
3611
3616
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
3612
- var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
3613
- var at$1 = uncurryThis$t(''.charAt);
3614
- var slice$2 = uncurryThis$t(''.slice);
3615
- var exec$5 = uncurryThis$t(/./.exec);
3616
- var push$6 = uncurryThis$t([].push);
3617
+ var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
3618
+ var at$1 = uncurryThis$u(''.charAt);
3619
+ var slice$3 = uncurryThis$u(''.slice);
3620
+ var exec$5 = uncurryThis$u(/./.exec);
3621
+ var push$6 = uncurryThis$u([].push);
3617
3622
 
3618
3623
  var IS_DIGIT = /^\d$/;
3619
3624
  var IS_NON_ZERO_DIGIT = /^[1-9]$/;
@@ -3624,7 +3629,7 @@ var PRIMITIVE = 0;
3624
3629
  var OBJECT = 1;
3625
3630
 
3626
3631
  var $parse = function (source, reviver) {
3627
- source = toString$e(source);
3632
+ source = toString$f(source);
3628
3633
  var context = new Context(source, 0);
3629
3634
  var root = context.parse();
3630
3635
  var value = root.value;
@@ -3663,7 +3668,7 @@ var internalize = function (holder, name, reviver, node) {
3663
3668
 
3664
3669
  var internalizeProperty = function (object, key, value) {
3665
3670
  if (DESCRIPTORS$c) {
3666
- var descriptor = getOwnPropertyDescriptor$2(object, key);
3671
+ var descriptor = getOwnPropertyDescriptor$3(object, key);
3667
3672
  if (descriptor && !descriptor.configurable) return;
3668
3673
  }
3669
3674
  if (value === undefined) delete object[key];
@@ -3709,7 +3714,7 @@ Context.prototype = {
3709
3714
  } throw new SyntaxError$4('Unexpected character: "' + chr + '" at: ' + i);
3710
3715
  },
3711
3716
  node: function (type, value, start, end, nodes) {
3712
- return new Node(value, end, type ? null : slice$2(this.source, start, end), nodes);
3717
+ return new Node(value, end, type ? null : slice$3(this.source, start, end), nodes);
3713
3718
  },
3714
3719
  object: function () {
3715
3720
  var source = this.source;
@@ -3804,13 +3809,13 @@ Context.prototype = {
3804
3809
  i = this.skip(IS_DIGIT, i);
3805
3810
  if (exponentStartIndex === i) throw new SyntaxError$4("Failed to parse number's exponent value at: " + i);
3806
3811
  }
3807
- return this.node(PRIMITIVE, Number$1(slice$2(source, startIndex, i)), startIndex, i);
3812
+ return this.node(PRIMITIVE, Number$1(slice$3(source, startIndex, i)), startIndex, i);
3808
3813
  },
3809
3814
  keyword: function (value) {
3810
3815
  var keyword = '' + value;
3811
3816
  var index = this.index;
3812
3817
  var endIndex = index + keyword.length;
3813
- if (slice$2(this.source, index, endIndex) !== keyword) throw new SyntaxError$4('Failed to parse value at: ' + index);
3818
+ if (slice$3(this.source, index, endIndex) !== keyword) throw new SyntaxError$4('Failed to parse value at: ' + index);
3814
3819
  return this.node(PRIMITIVE, value, index, endIndex);
3815
3820
  },
3816
3821
  skip: function (regex, i) {
@@ -3843,7 +3848,7 @@ var PROPER_BASE_PARSE = NATIVE_SYMBOL && !fails$m(function () {
3843
3848
  // `JSON.parse` method
3844
3849
  // https://tc39.es/ecma262/#sec-json.parse
3845
3850
  // https://github.com/tc39/proposal-json-parse-with-source
3846
- $$x({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {
3851
+ $$y({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {
3847
3852
  parse: function parse(text, reviver) {
3848
3853
  return PROPER_BASE_PARSE && !isCallable$6(reviver) ? nativeParse(text) : $parse(text, reviver);
3849
3854
  }
@@ -3863,27 +3868,31 @@ const saveSession = async data => {
3863
3868
  const configPath = getConfigPath();
3864
3869
  await promises.writeFile(configPath, JSON.stringify(data, null, 2));
3865
3870
  };
3866
- const loadSession = async () => {
3871
+ const loadSession = async ({
3872
+ quiet: _quiet = false
3873
+ } = {}) => {
3867
3874
  try {
3868
3875
  const configPath = getConfigPath();
3869
3876
  const data = await promises.readFile(configPath, "utf-8");
3870
3877
  return JSON.parse(data);
3871
3878
  } catch (error) {
3872
- console.error("Failed to load session:", error);
3879
+ if (!_quiet) {
3880
+ console.error("Failed to load session:", error);
3881
+ }
3873
3882
  return null;
3874
3883
  }
3875
3884
  };
3876
3885
 
3877
- var $$w = _export;
3886
+ var $$x = _export;
3878
3887
  var globalThis$s = globalThis_1;
3879
3888
 
3880
3889
  // `globalThis` object
3881
3890
  // https://tc39.es/ecma262/#sec-globalthis
3882
- $$w({ global: true, forced: globalThis$s.globalThis !== globalThis$s }, {
3891
+ $$x({ global: true, forced: globalThis$s.globalThis !== globalThis$s }, {
3883
3892
  globalThis: globalThis$s
3884
3893
  });
3885
3894
 
3886
- var version = "0.34.15";
3895
+ var version = "0.35.1";
3887
3896
  var packageJson$1 = {
3888
3897
  version: version};
3889
3898
 
@@ -3916,10 +3925,10 @@ var inheritIfRequired$4 = function ($this, dummy, Wrapper) {
3916
3925
  return $this;
3917
3926
  };
3918
3927
 
3919
- var toString$d = toString$i;
3928
+ var toString$e = toString$j;
3920
3929
 
3921
3930
  var normalizeStringArgument$1 = function (argument, $default) {
3922
- return argument === undefined ? arguments.length < 2 ? '' : $default : toString$d(argument);
3931
+ return argument === undefined ? arguments.length < 2 ? '' : $default : toString$e(argument);
3923
3932
  };
3924
3933
 
3925
3934
  var isObject$7 = isObject$m;
@@ -3933,10 +3942,10 @@ var installErrorCause$1 = function (O, options) {
3933
3942
  }
3934
3943
  };
3935
3944
 
3936
- var uncurryThis$s = functionUncurryThis;
3945
+ var uncurryThis$t = functionUncurryThis;
3937
3946
 
3938
3947
  var $Error = Error;
3939
- var replace$7 = uncurryThis$s(''.replace);
3948
+ var replace$7 = uncurryThis$t(''.replace);
3940
3949
 
3941
3950
  var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
3942
3951
  // eslint-disable-next-line redos/no-vulnerable, sonarjs/slow-regex -- safe
@@ -4040,7 +4049,7 @@ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_A
4040
4049
  };
4041
4050
 
4042
4051
  /* eslint-disable no-unused-vars -- required for functions `.length` */
4043
- var $$v = _export;
4052
+ var $$w = _export;
4044
4053
  var globalThis$r = globalThis_1;
4045
4054
  var apply$2 = functionApply;
4046
4055
  var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$1;
@@ -4055,7 +4064,7 @@ var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
4055
4064
  var O = {};
4056
4065
  // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
4057
4066
  O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED$7);
4058
- $$v({ global: true, constructor: true, arity: 1, forced: FORCED$7 }, O);
4067
+ $$w({ global: true, constructor: true, arity: 1, forced: FORCED$7 }, O);
4059
4068
  };
4060
4069
 
4061
4070
  var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
@@ -4063,7 +4072,7 @@ var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
4063
4072
  var O = {};
4064
4073
  // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
4065
4074
  O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED$7);
4066
- $$v({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$7 }, O);
4075
+ $$w({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$7 }, O);
4067
4076
  }
4068
4077
  };
4069
4078
 
@@ -4099,7 +4108,7 @@ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
4099
4108
  return function RuntimeError(message) { return apply$2(init, this, arguments); };
4100
4109
  });
4101
4110
 
4102
- var $$u = _export;
4111
+ var $$v = _export;
4103
4112
  var call$j = functionCall;
4104
4113
  var iterate$3 = iterate$7;
4105
4114
  var aCallable$9 = aCallable$j;
@@ -4112,7 +4121,7 @@ var forEachWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError
4112
4121
 
4113
4122
  // `Iterator.prototype.forEach` method
4114
4123
  // https://tc39.es/ecma262/#sec-iterator.prototype.foreach
4115
- $$u({ target: 'Iterator', proto: true, real: true, forced: forEachWithoutClosingOnEarlyError }, {
4124
+ $$v({ target: 'Iterator', proto: true, real: true, forced: forEachWithoutClosingOnEarlyError }, {
4116
4125
  forEach: function forEach(fn) {
4117
4126
  anObject$b(this);
4118
4127
  try {
@@ -4246,7 +4255,7 @@ const POSTHOG_PROJECT_TOKENS = {
4246
4255
  };
4247
4256
  const POSTHOG_FLAGS_URL = "https://us.i.posthog.com/flags?v=2";
4248
4257
  const CACHE_TTL_MS = 15 * 60 * 1000;
4249
- const REQUEST_TIMEOUT_MS = 2000;
4258
+ const REQUEST_TIMEOUT_MS$2 = 2000;
4250
4259
  const FlagsResponseSchema = z.object({
4251
4260
  flags: z.record(z.string(), z.object({
4252
4261
  enabled: z.boolean()
@@ -4254,14 +4263,16 @@ const FlagsResponseSchema = z.object({
4254
4263
  enabled: false
4255
4264
  }))
4256
4265
  });
4266
+ const DIGITAL_TWIN_V3 = {
4267
+ key: "devops_digital_twin_v3",
4268
+ override: "VENTION_CLI_EXPERIMENTAL_DIGITAL_TWIN_V3",
4269
+ defaultValue: false
4270
+ };
4257
4271
  const refreshFeatureFlags = async () => {
4258
4272
  var _a, _b;
4259
- try {
4260
- await promises.access(getConfigPath());
4261
- } catch (_c) {
4262
- return;
4263
- }
4264
- const session = await loadSession();
4273
+ const session = await loadSession({
4274
+ quiet: true
4275
+ });
4265
4276
  const projectToken = session && POSTHOG_PROJECT_TOKENS[session.environment];
4266
4277
  if (!(session === null || session === void 0 ? void 0 : session.email) || !projectToken) {
4267
4278
  return;
@@ -4283,6 +4294,18 @@ const refreshFeatureFlags = async () => {
4283
4294
  verboseLog("feature flags: could not cache the answers");
4284
4295
  });
4285
4296
  };
4297
+ const isFeatureEnabled = (session, flag) => {
4298
+ var _a, _b;
4299
+ if (flag.override && process.env[flag.override] === "1") {
4300
+ verboseLog(`${flag.key}: on (${flag.override}=1)`);
4301
+ return true;
4302
+ }
4303
+ const known = (_b = (_a = session.featureFlags) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b[flag.key];
4304
+ const enabled = known !== null && known !== void 0 ? known : flag.defaultValue;
4305
+ verboseLog(`${flag.key}: ${enabled ? "on" : "off"} (${known === undefined ? "default" : "PostHog"})`);
4306
+ return enabled;
4307
+ };
4308
+ const isDigitalTwinV3Enabled = session => isFeatureEnabled(session, DIGITAL_TWIN_V3);
4286
4309
  const fetchFlags = async (projectToken, distinctId) => {
4287
4310
  try {
4288
4311
  const response = await fetchWithUserAgent(POSTHOG_FLAGS_URL, {
@@ -4294,7 +4317,7 @@ const fetchFlags = async (projectToken, distinctId) => {
4294
4317
  api_key: projectToken,
4295
4318
  distinct_id: distinctId
4296
4319
  }),
4297
- signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
4320
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS$2)
4298
4321
  });
4299
4322
  if (!response.ok) {
4300
4323
  return undefined;
@@ -4329,7 +4352,7 @@ var regexpGetFlags = regExpFlagsDetection.correct ? function (it) {
4329
4352
  var PROPER_FUNCTION_NAME$2 = functionName.PROPER;
4330
4353
  var defineBuiltIn$7 = defineBuiltIn$e;
4331
4354
  var anObject$a = anObject$p;
4332
- var $toString$2 = toString$i;
4355
+ var $toString$2 = toString$j;
4333
4356
  var fails$k = fails$F;
4334
4357
  var getRegExpFlags$2 = regexpGetFlags;
4335
4358
 
@@ -4352,18 +4375,18 @@ if (NOT_GENERIC || INCORRECT_NAME) {
4352
4375
  }, { unsafe: true });
4353
4376
  }
4354
4377
 
4355
- var uncurryThis$r = functionUncurryThis;
4378
+ var uncurryThis$s = functionUncurryThis;
4356
4379
  var toIntegerOrInfinity$8 = toIntegerOrInfinity$b;
4357
- var toString$c = toString$i;
4358
- var requireObjectCoercible$5 = requireObjectCoercible$a;
4380
+ var toString$d = toString$j;
4381
+ var requireObjectCoercible$6 = requireObjectCoercible$b;
4359
4382
 
4360
- var charAt$8 = uncurryThis$r(''.charAt);
4361
- var charCodeAt$1 = uncurryThis$r(''.charCodeAt);
4362
- var stringSlice$8 = uncurryThis$r(''.slice);
4383
+ var charAt$8 = uncurryThis$s(''.charAt);
4384
+ var charCodeAt$1 = uncurryThis$s(''.charCodeAt);
4385
+ var stringSlice$8 = uncurryThis$s(''.slice);
4363
4386
 
4364
4387
  var createMethod$4 = function (CONVERT_TO_STRING) {
4365
4388
  return function ($this, pos) {
4366
- var S = toString$c(requireObjectCoercible$5($this));
4389
+ var S = toString$d(requireObjectCoercible$6($this));
4367
4390
  var position = toIntegerOrInfinity$8(pos);
4368
4391
  var size = S.length;
4369
4392
  var first, second;
@@ -4390,7 +4413,7 @@ var stringMultibyte = {
4390
4413
  };
4391
4414
 
4392
4415
  var charAt$7 = stringMultibyte.charAt;
4393
- var toString$b = toString$i;
4416
+ var toString$c = toString$j;
4394
4417
  var InternalStateModule$5 = internalState;
4395
4418
  var defineIterator = iteratorDefine;
4396
4419
  var createIterResultObject$1 = createIterResultObject$4;
@@ -4404,7 +4427,7 @@ var getInternalState$4 = InternalStateModule$5.getterFor(STRING_ITERATOR);
4404
4427
  defineIterator(String, 'String', function (iterated) {
4405
4428
  setInternalState$4(this, {
4406
4429
  type: STRING_ITERATOR,
4407
- string: toString$b(iterated),
4430
+ string: toString$c(iterated),
4408
4431
  index: 0
4409
4432
  });
4410
4433
  // `%StringIteratorPrototype%.next` method
@@ -4467,7 +4490,7 @@ var isArray$2 = isArray$5;
4467
4490
 
4468
4491
  var $TypeError$b = TypeError;
4469
4492
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
4470
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
4493
+ var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
4471
4494
 
4472
4495
  // Safari < 13 does not throw an error in this case
4473
4496
  var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$9 && !function () {
@@ -4482,7 +4505,7 @@ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$9 && !function () {
4482
4505
  }();
4483
4506
 
4484
4507
  var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
4485
- if (isArray$2(O) && !getOwnPropertyDescriptor$1(O, 'length').writable) {
4508
+ if (isArray$2(O) && !getOwnPropertyDescriptor$2(O, 'length').writable) {
4486
4509
  throw new $TypeError$b('Cannot set read only .length');
4487
4510
  } return O.length = length;
4488
4511
  } : function (O, length) {
@@ -4542,7 +4565,7 @@ var arrayFrom$1 = function from(arrayLike /* , mapfn = undefined, thisArg = unde
4542
4565
  };
4543
4566
 
4544
4567
  // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
4545
- var uncurryThis$q = functionUncurryThis;
4568
+ var uncurryThis$r = functionUncurryThis;
4546
4569
 
4547
4570
  var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
4548
4571
  var base = 36;
@@ -4559,15 +4582,15 @@ var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
4559
4582
  var baseMinusTMin = base - tMin;
4560
4583
 
4561
4584
  var $RangeError$7 = RangeError;
4562
- var exec$4 = uncurryThis$q(regexSeparators.exec);
4585
+ var exec$4 = uncurryThis$r(regexSeparators.exec);
4563
4586
  var floor$7 = Math.floor;
4564
4587
  var fromCharCode$2 = String.fromCharCode;
4565
- var charCodeAt = uncurryThis$q(''.charCodeAt);
4566
- var join$4 = uncurryThis$q([].join);
4567
- var push$5 = uncurryThis$q([].push);
4568
- var replace$6 = uncurryThis$q(''.replace);
4569
- var split$2 = uncurryThis$q(''.split);
4570
- var toLowerCase$1 = uncurryThis$q(''.toLowerCase);
4588
+ var charCodeAt = uncurryThis$r(''.charCodeAt);
4589
+ var join$4 = uncurryThis$r([].join);
4590
+ var push$5 = uncurryThis$r([].push);
4591
+ var replace$6 = uncurryThis$r(''.replace);
4592
+ var split$2 = uncurryThis$r(''.split);
4593
+ var toLowerCase$1 = uncurryThis$r(''.toLowerCase);
4571
4594
 
4572
4595
  /**
4573
4596
  * Creates an array containing the numeric code points of each Unicode
@@ -4722,22 +4745,22 @@ var stringPunycodeToAscii = function (input) {
4722
4745
  return join$4(encoded, '.');
4723
4746
  };
4724
4747
 
4725
- var $$t = _export;
4726
- var uncurryThis$p = functionUncurryThis;
4748
+ var $$u = _export;
4749
+ var uncurryThis$q = functionUncurryThis;
4727
4750
  var toAbsoluteIndex$2 = toAbsoluteIndex$4;
4728
4751
 
4729
4752
  var $RangeError$6 = RangeError;
4730
4753
  var fromCharCode$1 = String.fromCharCode;
4731
4754
  // eslint-disable-next-line es/no-string-fromcodepoint -- required for testing
4732
4755
  var $fromCodePoint = String.fromCodePoint;
4733
- var join$3 = uncurryThis$p([].join);
4756
+ var join$3 = uncurryThis$q([].join);
4734
4757
 
4735
4758
  // length should be 1, old FF problem
4736
4759
  var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length !== 1;
4737
4760
 
4738
4761
  // `String.fromCodePoint` method
4739
4762
  // https://tc39.es/ecma262/#sec-string.fromcodepoint
4740
- $$t({ target: 'String', stat: true, arity: 1, forced: INCORRECT_LENGTH }, {
4763
+ $$u({ target: 'String', stat: true, arity: 1, forced: INCORRECT_LENGTH }, {
4741
4764
  // eslint-disable-next-line no-unused-vars -- required for `.length`
4742
4765
  fromCodePoint: function fromCodePoint(x) {
4743
4766
  var elements = [];
@@ -4799,12 +4822,12 @@ var arraySort$1 = sort$1;
4799
4822
  // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
4800
4823
 
4801
4824
 
4802
- var $$s = _export;
4825
+ var $$t = _export;
4803
4826
  var globalThis$q = globalThis_1;
4804
4827
  var safeGetBuiltIn = safeGetBuiltIn$2;
4805
4828
  var getBuiltIn$1 = getBuiltIn$c;
4806
4829
  var call$g = functionCall;
4807
- var uncurryThis$o = functionUncurryThis;
4830
+ var uncurryThis$p = functionUncurryThis;
4808
4831
  var DESCRIPTORS$8 = descriptors;
4809
4832
  var USE_NATIVE_URL$1 = urlConstructorDetection;
4810
4833
  var defineBuiltIn$6 = defineBuiltIn$e;
@@ -4820,7 +4843,7 @@ var bind$5 = functionBindContext;
4820
4843
  var classof$8 = classof$g;
4821
4844
  var anObject$9 = anObject$p;
4822
4845
  var isObject$6 = isObject$m;
4823
- var $toString$1 = toString$i;
4846
+ var $toString$1 = toString$j;
4824
4847
  var create$3 = objectCreate;
4825
4848
  var createPropertyDescriptor$1 = createPropertyDescriptor$7;
4826
4849
  var getIterator$1 = getIterator$4;
@@ -4847,15 +4870,15 @@ var encodeURIComponent$1 = globalThis$q.encodeURIComponent;
4847
4870
  var fromCharCode = String.fromCharCode;
4848
4871
  var fromCodePoint = getBuiltIn$1('String', 'fromCodePoint');
4849
4872
  var $parseInt = parseInt;
4850
- var charAt$6 = uncurryThis$o(''.charAt);
4851
- var join$2 = uncurryThis$o([].join);
4852
- var push$4 = uncurryThis$o([].push);
4853
- var replace$5 = uncurryThis$o(''.replace);
4854
- var shift$1 = uncurryThis$o([].shift);
4855
- var splice = uncurryThis$o([].splice);
4856
- var split$1 = uncurryThis$o(''.split);
4857
- var stringSlice$7 = uncurryThis$o(''.slice);
4858
- var exec$3 = uncurryThis$o(/./.exec);
4873
+ var charAt$6 = uncurryThis$p(''.charAt);
4874
+ var join$2 = uncurryThis$p([].join);
4875
+ var push$4 = uncurryThis$p([].push);
4876
+ var replace$5 = uncurryThis$p(''.replace);
4877
+ var shift$1 = uncurryThis$p([].shift);
4878
+ var splice = uncurryThis$p([].splice);
4879
+ var split$1 = uncurryThis$p(''.split);
4880
+ var stringSlice$7 = uncurryThis$p(''.slice);
4881
+ var exec$3 = uncurryThis$p(/./.exec);
4859
4882
 
4860
4883
  var plus = /\+/g;
4861
4884
  var FALLBACK_REPLACER = '\uFFFD';
@@ -5268,14 +5291,14 @@ if (DESCRIPTORS$8) defineBuiltInAccessor$7(URLSearchParamsPrototype$3, 'size', {
5268
5291
 
5269
5292
  setToStringTag$2(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
5270
5293
 
5271
- $$s({ global: true, constructor: true, forced: !USE_NATIVE_URL$1 }, {
5294
+ $$t({ global: true, constructor: true, forced: !USE_NATIVE_URL$1 }, {
5272
5295
  URLSearchParams: URLSearchParamsConstructor
5273
5296
  });
5274
5297
 
5275
5298
  // Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams`
5276
5299
  if (!USE_NATIVE_URL$1 && isCallable$4(Headers)) {
5277
- var headersHas = uncurryThis$o(HeadersPrototype.has);
5278
- var headersSet = uncurryThis$o(HeadersPrototype.set);
5300
+ var headersHas = uncurryThis$p(HeadersPrototype.has);
5301
+ var headersSet = uncurryThis$p(HeadersPrototype.set);
5279
5302
 
5280
5303
  var wrapRequestOptions = function (init) {
5281
5304
  if (isObject$6(init)) {
@@ -5295,7 +5318,7 @@ if (!USE_NATIVE_URL$1 && isCallable$4(Headers)) {
5295
5318
  };
5296
5319
 
5297
5320
  if (isCallable$4(nativeFetch)) {
5298
- $$s({ global: true, enumerable: true, dontCallGetSet: true, forced: true }, {
5321
+ $$t({ global: true, enumerable: true, dontCallGetSet: true, forced: true }, {
5299
5322
  fetch: function fetch(input /* , init */) {
5300
5323
  return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
5301
5324
  }
@@ -5311,7 +5334,7 @@ if (!USE_NATIVE_URL$1 && isCallable$4(Headers)) {
5311
5334
  RequestPrototype.constructor = RequestConstructor;
5312
5335
  RequestConstructor.prototype = RequestPrototype;
5313
5336
 
5314
- $$s({ global: true, constructor: true, dontCallGetSet: true, forced: true }, {
5337
+ $$t({ global: true, constructor: true, dontCallGetSet: true, forced: true }, {
5315
5338
  Request: RequestConstructor
5316
5339
  });
5317
5340
  }
@@ -5324,12 +5347,12 @@ var web_urlSearchParams_constructor = {
5324
5347
 
5325
5348
  // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
5326
5349
 
5327
- var $$r = _export;
5350
+ var $$s = _export;
5328
5351
  var DESCRIPTORS$7 = descriptors;
5329
5352
  var USE_NATIVE_URL = urlConstructorDetection;
5330
5353
  var globalThis$p = globalThis_1;
5331
5354
  var bind$4 = functionBindContext;
5332
- var uncurryThis$n = functionUncurryThis;
5355
+ var uncurryThis$o = functionUncurryThis;
5333
5356
  var defineBuiltIn$5 = defineBuiltIn$e;
5334
5357
  var defineBuiltInAccessor$6 = defineBuiltInAccessor$c;
5335
5358
  var anInstance$2 = anInstance$6;
@@ -5339,7 +5362,7 @@ var arrayFrom = arrayFrom$1;
5339
5362
  var arraySlice$2 = arraySlice$6;
5340
5363
  var codeAt = stringMultibyte.codeAt;
5341
5364
  var toASCII = stringPunycodeToAscii;
5342
- var $toString = toString$i;
5365
+ var $toString = toString$j;
5343
5366
  var setToStringTag$1 = setToStringTag$7;
5344
5367
  var validateArgumentsLength$2 = validateArgumentsLength$5;
5345
5368
  var URLSearchParamsModule = web_urlSearchParams_constructor;
@@ -5356,18 +5379,18 @@ var encodeURIComponent = globalThis$p.encodeURIComponent;
5356
5379
  var parseInt$1 = globalThis$p.parseInt;
5357
5380
  var floor$5 = Math.floor;
5358
5381
  var pow$1 = Math.pow;
5359
- var charAt$5 = uncurryThis$n(''.charAt);
5360
- var exec$2 = uncurryThis$n(/./.exec);
5361
- var join$1 = uncurryThis$n([].join);
5362
- var numberToString$1 = uncurryThis$n(1.1.toString);
5363
- var pop = uncurryThis$n([].pop);
5364
- var push$3 = uncurryThis$n([].push);
5365
- var replace$4 = uncurryThis$n(''.replace);
5366
- var shift = uncurryThis$n([].shift);
5367
- var split = uncurryThis$n(''.split);
5368
- var stringSlice$6 = uncurryThis$n(''.slice);
5369
- var toLowerCase = uncurryThis$n(''.toLowerCase);
5370
- var unshift = uncurryThis$n([].unshift);
5382
+ var charAt$5 = uncurryThis$o(''.charAt);
5383
+ var exec$2 = uncurryThis$o(/./.exec);
5384
+ var join$1 = uncurryThis$o([].join);
5385
+ var numberToString$1 = uncurryThis$o(1.1.toString);
5386
+ var pop = uncurryThis$o([].pop);
5387
+ var push$3 = uncurryThis$o([].push);
5388
+ var replace$4 = uncurryThis$o(''.replace);
5389
+ var shift = uncurryThis$o([].shift);
5390
+ var split = uncurryThis$o(''.split);
5391
+ var stringSlice$6 = uncurryThis$o(''.slice);
5392
+ var toLowerCase = uncurryThis$o(''.toLowerCase);
5393
+ var unshift = uncurryThis$o([].unshift);
5371
5394
 
5372
5395
  var INVALID_AUTHORITY = 'Invalid authority';
5373
5396
  var INVALID_SCHEME = 'Invalid scheme';
@@ -6398,32 +6421,32 @@ if (NativeURL) {
6398
6421
 
6399
6422
  setToStringTag$1(URLConstructor, 'URL');
6400
6423
 
6401
- $$r({ global: true, constructor: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS$7 }, {
6424
+ $$s({ global: true, constructor: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS$7 }, {
6402
6425
  URL: URLConstructor
6403
6426
  });
6404
6427
 
6405
- var $$q = _export;
6428
+ var $$r = _export;
6406
6429
  var call$f = functionCall;
6407
6430
 
6408
6431
  // `URL.prototype.toJSON` method
6409
6432
  // https://url.spec.whatwg.org/#dom-url-tojson
6410
- $$q({ target: 'URL', proto: true, enumerable: true }, {
6433
+ $$r({ target: 'URL', proto: true, enumerable: true }, {
6411
6434
  toJSON: function toJSON() {
6412
6435
  return call$f(URL.prototype.toString, this);
6413
6436
  }
6414
6437
  });
6415
6438
 
6416
6439
  var defineBuiltIn$4 = defineBuiltIn$e;
6417
- var uncurryThis$m = functionUncurryThis;
6418
- var toString$a = toString$i;
6440
+ var uncurryThis$n = functionUncurryThis;
6441
+ var toString$b = toString$j;
6419
6442
  var validateArgumentsLength$1 = validateArgumentsLength$5;
6420
6443
 
6421
6444
  var $URLSearchParams$1 = URLSearchParams;
6422
6445
  var URLSearchParamsPrototype$2 = $URLSearchParams$1.prototype;
6423
- var append = uncurryThis$m(URLSearchParamsPrototype$2.append);
6424
- var $delete = uncurryThis$m(URLSearchParamsPrototype$2['delete']);
6425
- var forEach$3 = uncurryThis$m(URLSearchParamsPrototype$2.forEach);
6426
- var push$2 = uncurryThis$m([].push);
6446
+ var append = uncurryThis$n(URLSearchParamsPrototype$2.append);
6447
+ var $delete = uncurryThis$n(URLSearchParamsPrototype$2['delete']);
6448
+ var forEach$3 = uncurryThis$n(URLSearchParamsPrototype$2.forEach);
6449
+ var push$2 = uncurryThis$n([].push);
6427
6450
  var params$1 = new $URLSearchParams$1('a=1&a=2&b=3');
6428
6451
 
6429
6452
  params$1['delete']('a', 1);
@@ -6441,8 +6464,8 @@ if (params$1 + '' !== 'a=2') {
6441
6464
  push$2(entries, { key: k, value: v });
6442
6465
  });
6443
6466
  validateArgumentsLength$1(length, 1);
6444
- var key = toString$a(name);
6445
- var value = toString$a($value);
6467
+ var key = toString$b(name);
6468
+ var value = toString$b($value);
6446
6469
  var index = 0;
6447
6470
  var entriesLength = entries.length;
6448
6471
  var entry;
@@ -6460,14 +6483,14 @@ if (params$1 + '' !== 'a=2') {
6460
6483
  }
6461
6484
 
6462
6485
  var defineBuiltIn$3 = defineBuiltIn$e;
6463
- var uncurryThis$l = functionUncurryThis;
6464
- var toString$9 = toString$i;
6486
+ var uncurryThis$m = functionUncurryThis;
6487
+ var toString$a = toString$j;
6465
6488
  var validateArgumentsLength = validateArgumentsLength$5;
6466
6489
 
6467
6490
  var $URLSearchParams = URLSearchParams;
6468
6491
  var URLSearchParamsPrototype$1 = $URLSearchParams.prototype;
6469
- var getAll = uncurryThis$l(URLSearchParamsPrototype$1.getAll);
6470
- var $has = uncurryThis$l(URLSearchParamsPrototype$1.has);
6492
+ var getAll = uncurryThis$m(URLSearchParamsPrototype$1.getAll);
6493
+ var $has = uncurryThis$m(URLSearchParamsPrototype$1.has);
6471
6494
  var params = new $URLSearchParams('a=1');
6472
6495
 
6473
6496
  // `undefined` case is a Chromium 117 bug
@@ -6479,7 +6502,7 @@ if (params.has('a', 2) || !params.has('a', undefined)) {
6479
6502
  if (length && $value === undefined) return $has(this, name);
6480
6503
  var values = getAll(this, name); // also validates `this`
6481
6504
  validateArgumentsLength(length, 1);
6482
- var value = toString$9($value);
6505
+ var value = toString$a($value);
6483
6506
  var index = 0;
6484
6507
  while (index < values.length) {
6485
6508
  if (values[index++] === value) return true;
@@ -6488,11 +6511,11 @@ if (params.has('a', 2) || !params.has('a', undefined)) {
6488
6511
  }
6489
6512
 
6490
6513
  var DESCRIPTORS$6 = descriptors;
6491
- var uncurryThis$k = functionUncurryThis;
6514
+ var uncurryThis$l = functionUncurryThis;
6492
6515
  var defineBuiltInAccessor$5 = defineBuiltInAccessor$c;
6493
6516
 
6494
6517
  var URLSearchParamsPrototype = URLSearchParams.prototype;
6495
- var forEach$2 = uncurryThis$k(URLSearchParamsPrototype.forEach);
6518
+ var forEach$2 = uncurryThis$l(URLSearchParamsPrototype.forEach);
6496
6519
 
6497
6520
  // `URLSearchParams.prototype.size` getter
6498
6521
  // https://github.com/whatwg/url/pull/734
@@ -6547,16 +6570,16 @@ const openBrowser = url => {
6547
6570
  }
6548
6571
  });
6549
6572
  };
6550
- const generateRandomBase64Url = numBytes => crypto.randomBytes(numBytes).toString("base64url");
6573
+ const generateRandomBase64Url$1 = numBytes => crypto.randomBytes(numBytes).toString("base64url");
6551
6574
  const generatePkce = () => {
6552
- const verifier = generateRandomBase64Url(32);
6575
+ const verifier = generateRandomBase64Url$1(32);
6553
6576
  const challenge = Buffer.from(crypto.createHash("sha256").update(verifier).digest()).toString("base64url");
6554
6577
  return {
6555
6578
  verifier,
6556
6579
  challenge
6557
6580
  };
6558
6581
  };
6559
- const startCallbackServer = async expectedState => {
6582
+ const startCallbackServer$1 = async expectedState => {
6560
6583
  const server = http.createServer();
6561
6584
  const waitForCode = (async () => {
6562
6585
  try {
@@ -6682,6 +6705,33 @@ const refreshAccessToken = async (config, refreshToken) => {
6682
6705
  expiresInSeconds: parsed.expires_in
6683
6706
  };
6684
6707
  };
6708
+ const revokeToken = async (config, token, tokenType = "access_token") => {
6709
+ if (!config.revokeUrl) return;
6710
+ const body = new URLSearchParams$2({
6711
+ token,
6712
+ token_type_hint: tokenType,
6713
+ client_id: config.clientId
6714
+ });
6715
+ const res = await fetchWithUserAgent(config.revokeUrl, {
6716
+ method: "POST",
6717
+ headers: {
6718
+ "Content-Type": "application/x-www-form-urlencoded"
6719
+ },
6720
+ body
6721
+ });
6722
+ if (!res.ok) {
6723
+ throw new Error(`Token revocation failed: ${res.status} ${res.statusText}`);
6724
+ }
6725
+ };
6726
+ const revokeRefreshToken = async ({
6727
+ environment,
6728
+ oauth
6729
+ }) => {
6730
+ if (!(oauth === null || oauth === void 0 ? void 0 : oauth.refreshToken)) {
6731
+ return;
6732
+ }
6733
+ await revokeToken(getSsoConfig(environment), oauth.refreshToken, "refresh_token");
6734
+ };
6685
6735
  const loginWithSso = async environment => {
6686
6736
  const {
6687
6737
  clientId,
@@ -6692,11 +6742,11 @@ const loginWithSso = async environment => {
6692
6742
  verifier,
6693
6743
  challenge
6694
6744
  } = generatePkce();
6695
- const state = generateRandomBase64Url(16);
6745
+ const state = generateRandomBase64Url$1(16);
6696
6746
  const {
6697
6747
  port,
6698
6748
  waitForCode
6699
- } = await startCallbackServer(state);
6749
+ } = await startCallbackServer$1(state);
6700
6750
  const redirectUri = `http://127.0.0.1:${port}/callback`;
6701
6751
  const auth = new URL(authorizeUrl);
6702
6752
  auth.searchParams.set("client_id", clientId);
@@ -6719,6 +6769,496 @@ const loginWithSso = async environment => {
6719
6769
  };
6720
6770
  const getSsoEnvironmentConfig = getSsoConfig;
6721
6771
 
6772
+ var $$q = _export;
6773
+ var uncurryThis$k = functionUncurryThisClause;
6774
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
6775
+ var toLength$5 = toLength$7;
6776
+ var toString$9 = toString$j;
6777
+ var notARegExp$1 = notARegexp;
6778
+ var requireObjectCoercible$5 = requireObjectCoercible$b;
6779
+ var correctIsRegExpLogic$1 = correctIsRegexpLogic;
6780
+
6781
+ var slice$2 = uncurryThis$k(''.slice);
6782
+ var min$4 = Math.min;
6783
+
6784
+ var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegExpLogic$1('endsWith');
6785
+ // https://github.com/zloirock/core-js/pull/702
6786
+ var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
6787
+ var descriptor = getOwnPropertyDescriptor$1(String.prototype, 'endsWith');
6788
+ return descriptor && !descriptor.writable;
6789
+ }();
6790
+
6791
+ // `String.prototype.endsWith` method
6792
+ // https://tc39.es/ecma262/#sec-string.prototype.endswith
6793
+ $$q({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
6794
+ endsWith: function endsWith(searchString /* , endPosition = @length */) {
6795
+ var that = toString$9(requireObjectCoercible$5(this));
6796
+ notARegExp$1(searchString);
6797
+ var search = toString$9(searchString);
6798
+ var endPosition = arguments.length > 1 ? arguments[1] : undefined;
6799
+ var len = that.length;
6800
+ var end = endPosition === undefined ? len : min$4(toLength$5(endPosition), len);
6801
+ return slice$2(that, end - search.length, end) === search;
6802
+ }
6803
+ });
6804
+
6805
+ /******************************************************************************
6806
+ Copyright (c) Microsoft Corporation.
6807
+
6808
+ Permission to use, copy, modify, and/or distribute this software for any
6809
+ purpose with or without fee is hereby granted.
6810
+
6811
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
6812
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
6813
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
6814
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
6815
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
6816
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
6817
+ PERFORMANCE OF THIS SOFTWARE.
6818
+ ***************************************************************************** */
6819
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
6820
+
6821
+
6822
+ function __rest(s, e) {
6823
+ var t = {};
6824
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
6825
+ t[p] = s[p];
6826
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6827
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
6828
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
6829
+ t[p[i]] = s[p[i]];
6830
+ }
6831
+ return t;
6832
+ }
6833
+
6834
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
6835
+ var e = new Error(message);
6836
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
6837
+ };
6838
+
6839
+ //#region src/errors/authorization-server-unavailable.ts
6840
+ var AuthorizationServerUnavailable = class extends Error {
6841
+ name = "AuthorizationServerUnavailable";
6842
+ };
6843
+
6844
+ //#region src/discovery.ts
6845
+ const REQUEST_TIMEOUT_MS$1 = 1e4;
6846
+ async function discoverAuthorizationServer(issuer, fetch = globalThis.fetch) {
6847
+ const metadata = await readMetadata(`${issuer}/.well-known/oauth-authorization-server`, fetch);
6848
+ return {
6849
+ tokenEndpoint: metadata.token_endpoint,
6850
+ identityProviderIssuer: metadata.vention_identity_provider_issuer,
6851
+ clients: metadata.vention_clients
6852
+ };
6853
+ }
6854
+ async function discoverOpenIdProvider(issuer, fetch = globalThis.fetch) {
6855
+ const url = `${issuer}/.well-known/openid-configuration`;
6856
+ const metadata = await readMetadata(url, fetch);
6857
+ if (metadata.issuer !== issuer) throw new AuthorizationServerUnavailable(`${url} names the issuer ${metadata.issuer}, not ${issuer}`);
6858
+ return {
6859
+ authorizationEndpoint: metadata.authorization_endpoint,
6860
+ tokenEndpoint: metadata.token_endpoint
6861
+ };
6862
+ }
6863
+ async function readMetadata(url, fetch) {
6864
+ const response = await fetch(url, {
6865
+ headers: { Accept: "application/json" },
6866
+ redirect: "error",
6867
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS$1)
6868
+ }).catch((error) => {
6869
+ throw new AuthorizationServerUnavailable(`Could not reach ${url}`, { cause: error });
6870
+ });
6871
+ if (!response.ok) throw new AuthorizationServerUnavailable(`${url} answered ${response.status}`);
6872
+ return response.json().catch((error) => {
6873
+ throw new AuthorizationServerUnavailable(`${url} did not answer with JSON`, { cause: error });
6874
+ });
6875
+ }
6876
+
6877
+ //#region src/errors/exchange-rejected.ts
6878
+ var ExchangeRejected = class extends Error {
6879
+ code;
6880
+ name = "ExchangeRejected";
6881
+ constructor(code) {
6882
+ super(`The authorization server refused the token exchange (${code})`);
6883
+ this.code = code;
6884
+ }
6885
+ };
6886
+
6887
+ //#region src/errors/login-timed-out.ts
6888
+ var LoginTimedOut = class extends Error {
6889
+ name = "LoginTimedOut";
6890
+ constructor() {
6891
+ super("Login timed out");
6892
+ }
6893
+ };
6894
+
6895
+ //#region src/oauth2-token-request.ts
6896
+ const REQUEST_TIMEOUT_MS = 1e4;
6897
+ function exchangeForGatewayToken(tokenEndpoint, subjectToken, fetch, now) {
6898
+ return requestToken(tokenEndpoint, subjectToken, "urn:ietf:params:oauth:token-type:access_token", fetch, now);
6899
+ }
6900
+ async function requestToken(tokenEndpoint, subjectToken, subjectTokenType, fetch, now) {
6901
+ const response = await fetch(tokenEndpoint, {
6902
+ method: "POST",
6903
+ headers: {
6904
+ "Content-Type": "application/x-www-form-urlencoded",
6905
+ Accept: "application/json"
6906
+ },
6907
+ body: new URLSearchParams({
6908
+ grant_type: "urn:ietf:params:oauth:grant-type:token-exchange",
6909
+ subject_token: subjectToken,
6910
+ subject_token_type: subjectTokenType
6911
+ }),
6912
+ redirect: "error",
6913
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
6914
+ }).catch((error) => {
6915
+ throw new AuthorizationServerUnavailable("The authorization server could not be reached", { cause: error });
6916
+ });
6917
+ if (response.status >= 500 || response.status === 408 || response.status === 429) throw new AuthorizationServerUnavailable(`The authorization server answered ${response.status}`);
6918
+ if (!response.ok) {
6919
+ const refusal = await response.json().catch(() => void 0);
6920
+ throw new ExchangeRejected(refusal?.error ?? `http_${response.status}`);
6921
+ }
6922
+ return response.json().then((body) => toStoredGatewayToken(body, now())).catch(() => {
6923
+ throw new AuthorizationServerUnavailable("The authorization server returned an unusable token response");
6924
+ });
6925
+ }
6926
+ function toStoredGatewayToken({ access_token: token, expires_in: expiresIn }, receivedAt) {
6927
+ const payload = (token.split(".")[1] ?? "").replace(/-/g, "+").replace(/_/g, "/");
6928
+ const claims = JSON.parse(atob(payload));
6929
+ return {
6930
+ token,
6931
+ receivedAt,
6932
+ expiresAt: receivedAt + expiresIn * 1e3,
6933
+ capExpiresAt: receivedAt + (claims.cap_exp - claims.exp + expiresIn) * 1e3
6934
+ };
6935
+ }
6936
+
6937
+ //#region src/id-token.ts
6938
+ const decodeClaims = (idToken = "") => {
6939
+ const segments = idToken.split(".");
6940
+ if (segments.length !== 3 || segments.some((segment) => segment === "")) return {};
6941
+ try {
6942
+ return JSON.parse(Buffer.from(segments[1] ?? "", "base64url").toString()) ?? {};
6943
+ } catch {
6944
+ return {};
6945
+ }
6946
+ };
6947
+ const isValidFor = (claims, { issuer, clientId, now }) => claims.iss === issuer && (Array.isArray(claims.aud) ? claims.aud.includes(clientId) : claims.aud === clientId) && typeof claims.exp === "number" && claims.exp * 1e3 > now();
6948
+ const toOptionalString = (value) => typeof value === "string" ? value : void 0;
6949
+ const readSignedInUser = (idToken, validation) => {
6950
+ const claims = decodeClaims(idToken);
6951
+ if (typeof claims.sub !== "string" || claims.sub === "" || !isValidFor(claims, validation)) throw new Error("The identity provider returned no usable ID token for this client");
6952
+ return {
6953
+ memberId: claims.sub,
6954
+ email: toOptionalString(claims.email),
6955
+ displayName: toOptionalString(claims.name)
6956
+ };
6957
+ };
6958
+
6959
+ //#region src/assets/callback.html
6960
+ var callback_default = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>Vention login</title>\n <style>\n body {\n font-family: system-ui, sans-serif;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n margin: 0;\n text-align: center;\n }\n p {\n color: #666;\n }\n </style>\n </head>\n <body>\n <main>\n <h2>Return to your terminal to finish logging in</h2>\n <p>You can close this window.</p>\n </main>\n </body>\n</html>\n";
6961
+
6962
+ //#region src/browser-launcher.ts
6963
+ const browserCommands = (url, platform, osRelease) => {
6964
+ if (platform === "darwin") return [["open", [url]]];
6965
+ if (platform === "win32") return [["rundll32", ["url.dll,FileProtocolHandler", url]]];
6966
+ const linux = [
6967
+ "xdg-open",
6968
+ "x-www-browser",
6969
+ "www-browser",
6970
+ "wslview"
6971
+ ].map((launcher) => [launcher, [url]]);
6972
+ if (osRelease.toLowerCase().includes("microsoft")) return [["powershell.exe", [
6973
+ "-NoProfile",
6974
+ "-Command",
6975
+ `Start-Process '${url.replaceAll("'", "''")}'`
6976
+ ]], ...linux];
6977
+ return linux;
6978
+ };
6979
+ const launchFirstAvailable = ([[command, args], ...fallbacks]) => {
6980
+ const child = spawn(command, args, {
6981
+ detached: true,
6982
+ stdio: "ignore"
6983
+ });
6984
+ child.once("error", () => {
6985
+ if (fallbacks.length > 0) launchFirstAvailable(fallbacks);
6986
+ });
6987
+ child.unref();
6988
+ };
6989
+ const launchBrowser = (url) => {
6990
+ console.error(`Open this URL in your browser to log in: ${url}`);
6991
+ launchFirstAvailable(browserCommands(url, process.platform, release()));
6992
+ };
6993
+
6994
+ //#region src/loopback-authorization.ts
6995
+ const LOOPBACK_HOST = "127.0.0.1";
6996
+ const CALLBACK_PATH = "/callback";
6997
+ const generateRandomBase64Url = (numBytes) => randomBytes(numBytes).toString("base64url");
6998
+ const respondWithPage = (res, status) => {
6999
+ res.writeHead(status, { "Content-Type": "text/html; charset=utf-8" });
7000
+ res.end(callback_default);
7001
+ };
7002
+ const readCallback = (req, res, expectedState) => {
7003
+ const url = URL.parse(req.url ?? "/", `http://${LOOPBACK_HOST}`);
7004
+ if (url?.pathname !== CALLBACK_PATH) {
7005
+ res.writeHead(404);
7006
+ res.end("Not found");
7007
+ return;
7008
+ }
7009
+ if (url.searchParams.get("state") !== expectedState) {
7010
+ respondWithPage(res, 400);
7011
+ return;
7012
+ }
7013
+ respondWithPage(res, 200);
7014
+ const error = url.searchParams.get("error");
7015
+ const authorizationCode = url.searchParams.get("code");
7016
+ if (error) return { error: new Error(error) };
7017
+ if (!authorizationCode) return { error: /* @__PURE__ */ new Error("No authorization code received") };
7018
+ return { authorizationCode };
7019
+ };
7020
+ const buildAuthorizationUrl = (endpoint, params) => {
7021
+ const url = new URL(endpoint);
7022
+ for (const [name, value] of Object.entries(params)) url.searchParams.set(name, value);
7023
+ return url.toString();
7024
+ };
7025
+ const startCallbackServer = async (expectedState, timeoutMs) => {
7026
+ const callbackServer = createServer();
7027
+ let timer;
7028
+ const close = () => {
7029
+ clearTimeout(timer);
7030
+ callbackServer.close();
7031
+ };
7032
+ const authorizationCodeReceived = new Promise((resolve, reject) => {
7033
+ timer = setTimeout(() => {
7034
+ close();
7035
+ reject(new LoginTimedOut());
7036
+ }, timeoutMs);
7037
+ callbackServer.on("request", (req, res) => {
7038
+ const outcome = readCallback(req, res, expectedState);
7039
+ if (outcome === void 0) return;
7040
+ close();
7041
+ if ("error" in outcome) reject(outcome.error);
7042
+ else resolve(outcome.authorizationCode);
7043
+ });
7044
+ });
7045
+ try {
7046
+ callbackServer.listen(0, LOOPBACK_HOST);
7047
+ await once$1(callbackServer, "listening");
7048
+ return {
7049
+ port: callbackServer.address().port,
7050
+ authorizationCodeReceived,
7051
+ close
7052
+ };
7053
+ } catch (error) {
7054
+ close();
7055
+ throw error;
7056
+ }
7057
+ };
7058
+ const redeemAuthorizationCode = async (options, authorizationCode, codeVerifier, redirectUri) => {
7059
+ const body = new URLSearchParams({
7060
+ grant_type: "authorization_code",
7061
+ code: authorizationCode,
7062
+ client_id: options.clientId,
7063
+ redirect_uri: redirectUri,
7064
+ code_verifier: codeVerifier
7065
+ });
7066
+ const response = await options.fetch(options.tokenEndpoint, {
7067
+ method: "POST",
7068
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
7069
+ body,
7070
+ redirect: "error",
7071
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
7072
+ }).catch((error) => {
7073
+ throw new Error("Could not reach the identity provider", { cause: error });
7074
+ });
7075
+ if (!response.ok) throw new Error(`The identity provider refused the authorization code (${response.status})`);
7076
+ return response.json().then((body) => {
7077
+ const accessToken = body?.access_token;
7078
+ const idToken = body?.id_token;
7079
+ if (typeof accessToken !== "string" || idToken !== void 0 && typeof idToken !== "string") throw new Error(`${options.tokenEndpoint} returned an unusable token response`);
7080
+ return {
7081
+ accessToken,
7082
+ idToken
7083
+ };
7084
+ }, (error) => {
7085
+ throw new Error(`${options.tokenEndpoint} returned an unusable token response`, { cause: error });
7086
+ });
7087
+ };
7088
+ const authorizeWithLoopback = async (options) => {
7089
+ const codeVerifier = generateRandomBase64Url(32);
7090
+ const state = generateRandomBase64Url(16);
7091
+ const { port, authorizationCodeReceived, close } = await startCallbackServer(state, options.timeoutMs ?? 12e4);
7092
+ const redirectUri = `http://${LOOPBACK_HOST}:${port}${CALLBACK_PATH}`;
7093
+ try {
7094
+ const authorizationUrl = buildAuthorizationUrl(options.authorizationEndpoint, {
7095
+ client_id: options.clientId,
7096
+ redirect_uri: redirectUri,
7097
+ response_type: "code",
7098
+ code_challenge: createHash("sha256").update(codeVerifier).digest("base64url"),
7099
+ code_challenge_method: "S256",
7100
+ scope: options.scopes.join(" "),
7101
+ state
7102
+ });
7103
+ await Promise.race([(options.showAuthorization ?? launchBrowser)(authorizationUrl), authorizationCodeReceived]);
7104
+ } catch (error) {
7105
+ close();
7106
+ throw error;
7107
+ }
7108
+ const authorizationCode = await authorizationCodeReceived;
7109
+ return redeemAuthorizationCode(options, authorizationCode, codeVerifier, redirectUri);
7110
+ };
7111
+
7112
+ //#region src/login-with-loopback.ts
7113
+ async function loginWithLoopback({ issuer, clientLabel, scopes, store, showAuthorization, fetch = globalThis.fetch, now = Date.now }) {
7114
+ const authorizationServer = await discoverAuthorizationServer(issuer, fetch);
7115
+ const clientId = authorizationServer.clients[clientLabel];
7116
+ if (clientId === void 0) throw new Error(`The authorization server at ${issuer} does not trust the client "${clientLabel}"`);
7117
+ const openIdProvider = await discoverOpenIdProvider(authorizationServer.identityProviderIssuer, fetch);
7118
+ const { accessToken, idToken } = await authorizeWithLoopback({
7119
+ ...openIdProvider,
7120
+ clientId,
7121
+ scopes,
7122
+ showAuthorization,
7123
+ fetch
7124
+ });
7125
+ const signedInUser = readSignedInUser(idToken, {
7126
+ issuer: authorizationServer.identityProviderIssuer,
7127
+ clientId,
7128
+ now
7129
+ });
7130
+ await store.write(await exchangeForGatewayToken(authorizationServer.tokenEndpoint, accessToken, fetch, now));
7131
+ return signedInUser;
7132
+ }
7133
+
7134
+ const PLATFORM_AUTH_ORIGINS = {
7135
+ demo: "https://platform-auth.vention.foo",
7136
+ prod: "https://platform-auth.vention.com"
7137
+ };
7138
+ const originSchema = z.url({
7139
+ protocol: /^https$/
7140
+ }).refine(url => !url.endsWith("/"));
7141
+ const originOverride = variableName => {
7142
+ const override = process.env[variableName];
7143
+ if (!override) {
7144
+ return undefined;
7145
+ }
7146
+ if (!originSchema.safeParse(override).success) {
7147
+ throw new Error(`${variableName} must be an https URL without a trailing slash`);
7148
+ }
7149
+ return override;
7150
+ };
7151
+ const getPlatformAuthOrigin = environment => {
7152
+ var _a;
7153
+ return (_a = originOverride("VENTION_CLI_PLATFORM_AUTH_ORIGIN")) !== null && _a !== void 0 ? _a : PLATFORM_AUTH_ORIGINS[environment];
7154
+ };
7155
+ const gatewayTokenStore = session => ({
7156
+ read: async () => {
7157
+ var _a;
7158
+ if (((_a = session.gatewayToken) === null || _a === void 0 ? void 0 : _a.environment) !== session.environment) {
7159
+ return undefined;
7160
+ }
7161
+ const _b = session.gatewayToken,
7162
+ {
7163
+ environment: _environment
7164
+ } = _b,
7165
+ token = __rest(_b, ["environment"]);
7166
+ return token;
7167
+ },
7168
+ write: async token => {
7169
+ session.gatewayToken = Object.assign(Object.assign({}, token), {
7170
+ environment: session.environment
7171
+ });
7172
+ await saveSession(session);
7173
+ }
7174
+ });
7175
+ const isSameUser = (signedInUserEmail, existingSessionEmail) => signedInUserEmail !== undefined && signedInUserEmail === existingSessionEmail;
7176
+ const loginToPlatform = async existingSession => {
7177
+ const origin = getPlatformAuthOrigin(existingSession.environment);
7178
+ if (!origin) {
7179
+ throw new Error(`The digital twin platform is not available on ${existingSession.environment}`);
7180
+ }
7181
+ console.log(chalk.blue("Signing in to the digital twin platform..."));
7182
+ const {
7183
+ oauth: _oauth,
7184
+ gatewayToken: _gatewayToken
7185
+ } = existingSession,
7186
+ session = __rest(existingSession, ["oauth", "gatewayToken"]);
7187
+ const signedInUser = await loginWithLoopback({
7188
+ issuer: origin,
7189
+ clientLabel: "vention-cli",
7190
+ scopes: ["openid", "email", "profile"],
7191
+ store: gatewayTokenStore(session),
7192
+ fetch: fetchWithUserAgent
7193
+ }).catch(error => {
7194
+ if (error instanceof LoginTimedOut) {
7195
+ throw new Error("Signing in to the digital twin platform took too long. Run 'vention login' again.");
7196
+ }
7197
+ if (error instanceof ExchangeRejected) {
7198
+ throw new Error(`The digital twin platform refused the sign-in (${error.code}).`);
7199
+ }
7200
+ throw error;
7201
+ });
7202
+ const featureFlags = isSameUser(signedInUser.email, existingSession.email) ? session.featureFlags : undefined;
7203
+ await saveSession(Object.assign(Object.assign({}, session), {
7204
+ email: signedInUser.email,
7205
+ featureFlags
7206
+ }));
7207
+ await refreshFeatureFlags();
7208
+ return signedInUser;
7209
+ };
7210
+
7211
+ const loginToRails = async environment => {
7212
+ console.log(chalk.blue("Starting SSO flow..."));
7213
+ const tokens = await loginWithSso(environment);
7214
+ const expiresAt = tokens.expiresInSeconds ? Date.now() + tokens.expiresInSeconds * 1000 : undefined;
7215
+ await saveSession({
7216
+ environment,
7217
+ oauth: {
7218
+ accessToken: tokens.accessToken,
7219
+ refreshToken: tokens.refreshToken,
7220
+ expiresAt
7221
+ },
7222
+ email: tokens.email
7223
+ });
7224
+ await refreshFeatureFlags();
7225
+ const session = await loadSession();
7226
+ if (!session) {
7227
+ throw new Error("The session could not be read back after saving it");
7228
+ }
7229
+ return session;
7230
+ };
7231
+ const refreshPreviousSession = async environment => {
7232
+ await refreshFeatureFlags();
7233
+ const session = await loadSession({
7234
+ quiet: true
7235
+ });
7236
+ return (session === null || session === void 0 ? void 0 : session.environment) === environment ? session : {
7237
+ environment
7238
+ };
7239
+ };
7240
+ const replaceWithPlatformSession = async sessionToReplace => {
7241
+ const {
7242
+ email
7243
+ } = await loginToPlatform(sessionToReplace);
7244
+ await revokeRefreshToken(sessionToReplace).catch(() => {
7245
+ verboseLog("login: could not revoke the legacy refresh token");
7246
+ });
7247
+ if (!email) {
7248
+ throw new Error("The digital twin platform sign-in returned no email, so the rollout flag can't be checked. Please report this.");
7249
+ }
7250
+ };
7251
+ const login = async environment => {
7252
+ const previousSession = await refreshPreviousSession(environment);
7253
+ if (isDigitalTwinV3Enabled(previousSession)) {
7254
+ return replaceWithPlatformSession(previousSession);
7255
+ }
7256
+ const railsSession = await loginToRails(environment);
7257
+ if (!isDigitalTwinV3Enabled(railsSession)) {
7258
+ return;
7259
+ }
7260
+ await replaceWithPlatformSession(railsSession);
7261
+ };
6722
7262
  function createLoginCommand() {
6723
7263
  return new Command().command("login").description("Login to Vention").addOption(new Option("--internal").hideHelp()).action(async (_opts, cmd) => {
6724
7264
  try {
@@ -6750,19 +7290,7 @@ function createLoginCommand() {
6750
7290
  console.log(chalk.green("Successfully logged in!"));
6751
7291
  process.exit(0);
6752
7292
  }
6753
- console.log(chalk.blue("Starting SSO flow..."));
6754
- const tokens = await loginWithSso(environment);
6755
- const expiresAt = tokens.expiresInSeconds ? Date.now() + tokens.expiresInSeconds * 1000 : undefined;
6756
- await saveSession({
6757
- environment,
6758
- oauth: {
6759
- accessToken: tokens.accessToken,
6760
- refreshToken: tokens.refreshToken,
6761
- expiresAt
6762
- },
6763
- email: tokens.email
6764
- });
6765
- await refreshFeatureFlags();
7293
+ await login(environment);
6766
7294
  console.log();
6767
7295
  console.log(chalk.green("Successfully logged in via SSO!"));
6768
7296
  process.exit(0);
@@ -7007,7 +7535,7 @@ const getAuthHeaders = async session => {
7007
7535
  var arrayBufferBasicDetection = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
7008
7536
 
7009
7537
  var toIntegerOrInfinity$7 = toIntegerOrInfinity$b;
7010
- var toLength$4 = toLength$6;
7538
+ var toLength$4 = toLength$7;
7011
7539
 
7012
7540
  var $RangeError$5 = RangeError;
7013
7541
 
@@ -7471,7 +7999,7 @@ var fails$h = fails$F;
7471
7999
  var ArrayBufferModule$1 = arrayBuffer;
7472
8000
  var anObject$6 = anObject$p;
7473
8001
  var toAbsoluteIndex = toAbsoluteIndex$4;
7474
- var toLength$3 = toLength$6;
8002
+ var toLength$3 = toLength$7;
7475
8003
 
7476
8004
  var ArrayBuffer$5 = ArrayBufferModule$1.ArrayBuffer;
7477
8005
  var DataView$4 = ArrayBufferModule$1.DataView;
@@ -7764,7 +8292,7 @@ var create$2 = objectCreate;
7764
8292
  var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
7765
8293
  var isPrototypeOf$2 = objectIsPrototypeOf;
7766
8294
  var isRegExp = isRegexp;
7767
- var toString$8 = toString$i;
8295
+ var toString$8 = toString$j;
7768
8296
  var getRegExpFlags$1 = regexpGetFlags;
7769
8297
  var stickyHelpers$1 = regexpStickyHelpers;
7770
8298
  var proxyAccessor = proxyAccessor$2;
@@ -7992,7 +8520,7 @@ if (DESCRIPTORS$2 && UNSUPPORTED_DOT_ALL$1) {
7992
8520
  /* eslint-disable regexp/no-useless-quantifier -- testing */
7993
8521
  var call$c = functionCall;
7994
8522
  var uncurryThis$f = functionUncurryThis;
7995
- var toString$7 = toString$i;
8523
+ var toString$7 = toString$j;
7996
8524
  var regexpFlags = regexpFlags$1;
7997
8525
  var stickyHelpers = regexpStickyHelpers;
7998
8526
  var shared = shared$4;
@@ -8127,7 +8655,7 @@ var $$i = _export;
8127
8655
  var call$b = functionCall;
8128
8656
  var isCallable$3 = isCallable$t;
8129
8657
  var anObject$5 = anObject$p;
8130
- var toString$6 = toString$i;
8658
+ var toString$6 = toString$j;
8131
8659
 
8132
8660
  var DELEGATES_TO_EXEC = function () {
8133
8661
  var execCalled = false;
@@ -8793,9 +9321,9 @@ var anObject$2 = anObject$p;
8793
9321
  var isCallable$1 = isCallable$t;
8794
9322
  var isObject$5 = isObject$m;
8795
9323
  var toIntegerOrInfinity$4 = toIntegerOrInfinity$b;
8796
- var toLength$2 = toLength$6;
8797
- var toString$5 = toString$i;
8798
- var requireObjectCoercible$4 = requireObjectCoercible$a;
9324
+ var toLength$2 = toLength$7;
9325
+ var toString$5 = toString$j;
9326
+ var requireObjectCoercible$4 = requireObjectCoercible$b;
8799
9327
  var advanceStringIndex = advanceStringIndex$1;
8800
9328
  var getMethod = getMethod$5;
8801
9329
  var getSubstitution = getSubstitution$1;
@@ -10810,7 +11338,7 @@ var aCallable$1 = aCallable$j;
10810
11338
  var toObject = toObject$b;
10811
11339
  var lengthOfArrayLike = lengthOfArrayLike$g;
10812
11340
  var deletePropertyOrThrow = deletePropertyOrThrow$1;
10813
- var toString$4 = toString$i;
11341
+ var toString$4 = toString$j;
10814
11342
  var fails$1 = fails$F;
10815
11343
  var internalSort = arraySort$1;
10816
11344
  var arrayMethodIsStrict = arrayMethodIsStrict$1;
@@ -11004,8 +11532,8 @@ $$3({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {
11004
11532
  });
11005
11533
 
11006
11534
  var toIntegerOrInfinity = toIntegerOrInfinity$b;
11007
- var toString$3 = toString$i;
11008
- var requireObjectCoercible$3 = requireObjectCoercible$a;
11535
+ var toString$3 = toString$j;
11536
+ var requireObjectCoercible$3 = requireObjectCoercible$b;
11009
11537
 
11010
11538
  var $RangeError = RangeError;
11011
11539
  var floor = Math.floor;
@@ -11022,10 +11550,10 @@ var stringRepeat = function repeat(count) {
11022
11550
  };
11023
11551
 
11024
11552
  var uncurryThis$2 = functionUncurryThis;
11025
- var toLength$1 = toLength$6;
11026
- var toString$2 = toString$i;
11553
+ var toLength$1 = toLength$7;
11554
+ var toString$2 = toString$j;
11027
11555
  var $repeat = stringRepeat;
11028
- var requireObjectCoercible$2 = requireObjectCoercible$a;
11556
+ var requireObjectCoercible$2 = requireObjectCoercible$b;
11029
11557
 
11030
11558
  var repeat = uncurryThis$2($repeat);
11031
11559
  var stringSlice$1 = uncurryThis$2(''.slice);
@@ -11074,10 +11602,10 @@ $$2({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
11074
11602
  var $$1 = _export;
11075
11603
  var uncurryThis$1 = functionUncurryThisClause;
11076
11604
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
11077
- var toLength = toLength$6;
11078
- var toString$1 = toString$i;
11605
+ var toLength = toLength$7;
11606
+ var toString$1 = toString$j;
11079
11607
  var notARegExp = notARegexp;
11080
- var requireObjectCoercible$1 = requireObjectCoercible$a;
11608
+ var requireObjectCoercible$1 = requireObjectCoercible$b;
11081
11609
  var correctIsRegExpLogic = correctIsRegexpLogic;
11082
11610
 
11083
11611
  var stringSlice = uncurryThis$1(''.slice);
@@ -11107,8 +11635,8 @@ var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u200
11107
11635
  '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
11108
11636
 
11109
11637
  var uncurryThis = functionUncurryThis;
11110
- var requireObjectCoercible = requireObjectCoercible$a;
11111
- var toString = toString$i;
11638
+ var requireObjectCoercible = requireObjectCoercible$b;
11639
+ var toString = toString$j;
11112
11640
  var whitespaces$1 = whitespaces$2;
11113
11641
 
11114
11642
  var replace = uncurryThis(''.replace);