import * as tsplus_module_1 from "@tsplus/stdlib/collections/Chunk/isEmpty";
import * as tsplus_module_2 from "@effect/core/stream/Channel/operations/write";
import * as tsplus_module_3 from "@effect/core/stream/Channel/operations/identity";
import * as tsplus_module_4 from "@effect/core/stream/Channel/operations/zipRight";
import * as tsplus_module_5 from "@effect/core/collection/Chunk/operations/dropWhileEffect";
import * as tsplus_module_6 from "@effect/core/io/Effect/operations/map";
import * as tsplus_module_7 from "@effect/core/stream/Channel/operations/unwrap";
import * as tsplus_module_8 from "@effect/core/stream/Channel/operations/fail";
import * as tsplus_module_9 from "@effect/core/stream/Channel/operations/unit";
import * as tsplus_module_10 from "@effect/core/stream/Channel/operations/readWith";
import { SinkInternal } from "@effect/core/stream/Sink/operations/_internal/SinkInternal";
/**
 * @tsplus static ets/Sink/Ops dropWhileEffect
 */

export function dropWhileEffect(p, __tsplusTrace) {
  const loop = tsplus_module_10.readWith(input => tsplus_module_7.unwrap(() => tsplus_module_6.map_(tsplus_module_5.dropWhileEffect_(input, p, __tsplusTrace), leftover => tsplus_module_1.isEmpty(leftover) ? loop : tsplus_module_4.zipRight_(tsplus_module_2.write(() => leftover), () => tsplus_module_3.identity()), __tsplusTrace)), err => tsplus_module_8.fail(() => err), () => tsplus_module_9.unit);
  return new SinkInternal(loop);
}
//# sourceMappingURL=dropWhileEffect.mjs.map