import * as tsplus_module_1 from "@tsplus/stdlib/io/Eval/run";
import * as tsplus_module_2 from "@tsplus/stdlib/io/Eval/succeed";
import * as tsplus_module_3 from "@tsplus/stdlib/io/Eval/suspend";
import * as tsplus_module_4 from "@tsplus/stdlib/io/Eval/zipWith";
import { realFiberId } from "@effect/core/io/FiberId/definition";
/**
 * Determines if the `FiberId` is a `None`.
 *
 * @tsplus fluent ets/FiberId isNone
 */

export function isNone(self) {
  return tsplus_module_1.run(isNoneSafe(self));
}

function isNoneSafe(self) {
  void 0;

  switch (self._tag) {
    case "None":
      {
        return tsplus_module_2.succeed(() => true);
      }

    case "Runtime":
      {
        return tsplus_module_2.succeed(() => false);
      }

    case "Composite":
      {
        let base = tsplus_module_2.succeed(() => true);

        for (const fiberId of self.fiberIds) {
          base = tsplus_module_4.zipWith_(tsplus_module_3.suspend(() => isNoneSafe(fiberId)), () => base, (a, b) => a && b);
        }

        return base;
      }
  }
}
//# sourceMappingURL=isNone.mjs.map