using System.Text.Json;
namespace AIStudio.Assistants.VisualBriefing;
///
/// The data of a content artifact, as the content stage keeps it along with the artifact.
///
/// The content of each slot, by its ID.
/// The validated chart specifications.
/// The validated interaction controls.
/// The validated formula specifications.
/// The text for people who cannot see a component, by the ID of the component.
/// The sources of each component, by the ID of the component.
/// The fixed labels which the runtime of the briefing shows.
internal sealed record VisualBriefingContentData(
Dictionary Slots,
List Charts,
List Controls,
List Formulas,
Dictionary Accessibility,
Dictionary> SourceReferences,
VisualBriefingLabels Labels)
{
///
/// Gathers the data of a content artifact.
///
/// The content artifact.
/// The data of the artifact.
internal static VisualBriefingContentData Of(VisualBriefingContentArtifact artifact) => new(
artifact.Slots.ToDictionary(slot => slot.SlotId, slot => slot.Value, StringComparer.Ordinal),
artifact.Charts,
artifact.Controls,
artifact.Formulas,
artifact.AccessibilityTexts,
artifact.SourceReferences,
VisualBriefingLabels.Of(artifact.ResetLabel));
}