@effect/language-service 0.75.1 → 0.76.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.
@@ -27,15 +27,44 @@ __export(effect_lsp_patch_utils_exports, {
27
27
  });
28
28
  module.exports = __toCommonJS(effect_lsp_patch_utils_exports);
29
29
 
30
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/Function.js
31
- var isFunction = (input) => typeof input === "function";
30
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Pipeable.js
31
+ var pipeArguments = (self, args3) => {
32
+ switch (args3.length) {
33
+ case 0:
34
+ return self;
35
+ case 1:
36
+ return args3[0](self);
37
+ case 2:
38
+ return args3[1](args3[0](self));
39
+ case 3:
40
+ return args3[2](args3[1](args3[0](self)));
41
+ case 4:
42
+ return args3[3](args3[2](args3[1](args3[0](self))));
43
+ case 5:
44
+ return args3[4](args3[3](args3[2](args3[1](args3[0](self)))));
45
+ case 6:
46
+ return args3[5](args3[4](args3[3](args3[2](args3[1](args3[0](self))))));
47
+ case 7:
48
+ return args3[6](args3[5](args3[4](args3[3](args3[2](args3[1](args3[0](self)))))));
49
+ case 8:
50
+ return args3[7](args3[6](args3[5](args3[4](args3[3](args3[2](args3[1](args3[0](self))))))));
51
+ case 9:
52
+ return args3[8](args3[7](args3[6](args3[5](args3[4](args3[3](args3[2](args3[1](args3[0](self)))))))));
53
+ default: {
54
+ let ret = self;
55
+ for (let i = 0, len = args3.length; i < len; i++) {
56
+ ret = args3[i](ret);
57
+ }
58
+ return ret;
59
+ }
60
+ }
61
+ };
62
+
63
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Function.js
32
64
  var dual = function(arity, body) {
33
65
  if (typeof arity === "function") {
34
66
  return function() {
35
- if (arity(arguments)) {
36
- return body.apply(this, arguments);
37
- }
38
- return (self) => body(self, ...arguments);
67
+ return arity(arguments) ? body.apply(this, arguments) : (self) => body(self, ...arguments);
39
68
  };
40
69
  }
41
70
  switch (arity) {
@@ -60,32 +89,14 @@ var dual = function(arity, body) {
60
89
  return body(self, a, b);
61
90
  };
62
91
  };
63
- case 4:
64
- return function(a, b, c, d) {
65
- if (arguments.length >= 4) {
66
- return body(a, b, c, d);
67
- }
68
- return function(self) {
69
- return body(self, a, b, c);
70
- };
71
- };
72
- case 5:
73
- return function(a, b, c, d, e) {
74
- if (arguments.length >= 5) {
75
- return body(a, b, c, d, e);
76
- }
77
- return function(self) {
78
- return body(self, a, b, c, d);
79
- };
80
- };
81
92
  default:
82
93
  return function() {
83
94
  if (arguments.length >= arity) {
84
95
  return body.apply(this, arguments);
85
96
  }
86
- const args2 = arguments;
97
+ const args3 = arguments;
87
98
  return function(self) {
88
- return body(self, ...args2);
99
+ return body(self, ...args3);
89
100
  };
90
101
  };
91
102
  }
@@ -93,189 +104,57 @@ var dual = function(arity, body) {
93
104
  var identity = (a) => a;
94
105
  var constant = (value) => () => value;
95
106
  var constUndefined = /* @__PURE__ */ constant(void 0);
96
- function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
97
- switch (arguments.length) {
98
- case 1:
99
- return a;
100
- case 2:
101
- return ab(a);
102
- case 3:
103
- return bc(ab(a));
104
- case 4:
105
- return cd(bc(ab(a)));
106
- case 5:
107
- return de(cd(bc(ab(a))));
108
- case 6:
109
- return ef(de(cd(bc(ab(a)))));
110
- case 7:
111
- return fg(ef(de(cd(bc(ab(a))))));
112
- case 8:
113
- return gh(fg(ef(de(cd(bc(ab(a)))))));
114
- case 9:
115
- return hi(gh(fg(ef(de(cd(bc(ab(a))))))));
116
- default: {
117
- let ret = arguments[0];
118
- for (let i = 1; i < arguments.length; i++) {
119
- ret = arguments[i](ret);
120
- }
121
- return ret;
122
- }
123
- }
107
+ function pipe(a, ...args3) {
108
+ return pipeArguments(a, args3);
124
109
  }
125
110
 
126
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/GlobalValue.js
127
- var globalStoreId = `effect/GlobalValue`;
128
- var globalStore;
129
- var globalValue = (id, compute) => {
130
- if (!globalStore) {
131
- globalThis[globalStoreId] ??= /* @__PURE__ */ new Map();
132
- globalStore = globalThis[globalStoreId];
133
- }
134
- if (!globalStore.has(id)) {
135
- globalStore.set(id, compute());
136
- }
137
- return globalStore.get(id);
111
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/internal/equal.js
112
+ var getAllObjectKeys = (obj) => {
113
+ const keys2 = new Set(Reflect.ownKeys(obj));
114
+ if (obj.constructor === Object) return keys2;
115
+ if (obj instanceof Error) {
116
+ keys2.delete("stack");
117
+ }
118
+ const proto = Object.getPrototypeOf(obj);
119
+ let current = proto;
120
+ while (current !== null && current !== Object.prototype) {
121
+ const ownKeys = Reflect.ownKeys(current);
122
+ for (let i = 0; i < ownKeys.length; i++) {
123
+ keys2.add(ownKeys[i]);
124
+ }
125
+ current = Object.getPrototypeOf(current);
126
+ }
127
+ if (keys2.has("constructor") && typeof obj.constructor === "function" && proto === obj.constructor.prototype) {
128
+ keys2.delete("constructor");
129
+ }
130
+ return keys2;
138
131
  };
132
+ var byReferenceInstances = /* @__PURE__ */ new WeakSet();
139
133
 
140
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/Predicate.js
141
- var isString = (input) => typeof input === "string";
142
- var isNumber = (input) => typeof input === "number";
143
- var isBoolean = (input) => typeof input === "boolean";
144
- var isFunction2 = isFunction;
145
- var isRecordOrArray = (input) => typeof input === "object" && input !== null;
146
- var isObject = (input) => isRecordOrArray(input) || isFunction2(input);
147
- var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self);
148
- var isRecord = (input) => isRecordOrArray(input) && !Array.isArray(input);
149
-
150
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/Utils.js
151
- var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
152
- var GenKindImpl = class {
153
- value;
154
- constructor(value) {
155
- this.value = value;
156
- }
157
- /**
158
- * @since 2.0.0
159
- */
160
- get _F() {
161
- return identity;
162
- }
163
- /**
164
- * @since 2.0.0
165
- */
166
- get _R() {
167
- return (_) => _;
168
- }
169
- /**
170
- * @since 2.0.0
171
- */
172
- get _O() {
173
- return (_) => _;
174
- }
175
- /**
176
- * @since 2.0.0
177
- */
178
- get _E() {
179
- return (_) => _;
180
- }
181
- /**
182
- * @since 2.0.0
183
- */
184
- [GenKindTypeId] = GenKindTypeId;
185
- /**
186
- * @since 2.0.0
187
- */
188
- [Symbol.iterator]() {
189
- return new SingleShotGen(this);
190
- }
191
- };
192
- var SingleShotGen = class _SingleShotGen {
193
- self;
194
- called = false;
195
- constructor(self) {
196
- this.self = self;
197
- }
198
- /**
199
- * @since 2.0.0
200
- */
201
- next(a) {
202
- return this.called ? {
203
- value: a,
204
- done: true
205
- } : (this.called = true, {
206
- value: this.self,
207
- done: false
208
- });
209
- }
210
- /**
211
- * @since 2.0.0
212
- */
213
- return(a) {
214
- return {
215
- value: a,
216
- done: true
217
- };
218
- }
219
- /**
220
- * @since 2.0.0
221
- */
222
- throw(e) {
223
- throw e;
224
- }
225
- /**
226
- * @since 2.0.0
227
- */
228
- [Symbol.iterator]() {
229
- return new _SingleShotGen(this.self);
230
- }
231
- };
232
- var MUL_HI = 1481765933 >>> 0;
233
- var MUL_LO = 1284865837 >>> 0;
234
- var YieldWrapTypeId = /* @__PURE__ */ Symbol.for("effect/Utils/YieldWrap");
235
- var YieldWrap = class {
236
- /**
237
- * @since 3.0.6
238
- */
239
- #value;
240
- constructor(value) {
241
- this.#value = value;
242
- }
243
- /**
244
- * @since 3.0.6
245
- */
246
- [YieldWrapTypeId]() {
247
- return this.#value;
248
- }
249
- };
250
- var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructuralRegion", () => ({
251
- enabled: false,
252
- tester: void 0
253
- }));
254
- var standard = {
255
- effect_internal_function: (body) => {
256
- return body();
257
- }
258
- };
259
- var forced = {
260
- effect_internal_function: (body) => {
261
- try {
262
- return body();
263
- } finally {
264
- }
265
- }
266
- };
267
- var isNotOptimizedAway = /* @__PURE__ */ standard.effect_internal_function(() => new Error().stack)?.includes("effect_internal_function") === true;
268
- var internalCall = isNotOptimizedAway ? standard.effect_internal_function : forced.effect_internal_function;
269
- var genConstructor = function* () {
270
- }.constructor;
134
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Predicate.js
135
+ function isString(input) {
136
+ return typeof input === "string";
137
+ }
138
+ function isNumber(input) {
139
+ return typeof input === "number";
140
+ }
141
+ function isBoolean(input) {
142
+ return typeof input === "boolean";
143
+ }
144
+ function isFunction(input) {
145
+ return typeof input === "function";
146
+ }
147
+ function isObject(input) {
148
+ return typeof input === "object" && input !== null && !Array.isArray(input);
149
+ }
150
+ function isObjectKeyword(input) {
151
+ return typeof input === "object" && input !== null || isFunction(input);
152
+ }
153
+ var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObjectKeyword(self) && property in self);
271
154
 
