"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const Equal = require("./dist-esm-Equal.cjs");
const Hash = require("./dist-esm-Hash.cjs");
const Pipeable = require("./dist-esm-Pipeable.cjs");
const Utils = require("./dist-esm-Utils.cjs");
const version = require("./dist-esm-internal-version.cjs");
const EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
const StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
const SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
const ChannelTypeId = /* @__PURE__ */ Symbol.for("effect/Channel");
const effectVariance = {
  /* c8 ignore next */
  _R: (_) => _,
  /* c8 ignore next */
  _E: (_) => _,
  /* c8 ignore next */
  _A: (_) => _,
  _V: /* @__PURE__ */ version.getCurrentVersion()
};
const sinkVariance = {
  /* c8 ignore next */
  _A: (_) => _,
  /* c8 ignore next */
  _In: (_) => _,
  /* c8 ignore next */
  _L: (_) => _,
  /* c8 ignore next */
  _E: (_) => _,
  /* c8 ignore next */
  _R: (_) => _
};
const channelVariance = {
  /* c8 ignore next */
  _Env: (_) => _,
  /* c8 ignore next */
  _InErr: (_) => _,
  /* c8 ignore next */
  _InElem: (_) => _,
  /* c8 ignore next */
  _InDone: (_) => _,
  /* c8 ignore next */
  _OutErr: (_) => _,
  /* c8 ignore next */
  _OutElem: (_) => _,
  /* c8 ignore next */
  _OutDone: (_) => _
};
const EffectPrototype = {
  [EffectTypeId]: effectVariance,
  [StreamTypeId]: effectVariance,
  [SinkTypeId]: sinkVariance,
  [ChannelTypeId]: channelVariance,
  [Equal.symbol](that) {
    return this === that;
  },
  [Hash.symbol]() {
    return Hash.cached(this, Hash.random(this));
  },
  [Symbol.iterator]() {
    return new Utils.SingleShotGen(new Utils.YieldWrap(this));
  },
  pipe() {
    return Pipeable.pipeArguments(this, arguments);
  }
};
const StructuralPrototype = {
  [Hash.symbol]() {
    return Hash.cached(this, Hash.structure(this));
  },
  [Equal.symbol](that) {
    const selfKeys = Object.keys(this);
    const thatKeys = Object.keys(that);
    if (selfKeys.length !== thatKeys.length) {
      return false;
    }
    for (const key of selfKeys) {
      if (!(key in that && Equal.equals(this[key], that[key]))) {
        return false;
      }
    }
    return true;
  }
};
({
  ...StructuralPrototype
});
exports.ChannelTypeId = ChannelTypeId;
exports.EffectPrototype = EffectPrototype;
exports.EffectTypeId = EffectTypeId;
exports.SinkTypeId = SinkTypeId;
exports.StreamTypeId = StreamTypeId;
exports.StructuralPrototype = StructuralPrototype;
exports.effectVariance = effectVariance;
//# sourceMappingURL=dist-esm-internal-effectable.cjs.map
