@eslint-react/jsx 1.5.20-next.8 → 1.5.21-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +52 -2153
- package/dist/index.mjs +52 -2153
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
2
2
|
import { isOneOf, NodeType, is, traverseUpGuard, isStringLiteral, isMultiLine, isJSXTagNameExpression, ESLintCommunityESLintUtils } from '@eslint-react/ast';
|
|
3
3
|
import { findVariable, getVariableInit } from '@eslint-react/var';
|
|
4
|
+
import { Option, Function, Array as Array$1, Predicate } from 'effect';
|
|
5
|
+
import { match, P } from 'ts-pattern';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
var __export = (target, all3) => {
|
|
7
|
-
for (var name in all3)
|
|
8
|
-
__defProp(target, name, { get: all3[name], enumerable: true });
|
|
9
|
-
};
|
|
7
|
+
// src/element/element-type.ts
|
|
10
8
|
function resolveMemberExpressions(object, property) {
|
|
11
9
|
if (object.type === AST_NODE_TYPES.JSXMemberExpression) {
|
|
12
10
|
return `${resolveMemberExpressions(object.object, object.property)}.${property.name}`;
|
|
@@ -30,2104 +28,9 @@ function elementType(node) {
|
|
|
30
28
|
}
|
|
31
29
|
return name.name;
|
|
32
30
|
}
|
|
33
|
-
|
|
34
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Function.js
|
|
35
|
-
var Function_exports = {};
|
|
36
|
-
__export(Function_exports, {
|
|
37
|
-
SK: () => SK,
|
|
38
|
-
absurd: () => absurd,
|
|
39
|
-
apply: () => apply,
|
|
40
|
-
compose: () => compose,
|
|
41
|
-
constFalse: () => constFalse,
|
|
42
|
-
constNull: () => constNull,
|
|
43
|
-
constTrue: () => constTrue,
|
|
44
|
-
constUndefined: () => constUndefined,
|
|
45
|
-
constVoid: () => constVoid,
|
|
46
|
-
constant: () => constant,
|
|
47
|
-
dual: () => dual,
|
|
48
|
-
flip: () => flip,
|
|
49
|
-
flow: () => flow,
|
|
50
|
-
hole: () => hole,
|
|
51
|
-
identity: () => identity,
|
|
52
|
-
isFunction: () => isFunction,
|
|
53
|
-
pipe: () => pipe,
|
|
54
|
-
satisfies: () => satisfies,
|
|
55
|
-
tupled: () => tupled,
|
|
56
|
-
unsafeCoerce: () => unsafeCoerce,
|
|
57
|
-
untupled: () => untupled
|
|
58
|
-
});
|
|
59
|
-
var isFunction = (input) => typeof input === "function";
|
|
60
|
-
var dual = function(arity, body) {
|
|
61
|
-
if (typeof arity === "function") {
|
|
62
|
-
return function() {
|
|
63
|
-
if (arity(arguments)) {
|
|
64
|
-
return body.apply(this, arguments);
|
|
65
|
-
}
|
|
66
|
-
return (self) => body(self, ...arguments);
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
switch (arity) {
|
|
70
|
-
case 0:
|
|
71
|
-
case 1:
|
|
72
|
-
throw new RangeError(`Invalid arity ${arity}`);
|
|
73
|
-
case 2:
|
|
74
|
-
return function(a2, b2) {
|
|
75
|
-
if (arguments.length >= 2) {
|
|
76
|
-
return body(a2, b2);
|
|
77
|
-
}
|
|
78
|
-
return function(self) {
|
|
79
|
-
return body(self, a2);
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
case 3:
|
|
83
|
-
return function(a2, b2, c2) {
|
|
84
|
-
if (arguments.length >= 3) {
|
|
85
|
-
return body(a2, b2, c2);
|
|
86
|
-
}
|
|
87
|
-
return function(self) {
|
|
88
|
-
return body(self, a2, b2);
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
case 4:
|
|
92
|
-
return function(a2, b2, c2, d2) {
|
|
93
|
-
if (arguments.length >= 4) {
|
|
94
|
-
return body(a2, b2, c2, d2);
|
|
95
|
-
}
|
|
96
|
-
return function(self) {
|
|
97
|
-
return body(self, a2, b2, c2);
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
case 5:
|
|
101
|
-
return function(a2, b2, c2, d2, e2) {
|
|
102
|
-
if (arguments.length >= 5) {
|
|
103
|
-
return body(a2, b2, c2, d2, e2);
|
|
104
|
-
}
|
|
105
|
-
return function(self) {
|
|
106
|
-
return body(self, a2, b2, c2, d2);
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
default:
|
|
110
|
-
return function() {
|
|
111
|
-
if (arguments.length >= arity) {
|
|
112
|
-
return body.apply(this, arguments);
|
|
113
|
-
}
|
|
114
|
-
const args = arguments;
|
|
115
|
-
return function(self) {
|
|
116
|
-
return body(self, ...args);
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
var apply = (a2) => (self) => self(a2);
|
|
122
|
-
var identity = (a2) => a2;
|
|
123
|
-
var satisfies = () => (b2) => b2;
|
|
124
|
-
var unsafeCoerce = identity;
|
|
125
|
-
var constant = (value) => () => value;
|
|
126
|
-
var constTrue = /* @__PURE__ */ constant(true);
|
|
127
|
-
var constFalse = /* @__PURE__ */ constant(false);
|
|
128
|
-
var constNull = /* @__PURE__ */ constant(null);
|
|
129
|
-
var constUndefined = /* @__PURE__ */ constant(void 0);
|
|
130
|
-
var constVoid = constUndefined;
|
|
131
|
-
var flip = (f2) => (...b2) => (...a2) => f2(...a2)(...b2);
|
|
132
|
-
var compose = /* @__PURE__ */ dual(2, (ab, bc) => (a2) => bc(ab(a2)));
|
|
133
|
-
var absurd = (_2) => {
|
|
134
|
-
throw new Error("Called `absurd` function which should be uncallable");
|
|
135
|
-
};
|
|
136
|
-
var tupled = (f2) => (a2) => f2(...a2);
|
|
137
|
-
var untupled = (f2) => (...a2) => f2(a2);
|
|
138
|
-
function pipe(a2, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
139
|
-
switch (arguments.length) {
|
|
140
|
-
case 1:
|
|
141
|
-
return a2;
|
|
142
|
-
case 2:
|
|
143
|
-
return ab(a2);
|
|
144
|
-
case 3:
|
|
145
|
-
return bc(ab(a2));
|
|
146
|
-
case 4:
|
|
147
|
-
return cd(bc(ab(a2)));
|
|
148
|
-
case 5:
|
|
149
|
-
return de(cd(bc(ab(a2))));
|
|
150
|
-
case 6:
|
|
151
|
-
return ef(de(cd(bc(ab(a2)))));
|
|
152
|
-
case 7:
|
|
153
|
-
return fg(ef(de(cd(bc(ab(a2))))));
|
|
154
|
-
case 8:
|
|
155
|
-
return gh(fg(ef(de(cd(bc(ab(a2)))))));
|
|
156
|
-
case 9:
|
|
157
|
-
return hi(gh(fg(ef(de(cd(bc(ab(a2))))))));
|
|
158
|
-
default: {
|
|
159
|
-
let ret = arguments[0];
|
|
160
|
-
for (let i2 = 1; i2 < arguments.length; i2++) {
|
|
161
|
-
ret = arguments[i2](ret);
|
|
162
|
-
}
|
|
163
|
-
return ret;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
|
|
168
|
-
switch (arguments.length) {
|
|
169
|
-
case 1:
|
|
170
|
-
return ab;
|
|
171
|
-
case 2:
|
|
172
|
-
return function() {
|
|
173
|
-
return bc(ab.apply(this, arguments));
|
|
174
|
-
};
|
|
175
|
-
case 3:
|
|
176
|
-
return function() {
|
|
177
|
-
return cd(bc(ab.apply(this, arguments)));
|
|
178
|
-
};
|
|
179
|
-
case 4:
|
|
180
|
-
return function() {
|
|
181
|
-
return de(cd(bc(ab.apply(this, arguments))));
|
|
182
|
-
};
|
|
183
|
-
case 5:
|
|
184
|
-
return function() {
|
|
185
|
-
return ef(de(cd(bc(ab.apply(this, arguments)))));
|
|
186
|
-
};
|
|
187
|
-
case 6:
|
|
188
|
-
return function() {
|
|
189
|
-
return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
|
|
190
|
-
};
|
|
191
|
-
case 7:
|
|
192
|
-
return function() {
|
|
193
|
-
return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
|
|
194
|
-
};
|
|
195
|
-
case 8:
|
|
196
|
-
return function() {
|
|
197
|
-
return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
|
|
198
|
-
};
|
|
199
|
-
case 9:
|
|
200
|
-
return function() {
|
|
201
|
-
return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
var hole = /* @__PURE__ */ unsafeCoerce(absurd);
|
|
207
|
-
var SK = (_2, b2) => b2;
|
|
208
|
-
|
|
209
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Array.js
|
|
210
|
-
var Array_exports = {};
|
|
211
|
-
__export(Array_exports, {
|
|
212
|
-
Do: () => Do2,
|
|
213
|
-
allocate: () => allocate,
|
|
214
|
-
append: () => append,
|
|
215
|
-
appendAll: () => appendAll,
|
|
216
|
-
bind: () => bind3,
|
|
217
|
-
bindTo: () => bindTo3,
|
|
218
|
-
cartesian: () => cartesian,
|
|
219
|
-
cartesianWith: () => cartesianWith,
|
|
220
|
-
chop: () => chop,
|
|
221
|
-
chunksOf: () => chunksOf,
|
|
222
|
-
contains: () => contains2,
|
|
223
|
-
containsWith: () => containsWith2,
|
|
224
|
-
copy: () => copy,
|
|
225
|
-
dedupe: () => dedupe,
|
|
226
|
-
dedupeAdjacent: () => dedupeAdjacent,
|
|
227
|
-
dedupeAdjacentWith: () => dedupeAdjacentWith,
|
|
228
|
-
dedupeWith: () => dedupeWith,
|
|
229
|
-
difference: () => difference,
|
|
230
|
-
differenceWith: () => differenceWith,
|
|
231
|
-
drop: () => drop,
|
|
232
|
-
dropRight: () => dropRight,
|
|
233
|
-
dropWhile: () => dropWhile,
|
|
234
|
-
empty: () => empty2,
|
|
235
|
-
ensure: () => ensure,
|
|
236
|
-
every: () => every2,
|
|
237
|
-
extend: () => extend,
|
|
238
|
-
filter: () => filter2,
|
|
239
|
-
filterMap: () => filterMap2,
|
|
240
|
-
filterMapWhile: () => filterMapWhile,
|
|
241
|
-
findFirst: () => findFirst2,
|
|
242
|
-
findFirstIndex: () => findFirstIndex,
|
|
243
|
-
findLast: () => findLast,
|
|
244
|
-
findLastIndex: () => findLastIndex,
|
|
245
|
-
flatMap: () => flatMap2,
|
|
246
|
-
flatMapNullable: () => flatMapNullable2,
|
|
247
|
-
flatten: () => flatten2,
|
|
248
|
-
forEach: () => forEach,
|
|
249
|
-
fromIterable: () => fromIterable2,
|
|
250
|
-
fromNullable: () => fromNullable2,
|
|
251
|
-
fromOption: () => fromOption2,
|
|
252
|
-
fromRecord: () => fromRecord,
|
|
253
|
-
get: () => get,
|
|
254
|
-
getEquivalence: () => getEquivalence2,
|
|
255
|
-
getLefts: () => getLefts,
|
|
256
|
-
getOrder: () => getOrder2,
|
|
257
|
-
getRights: () => getRights,
|
|
258
|
-
getSomes: () => getSomes,
|
|
259
|
-
group: () => group,
|
|
260
|
-
groupBy: () => groupBy,
|
|
261
|
-
groupWith: () => groupWith,
|
|
262
|
-
head: () => head,
|
|
263
|
-
headNonEmpty: () => headNonEmpty,
|
|
264
|
-
init: () => init,
|
|
265
|
-
initNonEmpty: () => initNonEmpty,
|
|
266
|
-
insertAt: () => insertAt,
|
|
267
|
-
intersection: () => intersection,
|
|
268
|
-
intersectionWith: () => intersectionWith,
|
|
269
|
-
intersperse: () => intersperse,
|
|
270
|
-
isArray: () => isArray,
|
|
271
|
-
isEmptyArray: () => isEmptyArray,
|
|
272
|
-
isEmptyReadonlyArray: () => isEmptyReadonlyArray,
|
|
273
|
-
isNonEmptyArray: () => isNonEmptyArray2,
|
|
274
|
-
isNonEmptyReadonlyArray: () => isNonEmptyReadonlyArray,
|
|
275
|
-
join: () => join,
|
|
276
|
-
last: () => last,
|
|
277
|
-
lastNonEmpty: () => lastNonEmpty,
|
|
278
|
-
length: () => length,
|
|
279
|
-
let: () => let_3,
|
|
280
|
-
liftEither: () => liftEither,
|
|
281
|
-
liftNullable: () => liftNullable2,
|
|
282
|
-
liftOption: () => liftOption,
|
|
283
|
-
liftPredicate: () => liftPredicate2,
|
|
284
|
-
make: () => make4,
|
|
285
|
-
makeBy: () => makeBy,
|
|
286
|
-
map: () => map2,
|
|
287
|
-
mapAccum: () => mapAccum,
|
|
288
|
-
match: () => match2,
|
|
289
|
-
matchLeft: () => matchLeft,
|
|
290
|
-
matchRight: () => matchRight,
|
|
291
|
-
max: () => max2,
|
|
292
|
-
min: () => min2,
|
|
293
|
-
modify: () => modify,
|
|
294
|
-
modifyNonEmptyHead: () => modifyNonEmptyHead,
|
|
295
|
-
modifyNonEmptyLast: () => modifyNonEmptyLast,
|
|
296
|
-
modifyOption: () => modifyOption,
|
|
297
|
-
of: () => of,
|
|
298
|
-
partition: () => partition,
|
|
299
|
-
partitionMap: () => partitionMap2,
|
|
300
|
-
prepend: () => prepend,
|
|
301
|
-
prependAll: () => prependAll,
|
|
302
|
-
range: () => range,
|
|
303
|
-
reduce: () => reduce,
|
|
304
|
-
reduceRight: () => reduceRight,
|
|
305
|
-
remove: () => remove,
|
|
306
|
-
replace: () => replace,
|
|
307
|
-
replaceOption: () => replaceOption,
|
|
308
|
-
replicate: () => replicate,
|
|
309
|
-
reverse: () => reverse,
|
|
310
|
-
rotate: () => rotate,
|
|
311
|
-
scan: () => scan,
|
|
312
|
-
scanRight: () => scanRight,
|
|
313
|
-
separate: () => separate,
|
|
314
|
-
setNonEmptyHead: () => setNonEmptyHead,
|
|
315
|
-
setNonEmptyLast: () => setNonEmptyLast,
|
|
316
|
-
some: () => some4,
|
|
317
|
-
sort: () => sort,
|
|
318
|
-
sortBy: () => sortBy,
|
|
319
|
-
sortWith: () => sortWith,
|
|
320
|
-
span: () => span,
|
|
321
|
-
split: () => split,
|
|
322
|
-
splitAt: () => splitAt,
|
|
323
|
-
splitNonEmptyAt: () => splitNonEmptyAt,
|
|
324
|
-
splitWhere: () => splitWhere,
|
|
325
|
-
tail: () => tail,
|
|
326
|
-
tailNonEmpty: () => tailNonEmpty,
|
|
327
|
-
take: () => take,
|
|
328
|
-
takeRight: () => takeRight,
|
|
329
|
-
takeWhile: () => takeWhile,
|
|
330
|
-
unappend: () => unappend,
|
|
331
|
-
unfold: () => unfold,
|
|
332
|
-
union: () => union,
|
|
333
|
-
unionWith: () => unionWith,
|
|
334
|
-
unprepend: () => unprepend,
|
|
335
|
-
unsafeGet: () => unsafeGet,
|
|
336
|
-
unzip: () => unzip,
|
|
337
|
-
zip: () => zip,
|
|
338
|
-
zipWith: () => zipWith2
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Equivalence.js
|
|
342
|
-
var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
343
|
-
var array = (item) => make((self, that) => {
|
|
344
|
-
if (self.length !== that.length) {
|
|
345
|
-
return false;
|
|
346
|
-
}
|
|
347
|
-
for (let i2 = 0; i2 < self.length; i2++) {
|
|
348
|
-
const isEq = item(self[i2], that[i2]);
|
|
349
|
-
if (!isEq) {
|
|
350
|
-
return false;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
return true;
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/doNotation.js
|
|
357
|
-
var let_ = (map3) => dual(3, (self, name, f2) => map3(self, (a2) => Object.assign({}, a2, {
|
|
358
|
-
[name]: f2(a2)
|
|
359
|
-
})));
|
|
360
|
-
var bindTo = (map3) => dual(2, (self, name) => map3(self, (a2) => ({
|
|
361
|
-
[name]: a2
|
|
362
|
-
})));
|
|
363
|
-
var bind = (map3, flatMap3) => dual(3, (self, name, f2) => flatMap3(self, (a2) => map3(f2(a2), (b2) => Object.assign({}, a2, {
|
|
364
|
-
[name]: b2
|
|
365
|
-
}))));
|
|
366
|
-
|
|
367
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/version.js
|
|
368
|
-
var moduleVersion = "3.4.6";
|
|
369
|
-
var getCurrentVersion = () => moduleVersion;
|
|
370
|
-
|
|
371
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/GlobalValue.js
|
|
372
|
-
var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${/* @__PURE__ */ getCurrentVersion()}`);
|
|
373
|
-
if (!(globalStoreId in globalThis)) {
|
|
374
|
-
globalThis[globalStoreId] = /* @__PURE__ */ new Map();
|
|
375
|
-
}
|
|
376
|
-
var globalStore = globalThis[globalStoreId];
|
|
377
|
-
var globalValue = (id, compute) => {
|
|
378
|
-
if (!globalStore.has(id)) {
|
|
379
|
-
globalStore.set(id, compute());
|
|
380
|
-
}
|
|
381
|
-
return globalStore.get(id);
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Predicate.js
|
|
385
|
-
var Predicate_exports = {};
|
|
386
|
-
__export(Predicate_exports, {
|
|
387
|
-
all: () => all,
|
|
388
|
-
and: () => and,
|
|
389
|
-
compose: () => compose2,
|
|
390
|
-
eqv: () => eqv,
|
|
391
|
-
every: () => every,
|
|
392
|
-
hasProperty: () => hasProperty,
|
|
393
|
-
implies: () => implies,
|
|
394
|
-
isBigInt: () => isBigInt,
|
|
395
|
-
isBoolean: () => isBoolean,
|
|
396
|
-
isDate: () => isDate,
|
|
397
|
-
isError: () => isError,
|
|
398
|
-
isFunction: () => isFunction2,
|
|
399
|
-
isIterable: () => isIterable,
|
|
400
|
-
isMap: () => isMap,
|
|
401
|
-
isNever: () => isNever,
|
|
402
|
-
isNotNull: () => isNotNull,
|
|
403
|
-
isNotNullable: () => isNotNullable,
|
|
404
|
-
isNotUndefined: () => isNotUndefined,
|
|
405
|
-
isNull: () => isNull,
|
|
406
|
-
isNullable: () => isNullable,
|
|
407
|
-
isNumber: () => isNumber,
|
|
408
|
-
isObject: () => isObject,
|
|
409
|
-
isPromise: () => isPromise,
|
|
410
|
-
isPromiseLike: () => isPromiseLike,
|
|
411
|
-
isReadonlyRecord: () => isReadonlyRecord,
|
|
412
|
-
isRecord: () => isRecord,
|
|
413
|
-
isSet: () => isSet,
|
|
414
|
-
isString: () => isString,
|
|
415
|
-
isSymbol: () => isSymbol,
|
|
416
|
-
isTagged: () => isTagged,
|
|
417
|
-
isTruthy: () => isTruthy,
|
|
418
|
-
isTupleOf: () => isTupleOf,
|
|
419
|
-
isTupleOfAtLeast: () => isTupleOfAtLeast,
|
|
420
|
-
isUint8Array: () => isUint8Array,
|
|
421
|
-
isUndefined: () => isUndefined,
|
|
422
|
-
isUnknown: () => isUnknown,
|
|
423
|
-
mapInput: () => mapInput,
|
|
424
|
-
nand: () => nand,
|
|
425
|
-
nor: () => nor,
|
|
426
|
-
not: () => not,
|
|
427
|
-
or: () => or,
|
|
428
|
-
product: () => product,
|
|
429
|
-
productMany: () => productMany,
|
|
430
|
-
some: () => some,
|
|
431
|
-
struct: () => struct,
|
|
432
|
-
tuple: () => tuple,
|
|
433
|
-
xor: () => xor
|
|
434
|
-
});
|
|
435
|
-
var mapInput = /* @__PURE__ */ dual(2, (self, f2) => (b2) => self(f2(b2)));
|
|
436
|
-
var isTupleOf = /* @__PURE__ */ dual(2, (self, n2) => self.length === n2);
|
|
437
|
-
var isTupleOfAtLeast = /* @__PURE__ */ dual(2, (self, n2) => self.length >= n2);
|
|
438
|
-
var isTruthy = (input) => !!input;
|
|
439
|
-
var isSet = (input) => input instanceof Set;
|
|
440
|
-
var isMap = (input) => input instanceof Map;
|
|
441
|
-
var isString = (input) => typeof input === "string";
|
|
442
|
-
var isNumber = (input) => typeof input === "number";
|
|
443
|
-
var isBoolean = (input) => typeof input === "boolean";
|
|
444
|
-
var isBigInt = (input) => typeof input === "bigint";
|
|
445
|
-
var isSymbol = (input) => typeof input === "symbol";
|
|
446
|
-
var isFunction2 = isFunction;
|
|
447
|
-
var isUndefined = (input) => input === void 0;
|
|
448
|
-
var isNotUndefined = (input) => input !== void 0;
|
|
449
|
-
var isNull = (input) => input === null;
|
|
450
|
-
var isNotNull = (input) => input !== null;
|
|
451
|
-
var isNever = (_2) => false;
|
|
452
|
-
var isUnknown = (_2) => true;
|
|
453
|
-
var isRecordOrArray = (input) => typeof input === "object" && input !== null;
|
|
454
|
-
var isObject = (input) => isRecordOrArray(input) || isFunction2(input);
|
|
455
|
-
var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self);
|
|
456
|
-
var isTagged = /* @__PURE__ */ dual(2, (self, tag) => hasProperty(self, "_tag") && self["_tag"] === tag);
|
|
457
|
-
var isNullable = (input) => input === null || input === void 0;
|
|
458
|
-
var isNotNullable = (input) => input !== null && input !== void 0;
|
|
459
|
-
var isError = (input) => input instanceof Error;
|
|
460
|
-
var isUint8Array = (input) => input instanceof Uint8Array;
|
|
461
|
-
var isDate = (input) => input instanceof Date;
|
|
462
|
-
var isIterable = (input) => hasProperty(input, Symbol.iterator);
|
|
463
|
-
var isRecord = (input) => isRecordOrArray(input) && !Array.isArray(input);
|
|
464
|
-
var isReadonlyRecord = isRecord;
|
|
465
|
-
var isPromise = (input) => hasProperty(input, "then") && "catch" in input && isFunction2(input.then) && isFunction2(input.catch);
|
|
466
|
-
var isPromiseLike = (input) => hasProperty(input, "then") && isFunction2(input.then);
|
|
467
|
-
var compose2 = /* @__PURE__ */ dual(2, (ab, bc) => (a2) => ab(a2) && bc(a2));
|
|
468
|
-
var product = (self, that) => ([a2, b2]) => self(a2) && that(b2);
|
|
469
|
-
var all = (collection) => {
|
|
470
|
-
return (as2) => {
|
|
471
|
-
let collectionIndex = 0;
|
|
472
|
-
for (const p2 of collection) {
|
|
473
|
-
if (collectionIndex >= as2.length) {
|
|
474
|
-
break;
|
|
475
|
-
}
|
|
476
|
-
if (p2(as2[collectionIndex]) === false) {
|
|
477
|
-
return false;
|
|
478
|
-
}
|
|
479
|
-
collectionIndex++;
|
|
480
|
-
}
|
|
481
|
-
return true;
|
|
482
|
-
};
|
|
483
|
-
};
|
|
484
|
-
var productMany = (self, collection) => {
|
|
485
|
-
const rest = all(collection);
|
|
486
|
-
return ([head2, ...tail2]) => self(head2) === false ? false : rest(tail2);
|
|
487
|
-
};
|
|
488
|
-
var tuple = (...elements) => all(elements);
|
|
489
|
-
var struct = (fields) => {
|
|
490
|
-
const keys2 = Object.keys(fields);
|
|
491
|
-
return (a2) => {
|
|
492
|
-
for (const key of keys2) {
|
|
493
|
-
if (!fields[key](a2[key])) {
|
|
494
|
-
return false;
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
return true;
|
|
498
|
-
};
|
|
499
|
-
};
|
|
500
|
-
var not = (self) => (a2) => !self(a2);
|
|
501
|
-
var or = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) || that(a2));
|
|
502
|
-
var and = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) && that(a2));
|
|
503
|
-
var xor = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) !== that(a2));
|
|
504
|
-
var eqv = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) === that(a2));
|
|
505
|
-
var implies = /* @__PURE__ */ dual(2, (antecedent, consequent) => (a2) => antecedent(a2) ? consequent(a2) : true);
|
|
506
|
-
var nor = /* @__PURE__ */ dual(2, (self, that) => (a2) => !(self(a2) || that(a2)));
|
|
507
|
-
var nand = /* @__PURE__ */ dual(2, (self, that) => (a2) => !(self(a2) && that(a2)));
|
|
508
|
-
var every = (collection) => (a2) => {
|
|
509
|
-
for (const p2 of collection) {
|
|
510
|
-
if (!p2(a2)) {
|
|
511
|
-
return false;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
return true;
|
|
515
|
-
};
|
|
516
|
-
var some = (collection) => (a2) => {
|
|
517
|
-
for (const p2 of collection) {
|
|
518
|
-
if (p2(a2)) {
|
|
519
|
-
return true;
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
return false;
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/errors.js
|
|
526
|
-
var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
|
|
527
|
-
|
|
528
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Utils.js
|
|
529
|
-
var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
|
|
530
|
-
var isGenKind = (u2) => isObject(u2) && GenKindTypeId in u2;
|
|
531
|
-
var GenKindImpl = class {
|
|
532
|
-
value;
|
|
533
|
-
constructor(value) {
|
|
534
|
-
this.value = value;
|
|
535
|
-
}
|
|
536
|
-
/**
|
|
537
|
-
* @since 2.0.0
|
|
538
|
-
*/
|
|
539
|
-
get _F() {
|
|
540
|
-
return identity;
|
|
541
|
-
}
|
|
542
|
-
/**
|
|
543
|
-
* @since 2.0.0
|
|
544
|
-
*/
|
|
545
|
-
get _R() {
|
|
546
|
-
return (_2) => _2;
|
|
547
|
-
}
|
|
548
|
-
/**
|
|
549
|
-
* @since 2.0.0
|
|
550
|
-
*/
|
|
551
|
-
get _O() {
|
|
552
|
-
return (_2) => _2;
|
|
553
|
-
}
|
|
554
|
-
/**
|
|
555
|
-
* @since 2.0.0
|
|
556
|
-
*/
|
|
557
|
-
get _E() {
|
|
558
|
-
return (_2) => _2;
|
|
559
|
-
}
|
|
560
|
-
/**
|
|
561
|
-
* @since 2.0.0
|
|
562
|
-
*/
|
|
563
|
-
[GenKindTypeId] = GenKindTypeId;
|
|
564
|
-
/**
|
|
565
|
-
* @since 2.0.0
|
|
566
|
-
*/
|
|
567
|
-
[Symbol.iterator]() {
|
|
568
|
-
return new SingleShotGen(this);
|
|
569
|
-
}
|
|
570
|
-
};
|
|
571
|
-
var SingleShotGen = class _SingleShotGen {
|
|
572
|
-
self;
|
|
573
|
-
called = false;
|
|
574
|
-
constructor(self) {
|
|
575
|
-
this.self = self;
|
|
576
|
-
}
|
|
577
|
-
/**
|
|
578
|
-
* @since 2.0.0
|
|
579
|
-
*/
|
|
580
|
-
next(a2) {
|
|
581
|
-
return this.called ? {
|
|
582
|
-
value: a2,
|
|
583
|
-
done: true
|
|
584
|
-
} : (this.called = true, {
|
|
585
|
-
value: this.self,
|
|
586
|
-
done: false
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* @since 2.0.0
|
|
591
|
-
*/
|
|
592
|
-
return(a2) {
|
|
593
|
-
return {
|
|
594
|
-
value: a2,
|
|
595
|
-
done: true
|
|
596
|
-
};
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* @since 2.0.0
|
|
600
|
-
*/
|
|
601
|
-
throw(e2) {
|
|
602
|
-
throw e2;
|
|
603
|
-
}
|
|
604
|
-
/**
|
|
605
|
-
* @since 2.0.0
|
|
606
|
-
*/
|
|
607
|
-
[Symbol.iterator]() {
|
|
608
|
-
return new _SingleShotGen(this.self);
|
|
609
|
-
}
|
|
610
|
-
};
|
|
611
|
-
var adapter = () => function() {
|
|
612
|
-
let x2 = arguments[0];
|
|
613
|
-
for (let i2 = 1; i2 < arguments.length; i2++) {
|
|
614
|
-
x2 = arguments[i2](x2);
|
|
615
|
-
}
|
|
616
|
-
return new GenKindImpl(x2);
|
|
617
|
-
};
|
|
618
|
-
var YieldWrapTypeId = /* @__PURE__ */ Symbol.for("effect/Utils/YieldWrap");
|
|
619
|
-
var YieldWrap = class {
|
|
620
|
-
/**
|
|
621
|
-
* @since 3.0.6
|
|
622
|
-
*/
|
|
623
|
-
#value;
|
|
624
|
-
constructor(value) {
|
|
625
|
-
this.#value = value;
|
|
626
|
-
}
|
|
627
|
-
/**
|
|
628
|
-
* @since 3.0.6
|
|
629
|
-
*/
|
|
630
|
-
[YieldWrapTypeId]() {
|
|
631
|
-
return this.#value;
|
|
632
|
-
}
|
|
633
|
-
};
|
|
634
|
-
function yieldWrapGet(self) {
|
|
635
|
-
if (typeof self === "object" && self !== null && YieldWrapTypeId in self) {
|
|
636
|
-
return self[YieldWrapTypeId]();
|
|
637
|
-
}
|
|
638
|
-
throw new Error(getBugErrorMessage("yieldWrapGet"));
|
|
639
|
-
}
|
|
640
|
-
var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructuralRegion", () => ({
|
|
641
|
-
enabled: false,
|
|
642
|
-
tester: void 0
|
|
643
|
-
}));
|
|
644
|
-
|
|
645
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Hash.js
|
|
646
|
-
var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
|
|
647
|
-
var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
|
|
648
|
-
var hash = (self) => {
|
|
649
|
-
if (structuralRegionState.enabled === true) {
|
|
650
|
-
return 0;
|
|
651
|
-
}
|
|
652
|
-
switch (typeof self) {
|
|
653
|
-
case "number":
|
|
654
|
-
return number(self);
|
|
655
|
-
case "bigint":
|
|
656
|
-
return string(self.toString(10));
|
|
657
|
-
case "boolean":
|
|
658
|
-
return string(String(self));
|
|
659
|
-
case "symbol":
|
|
660
|
-
return string(String(self));
|
|
661
|
-
case "string":
|
|
662
|
-
return string(self);
|
|
663
|
-
case "undefined":
|
|
664
|
-
return string("undefined");
|
|
665
|
-
case "function":
|
|
666
|
-
case "object": {
|
|
667
|
-
if (self === null) {
|
|
668
|
-
return string("null");
|
|
669
|
-
} else if (self instanceof Date) {
|
|
670
|
-
return hash(self.toISOString());
|
|
671
|
-
} else if (isHash(self)) {
|
|
672
|
-
return self[symbol]();
|
|
673
|
-
} else {
|
|
674
|
-
return random(self);
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
default:
|
|
678
|
-
throw new Error(`BUG: unhandled typeof ${typeof self} - please report an issue at https://github.com/Effect-TS/effect/issues`);
|
|
679
|
-
}
|
|
680
|
-
};
|
|
681
|
-
var random = (self) => {
|
|
682
|
-
if (!randomHashCache.has(self)) {
|
|
683
|
-
randomHashCache.set(self, number(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)));
|
|
684
|
-
}
|
|
685
|
-
return randomHashCache.get(self);
|
|
686
|
-
};
|
|
687
|
-
var combine = (b2) => (self) => self * 53 ^ b2;
|
|
688
|
-
var optimize = (n2) => n2 & 3221225471 | n2 >>> 1 & 1073741824;
|
|
689
|
-
var isHash = (u2) => hasProperty(u2, symbol);
|
|
690
|
-
var number = (n2) => {
|
|
691
|
-
if (n2 !== n2 || n2 === Infinity) {
|
|
692
|
-
return 0;
|
|
693
|
-
}
|
|
694
|
-
let h2 = n2 | 0;
|
|
695
|
-
if (h2 !== n2) {
|
|
696
|
-
h2 ^= n2 * 4294967295;
|
|
697
|
-
}
|
|
698
|
-
while (n2 > 4294967295) {
|
|
699
|
-
h2 ^= n2 /= 4294967295;
|
|
700
|
-
}
|
|
701
|
-
return optimize(n2);
|
|
702
|
-
};
|
|
703
|
-
var string = (str) => {
|
|
704
|
-
let h2 = 5381, i2 = str.length;
|
|
705
|
-
while (i2) {
|
|
706
|
-
h2 = h2 * 33 ^ str.charCodeAt(--i2);
|
|
707
|
-
}
|
|
708
|
-
return optimize(h2);
|
|
709
|
-
};
|
|
710
|
-
var cached = function() {
|
|
711
|
-
if (arguments.length === 1) {
|
|
712
|
-
const self2 = arguments[0];
|
|
713
|
-
return function(hash3) {
|
|
714
|
-
Object.defineProperty(self2, symbol, {
|
|
715
|
-
value() {
|
|
716
|
-
return hash3;
|
|
717
|
-
},
|
|
718
|
-
enumerable: false
|
|
719
|
-
});
|
|
720
|
-
return hash3;
|
|
721
|
-
};
|
|
722
|
-
}
|
|
723
|
-
const self = arguments[0];
|
|
724
|
-
const hash2 = arguments[1];
|
|
725
|
-
Object.defineProperty(self, symbol, {
|
|
726
|
-
value() {
|
|
727
|
-
return hash2;
|
|
728
|
-
},
|
|
729
|
-
enumerable: false
|
|
730
|
-
});
|
|
731
|
-
return hash2;
|
|
732
|
-
};
|
|
733
|
-
|
|
734
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Equal.js
|
|
735
|
-
var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
|
|
736
|
-
function equals() {
|
|
737
|
-
if (arguments.length === 1) {
|
|
738
|
-
return (self) => compareBoth(self, arguments[0]);
|
|
739
|
-
}
|
|
740
|
-
return compareBoth(arguments[0], arguments[1]);
|
|
741
|
-
}
|
|
742
|
-
function compareBoth(self, that) {
|
|
743
|
-
if (self === that) {
|
|
744
|
-
return true;
|
|
745
|
-
}
|
|
746
|
-
const selfType = typeof self;
|
|
747
|
-
if (selfType !== typeof that) {
|
|
748
|
-
return false;
|
|
749
|
-
}
|
|
750
|
-
if (selfType === "object" || selfType === "function") {
|
|
751
|
-
if (self !== null && that !== null) {
|
|
752
|
-
if (isEqual(self) && isEqual(that)) {
|
|
753
|
-
if (hash(self) === hash(that) && self[symbol2](that)) {
|
|
754
|
-
return true;
|
|
755
|
-
} else {
|
|
756
|
-
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
757
|
-
}
|
|
758
|
-
} else if (self instanceof Date && that instanceof Date) {
|
|
759
|
-
return self.toISOString() === that.toISOString();
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
if (structuralRegionState.enabled) {
|
|
763
|
-
if (Array.isArray(self) && Array.isArray(that)) {
|
|
764
|
-
return self.length === that.length && self.every((v2, i2) => compareBoth(v2, that[i2]));
|
|
765
|
-
}
|
|
766
|
-
if (Object.getPrototypeOf(self) === Object.prototype && Object.getPrototypeOf(self) === Object.prototype) {
|
|
767
|
-
const keysSelf = Object.keys(self);
|
|
768
|
-
const keysThat = Object.keys(that);
|
|
769
|
-
if (keysSelf.length === keysThat.length) {
|
|
770
|
-
for (const key of keysSelf) {
|
|
771
|
-
if (!(key in that && compareBoth(self[key], that[key]))) {
|
|
772
|
-
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
return true;
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
|
|
782
|
-
}
|
|
783
|
-
var isEqual = (u2) => hasProperty(u2, symbol2);
|
|
784
|
-
var equivalence = () => equals;
|
|
785
|
-
|
|
786
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Inspectable.js
|
|
787
|
-
var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
788
|
-
var toJSON = (x2) => {
|
|
789
|
-
if (hasProperty(x2, "toJSON") && isFunction2(x2["toJSON"]) && x2["toJSON"].length === 0) {
|
|
790
|
-
return x2.toJSON();
|
|
791
|
-
} else if (Array.isArray(x2)) {
|
|
792
|
-
return x2.map(toJSON);
|
|
793
|
-
}
|
|
794
|
-
return x2;
|
|
795
|
-
};
|
|
796
|
-
var format = (x2) => JSON.stringify(x2, null, 2);
|
|
797
|
-
|
|
798
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Pipeable.js
|
|
799
|
-
var pipeArguments = (self, args) => {
|
|
800
|
-
switch (args.length) {
|
|
801
|
-
case 1:
|
|
802
|
-
return args[0](self);
|
|
803
|
-
case 2:
|
|
804
|
-
return args[1](args[0](self));
|
|
805
|
-
case 3:
|
|
806
|
-
return args[2](args[1](args[0](self)));
|
|
807
|
-
case 4:
|
|
808
|
-
return args[3](args[2](args[1](args[0](self))));
|
|
809
|
-
case 5:
|
|
810
|
-
return args[4](args[3](args[2](args[1](args[0](self)))));
|
|
811
|
-
case 6:
|
|
812
|
-
return args[5](args[4](args[3](args[2](args[1](args[0](self))))));
|
|
813
|
-
case 7:
|
|
814
|
-
return args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))));
|
|
815
|
-
case 8:
|
|
816
|
-
return args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self))))))));
|
|
817
|
-
case 9:
|
|
818
|
-
return args[8](args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))))));
|
|
819
|
-
default: {
|
|
820
|
-
let ret = self;
|
|
821
|
-
for (let i2 = 0, len = args.length; i2 < len; i2++) {
|
|
822
|
-
ret = args[i2](ret);
|
|
823
|
-
}
|
|
824
|
-
return ret;
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
};
|
|
828
|
-
|
|
829
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/effectable.js
|
|
830
|
-
var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
|
|
831
|
-
var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
|
|
832
|
-
var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
|
|
833
|
-
var ChannelTypeId = /* @__PURE__ */ Symbol.for("effect/Channel");
|
|
834
|
-
var effectVariance = {
|
|
835
|
-
/* c8 ignore next */
|
|
836
|
-
_R: (_2) => _2,
|
|
837
|
-
/* c8 ignore next */
|
|
838
|
-
_E: (_2) => _2,
|
|
839
|
-
/* c8 ignore next */
|
|
840
|
-
_A: (_2) => _2,
|
|
841
|
-
_V: /* @__PURE__ */ getCurrentVersion()
|
|
842
|
-
};
|
|
843
|
-
var sinkVariance = {
|
|
844
|
-
/* c8 ignore next */
|
|
845
|
-
_A: (_2) => _2,
|
|
846
|
-
/* c8 ignore next */
|
|
847
|
-
_In: (_2) => _2,
|
|
848
|
-
/* c8 ignore next */
|
|
849
|
-
_L: (_2) => _2,
|
|
850
|
-
/* c8 ignore next */
|
|
851
|
-
_E: (_2) => _2,
|
|
852
|
-
/* c8 ignore next */
|
|
853
|
-
_R: (_2) => _2
|
|
854
|
-
};
|
|
855
|
-
var channelVariance = {
|
|
856
|
-
/* c8 ignore next */
|
|
857
|
-
_Env: (_2) => _2,
|
|
858
|
-
/* c8 ignore next */
|
|
859
|
-
_InErr: (_2) => _2,
|
|
860
|
-
/* c8 ignore next */
|
|
861
|
-
_InElem: (_2) => _2,
|
|
862
|
-
/* c8 ignore next */
|
|
863
|
-
_InDone: (_2) => _2,
|
|
864
|
-
/* c8 ignore next */
|
|
865
|
-
_OutErr: (_2) => _2,
|
|
866
|
-
/* c8 ignore next */
|
|
867
|
-
_OutElem: (_2) => _2,
|
|
868
|
-
/* c8 ignore next */
|
|
869
|
-
_OutDone: (_2) => _2
|
|
870
|
-
};
|
|
871
|
-
var EffectPrototype = {
|
|
872
|
-
[EffectTypeId]: effectVariance,
|
|
873
|
-
[StreamTypeId]: effectVariance,
|
|
874
|
-
[SinkTypeId]: sinkVariance,
|
|
875
|
-
[ChannelTypeId]: channelVariance,
|
|
876
|
-
[symbol2](that) {
|
|
877
|
-
return this === that;
|
|
878
|
-
},
|
|
879
|
-
[symbol]() {
|
|
880
|
-
return cached(this, random(this));
|
|
881
|
-
},
|
|
882
|
-
[Symbol.iterator]() {
|
|
883
|
-
return new SingleShotGen(new YieldWrap(this));
|
|
884
|
-
},
|
|
885
|
-
pipe() {
|
|
886
|
-
return pipeArguments(this, arguments);
|
|
887
|
-
}
|
|
888
|
-
};
|
|
889
|
-
|
|
890
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/option.js
|
|
891
|
-
var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
892
|
-
var CommonProto = {
|
|
893
|
-
...EffectPrototype,
|
|
894
|
-
[TypeId]: {
|
|
895
|
-
_A: (_2) => _2
|
|
896
|
-
},
|
|
897
|
-
[NodeInspectSymbol]() {
|
|
898
|
-
return this.toJSON();
|
|
899
|
-
},
|
|
900
|
-
toString() {
|
|
901
|
-
return format(this.toJSON());
|
|
902
|
-
}
|
|
903
|
-
};
|
|
904
|
-
var SomeProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
|
|
905
|
-
_tag: "Some",
|
|
906
|
-
_op: "Some",
|
|
907
|
-
[symbol2](that) {
|
|
908
|
-
return isOption(that) && isSome(that) && equals(this.value, that.value);
|
|
909
|
-
},
|
|
910
|
-
[symbol]() {
|
|
911
|
-
return cached(this, combine(hash(this._tag))(hash(this.value)));
|
|
912
|
-
},
|
|
913
|
-
toJSON() {
|
|
914
|
-
return {
|
|
915
|
-
_id: "Option",
|
|
916
|
-
_tag: this._tag,
|
|
917
|
-
value: toJSON(this.value)
|
|
918
|
-
};
|
|
919
|
-
}
|
|
920
|
-
});
|
|
921
|
-
var NoneHash = /* @__PURE__ */ hash("None");
|
|
922
|
-
var NoneProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
|
|
923
|
-
_tag: "None",
|
|
924
|
-
_op: "None",
|
|
925
|
-
[symbol2](that) {
|
|
926
|
-
return isOption(that) && isNone(that);
|
|
927
|
-
},
|
|
928
|
-
[symbol]() {
|
|
929
|
-
return NoneHash;
|
|
930
|
-
},
|
|
931
|
-
toJSON() {
|
|
932
|
-
return {
|
|
933
|
-
_id: "Option",
|
|
934
|
-
_tag: this._tag
|
|
935
|
-
};
|
|
936
|
-
}
|
|
937
|
-
});
|
|
938
|
-
var isOption = (input) => hasProperty(input, TypeId);
|
|
939
|
-
var isNone = (fa) => fa._tag === "None";
|
|
940
|
-
var isSome = (fa) => fa._tag === "Some";
|
|
941
|
-
var none = /* @__PURE__ */ Object.create(NoneProto);
|
|
942
|
-
var some2 = (value) => {
|
|
943
|
-
const a2 = Object.create(SomeProto);
|
|
944
|
-
a2.value = value;
|
|
945
|
-
return a2;
|
|
946
|
-
};
|
|
947
|
-
|
|
948
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/either.js
|
|
949
|
-
var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
|
|
950
|
-
var CommonProto2 = {
|
|
951
|
-
...EffectPrototype,
|
|
952
|
-
[TypeId2]: {
|
|
953
|
-
_R: (_2) => _2
|
|
954
|
-
},
|
|
955
|
-
[NodeInspectSymbol]() {
|
|
956
|
-
return this.toJSON();
|
|
957
|
-
},
|
|
958
|
-
toString() {
|
|
959
|
-
return format(this.toJSON());
|
|
960
|
-
}
|
|
961
|
-
};
|
|
962
|
-
var RightProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
|
|
963
|
-
_tag: "Right",
|
|
964
|
-
_op: "Right",
|
|
965
|
-
[symbol2](that) {
|
|
966
|
-
return isEither(that) && isRight(that) && equals(this.right, that.right);
|
|
967
|
-
},
|
|
968
|
-
[symbol]() {
|
|
969
|
-
return combine(hash(this._tag))(hash(this.right));
|
|
970
|
-
},
|
|
971
|
-
toJSON() {
|
|
972
|
-
return {
|
|
973
|
-
_id: "Either",
|
|
974
|
-
_tag: this._tag,
|
|
975
|
-
right: toJSON(this.right)
|
|
976
|
-
};
|
|
977
|
-
}
|
|
978
|
-
});
|
|
979
|
-
var LeftProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
|
|
980
|
-
_tag: "Left",
|
|
981
|
-
_op: "Left",
|
|
982
|
-
[symbol2](that) {
|
|
983
|
-
return isEither(that) && isLeft(that) && equals(this.left, that.left);
|
|
984
|
-
},
|
|
985
|
-
[symbol]() {
|
|
986
|
-
return combine(hash(this._tag))(hash(this.left));
|
|
987
|
-
},
|
|
988
|
-
toJSON() {
|
|
989
|
-
return {
|
|
990
|
-
_id: "Either",
|
|
991
|
-
_tag: this._tag,
|
|
992
|
-
left: toJSON(this.left)
|
|
993
|
-
};
|
|
994
|
-
}
|
|
995
|
-
});
|
|
996
|
-
var isEither = (input) => hasProperty(input, TypeId2);
|
|
997
|
-
var isLeft = (ma) => ma._tag === "Left";
|
|
998
|
-
var isRight = (ma) => ma._tag === "Right";
|
|
999
|
-
var left = (left2) => {
|
|
1000
|
-
const a2 = Object.create(LeftProto);
|
|
1001
|
-
a2.left = left2;
|
|
1002
|
-
return a2;
|
|
1003
|
-
};
|
|
1004
|
-
var right = (right2) => {
|
|
1005
|
-
const a2 = Object.create(RightProto);
|
|
1006
|
-
a2.right = right2;
|
|
1007
|
-
return a2;
|
|
1008
|
-
};
|
|
1009
|
-
var getLeft = (self) => isRight(self) ? none : some2(self.left);
|
|
1010
|
-
var getRight = (self) => isLeft(self) ? none : some2(self.right);
|
|
1011
|
-
|
|
1012
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Either.js
|
|
1013
|
-
var isLeft2 = isLeft;
|
|
1014
|
-
var isRight2 = isRight;
|
|
1015
|
-
|
|
1016
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/array.js
|
|
1017
|
-
var isNonEmptyArray = (self) => self.length > 0;
|
|
1018
|
-
|
|
1019
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Option.js
|
|
1020
|
-
var Option_exports = {};
|
|
1021
|
-
__export(Option_exports, {
|
|
1022
|
-
Do: () => Do,
|
|
1023
|
-
TypeId: () => TypeId3,
|
|
1024
|
-
all: () => all2,
|
|
1025
|
-
andThen: () => andThen,
|
|
1026
|
-
ap: () => ap,
|
|
1027
|
-
as: () => as,
|
|
1028
|
-
asVoid: () => asVoid,
|
|
1029
|
-
bind: () => bind2,
|
|
1030
|
-
bindTo: () => bindTo2,
|
|
1031
|
-
composeK: () => composeK,
|
|
1032
|
-
contains: () => contains,
|
|
1033
|
-
containsWith: () => containsWith,
|
|
1034
|
-
exists: () => exists,
|
|
1035
|
-
filter: () => filter,
|
|
1036
|
-
filterMap: () => filterMap,
|
|
1037
|
-
firstSomeOf: () => firstSomeOf,
|
|
1038
|
-
flatMap: () => flatMap,
|
|
1039
|
-
flatMapNullable: () => flatMapNullable,
|
|
1040
|
-
flatten: () => flatten,
|
|
1041
|
-
fromIterable: () => fromIterable,
|
|
1042
|
-
fromNullable: () => fromNullable,
|
|
1043
|
-
gen: () => gen,
|
|
1044
|
-
getEquivalence: () => getEquivalence,
|
|
1045
|
-
getLeft: () => getLeft2,
|
|
1046
|
-
getOrElse: () => getOrElse,
|
|
1047
|
-
getOrNull: () => getOrNull,
|
|
1048
|
-
getOrThrow: () => getOrThrow,
|
|
1049
|
-
getOrThrowWith: () => getOrThrowWith,
|
|
1050
|
-
getOrUndefined: () => getOrUndefined,
|
|
1051
|
-
getOrder: () => getOrder,
|
|
1052
|
-
getRight: () => getRight2,
|
|
1053
|
-
isNone: () => isNone2,
|
|
1054
|
-
isOption: () => isOption2,
|
|
1055
|
-
isSome: () => isSome2,
|
|
1056
|
-
let: () => let_2,
|
|
1057
|
-
lift2: () => lift2,
|
|
1058
|
-
liftNullable: () => liftNullable,
|
|
1059
|
-
liftPredicate: () => liftPredicate,
|
|
1060
|
-
liftThrowable: () => liftThrowable,
|
|
1061
|
-
map: () => map,
|
|
1062
|
-
match: () => match,
|
|
1063
|
-
none: () => none2,
|
|
1064
|
-
orElse: () => orElse,
|
|
1065
|
-
orElseEither: () => orElseEither,
|
|
1066
|
-
orElseSome: () => orElseSome,
|
|
1067
|
-
partitionMap: () => partitionMap,
|
|
1068
|
-
product: () => product2,
|
|
1069
|
-
productMany: () => productMany2,
|
|
1070
|
-
reduceCompact: () => reduceCompact,
|
|
1071
|
-
some: () => some3,
|
|
1072
|
-
tap: () => tap,
|
|
1073
|
-
toArray: () => toArray,
|
|
1074
|
-
toRefinement: () => toRefinement,
|
|
1075
|
-
void: () => void_,
|
|
1076
|
-
zipLeft: () => zipLeft,
|
|
1077
|
-
zipRight: () => zipRight,
|
|
1078
|
-
zipWith: () => zipWith
|
|
1079
|
-
});
|
|
1080
|
-
|
|
1081
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Order.js
|
|
1082
|
-
var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
|
|
1083
|
-
var number2 = /* @__PURE__ */ make2((self, that) => self < that ? -1 : 1);
|
|
1084
|
-
var combineMany = /* @__PURE__ */ dual(2, (self, collection) => make2((a1, a2) => {
|
|
1085
|
-
let out = self(a1, a2);
|
|
1086
|
-
if (out !== 0) {
|
|
1087
|
-
return out;
|
|
1088
|
-
}
|
|
1089
|
-
for (const O2 of collection) {
|
|
1090
|
-
out = O2(a1, a2);
|
|
1091
|
-
if (out !== 0) {
|
|
1092
|
-
return out;
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
return out;
|
|
1096
|
-
}));
|
|
1097
|
-
var empty = () => make2(() => 0);
|
|
1098
|
-
var combineAll = (collection) => combineMany(empty(), collection);
|
|
1099
|
-
var mapInput2 = /* @__PURE__ */ dual(2, (self, f2) => make2((b1, b2) => self(f2(b1), f2(b2))));
|
|
1100
|
-
var array2 = (O2) => make2((self, that) => {
|
|
1101
|
-
const aLen = self.length;
|
|
1102
|
-
const bLen = that.length;
|
|
1103
|
-
const len = Math.min(aLen, bLen);
|
|
1104
|
-
for (let i2 = 0; i2 < len; i2++) {
|
|
1105
|
-
const o2 = O2(self[i2], that[i2]);
|
|
1106
|
-
if (o2 !== 0) {
|
|
1107
|
-
return o2;
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
return number2(aLen, bLen);
|
|
1111
|
-
});
|
|
1112
|
-
var min = (O2) => dual(2, (self, that) => self === that || O2(self, that) < 1 ? self : that);
|
|
1113
|
-
var max = (O2) => dual(2, (self, that) => self === that || O2(self, that) > -1 ? self : that);
|
|
1114
|
-
|
|
1115
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Option.js
|
|
1116
|
-
var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
1117
|
-
var none2 = () => none;
|
|
1118
|
-
var some3 = some2;
|
|
1119
|
-
var isOption2 = isOption;
|
|
1120
|
-
var isNone2 = isNone;
|
|
1121
|
-
var isSome2 = isSome;
|
|
1122
|
-
var match = /* @__PURE__ */ dual(2, (self, {
|
|
1123
|
-
onNone,
|
|
1124
|
-
onSome
|
|
1125
|
-
}) => isNone2(self) ? onNone() : onSome(self.value));
|
|
1126
|
-
var toRefinement = (f2) => (a2) => isSome2(f2(a2));
|
|
1127
|
-
var fromIterable = (collection) => {
|
|
1128
|
-
for (const a2 of collection) {
|
|
1129
|
-
return some3(a2);
|
|
1130
|
-
}
|
|
1131
|
-
return none2();
|
|
1132
|
-
};
|
|
1133
|
-
var getRight2 = getRight;
|
|
1134
|
-
var getLeft2 = getLeft;
|
|
1135
|
-
var getOrElse = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value);
|
|
1136
|
-
var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
|
|
1137
|
-
var orElseSome = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? some3(onNone()) : self);
|
|
1138
|
-
var orElseEither = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? map(that(), right) : map(self, left));
|
|
1139
|
-
var firstSomeOf = (collection) => {
|
|
1140
|
-
let out = none2();
|
|
1141
|
-
for (out of collection) {
|
|
1142
|
-
if (isSome2(out)) {
|
|
1143
|
-
return out;
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
return out;
|
|
1147
|
-
};
|
|
1148
|
-
var fromNullable = (nullableValue) => nullableValue == null ? none2() : some3(nullableValue);
|
|
1149
|
-
var liftNullable = (f2) => (...a2) => fromNullable(f2(...a2));
|
|
1150
|
-
var getOrNull = /* @__PURE__ */ getOrElse(constNull);
|
|
1151
|
-
var getOrUndefined = /* @__PURE__ */ getOrElse(constUndefined);
|
|
1152
|
-
var liftThrowable = (f2) => (...a2) => {
|
|
1153
|
-
try {
|
|
1154
|
-
return some3(f2(...a2));
|
|
1155
|
-
} catch (e2) {
|
|
1156
|
-
return none2();
|
|
1157
|
-
}
|
|
1158
|
-
};
|
|
1159
|
-
var getOrThrowWith = /* @__PURE__ */ dual(2, (self, onNone) => {
|
|
1160
|
-
if (isSome2(self)) {
|
|
1161
|
-
return self.value;
|
|
1162
|
-
}
|
|
1163
|
-
throw onNone();
|
|
1164
|
-
});
|
|
1165
|
-
var getOrThrow = /* @__PURE__ */ getOrThrowWith(() => new Error("getOrThrow called on a None"));
|
|
1166
|
-
var map = /* @__PURE__ */ dual(2, (self, f2) => isNone2(self) ? none2() : some3(f2(self.value)));
|
|
1167
|
-
var as = /* @__PURE__ */ dual(2, (self, b2) => map(self, () => b2));
|
|
1168
|
-
var asVoid = /* @__PURE__ */ as(void 0);
|
|
1169
|
-
var void_ = /* @__PURE__ */ some3(void 0);
|
|
1170
|
-
var flatMap = /* @__PURE__ */ dual(2, (self, f2) => isNone2(self) ? none2() : f2(self.value));
|
|
1171
|
-
var andThen = /* @__PURE__ */ dual(2, (self, f2) => flatMap(self, (a2) => {
|
|
1172
|
-
const b2 = isFunction(f2) ? f2(a2) : f2;
|
|
1173
|
-
return isOption2(b2) ? b2 : some3(b2);
|
|
1174
|
-
}));
|
|
1175
|
-
var flatMapNullable = /* @__PURE__ */ dual(2, (self, f2) => isNone2(self) ? none2() : fromNullable(f2(self.value)));
|
|
1176
|
-
var flatten = /* @__PURE__ */ flatMap(identity);
|
|
1177
|
-
var zipRight = /* @__PURE__ */ dual(2, (self, that) => flatMap(self, () => that));
|
|
1178
|
-
var composeK = /* @__PURE__ */ dual(2, (afb, bfc) => (a2) => flatMap(afb(a2), bfc));
|
|
1179
|
-
var zipLeft = /* @__PURE__ */ dual(2, (self, that) => tap(self, () => that));
|
|
1180
|
-
var tap = /* @__PURE__ */ dual(2, (self, f2) => flatMap(self, (a2) => map(f2(a2), () => a2)));
|
|
1181
|
-
var product2 = (self, that) => isSome2(self) && isSome2(that) ? some3([self.value, that.value]) : none2();
|
|
1182
|
-
var productMany2 = (self, collection) => {
|
|
1183
|
-
if (isNone2(self)) {
|
|
1184
|
-
return none2();
|
|
1185
|
-
}
|
|
1186
|
-
const out = [self.value];
|
|
1187
|
-
for (const o2 of collection) {
|
|
1188
|
-
if (isNone2(o2)) {
|
|
1189
|
-
return none2();
|
|
1190
|
-
}
|
|
1191
|
-
out.push(o2.value);
|
|
1192
|
-
}
|
|
1193
|
-
return some3(out);
|
|
1194
|
-
};
|
|
1195
|
-
var all2 = (input) => {
|
|
1196
|
-
if (Symbol.iterator in input) {
|
|
1197
|
-
const out2 = [];
|
|
1198
|
-
for (const o2 of input) {
|
|
1199
|
-
if (isNone2(o2)) {
|
|
1200
|
-
return none2();
|
|
1201
|
-
}
|
|
1202
|
-
out2.push(o2.value);
|
|
1203
|
-
}
|
|
1204
|
-
return some3(out2);
|
|
1205
|
-
}
|
|
1206
|
-
const out = {};
|
|
1207
|
-
for (const key of Object.keys(input)) {
|
|
1208
|
-
const o2 = input[key];
|
|
1209
|
-
if (isNone2(o2)) {
|
|
1210
|
-
return none2();
|
|
1211
|
-
}
|
|
1212
|
-
out[key] = o2.value;
|
|
1213
|
-
}
|
|
1214
|
-
return some3(out);
|
|
1215
|
-
};
|
|
1216
|
-
var zipWith = /* @__PURE__ */ dual(3, (self, that, f2) => map(product2(self, that), ([a2, b2]) => f2(a2, b2)));
|
|
1217
|
-
var ap = /* @__PURE__ */ dual(2, (self, that) => zipWith(self, that, (f2, a2) => f2(a2)));
|
|
1218
|
-
var reduceCompact = /* @__PURE__ */ dual(3, (self, b2, f2) => {
|
|
1219
|
-
let out = b2;
|
|
1220
|
-
for (const oa of self) {
|
|
1221
|
-
if (isSome2(oa)) {
|
|
1222
|
-
out = f2(out, oa.value);
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
return out;
|
|
1226
|
-
});
|
|
1227
|
-
var toArray = (self) => isNone2(self) ? [] : [self.value];
|
|
1228
|
-
var partitionMap = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1229
|
-
if (isNone2(self)) {
|
|
1230
|
-
return [none2(), none2()];
|
|
1231
|
-
}
|
|
1232
|
-
const e2 = f2(self.value);
|
|
1233
|
-
return isLeft(e2) ? [some3(e2.left), none2()] : [none2(), some3(e2.right)];
|
|
1234
|
-
});
|
|
1235
|
-
var filterMap = /* @__PURE__ */ dual(2, (self, f2) => isNone2(self) ? none2() : f2(self.value));
|
|
1236
|
-
var filter = /* @__PURE__ */ dual(2, (self, predicate) => filterMap(self, (b2) => predicate(b2) ? some2(b2) : none));
|
|
1237
|
-
var getEquivalence = (isEquivalent) => make((x2, y2) => isNone2(x2) ? isNone2(y2) : isNone2(y2) ? false : isEquivalent(x2.value, y2.value));
|
|
1238
|
-
var getOrder = (O2) => make2((self, that) => isSome2(self) ? isSome2(that) ? O2(self.value, that.value) : 1 : -1);
|
|
1239
|
-
var lift2 = (f2) => dual(2, (self, that) => zipWith(self, that, f2));
|
|
1240
|
-
var liftPredicate = /* @__PURE__ */ dual(2, (b2, predicate) => predicate(b2) ? some3(b2) : none2());
|
|
1241
|
-
var containsWith = (isEquivalent) => dual(2, (self, a2) => isNone2(self) ? false : isEquivalent(self.value, a2));
|
|
1242
|
-
var _equivalence = /* @__PURE__ */ equivalence();
|
|
1243
|
-
var contains = /* @__PURE__ */ containsWith(_equivalence);
|
|
1244
|
-
var exists = /* @__PURE__ */ dual(2, (self, refinement) => isNone2(self) ? false : refinement(self.value));
|
|
1245
|
-
var bindTo2 = /* @__PURE__ */ bindTo(map);
|
|
1246
|
-
var let_2 = /* @__PURE__ */ let_(map);
|
|
1247
|
-
var bind2 = /* @__PURE__ */ bind(map, flatMap);
|
|
1248
|
-
var Do = /* @__PURE__ */ some3({});
|
|
1249
|
-
var adapter2 = /* @__PURE__ */ adapter();
|
|
1250
|
-
var gen = (...args) => {
|
|
1251
|
-
let f2;
|
|
1252
|
-
if (args.length === 1) {
|
|
1253
|
-
f2 = args[0];
|
|
1254
|
-
} else {
|
|
1255
|
-
f2 = args[1].bind(args[0]);
|
|
1256
|
-
}
|
|
1257
|
-
const iterator = f2(adapter2);
|
|
1258
|
-
let state = iterator.next();
|
|
1259
|
-
if (state.done) {
|
|
1260
|
-
return some3(state.value);
|
|
1261
|
-
} else {
|
|
1262
|
-
let current = state.value;
|
|
1263
|
-
if (isGenKind(current)) {
|
|
1264
|
-
current = current.value;
|
|
1265
|
-
} else {
|
|
1266
|
-
current = yieldWrapGet(current);
|
|
1267
|
-
}
|
|
1268
|
-
if (isNone2(current)) {
|
|
1269
|
-
return current;
|
|
1270
|
-
}
|
|
1271
|
-
while (!state.done) {
|
|
1272
|
-
state = iterator.next(current.value);
|
|
1273
|
-
if (!state.done) {
|
|
1274
|
-
current = state.value;
|
|
1275
|
-
if (isGenKind(current)) {
|
|
1276
|
-
current = current.value;
|
|
1277
|
-
} else {
|
|
1278
|
-
current = yieldWrapGet(current);
|
|
1279
|
-
}
|
|
1280
|
-
if (isNone2(current)) {
|
|
1281
|
-
return current;
|
|
1282
|
-
}
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
return some3(state.value);
|
|
1286
|
-
}
|
|
1287
|
-
};
|
|
1288
|
-
|
|
1289
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Tuple.js
|
|
1290
|
-
var make3 = (...elements) => elements;
|
|
1291
|
-
|
|
1292
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Iterable.js
|
|
1293
|
-
var findFirst = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1294
|
-
let i2 = 0;
|
|
1295
|
-
for (const a2 of self) {
|
|
1296
|
-
const o2 = f2(a2, i2);
|
|
1297
|
-
if (isBoolean(o2)) {
|
|
1298
|
-
if (o2) {
|
|
1299
|
-
return some3(a2);
|
|
1300
|
-
}
|
|
1301
|
-
} else {
|
|
1302
|
-
if (isSome2(o2)) {
|
|
1303
|
-
return o2;
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1306
|
-
i2++;
|
|
1307
|
-
}
|
|
1308
|
-
return none2();
|
|
1309
|
-
});
|
|
1310
|
-
|
|
1311
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Record.js
|
|
1312
|
-
var collect = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1313
|
-
const out = [];
|
|
1314
|
-
for (const key of keys(self)) {
|
|
1315
|
-
out.push(f2(key, self[key]));
|
|
1316
|
-
}
|
|
1317
|
-
return out;
|
|
1318
|
-
});
|
|
1319
|
-
var toEntries = /* @__PURE__ */ collect((key, value) => [key, value]);
|
|
1320
|
-
var keys = (self) => Object.keys(self);
|
|
1321
|
-
|
|
1322
|
-
// ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Array.js
|
|
1323
|
-
var make4 = (...elements) => elements;
|
|
1324
|
-
var allocate = (n2) => new Array(n2);
|
|
1325
|
-
var makeBy = (n2, f2) => {
|
|
1326
|
-
const max3 = Math.max(1, Math.floor(n2));
|
|
1327
|
-
const out = new Array(max3);
|
|
1328
|
-
for (let i2 = 0; i2 < max3; i2++) {
|
|
1329
|
-
out[i2] = f2(i2);
|
|
1330
|
-
}
|
|
1331
|
-
return out;
|
|
1332
|
-
};
|
|
1333
|
-
var range = (start, end) => start <= end ? makeBy(end - start + 1, (i2) => start + i2) : [start];
|
|
1334
|
-
var replicate = /* @__PURE__ */ dual(2, (a2, n2) => makeBy(n2, () => a2));
|
|
1335
|
-
var fromIterable2 = (collection) => Array.isArray(collection) ? collection : Array.from(collection);
|
|
1336
|
-
var ensure = (self) => Array.isArray(self) ? self : [self];
|
|
1337
|
-
var fromRecord = toEntries;
|
|
1338
|
-
var fromOption2 = toArray;
|
|
1339
|
-
var match2 = /* @__PURE__ */ dual(2, (self, {
|
|
1340
|
-
onEmpty,
|
|
1341
|
-
onNonEmpty
|
|
1342
|
-
}) => isNonEmptyReadonlyArray(self) ? onNonEmpty(self) : onEmpty());
|
|
1343
|
-
var matchLeft = /* @__PURE__ */ dual(2, (self, {
|
|
1344
|
-
onEmpty,
|
|
1345
|
-
onNonEmpty
|
|
1346
|
-
}) => isNonEmptyReadonlyArray(self) ? onNonEmpty(headNonEmpty(self), tailNonEmpty(self)) : onEmpty());
|
|
1347
|
-
var matchRight = /* @__PURE__ */ dual(2, (self, {
|
|
1348
|
-
onEmpty,
|
|
1349
|
-
onNonEmpty
|
|
1350
|
-
}) => isNonEmptyReadonlyArray(self) ? onNonEmpty(initNonEmpty(self), lastNonEmpty(self)) : onEmpty());
|
|
1351
|
-
var prepend = /* @__PURE__ */ dual(2, (self, head2) => [head2, ...self]);
|
|
1352
|
-
var prependAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable2(that).concat(fromIterable2(self)));
|
|
1353
|
-
var append = /* @__PURE__ */ dual(2, (self, last2) => [...self, last2]);
|
|
1354
|
-
var appendAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable2(self).concat(fromIterable2(that)));
|
|
1355
|
-
var scan = /* @__PURE__ */ dual(3, (self, b2, f2) => {
|
|
1356
|
-
const out = [b2];
|
|
1357
|
-
let i2 = 0;
|
|
1358
|
-
for (const a2 of self) {
|
|
1359
|
-
out[i2 + 1] = f2(out[i2], a2);
|
|
1360
|
-
i2++;
|
|
1361
|
-
}
|
|
1362
|
-
return out;
|
|
1363
|
-
});
|
|
1364
|
-
var scanRight = /* @__PURE__ */ dual(3, (self, b2, f2) => {
|
|
1365
|
-
const input = fromIterable2(self);
|
|
1366
|
-
const out = new Array(input.length + 1);
|
|
1367
|
-
out[input.length] = b2;
|
|
1368
|
-
for (let i2 = input.length - 1; i2 >= 0; i2--) {
|
|
1369
|
-
out[i2] = f2(out[i2 + 1], input[i2]);
|
|
1370
|
-
}
|
|
1371
|
-
return out;
|
|
1372
|
-
});
|
|
1373
|
-
var isArray = Array.isArray;
|
|
1374
|
-
var isEmptyArray = (self) => self.length === 0;
|
|
1375
|
-
var isEmptyReadonlyArray = isEmptyArray;
|
|
1376
|
-
var isNonEmptyArray2 = isNonEmptyArray;
|
|
1377
|
-
var isNonEmptyReadonlyArray = isNonEmptyArray;
|
|
1378
|
-
var length = (self) => self.length;
|
|
1379
|
-
var isOutOfBound = (i2, as2) => i2 < 0 || i2 >= as2.length;
|
|
1380
|
-
var clamp = (i2, as2) => Math.floor(Math.min(Math.max(0, i2), as2.length));
|
|
1381
|
-
var get = /* @__PURE__ */ dual(2, (self, index) => {
|
|
1382
|
-
const i2 = Math.floor(index);
|
|
1383
|
-
return isOutOfBound(i2, self) ? none2() : some3(self[i2]);
|
|
1384
|
-
});
|
|
1385
|
-
var unsafeGet = /* @__PURE__ */ dual(2, (self, index) => {
|
|
1386
|
-
const i2 = Math.floor(index);
|
|
1387
|
-
if (isOutOfBound(i2, self)) {
|
|
1388
|
-
throw new Error(`Index ${i2} out of bounds`);
|
|
1389
|
-
}
|
|
1390
|
-
return self[i2];
|
|
1391
|
-
});
|
|
1392
|
-
var unprepend = (self) => [headNonEmpty(self), tailNonEmpty(self)];
|
|
1393
|
-
var unappend = (self) => [initNonEmpty(self), lastNonEmpty(self)];
|
|
1394
|
-
var head = /* @__PURE__ */ get(0);
|
|
1395
|
-
var headNonEmpty = /* @__PURE__ */ unsafeGet(0);
|
|
1396
|
-
var last = (self) => isNonEmptyReadonlyArray(self) ? some3(lastNonEmpty(self)) : none2();
|
|
1397
|
-
var lastNonEmpty = (self) => self[self.length - 1];
|
|
1398
|
-
var tail = (self) => {
|
|
1399
|
-
const input = fromIterable2(self);
|
|
1400
|
-
return isNonEmptyReadonlyArray(input) ? some3(tailNonEmpty(input)) : none2();
|
|
1401
|
-
};
|
|
1402
|
-
var tailNonEmpty = (self) => self.slice(1);
|
|
1403
|
-
var init = (self) => {
|
|
1404
|
-
const input = fromIterable2(self);
|
|
1405
|
-
return isNonEmptyReadonlyArray(input) ? some3(initNonEmpty(input)) : none2();
|
|
1406
|
-
};
|
|
1407
|
-
var initNonEmpty = (self) => self.slice(0, -1);
|
|
1408
|
-
var take = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1409
|
-
const input = fromIterable2(self);
|
|
1410
|
-
return input.slice(0, clamp(n2, input));
|
|
1411
|
-
});
|
|
1412
|
-
var takeRight = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1413
|
-
const input = fromIterable2(self);
|
|
1414
|
-
const i2 = clamp(n2, input);
|
|
1415
|
-
return i2 === 0 ? [] : input.slice(-i2);
|
|
1416
|
-
});
|
|
1417
|
-
var takeWhile = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
1418
|
-
let i2 = 0;
|
|
1419
|
-
const out = [];
|
|
1420
|
-
for (const a2 of self) {
|
|
1421
|
-
if (!predicate(a2, i2)) {
|
|
1422
|
-
break;
|
|
1423
|
-
}
|
|
1424
|
-
out.push(a2);
|
|
1425
|
-
i2++;
|
|
1426
|
-
}
|
|
1427
|
-
return out;
|
|
1428
|
-
});
|
|
1429
|
-
var spanIndex = (self, predicate) => {
|
|
1430
|
-
let i2 = 0;
|
|
1431
|
-
for (const a2 of self) {
|
|
1432
|
-
if (!predicate(a2, i2)) {
|
|
1433
|
-
break;
|
|
1434
|
-
}
|
|
1435
|
-
i2++;
|
|
1436
|
-
}
|
|
1437
|
-
return i2;
|
|
1438
|
-
};
|
|
1439
|
-
var span = /* @__PURE__ */ dual(2, (self, predicate) => splitAt(self, spanIndex(self, predicate)));
|
|
1440
|
-
var drop = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1441
|
-
const input = fromIterable2(self);
|
|
1442
|
-
return input.slice(clamp(n2, input), input.length);
|
|
1443
|
-
});
|
|
1444
|
-
var dropRight = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1445
|
-
const input = fromIterable2(self);
|
|
1446
|
-
return input.slice(0, input.length - clamp(n2, input));
|
|
1447
|
-
});
|
|
1448
|
-
var dropWhile = /* @__PURE__ */ dual(2, (self, predicate) => fromIterable2(self).slice(spanIndex(self, predicate)));
|
|
1449
|
-
var findFirstIndex = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
1450
|
-
let i2 = 0;
|
|
1451
|
-
for (const a2 of self) {
|
|
1452
|
-
if (predicate(a2, i2)) {
|
|
1453
|
-
return some3(i2);
|
|
1454
|
-
}
|
|
1455
|
-
i2++;
|
|
1456
|
-
}
|
|
1457
|
-
return none2();
|
|
1458
|
-
});
|
|
1459
|
-
var findLastIndex = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
1460
|
-
const input = fromIterable2(self);
|
|
1461
|
-
for (let i2 = input.length - 1; i2 >= 0; i2--) {
|
|
1462
|
-
if (predicate(input[i2], i2)) {
|
|
1463
|
-
return some3(i2);
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
return none2();
|
|
1467
|
-
});
|
|
1468
|
-
var findFirst2 = findFirst;
|
|
1469
|
-
var findLast = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1470
|
-
const input = fromIterable2(self);
|
|
1471
|
-
for (let i2 = input.length - 1; i2 >= 0; i2--) {
|
|
1472
|
-
const a2 = input[i2];
|
|
1473
|
-
const o2 = f2(a2, i2);
|
|
1474
|
-
if (isBoolean(o2)) {
|
|
1475
|
-
if (o2) {
|
|
1476
|
-
return some3(a2);
|
|
1477
|
-
}
|
|
1478
|
-
} else {
|
|
1479
|
-
if (isSome2(o2)) {
|
|
1480
|
-
return o2;
|
|
1481
|
-
}
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
return none2();
|
|
1485
|
-
});
|
|
1486
|
-
var insertAt = /* @__PURE__ */ dual(3, (self, i2, b2) => {
|
|
1487
|
-
const out = Array.from(self);
|
|
1488
|
-
if (i2 < 0 || i2 > out.length) {
|
|
1489
|
-
return none2();
|
|
1490
|
-
}
|
|
1491
|
-
out.splice(i2, 0, b2);
|
|
1492
|
-
return some3(out);
|
|
1493
|
-
});
|
|
1494
|
-
var replace = /* @__PURE__ */ dual(3, (self, i2, b2) => modify(self, i2, () => b2));
|
|
1495
|
-
var replaceOption = /* @__PURE__ */ dual(3, (self, i2, b2) => modifyOption(self, i2, () => b2));
|
|
1496
|
-
var modify = /* @__PURE__ */ dual(3, (self, i2, f2) => getOrElse(modifyOption(self, i2, f2), () => Array.from(self)));
|
|
1497
|
-
var modifyOption = /* @__PURE__ */ dual(3, (self, i2, f2) => {
|
|
1498
|
-
const out = Array.from(self);
|
|
1499
|
-
if (isOutOfBound(i2, out)) {
|
|
1500
|
-
return none2();
|
|
1501
|
-
}
|
|
1502
|
-
const next = f2(out[i2]);
|
|
1503
|
-
out[i2] = next;
|
|
1504
|
-
return some3(out);
|
|
1505
|
-
});
|
|
1506
|
-
var remove = /* @__PURE__ */ dual(2, (self, i2) => {
|
|
1507
|
-
const out = Array.from(self);
|
|
1508
|
-
if (isOutOfBound(i2, out)) {
|
|
1509
|
-
return out;
|
|
1510
|
-
}
|
|
1511
|
-
out.splice(i2, 1);
|
|
1512
|
-
return out;
|
|
1513
|
-
});
|
|
1514
|
-
var reverse = (self) => Array.from(self).reverse();
|
|
1515
|
-
var sort = /* @__PURE__ */ dual(2, (self, O2) => {
|
|
1516
|
-
const out = Array.from(self);
|
|
1517
|
-
out.sort(O2);
|
|
1518
|
-
return out;
|
|
1519
|
-
});
|
|
1520
|
-
var sortWith = /* @__PURE__ */ dual(3, (self, f2, order) => sort(self, mapInput2(order, f2)));
|
|
1521
|
-
var sortBy = (...orders) => {
|
|
1522
|
-
const sortByAll = sort(combineAll(orders));
|
|
1523
|
-
return (self) => {
|
|
1524
|
-
const input = fromIterable2(self);
|
|
1525
|
-
if (isNonEmptyReadonlyArray(input)) {
|
|
1526
|
-
return sortByAll(input);
|
|
1527
|
-
}
|
|
1528
|
-
return [];
|
|
1529
|
-
};
|
|
1530
|
-
};
|
|
1531
|
-
var zip = /* @__PURE__ */ dual(2, (self, that) => zipWith2(self, that, make3));
|
|
1532
|
-
var zipWith2 = /* @__PURE__ */ dual(3, (self, that, f2) => {
|
|
1533
|
-
const as2 = fromIterable2(self);
|
|
1534
|
-
const bs = fromIterable2(that);
|
|
1535
|
-
if (isNonEmptyReadonlyArray(as2) && isNonEmptyReadonlyArray(bs)) {
|
|
1536
|
-
const out = [f2(headNonEmpty(as2), headNonEmpty(bs))];
|
|
1537
|
-
const len = Math.min(as2.length, bs.length);
|
|
1538
|
-
for (let i2 = 1; i2 < len; i2++) {
|
|
1539
|
-
out[i2] = f2(as2[i2], bs[i2]);
|
|
1540
|
-
}
|
|
1541
|
-
return out;
|
|
1542
|
-
}
|
|
1543
|
-
return [];
|
|
1544
|
-
});
|
|
1545
|
-
var unzip = (self) => {
|
|
1546
|
-
const input = fromIterable2(self);
|
|
1547
|
-
if (isNonEmptyReadonlyArray(input)) {
|
|
1548
|
-
const fa = [input[0][0]];
|
|
1549
|
-
const fb = [input[0][1]];
|
|
1550
|
-
for (let i2 = 1; i2 < input.length; i2++) {
|
|
1551
|
-
fa[i2] = input[i2][0];
|
|
1552
|
-
fb[i2] = input[i2][1];
|
|
1553
|
-
}
|
|
1554
|
-
return [fa, fb];
|
|
1555
|
-
}
|
|
1556
|
-
return [[], []];
|
|
1557
|
-
};
|
|
1558
|
-
var intersperse = /* @__PURE__ */ dual(2, (self, middle) => {
|
|
1559
|
-
const input = fromIterable2(self);
|
|
1560
|
-
if (isNonEmptyReadonlyArray(input)) {
|
|
1561
|
-
const out = [headNonEmpty(input)];
|
|
1562
|
-
const tail2 = tailNonEmpty(input);
|
|
1563
|
-
for (let i2 = 0; i2 < tail2.length; i2++) {
|
|
1564
|
-
if (i2 < tail2.length) {
|
|
1565
|
-
out.push(middle);
|
|
1566
|
-
}
|
|
1567
|
-
out.push(tail2[i2]);
|
|
1568
|
-
}
|
|
1569
|
-
return out;
|
|
1570
|
-
}
|
|
1571
|
-
return [];
|
|
1572
|
-
});
|
|
1573
|
-
var modifyNonEmptyHead = /* @__PURE__ */ dual(2, (self, f2) => [f2(headNonEmpty(self)), ...tailNonEmpty(self)]);
|
|
1574
|
-
var setNonEmptyHead = /* @__PURE__ */ dual(2, (self, b2) => modifyNonEmptyHead(self, () => b2));
|
|
1575
|
-
var modifyNonEmptyLast = /* @__PURE__ */ dual(2, (self, f2) => append(initNonEmpty(self), f2(lastNonEmpty(self))));
|
|
1576
|
-
var setNonEmptyLast = /* @__PURE__ */ dual(2, (self, b2) => modifyNonEmptyLast(self, () => b2));
|
|
1577
|
-
var rotate = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1578
|
-
const input = fromIterable2(self);
|
|
1579
|
-
if (isNonEmptyReadonlyArray(input)) {
|
|
1580
|
-
const len = input.length;
|
|
1581
|
-
const m2 = Math.round(n2) % len;
|
|
1582
|
-
if (isOutOfBound(Math.abs(m2), input) || m2 === 0) {
|
|
1583
|
-
return copy(input);
|
|
1584
|
-
}
|
|
1585
|
-
if (m2 < 0) {
|
|
1586
|
-
const [f2, s2] = splitNonEmptyAt(input, -m2);
|
|
1587
|
-
return appendAll(s2, f2);
|
|
1588
|
-
} else {
|
|
1589
|
-
return rotate(self, m2 - len);
|
|
1590
|
-
}
|
|
1591
|
-
}
|
|
1592
|
-
return [];
|
|
1593
|
-
});
|
|
1594
|
-
var containsWith2 = (isEquivalent) => dual(2, (self, a2) => {
|
|
1595
|
-
for (const i2 of self) {
|
|
1596
|
-
if (isEquivalent(a2, i2)) {
|
|
1597
|
-
return true;
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
return false;
|
|
1601
|
-
});
|
|
1602
|
-
var _equivalence2 = /* @__PURE__ */ equivalence();
|
|
1603
|
-
var contains2 = /* @__PURE__ */ containsWith2(_equivalence2);
|
|
1604
|
-
var chop = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1605
|
-
const input = fromIterable2(self);
|
|
1606
|
-
if (isNonEmptyReadonlyArray(input)) {
|
|
1607
|
-
const [b2, rest] = f2(input);
|
|
1608
|
-
const out = [b2];
|
|
1609
|
-
let next = rest;
|
|
1610
|
-
while (isNonEmptyArray(next)) {
|
|
1611
|
-
const [b3, rest2] = f2(next);
|
|
1612
|
-
out.push(b3);
|
|
1613
|
-
next = rest2;
|
|
1614
|
-
}
|
|
1615
|
-
return out;
|
|
1616
|
-
}
|
|
1617
|
-
return [];
|
|
1618
|
-
});
|
|
1619
|
-
var splitAt = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1620
|
-
const input = Array.from(self);
|
|
1621
|
-
const _n = Math.floor(n2);
|
|
1622
|
-
if (isNonEmptyReadonlyArray(input)) {
|
|
1623
|
-
if (_n >= 1) {
|
|
1624
|
-
return splitNonEmptyAt(input, _n);
|
|
1625
|
-
}
|
|
1626
|
-
return [[], input];
|
|
1627
|
-
}
|
|
1628
|
-
return [input, []];
|
|
1629
|
-
});
|
|
1630
|
-
var splitNonEmptyAt = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1631
|
-
const _n = Math.max(1, Math.floor(n2));
|
|
1632
|
-
return _n >= self.length ? [copy(self), []] : [prepend(self.slice(1, _n), headNonEmpty(self)), self.slice(_n)];
|
|
1633
|
-
});
|
|
1634
|
-
var split = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1635
|
-
const input = fromIterable2(self);
|
|
1636
|
-
return chunksOf(input, Math.ceil(input.length / Math.floor(n2)));
|
|
1637
|
-
});
|
|
1638
|
-
var splitWhere = /* @__PURE__ */ dual(2, (self, predicate) => span(self, (a2, i2) => !predicate(a2, i2)));
|
|
1639
|
-
var copy = (self) => self.slice();
|
|
1640
|
-
var chunksOf = /* @__PURE__ */ dual(2, (self, n2) => {
|
|
1641
|
-
const input = fromIterable2(self);
|
|
1642
|
-
if (isNonEmptyReadonlyArray(input)) {
|
|
1643
|
-
return chop(input, splitNonEmptyAt(n2));
|
|
1644
|
-
}
|
|
1645
|
-
return [];
|
|
1646
|
-
});
|
|
1647
|
-
var groupWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => chop(self, (as2) => {
|
|
1648
|
-
const h2 = headNonEmpty(as2);
|
|
1649
|
-
const out = [h2];
|
|
1650
|
-
let i2 = 1;
|
|
1651
|
-
for (; i2 < as2.length; i2++) {
|
|
1652
|
-
const a2 = as2[i2];
|
|
1653
|
-
if (isEquivalent(a2, h2)) {
|
|
1654
|
-
out.push(a2);
|
|
1655
|
-
} else {
|
|
1656
|
-
break;
|
|
1657
|
-
}
|
|
1658
|
-
}
|
|
1659
|
-
return [out, as2.slice(i2)];
|
|
1660
|
-
}));
|
|
1661
|
-
var group = /* @__PURE__ */ groupWith(/* @__PURE__ */ equivalence());
|
|
1662
|
-
var groupBy = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1663
|
-
const out = {};
|
|
1664
|
-
for (const a2 of self) {
|
|
1665
|
-
const k2 = f2(a2);
|
|
1666
|
-
if (Object.prototype.hasOwnProperty.call(out, k2)) {
|
|
1667
|
-
out[k2].push(a2);
|
|
1668
|
-
} else {
|
|
1669
|
-
out[k2] = [a2];
|
|
1670
|
-
}
|
|
1671
|
-
}
|
|
1672
|
-
return out;
|
|
1673
|
-
});
|
|
1674
|
-
var unionWith = /* @__PURE__ */ dual(3, (self, that, isEquivalent) => {
|
|
1675
|
-
const a2 = fromIterable2(self);
|
|
1676
|
-
const b2 = fromIterable2(that);
|
|
1677
|
-
if (isNonEmptyReadonlyArray(a2)) {
|
|
1678
|
-
if (isNonEmptyReadonlyArray(b2)) {
|
|
1679
|
-
const dedupe2 = dedupeWith(isEquivalent);
|
|
1680
|
-
return dedupe2(appendAll(a2, b2));
|
|
1681
|
-
}
|
|
1682
|
-
return a2;
|
|
1683
|
-
}
|
|
1684
|
-
return b2;
|
|
1685
|
-
});
|
|
1686
|
-
var union = /* @__PURE__ */ dual(2, (self, that) => unionWith(self, that, _equivalence2));
|
|
1687
|
-
var intersectionWith = (isEquivalent) => {
|
|
1688
|
-
const has = containsWith2(isEquivalent);
|
|
1689
|
-
return dual(2, (self, that) => fromIterable2(self).filter((a2) => has(that, a2)));
|
|
1690
|
-
};
|
|
1691
|
-
var intersection = /* @__PURE__ */ intersectionWith(_equivalence2);
|
|
1692
|
-
var differenceWith = (isEquivalent) => {
|
|
1693
|
-
const has = containsWith2(isEquivalent);
|
|
1694
|
-
return dual(2, (self, that) => fromIterable2(self).filter((a2) => !has(that, a2)));
|
|
1695
|
-
};
|
|
1696
|
-
var difference = /* @__PURE__ */ differenceWith(_equivalence2);
|
|
1697
|
-
var empty2 = () => [];
|
|
1698
|
-
var of = (a2) => [a2];
|
|
1699
|
-
var map2 = /* @__PURE__ */ dual(2, (self, f2) => self.map(f2));
|
|
1700
|
-
var flatMap2 = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1701
|
-
if (isEmptyReadonlyArray(self)) {
|
|
1702
|
-
return [];
|
|
1703
|
-
}
|
|
1704
|
-
const out = [];
|
|
1705
|
-
for (let i2 = 0; i2 < self.length; i2++) {
|
|
1706
|
-
const inner = f2(self[i2], i2);
|
|
1707
|
-
for (let j2 = 0; j2 < inner.length; j2++) {
|
|
1708
|
-
out.push(inner[j2]);
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
return out;
|
|
1712
|
-
});
|
|
1713
|
-
var flatten2 = /* @__PURE__ */ flatMap2(identity);
|
|
1714
|
-
var filterMap2 = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1715
|
-
const as2 = fromIterable2(self);
|
|
1716
|
-
const out = [];
|
|
1717
|
-
for (let i2 = 0; i2 < as2.length; i2++) {
|
|
1718
|
-
const o2 = f2(as2[i2], i2);
|
|
1719
|
-
if (isSome2(o2)) {
|
|
1720
|
-
out.push(o2.value);
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
return out;
|
|
1724
|
-
});
|
|
1725
|
-
var filterMapWhile = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1726
|
-
let i2 = 0;
|
|
1727
|
-
const out = [];
|
|
1728
|
-
for (const a2 of self) {
|
|
1729
|
-
const b2 = f2(a2, i2);
|
|
1730
|
-
if (isSome2(b2)) {
|
|
1731
|
-
out.push(b2.value);
|
|
1732
|
-
} else {
|
|
1733
|
-
break;
|
|
1734
|
-
}
|
|
1735
|
-
i2++;
|
|
1736
|
-
}
|
|
1737
|
-
return out;
|
|
1738
|
-
});
|
|
1739
|
-
var partitionMap2 = /* @__PURE__ */ dual(2, (self, f2) => {
|
|
1740
|
-
const left2 = [];
|
|
1741
|
-
const right2 = [];
|
|
1742
|
-
const as2 = fromIterable2(self);
|
|
1743
|
-
for (let i2 = 0; i2 < as2.length; i2++) {
|
|
1744
|
-
const e2 = f2(as2[i2], i2);
|
|
1745
|
-
if (isLeft2(e2)) {
|
|
1746
|
-
left2.push(e2.left);
|
|
1747
|
-
} else {
|
|
1748
|
-
right2.push(e2.right);
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
return [left2, right2];
|
|
1752
|
-
});
|
|
1753
|
-
var getSomes = /* @__PURE__ */ filterMap2(identity);
|
|
1754
|
-
var getLefts = (self) => {
|
|
1755
|
-
const out = [];
|
|
1756
|
-
for (const a2 of self) {
|
|
1757
|
-
if (isLeft2(a2)) {
|
|
1758
|
-
out.push(a2.left);
|
|
1759
|
-
}
|
|
1760
|
-
}
|
|
1761
|
-
return out;
|
|
1762
|
-
};
|
|
1763
|
-
var getRights = (self) => {
|
|
1764
|
-
const out = [];
|
|
1765
|
-
for (const a2 of self) {
|
|
1766
|
-
if (isRight2(a2)) {
|
|
1767
|
-
out.push(a2.right);
|
|
1768
|
-
}
|
|
1769
|
-
}
|
|
1770
|
-
return out;
|
|
1771
|
-
};
|
|
1772
|
-
var filter2 = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
1773
|
-
const as2 = fromIterable2(self);
|
|
1774
|
-
const out = [];
|
|
1775
|
-
for (let i2 = 0; i2 < as2.length; i2++) {
|
|
1776
|
-
if (predicate(as2[i2], i2)) {
|
|
1777
|
-
out.push(as2[i2]);
|
|
1778
|
-
}
|
|
1779
|
-
}
|
|
1780
|
-
return out;
|
|
1781
|
-
});
|
|
1782
|
-
var partition = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
1783
|
-
const left2 = [];
|
|
1784
|
-
const right2 = [];
|
|
1785
|
-
const as2 = fromIterable2(self);
|
|
1786
|
-
for (let i2 = 0; i2 < as2.length; i2++) {
|
|
1787
|
-
if (predicate(as2[i2], i2)) {
|
|
1788
|
-
right2.push(as2[i2]);
|
|
1789
|
-
} else {
|
|
1790
|
-
left2.push(as2[i2]);
|
|
1791
|
-
}
|
|
1792
|
-
}
|
|
1793
|
-
return [left2, right2];
|
|
1794
|
-
});
|
|
1795
|
-
var separate = /* @__PURE__ */ partitionMap2(identity);
|
|
1796
|
-
var reduce = /* @__PURE__ */ dual(3, (self, b2, f2) => fromIterable2(self).reduce((b3, a2, i2) => f2(b3, a2, i2), b2));
|
|
1797
|
-
var reduceRight = /* @__PURE__ */ dual(3, (self, b2, f2) => fromIterable2(self).reduceRight((b3, a2, i2) => f2(b3, a2, i2), b2));
|
|
1798
|
-
var liftPredicate2 = (predicate) => (b2) => predicate(b2) ? [b2] : [];
|
|
1799
|
-
var liftOption = (f2) => (...a2) => fromOption2(f2(...a2));
|
|
1800
|
-
var fromNullable2 = (a2) => a2 == null ? empty2() : [a2];
|
|
1801
|
-
var liftNullable2 = (f2) => (...a2) => fromNullable2(f2(...a2));
|
|
1802
|
-
var flatMapNullable2 = /* @__PURE__ */ dual(2, (self, f2) => flatMap2(self, (a2) => fromNullable2(f2(a2))));
|
|
1803
|
-
var liftEither = (f2) => (...a2) => {
|
|
1804
|
-
const e2 = f2(...a2);
|
|
1805
|
-
return isLeft2(e2) ? [] : [e2.right];
|
|
1806
|
-
};
|
|
1807
|
-
var every2 = /* @__PURE__ */ dual(2, (self, refinement) => self.every(refinement));
|
|
1808
|
-
var some4 = /* @__PURE__ */ dual(2, (self, predicate) => self.some(predicate));
|
|
1809
|
-
var extend = /* @__PURE__ */ dual(2, (self, f2) => self.map((_2, i2, as2) => f2(as2.slice(i2))));
|
|
1810
|
-
var min2 = /* @__PURE__ */ dual(2, (self, O2) => self.reduce(min(O2)));
|
|
1811
|
-
var max2 = /* @__PURE__ */ dual(2, (self, O2) => self.reduce(max(O2)));
|
|
1812
|
-
var unfold = (b2, f2) => {
|
|
1813
|
-
const out = [];
|
|
1814
|
-
let next = b2;
|
|
1815
|
-
let o2;
|
|
1816
|
-
while (isSome2(o2 = f2(next))) {
|
|
1817
|
-
const [a2, b3] = o2.value;
|
|
1818
|
-
out.push(a2);
|
|
1819
|
-
next = b3;
|
|
1820
|
-
}
|
|
1821
|
-
return out;
|
|
1822
|
-
};
|
|
1823
|
-
var getOrder2 = array2;
|
|
1824
|
-
var getEquivalence2 = array;
|
|
1825
|
-
var forEach = /* @__PURE__ */ dual(2, (self, f2) => fromIterable2(self).forEach((a2, i2) => f2(a2, i2)));
|
|
1826
|
-
var dedupeWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
|
|
1827
|
-
const input = fromIterable2(self);
|
|
1828
|
-
if (isNonEmptyReadonlyArray(input)) {
|
|
1829
|
-
const out = [headNonEmpty(input)];
|
|
1830
|
-
const rest = tailNonEmpty(input);
|
|
1831
|
-
for (const r2 of rest) {
|
|
1832
|
-
if (out.every((a2) => !isEquivalent(r2, a2))) {
|
|
1833
|
-
out.push(r2);
|
|
1834
|
-
}
|
|
1835
|
-
}
|
|
1836
|
-
return out;
|
|
1837
|
-
}
|
|
1838
|
-
return [];
|
|
1839
|
-
});
|
|
1840
|
-
var dedupe = (self) => dedupeWith(self, equivalence());
|
|
1841
|
-
var dedupeAdjacentWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
|
|
1842
|
-
const out = [];
|
|
1843
|
-
let lastA = none2();
|
|
1844
|
-
for (const a2 of self) {
|
|
1845
|
-
if (isNone2(lastA) || !isEquivalent(a2, lastA.value)) {
|
|
1846
|
-
out.push(a2);
|
|
1847
|
-
lastA = some3(a2);
|
|
1848
|
-
}
|
|
1849
|
-
}
|
|
1850
|
-
return out;
|
|
1851
|
-
});
|
|
1852
|
-
var dedupeAdjacent = /* @__PURE__ */ dedupeAdjacentWith(/* @__PURE__ */ equivalence());
|
|
1853
|
-
var join = /* @__PURE__ */ dual(2, (self, sep) => fromIterable2(self).join(sep));
|
|
1854
|
-
var mapAccum = /* @__PURE__ */ dual(3, (self, s2, f2) => {
|
|
1855
|
-
let i2 = 0;
|
|
1856
|
-
let s1 = s2;
|
|
1857
|
-
const out = [];
|
|
1858
|
-
for (const a2 of self) {
|
|
1859
|
-
const r2 = f2(s1, a2, i2);
|
|
1860
|
-
s1 = r2[0];
|
|
1861
|
-
out.push(r2[1]);
|
|
1862
|
-
i2++;
|
|
1863
|
-
}
|
|
1864
|
-
return [s1, out];
|
|
1865
|
-
});
|
|
1866
|
-
var cartesianWith = /* @__PURE__ */ dual(3, (self, that, f2) => flatMap2(self, (a2) => map2(that, (b2) => f2(a2, b2))));
|
|
1867
|
-
var cartesian = /* @__PURE__ */ dual(2, (self, that) => cartesianWith(self, that, (a2, b2) => [a2, b2]));
|
|
1868
|
-
var Do2 = /* @__PURE__ */ of({});
|
|
1869
|
-
var bind3 = /* @__PURE__ */ bind(map2, flatMap2);
|
|
1870
|
-
var bindTo3 = /* @__PURE__ */ bindTo(map2);
|
|
1871
|
-
var let_3 = /* @__PURE__ */ let_(map2);
|
|
1872
|
-
|
|
1873
|
-
// ../../../node_modules/.pnpm/ts-pattern@5.2.0/node_modules/ts-pattern/dist/index.js
|
|
1874
|
-
var t = Symbol.for("@ts-pattern/matcher");
|
|
1875
|
-
var e = Symbol.for("@ts-pattern/isVariadic");
|
|
1876
|
-
var n = "@ts-pattern/anonymous-select-key";
|
|
1877
|
-
var r = (t2) => Boolean(t2 && "object" == typeof t2);
|
|
1878
|
-
var i = (e2) => e2 && !!e2[t];
|
|
1879
|
-
var o = (n2, s2, c2) => {
|
|
1880
|
-
if (i(n2)) {
|
|
1881
|
-
const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(s2);
|
|
1882
|
-
return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2;
|
|
1883
|
-
}
|
|
1884
|
-
if (r(n2)) {
|
|
1885
|
-
if (!r(s2)) return false;
|
|
1886
|
-
if (Array.isArray(n2)) {
|
|
1887
|
-
if (!Array.isArray(s2)) return false;
|
|
1888
|
-
let t2 = [], r2 = [], a2 = [];
|
|
1889
|
-
for (const o2 of n2.keys()) {
|
|
1890
|
-
const s3 = n2[o2];
|
|
1891
|
-
i(s3) && s3[e] ? a2.push(s3) : a2.length ? r2.push(s3) : t2.push(s3);
|
|
1892
|
-
}
|
|
1893
|
-
if (a2.length) {
|
|
1894
|
-
if (a2.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
|
|
1895
|
-
if (s2.length < t2.length + r2.length) return false;
|
|
1896
|
-
const e2 = s2.slice(0, t2.length), n3 = 0 === r2.length ? [] : s2.slice(-r2.length), i2 = s2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
|
|
1897
|
-
return t2.every((t3, n4) => o(t3, e2[n4], c2)) && r2.every((t3, e3) => o(t3, n3[e3], c2)) && (0 === a2.length || o(a2[0], i2, c2));
|
|
1898
|
-
}
|
|
1899
|
-
return n2.length === s2.length && n2.every((t3, e2) => o(t3, s2[e2], c2));
|
|
1900
|
-
}
|
|
1901
|
-
return Object.keys(n2).every((e2) => {
|
|
1902
|
-
const r2 = n2[e2];
|
|
1903
|
-
return (e2 in s2 || i(a2 = r2) && "optional" === a2[t]().matcherType) && o(r2, s2[e2], c2);
|
|
1904
|
-
var a2;
|
|
1905
|
-
});
|
|
1906
|
-
}
|
|
1907
|
-
return Object.is(s2, n2);
|
|
1908
|
-
};
|
|
1909
|
-
var s = (e2) => {
|
|
1910
|
-
var n2, o2, a2;
|
|
1911
|
-
return r(e2) ? i(e2) ? null != (n2 = null == (o2 = (a2 = e2[t]()).getSelectionKeys) ? void 0 : o2.call(a2)) ? n2 : [] : Array.isArray(e2) ? c(e2, s) : c(Object.values(e2), s) : [];
|
|
1912
|
-
};
|
|
1913
|
-
var c = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []);
|
|
1914
|
-
function a(...t2) {
|
|
1915
|
-
if (1 === t2.length) {
|
|
1916
|
-
const [e2] = t2;
|
|
1917
|
-
return (t3) => o(e2, t3, () => {
|
|
1918
|
-
});
|
|
1919
|
-
}
|
|
1920
|
-
if (2 === t2.length) {
|
|
1921
|
-
const [e2, n2] = t2;
|
|
1922
|
-
return o(e2, n2, () => {
|
|
1923
|
-
});
|
|
1924
|
-
}
|
|
1925
|
-
throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t2.length}.`);
|
|
1926
|
-
}
|
|
1927
|
-
function u(t2) {
|
|
1928
|
-
return Object.assign(t2, { optional: () => l(t2), and: (e2) => m(t2, e2), or: (e2) => d(t2, e2), select: (e2) => void 0 === e2 ? p(t2) : p(e2, t2) });
|
|
1929
|
-
}
|
|
1930
|
-
function h(t2) {
|
|
1931
|
-
return Object.assign(((t3) => Object.assign(t3, { [Symbol.iterator]() {
|
|
1932
|
-
let n2 = 0;
|
|
1933
|
-
const r2 = [{ value: Object.assign(t3, { [e]: true }), done: false }, { done: true, value: void 0 }];
|
|
1934
|
-
return { next: () => {
|
|
1935
|
-
var t4;
|
|
1936
|
-
return null != (t4 = r2[n2++]) ? t4 : r2.at(-1);
|
|
1937
|
-
} };
|
|
1938
|
-
} }))(t2), { optional: () => h(l(t2)), select: (e2) => h(void 0 === e2 ? p(t2) : p(e2, t2)) });
|
|
1939
|
-
}
|
|
1940
|
-
function l(e2) {
|
|
1941
|
-
return u({ [t]: () => ({ match: (t2) => {
|
|
1942
|
-
let n2 = {};
|
|
1943
|
-
const r2 = (t3, e3) => {
|
|
1944
|
-
n2[t3] = e3;
|
|
1945
|
-
};
|
|
1946
|
-
return void 0 === t2 ? (s(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: o(e2, t2, r2), selections: n2 };
|
|
1947
|
-
}, getSelectionKeys: () => s(e2), matcherType: "optional" }) });
|
|
1948
|
-
}
|
|
1949
|
-
var f = (t2, e2) => {
|
|
1950
|
-
for (const n2 of t2) if (!e2(n2)) return false;
|
|
1951
|
-
return true;
|
|
1952
|
-
};
|
|
1953
|
-
var g = (t2, e2) => {
|
|
1954
|
-
for (const [n2, r2] of t2.entries()) if (!e2(r2, n2)) return false;
|
|
1955
|
-
return true;
|
|
1956
|
-
};
|
|
1957
|
-
function m(...e2) {
|
|
1958
|
-
return u({ [t]: () => ({ match: (t2) => {
|
|
1959
|
-
let n2 = {};
|
|
1960
|
-
const r2 = (t3, e3) => {
|
|
1961
|
-
n2[t3] = e3;
|
|
1962
|
-
};
|
|
1963
|
-
return { matched: e2.every((e3) => o(e3, t2, r2)), selections: n2 };
|
|
1964
|
-
}, getSelectionKeys: () => c(e2, s), matcherType: "and" }) });
|
|
1965
|
-
}
|
|
1966
|
-
function d(...e2) {
|
|
1967
|
-
return u({ [t]: () => ({ match: (t2) => {
|
|
1968
|
-
let n2 = {};
|
|
1969
|
-
const r2 = (t3, e3) => {
|
|
1970
|
-
n2[t3] = e3;
|
|
1971
|
-
};
|
|
1972
|
-
return c(e2, s).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => o(e3, t2, r2)), selections: n2 };
|
|
1973
|
-
}, getSelectionKeys: () => c(e2, s), matcherType: "or" }) });
|
|
1974
|
-
}
|
|
1975
|
-
function y(e2) {
|
|
1976
|
-
return { [t]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) };
|
|
1977
|
-
}
|
|
1978
|
-
function p(...e2) {
|
|
1979
|
-
const r2 = "string" == typeof e2[0] ? e2[0] : void 0, i2 = 2 === e2.length ? e2[1] : "string" == typeof e2[0] ? void 0 : e2[0];
|
|
1980
|
-
return u({ [t]: () => ({ match: (t2) => {
|
|
1981
|
-
let e3 = { [null != r2 ? r2 : n]: t2 };
|
|
1982
|
-
return { matched: void 0 === i2 || o(i2, t2, (t3, n2) => {
|
|
1983
|
-
e3[t3] = n2;
|
|
1984
|
-
}), selections: e3 };
|
|
1985
|
-
}, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : s(i2)) }) });
|
|
1986
|
-
}
|
|
1987
|
-
function v(t2) {
|
|
1988
|
-
return "number" == typeof t2;
|
|
1989
|
-
}
|
|
1990
|
-
function b(t2) {
|
|
1991
|
-
return "string" == typeof t2;
|
|
1992
|
-
}
|
|
1993
|
-
function w(t2) {
|
|
1994
|
-
return "bigint" == typeof t2;
|
|
1995
|
-
}
|
|
1996
|
-
var S = u(y(function(t2) {
|
|
1997
|
-
return true;
|
|
1998
|
-
}));
|
|
1999
|
-
var O = S;
|
|
2000
|
-
var j = (t2) => Object.assign(u(t2), { startsWith: (e2) => {
|
|
2001
|
-
return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.startsWith(n2)))));
|
|
2002
|
-
var n2;
|
|
2003
|
-
}, endsWith: (e2) => {
|
|
2004
|
-
return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.endsWith(n2)))));
|
|
2005
|
-
var n2;
|
|
2006
|
-
}, minLength: (e2) => j(m(t2, ((t3) => y((e3) => b(e3) && e3.length >= t3))(e2))), length: (e2) => j(m(t2, ((t3) => y((e3) => b(e3) && e3.length === t3))(e2))), maxLength: (e2) => j(m(t2, ((t3) => y((e3) => b(e3) && e3.length <= t3))(e2))), includes: (e2) => {
|
|
2007
|
-
return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.includes(n2)))));
|
|
2008
|
-
var n2;
|
|
2009
|
-
}, regex: (e2) => {
|
|
2010
|
-
return j(m(t2, (n2 = e2, y((t3) => b(t3) && Boolean(t3.match(n2))))));
|
|
2011
|
-
var n2;
|
|
2012
|
-
} });
|
|
2013
|
-
var E = j(y(b));
|
|
2014
|
-
var K = (t2) => Object.assign(u(t2), { between: (e2, n2) => K(m(t2, ((t3, e3) => y((n3) => v(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 < t3))(e2))), gt: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 > t3))(e2))), lte: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 <= t3))(e2))), gte: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 >= t3))(e2))), int: () => K(m(t2, y((t3) => v(t3) && Number.isInteger(t3)))), finite: () => K(m(t2, y((t3) => v(t3) && Number.isFinite(t3)))), positive: () => K(m(t2, y((t3) => v(t3) && t3 > 0))), negative: () => K(m(t2, y((t3) => v(t3) && t3 < 0))) });
|
|
2015
|
-
var x = K(y(v));
|
|
2016
|
-
var A = (t2) => Object.assign(u(t2), { between: (e2, n2) => A(m(t2, ((t3, e3) => y((n3) => w(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 < t3))(e2))), gt: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 > t3))(e2))), lte: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 <= t3))(e2))), gte: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 >= t3))(e2))), positive: () => A(m(t2, y((t3) => w(t3) && t3 > 0))), negative: () => A(m(t2, y((t3) => w(t3) && t3 < 0))) });
|
|
2017
|
-
var P = A(y(w));
|
|
2018
|
-
var T = u(y(function(t2) {
|
|
2019
|
-
return "boolean" == typeof t2;
|
|
2020
|
-
}));
|
|
2021
|
-
var k = u(y(function(t2) {
|
|
2022
|
-
return "symbol" == typeof t2;
|
|
2023
|
-
}));
|
|
2024
|
-
var B = u(y(function(t2) {
|
|
2025
|
-
return null == t2;
|
|
2026
|
-
}));
|
|
2027
|
-
var _ = u(y(function(t2) {
|
|
2028
|
-
return null != t2;
|
|
2029
|
-
}));
|
|
2030
|
-
var N = { __proto__: null, matcher: t, optional: l, array: function(...e2) {
|
|
2031
|
-
return h({ [t]: () => ({ match: (t2) => {
|
|
2032
|
-
if (!Array.isArray(t2)) return { matched: false };
|
|
2033
|
-
if (0 === e2.length) return { matched: true };
|
|
2034
|
-
const n2 = e2[0];
|
|
2035
|
-
let r2 = {};
|
|
2036
|
-
if (0 === t2.length) return s(n2).forEach((t3) => {
|
|
2037
|
-
r2[t3] = [];
|
|
2038
|
-
}), { matched: true, selections: r2 };
|
|
2039
|
-
const i2 = (t3, e3) => {
|
|
2040
|
-
r2[t3] = (r2[t3] || []).concat([e3]);
|
|
2041
|
-
};
|
|
2042
|
-
return { matched: t2.every((t3) => o(n2, t3, i2)), selections: r2 };
|
|
2043
|
-
}, getSelectionKeys: () => 0 === e2.length ? [] : s(e2[0]) }) });
|
|
2044
|
-
}, set: function(...e2) {
|
|
2045
|
-
return u({ [t]: () => ({ match: (t2) => {
|
|
2046
|
-
if (!(t2 instanceof Set)) return { matched: false };
|
|
2047
|
-
let n2 = {};
|
|
2048
|
-
if (0 === t2.size) return { matched: true, selections: n2 };
|
|
2049
|
-
if (0 === e2.length) return { matched: true };
|
|
2050
|
-
const r2 = (t3, e3) => {
|
|
2051
|
-
n2[t3] = (n2[t3] || []).concat([e3]);
|
|
2052
|
-
}, i2 = e2[0];
|
|
2053
|
-
return { matched: f(t2, (t3) => o(i2, t3, r2)), selections: n2 };
|
|
2054
|
-
}, getSelectionKeys: () => 0 === e2.length ? [] : s(e2[0]) }) });
|
|
2055
|
-
}, map: function(...e2) {
|
|
2056
|
-
return u({ [t]: () => ({ match: (t2) => {
|
|
2057
|
-
if (!(t2 instanceof Map)) return { matched: false };
|
|
2058
|
-
let n2 = {};
|
|
2059
|
-
if (0 === t2.size) return { matched: true, selections: n2 };
|
|
2060
|
-
const r2 = (t3, e3) => {
|
|
2061
|
-
n2[t3] = (n2[t3] || []).concat([e3]);
|
|
2062
|
-
};
|
|
2063
|
-
if (0 === e2.length) return { matched: true };
|
|
2064
|
-
var i2;
|
|
2065
|
-
if (1 === e2.length) throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null == (i2 = e2[0]) ? void 0 : i2.toString()}`);
|
|
2066
|
-
const [s2, c2] = e2;
|
|
2067
|
-
return { matched: g(t2, (t3, e3) => {
|
|
2068
|
-
const n3 = o(s2, e3, r2), i3 = o(c2, t3, r2);
|
|
2069
|
-
return n3 && i3;
|
|
2070
|
-
}), selections: n2 };
|
|
2071
|
-
}, getSelectionKeys: () => 0 === e2.length ? [] : [...s(e2[0]), ...s(e2[1])] }) });
|
|
2072
|
-
}, intersection: m, union: d, not: function(e2) {
|
|
2073
|
-
return u({ [t]: () => ({ match: (t2) => ({ matched: !o(e2, t2, () => {
|
|
2074
|
-
}) }), getSelectionKeys: () => [], matcherType: "not" }) });
|
|
2075
|
-
}, when: y, select: p, any: S, _: O, string: E, number: x, bigint: P, boolean: T, symbol: k, nullish: B, nonNullable: _, instanceOf: function(t2) {
|
|
2076
|
-
return u(y(/* @__PURE__ */ function(t3) {
|
|
2077
|
-
return (e2) => e2 instanceof t3;
|
|
2078
|
-
}(t2)));
|
|
2079
|
-
}, shape: function(t2) {
|
|
2080
|
-
return u(y(a(t2)));
|
|
2081
|
-
} };
|
|
2082
|
-
var W = { matched: false, value: void 0 };
|
|
2083
|
-
function $(t2) {
|
|
2084
|
-
return new z(t2, W);
|
|
2085
|
-
}
|
|
2086
|
-
var z = class _z {
|
|
2087
|
-
constructor(t2, e2) {
|
|
2088
|
-
this.input = void 0, this.state = void 0, this.input = t2, this.state = e2;
|
|
2089
|
-
}
|
|
2090
|
-
with(...t2) {
|
|
2091
|
-
if (this.state.matched) return this;
|
|
2092
|
-
const e2 = t2[t2.length - 1], r2 = [t2[0]];
|
|
2093
|
-
let i2;
|
|
2094
|
-
3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
|
|
2095
|
-
let s2 = false, c2 = {};
|
|
2096
|
-
const a2 = (t3, e3) => {
|
|
2097
|
-
s2 = true, c2[t3] = e3;
|
|
2098
|
-
}, u2 = !r2.some((t3) => o(t3, this.input, a2)) || i2 && !Boolean(i2(this.input)) ? W : { matched: true, value: e2(s2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
|
|
2099
|
-
return new _z(this.input, u2);
|
|
2100
|
-
}
|
|
2101
|
-
when(t2, e2) {
|
|
2102
|
-
if (this.state.matched) return this;
|
|
2103
|
-
const n2 = Boolean(t2(this.input));
|
|
2104
|
-
return new _z(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : W);
|
|
2105
|
-
}
|
|
2106
|
-
otherwise(t2) {
|
|
2107
|
-
return this.state.matched ? this.state.value : t2(this.input);
|
|
2108
|
-
}
|
|
2109
|
-
exhaustive() {
|
|
2110
|
-
if (this.state.matched) return this.state.value;
|
|
2111
|
-
let t2;
|
|
2112
|
-
try {
|
|
2113
|
-
t2 = JSON.stringify(this.input);
|
|
2114
|
-
} catch (e2) {
|
|
2115
|
-
t2 = this.input;
|
|
2116
|
-
}
|
|
2117
|
-
throw new Error(`Pattern matching error: no pattern matches value ${t2}`);
|
|
2118
|
-
}
|
|
2119
|
-
run() {
|
|
2120
|
-
return this.exhaustive();
|
|
2121
|
-
}
|
|
2122
|
-
returnType() {
|
|
2123
|
-
return this;
|
|
2124
|
-
}
|
|
2125
|
-
};
|
|
2126
|
-
|
|
2127
|
-
// src/prop/get-prop.ts
|
|
2128
31
|
var { getStaticValue } = ESLintCommunityESLintUtils;
|
|
2129
32
|
function getPropName(node) {
|
|
2130
|
-
return
|
|
33
|
+
return match(node.name).when(is(NodeType.JSXIdentifier), (n) => n.name).when(is(NodeType.JSXNamespacedName), (n) => `${n.namespace.name}:${n.name.name}`).exhaustive();
|
|
2131
34
|
}
|
|
2132
35
|
function getProp(props, propName, context, initialScope) {
|
|
2133
36
|
return findPropInAttributes(props, context, initialScope)(propName);
|
|
@@ -2136,77 +39,75 @@ function getPropValue(attribute, context) {
|
|
|
2136
39
|
const initialScope = context.sourceCode.getScope(attribute);
|
|
2137
40
|
if (attribute.type === NodeType.JSXAttribute && "value" in attribute) {
|
|
2138
41
|
const { value } = attribute;
|
|
2139
|
-
if (value === null) return
|
|
2140
|
-
if (value.type === NodeType.Literal) return
|
|
2141
|
-
if (value.type === NodeType.JSXExpressionContainer) return
|
|
2142
|
-
return
|
|
42
|
+
if (value === null) return Option.none();
|
|
43
|
+
if (value.type === NodeType.Literal) return Option.some(getStaticValue(value, initialScope));
|
|
44
|
+
if (value.type === NodeType.JSXExpressionContainer) return Option.some(getStaticValue(value.expression, initialScope));
|
|
45
|
+
return Option.none();
|
|
2143
46
|
}
|
|
2144
47
|
const { argument } = attribute;
|
|
2145
|
-
return
|
|
48
|
+
return Option.some(getStaticValue(argument, initialScope));
|
|
2146
49
|
}
|
|
2147
50
|
function findPropInProperties(properties, context, initialScope, seenProps = []) {
|
|
2148
51
|
return (propName) => {
|
|
2149
|
-
return
|
|
52
|
+
return Option.fromNullable(
|
|
2150
53
|
properties.find((prop) => {
|
|
2151
|
-
return
|
|
54
|
+
return match(prop).when(is(NodeType.Property), (prop2) => {
|
|
2152
55
|
return "name" in prop2.key && prop2.key.name === propName;
|
|
2153
56
|
}).when(is(NodeType.SpreadElement), (prop2) => {
|
|
2154
|
-
return
|
|
57
|
+
return match(prop2.argument).when(is(NodeType.Identifier), (argument) => {
|
|
2155
58
|
const { name } = argument;
|
|
2156
|
-
const maybeInit =
|
|
59
|
+
const maybeInit = Option.flatMap(
|
|
2157
60
|
findVariable(name, initialScope),
|
|
2158
61
|
getVariableInit(0)
|
|
2159
62
|
);
|
|
2160
|
-
if (
|
|
2161
|
-
const
|
|
2162
|
-
if (
|
|
63
|
+
if (Option.isNone(maybeInit)) return false;
|
|
64
|
+
const init = maybeInit.value;
|
|
65
|
+
if (init.type !== NodeType.ObjectExpression) return false;
|
|
2163
66
|
if (seenProps.includes(name)) return false;
|
|
2164
|
-
return
|
|
2165
|
-
findPropInProperties(
|
|
67
|
+
return Option.isSome(
|
|
68
|
+
findPropInProperties(init.properties, context, initialScope, [...seenProps, name])(propName)
|
|
2166
69
|
);
|
|
2167
70
|
}).when(is(NodeType.ObjectExpression), (argument) => {
|
|
2168
|
-
return
|
|
71
|
+
return Option.isSome(findPropInProperties(argument.properties, context, initialScope, seenProps)(propName));
|
|
2169
72
|
}).when(is(NodeType.MemberExpression), () => {
|
|
2170
73
|
}).when(is(NodeType.CallExpression), () => {
|
|
2171
|
-
}).otherwise(
|
|
74
|
+
}).otherwise(Function.constFalse);
|
|
2172
75
|
}).when(is(NodeType.RestElement), () => {
|
|
2173
76
|
return false;
|
|
2174
|
-
}).otherwise(
|
|
77
|
+
}).otherwise(Function.constFalse);
|
|
2175
78
|
})
|
|
2176
79
|
);
|
|
2177
80
|
};
|
|
2178
81
|
}
|
|
2179
82
|
function findPropInAttributes(attributes, context, initialScope) {
|
|
2180
83
|
return (propName) => {
|
|
2181
|
-
return
|
|
84
|
+
return Option.fromNullable(
|
|
2182
85
|
attributes.find((attr) => {
|
|
2183
|
-
return
|
|
2184
|
-
return
|
|
86
|
+
return match(attr).when(is(NodeType.JSXAttribute), (attr2) => getPropName(attr2) === propName).when(is(NodeType.JSXSpreadAttribute), (attr2) => {
|
|
87
|
+
return match(attr2.argument).with({ type: NodeType.Identifier }, (argument) => {
|
|
2185
88
|
const { name } = argument;
|
|
2186
|
-
const maybeInit =
|
|
89
|
+
const maybeInit = Option.flatMap(
|
|
2187
90
|
findVariable(name, initialScope),
|
|
2188
91
|
getVariableInit(0)
|
|
2189
92
|
);
|
|
2190
|
-
if (
|
|
2191
|
-
const
|
|
2192
|
-
if (!("properties" in
|
|
2193
|
-
return
|
|
93
|
+
if (Option.isNone(maybeInit)) return false;
|
|
94
|
+
const init = maybeInit.value;
|
|
95
|
+
if (!("properties" in init)) return false;
|
|
96
|
+
return Option.isSome(findPropInProperties(init.properties, context, initialScope)(propName));
|
|
2194
97
|
}).when(is(NodeType.ObjectExpression), (argument) => {
|
|
2195
|
-
return
|
|
98
|
+
return Option.isSome(findPropInProperties(argument.properties, context, initialScope)(propName));
|
|
2196
99
|
}).when(is(NodeType.MemberExpression), () => {
|
|
2197
100
|
return false;
|
|
2198
101
|
}).when(is(NodeType.CallExpression), () => {
|
|
2199
102
|
return false;
|
|
2200
|
-
}).otherwise(
|
|
2201
|
-
}).otherwise(
|
|
103
|
+
}).otherwise(Function.constFalse);
|
|
104
|
+
}).otherwise(Function.constFalse);
|
|
2202
105
|
})
|
|
2203
106
|
);
|
|
2204
107
|
};
|
|
2205
108
|
}
|
|
2206
|
-
|
|
2207
|
-
// src/prop/has-prop.ts
|
|
2208
109
|
function hasProp(attributes, propName, context, initialScope) {
|
|
2209
|
-
return
|
|
110
|
+
return Option.isSome(findPropInAttributes(attributes, context, initialScope)(propName));
|
|
2210
111
|
}
|
|
2211
112
|
function hasAnyProp(attributes, propNames, context, initialScope) {
|
|
2212
113
|
return propNames.some((propName) => hasProp(attributes, propName, context, initialScope));
|
|
@@ -2214,7 +115,7 @@ function hasAnyProp(attributes, propNames, context, initialScope) {
|
|
|
2214
115
|
function hasEveryProp(attributes, propNames, context, initialScope) {
|
|
2215
116
|
return propNames.every((propName) => hasProp(attributes, propName, context, initialScope));
|
|
2216
117
|
}
|
|
2217
|
-
function traverseUpProp(node, predicate =
|
|
118
|
+
function traverseUpProp(node, predicate = Function.constTrue) {
|
|
2218
119
|
const guard = (node2) => {
|
|
2219
120
|
return node2.type === NodeType.JSXAttribute && predicate(node2);
|
|
2220
121
|
};
|
|
@@ -2224,7 +125,7 @@ function traverseUpProp(node, predicate = Function_exports.constTrue) {
|
|
|
2224
125
|
// src/prop/misc.ts
|
|
2225
126
|
function isInsidePropValue(node) {
|
|
2226
127
|
if (isStringLiteral(node)) return node.parent.type === NodeType.JSXAttribute;
|
|
2227
|
-
return
|
|
128
|
+
return Option.isSome(traverseUpProp(node, (n) => n.value?.type === NodeType.JSXExpressionContainer));
|
|
2228
129
|
}
|
|
2229
130
|
|
|
2230
131
|
// src/element/is.ts
|
|
@@ -2240,22 +141,20 @@ function isBuiltInElement(node) {
|
|
|
2240
141
|
if (node.type !== NodeType.JSXElement) return false;
|
|
2241
142
|
return node.openingElement.name.type === NodeType.JSXIdentifier && node.openingElement.name.name.toLowerCase() === node.openingElement.name.name && /^[a-z]/u.test(node.openingElement.name.name);
|
|
2242
143
|
}
|
|
2243
|
-
|
|
2244
|
-
// src/pragma.ts
|
|
2245
144
|
var RE_JSX_ANNOTATION_REGEX = /@jsx\s+(\S+)/u;
|
|
2246
145
|
var RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
|
|
2247
146
|
function getJSXPragmaFromContext(context) {
|
|
2248
147
|
const { sourceCode } = context;
|
|
2249
|
-
return
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
148
|
+
return Function.pipe(
|
|
149
|
+
Array$1.findFirst(sourceCode.getAllComments(), (node) => RE_JSX_ANNOTATION_REGEX.test(node.value)),
|
|
150
|
+
Option.map(({ value }) => RE_JSX_ANNOTATION_REGEX.exec(value)),
|
|
151
|
+
Option.flatMapNullable((matches) => matches?.[1]),
|
|
152
|
+
Option.filter((pragma) => RE_JS_IDENTIFIER_REGEX.test(pragma))
|
|
2254
153
|
);
|
|
2255
154
|
}
|
|
2256
155
|
var isLiteral = isOneOf([NodeType.Literal, NodeType.JSXText]);
|
|
2257
156
|
function isWhiteSpace(node) {
|
|
2258
|
-
return
|
|
157
|
+
return Predicate.isString(node.value) && node.value.trim() === "";
|
|
2259
158
|
}
|
|
2260
159
|
function isLineBreak(node) {
|
|
2261
160
|
return isLiteral(node) && isWhiteSpace(node) && isMultiLine(node);
|
|
@@ -2279,19 +178,19 @@ var JSXValueHint = {
|
|
|
2279
178
|
var DEFAULT_JSX_VALUE_HINT = JSXValueHint.SkipUndefinedLiteral | JSXValueHint.SkipBooleanLiteral;
|
|
2280
179
|
function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
|
|
2281
180
|
if (!node) return false;
|
|
2282
|
-
return
|
|
2283
|
-
return
|
|
181
|
+
return match(node).with({ type: NodeType.JSXElement }, Function.constTrue).with({ type: NodeType.JSXFragment }, Function.constTrue).with({ type: NodeType.JSXMemberExpression }, Function.constTrue).with({ type: NodeType.JSXNamespacedName }, Function.constTrue).with({ type: NodeType.Literal }, (node2) => {
|
|
182
|
+
return match(node2.value).with(null, () => !(hint & JSXValueHint.SkipNullLiteral)).with(P.boolean, () => !(hint & JSXValueHint.SkipBooleanLiteral)).with(P.string, () => !(hint & JSXValueHint.SkipStringLiteral)).with(P.number, () => !(hint & JSXValueHint.SkipNumberLiteral)).otherwise(Function.constFalse);
|
|
2284
183
|
}).with({ type: NodeType.TemplateLiteral }, () => !(hint & JSXValueHint.SkipStringLiteral)).with({ type: NodeType.ArrayExpression }, (node2) => {
|
|
2285
|
-
if (hint & JSXValueHint.StrictArray) return node2.elements.every((
|
|
2286
|
-
return node2.elements.some((
|
|
184
|
+
if (hint & JSXValueHint.StrictArray) return node2.elements.every((n) => isJSXValue(n, context, hint));
|
|
185
|
+
return node2.elements.some((n) => isJSXValue(n, context, hint));
|
|
2287
186
|
}).with({ type: NodeType.ConditionalExpression }, (node2) => {
|
|
2288
187
|
function leftHasJSX(node3) {
|
|
2289
188
|
if (Array.isArray(node3.consequent)) {
|
|
2290
189
|
if (node3.consequent.length === 0) return !(hint & JSXValueHint.SkipEmptyArray);
|
|
2291
190
|
if (hint & JSXValueHint.StrictArray) {
|
|
2292
|
-
return node3.consequent.every((
|
|
191
|
+
return node3.consequent.every((n) => isJSXValue(n, context, hint));
|
|
2293
192
|
}
|
|
2294
|
-
return node3.consequent.some((
|
|
193
|
+
return node3.consequent.some((n) => isJSXValue(n, context, hint));
|
|
2295
194
|
}
|
|
2296
195
|
return isJSXValue(node3.consequent, context, hint);
|
|
2297
196
|
}
|
|
@@ -2312,19 +211,19 @@ function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
|
|
|
2312
211
|
return isJSXValue(exp, context, hint);
|
|
2313
212
|
}).with({ type: NodeType.CallExpression }, (node2) => {
|
|
2314
213
|
if (hint & JSXValueHint.SkipCreateElement) return false;
|
|
2315
|
-
return
|
|
214
|
+
return match(node2.callee).with({ type: NodeType.Identifier, name: "createElement" }, Function.constTrue).with({ type: NodeType.MemberExpression, property: { name: "createElement" } }, Function.constTrue).otherwise(Function.constFalse);
|
|
2316
215
|
}).with({ type: NodeType.Identifier }, (node2) => {
|
|
2317
216
|
const { name } = node2;
|
|
2318
217
|
if (name === "undefined") return !(hint & JSXValueHint.SkipUndefinedLiteral);
|
|
2319
218
|
if (isJSXTagNameExpression(node2)) return true;
|
|
2320
219
|
const initialScope = context.sourceCode.getScope(node2);
|
|
2321
220
|
const maybeVariable = findVariable(name, initialScope);
|
|
2322
|
-
return
|
|
221
|
+
return Function.pipe(
|
|
2323
222
|
maybeVariable,
|
|
2324
|
-
|
|
2325
|
-
|
|
223
|
+
Option.flatMap(getVariableInit(0)),
|
|
224
|
+
Option.exists((n) => isJSXValue(n, context, hint))
|
|
2326
225
|
);
|
|
2327
|
-
}).otherwise(
|
|
226
|
+
}).otherwise(Function.constFalse);
|
|
2328
227
|
}
|
|
2329
228
|
|
|
2330
229
|
export { DEFAULT_JSX_VALUE_HINT, JSXValueHint, elementType, findPropInAttributes, findPropInProperties, getJSXPragmaFromContext, getProp, getPropName, getPropValue, hasAnyProp, hasEveryProp, hasProp, isBuiltInElement, isInsidePropValue, isJSXValue, isKeyedElement, isLineBreak, isLiteral, isPaddingSpaces, isUserDefinedElement, isWhiteSpace, traverseUpProp };
|