272
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/Hash.js
273
- var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
274
- var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
155
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Hash.js
156
+ var symbol = "~effect/interfaces/Hash";
275
157
  var hash = (self) => {
276
- if (structuralRegionState.enabled === true) {
277
- return 0;
278
- }
279
158
  switch (typeof self) {
280
159
  case "number":
281
160
  return number(self);
@@ -294,16 +173,32 @@ var hash = (self) => {
294
173
  if (self === null) {
295
174
  return string("null");
296
175
  } else if (self instanceof Date) {
297
- if (Number.isNaN(self.getTime())) {
298
- return string("Invalid Date");
299
- }
300
- return hash(self.toISOString());
301
- } else if (self instanceof URL) {
302
- return hash(self.href);
303
- } else if (isHash(self)) {
304
- return self[symbol]();
176
+ return string(self.toISOString());
177
+ } else if (self instanceof RegExp) {
178
+ return string(self.toString());
305
179
  } else {
306
- return random(self);
180
+ if (byReferenceInstances.has(self)) {
181
+ return random(self);
182
+ }
183
+ if (hashCache.has(self)) {
184
+ return hashCache.get(self);
185
+ }
186
+ const h = withVisitedTracking(self, () => {
187
+ if (isHash(self)) {
188
+ return self[symbol]();
189
+ } else if (typeof self === "function") {
190
+ return random(self);
191
+ } else if (Array.isArray(self)) {
192
+ return array(self);
193
+ } else if (self instanceof Map) {
194
+ return hashMap(self);
195
+ } else if (self instanceof Set) {
196
+ return hashSet(self);
197
+ }
198
+ return structure(self);
199
+ });
200
+ hashCache.set(self, h);
201
+ return h;
307
202
  }
308
203
  }
309
204
  default:
@@ -316,12 +211,18 @@ var random = (self) => {
316
211
  }
317
212
  return randomHashCache.get(self);
318
213
  };
319
- var combine = (b) => (self) => self * 53 ^ b;
214
+ var combine = /* @__PURE__ */ dual(2, (self, b) => self * 53 ^ b);
320
215
  var optimize = (n) => n & 3221225471 | n >>> 1 & 1073741824;
321
216
  var isHash = (u) => hasProperty(u, symbol);
322
217
  var number = (n) => {
323
- if (n !== n || n === Infinity) {
324
- return 0;
218
+ if (n !== n) {
219
+ return string("NaN");
220
+ }
221
+ if (n === Infinity) {
222
+ return string("Infinity");
223
+ }
224
+ if (n === -Infinity) {
225
+ return string("-Infinity");
325
226
  }
326
227
  let h = n | 0;
327
228
  if (h !== n) {
@@ -341,38 +242,37 @@ var string = (str) => {
341
242
  };
342
243
  var structureKeys = (o, keys2) => {
343
244
  let h = 12289;
344
- for (let i = 0; i < keys2.length; i++) {
345
- h ^= pipe(string(keys2[i]), combine(hash(o[keys2[i]])));
245
+ for (const key of keys2) {
246
+ h ^= combine(hash(key), hash(o[key]));
346
247
  }
347
248
  return optimize(h);
348
249
  };
349
- var structure = (o) => structureKeys(o, Object.keys(o));
350
- var cached = function() {
351
- if (arguments.length === 1) {
352
- const self2 = arguments[0];
353
- return function(hash3) {
354
- Object.defineProperty(self2, symbol, {
355
- value() {
356
- return hash3;
357
- },
358
- enumerable: false
359
- });
360
- return hash3;
361
- };
250
+ var structure = (o) => structureKeys(o, getAllObjectKeys(o));
251
+ var iterableWith = (seed, f) => (iter) => {
252
+ let h = seed;
253
+ for (const element of iter) {
254
+ h ^= f(element);
362
255
  }
363
- const self = arguments[0];
364
- const hash2 = arguments[1];
365
- Object.defineProperty(self, symbol, {
366
- value() {
367
- return hash2;
368
- },
369
- enumerable: false
370
- });
371
- return hash2;
256
+ return optimize(h);
372
257
  };
258
+ var array = /* @__PURE__ */ iterableWith(6151, hash);
259
+ var hashMap = /* @__PURE__ */ iterableWith(/* @__PURE__ */ string("Map"), ([k, v]) => combine(hash(k), hash(v)));
260
+ var hashSet = /* @__PURE__ */ iterableWith(/* @__PURE__ */ string("Set"), hash);
261
+ var randomHashCache = /* @__PURE__ */ new WeakMap();
262
+ var hashCache = /* @__PURE__ */ new WeakMap();
263
+ var visitedObjects = /* @__PURE__ */ new WeakSet();
264
+ function withVisitedTracking(obj, fn2) {
265
+ if (visitedObjects.has(obj)) {
266
+ return string("[Circular]");
267
+ }
268
+ visitedObjects.add(obj);
269
+ const result = fn2();
270
+ visitedObjects.delete(obj);
271
+ return result;
272
+ }
373
273
 
374
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/Equal.js
375
- var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
274
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Equal.js
275
+ var symbol2 = "~effect/interfaces/Equal";
376
276
  function equals() {
377
277
  if (arguments.length === 1) {
378
278
  return (self) => compareBoth(self, arguments[0]);
@@ -380,71 +280,274 @@ function equals() {
380
280
  return compareBoth(arguments[0], arguments[1]);
381
281
  }
382
282
  function compareBoth(self, that) {
383
- if (self === that) {
384
- return true;
385
- }
283
+ if (self === that) return true;
284
+ if (self == null || that == null) return false;
386
285
  const selfType = typeof self;
387
286
  if (selfType !== typeof that) {
388
287
  return false;
389
288
  }
390
- if (selfType === "object" || selfType === "function") {
391
- if (self !== null && that !== null) {
392
- if (isEqual(self) && isEqual(that)) {
393
- if (hash(self) === hash(that) && self[symbol2](that)) {
394
- return true;
395
- } else {
396
- return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
397
- }
398
- } else if (self instanceof Date && that instanceof Date) {
399
- const t1 = self.getTime();
400
- const t2 = that.getTime();
401
- return t1 === t2 || Number.isNaN(t1) && Number.isNaN(t2);
402
- } else if (self instanceof URL && that instanceof URL) {
403
- return self.href === that.href;
404
- }
405
- }
406
- if (structuralRegionState.enabled) {
407
- if (Array.isArray(self) && Array.isArray(that)) {
408
- return self.length === that.length && self.every((v, i) => compareBoth(v, that[i]));
409
- }
410
- if (Object.getPrototypeOf(self) === Object.prototype && Object.getPrototypeOf(self) === Object.prototype) {
411
- const keysSelf = Object.keys(self);
412
- const keysThat = Object.keys(that);
413
- if (keysSelf.length === keysThat.length) {
414
- for (const key of keysSelf) {
415
- if (!(key in that && compareBoth(self[key], that[key]))) {
416
- return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
417
- }
418
- }
419
- return true;
420
- }
289
+ if (selfType === "number" && self !== self && that !== that) {
290
+ return true;
291
+ }
292
+ if (selfType !== "object" && selfType !== "function") {
293
+ return false;
294
+ }
295
+ if (byReferenceInstances.has(self) || byReferenceInstances.has(that)) {
296
+ return false;
297
+ }
298
+ return withCache(self, that, compareObjects);
299
+ }
300
+ function withVisitedTracking2(self, that, fn2) {
301
+ const hasLeft = visitedLeft.has(self);
302
+ const hasRight = visitedRight.has(that);
303
+ if (hasLeft && hasRight) {
304
+ return true;
305
+ }
306
+ if (hasLeft || hasRight) {
307
+ return false;
308
+ }
309
+ visitedLeft.add(self);
310
+ visitedRight.add(that);
311
+ const result = fn2();
312
+ visitedLeft.delete(self);
313
+ visitedRight.delete(that);
314
+ return result;
315
+ }
316
+ var visitedLeft = /* @__PURE__ */ new WeakSet();
317
+ var visitedRight = /* @__PURE__ */ new WeakSet();
318
+ function compareObjects(self, that) {
319
+ if (hash(self) !== hash(that)) {
320
+ return false;
321
+ } else if (self instanceof Date) {
322
+ if (!(that instanceof Date)) return false;
323
+ return self.toISOString() === that.toISOString();
324
+ } else if (self instanceof RegExp) {
325
+ if (!(that instanceof RegExp)) return false;
326
+ return self.toString() === that.toString();
327
+ }
328
+ const selfIsEqual = isEqual(self);
329
+ const thatIsEqual = isEqual(that);
330
+ if (selfIsEqual !== thatIsEqual) return false;
331
+ const bothEquals = selfIsEqual && thatIsEqual;
332
+ if (typeof self === "function" && !bothEquals) {
333
+ return false;
334
+ }
335
+ return withVisitedTracking2(self, that, () => {
336
+ if (bothEquals) {
337
+ return self[symbol2](that);
338
+ } else if (Array.isArray(self)) {
339
+ if (!Array.isArray(that) || self.length !== that.length) {
340
+ return false;
341
+ }
342
+ return compareArrays(self, that);
343
+ } else if (self instanceof Map) {
344
+ if (!(that instanceof Map) || self.size !== that.size) {
345
+ return false;
421
346
  }
422
- return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
347
+ return compareMaps(self, that);
348
+ } else if (self instanceof Set) {
349
+ if (!(that instanceof Set) || self.size !== that.size) {
350
+ return false;
351
+ }
352
+ return compareSets(self, that);
353
+ }
354
+ return compareRecords(self, that);
355
+ });
356
+ }
357
+ function withCache(self, that, f) {
358
+ let selfMap = equalityCache.get(self);
359
+ if (!selfMap) {
360
+ selfMap = /* @__PURE__ */ new WeakMap();
361
+ equalityCache.set(self, selfMap);
362
+ } else if (selfMap.has(that)) {
363
+ return selfMap.get(that);
364
+ }
365
+ const result = f(self, that);
366
+ selfMap.set(that, result);
367
+ let thatMap = equalityCache.get(that);
368
+ if (!thatMap) {
369
+ thatMap = /* @__PURE__ */ new WeakMap();
370
+ equalityCache.set(that, thatMap);
371
+ }
372
+ thatMap.set(self, result);
373
+ return result;
374
+ }
375
+ var equalityCache = /* @__PURE__ */ new WeakMap();
376
+ function compareArrays(self, that) {
377
+ for (let i = 0; i < self.length; i++) {
378
+ if (!compareBoth(self[i], that[i])) {
379
+ return false;
423
380
  }
424
381
  }
425
- return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
382
+ return true;
383
+ }
384
+ function compareRecords(self, that) {
385
+ const selfKeys = getAllObjectKeys(self);
386
+ const thatKeys = getAllObjectKeys(that);
387
+ if (selfKeys.size !== thatKeys.size) {
388
+ return false;
389
+ }
390
+ for (const key of selfKeys) {
391
+ if (!thatKeys.has(key) || !compareBoth(self[key], that[key])) {
392
+ return false;
393
+ }
394
+ }
395
+ return true;
396
+ }
397
+ function makeCompareMap(keyEquivalence, valueEquivalence) {
398
+ return function compareMaps2(self, that) {
399
+ for (const [selfKey, selfValue] of self) {
400
+ let found = false;
401
+ for (const [thatKey, thatValue] of that) {
402
+ if (keyEquivalence(selfKey, thatKey) && valueEquivalence(selfValue, thatValue)) {
403
+ found = true;
404
+ break;
405
+ }
406
+ }
407
+ if (!found) {
408
+ return false;
409
+ }
410
+ }
411
+ return true;
412
+ };
413
+ }
414
+ var compareMaps = /* @__PURE__ */ makeCompareMap(compareBoth, compareBoth);
415
+ function makeCompareSet(equivalence) {
416
+ return function compareSets2(self, that) {
417
+ for (const selfValue of self) {
418
+ let found = false;
419
+ for (const thatValue of that) {
420
+ if (equivalence(selfValue, thatValue)) {
421
+ found = true;
422
+ break;
423
+ }
424
+ }
425
+ if (!found) {
426
+ return false;
427
+ }
428
+ }
429
+ return true;
430
+ };
426
431
  }
432
+ var compareSets = /* @__PURE__ */ makeCompareSet(compareBoth);
427
433
  var isEqual = (u) => hasProperty(u, symbol2);
428
- var equivalence = () => equals;
434
+ var asEquivalence = () => equals;
435
+
436
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Redactable.js
437
+ var symbolRedactable = /* @__PURE__ */ Symbol.for("~effect/Inspectable/redactable");
438
+ var isRedactable = (u) => hasProperty(u, symbolRedactable);
439
+ function redact(u) {
440
+ if (isRedactable(u)) return getRedacted(u);
441
+ return u;
442
+ }
443
+ function getRedacted(redactable) {
444
+ return redactable[symbolRedactable](globalThis[currentFiberTypeId]?.services ?? emptyServiceMap);
445
+ }
446
+ var currentFiberTypeId = "~effect/Fiber/currentFiber";
447
+ var emptyServiceMap = {
448
+ "~effect/ServiceMap": {},
449
+ mapUnsafe: /* @__PURE__ */ new Map(),
450
+ pipe() {
451
+ return pipeArguments(this, arguments);
452
+ }
453
+ };
429
454
 
430
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/Inspectable.js
455
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Formatter.js
456
+ function format(input, options) {
457
+ const space = options?.space ?? 0;
458
+ const seen = /* @__PURE__ */ new WeakSet();
459
+ const gap = !space ? "" : typeof space === "number" ? " ".repeat(space) : space;
460
+ const ind = (d) => gap.repeat(d);
461
+ const wrap = (v, body) => {
462
+ const ctor = v?.constructor;
463
+ return ctor && ctor !== Object.prototype.constructor && ctor.name ? `${ctor.name}(${body})` : body;
464
+ };
465
+ const ownKeys = (o) => {
466
+ try {
467
+ return Reflect.ownKeys(o);
468
+ } catch {
469
+ return ["[ownKeys threw]"];
470
+ }
471
+ };
472
+ function recur(v, d = 0) {
473
+ if (Array.isArray(v)) {
474
+ if (seen.has(v)) return CIRCULAR;
475
+ seen.add(v);
476
+ if (!gap || v.length <= 1) return `[${v.map((x) => recur(x, d)).join(",")}]`;
477
+ const inner = v.map((x) => recur(x, d + 1)).join(",\n" + ind(d + 1));
478
+ return `[
479
+ ${ind(d + 1)}${inner}
480
+ ${ind(d)}]`;
481
+ }
482
+ if (v instanceof Date) return formatDate(v);
483
+ if (!options?.ignoreToString && hasProperty(v, "toString") && typeof v["toString"] === "function" && v["toString"] !== Object.prototype.toString && v["toString"] !== Array.prototype.toString) {
484
+ const s = safeToString(v);
485
+ if (v instanceof Error && v.cause) {
486
+ return `${s} (cause: ${recur(v.cause, d)})`;
487
+ }
488
+ return s;
489
+ }
490
+ if (typeof v === "string") return JSON.stringify(v);
491
+ if (typeof v === "number" || v == null || typeof v === "boolean" || typeof v === "symbol") return String(v);
492
+ if (typeof v === "bigint") return String(v) + "n";
493
+ if (typeof v === "object" || typeof v === "function") {
494
+ if (seen.has(v)) return CIRCULAR;
495
+ seen.add(v);
496
+ if (symbolRedactable in v) return format(getRedacted(v));
497
+ if (Symbol.iterator in v) {
498
+ return `${v.constructor.name}(${recur(Array.from(v), d)})`;
499
+ }
500
+ const keys2 = ownKeys(v);
501
+ if (!gap || keys2.length <= 1) {
502
+ const body2 = `{${keys2.map((k) => `${formatPropertyKey(k)}:${recur(v[k], d)}`).join(",")}}`;
503
+ return wrap(v, body2);
504
+ }
505
+ const body = `{
506
+ ${keys2.map((k) => `${ind(d + 1)}${formatPropertyKey(k)}: ${recur(v[k], d + 1)}`).join(",\n")}
507
+ ${ind(d)}}`;
508
+ return wrap(v, body);
509
+ }
510
+ return String(v);
511
+ }
512
+ return recur(input, 0);
513
+ }
514
+ var CIRCULAR = "[Circular]";
515
+ function formatPropertyKey(name) {
516
+ return typeof name === "string" ? JSON.stringify(name) : String(name);
517
+ }
518
+ function formatDate(date) {
519
+ try {
520
+ return date.toISOString();
521
+ } catch {
522
+ return "Invalid Date";
523
+ }
524
+ }
525
+ function safeToString(input) {
526
+ try {
527
+ const s = input.toString();
528
+ return typeof s === "string" ? s : String(s);
529
+ } catch {
530
+ return "[toString threw]";
531
+ }
532
+ }
533
+
534
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Inspectable.js
431
535
  var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
432
- var toJSON = (x) => {
536
+ var toJson = (input) => {
433
537
  try {
434
- if (hasProperty(x, "toJSON") && isFunction2(x["toJSON"]) && x["toJSON"].length === 0) {
435
- return x.toJSON();
436
- } else if (Array.isArray(x)) {
437
- return x.map(toJSON);
538
+ if (hasProperty(input, "toJSON") && isFunction(input["toJSON"]) && input["toJSON"].length === 0) {
539
+ return input.toJSON();
540
+ } else if (Array.isArray(input)) {
541
+ return input.map(toJson);
438
542
  }
439
543
  } catch {
440
- return {};
544
+ return "[toJSON threw]";
441
545
  }
442
- return redact(x);
546
+ return redact(input);
443
547
  };
444
- var format = (x) => JSON.stringify(x, null, 2);
445
548
  var BaseProto = {
446
549
  toJSON() {
447
- return toJSON(this);
550
+ return toJson(this);
448
551
  },
449
552
  [NodeInspectSymbol]() {
450
553
  return this.toJSON();
@@ -455,171 +558,447 @@ var BaseProto = {
455
558
  };
456
559
  var Class = class {
457
560
  /**
561
+ * Node.js custom inspection method.
562
+ *
458
563
  * @since 2.0.0
459
564
  */
460
565
  [NodeInspectSymbol]() {
461
566
  return this.toJSON();
462
567
  }
463
568
  /**
569
+ * Returns a formatted string representation of this object.
570
+ *
464
571
  * @since 2.0.0
465
572
  */
466
573
  toString() {
467
574
  return format(this.toJSON());
468
575
  }
469
576
  };
470
- var symbolRedactable = /* @__PURE__ */ Symbol.for("effect/Inspectable/Redactable");
471
- var isRedactable = (u) => typeof u === "object" && u !== null && symbolRedactable in u;
472
- var redactableState = /* @__PURE__ */ globalValue("effect/Inspectable/redactableState", () => ({
473
- fiberRefs: void 0
474
- }));
475
- var redact = (u) => {
476
- if (isRedactable(u) && redactableState.fiberRefs !== void 0) {
477
- return u[symbolRedactable](redactableState.fiberRefs);
577
+
578
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Utils.js
579
+ var GenKindTypeId = "~effect/Utils/GenKind";
580
+ var GenKindImpl = class {
581
+ value;
582
+ constructor(value) {
583
+ this.value = value;
584
+ }
585
+ get _F() {
586
+ return identity;
587
+ }
588
+ get _R() {
589
+ return (_) => _;
590
+ }
591
+ get _O() {
592
+ return (_) => _;
593
+ }
594
+ get _E() {
595
+ return (_) => _;
596
+ }
597
+ [GenKindTypeId] = GenKindTypeId;
598
+ [Symbol.iterator]() {
599
+ return new SingleShotGen(this);
478
600
  }
479
- return u;
480
601
  };
481
-
482
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/Pipeable.js
483
- var pipeArguments = (self, args2) => {
484
- switch (args2.length) {
485
- case 0:
486
- return self;
487
- case 1:
488
- return args2[0](self);
489
- case 2:
490
- return args2[1](args2[0](self));
491
- case 3:
492
- return args2[2](args2[1](args2[0](self)));
493
- case 4:
494
- return args2[3](args2[2](args2[1](args2[0](self))));
495
- case 5:
496
- return args2[4](args2[3](args2[2](args2[1](args2[0](self)))));
497
- case 6:
498
- return args2[5](args2[4](args2[3](args2[2](args2[1](args2[0](self))))));
499
- case 7:
500
- return args2[6](args2[5](args2[4](args2[3](args2[2](args2[1](args2[0](self)))))));
501
- case 8:
502
- return args2[7](args2[6](args2[5](args2[4](args2[3](args2[2](args2[1](args2[0](self))))))));
503
- case 9:
504
- return args2[8](args2[7](args2[6](args2[5](args2[4](args2[3](args2[2](args2[1](args2[0](self)))))))));
505
- default: {
506
- let ret = self;
507
- for (let i = 0, len = args2.length; i < len; i++) {
508
- ret = args2[i](ret);
509
- }
510
- return ret;
602
+ var SingleShotGen = class _SingleShotGen {
603
+ called = false;
604
+ self;
605
+ constructor(self) {
606
+ this.self = self;
607
+ }
608
+ /**
609
+ * @since 2.0.0
610
+ */
611
+ next(a) {
612
+ return this.called ? {
613
+ value: a,
614
+ done: true
615
+ } : (this.called = true, {
616
+ value: this.self,
617
+ done: false
618
+ });
619
+ }
620
+ /**
621
+ * @since 2.0.0
622
+ */
623
+ [Symbol.iterator]() {
624
+ return new _SingleShotGen(this.self);
625
+ }
626
+ };
627
+ var InternalTypeId = "~effect/Effect/internal";
628
+ var standard = {
629
+ [InternalTypeId]: (body) => {
630
+ return body();
631
+ }
632
+ };
633
+ var forced = {
634
+ [InternalTypeId]: (body) => {
635
+ try {
636
+ return body();
637
+ } finally {
511
638
  }
512
639
  }
513
640
  };
641
+ var isNotOptimizedAway = /* @__PURE__ */ standard[InternalTypeId](() => new Error().stack)?.includes(InternalTypeId) === true;
642
+ var internalCall = isNotOptimizedAway ? standard[InternalTypeId] : forced[InternalTypeId];
643
+ var genConstructor = function* () {
644
+ }.constructor;
514
645
 
515
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/internal/opCodes/effect.js
516
- var OP_COMMIT = "Commit";
517
-
518
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/internal/version.js
519
- var moduleVersion = "3.19.14";
520
- var getCurrentVersion = () => moduleVersion;
521
-
522
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/internal/effectable.js
523
- var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
524
- var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
525
- var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
526
- var ChannelTypeId = /* @__PURE__ */ Symbol.for("effect/Channel");
646
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/internal/core.js
647
+ var EffectTypeId = `~effect/Effect`;
648
+ var ExitTypeId = `~effect/Exit`;
527
649
  var effectVariance = {
528
- /* c8 ignore next */
529
- _R: (_) => _,
530
- /* c8 ignore next */
531
- _E: (_) => _,
532
- /* c8 ignore next */
533
- _A: (_) => _,
534
- _V: /* @__PURE__ */ getCurrentVersion()
535
- };
536
- var sinkVariance = {
537
- /* c8 ignore next */
538
- _A: (_) => _,
539
- /* c8 ignore next */
540
- _In: (_) => _,
541
- /* c8 ignore next */
542
- _L: (_) => _,
543
- /* c8 ignore next */
544
- _E: (_) => _,
545
- /* c8 ignore next */
546
- _R: (_) => _
650
+ _A: identity,
651
+ _E: identity,
652
+ _R: identity
547
653
  };
548
- var channelVariance = {
549
- /* c8 ignore next */
550
- _Env: (_) => _,
551
- /* c8 ignore next */
552
- _InErr: (_) => _,
553
- /* c8 ignore next */
554
- _InElem: (_) => _,
555
- /* c8 ignore next */
556
- _InDone: (_) => _,
557
- /* c8 ignore next */
558
- _OutErr: (_) => _,
559
- /* c8 ignore next */
560
- _OutElem: (_) => _,
561
- /* c8 ignore next */
562
- _OutDone: (_) => _
563
- };
564
- var EffectPrototype = {
565
- [EffectTypeId]: effectVariance,
566
- [StreamTypeId]: effectVariance,
567
- [SinkTypeId]: sinkVariance,
568
- [ChannelTypeId]: channelVariance,
569
- [symbol2](that) {
570
- return this === that;
654
+ var identifier = `${EffectTypeId}/identifier`;
655
+ var args = `${EffectTypeId}/args`;
656
+ var evaluate = `${EffectTypeId}/evaluate`;
657
+ var contA = `${EffectTypeId}/successCont`;
658
+ var contE = `${EffectTypeId}/failureCont`;
659
+ var contAll = `${EffectTypeId}/ensureCont`;
660
+ var PipeInspectableProto = {
661
+ pipe() {
662
+ return pipeArguments(this, arguments);
571
663
  },
572
- [symbol]() {
573
- return cached(this, random(this));
664
+ toJSON() {
665
+ return {
666
+ ...this
667
+ };
574
668
  },
575
- [Symbol.iterator]() {
576
- return new SingleShotGen(new YieldWrap(this));
669
+ toString() {
670
+ return format(this.toJSON(), {
671
+ ignoreToString: true,
672
+ space: 2
673
+ });
577
674
  },
578
- pipe() {
579
- return pipeArguments(this, arguments);
675
+ [NodeInspectSymbol]() {
676
+ return this.toJSON();
580
677
  }
581
678
  };
582
- var StructuralPrototype = {
679
+ var StructuralProto = {
583
680
  [symbol]() {
584
- return cached(this, structure(this));
681
+ return structureKeys(this, Object.keys(this));
585
682
  },
586
683
  [symbol2](that) {
587
684
  const selfKeys = Object.keys(this);
588
685
  const thatKeys = Object.keys(that);
589
- if (selfKeys.length !== thatKeys.length) {
590
- return false;
591
- }
592
- for (const key of selfKeys) {
593
- if (!(key in that && equals(this[key], that[key]))) {
686
+ if (selfKeys.length !== thatKeys.length) return false;
687
+ for (let i = 0; i < selfKeys.length; i++) {
688
+ if (selfKeys[i] !== thatKeys[i] && !equals(this[selfKeys[i]], that[selfKeys[i]])) {
594
689
  return false;
595
690
  }
596
691
  }
597
692
  return true;
598
693
  }
599
694
  };
600
- var CommitPrototype = {
601
- ...EffectPrototype,
602
- _op: OP_COMMIT
695
+ var YieldableProto = {
696
+ [Symbol.iterator]() {
697
+ return new SingleShotGen(this);
698
+ }
603
699
  };
604
- var StructuralCommitPrototype = {
605
- ...CommitPrototype,
606
- ...StructuralPrototype
700
+ var YieldableErrorProto = {
701
+ ...YieldableProto,
702
+ pipe() {
703
+ return pipeArguments(this, arguments);
704
+ }
607
705
  };
608
-
609
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/internal/option.js
610
- var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
611
- var CommonProto = {
612
- ...EffectPrototype,
613
- [TypeId]: {
614
- _A: (_) => _
706
+ var EffectProto = {
707
+ [EffectTypeId]: effectVariance,
708
+ ...PipeInspectableProto,
709
+ [Symbol.iterator]() {
710
+ return new SingleShotGen(this);
615
711
  },
712
+ asEffect() {
713
+ return this;
714
+ },
715
+ toJSON() {
716
+ return {
717
+ _id: "Effect",
718
+ op: this[identifier],
719
+ ...args in this ? {
720
+ args: this[args]
721
+ } : void 0
722
+ };
723
+ }
724
+ };
725
+ var isExit = (u) => hasProperty(u, ExitTypeId);
726
+ var CauseTypeId = "~effect/Cause";
727
+ var CauseReasonTypeId = "~effect/Cause/Reason";
728
+ var isCause = (self) => hasProperty(self, CauseTypeId);
729
+ var CauseImpl = class {
730
+ [CauseTypeId];
731
+ reasons;
732
+ constructor(failures) {
733
+ this[CauseTypeId] = CauseTypeId;
734
+ this.reasons = failures;
735
+ }
736
+ pipe() {
737
+ return pipeArguments(this, arguments);
738
+ }
739
+ toJSON() {
740
+ return {
741
+ _id: "Cause",
742
+ failures: this.reasons.map((f) => f.toJSON())
743
+ };
744
+ }
745
+ toString() {
746
+ return `Cause(${format(this.reasons)})`;
747
+ }
616
748
  [NodeInspectSymbol]() {
617
749
  return this.toJSON();
618
- },
750
+ }
751
+ [symbol2](that) {
752
+ return isCause(that) && this.reasons.length === that.reasons.length && this.reasons.every((e, i) => equals(e, that.reasons[i]));
753
+ }
754
+ [symbol]() {
755
+ return array(this.reasons);
756
+ }
757
+ };
758
+ var annotationsMap = /* @__PURE__ */ new WeakMap();
759
+ var ReasonBase = class {
760
+ [CauseReasonTypeId];
761
+ annotations;
762
+ _tag;
763
+ constructor(_tag, annotations, originalError) {
764
+ this[CauseReasonTypeId] = CauseReasonTypeId;
765
+ this._tag = _tag;
766
+ if (annotations !== constEmptyAnnotations && typeof originalError === "object" && originalError !== null && annotations.size > 0) {
767
+ const prevAnnotations = annotationsMap.get(originalError);
768
+ if (prevAnnotations) {
769
+ annotations = new Map([...prevAnnotations, ...annotations]);
770
+ }
771
+ annotationsMap.set(originalError, annotations);
772
+ }
773
+ this.annotations = annotations;
774
+ }
775
+ annotate(annotations, options) {
776
+ if (annotations.mapUnsafe.size === 0) return this;
777
+ const newAnnotations = new Map(this.annotations);
778
+ annotations.mapUnsafe.forEach((value, key) => {
779
+ if (options?.overwrite !== true && newAnnotations.has(key)) return;
780
+ newAnnotations.set(key, value);
781
+ });
782
+ const self = Object.assign(Object.create(Object.getPrototypeOf(this)), this);
783
+ self.annotations = newAnnotations;
784
+ return self;
785
+ }
786
+ pipe() {
787
+ return pipeArguments(this, arguments);
788
+ }
619
789
  toString() {
620
- return format(this.toJSON());
790
+ return format(this);
791
+ }
792
+ [NodeInspectSymbol]() {
793
+ return this.toString();
794
+ }
795
+ };
796
+ var constEmptyAnnotations = /* @__PURE__ */ new Map();
797
+ var Fail = class extends ReasonBase {
798
+ error;
799
+ constructor(error, annotations = constEmptyAnnotations) {
800
+ super("Fail", annotations, error);
801
+ this.error = error;
802
+ }
803
+ toString() {
804
+ return `Fail(${format(this.error)})`;
805
+ }
806
+ toJSON() {
807
+ return {
808
+ _tag: "Fail",
809
+ error: this.error
810
+ };
811
+ }
812
+ [symbol2](that) {
813
+ return isFailReason(that) && equals(this.error, that.error) && equals(this.annotations, that.annotations);
814
+ }
815
+ [symbol]() {
816
+ return combine(string(this._tag))(combine(hash(this.error))(hash(this.annotations)));
817
+ }
818
+ };
819
+ var causeFail = (error) => new CauseImpl([new Fail(error)]);
820
+ var Die = class extends ReasonBase {
821
+ defect;
822
+ constructor(defect, annotations = constEmptyAnnotations) {
823
+ super("Die", annotations, defect);
824
+ this.defect = defect;
825
+ }
826
+ toString() {
827
+ return `Die(${format(this.defect)})`;
828
+ }
829
+ toJSON() {
830
+ return {
831
+ _tag: "Die",
832
+ defect: this.defect
833
+ };
834
+ }
835
+ [symbol2](that) {
836
+ return isDieReason(that) && equals(this.defect, that.defect) && equals(this.annotations, that.annotations);
837
+ }
838
+ [symbol]() {
839
+ return combine(string(this._tag))(combine(hash(this.defect))(hash(this.annotations)));
840
+ }
841
+ };
842
+ var causeDie = (defect) => new CauseImpl([new Die(defect)]);
843
+ var causeAnnotate = /* @__PURE__ */ dual((args3) => isCause(args3[0]), (self, annotations, options) => {
844
+ if (annotations.mapUnsafe.size === 0) return self;
845
+ return new CauseImpl(self.reasons.map((f) => f.annotate(annotations, options)));
846
+ });
847
+ var isFailReason = (self) => self._tag === "Fail";
848
+ var isDieReason = (self) => self._tag === "Die";
849
+ function defaultEvaluate(_fiber) {
850
+ return exitDie(`Effect.evaluate: Not implemented`);
851
+ }
852
+ var makePrimitiveProto = (options) => ({
853
+ ...EffectProto,
854
+ [identifier]: options.op,
855
+ [evaluate]: options[evaluate] ?? defaultEvaluate,
856
+ [contA]: options[contA],
857
+ [contE]: options[contE],
858
+ [contAll]: options[contAll]
859
+ });
860
+ var makePrimitive = (options) => {
861
+ const Proto = makePrimitiveProto(options);
862
+ return function() {
863
+ const self = Object.create(Proto);
864
+ self[args] = options.single === false ? arguments : arguments[0];
865
+ return self;
866
+ };
867
+ };
868
+ var makeExit = (options) => {
869
+ const Proto = {
870
+ ...makePrimitiveProto(options),
871
+ [ExitTypeId]: ExitTypeId,
872
+ _tag: options.op,
873
+ get [options.prop]() {
874
+ return this[args];
875
+ },
876
+ toString() {
877
+ return `${options.op}(${format(this[args])})`;
878
+ },
879
+ toJSON() {
880
+ return {
881
+ _id: "Exit",
882
+ _tag: options.op,
883
+ [options.prop]: this[args]
884
+ };
885
+ },
886
+ [symbol2](that) {
887
+ return isExit(that) && that._tag === this._tag && equals(this[args], that[args]);
888
+ },
889
+ [symbol]() {
890
+ return combine(string(options.op), hash(this[args]));
891
+ }
892
+ };
893
+ return function(value) {
894
+ const self = Object.create(Proto);
895
+ self[args] = value;
896
+ return self;
897
+ };
898
+ };
899
+ var exitSucceed = /* @__PURE__ */ makeExit({
900
+ op: "Success",
901
+ prop: "value",
902
+ [evaluate](fiber) {
903
+ const cont = fiber.getCont(contA);
904
+ return cont ? cont[contA](this[args], fiber, this) : fiber.yieldWith(this);
905
+ }
906
+ });
907
+ var StackTraceKey = {
908
+ key: "effect/Cause/StackTrace"
909
+ };
910
+ var exitFailCause = /* @__PURE__ */ makeExit({
911
+ op: "Failure",
912
+ prop: "cause",
913
+ [evaluate](fiber) {
914
+ let cause = this[args];
915
+ let annotated = false;
916
+ if (fiber.currentStackFrame) {
917
+ cause = causeAnnotate(cause, {
918
+ mapUnsafe: /* @__PURE__ */ new Map([[StackTraceKey.key, fiber.currentStackFrame]])
919
+ });
920
+ annotated = true;
921
+ }
922
+ let cont = fiber.getCont(contE);
923
+ while (fiber.interruptible && fiber._interruptedCause && cont) {
924
+ cont = fiber.getCont(contE);
925
+ }
926
+ return cont ? cont[contE](cause, fiber, annotated ? void 0 : this) : fiber.yieldWith(annotated ? this : exitFailCause(cause));
927
+ }
928
+ });
929
+ var exitFail = (e) => exitFailCause(causeFail(e));
930
+ var exitDie = (defect) => exitFailCause(causeDie(defect));
931
+ var withFiber = /* @__PURE__ */ makePrimitive({
932
+ op: "WithFiber",
933
+ [evaluate](fiber) {
934
+ return this[args](fiber);
935
+ }
936
+ });
937
+ var YieldableError = /* @__PURE__ */ (function() {
938
+ class YieldableError2 extends globalThis.Error {
939
+ asEffect() {
940
+ return exitFail(this);
941
+ }
942
+ }
943
+ Object.assign(YieldableError2.prototype, YieldableErrorProto);
944
+ return YieldableError2;
945
+ })();
946
+ var Error2 = /* @__PURE__ */ (function() {
947
+ const plainArgsSymbol = /* @__PURE__ */ Symbol.for("effect/Data/Error/plainArgs");
948
+ return class Base extends YieldableError {
949
+ constructor(args3) {
950
+ super(args3?.message, args3?.cause ? {
951
+ cause: args3.cause
952
+ } : void 0);
953
+ if (args3) {
954
+ Object.assign(this, args3);
955
+ Object.defineProperty(this, plainArgsSymbol, {
956
+ value: args3,
957
+ enumerable: false
958
+ });
959
+ }
960
+ }
961
+ toJSON() {
962
+ return {
963
+ ...this[plainArgsSymbol],
964
+ ...this
965
+ };
966
+ }
967
+ };
968
+ })();
969
+ var TaggedError = (tag) => {
970
+ class Base extends Error2 {
971
+ _tag = tag;
972
+ }
973
+ ;
974
+ Base.prototype.name = tag;
975
+ return Base;
976
+ };
977
+ var NoSuchElementErrorTypeId = "~effect/Cause/NoSuchElementError";
978
+ var NoSuchElementError = class extends (/* @__PURE__ */ TaggedError("NoSuchElementError")) {
979
+ [NoSuchElementErrorTypeId] = NoSuchElementErrorTypeId;
980
+ constructor(message) {
981
+ super({
982
+ message
983
+ });
621
984
  }
622
985
  };
986
+ var DoneTypeId = "~effect/Cause/Done";
987
+ var DoneVoid = {
988
+ [DoneTypeId]: DoneTypeId,
989
+ _tag: "Done",
990
+ value: void 0
991
+ };
992
+
993
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/internal/option.js
994
+ var TypeId = "~effect/data/Option";
995
+ var CommonProto = {
996
+ [TypeId]: {
997
+ _A: (_) => _
998
+ },
999
+ ...PipeInspectableProto,
1000
+ ...YieldableProto
1001
+ };
623
1002
  var SomeProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
624
1003
  _tag: "Some",
625
1004
  _op: "Some",
@@ -627,14 +1006,20 @@ var SomeProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(Comm
627
1006
  return isOption(that) && isSome(that) && equals(this.value, that.value);
628
1007
  },
629
1008
  [symbol]() {
630
- return cached(this, combine(hash(this._tag))(hash(this.value)));
1009
+ return combine(hash(this._tag))(hash(this.value));
1010
+ },
1011
+ toString() {
1012
+ return `some(${format(this.value)})`;
631
1013
  },
632
1014
  toJSON() {
633
1015
  return {
634
1016
  _id: "Option",
635
1017
  _tag: this._tag,
636
- value: toJSON(this.value)
1018
+ value: toJson(this.value)
637
1019
  };
1020
+ },
1021
+ asEffect() {
1022
+ return exitSucceed(this.value);
638
1023
  }
639
1024
  });
640
1025
  var NoneHash = /* @__PURE__ */ hash("None");
@@ -647,11 +1032,17 @@ var NoneProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(Comm
647
1032
  [symbol]() {
648
1033
  return NoneHash;
649
1034
  },
1035
+ toString() {
1036
+ return `none()`;
1037
+ },
650
1038
  toJSON() {
651
1039
  return {
652
1040
  _id: "Option",
653
1041
  _tag: this._tag
654
1042
  };
1043
+ },
1044
+ asEffect() {
1045
+ return exitFail(new NoSuchElementError());
655
1046
  }
656
1047
  });
657
1048
  var isOption = (input) => hasProperty(input, TypeId);
@@ -664,94 +1055,113 @@ var some = (value) => {
664
1055
  return a;
665
1056
  };
666
1057
 
667
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/internal/either.js
668
- var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
1058
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/internal/result.js
1059
+ var TypeId2 = "~effect/data/Result";
669
1060
  var CommonProto2 = {
670
- ...EffectPrototype,
671
1061
  [TypeId2]: {
672
- _R: (_) => _
1062
+ /* v8 ignore next 2 */
1063
+ _A: (_) => _,
1064
+ _E: (_) => _
673
1065
  },
674
- [NodeInspectSymbol]() {
675
- return this.toJSON();
676
- },
677
- toString() {
678
- return format(this.toJSON());
679
- }
1066
+ ...PipeInspectableProto,
1067
+ ...YieldableProto
680
1068
  };
681
- var RightProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
682
- _tag: "Right",
683
- _op: "Right",
1069
+ var SuccessProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
1070
+ _tag: "Success",
1071
+ _op: "Success",
684
1072
  [symbol2](that) {
685
- return isEither(that) && isRight(that) && equals(this.right, that.right);
1073
+ return isResult(that) && isSuccess(that) && equals(this.success, that.success);
686
1074
  },
687
1075
  [symbol]() {
688
- return combine(hash(this._tag))(hash(this.right));
1076
+ return combine(hash(this._tag))(hash(this.success));
1077
+ },
1078
+ toString() {
1079
+ return `success(${format(this.success)})`;
689
1080
  },
690
1081
  toJSON() {
691
1082
  return {
692
- _id: "Either",
1083
+ _id: "Result",
693
1084
  _tag: this._tag,
694
- right: toJSON(this.right)
1085
+ value: toJson(this.success)
695
1086
  };
1087
+ },
1088
+ asEffect() {
1089
+ return exitSucceed(this.success);
696
1090
  }
697
1091
  });
698
- var LeftProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
699
- _tag: "Left",
700
- _op: "Left",
1092
+ var FailureProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
1093
+ _tag: "Failure",
1094
+ _op: "Failure",
701
1095
  [symbol2](that) {
702
- return isEither(that) && isLeft(that) && equals(this.left, that.left);
1096
+ return isResult(that) && isFailure(that) && equals(this.failure, that.failure);
703
1097
  },
704
1098
  [symbol]() {
705
- return combine(hash(this._tag))(hash(this.left));
1099
+ return combine(hash(this._tag))(hash(this.failure));
1100
+ },
1101
+ toString() {
1102
+ return `failure(${format(this.failure)})`;
706
1103
  },
707
1104
  toJSON() {
708
1105
  return {
709
- _id: "Either",
1106
+ _id: "Result",
710
1107
  _tag: this._tag,
711
- left: toJSON(this.left)
1108
+ failure: toJson(this.failure)
712
1109
  };
1110
+ },
1111
+ asEffect() {
1112
+ return exitFail(this.failure);
713
1113
  }
714
1114
  });
715
- var isEither = (input) => hasProperty(input, TypeId2);
716
- var isLeft = (ma) => ma._tag === "Left";
717
- var isRight = (ma) => ma._tag === "Right";
718
- var left = (left3) => {
719
- const a = Object.create(LeftProto);
720
- a.left = left3;
1115
+ var isResult = (input) => hasProperty(input, TypeId2);
1116
+ var isFailure = (result) => result._tag === "Failure";
1117
+ var isSuccess = (result) => result._tag === "Success";
1118
+ var fail = (failure) => {
1119
+ const a = Object.create(FailureProto);
1120
+ a.failure = failure;
721
1121
  return a;
722
1122
  };
723
- var right = (right3) => {
724
- const a = Object.create(RightProto);
725
- a.right = right3;
1123
+ var succeed = (success) => {
1124
+ const a = Object.create(SuccessProto);
1125
+ a.success = success;
726
1126
  return a;
727
1127
  };
728
1128
 
729
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/Either.js
730
- var right2 = right;
731
- var left2 = left;
732
- var isLeft2 = isLeft;
733
- var isRight2 = isRight;
734
- var map = /* @__PURE__ */ dual(2, (self, f) => isRight2(self) ? right2(f(self.right)) : left2(self.left));
735
- var getOrElse = /* @__PURE__ */ dual(2, (self, onLeft) => isLeft2(self) ? onLeft(self.left) : self.right);
736
-
737
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/internal/array.js
738
- var isNonEmptyArray = (self) => self.length > 0;
739
-
740
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/Order.js
741
- var make = (compare) => (self, that) => self === that ? 0 : compare(self, that);
742
- var string2 = /* @__PURE__ */ make((self, that) => self < that ? -1 : 1);
1129
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Order.js
1130
+ function make(compare) {
1131
+ return (self, that) => self === that ? 0 : compare(self, that);
1132
+ }
1133
+ var String2 = /* @__PURE__ */ make((self, that) => self < that ? -1 : 1);
743
1134
 
744
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/Option.js
1135
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Option.js
745
1136
  var none2 = () => none;
746
1137
  var some2 = some;
747
1138
  var isNone2 = isNone;
748
1139
  var isSome2 = isSome;
749
- var getOrElse2 = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value);
1140
+ var getOrElse = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value);
750
1141
  var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
751
- var fromNullable = (nullableValue) => nullableValue == null ? none2() : some2(nullableValue);
752
- var getOrUndefined = /* @__PURE__ */ getOrElse2(constUndefined);
1142
+ var fromNullishOr = (a) => a == null ? none2() : some2(a);
1143
+ var getOrUndefined = /* @__PURE__ */ getOrElse(constUndefined);
1144
+
1145
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Result.js
1146
+ var succeed2 = succeed;
1147
+ var fail2 = fail;
1148
+ var isFailure2 = isFailure;
1149
+ var isSuccess2 = isSuccess;
1150
+ var map = /* @__PURE__ */ dual(2, (self, f) => isSuccess2(self) ? succeed2(f(self.success)) : fail2(self.failure));
1151
+ var getOrElse2 = /* @__PURE__ */ dual(2, (self, onFailure) => isFailure2(self) ? onFailure(self.failure) : self.success);
753
1152
 
754
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/Record.js
1153
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Filter.js
1154
+ var apply = (filter2, input, ...args3) => {
1155
+ const result = filter2(input, ...args3);
1156
+ if (result === true) return succeed2(input);
1157
+ if (result === false) return fail2(input);
1158
+ return result;
1159
+ };
1160
+
1161
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/internal/array.js
1162
+ var isArrayNonEmpty = (self) => self.length > 0;
1163
+
1164
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Record.js
755
1165
  var map2 = /* @__PURE__ */ dual(2, (self, f) => {
756
1166
  const out = {
757
1167
  ...self
@@ -763,31 +1173,34 @@ var map2 = /* @__PURE__ */ dual(2, (self, f) => {
763
1173
  });
764
1174
  var keys = (self) => Object.keys(self);
765
1175
 
766
- // ../../node_modules/.pnpm/effect@3.19.14/node_modules/effect/dist/esm/Array.js
767
- var fromIterable = (collection) => Array.isArray(collection) ? collection : Array.from(collection);
1176
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Array.js
1177
+ var Array2 = globalThis.Array;
1178
+ var fromIterable = (collection) => Array2.isArray(collection) ? collection : Array2.from(collection);
768
1179
  var append = /* @__PURE__ */ dual(2, (self, last) => [...self, last]);
769
1180
  var appendAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable(self).concat(fromIterable(that)));
770
- var isArray = Array.isArray;
771
- var isEmptyArray = (self) => self.length === 0;
772
- var isEmptyReadonlyArray = isEmptyArray;
773
- var isNonEmptyReadonlyArray = isNonEmptyArray;
774
- var isOutOfBounds = (i, as) => i < 0 || i >= as.length;
1181
+ var isArray = Array2.isArray;
1182
+ var isArrayEmpty = (self) => self.length === 0;
1183
+ var isReadonlyArrayEmpty = isArrayEmpty;
1184
+ var isReadonlyArrayNonEmpty = isArrayNonEmpty;
1185
+ function isOutOfBounds(i, as) {
1186
+ return i < 0 || i >= as.length;
1187
+ }
775
1188
  var get = /* @__PURE__ */ dual(2, (self, index) => {
776
1189
  const i = Math.floor(index);
777
1190
  return isOutOfBounds(i, self) ? none2() : some2(self[i]);
778
1191
  });
779
- var unsafeGet = /* @__PURE__ */ dual(2, (self, index) => {
1192
+ var getUnsafe = /* @__PURE__ */ dual(2, (self, index) => {
780
1193
  const i = Math.floor(index);
781
1194
  if (isOutOfBounds(i, self)) {
782
- throw new Error(`Index ${i} out of bounds`);
1195
+ throw new Error(`Index out of bounds: ${i}`);
783
1196
  }
784
1197
  return self[i];
785
1198
  });
786
1199
  var head = /* @__PURE__ */ get(0);
787
- var headNonEmpty = /* @__PURE__ */ unsafeGet(0);
1200
+ var headNonEmpty = /* @__PURE__ */ getUnsafe(0);
788
1201
  var tailNonEmpty = (self) => self.slice(1);
789
1202
  var sort = /* @__PURE__ */ dual(2, (self, O) => {
790
- const out = Array.from(self);
1203
+ const out = Array2.from(self);
791
1204
  out.sort(O);
792
1205
  return out;
793
1206
  });
@@ -799,19 +1212,18 @@ var containsWith = (isEquivalent) => dual(2, (self, a) => {
799
1212
  }
800
1213
  return false;
801
1214
  });
802
- var _equivalence = /* @__PURE__ */ equivalence();
803
1215
  var intersectionWith = (isEquivalent) => {
804
1216
  const has = containsWith(isEquivalent);
805
1217
  return dual(2, (self, that) => {
806
- const bs = fromIterable(that);
807
- return fromIterable(self).filter((a) => has(bs, a));
1218
+ const thatArray = fromIterable(that);
1219
+ return fromIterable(self).filter((a) => has(thatArray, a));
808
1220
  });
809
1221
  };
810
- var intersection = /* @__PURE__ */ intersectionWith(_equivalence);
1222
+ var intersection = /* @__PURE__ */ intersectionWith(/* @__PURE__ */ asEquivalence());
811
1223
  var empty = () => [];
812
1224
  var map3 = /* @__PURE__ */ dual(2, (self, f) => self.map(f));
813
1225
  var flatMap = /* @__PURE__ */ dual(2, (self, f) => {
814
- if (isEmptyReadonlyArray(self)) {
1226
+ if (isReadonlyArrayEmpty(self)) {
815
1227
  return [];
816
1228
  }
817
1229
  const out = [];
@@ -824,19 +1236,20 @@ var flatMap = /* @__PURE__ */ dual(2, (self, f) => {
824
1236
  return out;
825
1237
  });
826
1238
  var flatten = /* @__PURE__ */ flatMap(identity);
827
- var filter = /* @__PURE__ */ dual(2, (self, predicate) => {
1239
+ var filter = /* @__PURE__ */ dual(2, (self, f) => {
828
1240
  const as = fromIterable(self);
829
1241
  const out = [];
830
1242
  for (let i = 0; i < as.length; i++) {
831
- if (predicate(as[i], i)) {
832
- out.push(as[i]);
1243
+ const result = apply(f, as[i], i);
1244
+ if (!isFailure2(result)) {
1245
+ out.push(result.success);
833
1246
  }
834
1247
  }
835
1248
  return out;
836
1249
  });
837
1250
  var dedupeWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
838
1251
  const input = fromIterable(self);
839
- if (isNonEmptyReadonlyArray(input)) {
1252
+ if (isReadonlyArrayNonEmpty(input)) {
840
1253
  const out = [headNonEmpty(input)];
841
1254
  const rest = tailNonEmpty(input);
842
1255
  for (const r of rest) {
@@ -848,7 +1261,7 @@ var dedupeWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
848
1261
  }
849
1262
  return [];
850
1263
  });
851
- var dedupe = (self) => dedupeWith(self, equivalence());
1264
+ var dedupe = (self) => dedupeWith(self, asEquivalence());
852
1265
  var join = /* @__PURE__ */ dual(2, (self, sep) => fromIterable(self).join(sep));
853
1266
 
854
1267
  // src/core/Nano.ts
@@ -858,7 +1271,7 @@ var NanoTag = class {
858
1271
  this.key = key;
859
1272
  }
860
1273
  };
861
- var Tag = (identifier) => new NanoTag(identifier);
1274
+ var Tag = (identifier2) => new NanoTag(identifier2);
862
1275
  var SingleShotGen2 = class _SingleShotGen {
863
1276
  called = false;
864
1277
  self;
@@ -884,12 +1297,12 @@ var SingleShotGen2 = class _SingleShotGen {
884
1297
  return new _SingleShotGen(this.self);
885
1298
  }
886
1299
  };
887
- var evaluate = /* @__PURE__ */ Symbol.for("Nano.evaluate");
888
- var contA = /* @__PURE__ */ Symbol.for("Nano.contA");
889
- var contE = /* @__PURE__ */ Symbol.for("Nano.contE");
890
- var contAll = /* @__PURE__ */ Symbol.for("Nano.contAll");
1300
+ var evaluate2 = /* @__PURE__ */ Symbol.for("Nano.evaluate");
1301
+ var contA2 = /* @__PURE__ */ Symbol.for("Nano.contA");
1302
+ var contE2 = /* @__PURE__ */ Symbol.for("Nano.contE");
1303
+ var contAll2 = /* @__PURE__ */ Symbol.for("Nano.contAll");
891
1304
  var NanoYield = /* @__PURE__ */ Symbol.for("Nano.yield");
892
- var args = /* @__PURE__ */ Symbol.for("Nano.args");
1305
+ var args2 = /* @__PURE__ */ Symbol.for("Nano.args");
893
1306
  var NanoDefectException = class {
894
1307
  constructor(message, lastSpan) {
895
1308
  this.message = message;
@@ -906,43 +1319,43 @@ var SucceedProto = {
906
1319
  ...PrimitiveProto,
907
1320
  _tag: "Success",
908
1321
  get value() {
909
- return this[args];
1322
+ return this[args2];
910
1323
  },
911
- [evaluate](fiber) {
912
- const cont = fiber.getCont(contA);
913
- return cont ? cont[contA](this[args], fiber) : fiber.yieldWith(this);
1324
+ [evaluate2](fiber) {
1325
+ const cont = fiber.getCont(contA2);
1326
+ return cont ? cont[contA2](this[args2], fiber) : fiber.yieldWith(this);
914
1327
  }
915
1328
  };
916
- var succeed = (value) => {
1329
+ var succeed3 = (value) => {
917
1330
  const nano = Object.create(SucceedProto);
918
- nano[args] = value;
1331
+ nano[args2] = value;
919
1332
  return nano;
920
1333
  };
921
- var FailureProto = {
1334
+ var FailureProto2 = {
922
1335
  ...PrimitiveProto,
923
1336
  _tag: "Failure",
924
1337
  get value() {
925
- return this[args];
1338
+ return this[args2];
926
1339
  },
927
- [evaluate](fiber) {
928
- const cont = fiber.getCont(contE);
929
- return cont ? cont[contE](this[args], fiber) : fiber.yieldWith(this);
1340
+ [evaluate2](fiber) {
1341
+ const cont = fiber.getCont(contE2);
1342
+ return cont ? cont[contE2](this[args2], fiber) : fiber.yieldWith(this);
930
1343
  }
931
1344
  };
932
- var fail = (error) => {
933
- const nano = Object.create(FailureProto);
934
- nano[args] = error;
1345
+ var fail3 = (error) => {
1346
+ const nano = Object.create(FailureProto2);
1347
+ nano[args2] = error;
935
1348
  return nano;
936
1349
  };
937
1350
  var SuspendProto = {
938
1351
  ...PrimitiveProto,
939
- [evaluate]() {
940
- return this[args]();
1352
+ [evaluate2]() {
1353
+ return this[args2]();
941
1354
  }
942
1355
  };
943
1356
  var suspend = (fn2) => {
944
1357
  const nano = Object.create(SuspendProto);
945
- nano[args] = fn2;
1358
+ nano[args2] = fn2;
946
1359
  return nano;
947
1360
  };
948
1361
  var NanoFiber = class {
@@ -954,7 +1367,7 @@ var NanoFiber = class {
954
1367
  runLoop(nano) {
955
1368
  let current = nano;
956
1369
  while (true) {
957
- current = current[evaluate](this);
1370
+ current = current[evaluate2](this);
958
1371
  if (current === NanoYield) {
959
1372
  return this._yielded;
960
1373
  }
@@ -964,7 +1377,7 @@ var NanoFiber = class {
964
1377
  while (true) {
965
1378
  const op = this._stack.pop();
966
1379
  if (!op) return void 0;
967
- const cont = op[contAll] && op[contAll](this);
1380
+ const cont = op[contAll2] && op[contAll2](this);
968
1381
  if (cont) return { [symbol3]: cont };
969
1382
  if (op[symbol3]) return op;
970
1383
  }
@@ -978,8 +1391,8 @@ var timings = {};
978
1391
  var timingsCount = {};
979
1392
  var WithSpanProto = {
980
1393
  ...PrimitiveProto,
981
- [evaluate](fiber) {
982
- const [fa, name] = this[args];
1394
+ [evaluate2](fiber) {
1395
+ const [fa, name] = this[args2];
983
1396
  if (!debugPerformance) return fa;
984
1397
  const previousSpan = fiber._lastSpan;
985
1398
  fiber._lastSpan = name;
@@ -990,103 +1403,103 @@ var WithSpanProto = {
990
1403
  const end = performance.now();
991
1404
  timings[name] = (timings[name] || 0) + (end - start);
992
1405
  fiber._lastSpan = previousSpan;
993
- return succeed(_);
1406
+ return succeed3(_);
994
1407
  },
995
1408
  onFailure: (_) => {
996
1409
  const end = performance.now();
997
1410
  timings[name] = (timings[name] || 0) + (end - start);
998
1411
  fiber._lastSpan = previousSpan;
999
- return fail(_);
1412
+ return fail3(_);
1000
1413
  }
1001
1414
  });
1002
1415
  }
1003
1416
  };
1004
1417
  var withSpan = (name) => (fa) => {
1005
1418
  const nano = Object.create(WithSpanProto);
1006
- nano[args] = [fa, name];
1419
+ nano[args2] = [fa, name];
1007
1420
  return nano;
1008
1421
  };
1009
1422
  var unsafeRun = (nano) => {
1010
1423
  const fiber = new NanoFiber();
1011
1424
  const result = fiber.runLoop(nano);
1012
1425
  if (result._tag === "Success") {
1013
- return right2(result.value);
1426
+ return succeed2(result.value);
1014
1427
  }
1015
- return left2(result.value);
1428
+ return fail2(result.value);
1016
1429
  };
1017
1430
  var OnSuccessProto = {
1018
1431
  ...PrimitiveProto,
1019
- [evaluate](fiber) {
1432
+ [evaluate2](fiber) {
1020
1433
  fiber._stack.push(this);
1021
- return this[args];
1434
+ return this[args2];
1022
1435
  }
1023
1436
  };
1024
1437
  var flatMap2 = dual(2, (fa, f) => {
1025
1438
  const nano = Object.create(OnSuccessProto);
1026
- nano[args] = fa;
1027
- nano[contA] = f;
1439
+ nano[args2] = fa;
1440
+ nano[contA2] = f;
1028
1441
  return nano;
1029
1442
  });
1030
- var map4 = dual(2, (fa, f) => flatMap2(fa, (_) => succeed(f(_))));
1443
+ var map4 = dual(2, (fa, f) => flatMap2(fa, (_) => succeed3(f(_))));
1031
1444
  var SyncProto = {
1032
1445
  ...PrimitiveProto,
1033
- [evaluate](fiber) {
1034
- const value = this[args]();
1035
- const cont = fiber.getCont(contA);
1036
- return cont ? cont[contA](value, fiber) : fiber.yieldWith(succeed(value));
1446
+ [evaluate2](fiber) {
1447
+ const value = this[args2]();
1448
+ const cont = fiber.getCont(contA2);
1449
+ return cont ? cont[contA2](value, fiber) : fiber.yieldWith(succeed3(value));
1037
1450
  }
1038
1451
  };
1039
1452
  var sync = (f) => {
1040
1453
  const nano = Object.create(SyncProto);
1041
- nano[args] = f;
1454
+ nano[args2] = f;
1042
1455
  return nano;
1043
1456
  };
1044
- var void_ = succeed(void 0);
1457
+ var void_ = succeed3(void 0);
1045
1458
  var FromIteratorProto = {
1046
1459
  ...PrimitiveProto,
1047
- [contA](value, fiber) {
1048
- const state = this[args][0].next(value);
1049
- if (state.done) return succeed(state.value);
1460
+ [contA2](value, fiber) {
1461
+ const state = this[args2][0].next(value);
1462
+ if (state.done) return succeed3(state.value);
1050
1463
  fiber._stack.push(this);
1051
1464
  return state.value;
1052
1465
  },
1053
- [evaluate](fiber) {
1054
- return this[contA](this[args][1], fiber);
1466
+ [evaluate2](fiber) {
1467
+ return this[contA2](this[args2][1], fiber);
1055
1468
  }
1056
1469
  };
1057
1470
  var unsafeFromIterator = (iterator, initial) => {
1058
1471
  const nano = Object.create(FromIteratorProto);
1059
- nano[args] = [iterator, initial];
1472
+ nano[args2] = [iterator, initial];
1060
1473
  return nano;
1061
1474
  };
1062
- var gen = (...args2) => suspend(() => unsafeFromIterator(args2[0]()));
1063
- var fn = (_) => (body) => (...args2) => withSpan(_)(suspend(() => unsafeFromIterator(body(...args2))));
1475
+ var gen = (...args3) => suspend(() => unsafeFromIterator(args3[0]()));
1476
+ var fn = (_) => (body) => (...args3) => withSpan(_)(suspend(() => unsafeFromIterator(body(...args3))));
1064
1477
  var MatchProto = {
1065
1478
  ...PrimitiveProto,
1066
- [evaluate](fiber) {
1479
+ [evaluate2](fiber) {
1067
1480
  fiber._stack.push(this);
1068
- return this[args];
1481
+ return this[args2];
1069
1482
  }
1070
1483
  };
1071
1484
  var match = (fa, opts) => {
1072
1485
  const nano = Object.create(MatchProto);
1073
- nano[args] = fa;
1074
- nano[contA] = opts.onSuccess;
1075
- nano[contE] = opts.onFailure;
1486
+ nano[args2] = fa;
1487
+ nano[contA2] = opts.onSuccess;
1488
+ nano[contE2] = opts.onFailure;
1076
1489
  return nano;
1077
1490
  };
1078
1491
  var orElse2 = (f) => (fa) => {
1079
1492
  const nano = Object.create(MatchProto);
1080
- nano[args] = fa;
1081
- nano[contE] = (_) => _ instanceof NanoDefectException ? fail(_) : f(_);
1493
+ nano[args2] = fa;
1494
+ nano[contE2] = (_) => _ instanceof NanoDefectException ? fail3(_) : f(_);
1082
1495
  return nano;
1083
1496
  };
1084
1497
  var firstSuccessOf = (arr) => arr.slice(1).reduce((arr2, fa) => orElse2(() => fa)(arr2), arr[0]);
1085
1498
  var ProvideServiceProto = {
1086
1499
  ...PrimitiveProto,
1087
- [evaluate](fiber) {
1500
+ [evaluate2](fiber) {
1088
1501
  const prevServices = fiber._services;
1089
- const [fa, tag, value] = this[args];
1502
+ const [fa, tag, value] = this[args2];
1090
1503
  fiber._services = {
1091
1504
  ...fiber._services,
1092
1505
  [tag.key]: value
@@ -1094,54 +1507,54 @@ var ProvideServiceProto = {
1094
1507
  return match(fa, {
1095
1508
  onSuccess: (_) => {
1096
1509
  fiber._services = prevServices;
1097
- return succeed(_);
1510
+ return succeed3(_);
1098
1511
  },
1099
1512
  onFailure: (_) => {
1100
1513
  fiber._services = prevServices;
1101
- return fail(_);
1514
+ return fail3(_);
1102
1515
  }
1103
1516
  });
1104
1517
  }
1105
1518
  };
1106
1519
  var provideService = (tag, value) => (fa) => {
1107
1520
  const nano = Object.create(ProvideServiceProto);
1108
- nano[args] = [fa, tag, value];
1521
+ nano[args2] = [fa, tag, value];
1109
1522
  return nano;
1110
1523
  };
1111
1524
  var ServiceProto = {
1112
1525
  ...PrimitiveProto,
1113
- [evaluate](fiber) {
1114
- const tag = this[args];
1526
+ [evaluate2](fiber) {
1527
+ const tag = this[args2];
1115
1528
  if (tag.key in fiber._services) {
1116
1529
  const value = fiber._services[tag.key];
1117
- const cont2 = fiber.getCont(contA);
1118
- return cont2 ? cont2[contA](value, fiber) : fiber.yieldWith(succeed(value));
1530
+ const cont2 = fiber.getCont(contA2);
1531
+ return cont2 ? cont2[contA2](value, fiber) : fiber.yieldWith(succeed3(value));
1119
1532
  }
1120
- const cont = fiber.getCont(contE);
1121
- return cont ? cont[contE](tag, fiber) : fiber.yieldWith(fail(new NanoDefectException(`Service ${tag.key} not found`, fiber._lastSpan)));
1533
+ const cont = fiber.getCont(contE2);
1534
+ return cont ? cont[contE2](tag, fiber) : fiber.yieldWith(fail3(new NanoDefectException(`Service ${tag.key} not found`, fiber._lastSpan)));
1122
1535
  }
1123
1536
  };
1124
1537
  var service = (tag) => {
1125
1538
  const nano = Object.create(ServiceProto);
1126
- nano[args] = tag;
1539
+ nano[args2] = tag;
1127
1540
  return nano;
1128
1541
  };
1129
1542
  var CachedProto = {
1130
1543
  ...PrimitiveProto,
1131
- [evaluate](fiber) {
1132
- const [fa, type, key] = this[args];
1544
+ [evaluate2](fiber) {
1545
+ const [fa, type, key] = this[args2];
1133
1546
  const cache = fiber._cache[type] || /* @__PURE__ */ new WeakMap();
1134
1547
  fiber._cache[type] = cache;
1135
- const cached2 = cache.get(key);
1136
- if (cached2) return cached2;
1548
+ const cached = cache.get(key);
1549
+ if (cached) return cached;
1137
1550
  return match(fa, {
1138
1551
  onSuccess: (_) => {
1139
- cache.set(key, succeed(_));
1140
- return succeed(_);
1552
+ cache.set(key, succeed3(_));
1553
+ return succeed3(_);
1141
1554
  },
1142
1555
  onFailure: (_) => {
1143
- cache.set(key, fail(_));
1144
- return fail(_);
1556
+ cache.set(key, fail3(_));
1557
+ return fail3(_);
1145
1558
  }
1146
1559
  });
1147
1560
  }
@@ -1149,35 +1562,35 @@ var CachedProto = {
1149
1562
  function cachedBy(fa, type, lookupKey) {
1150
1563
  return (...p) => {
1151
1564
  const nano = Object.create(CachedProto);
1152
- nano[args] = [fa(...p), type, lookupKey(...p)];
1565
+ nano[args2] = [fa(...p), type, lookupKey(...p)];
1153
1566
  return nano;
1154
1567
  };
1155
1568
  }
1156
1569
  var option = (fa) => {
1157
1570
  const nano = Object.create(MatchProto);
1158
- nano[args] = fa;
1159
- nano[contA] = (_) => succeed(some2(_));
1160
- nano[contE] = (_) => _ instanceof NanoDefectException ? fail(_) : succeed(none2());
1571
+ nano[args2] = fa;
1572
+ nano[contA2] = (_) => succeed3(some2(_));
1573
+ nano[contE2] = (_) => _ instanceof NanoDefectException ? fail3(_) : succeed3(none2());
1161
1574
  return nano;
1162
1575
  };
1163
1576
  var orUndefined = (fa) => {
1164
1577
  const nano = Object.create(MatchProto);
1165
- nano[args] = fa;
1166
- nano[contA] = (_) => succeed(_);
1167
- nano[contE] = (_) => _ instanceof NanoDefectException ? fail(_) : succeed(void 0);
1578
+ nano[args2] = fa;
1579
+ nano[contA2] = (_) => succeed3(_);
1580
+ nano[contE2] = (_) => _ instanceof NanoDefectException ? fail3(_) : succeed3(void 0);
1168
1581
  return nano;
1169
1582
  };
1170
1583
  var ignore = (fa) => {
1171
1584
  const nano = Object.create(MatchProto);
1172
- nano[args] = fa;
1173
- nano[contA] = (_) => void_;
1174
- nano[contE] = (_) => _ instanceof NanoDefectException ? fail(_) : void_;
1585
+ nano[args2] = fa;
1586
+ nano[contA2] = (_) => void_;
1587
+ nano[contE2] = (_) => _ instanceof NanoDefectException ? fail3(_) : void_;
1175
1588
  return nano;
1176
1589
  };
1177
1590
  var all = fn("all")(
1178
- function* (...args2) {
1591
+ function* (...args3) {
1179
1592
  const results = [];
1180
- for (const fa of args2) {
1593
+ for (const fa of args3) {
1181
1594
  const result = yield* fa;
1182
1595
  results.push(result);
1183
1596
  }
@@ -1191,7 +1604,7 @@ function isValidSeverityLevel(value) {
1191
1604
  return value === "off" || value === "error" || value === "warning" || value === "message" || value === "suggestion";
1192
1605
  }
1193
1606
  function parseDiagnosticSeverity(config) {
1194
- if (!isRecord(config)) return {};
1607
+ if (!isObject(config)) return {};
1195
1608
  return Object.fromEntries(
1196
1609
  pipe(
1197
1610
  Object.entries(config),
@@ -1254,7 +1667,7 @@ function parse(config) {
1254
1667
  return {
1255
1668
  refactors: isObject(config) && hasProperty(config, "refactors") && isBoolean(config.refactors) ? config.refactors : defaults.refactors,
1256
1669
  diagnostics: isObject(config) && hasProperty(config, "diagnostics") && isBoolean(config.diagnostics) ? config.diagnostics : defaults.diagnostics,
1257
- diagnosticSeverity: isObject(config) && hasProperty(config, "diagnosticSeverity") && isRecord(config.diagnosticSeverity) ? parseDiagnosticSeverity(config.diagnosticSeverity) : defaults.diagnosticSeverity,
1670
+ diagnosticSeverity: isObject(config) && hasProperty(config, "diagnosticSeverity") && isObject(config.diagnosticSeverity) ? parseDiagnosticSeverity(config.diagnosticSeverity) : defaults.diagnosticSeverity,
1258
1671
  diagnosticsName: isObject(config) && hasProperty(config, "diagnosticsName") && isBoolean(config.diagnosticsName) ? config.diagnosticsName : defaults.diagnosticsName,
1259
1672
  missingDiagnosticNextLine: isObject(config) && hasProperty(config, "missingDiagnosticNextLine") && isString(config.missingDiagnosticNextLine) && isValidSeverityLevel(config.missingDiagnosticNextLine) ? config.missingDiagnosticNextLine : defaults.missingDiagnosticNextLine,
1260
1673
  includeSuggestionsInTsc: isObject(config) && hasProperty(config, "includeSuggestionsInTsc") && isBoolean(config.includeSuggestionsInTsc) ? config.includeSuggestionsInTsc : defaults.includeSuggestionsInTsc,
@@ -1269,7 +1682,7 @@ function parse(config) {
1269
1682
  allowedDuplicatedPackages: isObject(config) && hasProperty(config, "allowedDuplicatedPackages") && isArray(config.allowedDuplicatedPackages) && config.allowedDuplicatedPackages.every(isString) ? config.allowedDuplicatedPackages.map((_) => _.toLowerCase()) : defaults.allowedDuplicatedPackages,
1270
1683
  namespaceImportPackages: isObject(config) && hasProperty(config, "namespaceImportPackages") && isArray(config.namespaceImportPackages) && config.namespaceImportPackages.every(isString) ? config.namespaceImportPackages.map((_) => _.toLowerCase()) : defaults.namespaceImportPackages,
1271
1684
  barrelImportPackages: isObject(config) && hasProperty(config, "barrelImportPackages") && isArray(config.barrelImportPackages) && config.barrelImportPackages.every(isString) ? config.barrelImportPackages.map((_) => _.toLowerCase()) : defaults.barrelImportPackages,
1272
- importAliases: isObject(config) && hasProperty(config, "importAliases") && isRecord(config.importAliases) ? map2(config.importAliases, (value) => String(value)) : defaults.importAliases,
1685
+ importAliases: isObject(config) && hasProperty(config, "importAliases") && isObject(config.importAliases) ? map2(config.importAliases, (value) => String(value)) : defaults.importAliases,
1273
1686
  topLevelNamedReexports: isObject(config) && hasProperty(config, "topLevelNamedReexports") && isString(config.topLevelNamedReexports) && ["ignore", "follow"].includes(config.topLevelNamedReexports.toLowerCase()) ? config.topLevelNamedReexports.toLowerCase() : defaults.topLevelNamedReexports,
1274
1687
  renames: isObject(config) && hasProperty(config, "renames") && isBoolean(config.renames) ? config.renames : defaults.renames,
1275
1688
  noExternal: isObject(config) && hasProperty(config, "noExternal") && isBoolean(config.noExternal) ? config.noExternal : defaults.noExternal,
@@ -1288,9 +1701,9 @@ var TypeScriptProgram = Tag("TypeScriptProgram");
1288
1701
  var ChangeTracker = Tag("ChangeTracker");
1289
1702
  function getPackageJsonInfoCache(program) {
1290
1703
  try {
1291
- if (hasProperty(program, "getModuleResolutionCache") && isFunction2(program.getModuleResolutionCache)) {
1704
+ if (hasProperty(program, "getModuleResolutionCache") && isFunction(program.getModuleResolutionCache)) {
1292
1705
  const moduleResolutionCache = program.getModuleResolutionCache();
1293
- if (hasProperty(moduleResolutionCache, "getPackageJsonInfoCache") && isFunction2(moduleResolutionCache.getPackageJsonInfoCache)) {
1706
+ if (hasProperty(moduleResolutionCache, "getPackageJsonInfoCache") && isFunction(moduleResolutionCache.getPackageJsonInfoCache)) {
1294
1707
  return moduleResolutionCache.getPackageJsonInfoCache();
1295
1708
  }
1296
1709
  }
@@ -1301,7 +1714,7 @@ function getPackageJsonInfoCache(program) {
1301
1714
  }
1302
1715
  function getDirectoryPath(ts, path) {
1303
1716
  try {
1304
- if (hasProperty(ts, "getDirectoryPath") && isFunction2(ts.getDirectoryPath)) {
1717
+ if (hasProperty(ts, "getDirectoryPath") && isFunction(ts.getDirectoryPath)) {
1305
1718
  return ts.getDirectoryPath(path);
1306
1719
  }
1307
1720
  return path;
@@ -1310,7 +1723,7 @@ function getDirectoryPath(ts, path) {
1310
1723
  }
1311
1724
  }
1312
1725
  function makeGetModuleSpecifier(ts) {
1313
- if (!(hasProperty(ts, "moduleSpecifiers") && hasProperty(ts.moduleSpecifiers, "getModuleSpecifier") && isFunction2(ts.moduleSpecifiers.getModuleSpecifier))) return;
1726
+ if (!(hasProperty(ts, "moduleSpecifiers") && hasProperty(ts.moduleSpecifiers, "getModuleSpecifier") && isFunction(ts.moduleSpecifiers.getModuleSpecifier))) return;
1314
1727
  const _internal = ts.moduleSpecifiers.getModuleSpecifier;
1315
1728
  return (compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, options) => {
1316
1729
  return _internal(
@@ -1324,14 +1737,14 @@ function makeGetModuleSpecifier(ts) {
1324
1737
  };
1325
1738
  }
1326
1739
  function makeGetTemporaryModuleResolutionState(ts) {
1327
- if (hasProperty(ts, "getTemporaryModuleResolutionState") && isFunction2(ts.getTemporaryModuleResolutionState)) {
1740
+ if (hasProperty(ts, "getTemporaryModuleResolutionState") && isFunction(ts.getTemporaryModuleResolutionState)) {
1328
1741
  const _internal = ts.getTemporaryModuleResolutionState;
1329
1742
  return (cache, program, compilerOptions) => _internal(cache, program, compilerOptions);
1330
1743
  }
1331
1744
  return void 0;
1332
1745
  }
1333
1746
  function makeGetPackageScopeForPath(ts) {
1334
- if (hasProperty(ts, "getPackageScopeForPath") && isFunction2(ts.getPackageScopeForPath)) {
1747
+ if (hasProperty(ts, "getPackageScopeForPath") && isFunction(ts.getPackageScopeForPath)) {
1335
1748
  const _internal = ts.getPackageScopeForPath;
1336
1749
  return (path, state) => _internal(path, state);
1337
1750
  }
@@ -1589,7 +2002,7 @@ function makeTypeScriptUtils(ts) {
1589
2002
  }
1590
2003
  } else if (ts.isNamedImports(namedBindings)) {
1591
2004
  for (const importSpecifier of namedBindings.elements) {
1592
- const importProperty = fromNullable(importSpecifier.propertyName).pipe(
2005
+ const importProperty = fromNullishOr(importSpecifier.propertyName).pipe(
1593
2006
  orElse(() => some2(importSpecifier.name))
1594
2007
  );
1595
2008
  if (test(importSpecifier.name, statement.moduleSpecifier, importProperty)) {
@@ -1942,7 +2355,7 @@ var codeFixesToApplicableRefactor = fn("LSP.codeFixesToApplicableRefactor")(func
1942
2355
  var getEditsForRefactor = fn("LSP.getEditsForRefactor")(function* (refactors, sourceFile, positionOrRange, refactorName) {
1943
2356
  const refactor = refactors.find((refactor2) => refactorNameToFullyQualifiedName(refactor2.name) === refactorName);
1944
2357
  if (!refactor) {
1945
- return yield* fail(new RefactorNotApplicableError());
2358
+ return yield* fail3(new RefactorNotApplicableError());
1946
2359
  }
1947
2360
  const textRange = typeof positionOrRange === "number" ? { pos: positionOrRange, end: positionOrRange } : positionOrRange;
1948
2361
  return yield* refactor.apply(sourceFile, textRange);
@@ -1953,7 +2366,7 @@ var getEditsForCodeFixes = fn("LSP.getEditsForCodeFixes")(function* (codeFixes,
1953
2366
  (_) => codeFixNameToFullyQualifiedName(_.fixName) === refactorName && _.start <= textRange.pos && _.end >= textRange.end
1954
2367
  );
1955
2368
  if (!fixToRun) {
1956
- return yield* fail(new RefactorNotApplicableError());
2369
+ return yield* fail3(new RefactorNotApplicableError());
1957
2370
  }
1958
2371
  return fixToRun;
1959
2372
  });
@@ -2208,7 +2621,7 @@ var getEditsForCodegen = fn("LSP.getEditsForCodegen")(function* (codegens2, sour
2208
2621
  (codegen2) => codegen2.range.pos <= textRange.pos && codegen2.range.end >= textRange.end
2209
2622
  );
2210
2623
  if (inRangeCodegens.length !== 1) {
2211
- return yield* fail(new CodegenNotApplicableError("zero or multiple codegens in range"));
2624
+ return yield* fail3(new CodegenNotApplicableError("zero or multiple codegens in range"));
2212
2625
  }
2213
2626
  const { codegen, range } = inRangeCodegens[0];
2214
2627
  const edit = yield* codegen.apply(sourceFile, range);
@@ -2412,8 +2825,8 @@ function makeTypeCheckerUtils(ts, typeChecker, tsUtils) {
2412
2825
  };
2413
2826
  const expectedAndRealTypeCache = /* @__PURE__ */ new WeakMap();
2414
2827
  const expectedAndRealType = (sourceFile) => {
2415
- const cached2 = expectedAndRealTypeCache.get(sourceFile);
2416
- if (cached2) return cached2;
2828
+ const cached = expectedAndRealTypeCache.get(sourceFile);
2829
+ if (cached) return cached;
2417
2830
  const result = [];
2418
2831
  const nodeToVisit = [sourceFile];
2419
2832
  const appendNodeToVisit = (node) => {
@@ -2630,7 +3043,7 @@ var nanoLayer3 = (fa) => gen(function* () {
2630
3043
  });
2631
3044
  var TypeParserIssue = class _TypeParserIssue {
2632
3045
  _tag = "@effect/language-service/TypeParserIssue";
2633
- static issue = fail(new _TypeParserIssue());
3046
+ static issue = fail3(new _TypeParserIssue());
2634
3047
  };
2635
3048
  function typeParserIssue(_message, _type, _node) {
2636
3049
  return TypeParserIssue.issue;
@@ -2829,7 +3242,7 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
2829
3242
  if (signatures[0].typeParameters && signatures[0].typeParameters.length > 0) {
2830
3243
  return typeParserIssue("Invariant type should not have type parameters", type);
2831
3244
  }
2832
- return succeed(typeChecker.getReturnTypeOfSignature(signatures[0]));
3245
+ return succeed3(typeChecker.getReturnTypeOfSignature(signatures[0]));
2833
3246
  }
2834
3247
  function contravariantTypeArgument(type) {
2835
3248
  const signatures = typeChecker.getSignaturesOfType(type, ts.SignatureKind.Call);
@@ -2839,7 +3252,7 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
2839
3252
  if (signatures[0].typeParameters && signatures[0].typeParameters.length > 0) {
2840
3253
  return typeParserIssue("Invariant type should not have type parameters", type);
2841
3254
  }
2842
- return succeed(typeCheckerUtils.getTypeParameterAtPosition(signatures[0], 0));
3255
+ return succeed3(typeCheckerUtils.getTypeParameterAtPosition(signatures[0], 0));
2843
3256
  }
2844
3257
  function invariantTypeArgument(type) {
2845
3258
  const signatures = typeChecker.getSignaturesOfType(type, ts.SignatureKind.Call);
@@ -2849,7 +3262,7 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
2849
3262
  if (signatures[0].typeParameters && signatures[0].typeParameters.length > 0) {
2850
3263
  return typeParserIssue("Invariant type should not have type parameters", type);
2851
3264
  }
2852
- return succeed(typeChecker.getReturnTypeOfSignature(signatures[0]));
3265
+ return succeed3(typeChecker.getReturnTypeOfSignature(signatures[0]));
2853
3266
  }
2854
3267
  const pipeableType = cachedBy(
2855
3268
  function(type, atLocation) {
@@ -2862,7 +3275,7 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
2862
3275
  if (signatures.length === 0) {
2863
3276
  return typeParserIssue("'pipe' property is not callable", type, atLocation);
2864
3277
  }
2865
- return succeed(type);
3278
+ return succeed3(type);
2866
3279
  },
2867
3280
  "TypeParser.pipeableType",
2868
3281
  (type) => type
@@ -3326,7 +3739,7 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
3326
3739
  const type = typeCheckerUtils.getTypeAtLocation(yieldedExpression);
3327
3740
  if (!type) continue;
3328
3741
  const { A: successType } = yield* effectType(type, yieldedExpression);
3329
- let replacementNode = succeed(yieldedExpression);
3742
+ let replacementNode = succeed3(yieldedExpression);
3330
3743
  if (!explicitReturn && !(successType.flags & ts.TypeFlags.VoidLike)) {
3331
3744
  replacementNode = pipe(
3332
3745
  gen(function* () {
@@ -3537,15 +3950,15 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
3537
3950
  if (node.arguments.length === 0) {
3538
3951
  return typeParserIssue("Node is not a pipe call", void 0, node);
3539
3952
  }
3540
- const [subject, ...args2] = node.arguments;
3541
- return succeed({
3953
+ const [subject, ...args3] = node.arguments;
3954
+ return succeed3({
3542
3955
  node,
3543
3956
  subject,
3544
- args: args2,
3957
+ args: args3,
3545
3958
  kind: "pipe"
3546
3959
  });
3547
3960
  }
3548
- return succeed({
3961
+ return succeed3({
3549
3962
  node,
3550
3963
  subject: baseExpression,
3551
3964
  args: Array.from(node.arguments),
@@ -3555,8 +3968,8 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
3555
3968
  );
3556
3969
  }
3557
3970
  if (ts.isCallExpression(node) && ts.isIdentifier(node.expression) && ts.idText(node.expression) === "pipe" && node.arguments.length > 0) {
3558
- const [subject, ...args2] = node.arguments;
3559
- return succeed({ node, subject, args: args2, kind: "pipe" });
3971
+ const [subject, ...args3] = node.arguments;
3972
+ return succeed3({ node, subject, args: args3, kind: "pipe" });
3560
3973
  }
3561
3974
  return typeParserIssue("Node is not a pipe call", void 0, node);
3562
3975
  },
@@ -3571,7 +3984,7 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
3571
3984
  if (node.arguments.length !== 1) {
3572
3985
  return typeParserIssue("Node must have exactly one argument", void 0, node);
3573
3986
  }
3574
- return succeed({
3987
+ return succeed3({
3575
3988
  node,
3576
3989
  callee: node.expression,
3577
3990
  subject: node.arguments[0]
@@ -3633,7 +4046,7 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
3633
4046
  if (!callbackParameterType) {
3634
4047
  continue;
3635
4048
  }
3636
- return succeed({
4049
+ return succeed3({
3637
4050
  type: callbackParameterType
3638
4051
  });
3639
4052
  }
@@ -4045,9 +4458,9 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
4045
4458
  let accessors2 = void 0;
4046
4459
  let dependencies = void 0;
4047
4460
  if (wholeCall.arguments.length >= 2) {
4048
- const args2 = wholeCall.arguments[1];
4049
- if (ts.isObjectLiteralExpression(args2)) {
4050
- for (const property of args2.properties) {
4461
+ const args3 = wholeCall.arguments[1];
4462
+ if (ts.isObjectLiteralExpression(args3)) {
4463
+ for (const property of args3.properties) {
4051
4464
  if (ts.isPropertyAssignment(property) && property.name && ts.isIdentifier(property.name) && ts.idText(property.name) === "accessors" && property.initializer && property.initializer.kind === ts.SyntaxKind.TrueKeyword) {
4052
4465
  accessors2 = true;
4053
4466
  }
@@ -4252,7 +4665,7 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
4252
4665
  const body = node.body;
4253
4666
  const returnType = node.type;
4254
4667
  if (ts.isArrowFunction(node) && !ts.isBlock(body)) {
4255
- return succeed({
4668
+ return succeed3({
4256
4669
  node,
4257
4670
  body,
4258
4671
  expression: body,
@@ -4270,7 +4683,7 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
4270
4683
  if (!stmt.expression) {
4271
4684
  return typeParserIssue("Return statement must have an expression", void 0, node);
4272
4685
  }
4273
- return succeed({
4686
+ return succeed3({
4274
4687
  node,
4275
4688
  body,
4276
4689
  expression: stmt.expression,
@@ -4295,7 +4708,7 @@ function make2(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
4295
4708
  if (body.statements.length !== 0) {
4296
4709
  return typeParserIssue("Block must have zero statements", void 0, node);
4297
4710
  }
4298
- return succeed({
4711
+ return succeed3({
4299
4712
  node,
4300
4713
  body,
4301
4714
  returnType
@@ -4992,10 +5405,10 @@ var getOrMakeKeyBuilder = fn("getOrMakeKeyBuilder")(function* (sourceFile) {
4992
5405
  keyBuilderCache.set(sourceFile.fileName, keyBuilder);
4993
5406
  return keyBuilder;
4994
5407
  });
4995
- function createString(sourceFile, identifier, kind) {
5408
+ function createString(sourceFile, identifier2, kind) {
4996
5409
  return map4(
4997
5410
  getOrMakeKeyBuilder(sourceFile),
4998
- (identifierBuilder) => identifierBuilder.createString(identifier, kind)
5411
+ (identifierBuilder) => identifierBuilder.createString(identifier2, kind)
4999
5412
  );
5000
5413
  }
5001
5414
 
@@ -5047,7 +5460,7 @@ var deterministicKeys = createDiagnostic({
5047
5460
  const parameterSourceFile = typeScriptUtils.getSourceFileOfNode(declaration);
5048
5461
  const paramText = parameterSourceFile.text.substring(declaration.pos, declaration.end);
5049
5462
  if (paramText.toLowerCase().includes("@effect-identifier")) {
5050
- return succeed({ className, keyStringLiteral: arg, target: "custom" });
5463
+ return succeed3({ className, keyStringLiteral: arg, target: "custom" });
5051
5464
  }
5052
5465
  }
5053
5466
  }
@@ -5342,7 +5755,7 @@ var effectFnOpportunity = createDiagnostic({
5342
5755
  const isWithSpan = yield* pipe(
5343
5756
  typeParser.isNodeReferenceToEffectModuleApi("withSpan")(callee),
5344
5757
  map4(() => true),
5345
- orElse2(() => succeed(false))
5758
+ orElse2(() => succeed3(false))
5346
5759
  );
5347
5760
  if (!isWithSpan) return void 0;
5348
5761
  if (expr.arguments.length === 0) return void 0;
@@ -5355,8 +5768,8 @@ var effectFnOpportunity = createDiagnostic({
5355
5768
  if (!bodyExpression) return yield* TypeParserIssue.issue;
5356
5769
  const { pipeArguments: pipeArguments2, subject } = yield* pipe(
5357
5770
  typeParser.pipeCall(bodyExpression),
5358
- map4(({ args: args2, subject: subject2 }) => ({ subject: subject2, pipeArguments: args2 })),
5359
- orElse2(() => succeed({ subject: bodyExpression, pipeArguments: [] }))
5771
+ map4(({ args: args3, subject: subject2 }) => ({ subject: subject2, pipeArguments: args3 })),
5772
+ orElse2(() => succeed3({ subject: bodyExpression, pipeArguments: [] }))
5360
5773
  );
5361
5774
  const { effectModule, generatorFunction } = yield* typeParser.effectGen(subject);
5362
5775
  const effectModuleName = ts.isIdentifier(effectModule) ? ts.idText(effectModule) : sourceEffectModuleName;
@@ -5373,17 +5786,17 @@ var effectFnOpportunity = createDiagnostic({
5373
5786
  const isInsideEffectFn = (fnNode) => {
5374
5787
  const parent = fnNode.parent;
5375
5788
  if (!parent || !ts.isCallExpression(parent)) {
5376
- return succeed(false);
5789
+ return succeed3(false);
5377
5790
  }
5378
5791
  if (parent.arguments[0] !== fnNode) {
5379
- return succeed(false);
5792
+ return succeed3(false);
5380
5793
  }
5381
5794
  return pipe(
5382
5795
  typeParser.effectFn(parent),
5383
5796
  orElse2(() => typeParser.effectFnGen(parent)),
5384
5797
  orElse2(() => typeParser.effectFnUntracedGen(parent)),
5385
5798
  map4(() => true),
5386
- orElse2(() => succeed(false))
5799
+ orElse2(() => succeed3(false))
5387
5800
  );
5388
5801
  };
5389
5802
  const parseEffectFnOpportunityTargetGen = fn("effectFnOpportunity.parseEffectFnOpportunityTarget")(
@@ -5403,7 +5816,7 @@ var effectFnOpportunity = createDiagnostic({
5403
5816
  if (!body || !ts.isBlock(body) || body.statements.length <= 5) {
5404
5817
  return TypeParserIssue.issue;
5405
5818
  }
5406
- return succeed({
5819
+ return succeed3({
5407
5820
  effectModuleName: sourceEffectModuleName,
5408
5821
  pipeArguments: [],
5409
5822
  generatorFunction: void 0,
@@ -5602,7 +6015,7 @@ var effectFnOpportunity = createDiagnostic({
5602
6015
  }).join(", ");
5603
6016
  const fnSignature = `function*${typeParamNames}(${paramNames}) { ... }`;
5604
6017
  const pipeArgsForWithSpan = pipeArguments2.slice(0, -1);
5605
- const pipeArgsSuffix = (args2) => args2.length > 0 ? ", ...pipeTransformations" : "";
6018
+ const pipeArgsSuffix = (args3) => args3.length > 0 ? ", ...pipeTransformations" : "";
5606
6019
  switch (firstFix.fixName) {
5607
6020
  case "effectFnOpportunity_toEffectFnWithSpan": {
5608
6021
  const traceName = explicitTraceExpression ? sourceFile.text.slice(explicitTraceExpression.pos, explicitTraceExpression.end).trim() : void 0;
@@ -5748,7 +6161,7 @@ var effectMapVoid = createDiagnostic({
5748
6161
  () => pipe(
5749
6162
  typeParser.lazyExpression(callback),
5750
6163
  flatMap2(
5751
- (lazy) => tsUtils.isVoidExpression(lazy.expression) ? succeed(lazy) : typeParserIssue("Expression is not void")
6164
+ (lazy) => tsUtils.isVoidExpression(lazy.expression) ? succeed3(lazy) : typeParserIssue("Expression is not void")
5752
6165
  )
5753
6166
  )
5754
6167
  ),
@@ -6409,11 +6822,11 @@ var leakingRequirements = createDiagnostic({
6409
6822
  memory,
6410
6823
  effectContextType,
6411
6824
  (type) => {
6412
- if (type.flags & ts.TypeFlags.Never) return succeed(true);
6825
+ if (type.flags & ts.TypeFlags.Never) return succeed3(true);
6413
6826
  return pipe(
6414
6827
  typeParser.scopeType(type, atLocation),
6415
6828
  map4(() => true),
6416
- orElse2(() => succeed(false))
6829
+ orElse2(() => succeed3(false))
6417
6830
  );
6418
6831
  }
6419
6832
  );
@@ -6828,7 +7241,7 @@ var missingEffectError = createDiagnostic({
6828
7241
  map3((_) => _.literal),
6829
7242
  filter((_) => ts.isLiteralExpression(_)),
6830
7243
  map3((_) => _.text),
6831
- sort(string2),
7244
+ sort(String2),
6832
7245
  map3(
6833
7246
  (_) => ts.factory.createPropertyAssignment(
6834
7247
  ts.factory.createIdentifier(_),
@@ -6921,7 +7334,7 @@ var missingEffectServiceDependency = createDiagnostic({
6921
7334
  );
6922
7335
  if (layerResult) {
6923
7336
  const servicesMemory = /* @__PURE__ */ new Map();
6924
- const excludeNever = (type) => succeed((type.flags & ts.TypeFlags.Never) !== 0);
7337
+ const excludeNever = (type) => succeed3((type.flags & ts.TypeFlags.Never) !== 0);
6925
7338
  const { allIndexes: requiredIndexes } = yield* typeCheckerUtils.appendToUniqueTypesMap(
6926
7339
  servicesMemory,
6927
7340
  layerResult.RIn,
@@ -7437,13 +7850,13 @@ var generate = fn("writeTagClassAccessors.generate")(function* (sourceFile, serv
7437
7850
  atLocation2,
7438
7851
  ts.NodeBuilderFlags.NoTruncation
7439
7852
  );
7440
- if (!successType) return fail("error generating success type");
7853
+ if (!successType) return fail3("error generating success type");
7441
7854
  const failureType = typeChecker.typeToTypeNode(
7442
7855
  returnedEffect.E,
7443
7856
  atLocation2,
7444
7857
  ts.NodeBuilderFlags.NoTruncation
7445
7858
  );
7446
- if (!failureType) return fail("error generating failure type");
7859
+ if (!failureType) return fail3("error generating failure type");
7447
7860
  const typeNode = ts.factory.createTypeReferenceNode(
7448
7861
  ts.factory.createQualifiedName(
7449
7862
  ts.factory.createIdentifier(effectIdentifier),
@@ -7451,7 +7864,7 @@ var generate = fn("writeTagClassAccessors.generate")(function* (sourceFile, serv
7451
7864
  ),
7452
7865
  [successType, failureType, contextType]
7453
7866
  );
7454
- return succeed(typeNode);
7867
+ return succeed3(typeNode);
7455
7868
  }),
7456
7869
  orElse2(
7457
7870
  () => pipe(
@@ -7462,8 +7875,8 @@ var generate = fn("writeTagClassAccessors.generate")(function* (sourceFile, serv
7462
7875
  atLocation2,
7463
7876
  ts.NodeBuilderFlags.NoTruncation
7464
7877
  );
7465
- if (!successType) return fail("error generating success type");
7466
- return succeed(ts.factory.createTypeReferenceNode(
7878
+ if (!successType) return fail3("error generating success type");
7879
+ return succeed3(ts.factory.createTypeReferenceNode(
7467
7880
  ts.factory.createQualifiedName(
7468
7881
  ts.factory.createIdentifier(effectIdentifier),
7469
7882
  ts.factory.createIdentifier("Effect")
@@ -7484,7 +7897,7 @@ var generate = fn("writeTagClassAccessors.generate")(function* (sourceFile, serv
7484
7897
  ),
7485
7898
  orElse2(() => {
7486
7899
  const successType = typeChecker.typeToTypeNode(type, atLocation2, ts.NodeBuilderFlags.NoTruncation);
7487
- if (!successType) return fail("error generating success type");
7900
+ if (!successType) return fail3("error generating success type");
7488
7901
  const typeNode = ts.factory.createTypeReferenceNode(
7489
7902
  ts.factory.createQualifiedName(
7490
7903
  ts.factory.createIdentifier(effectIdentifier),
@@ -7496,7 +7909,7 @@ var generate = fn("writeTagClassAccessors.generate")(function* (sourceFile, serv
7496
7909
  ts.factory.createTypeReferenceNode(ts.idText(className2))
7497
7910
  ]
7498
7911
  );
7499
- return succeed(typeNode);
7912
+ return succeed3(typeNode);
7500
7913
  })
7501
7914
  );
7502
7915
  const proxySignature = fn("writeTagClassAccessors.proxySignature")(
@@ -7507,7 +7920,7 @@ var generate = fn("writeTagClassAccessors.generate")(function* (sourceFile, serv
7507
7920
  atLocation2,
7508
7921
  ts.NodeBuilderFlags.NoTruncation
7509
7922
  );
7510
- if (!signatureDeclaration) return yield* fail("error generating signature");
7923
+ if (!signatureDeclaration) return yield* fail3("error generating signature");
7511
7924
  const returnType = yield* generateReturnType(
7512
7925
  typeChecker.getReturnTypeOfSignature(signature),
7513
7926
  atLocation2,
@@ -7556,21 +7969,21 @@ var parse2 = fn("writeTagClassAccessors.parse")(function* (node) {
7556
7969
  const typeChecker = yield* service(TypeCheckerApi);
7557
7970
  const typeParser = yield* service(TypeParser);
7558
7971
  const typeCheckerUtils = yield* service(TypeCheckerUtils);
7559
- if (typeParser.supportedEffect() === "v4") return yield* fail("not applicable to Effect v4");
7560
- if (!ts.isClassDeclaration(node)) return yield* fail("not a class declaration");
7972
+ if (typeParser.supportedEffect() === "v4") return yield* fail3("not applicable to Effect v4");
7973
+ if (!ts.isClassDeclaration(node)) return yield* fail3("not a class declaration");
7561
7974
  const { Service, accessors: accessors2, className, kind } = yield* pipe(
7562
7975
  map4(typeParser.extendsEffectService(node), (_) => ({ kind: "effectService", ..._ })),
7563
7976
  orElse2(
7564
7977
  () => map4(typeParser.extendsEffectTag(node), (_) => ({ kind: "effectTag", accessors: true, ..._ }))
7565
7978
  ),
7566
- orElse2(() => fail("not a class extending Effect.Service call"))
7979
+ orElse2(() => fail3("not a class extending Effect.Service call"))
7567
7980
  );
7568
- if (accessors2 !== true) return yield* fail("accessors are not enabled in the Effect.Service call");
7981
+ if (accessors2 !== true) return yield* fail3("accessors are not enabled in the Effect.Service call");
7569
7982
  const involvedMembers = [];
7570
7983
  const nonPrimitiveServices = typeCheckerUtils.unrollUnionMembers(Service).filter(
7571
7984
  (_) => !(_.flags & ts.TypeFlags.Number || _.flags & ts.TypeFlags.String || _.flags & ts.TypeFlags.Boolean || _.flags & ts.TypeFlags.Literal)
7572
7985
  );
7573
- if (nonPrimitiveServices.length === 0) return yield* fail("Service type is a primitive type");
7986
+ if (nonPrimitiveServices.length === 0) return yield* fail3("Service type is a primitive type");
7574
7987
  for (const serviceShape of nonPrimitiveServices) {
7575
7988
  for (const property of typeChecker.getPropertiesOfType(serviceShape)) {
7576
7989
  const propertyType = typeChecker.getTypeOfSymbolAtLocation(property, node);
@@ -7611,7 +8024,7 @@ var writeTagClassAccessors = createRefactor({
7611
8024
  const parentNodes = tsUtils.getAncestorNodesInRange(sourceFile, textRange);
7612
8025
  return yield* pipe(
7613
8026
  firstSuccessOf(parentNodes.map(parseNode)),
7614
- orElse2(() => fail(new RefactorNotApplicableError()))
8027
+ orElse2(() => fail3(new RefactorNotApplicableError()))
7615
8028
  );
7616
8029
  })
7617
8030
  });
@@ -7626,7 +8039,7 @@ var accessors = createCodegen({
7626
8039
  const typeParser = yield* service(TypeParser);
7627
8040
  const typeCheckerUtils = yield* service(TypeCheckerUtils);
7628
8041
  const nodeAndCommentRange = tsUtils.findNodeWithLeadingCommentAtPosition(sourceFile, textRange.pos);
7629
- if (!nodeAndCommentRange) return yield* fail(new CodegenNotApplicableError("no node and comment range"));
8042
+ if (!nodeAndCommentRange) return yield* fail3(new CodegenNotApplicableError("no node and comment range"));
7630
8043
  return yield* pipe(
7631
8044
  parse2(nodeAndCommentRange.node),
7632
8045
  map4(
@@ -7643,7 +8056,7 @@ var accessors = createCodegen({
7643
8056
  )
7644
8057
  })
7645
8058
  ),
7646
- orElse2((cause) => fail(new CodegenNotApplicableError(cause)))
8059
+ orElse2((cause) => fail3(new CodegenNotApplicableError(cause)))
7647
8060
  );
7648
8061
  })
7649
8062
  });
@@ -7667,14 +8080,14 @@ var annotate = createCodegen({
7667
8080
  variableDeclarations = [...variableDeclarations, node];
7668
8081
  }
7669
8082
  if (variableDeclarations.length === 0) {
7670
- return yield* fail(new CodegenNotApplicableError("not a variable declaration"));
8083
+ return yield* fail3(new CodegenNotApplicableError("not a variable declaration"));
7671
8084
  }
7672
8085
  for (const variableDeclaration of variableDeclarations) {
7673
8086
  if (!variableDeclaration.initializer) continue;
7674
8087
  const initializerType = typeCheckerUtils.getTypeAtLocation(variableDeclaration.initializer);
7675
8088
  if (!initializerType) continue;
7676
8089
  const enclosingNode = ts.findAncestor(variableDeclaration, (_) => tsUtils.isDeclarationKind(_.kind)) || sourceFile;
7677
- const initializerTypeNode = fromNullable(typeCheckerUtils.typeToSimplifiedTypeNode(
8090
+ const initializerTypeNode = fromNullishOr(typeCheckerUtils.typeToSimplifiedTypeNode(
7678
8091
  initializerType,
7679
8092
  enclosingNode,
7680
8093
  ts.NodeBuilderFlags.NoTruncation | ts.NodeBuilderFlags.IgnoreErrors
@@ -7687,7 +8100,7 @@ var annotate = createCodegen({
7687
8100
  result.push({ variableDeclaration, initializerTypeNode, hash: hash3 });
7688
8101
  }
7689
8102
  if (result.length === 0) {
7690
- return yield* fail(new CodegenNotApplicableError("no variable declarations with initializers"));
8103
+ return yield* fail3(new CodegenNotApplicableError("no variable declarations with initializers"));
7691
8104
  }
7692
8105
  const hash2 = cyrb53(result.map((_) => _.hash).join("/"));
7693
8106
  return {
@@ -7696,7 +8109,7 @@ var annotate = createCodegen({
7696
8109
  };
7697
8110
  });
7698
8111
  const nodeAndCommentRange = tsUtils.findNodeWithLeadingCommentAtPosition(sourceFile, textRange.pos);
7699
- if (!nodeAndCommentRange) return yield* fail(new CodegenNotApplicableError("no node and comment range"));
8112
+ if (!nodeAndCommentRange) return yield* fail3(new CodegenNotApplicableError("no node and comment range"));
7700
8113
  return yield* pipe(
7701
8114
  parse3(nodeAndCommentRange.node),
7702
8115
  map4(
@@ -7757,13 +8170,13 @@ var makeStructuralSchemaGenContext = fn("StructuralSchemaGen.makeContext")(
7757
8170
  ts.factory.createIdentifier(effectSchemaIdentifier),
7758
8171
  apiName
7759
8172
  ),
7760
- createApiCall: (apiName, args2) => ts.factory.createCallExpression(
8173
+ createApiCall: (apiName, args3) => ts.factory.createCallExpression(
7761
8174
  ts.factory.createPropertyAccessExpression(
7762
8175
  ts.factory.createIdentifier(effectSchemaIdentifier),
7763
8176
  apiName
7764
8177
  ),
7765
8178
  [],
7766
- args2
8179
+ args3
7767
8180
  ),
7768
8181
  hoistedSchemas: /* @__PURE__ */ new Map(),
7769
8182
  typeToStatementIndex: /* @__PURE__ */ new Map(),
@@ -7813,7 +8226,7 @@ var processType = fn(
7813
8226
  StructuralSchemaGenContext
7814
8227
  );
7815
8228
  if (processingContext.depth >= processingContext.maxDepth) {
7816
- return yield* fail(new UnsupportedTypeError(type, "Maximum depth exceeded"));
8229
+ return yield* fail3(new UnsupportedTypeError(type, "Maximum depth exceeded"));
7817
8230
  }
7818
8231
  let hoistName = fromIterable(nameToType.entries()).find(([_, existingType]) => existingType === type)?.[0];
7819
8232
  if (!hoistName && type && type.symbol && type.symbol.declarations && type.symbol.declarations.length === 1) {
@@ -7927,7 +8340,7 @@ var processTypeImpl = fn(
7927
8340
  const objectType = type;
7928
8341
  return yield* processObjectType(objectType, context);
7929
8342
  }
7930
- return yield* fail(
8343
+ return yield* fail3(
7931
8344
  new UnsupportedTypeError(
7932
8345
  type,
7933
8346
  `Type with flags ${type.flags} is not supported`
@@ -8007,7 +8420,7 @@ var processArrayType = fn(
8007
8420
  const { createApiCall, typeChecker, typeCheckerUtils } = yield* service(StructuralSchemaGenContext);
8008
8421
  const typeArgs = typeChecker.getTypeArguments(type);
8009
8422
  if (typeArgs.length === 0) {
8010
- return yield* fail(new UnsupportedTypeError(type, "Array type has no type arguments"));
8423
+ return yield* fail3(new UnsupportedTypeError(type, "Array type has no type arguments"));
8011
8424
  }
8012
8425
  const elementSchema = yield* processType(typeArgs[0], context);
8013
8426
  const expr = createApiCall("Array", [elementSchema]);
@@ -8083,7 +8496,7 @@ var processObjectType = fn(
8083
8496
  );
8084
8497
  }
8085
8498
  const indexInfos = typeChecker.getIndexInfosOfType(type);
8086
- const args2 = [
8499
+ const args3 = [
8087
8500
  ts.factory.createObjectLiteralExpression(propertyAssignments, propertyAssignments.length > 0)
8088
8501
  ];
8089
8502
  const records = [];
@@ -8098,7 +8511,7 @@ var processObjectType = fn(
8098
8511
  if (records.length > 0) {
8099
8512
  return [
8100
8513
  createApiCall("StructWithRest", [
8101
- createApiCall("Struct", args2),
8514
+ createApiCall("Struct", args3),
8102
8515
  ts.factory.createArrayLiteralExpression(
8103
8516
  records.map(({ key, value }) => createApiCall("Record", [key, value]))
8104
8517
  )
@@ -8130,7 +8543,7 @@ var processObjectType = fn(
8130
8543
  [ts.factory.createStringLiteral(context.hoistName)]
8131
8544
  ),
8132
8545
  [],
8133
- args2
8546
+ args3
8134
8547
  ),
8135
8548
  []
8136
8549
  )
@@ -8143,14 +8556,14 @@ var processObjectType = fn(
8143
8556
  return [ctx.hoistedSchemas.get(type)(), true];
8144
8557
  }
8145
8558
  for (const { key, value } of records) {
8146
- args2.push(
8559
+ args3.push(
8147
8560
  ts.factory.createObjectLiteralExpression([
8148
8561
  ts.factory.createPropertyAssignment("key", key),
8149
8562
  ts.factory.createPropertyAssignment("value", value)
8150
8563
  ])
8151
8564
  );
8152
8565
  }
8153
- return [createApiCall("Struct", args2), propertyAssignments.length === 0];
8566
+ return [createApiCall("Struct", args3), propertyAssignments.length === 0];
8154
8567
  }
8155
8568
  );
8156
8569
  var findNodeToProcess = fn("StructuralSchemaGen.findNodeToProcess")(
@@ -8237,7 +8650,7 @@ var process = fn("StructuralSchemaGen.process")(
8237
8650
  ([name, type]) => pipe(
8238
8651
  processType(type, createProcessingContext(typeParser.supportedEffect())),
8239
8652
  orElse2(
8240
- (error) => succeed(ts.addSyntheticLeadingComment(
8653
+ (error) => succeed3(ts.addSyntheticLeadingComment(
8241
8654
  ts.factory.createIdentifier(""),
8242
8655
  ts.SyntaxKind.MultiLineCommentTrivia,
8243
8656
  " " + String(error) + " ",
@@ -8310,10 +8723,10 @@ var process = fn("StructuralSchemaGen.process")(
8310
8723
  }
8311
8724
  );
8312
8725
  var applyAtNode = fn("StructuralSchemaGen.applyAtNode")(
8313
- function* (sourceFile, node, identifier, type, isExported) {
8726
+ function* (sourceFile, node, identifier2, type, isExported) {
8314
8727
  const changeTracker = yield* service(ChangeTracker);
8315
8728
  const ts = yield* service(TypeScriptApi);
8316
- const ctx = yield* process(sourceFile, node, /* @__PURE__ */ new Map([[ts.idText(identifier), type]]), isExported, false);
8729
+ const ctx = yield* process(sourceFile, node, /* @__PURE__ */ new Map([[ts.idText(identifier2), type]]), isExported, false);
8317
8730
  for (const statement of ctx.schemaStatements) {
8318
8731
  changeTracker.insertNodeAt(sourceFile, node.pos, statement, { prefix: "\n", suffix: "\n" });
8319
8732
  }
@@ -8332,13 +8745,13 @@ var typeToSchema = createCodegen({
8332
8745
  const program = yield* service(TypeScriptProgram);
8333
8746
  const inThisFile = yield* getCodegensForSourceFile([typeToSchema], sourceFile);
8334
8747
  if (inThisFile.length > 1) {
8335
- return yield* fail(
8748
+ return yield* fail3(
8336
8749
  new CodegenNotApplicableError("the typeToSchema codegen can be used only once per file")
8337
8750
  );
8338
8751
  }
8339
8752
  const parse3 = fn("typeToSchema.parse")(function* (node) {
8340
8753
  if (!ts.isTypeAliasDeclaration(node)) {
8341
- return yield* fail(
8754
+ return yield* fail3(
8342
8755
  new CodegenNotApplicableError(
8343
8756
  "this codegen is applicable only to a type alias where each object member is a schema to generate. e.g. `type ToGenerate = { UserSchema: User, TodoSchema: Todo}`"
8344
8757
  )
@@ -8346,7 +8759,7 @@ var typeToSchema = createCodegen({
8346
8759
  }
8347
8760
  const type = typeCheckerUtils.getTypeAtLocation(node.name);
8348
8761
  if (!type) {
8349
- return yield* fail(
8762
+ return yield* fail3(
8350
8763
  new CodegenNotApplicableError(
8351
8764
  "error getting the type to process"
8352
8765
  )
@@ -8379,7 +8792,7 @@ var typeToSchema = createCodegen({
8379
8792
  });
8380
8793
  const nodeAndCommentRange = tsUtils.findNodeWithLeadingCommentAtPosition(sourceFile, textRange.pos);
8381
8794
  if (!nodeAndCommentRange) {
8382
- return yield* fail(new CodegenNotApplicableError("no node and comment range affected"));
8795
+ return yield* fail3(new CodegenNotApplicableError("no node and comment range affected"));
8383
8796
  }
8384
8797
  return yield* pipe(
8385
8798
  parse3(nodeAndCommentRange.node),
@@ -8515,7 +8928,7 @@ var overriddenSchemaConstructor = createDiagnostic({
8515
8928
  const isSchema = yield* pipe(
8516
8929
  typeParser.effectSchemaType(typeAtLocation, type.expression),
8517
8930
  map4(() => true),
8518
- orElse2(() => succeed(false))
8931
+ orElse2(() => succeed3(false))
8519
8932
  );
8520
8933
  if (isSchema) {
8521
8934
  extendsSchema = true;
@@ -9122,11 +9535,11 @@ var schemaUnionOfLiterals = createDiagnostic({
9122
9535
  orElse2(() => void_)
9123
9536
  );
9124
9537
  if (isSchemaUnionCall) {
9125
- const args2 = fromIterable(node.arguments);
9126
- if (args2.length >= 2) {
9127
- const allAreCallExpressions = args2.every((arg) => ts.isCallExpression(arg));
9538
+ const args3 = fromIterable(node.arguments);
9539
+ if (args3.length >= 2) {
9540
+ const allAreCallExpressions = args3.every((arg) => ts.isCallExpression(arg));
9128
9541
  if (allAreCallExpressions) {
9129
- const literalChecks = args2.map((arg) => {
9542
+ const literalChecks = args3.map((arg) => {
9130
9543
  const callArg = arg;
9131
9544
  return pipe(
9132
9545
  typeParser.isNodeReferenceToEffectSchemaModuleApi("Literal")(callArg.expression),
@@ -9632,8 +10045,8 @@ var unnecessaryPipe = createDiagnostic({
9632
10045
  if (ts.isCallExpression(node)) {
9633
10046
  yield* pipe(
9634
10047
  typeParser.pipeCall(node),
9635
- map4(({ args: args2, subject }) => {
9636
- if (args2.length === 0) {
10048
+ map4(({ args: args3, subject }) => {
10049
+ if (args3.length === 0) {
9637
10050
  report({
9638
10051
  location: node,
9639
10052
  messageText: `This pipe call contains no arguments.`,
@@ -9752,7 +10165,7 @@ var unsupportedServiceAccessors = createDiagnostic({
9752
10165
  if (ts.isClassDeclaration(node)) {
9753
10166
  const parseResult = yield* pipe(
9754
10167
  parse2(node),
9755
- orElse2(() => succeed(null))
10168
+ orElse2(() => succeed3(null))
9756
10169
  );
9757
10170
  if (parseResult && parseResult.involvedMembers.length > 0) {
9758
10171
  const existingStaticMembers = /* @__PURE__ */ new Set();
@@ -9896,7 +10309,7 @@ function checkSourceFileWorker(tsInstance, program, sourceFile, compilerOptions,
9896
10309
  return _;
9897
10310
  })
9898
10311
  ),
9899
- getOrElse((e) => {
10312
+ getOrElse2((e) => {
9900
10313
  console.error(e.message, "at", e.lastSpan);
9901
10314
  return [];
9902
10315
  }),