"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const strategy_1 = require("./strategy");
const util_1 = require("./util");
class GradualRolloutSessionIdStrategy extends strategy_1.Strategy {
    constructor() {
        super('gradualRolloutSessionId');
    }
    isEnabled(parameters, context) {
        const { sessionId } = context;
        if (!sessionId) {
            return false;
        }
        const percentage = Number(parameters.percentage);
        const groupId = parameters.groupId || '';
        const normalizedId = (0, util_1.normalizedStrategyValue)(sessionId, groupId);
        return percentage > 0 && normalizedId <= percentage;
    }
}
exports.default = GradualRolloutSessionIdStrategy;//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/bfcd46e04becbf1670511e8c1e9cb0f1c1d62983/node_modules/unleash-client/lib/strategy/gradual-rollout-session-id.js.map