import * as tsplus_module_1 from "@tsplus/stdlib/collections/Chunk/join";
import * as tsplus_module_2 from "@tsplus/stdlib/collections/Chunk/definition";
import * as tsplus_module_3 from "@effect/core/stream/Stream/operations/map";
import * as tsplus_module_4 from "@effect/core/stream/Stream/operations/unchunks";
import * as tsplus_module_5 from "@effect/core/stream/Stream/operations/splitOnChunkFlatten";
import * as tsplus_module_6 from "@effect/core/stream/Stream/operations/chunks";
import * as tsplus_module_7 from "@effect/core/stream/Stream/operations/succeed";
import * as tsplus_module_8 from "@effect/core/stream/Stream/operations/flatMap";
/**
 * Splits strings on a delimiter.
 *
 * @tsplus fluent ets/Stream splitOn
 */

export function splitOn_(self, delimiter, __tsplusTrace) {
  return tsplus_module_8.flatMap_(tsplus_module_7.succeed(delimiter, __tsplusTrace), delimiter => tsplus_module_3.map_(tsplus_module_6.chunks(tsplus_module_5.splitOnChunkFlatten_(tsplus_module_4.unchunks(tsplus_module_3.map_(self, s => tsplus_module_2.from(s), __tsplusTrace), __tsplusTrace), () => tsplus_module_2.from(delimiter), __tsplusTrace), __tsplusTrace), chunk => tsplus_module_1.join_(chunk, ""), __tsplusTrace), __tsplusTrace);
}
/**
 * Splits strings on a delimiter.
 *
 * @tsplus static ets/Stream/Aspects splitOn
 */

export const splitOn = (delimiter, __tsplusTrace) => self => splitOn_(self, delimiter, __tsplusTrace);
//# sourceMappingURL=splitOn.mjs.map