import TypedEnum from '../generic/typed-enum.js';
import TypedBytes from '../generic/typed-bytes.js';
import '../generic/typed-string.js';
import '../generic/typed-array.js';
import '../generic/typed-tuple.js';
import '../generic/typed-null.js';
import '../../utils/types/array.js';
import 'crypto';
import 'bs58';
import 'multiformats/bases/base58';
import 'varint';
import '../../utils/encoding/ss-58.js';
import TypedNumber from '../generic/typed-number.js';
import '../generic/typed-set.js';
import '../generic/typed-map.js';
import TypedStruct from '../generic/typed-struct.js';
import 'uuid';
import 'js-sha256';
import '../../utils/types/iterable.js';
import '../../utils/types/object.js';
import '../../utils/interfaces.js';
import '../../utils/assert.js';
import '../../utils/error.js';
import '../../utils/inheritance.js';
import '../../utils/types/set.js';
import '../generic/with-base.js';
import '../../utils/types/bytes.js';
import '../../utils/types/string.js';
import '../generic/with-catch-null.js';
import '../generic/with-eq.js';
import '../generic/any-of.js';
import '../generic/with-from.js';
import 'blake2b';
import '../generic/with-from-json-bytes.js';
import '../generic/create-placeholder.js';

const createAccumulatorVariants = (keyRef) => {
  class AccumulatorCommon extends TypedStruct {
    static Classes = {
      accumulated: class Accumulated extends TypedBytes {},
      keyRef,
    };
  }

  class UniversalAccumulatorValue extends TypedStruct {
    static Type = 'universal';

    static Classes = {
      common: AccumulatorCommon,
      maxSize: TypedNumber,
    };

    get accumulated() {
      return this.common.accumulated;
    }

    set accumulated(newAccumulated) {
      this.common.accumulated = newAccumulated;
    }

    get keyRef() {
      return this.common.keyRef;
    }
  }

  class Accumulator extends TypedEnum {
    get keyRef() {
      return this.value.keyRef;
    }

    get accumulated() {
      return this.value.accumulated;
    }

    set accumulated(newAccumulated) {
      this.value.accumulated = newAccumulated;
    }
  }

  class UniversalAccumulator extends Accumulator {
    static Type = 'universal';

    static Class = UniversalAccumulatorValue;
  }
  class KBUniversalAccumulator extends Accumulator {
    static Type = 'kbUniversal';

    static Class = AccumulatorCommon;
  }
  class PositiveAccumulator extends Accumulator {
    static Type = 'positive';

    static Class = AccumulatorCommon;
  }

  Accumulator.bindVariants(
    UniversalAccumulator,
    KBUniversalAccumulator,
    PositiveAccumulator,
  );

  return [
    AccumulatorCommon,
    Accumulator,
    UniversalAccumulator,
    KBUniversalAccumulator,
    PositiveAccumulator,
  ];
};

export { createAccumulatorVariants };
//# sourceMappingURL=variants.js.map
