export function samplePlayerBehaviorTelemetryFixture(options = {}) {
    const seed = normalizeSeed(options.seed ?? 0xb34a);
    const playerId = normalizePlayerId(options.playerId ?? "external-parity-runtime-player");
    const sessionSeconds = positive(options.sessionSeconds ?? 180, "sessionSeconds");
    const combat = count(options.combatEvents ?? 12, "combatEvents");
    const movement = count(options.movementEvents ?? 18, "movementEvents");
    const interaction = count(options.interactionEvents ?? 7, "interactionEvents");
    const progression = count(options.progressionEvents ?? 5, "progressionEvents");
    const success = count(options.successEvents ?? 24, "successEvents");
    const total = combat + movement + interaction + progression;
    const successRate = Number((success / Math.max(1, total)).toFixed(4));
    const eventsPerMinute = Number((total / Math.max(1, sessionSeconds / 60)).toFixed(3));
    const combatRatio = combat / Math.max(1, total);
    const movementRatio = movement / Math.max(1, total);
    const interactionRatio = interaction / Math.max(1, total);
    const progressionRatio = progression / Math.max(1, total);
    const playstyle = detectPlaystyle({ combatRatio, movementRatio, interactionRatio, progressionRatio, successRate, eventsPerMinute });
    const skillScore = successRate * 0.4 + Math.min(eventsPerMinute / 10, 1) * 0.3 + Math.min(4 / Math.max(1, total), 1) * 0.3;
    const skillLevel = skillForScore(skillScore);
    const engagement = sessionSeconds > 900 ? "hardcore" : sessionSeconds > 420 ? "dedicated" : sessionSeconds > 180 ? "regular" : "casual";
    const skills = [
        skill("combat", clamp01(successRate * 0.7 + combatRatio * 0.3), combat),
        skill("navigation", clamp01(0.45 + movementRatio * 0.65), movement),
        skill("objective-routing", clamp01(0.36 + progressionRatio * 1.1), progression),
        skill("interaction", clamp01(0.42 + interactionRatio * 1.15), interaction)
    ];
    const patterns = [
        { name: `${playstyle}-loop`, frequency: Number(Math.max(1, eventsPerMinute).toFixed(3)), confidence: Number((0.62 + successRate * 0.24).toFixed(3)) },
        { name: "objective-retry", frequency: Number((Math.max(0, total - success) / Math.max(1, sessionSeconds / 60)).toFixed(3)), confidence: Number((0.5 + (1 - successRate) * 0.32).toFixed(3)) }
    ];
    const insights = [
        {
            type: "playstyle",
            confidence: patterns[0]?.confidence ?? 0.6,
            evidence: [`combat=${combat}`, `movement=${movement}`, `progression=${progression}`],
            recommendations: [playstyle === "aggressive" ? "offer-combat-optional-objective" : "offer-navigation-shortcut"]
        },
        {
            type: "skill-estimate",
            confidence: Number((0.58 + skillScore * 0.3).toFixed(3)),
            evidence: [`successRate=${successRate}`, `eventsPerMinute=${eventsPerMinute}`],
            recommendations: [skillScore > 0.6 ? "raise-optional-challenge" : "keep-assistive-checkpoints"]
        }
    ];
    const core = {
        playerId,
        skillLevel,
        playstyle,
        engagement,
        successRate,
        eventsPerMinute,
        skills,
        patterns,
        insights
    };
    return {
        source: "origin-master-player-profile-event-analysis-adapted",
        playerId,
        profile: {
            skillLevel,
            playstyle,
            engagement,
            skills,
            preferences: [
                { category: "difficulty", value: skillScore > 0.6 ? "advanced" : "adaptive", strength: Number((0.62 + seededUnit(seed) * 0.22).toFixed(3)) },
                { category: "route", value: movementRatio > combatRatio ? "exploration" : "direct", strength: Number((0.56 + seededUnit(seed ^ 0x2735) * 0.2).toFixed(3)) }
            ],
            patterns,
            totalPlaytimeMs: Math.round(sessionSeconds * 1000),
            sessionCount: 3 + Math.round(seededUnit(seed ^ 0x9e37) * 4)
        },
        events: {
            total,
            byCategory: {
                combat,
                movement,
                interaction,
                progression,
                economy: 0,
                social: 0,
                custom: 0
            },
            bySeverity: {
                low: movement,
                medium: interaction + progression,
                high: combat,
                critical: 0
            },
            successRate,
            avgDurationMs: Number((180 + seededUnit(seed ^ 0xf00d) * 140).toFixed(2)),
            eventsPerMinute
        },
        sessionAnalysis: {
            durationMs: Math.round(sessionSeconds * 1000),
            dominantPlaystyle: playstyle,
            skillEstimate: skillLevel,
            insights
        },
        productionReadiness: {
            playerProfileTelemetry: true,
            eventTrackingTelemetry: true,
            behaviorPatternTelemetry: true,
            adaptiveSystemInputTelemetry: true
        },
        blockedClaims: [
            "production player modeling certification",
            "privacy/compliance analytics certification",
            "cloud telemetry pipeline parity",
            "Unity Analytics/Remote Config parity",
            "Unreal Insights gameplay telemetry parity"
        ],
        claimBoundary: "This fixture ports old smart PlayerProfile/EventTracker/BehaviorAnalyzer concepts into deterministic local runtime telemetry. It does not claim production player modeling, privacy/compliance analytics certification, cloud telemetry pipelines, Unity Analytics, or Unreal Insights parity.",
        hash: stableHash(JSON.stringify(core))
    };
}
function detectPlaystyle(stats) {
    if (stats.combatRatio > 0.45 && stats.eventsPerMinute > 8)
        return "aggressive";
    if (stats.movementRatio > 0.45 && stats.combatRatio < 0.35)
        return "exploration";
    if (stats.successRate > 0.7 && stats.combatRatio < 0.4)
        return "stealth";
    if (stats.eventsPerMinute > 10 && stats.progressionRatio > 0.2)
        return "speedrun";
    if (stats.interactionRatio > 0.35)
        return "completionist";
    if (stats.combatRatio > 0.3 && stats.successRate > 0.6)
        return "defensive";
    return "balanced";
}
function skillForScore(score) {
    if (score < 0.2)
        return "beginner";
    if (score < 0.4)
        return "novice";
    if (score < 0.6)
        return "intermediate";
    if (score < 0.8)
        return "advanced";
    return "expert";
}
function skill(area, level, sampleSize) {
    return {
        area,
        level: Number(level.toFixed(4)),
        confidence: Number(Math.min(1, Math.max(0.1, sampleSize / 40)).toFixed(3)),
        sampleSize
    };
}
function count(value, name) {
    if (!Number.isFinite(value) || value < 0)
        throw new Error(`${name} must be a non-negative finite number.`);
    return Math.trunc(value);
}
function positive(value, name) {
    if (!Number.isFinite(value) || value <= 0)
        throw new Error(`${name} must be a positive finite number.`);
    return value;
}
function normalizeSeed(seed) {
    if (!Number.isInteger(seed) || seed < 0)
        throw new Error("seed must be a non-negative integer.");
    return seed >>> 0;
}
function normalizePlayerId(playerId) {
    const normalized = playerId.trim();
    if (normalized.length === 0)
        throw new Error("playerId is required.");
    return normalized;
}
function clamp01(value) {
    return Math.max(0, Math.min(1, value));
}
function seededUnit(seed) {
    let value = seed >>> 0;
    value ^= value << 13;
    value ^= value >>> 17;
    value ^= value << 5;
    return (value >>> 0) / 0xffffffff;
}
function stableHash(value) {
    let hash = 2166136261;
    for (let index = 0; index < value.length; index += 1) {
        hash ^= value.charCodeAt(index);
        hash = Math.imul(hash, 16777619);
    }
    return (hash >>> 0).toString(16).padStart(8, "0");
}
//# sourceMappingURL=PlayerBehaviorTelemetryFixtures.js.map