@flemist/test-variants 3.0.3 → 5.0.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/README.md +287 -49
- package/build/browser/index.cjs +1 -0
- package/build/browser/index.d.ts +1 -0
- package/build/browser/index.mjs +4 -0
- package/build/common/-test/freezeProps.d.ts +2 -0
- package/build/common/garbage-collect/garbageCollect.d.ts +5 -0
- package/build/common/helpers/log.d.ts +5 -0
- package/build/common/index.cjs +1 -0
- package/build/common/index.d.ts +2 -0
- package/build/common/index.mjs +4 -0
- package/build/common/test-variants/-test/caches.d.ts +1 -0
- package/build/common/test-variants/-test/constants.d.ts +8 -0
- package/build/common/test-variants/-test/estimations/estimateCallCount.d.ts +4 -0
- package/build/common/test-variants/-test/estimations/estimateModeChanges.d.ts +4 -0
- package/build/common/test-variants/-test/generators/findBestError.d.ts +4 -0
- package/build/common/test-variants/-test/generators/primitives.d.ts +16 -0
- package/build/common/test-variants/-test/generators/run.d.ts +9 -0
- package/build/common/test-variants/-test/generators/template.d.ts +3 -0
- package/build/common/test-variants/-test/generators/testFunc.d.ts +3 -0
- package/build/common/test-variants/-test/helpers/CallController.d.ts +28 -0
- package/build/common/test-variants/-test/helpers/ErrorVariantController.d.ts +17 -0
- package/build/common/test-variants/-test/helpers/TestError.d.ts +2 -0
- package/build/common/test-variants/-test/helpers/deepEqualJsonLikeWithoutSeed.d.ts +1 -0
- package/build/common/test-variants/-test/helpers/deepFreezeJsonLike.d.ts +1 -0
- package/build/common/test-variants/-test/helpers/forEachVariant.d.ts +4 -0
- package/build/common/test-variants/-test/helpers/getMaxAttemptsPerVariant.d.ts +2 -0
- package/build/common/test-variants/-test/helpers/getParallelLimit.d.ts +7 -0
- package/build/common/test-variants/-test/helpers/getVariantArgs.d.ts +12 -0
- package/build/common/test-variants/-test/helpers/runWithTimeController.d.ts +7 -0
- package/build/common/test-variants/-test/invariants/CallCountInvariant.d.ts +18 -0
- package/build/common/test-variants/-test/invariants/CallOptionsInvariant.d.ts +32 -0
- package/build/common/test-variants/-test/invariants/ErrorBehaviorInvariant.d.ts +32 -0
- package/build/common/test-variants/-test/invariants/FindBestErrorInvariant.d.ts +37 -0
- package/build/common/test-variants/-test/invariants/IterationsInvariant.d.ts +21 -0
- package/build/common/test-variants/-test/invariants/LimitTimeInvariant.d.ts +26 -0
- package/build/common/test-variants/-test/invariants/LogInvariant.d.ts +126 -0
- package/build/common/test-variants/-test/invariants/OnErrorInvariant.d.ts +38 -0
- package/build/common/test-variants/-test/invariants/OnModeChangeInvariant.d.ts +32 -0
- package/build/common/test-variants/-test/invariants/ParallelInvariant.d.ts +25 -0
- package/build/common/test-variants/-test/log.d.ts +3 -0
- package/build/common/test-variants/-test/types.d.ts +34 -0
- package/build/common/test-variants/-test/variants.d.ts +3 -0
- package/build/common/test-variants/createTestRun.d.ts +3 -0
- package/build/common/test-variants/createTestVariants.d.ts +4 -0
- package/build/common/test-variants/iterator/createVariantsIterator.d.ts +4 -0
- package/build/common/test-variants/iterator/helpers/findValueIndex.d.ts +2 -0
- package/build/common/test-variants/iterator/helpers/mode.d.ts +3 -0
- package/build/common/test-variants/iterator/helpers/template.d.ts +7 -0
- package/build/common/test-variants/iterator/types.d.ts +106 -0
- package/build/common/test-variants/iterator/variant-navigation/-test/helpers/caches.d.ts +1 -0
- package/build/common/test-variants/iterator/variant-navigation/-test/helpers/check.d.ts +2 -0
- package/build/common/test-variants/iterator/variant-navigation/-test/helpers/create.d.ts +3 -0
- package/build/common/test-variants/iterator/variant-navigation/-test/helpers/format.d.ts +6 -0
- package/build/common/test-variants/iterator/variant-navigation/-test/helpers/parse.d.ts +8 -0
- package/build/common/test-variants/iterator/variant-navigation/-test/helpers/variants.d.ts +12 -0
- package/build/common/test-variants/iterator/variant-navigation/variantNavigation.d.ts +28 -0
- package/build/common/test-variants/log/format.d.ts +7 -0
- package/build/common/test-variants/log/getMemoryUsage.d.ts +2 -0
- package/build/common/test-variants/log/logOptions.d.ts +8 -0
- package/build/common/test-variants/run/AbortErrorSilent.d.ts +3 -0
- package/build/common/test-variants/run/RunContext.d.ts +21 -0
- package/build/common/test-variants/run/createRunResult.d.ts +6 -0
- package/build/common/test-variants/run/createRunState.d.ts +23 -0
- package/build/common/test-variants/run/errorHandlers.d.ts +20 -0
- package/build/common/test-variants/run/gcManager.d.ts +6 -0
- package/build/common/test-variants/run/resolveRunOptions.d.ts +23 -0
- package/build/common/test-variants/run/runIterationLoop.d.ts +9 -0
- package/build/common/test-variants/run/runLogger.d.ts +9 -0
- package/build/common/test-variants/run/types.d.ts +57 -0
- package/build/common/test-variants/testVariantsRun.d.ts +6 -0
- package/build/common/test-variants/types.d.ts +187 -0
- package/build/createTestVariants-BE_TQ9u5.mjs +1018 -0
- package/build/createTestVariants-Cmx68kHs.js +4 -0
- package/build/node/index.cjs +1 -0
- package/build/node/index.d.ts +8 -0
- package/build/node/index.mjs +107 -0
- package/build/node/test-variants/createSaveErrorVariantsStore.d.ts +5 -0
- package/{dist/lib → build/node}/test-variants/saveErrorVariants.d.ts +4 -3
- package/package.json +109 -68
- package/dist/bundle/browser.js +0 -669
- package/dist/lib/garbage-collect/garbageCollect.cjs +0 -30
- package/dist/lib/garbage-collect/garbageCollect.d.ts +0 -2
- package/dist/lib/garbage-collect/garbageCollect.mjs +0 -26
- package/dist/lib/index.cjs +0 -23
- package/dist/lib/index.d.ts +0 -7
- package/dist/lib/index.mjs +0 -13
- package/dist/lib/test-variants/argsToString.cjs +0 -17
- package/dist/lib/test-variants/argsToString.d.ts +0 -2
- package/dist/lib/test-variants/argsToString.mjs +0 -13
- package/dist/lib/test-variants/createTestVariants.cjs +0 -91
- package/dist/lib/test-variants/createTestVariants.d.ts +0 -8
- package/dist/lib/test-variants/createTestVariants.mjs +0 -87
- package/dist/lib/test-variants/createTestVariants.perf.cjs +0 -44
- package/dist/lib/test-variants/createTestVariants.perf.d.ts +0 -1
- package/dist/lib/test-variants/createTestVariants.perf.mjs +0 -42
- package/dist/lib/test-variants/prime.cjs +0 -65
- package/dist/lib/test-variants/prime.d.ts +0 -3
- package/dist/lib/test-variants/prime.mjs +0 -59
- package/dist/lib/test-variants/prime.perf.cjs +0 -30
- package/dist/lib/test-variants/prime.perf.d.ts +0 -1
- package/dist/lib/test-variants/prime.perf.mjs +0 -28
- package/dist/lib/test-variants/saveErrorVariants.cjs +0 -97
- package/dist/lib/test-variants/saveErrorVariants.mjs +0 -69
- package/dist/lib/test-variants/testVariantsCreateTestRun.cjs +0 -80
- package/dist/lib/test-variants/testVariantsCreateTestRun.d.ts +0 -22
- package/dist/lib/test-variants/testVariantsCreateTestRun.mjs +0 -76
- package/dist/lib/test-variants/testVariantsIterable.cjs +0 -70
- package/dist/lib/test-variants/testVariantsIterable.d.ts +0 -15
- package/dist/lib/test-variants/testVariantsIterable.mjs +0 -66
- package/dist/lib/test-variants/testVariantsIterator.cjs +0 -429
- package/dist/lib/test-variants/testVariantsIterator.d.ts +0 -67
- package/dist/lib/test-variants/testVariantsIterator.mjs +0 -425
- package/dist/lib/test-variants/testVariantsRun.cjs +0 -289
- package/dist/lib/test-variants/testVariantsRun.d.ts +0 -50
- package/dist/lib/test-variants/testVariantsRun.mjs +0 -265
- package/dist/lib/test-variants/types.cjs +0 -2
- package/dist/lib/test-variants/types.d.ts +0 -20
- package/dist/lib/test-variants/types.mjs +0 -1
package/dist/bundle/browser.js
DELETED
|
@@ -1,669 +0,0 @@
|
|
|
1
|
-
!function(e,t,n){"use strict";function r(e){
|
|
2
|
-
if(e&&e.__esModule)return e
|
|
3
|
-
;var t=Object.create(null)
|
|
4
|
-
;return e&&Object.keys(e).forEach(function(n){
|
|
5
|
-
if("default"!==n){
|
|
6
|
-
var r=Object.getOwnPropertyDescriptor(e,n)
|
|
7
|
-
;Object.defineProperty(t,n,r.get?r:{enumerable:!0,
|
|
8
|
-
get:function(){return e[n]}})}
|
|
9
|
-
}),t.default=e,Object.freeze(t)}
|
|
10
|
-
var i=r(t),s=r(n),o=function(){
|
|
11
|
-
return o=Object.assign||function(e){
|
|
12
|
-
for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])
|
|
13
|
-
;return e},o.apply(this,arguments)}
|
|
14
|
-
;function l(e,t,n,r){
|
|
15
|
-
return new(n||(n=Promise))(function(i,s){
|
|
16
|
-
function o(e){try{a(r.next(e))}catch(e){s(e)}}
|
|
17
|
-
function l(e){try{a(r.throw(e))}catch(e){s(e)}}
|
|
18
|
-
function a(e){var t
|
|
19
|
-
;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){
|
|
20
|
-
e(t)})).then(o,l)}a((r=r.apply(e,t||[])).next())})
|
|
21
|
-
}function a(e,t){var n,r,i,s,o={label:0,
|
|
22
|
-
sent:function(){if(1&i[0])throw i[1];return i[1]},
|
|
23
|
-
trys:[],ops:[]};return s={next:l(0),throw:l(1),
|
|
24
|
-
return:l(2)
|
|
25
|
-
},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){
|
|
26
|
-
return this}),s;function l(l){return function(a){
|
|
27
|
-
return function(l){
|
|
28
|
-
if(n)throw new TypeError("Generator is already executing.")
|
|
29
|
-
;for(;s&&(s=0,l[0]&&(o=0)),o;)try{
|
|
30
|
-
if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),
|
|
31
|
-
0):r.next)&&!(i=i.call(r,l[1])).done)return i
|
|
32
|
-
;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:
|
|
33
|
-
case 1:i=l;break;case 4:return o.label++,{
|
|
34
|
-
value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0]
|
|
35
|
-
;continue;case 7:l=o.ops.pop(),o.trys.pop()
|
|
36
|
-
;continue;default:
|
|
37
|
-
if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){
|
|
38
|
-
o=0;continue}
|
|
39
|
-
if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){
|
|
40
|
-
o.label=l[1];break}if(6===l[0]&&o.label<i[1]){
|
|
41
|
-
o.label=i[1],i=l;break}if(i&&o.label<i[2]){
|
|
42
|
-
o.label=i[2],o.ops.push(l);break}
|
|
43
|
-
i[2]&&o.ops.pop(),o.trys.pop();continue}
|
|
44
|
-
l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=i=0}
|
|
45
|
-
if(5&l[0])throw l[1];return{
|
|
46
|
-
value:l[0]?l[1]:void 0,done:!0}}([l,a])}}}
|
|
47
|
-
function c(e){
|
|
48
|
-
var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0
|
|
49
|
-
;if(n)return n.call(e)
|
|
50
|
-
;if(e&&"number"==typeof e.length)return{
|
|
51
|
-
next:function(){
|
|
52
|
-
return e&&r>=e.length&&(e=void 0),{
|
|
53
|
-
value:e&&e[r++],done:!e}}}
|
|
54
|
-
;throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")
|
|
55
|
-
}function u(e){
|
|
56
|
-
return l(this,void 0,void 0,function(){var t,n
|
|
57
|
-
;return a(this,function(r){switch(r.label){case 0:
|
|
58
|
-
return[4,i.promises.stat(e).catch(function(){
|
|
59
|
-
return null})];case 1:
|
|
60
|
-
if(null==(t=r.sent()))return[2,[]]
|
|
61
|
-
;if(!t.isDirectory())throw new Error("[saveErrorVariants] path is not a directory: ".concat(e))
|
|
62
|
-
;return[4,i.promises.readdir(e)];case 2:
|
|
63
|
-
return n=r.sent(),[2,n.filter(function(e){
|
|
64
|
-
return e.endsWith(".json")}).sort(function(e,t){
|
|
65
|
-
return e>t?-1:e<t?1:0}).map(function(t){
|
|
66
|
-
return s.join(e,t)})]}})})}function h(e,t){
|
|
67
|
-
return l(this,void 0,void 0,function(){var n,r
|
|
68
|
-
;return a(this,function(s){switch(s.label){case 0:
|
|
69
|
-
return[4,i.promises.readFile(e,"utf-8")];case 1:
|
|
70
|
-
n=s.sent();try{r=JSON.parse(n)}catch(t){
|
|
71
|
-
throw new Error("[saveErrorVariants] invalid JSON in file: ".concat(e))
|
|
72
|
-
}if(t)try{return[2,t(r)]}catch(t){
|
|
73
|
-
throw new Error("[saveErrorVariants] jsonToArgs failed for file: ".concat(e))
|
|
74
|
-
}return[2,r]}})})}function f(e){
|
|
75
|
-
return e.sessionDate.toISOString().substring(0,19).replace("T","_").replaceAll(":","-")+".json"
|
|
76
|
-
}function d(e,t,n){
|
|
77
|
-
return l(this,void 0,void 0,function(){var r,o
|
|
78
|
-
;return a(this,function(l){switch(l.label){case 0:
|
|
79
|
-
return n?(o=n(e),r="string"==typeof o?o:JSON.stringify(o,null,2)):r=JSON.stringify(e,null,2),
|
|
80
|
-
[4,i.promises.mkdir(s.dirname(t),{recursive:!0})]
|
|
81
|
-
;case 1:
|
|
82
|
-
return l.sent(),[4,i.promises.writeFile(t,r,"utf-8")]
|
|
83
|
-
;case 2:return l.sent(),[2]}})})}function v(e,t){
|
|
84
|
-
return e<t}class g{
|
|
85
|
-
constructor({objectPool:e,lessThanFunc:t}={}){
|
|
86
|
-
this._size=0,this._root=null,this.merge=p,
|
|
87
|
-
this.collapse=_,this._objectPool=e,this._lessThanFunc=t||v
|
|
88
|
-
}clear(){this._root=null,this._size=0}get size(){
|
|
89
|
-
return this._size}add(e){
|
|
90
|
-
let t=null!=this._objectPool?this._objectPool.get():null
|
|
91
|
-
;return null==t?t={child:null,next:null,prev:null,
|
|
92
|
-
item:e
|
|
93
|
-
}:t.item=e,this._size++,this._root=p(this._root,t,this._lessThanFunc),t
|
|
94
|
-
}getMin(){const{_root:e}=this
|
|
95
|
-
;return null==e?void 0:e.item}getMinNode(){
|
|
96
|
-
return this._root}deleteMin(){const{_root:e}=this
|
|
97
|
-
;if(null==e)return;const t=e.item
|
|
98
|
-
;return this.delete(e),t}delete(e){var t
|
|
99
|
-
;if(e===this._root)this._root=_(e.child,this._lessThanFunc);else{
|
|
100
|
-
if(null==e.prev){
|
|
101
|
-
if(this._objectPool)throw new Error("The node is already deleted. Don't use the objectPool to prevent this error.")
|
|
102
|
-
;return}
|
|
103
|
-
e.prev.child===e?e.prev.child=e.next:e.prev.next=e.next,null!=e.next&&(e.next.prev=e.prev),
|
|
104
|
-
this._root=p(this._root,_(e.child,this._lessThanFunc),this._lessThanFunc)
|
|
105
|
-
}
|
|
106
|
-
e.child=null,e.prev=null,e.next=null,e.item=void 0,null===(t=this._objectPool)||void 0===t||t.release(e),
|
|
107
|
-
this._size--}decreaseKey(e){
|
|
108
|
-
e!==this._root&&(e.prev.child===e?e.prev.child=e.next:e.prev.next=e.next,
|
|
109
|
-
null!=e.next&&(e.next.prev=e.prev),
|
|
110
|
-
this._root=p(this._root,e,this._lessThanFunc))}
|
|
111
|
-
get isEmpty(){return null==this._root}
|
|
112
|
-
[Symbol.iterator](){return this._iterate(!1)}
|
|
113
|
-
nodes(){return{
|
|
114
|
-
[Symbol.iterator]:()=>this._iterate(!0)}}
|
|
115
|
-
_iterate(e){const t=this._lessThanFunc
|
|
116
|
-
;return function*n(r){
|
|
117
|
-
r&&(e?yield r:yield r.item,r.child&&(null!=r.child.next&&(r.child=_(r.child,t),
|
|
118
|
-
r.child.prev=r),yield*n(r.child)))}(this._root)}}
|
|
119
|
-
function p(e,t,n){let r,i
|
|
120
|
-
;return null==e?t:null==t||e===t?e:(n(t.item,e.item)?(r=t,
|
|
121
|
-
i=e):(r=e,i=t),i.next=r.child,
|
|
122
|
-
null!=r.child&&(r.child.prev=i),i.prev=r,r.child=i,
|
|
123
|
-
r.next=null,r.prev=null,r)}function _(e,t){
|
|
124
|
-
let n,r,i,s,o;if(null==e)return null
|
|
125
|
-
;for(s=e,n=null;null!=s;){
|
|
126
|
-
if(r=s,i=r.next,null==i){r.prev=n,n=r;break}
|
|
127
|
-
s=i.next,o=p(r,i,t),o.prev=n,n=o}
|
|
128
|
-
for(o=null;null!=n;)s=n.prev,o=p(o,n,t),n=s
|
|
129
|
-
;return o}function y(e,t){e(function(e){return{
|
|
130
|
-
then(t,n){n(e)}}}(t))}function b(e){
|
|
131
|
-
return null!=e&&"object"==typeof e&&"function"==typeof e.then
|
|
132
|
-
}let m,x=[];function w(e){
|
|
133
|
-
x.push(e),m||(m=function(){
|
|
134
|
-
return l(this,void 0,void 0,function*(){
|
|
135
|
-
for(;x.length>0;){yield 0;const e=x
|
|
136
|
-
;x=[],e.forEach(e=>{try{e()}catch(e){
|
|
137
|
-
console.error("Unhandled promise rejection",e)}})}
|
|
138
|
-
m=null})}())}function j(e,t,n){w(()=>{try{
|
|
139
|
-
const r=t?t(e):e;n._resolve(r)}catch(e){
|
|
140
|
-
n._reject(e)}})}function E(e,t,n){w(()=>{if(t)try{
|
|
141
|
-
const r=t(e);n._resolve(r)}catch(e){n._reject(e)
|
|
142
|
-
}else n._reject(e)})}const S=function(){};class A{
|
|
143
|
-
constructor(e){
|
|
144
|
-
this.status="pending",this.value=void 0,this.reason=void 0,this._handlers=null
|
|
145
|
-
;const t=this._resolve,n=this._reject,r=this._resolveAsync,i=this._rejectAsync,s=this
|
|
146
|
-
;this._resolve=function(e){t.call(s,e)
|
|
147
|
-
},this._reject=function(e){n.call(s,e)
|
|
148
|
-
},this._resolveAsync=function(e){r.call(s,e)
|
|
149
|
-
},this._rejectAsync=function(e){i.call(s,e)
|
|
150
|
-
},e(this._resolve,this._reject)}_resolve(e){
|
|
151
|
-
"pending"===this.status&&(this.status="fulfilled",
|
|
152
|
-
this._resolveAsync(e))}_resolveAsync(e){
|
|
153
|
-
b(e)?e.then(this._resolveAsync,this._rejectAsync):this._resolveSync(e)
|
|
154
|
-
}_resolveSync(e){const t=this._handlers
|
|
155
|
-
;if(this.value=e,null!=t){this._handlers=null
|
|
156
|
-
;for(let n=0,r=t.length;n<r;n++){const[r,,i]=t[n]
|
|
157
|
-
;j(e,r,i)}}}_reject(e){
|
|
158
|
-
"pending"===this.status&&this._rejectAsync(e)}
|
|
159
|
-
_rejectAsync(e){
|
|
160
|
-
this.status="rejected",b(e)?e.then(this._rejectAsync,this._rejectAsync):this._rejectSync(e)
|
|
161
|
-
}_rejectSync(e){const t=this._handlers
|
|
162
|
-
;if(this.reason=e,null!=t){this._handlers=null
|
|
163
|
-
;for(let n=0,r=t.length;n<r;n++){const[,r,i]=t[n]
|
|
164
|
-
;E(e,r,i)}}}then(e,t){const n=new A(S)
|
|
165
|
-
;return"pending"===this.status?(null==this._handlers&&(this._handlers=[]),
|
|
166
|
-
this._handlers.push([e,t,n])):"fulfilled"===this.status?j(this.value,e,n):E(this.reason,t,n),
|
|
167
|
-
n}catch(e){return this.then(void 0,e)}finally(e){
|
|
168
|
-
const t=e&&function(t){const n=e()
|
|
169
|
-
;return b(n)?n.then(()=>t):A.resolve(t)
|
|
170
|
-
},n=e&&function(t){const n=e()
|
|
171
|
-
;return b(n)?n.then(()=>A.reject(t)):A.reject(t)}
|
|
172
|
-
;return this.then(t,n)}static resolve(e){
|
|
173
|
-
const t=new A(S);return t._resolve(e),t}
|
|
174
|
-
static reject(e){const t=new A(S)
|
|
175
|
-
;return t._reject(e),t}get[Symbol.toStringTag](){
|
|
176
|
-
return"Promise"}static get[Symbol.species](){
|
|
177
|
-
return A}static all(e){return function(e,t){
|
|
178
|
-
let n,r;t||(t=Promise);const i=new t((e,t)=>{
|
|
179
|
-
n=e,r=t});let s=e.length;const o=[]
|
|
180
|
-
;return e.forEach((e,t)=>{b(e)?e.then(e=>{
|
|
181
|
-
o[t]=e,0===--s&&n(o)},r):(o[t]=e,0===--s&&n(o))
|
|
182
|
-
}),i}(e,A)}static allSettled(e){
|
|
183
|
-
return function(e,t){let n;t||(t=Promise)
|
|
184
|
-
;const r=new t((e,t)=>{n=e});let i=e.length
|
|
185
|
-
;const s=[];return e.forEach((e,t)=>{
|
|
186
|
-
b(e)?e.then(e=>{s[t]={status:"fulfilled",value:e
|
|
187
|
-
},0===--i&&n(s)},e=>{s[t]={status:"rejected",
|
|
188
|
-
reason:e},0===--i&&n(s)}):(s[t]={
|
|
189
|
-
status:"fulfilled",value:e},0===--i&&n(s))}),r
|
|
190
|
-
}(e,A)}static any(e){return function(e,t){let n,r
|
|
191
|
-
;t||(t=Promise);const i=new t((e,t)=>{n=e,r=t})
|
|
192
|
-
;let s=e.length;const o=[]
|
|
193
|
-
;return e.forEach((e,t)=>{b(e)?e.then(n,e=>{
|
|
194
|
-
o[t]=e,0===--s&&r(new AggregateError(o))}):n(e)
|
|
195
|
-
}),i}(e,A)}static race(e){return function(e,t){
|
|
196
|
-
let n,r;t||(t=Promise);const i=new t((e,t)=>{
|
|
197
|
-
n=e,r=t});return e.forEach(e=>{
|
|
198
|
-
b(e)?e.then(n,r):n(e)}),i}(e,A)}}
|
|
199
|
-
const P=function(){};class k{constructor(e){
|
|
200
|
-
if(this._status="pending",e&&e.aborted)this.promise=A.reject(e.reason),
|
|
201
|
-
this.resolve=P,this.reject=P;else{let t,n
|
|
202
|
-
;if(this.promise=new Promise(function(e){
|
|
203
|
-
t=e,n=function(t){y(e,t)}}),e){
|
|
204
|
-
const r=e.subscribe(function(e){n(e)})
|
|
205
|
-
;this.resolve=function(e){r(),t(e)
|
|
206
|
-
},this.reject=function(e){r(),n(e)}
|
|
207
|
-
}else this.resolve=t,this.reject=n}
|
|
208
|
-
this.promise.then(()=>{this._status="resolved"
|
|
209
|
-
},()=>{this._status="rejected"})}get state(){
|
|
210
|
-
return this._status}}class I extends Error{
|
|
211
|
-
constructor(e,t){
|
|
212
|
-
super(e),Object.setPrototypeOf(this,I.prototype),this.reason=t,
|
|
213
|
-
this.name="AbortError",this._internal=!1}}
|
|
214
|
-
const T=()=>{};class O{constructor(){
|
|
215
|
-
this.aborted=!1,this.reason=void 0,this._callbacks=void 0
|
|
216
|
-
}subscribe(e){var t
|
|
217
|
-
;if(null===(t=this._callbacks)||void 0===t?void 0:t.has(e))throw new Error("Already subscribed: "+e)
|
|
218
|
-
;return this.aborted?(e.call(this,this.reason),
|
|
219
|
-
T):(this._callbacks||(this._callbacks=new Set),
|
|
220
|
-
this._callbacks.add(e),()=>{var t
|
|
221
|
-
;null===(t=this._callbacks)||void 0===t||t.delete(e)
|
|
222
|
-
})}abort(e){var t
|
|
223
|
-
;this.aborted=!0,this.reason=e,null===(t=this._callbacks)||void 0===t||t.forEach(e=>{
|
|
224
|
-
e.call(this,this.reason)}),this._callbacks=void 0}
|
|
225
|
-
throwIfAborted(){if(this.aborted)throw this.reason
|
|
226
|
-
}}class z{constructor(){this.signal=new O}
|
|
227
|
-
abort(e){
|
|
228
|
-
this.signal.aborted||(void 0===e&&((e=new I("Aborted with no reason",e))._internal=!0),
|
|
229
|
-
this.signal.abort(e))}}function L(e,t){
|
|
230
|
-
var n=0,r=null;function i(e,i,s){
|
|
231
|
-
return l(this,void 0,void 0,function(){var o
|
|
232
|
-
;return a(this,function(l){switch(l.label){case 0:
|
|
233
|
-
return r={error:e,args:i,index:s
|
|
234
|
-
},console.error("[test-variants] error variant: ".concat(s,"\n").concat(function(e){
|
|
235
|
-
return JSON.stringify(e,function(e,t){
|
|
236
|
-
return t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor!==Object?t+"":t
|
|
237
|
-
},2)
|
|
238
|
-
}(i))),console.error(e),o=Date.now(),Date.now()-o>50&&n<5?(console.log("[test-variants] DEBUG ITERATION: "+n),
|
|
239
|
-
n++,[2]):t.onError?[4,t.onError(r)]:[3,2];case 1:
|
|
240
|
-
l.sent(),l.label=2;case 2:throw r.error}})})}
|
|
241
|
-
return function(t,n,r){try{var s=e(t,r)
|
|
242
|
-
;if(b(s))return s.then(function(e){
|
|
243
|
-
return"number"==typeof e?{iterationsAsync:e,
|
|
244
|
-
iterationsSync:0}:null!==e&&"object"==typeof e?e:{
|
|
245
|
-
iterationsAsync:1,iterationsSync:0}},function(e){
|
|
246
|
-
return i(e,t,n)});return"number"==typeof s?{
|
|
247
|
-
iterationsAsync:0,iterationsSync:s
|
|
248
|
-
}:null!==s&&"object"==typeof s?s:{
|
|
249
|
-
iterationsAsync:0,iterationsSync:1}}catch(e){
|
|
250
|
-
return i(e,t,n)}}}class V{constructor(e,t){
|
|
251
|
-
this._branch=null,this.order=e,this.parent=t}
|
|
252
|
-
get branch(){if(!this._branch){
|
|
253
|
-
const e=[this.order];let t=this.parent
|
|
254
|
-
;for(;null!=t;)e.push(t.order),t=t.parent
|
|
255
|
-
;this._branch=e}return this._branch}}
|
|
256
|
-
function F(e){
|
|
257
|
-
return null!=e&&"object"==typeof e&&"function"==typeof e.then
|
|
258
|
-
}let M,D=[];function C(e){
|
|
259
|
-
D.push(e),M||(M=function(){
|
|
260
|
-
return l(this,void 0,void 0,function*(){
|
|
261
|
-
for(;D.length>0;){yield 0;const e=D
|
|
262
|
-
;D=[],e.forEach(e=>{try{e()}catch(e){
|
|
263
|
-
console.error("Unhandled promise rejection",e)}})}
|
|
264
|
-
M=null})}())}function R(e,t,n){C(()=>{try{
|
|
265
|
-
const r=t?t(e):e;n._resolve(r)}catch(e){
|
|
266
|
-
n._reject(e)}})}function q(e,t,n){C(()=>{if(t)try{
|
|
267
|
-
const r=t(e);n._resolve(r)}catch(e){n._reject(e)
|
|
268
|
-
}else n._reject(e)})}const B=function(){};class J{
|
|
269
|
-
constructor(e){
|
|
270
|
-
this.status="pending",this.value=void 0,this.reason=void 0,this._handlers=null
|
|
271
|
-
;const t=this._resolve,n=this._reject,r=this._resolveAsync,i=this._rejectAsync,s=this
|
|
272
|
-
;this._resolve=function(e){t.call(s,e)
|
|
273
|
-
},this._reject=function(e){n.call(s,e)
|
|
274
|
-
},this._resolveAsync=function(e){r.call(s,e)
|
|
275
|
-
},this._rejectAsync=function(e){i.call(s,e)
|
|
276
|
-
},e(this._resolve,this._reject)}_resolve(e){
|
|
277
|
-
"pending"===this.status&&(this.status="fulfilled",
|
|
278
|
-
this._resolveAsync(e))}_resolveAsync(e){
|
|
279
|
-
F(e)?e.then(this._resolveAsync,this._rejectAsync):this._resolveSync(e)
|
|
280
|
-
}_resolveSync(e){const t=this._handlers
|
|
281
|
-
;if(this.value=e,null!=t){this._handlers=null
|
|
282
|
-
;for(let n=0,r=t.length;n<r;n++){const[r,,i]=t[n]
|
|
283
|
-
;R(e,r,i)}}}_reject(e){
|
|
284
|
-
"pending"===this.status&&this._rejectAsync(e)}
|
|
285
|
-
_rejectAsync(e){
|
|
286
|
-
this.status="rejected",F(e)?e.then(this._rejectAsync,this._rejectAsync):this._rejectSync(e)
|
|
287
|
-
}_rejectSync(e){const t=this._handlers
|
|
288
|
-
;if(this.reason=e,null!=t){this._handlers=null
|
|
289
|
-
;for(let n=0,r=t.length;n<r;n++){const[,r,i]=t[n]
|
|
290
|
-
;q(e,r,i)}}}then(e,t){const n=new J(B)
|
|
291
|
-
;return"pending"===this.status?(null==this._handlers&&(this._handlers=[]),
|
|
292
|
-
this._handlers.push([e,t,n])):"fulfilled"===this.status?R(this.value,e,n):q(this.reason,t,n),
|
|
293
|
-
n}catch(e){return this.then(void 0,e)}finally(e){
|
|
294
|
-
const t=e&&function(t){const n=e()
|
|
295
|
-
;return F(n)?n.then(()=>t):J.resolve(t)
|
|
296
|
-
},n=e&&function(t){const n=e()
|
|
297
|
-
;return F(n)?n.then(()=>J.reject(t)):J.reject(t)}
|
|
298
|
-
;return this.then(t,n)}static resolve(e){
|
|
299
|
-
const t=new J(B);return t._resolve(e),t}
|
|
300
|
-
static reject(e){const t=new J(B)
|
|
301
|
-
;return t._reject(e),t}get[Symbol.toStringTag](){
|
|
302
|
-
return"Promise"}static get[Symbol.species](){
|
|
303
|
-
return J}static all(e){return function(e,t){
|
|
304
|
-
let n,r;t||(t=Promise);const i=new t((e,t)=>{
|
|
305
|
-
n=e,r=t});let s=e.length;const o=[]
|
|
306
|
-
;return e.forEach((e,t)=>{F(e)?e.then(e=>{
|
|
307
|
-
o[t]=e,0===--s&&n(o)},r):(o[t]=e,0===--s&&n(o))
|
|
308
|
-
}),i}(e,J)}static allSettled(e){
|
|
309
|
-
return function(e,t){let n;t||(t=Promise)
|
|
310
|
-
;const r=new t((e,t)=>{n=e});let i=e.length
|
|
311
|
-
;const s=[];return e.forEach((e,t)=>{
|
|
312
|
-
F(e)?e.then(e=>{s[t]={status:"fulfilled",value:e
|
|
313
|
-
},0===--i&&n(s)},e=>{s[t]={status:"rejected",
|
|
314
|
-
reason:e},0===--i&&n(s)}):(s[t]={
|
|
315
|
-
status:"fulfilled",value:e},0===--i&&n(s))}),r
|
|
316
|
-
}(e,J)}static any(e){return function(e,t){let n,r
|
|
317
|
-
;t||(t=Promise);const i=new t((e,t)=>{n=e,r=t})
|
|
318
|
-
;let s=e.length;const o=[]
|
|
319
|
-
;return e.forEach((e,t)=>{F(e)?e.then(n,e=>{
|
|
320
|
-
o[t]=e,0===--s&&r(new AggregateError(o))}):n(e)
|
|
321
|
-
}),i}(e,J)}static race(e){return function(e,t){
|
|
322
|
-
let n,r;t||(t=Promise);const i=new t((e,t)=>{
|
|
323
|
-
n=e,r=t});return e.forEach(e=>{
|
|
324
|
-
F(e)?e.then(n,r):n(e)}),i}(e,J)}}
|
|
325
|
-
const N=function(){};class ${constructor(e){
|
|
326
|
-
if(this._status="pending",e&&e.aborted)this.promise=J.reject(e.reason),
|
|
327
|
-
this.resolve=N,this.reject=N;else{let t,n
|
|
328
|
-
;if(this.promise=new Promise(function(e){
|
|
329
|
-
t=e,n=function(t){!function(e,t){e(function(e){
|
|
330
|
-
return{then(t,n){n(e)}}}(t))}(e,t)}}),e){
|
|
331
|
-
const r=e.subscribe(function(e){n(e)})
|
|
332
|
-
;this.resolve=function(e){r(),t(e)
|
|
333
|
-
},this.reject=function(e){r(),n(e)}
|
|
334
|
-
}else this.resolve=t,this.reject=n}
|
|
335
|
-
this.promise.then(()=>{this._status="resolved"
|
|
336
|
-
},()=>{this._status="rejected"})}get state(){
|
|
337
|
-
return this._status}}
|
|
338
|
-
var G="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}
|
|
339
|
-
;!function(e){if(!e.setImmediate){
|
|
340
|
-
var t,n,r,i,s,o=1,l={},a=!1,c=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e)
|
|
341
|
-
;u=u&&u.setTimeout?u:e,
|
|
342
|
-
"[object process]"==={}.toString.call(e.process)?t=function(e){
|
|
343
|
-
process.nextTick(function(){f(e)})}:!function(){
|
|
344
|
-
if(e.postMessage&&!e.importScripts){
|
|
345
|
-
var t=!0,n=e.onmessage
|
|
346
|
-
;return e.onmessage=function(){t=!1
|
|
347
|
-
},e.postMessage("","*"),e.onmessage=n,t}
|
|
348
|
-
}()?e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){
|
|
349
|
-
f(e.data)},t=function(e){r.port2.postMessage(e)
|
|
350
|
-
}):c&&"onreadystatechange"in c.createElement("script")?(n=c.documentElement,
|
|
351
|
-
t=function(e){var t=c.createElement("script")
|
|
352
|
-
;t.onreadystatechange=function(){
|
|
353
|
-
f(e),t.onreadystatechange=null,n.removeChild(t),
|
|
354
|
-
t=null},n.appendChild(t)}):t=function(e){
|
|
355
|
-
setTimeout(f,0,e)
|
|
356
|
-
}:(i="setImmediate$"+Math.random()+"$",s=function(t){
|
|
357
|
-
t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&f(+t.data.slice(i.length))
|
|
358
|
-
},
|
|
359
|
-
e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),
|
|
360
|
-
t=function(t){e.postMessage(i+t,"*")
|
|
361
|
-
}),u.setImmediate=function(e){
|
|
362
|
-
"function"!=typeof e&&(e=new Function(""+e))
|
|
363
|
-
;for(var n=new Array(arguments.length-1),r=0;r<n.length;r++)n[r]=arguments[r+1]
|
|
364
|
-
;var i={callback:e,args:n};return l[o]=i,t(o),o++
|
|
365
|
-
},u.clearImmediate=h}function h(e){delete l[e]}
|
|
366
|
-
function f(e){if(a)setTimeout(f,0,e);else{
|
|
367
|
-
var t=l[e];if(t){a=!0;try{!function(e){
|
|
368
|
-
var t=e.callback,n=e.args;switch(n.length){case 0:
|
|
369
|
-
t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1])
|
|
370
|
-
;break;case 3:t(n[0],n[1],n[2]);break;default:
|
|
371
|
-
t.apply(void 0,n)}}(t)}finally{h(e),a=!1}}}}
|
|
372
|
-
}("undefined"==typeof self?G:self)
|
|
373
|
-
;const U=function(e){return e};function W(e,t){
|
|
374
|
-
return function(e,t){
|
|
375
|
-
const n=e&&e.branch,r=t&&t.branch,i=n?n.length:0,s=r?r.length:0,o=i>s?i:s
|
|
376
|
-
;for(let e=0;e<o;e++){
|
|
377
|
-
const t=e>=i?0:n[i-1-e],o=e>=s?0:r[s-1-e]
|
|
378
|
-
;if(t!==o)return t>o?1:-1}return 0
|
|
379
|
-
}(e.priority,t.priority)<0}let Q=1;class K{
|
|
380
|
-
constructor(){this._queue=new g({lessThanFunc:W})}
|
|
381
|
-
run(e,t,n){return this._run(!1,e,t,n)}
|
|
382
|
-
runTask(e,t,n){return this._run(!0,e,t,n)}
|
|
383
|
-
_run(e,t,n,r){const i=new $(r),s={
|
|
384
|
-
priority:(o=Q++,l=n,null==o?null==l?null:l:new V(o,l)),
|
|
385
|
-
func:t,abortSignal:r,resolve:i.resolve,
|
|
386
|
-
reject:i.reject,readyToRun:!e};var o,l
|
|
387
|
-
;if(this._queue.add(s),e){const e=this;return{
|
|
388
|
-
result:i.promise,setReadyToRun(t){
|
|
389
|
-
s.readyToRun=t,t&&!e._inProcess&&(e._inProcess=!0,
|
|
390
|
-
e._process())}}}
|
|
391
|
-
return this._inProcess||(this._inProcess=!0,this._process()),i.promise
|
|
392
|
-
}_process(){
|
|
393
|
-
return l(this,void 0,void 0,function*(){
|
|
394
|
-
const e=this._queue
|
|
395
|
-
;for(yield Promise.resolve().then(U);;){
|
|
396
|
-
if(yield 0,e.isEmpty){this._inProcess=!1;break}
|
|
397
|
-
let t=e.getMin()
|
|
398
|
-
;if(t.readyToRun)e.deleteMin();else{let n
|
|
399
|
-
;for(const t of e.nodes())if(t.item.readyToRun){
|
|
400
|
-
n=t;break}if(!n){this._inProcess=!1;break}
|
|
401
|
-
t=n.item,e.delete(n)}
|
|
402
|
-
if(t.abortSignal&&t.abortSignal.aborted)t.reject(t.abortSignal.reason);else try{
|
|
403
|
-
let e=t.func&&t.func(t.abortSignal)
|
|
404
|
-
;e&&"function"==typeof e.then&&(e=yield e),t.resolve(e)
|
|
405
|
-
}catch(e){t.reject(e)}}})}}const H=function(){
|
|
406
|
-
const e=new K;return function(t,n){
|
|
407
|
-
return e.run(void 0,t,n)}}();class X{
|
|
408
|
-
constructor(e){
|
|
409
|
-
if(this._maxSize=0,this._size=0,this._tickPromise=new k,!e)throw new Error("maxSize should be > 0")
|
|
410
|
-
;this._maxSize=e,
|
|
411
|
-
this._size=e,this._priorityQueue=new K}
|
|
412
|
-
get maxSize(){return this._maxSize}get size(){
|
|
413
|
-
return this._size}get holdAvailable(){
|
|
414
|
-
return this._size}hold(e){const t=this._size
|
|
415
|
-
;return!(e>t)&&(this._size=t-e,!0)}
|
|
416
|
-
get releaseAvailable(){
|
|
417
|
-
return this.maxSize-this._size}release(e,t){
|
|
418
|
-
const n=this._size,r=this.maxSize-n;if(e>r){
|
|
419
|
-
if(!t)throw new Error(`count (${e} > maxReleaseCount (${r}))`)
|
|
420
|
-
;e=r}if(e>0&&(this._size=n+e,this._tickPromise)){
|
|
421
|
-
const e=this._tickPromise
|
|
422
|
-
;this._tickPromise=null,e.resolve()}return e}
|
|
423
|
-
tick(e){
|
|
424
|
-
if(!(this._size>=this._maxSize))return this._tickPromise||(this._tickPromise=new k),
|
|
425
|
-
function(e,t){return e?new Promise(function(n){
|
|
426
|
-
if(e&&e.aborted)return void y(n,e.reason);let r,i
|
|
427
|
-
;function s(e){i||(i=!0,r&&r(),y(n,e))}
|
|
428
|
-
t.then(function(e){r&&r(),n(e)
|
|
429
|
-
}).catch(s),e&&(r=e.subscribe(s))}):t
|
|
430
|
-
}(e,this._tickPromise.promise)}holdWait(e,t,n,r){
|
|
431
|
-
if(e>this.maxSize)throw new Error(`holdCount (${e} > maxSize (${this.maxSize}))`)
|
|
432
|
-
;return r||(r=H),
|
|
433
|
-
this._priorityQueue.run(n=>l(this,void 0,void 0,function*(){
|
|
434
|
-
for(;e>this._size;)yield this.tick(n),yield r(t,n)
|
|
435
|
-
;if(!this.hold(e))throw new Error("Unexpected behavior")
|
|
436
|
-
}),t,n)}}function Y(e){
|
|
437
|
-
if(null==e||e<=0)throw new Error("Iterations = ".concat(e))
|
|
438
|
-
;e--;var t=new Promise(function(t){
|
|
439
|
-
setTimeout(function(){t(e)},1)})
|
|
440
|
-
;return e<=0?t:t.then(Y)}function Z(e){var t=e/1e3
|
|
441
|
-
;if(t<60)return"".concat(t.toFixed(1),"s")
|
|
442
|
-
;var n=t/60
|
|
443
|
-
;return n<60?"".concat(n.toFixed(1),"m"):"".concat((n/60).toFixed(1),"h")
|
|
444
|
-
}function ee(e,t,n){var r,i,o,v,g,p,_,y,m
|
|
445
|
-
;return void 0===n&&(n={}),l(this,void 0,void 0,function(){
|
|
446
|
-
var x,w,j,E,S,A,P,k,I,T,O,L,V,F,M,D,C,R,q,B,J,N,$,G,U,W,Q,K,H,ee,te,ne,re,ie,se,oe,le,ae,ce,ue,he,fe,de,ve,ge=this
|
|
447
|
-
;return a(this,function(pe){switch(pe.label){
|
|
448
|
-
case 0:
|
|
449
|
-
return x=n.saveErrorVariants,w=null!==(r=null==x?void 0:x.retriesPerVariant)&&void 0!==r?r:1,
|
|
450
|
-
j=null==x?void 0:x.useToFindBestError,
|
|
451
|
-
E=new Date,S=x?s.resolve(x.dir,null!==(o=null===(i=x.getFilePath)||void 0===i?void 0:i.call(x,{
|
|
452
|
-
sessionDate:E}))&&void 0!==o?o:f({sessionDate:E
|
|
453
|
-
})):null,A=null!==(v=n.GC_Iterations)&&void 0!==v?v:1e6,
|
|
454
|
-
P=null!==(g=n.GC_IterationsAsync)&&void 0!==g?g:1e4,
|
|
455
|
-
k=null!==(p=n.GC_Interval)&&void 0!==p?p:1e3,
|
|
456
|
-
I=null!==(_=n.logInterval)&&void 0!==_?_:5e3,
|
|
457
|
-
T=null===(y=n.logCompleted)||void 0===y||y,
|
|
458
|
-
O=n.abortSignal,L=n.findBestError,V=null!==(m=null==L?void 0:L.cycles)&&void 0!==m?m:1,
|
|
459
|
-
F=null==L?void 0:L.dontThrowIfError,
|
|
460
|
-
M=n.limitTime,D=!0===n.parallel?Math.pow(2,31):!n.parallel||n.parallel<=0?1:n.parallel,
|
|
461
|
-
null!=n.limitVariantsCount&&t.addLimit({
|
|
462
|
-
index:n.limitVariantsCount}),x?[4,u(x.dir)]:[3,15]
|
|
463
|
-
;case 1:C=pe.sent(),pe.label=2;case 2:
|
|
464
|
-
pe.trys.push([2,13,14,15]),R=c(C),q=R.next(),
|
|
465
|
-
pe.label=3;case 3:
|
|
466
|
-
return q.done?[3,12]:[4,h(q.value,x.jsonToArgs)]
|
|
467
|
-
;case 4:ue=pe.sent(),B=0,pe.label=5;case 5:
|
|
468
|
-
if(!(B<w))return[3,11];pe.label=6;case 6:
|
|
469
|
-
return pe.trys.push([6,9,,10]),b(J=e(ue,-1,null))?[4,J]:[3,8]
|
|
470
|
-
;case 7:pe.sent(),pe.label=8;case 8:return[3,10]
|
|
471
|
-
;case 9:if(N=pe.sent(),j&&L)return t.addLimit({
|
|
472
|
-
args:ue,error:N}),[3,11];throw N;case 10:
|
|
473
|
-
return B++,[3,5];case 11:return q=R.next(),[3,3]
|
|
474
|
-
;case 12:return[3,15];case 13:
|
|
475
|
-
return $=pe.sent(),de={error:$},[3,15];case 14:
|
|
476
|
-
try{q&&!q.done&&(ve=R.return)&&ve.call(R)}finally{
|
|
477
|
-
if(de)throw de.error}return[7];case 15:
|
|
478
|
-
G=null,U=null,W=Date.now(),Q=W,K=new z,H=function(...e){
|
|
479
|
-
let t,n;function r(e){t.abort(e)}
|
|
480
|
-
for(let i=0;i<e.length;i++){const s=e[i];if(s){
|
|
481
|
-
if(s.aborted)return s
|
|
482
|
-
;n?(t||(t=new z,n.subscribe(r)),s.subscribe(r)):n=s
|
|
483
|
-
}}return t?t.signal:n||(new z).signal
|
|
484
|
-
}(O,K.signal),ee=H,te=!1,ne=0,re=0,ie=Date.now(),
|
|
485
|
-
se=ie,oe=ne,le=re,ae=D<=1?null:new X(D),
|
|
486
|
-
ce=!1,t.start(),pe.label=16;case 16:
|
|
487
|
-
if(!(t.cycleIndex<V)||ce)return[3,20]
|
|
488
|
-
;ue=void 0,he=function(){
|
|
489
|
-
var n,r,i,s,o,c,u,h,f,v,g,p,_,y,m,w
|
|
490
|
-
;return a(this,function(j){switch(j.label){case 0:
|
|
491
|
-
return n=t.index,r=ue,i=(I||k||M)&&Date.now(),
|
|
492
|
-
M&&i-W>=M?(ce=!0,[2,"break"]):(I&&i-ie>=I&&(s="",
|
|
493
|
-
o=i-Q,c=i-W,L?(s+="cycle: ".concat(t.cycleIndex,", variant: ").concat(t.index),
|
|
494
|
-
null!=(u=t.count)&&null!=G&&G<u&&(u=G),
|
|
495
|
-
null!=u&&t.index>0?(h=void 0,null!=U&&null!=G&&t.index<G&&o<U?(f=U-o,
|
|
496
|
-
v=G-t.index,
|
|
497
|
-
g=f/v,p=(u-t.index)*g,h=o+p):h=o*u/t.index,s+="/".concat(u," (").concat(Z(o),"/").concat(Z(h),")")):s+=" (".concat(Z(o),")")):s+="variant: ".concat(t.index," (").concat(Z(o),")"),
|
|
498
|
-
s+=", total: ".concat(ne," (").concat(Z(c),")"),
|
|
499
|
-
console.log(s),ie=i),A&&ne-oe>=A||P&&re-le>=P||k&&i-se>=k?(oe=ne,
|
|
500
|
-
le=re,se=i,[4,Y(1)]):[3,2]);case 1:
|
|
501
|
-
j.sent(),j.label=2;case 2:
|
|
502
|
-
if(null==O?void 0:O.aborted)return[2,"continue"]
|
|
503
|
-
;if(ae&&!H.aborted)return[3,10];j.label=3;case 3:
|
|
504
|
-
return j.trys.push([3,6,,9]),b(_=e(r,n,H))?[4,_]:[3,5]
|
|
505
|
-
;case 4:_=j.sent(),j.label=5;case 5:
|
|
506
|
-
return _?(y=_.iterationsAsync,m=_.iterationsSync,
|
|
507
|
-
re+=y,ne+=m+y,[3,9]):(te=!0,K.abort(),
|
|
508
|
-
[2,"continue"]);case 6:
|
|
509
|
-
return w=j.sent(),S?[4,d(r,S,x.argsToJson)]:[3,8]
|
|
510
|
-
;case 7:j.sent(),j.label=8;case 8:if(!L)throw w
|
|
511
|
-
;return t.addLimit({error:w}),te=!1,[3,9];case 9:
|
|
512
|
-
return[3,13];case 10:
|
|
513
|
-
return ae.hold(1)?[3,12]:[4,ae.holdWait(1)]
|
|
514
|
-
;case 11:j.sent(),j.label=12;case 12:
|
|
515
|
-
l(ge,void 0,void 0,function(){var i,s,o,l
|
|
516
|
-
;return a(this,function(a){switch(a.label){case 0:
|
|
517
|
-
return a.trys.push([0,3,6,7]),
|
|
518
|
-
(null==H?void 0:H.aborted)?[2]:b(i=e(r,n,H))?[4,i]:[3,2]
|
|
519
|
-
;case 1:i=a.sent(),a.label=2;case 2:
|
|
520
|
-
return i?(s=i.iterationsAsync,o=i.iterationsSync,
|
|
521
|
-
re+=s,ne+=o+s,[3,7]):(te=!0,K.abort(),[2]);case 3:
|
|
522
|
-
return l=a.sent(),S?[4,d(r,S,x.argsToJson)]:[3,5]
|
|
523
|
-
;case 4:a.sent(),a.label=5;case 5:if(!L)throw l
|
|
524
|
-
;return t.addLimit({error:l}),te=!1,[3,7];case 6:
|
|
525
|
-
return ae.release(1),[7];case 7:return[2]}})
|
|
526
|
-
}),j.label=13;case 13:return[2]}})},pe.label=17
|
|
527
|
-
;case 17:
|
|
528
|
-
return(null==O?void 0:O.aborted)||!te&&null==(ue=t.next())?[3,19]:[5,he()]
|
|
529
|
-
;case 18:return"break"===pe.sent()?[3,19]:[3,17]
|
|
530
|
-
;case 19:
|
|
531
|
-
return G=t.count,U=Date.now()-Q,Q=Date.now(),t.start(),[3,16]
|
|
532
|
-
;case 20:return ae?[4,ae.holdWait(D)]:[3,22]
|
|
533
|
-
;case 21:pe.sent(),ae.release(D),pe.label=22
|
|
534
|
-
;case 22:
|
|
535
|
-
if(null==ee?void 0:ee.aborted)throw ee.reason
|
|
536
|
-
;return T&&console.log("[test-variants] variants: ".concat(t.index,", iterations: ").concat(ne,", async: ").concat(re)),
|
|
537
|
-
[4,Y(1)];case 23:if(pe.sent(),(fe=t.limit?{
|
|
538
|
-
error:t.limit.error,args:t.limit.args,
|
|
539
|
-
index:t.count}:null)&&!F)throw fe.error;return[2,{
|
|
540
|
-
iterations:ne,bestError:fe}]}})})}
|
|
541
|
-
function te(e,t,n){if(n){
|
|
542
|
-
for(var r=e.length-1;r>=0;r--)if(n(e[r],t))return r
|
|
543
|
-
;return-1}
|
|
544
|
-
for(r=e.length-1;r>=0;r--)if(e[r]===t)return r
|
|
545
|
-
;return-1}function ne(e,t,n){var r=e[n]
|
|
546
|
-
;return"function"==typeof r?r(t):r}
|
|
547
|
-
function re(e,t){
|
|
548
|
-
var n=e.argValues[t].length,r=e.argLimits[t]
|
|
549
|
-
;return null==r?n:r<n?r:n}function ie(e,t,n){
|
|
550
|
-
var r,i,s=Object.keys(e).filter(function(e){
|
|
551
|
-
return"seed"!==e});if(s.length!==n)return!1;try{
|
|
552
|
-
for(var o=c(s),l=o.next();!l.done;l=o.next()){
|
|
553
|
-
var a=l.value;if(!t.has(a))return!1}}catch(e){r={
|
|
554
|
-
error:e}}finally{try{
|
|
555
|
-
l&&!l.done&&(i=o.return)&&i.call(o)}finally{
|
|
556
|
-
if(r)throw r.error}}return!0}
|
|
557
|
-
function se(e,t,n,r,i){for(var s=0;s<r;s++){
|
|
558
|
-
var o=t[s]
|
|
559
|
-
;if("function"!=typeof o)if(te(o,e[n[s]],i)<0)return!1
|
|
560
|
-
}return!0}function oe(e,t,n,r,i){
|
|
561
|
-
for(var s=!1,o=0;o<r;o++){
|
|
562
|
-
var l=e.indexes[o],a=t[n[o]],c=te(e.argValues[o],a,i)
|
|
563
|
-
;if(!(c<0)){if(s=!0,l<c)return!1;if(l>c)return!0}}
|
|
564
|
-
return s}function le(e,t,n,r,i){
|
|
565
|
-
for(var s=[],o=0;o<r;o++){
|
|
566
|
-
var l=e[n[o]],a=te(ne(t,e,o),l,i)
|
|
567
|
-
;if(a<0)return null;s.push(a)}return s}
|
|
568
|
-
function ae(e,t,n,r,i,s,o,l){if(!l)return!1
|
|
569
|
-
;var a=le(t,r,i,s,o);if(!a)return!1;if(n){
|
|
570
|
-
var c=le(n,r,i,s,o);if(c){var u=function(e,t){
|
|
571
|
-
for(var n,r,i=Math.max(e.length,t.length),s=0;s<i;s++){
|
|
572
|
-
var o=null!==(n=e[s])&&void 0!==n?n:0,l=null!==(r=t[s])&&void 0!==r?r:0
|
|
573
|
-
;if(o<l)return-1;if(o>l)return 1}return 0}(a,c)
|
|
574
|
-
;if(u>=0)return!1}}for(var h=0;h<s;h++){var f=a[h]
|
|
575
|
-
;if("function"==typeof l)if(!l({name:i[h],
|
|
576
|
-
valueIndex:f,values:ne(r,t,h),
|
|
577
|
-
maxValueIndex:e.argLimits[h]})){
|
|
578
|
-
e.argLimits[h]=null;continue}
|
|
579
|
-
e.argLimits[h]=f>0?f:null}
|
|
580
|
-
return e.pendingLimits=e.pendingLimits.filter(function(t){
|
|
581
|
-
for(var n=0;n<s;n++){
|
|
582
|
-
var l=t.args[i[n]],a=te(ne(r,t.args,n),l,o),c=e.argLimits[n]
|
|
583
|
-
;if(null!=c&&a>=c)return!1}return!0}),!0}
|
|
584
|
-
function ce(e){
|
|
585
|
-
for(var t=e.argsTemplates,n=e.getSeed,r=e.repeatsPerVariant,i=e.equals,s=e.limitArgOnError,l=null!=r?r:1,a=Object.keys(t),c=Object.values(t),u=a.length,h=new Set(a),f=[],d=[],v=[],g=0;g<u;g++)f[g]=-1,
|
|
586
|
-
d[g]=[],v[g]=null;var p={args:{},indexes:f,
|
|
587
|
-
argValues:d,argLimits:v,index:-1,cycleIndex:-1,
|
|
588
|
-
repeatIndex:0,count:null,limit:null,started:!1,
|
|
589
|
-
currentArgs:null,pendingLimits:[]},_={get index(){
|
|
590
|
-
return p.index},get cycleIndex(){
|
|
591
|
-
return p.cycleIndex},get count(){return p.count},
|
|
592
|
-
get limit(){return p.limit},addLimit:function(e){
|
|
593
|
-
var t,n,r,o,l,f,d=void 0!==(null==e?void 0:e.args)&&null!==e.args,v=null!=(null==e?void 0:e.index)
|
|
594
|
-
;if(d||v)if(!v||d)if(!d||v){if(d&&v){
|
|
595
|
-
var g=null==p.count||e.index<p.count
|
|
596
|
-
;if(g&&(p.count=e.index),!ie(e.args,h,u))return
|
|
597
|
-
;if(!se(e.args,c,a,u,i))return;if(g){
|
|
598
|
-
_=null!==(f=null===(l=p.limit)||void 0===l?void 0:l.args)&&void 0!==f?f:null
|
|
599
|
-
;p.limit=void 0!==e.error?{args:e.args,
|
|
600
|
-
error:e.error}:{args:e.args
|
|
601
|
-
},ae(p,e.args,_,c,a,u,i,s)}}}else{
|
|
602
|
-
if(!ie(e.args,h,u))return
|
|
603
|
-
;if(!se(e.args,c,a,u,i))return
|
|
604
|
-
;var _=null!==(o=null===(r=p.limit)||void 0===r?void 0:r.args)&&void 0!==o?o:null
|
|
605
|
-
;if(ae(p,e.args,_,c,a,u,i,s))p.limit=void 0!==e.error?{
|
|
606
|
-
args:e.args,error:e.error}:{args:e.args
|
|
607
|
-
};else if(!s){var y=void 0!==e.error?{args:e.args,
|
|
608
|
-
error:e.error}:{args:e.args}
|
|
609
|
-
;p.pendingLimits.push(y)}
|
|
610
|
-
}else(null==p.count||e.index<p.count)&&(p.count=e.index);else{
|
|
611
|
-
if(p.index<0)throw new Error("[testVariantsIterator] addLimit() requires at least one next() call")
|
|
612
|
-
;if(null==p.count||p.index<p.count){
|
|
613
|
-
var _=null!==(n=null===(t=p.limit)||void 0===t?void 0:t.args)&&void 0!==n?n:null
|
|
614
|
-
;p.count=p.index,
|
|
615
|
-
p.limit=void 0!==(null==e?void 0:e.error)?{
|
|
616
|
-
args:p.currentArgs,error:e.error}:{
|
|
617
|
-
args:p.currentArgs},ae(p,p.args,_,c,a,u,i,s)}}},
|
|
618
|
-
start:function(){p.cycleIndex++,function(e,t,n){
|
|
619
|
-
e.index=-1,e.repeatIndex=0
|
|
620
|
-
;for(var r=0;r<n;r++)e.indexes[r]=-1,e.argValues[r]=[]
|
|
621
|
-
;n>0&&(e.argValues[0]=ne(t,e.args,0))
|
|
622
|
-
}(p,c,u),p.started=!0},next:function(){
|
|
623
|
-
if(!p.started)throw new Error("[testVariantsIterator] start() must be called before next()")
|
|
624
|
-
;if(p.index>=0&&p.repeatIndex+1<l&&(null==p.count||p.index<p.count)){
|
|
625
|
-
if(p.repeatIndex++,n){var e=n({
|
|
626
|
-
variantIndex:p.index,cycleIndex:p.cycleIndex,
|
|
627
|
-
repeatIndex:p.repeatIndex})
|
|
628
|
-
;p.currentArgs=o(o({},p.args),{seed:e})
|
|
629
|
-
}else p.currentArgs=o({},p.args)
|
|
630
|
-
;return p.currentArgs}
|
|
631
|
-
if(p.repeatIndex=0,!function(e,t,n,r){
|
|
632
|
-
for(var i,s=r-1;s>=0;s--){var o=e.indexes[s]+1
|
|
633
|
-
;if(o<re(e,s)){var l=n[s],a=e.argValues[s][o]
|
|
634
|
-
;for(e.indexes[s]=o,e.args[l]=a,s++;s<r;s++){
|
|
635
|
-
var c=ne(t,e.args,s),u=null!==(i=e.argLimits[s])&&void 0!==i?i:c.length
|
|
636
|
-
;if(0===c.length||u<=0)break
|
|
637
|
-
;e.indexes[s]=0,e.argValues[s]=c;var h=n[s],f=c[0]
|
|
638
|
-
;e.args[h]=f}if(s>=r)return!0}}return!1
|
|
639
|
-
}(p,c,a,u))return null==p.count&&(p.count=p.index+1),
|
|
640
|
-
null
|
|
641
|
-
;if(p.index++,p.pendingLimits.length>0&&function(e,t,n,r,i,s){
|
|
642
|
-
for(var o,l,a=!1,c=e.pendingLimits.length-1;c>=0;c--){
|
|
643
|
-
var u=e.pendingLimits[c];if(oe(e,u.args,n,r,i)){
|
|
644
|
-
if(null==e.count||e.index<e.count){
|
|
645
|
-
var h=null!==(l=null===(o=e.limit)||void 0===o?void 0:o.args)&&void 0!==l?l:null
|
|
646
|
-
;e.count=e.index,e.limit=void 0!==u.error?{
|
|
647
|
-
args:u.args,error:u.error}:{args:u.args
|
|
648
|
-
},ae(e,u.args,h,t,n,r,i,s),a=!0}
|
|
649
|
-
e.pendingLimits.splice(c,1)}}
|
|
650
|
-
}(p,c,a,u,i,s),null!=p.count&&p.index>=p.count)return null
|
|
651
|
-
;if(n){e=n({variantIndex:p.index,
|
|
652
|
-
cycleIndex:p.cycleIndex,repeatIndex:p.repeatIndex
|
|
653
|
-
});p.currentArgs=o(o({},p.args),{seed:e})
|
|
654
|
-
}else p.currentArgs=o({},p.args)
|
|
655
|
-
;return p.currentArgs}};return _}
|
|
656
|
-
e.createTestVariants=function(e){
|
|
657
|
-
return function(t){return function(n){var r,i,s,o
|
|
658
|
-
;return l(this,void 0,void 0,function(){var l,c
|
|
659
|
-
;return a(this,function(a){return l=L(e,{
|
|
660
|
-
onError:null==n?void 0:n.onError}),c=ce({
|
|
661
|
-
argsTemplates:t,
|
|
662
|
-
getSeed:null===(r=null==n?void 0:n.findBestError)||void 0===r?void 0:r.getSeed,
|
|
663
|
-
repeatsPerVariant:null===(i=null==n?void 0:n.findBestError)||void 0===i?void 0:i.repeatsPerVariant,
|
|
664
|
-
equals:null===(s=null==n?void 0:n.findBestError)||void 0===s?void 0:s.equals,
|
|
665
|
-
limitArgOnError:null===(o=null==n?void 0:n.findBestError)||void 0===o?void 0:o.limitArgOnError
|
|
666
|
-
}),[2,ee(l,c,n)]})})}}
|
|
667
|
-
},e.generateErrorVariantFilePath=f,e.testVariantsIterator=ce,
|
|
668
|
-
Object.defineProperty(e,"__esModule",{value:!0})
|
|
669
|
-
}({},fs,path);
|