import * as tsplus_module_1 from "@effect/core/stm/TRef/operations/unsafeGet";
import * as tsplus_module_2 from "@effect/core/stm/TMap/operations/indexOf";
import * as tsplus_module_3 from "@tsplus/stdlib/collections/Chunk/unsafeGet";
import * as tsplus_module_4 from "@tsplus/stdlib/structure/Equals";
import * as tsplus_module_5 from "@tsplus/stdlib/collections/List/find";
import * as tsplus_module_6 from "@tsplus/stdlib/data/Maybe/map";
import * as tsplus_module_7 from "@effect/core/stm/STM/operations/effect";
import { concreteTArray } from "@effect/core/stm/TArray/operations/_internal/InternalTArray";
import { concreteTMap } from "@effect/core/stm/TMap/operations/_internal/InternalTMap";
/**
 * Retrieves value associated with given key.
 *
 * @tsplus fluent ets/TMap get
 */

export function get_(self, k) {
  void 0;
  return tsplus_module_7.effect(journal => {
    const buckets = tsplus_module_1.unsafeGet_(self.tBuckets, journal);
    void 0;
    const idx = tsplus_module_2.indexOf(k, buckets.chunk.length);
    const bucket = tsplus_module_1.unsafeGet_(tsplus_module_3.unsafeGet_(buckets.chunk, idx), journal);
    return tsplus_module_6.map_(tsplus_module_5.find_(bucket, _ => tsplus_module_4.equals(_.get(0), k)), _ => _.get(1));
  });
}
/**
 * Retrieves value associated with given key.
 *
 * @tsplus static ets/TMap/Aspects get
 */

export const get = k => self => get_(self, k);
//# sourceMappingURL=get.mjs.map