import { getAddressPointerForEvent } from "applesauce-core/helpers";
import { ensureMarkedAddressPointerTag } from "../helpers/common-tags.js";
/** Includes the "a" tag for live streams */
export function includeLiveStreamTag(stream) {
    return async (draft, ctx) => {
        let tags = Array.from(draft.tags);
        const hint = await ctx.getEventRelayHint?.(stream.id);
        tags = ensureMarkedAddressPointerTag(tags, getAddressPointerForEvent(stream, hint ? [hint] : undefined), "root");
        return { ...draft, tags };
    };
}
