"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const GlobalValue = require("./dist-esm-GlobalValue.cjs");
const errors = require("./dist-esm-internal-errors.cjs");
class SingleShotGen {
  self;
  called = false;
  constructor(self) {
    this.self = self;
  }
  /**
   * @since 2.0.0
   */
  next(a) {
    return this.called ? {
      value: a,
      done: true
    } : (this.called = true, {
      value: this.self,
      done: false
    });
  }
  /**
   * @since 2.0.0
   */
  return(a) {
    return {
      value: a,
      done: true
    };
  }
  /**
   * @since 2.0.0
   */
  throw(e) {
    throw e;
  }
  /**
   * @since 2.0.0
   */
  [Symbol.iterator]() {
    return new SingleShotGen(this.self);
  }
}
const YieldWrapTypeId = /* @__PURE__ */ Symbol.for("effect/Utils/YieldWrap");
class YieldWrap {
  /**
   * @since 3.0.6
   */
  #value;
  constructor(value) {
    this.#value = value;
  }
  /**
   * @since 3.0.6
   */
  [YieldWrapTypeId]() {
    return this.#value;
  }
}
function yieldWrapGet(self) {
  if (typeof self === "object" && self !== null && YieldWrapTypeId in self) {
    return self[YieldWrapTypeId]();
  }
  throw new Error(errors.getBugErrorMessage("yieldWrapGet"));
}
const structuralRegionState = /* @__PURE__ */ GlobalValue.globalValue("effect/Utils/isStructuralRegion", () => ({
  enabled: false,
  tester: void 0
}));
exports.SingleShotGen = SingleShotGen;
exports.YieldWrap = YieldWrap;
exports.YieldWrapTypeId = YieldWrapTypeId;
exports.structuralRegionState = structuralRegionState;
exports.yieldWrapGet = yieldWrapGet;
//# sourceMappingURL=dist-esm-Utils.cjs.map
