"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Options = exports.Inputs = exports.ExperienceResults = exports.ExperienceQueue = exports.Audience = exports.Tag = exports.View = exports.Decision = exports.Experience = exports.Experiment = exports.Change = exports.Variation = exports.Action = exports.ExperienceConfig = void 0;
class ExperienceConfig {
    constructor(DATA) {
        this.accountId = DATA['accountId'];
        this.namespace = DATA['namespace'];
        this.revision = DATA['revision'];
        this.anonymizeIP = DATA['anonymizeIP'];
        this.enableForceParameters = DATA['enableForceParameters'];
        this.experimental = DATA['experimental'];
        this.projectId = DATA['projectId'];
        this.layers = DATA['layers'];
        this.groups = DATA['groups'];
        this.audiences = DATA['audiences'];
        this.listTargetingKeys = DATA['listTargetingKeys'];
        this.visitorAttributes = DATA['visitorAttributes'];
        this.visitorIdLocator = DATA['visitorIdLocator'];
        this.integrationSettings = DATA['integrationSettings'];
        this.views = DATA['views'];
        this.events = DATA['events'];
        this.dimensions = DATA['dimensions'];
        this.interestGroups = DATA['interestGroups'];
        this.tagGroups = DATA['tagGroups'];
        this.plugins = DATA['plugins'];
        this.projectJS = DATA['projectJS'];
    }
}
exports.ExperienceConfig = ExperienceConfig;
class Action {
    constructor(DATA) {
        this.pageId = DATA['pageId'];
        this.viewId = DATA['viewId'];
        this.changes = DATA['changes'];
        this.transforms = DATA['transforms']; //TODO
    }
}
exports.Action = Action;
class Variation {
    constructor(DATA) {
        this.id = DATA['id'];
        this.name = DATA['name'];
        this.actions = DATA['actions']; //TODO
    }
}
exports.Variation = Variation;
class Change {
    constructor(DATA) {
        this.id = DATA['id'];
        this.src = DATA['src'];
        this.type = DATA['type'];
        this.dependencies = DATA['dependencies'];
        this.css = DATA['css'];
        this.attributes = DATA['attributes'];
        this.selector = DATA['selector'];
        this.transform = DATA['transform'];
    }
}
exports.Change = Change;
class Experiment {
    constructor(DATA) {
        this.id = DATA['id'];
        this.name = DATA['name'];
        this.audienceIds = DATA['audienceIds'];
        this.variations = DATA['variations']; //TODO
        this.integrationSettings = DATA['integrationSettings'];
        this.weightDistributions = DATA['weightDistributions'];
        this.bucketingStrategy = DATA['bucketingStrategy'];
        this.changes = DATA['changes']; //TODO
    }
}
exports.Experiment = Experiment;
// == Layer
// https://github.com/optimizely/client-js/blob/main/src/core/types.ts#L1831
class Experience {
    constructor(DATA) {
        this.changes = DATA['changes']; //TODO
        this.id = DATA['id'];
        this.name = DATA['name'];
        this.commitId = DATA['commitId'];
        this.groupId = DATA['groupId'];
        this.holdback = DATA['holdback'];
        this.activation = DATA['activation'];
        this.integrationSettings = DATA['integrationSettings'];
        this.integrationStringVersion = DATA['integrationStringVersion'];
        this.experiments = DATA['experiments']; //TODO
        this.policy = DATA['policy'];
        this.viewIds = DATA['viewIds'];
        this.weightDistributions = DATA['weightDistributions'];
        this.decisionMetadata = DATA['decisionMetadata'];
    }
}
exports.Experience = Experience;
class Decision {
    constructor(DATA) {
        this.layerId = DATA['layerId'];
        this.experimentId = DATA['experimentId'];
        this.variationId = DATA['variationId'];
        this.isLayerHoldback = DATA['isLayerHoldback'];
        this.reason = DATA['reason'];
        this.error = DATA['error'];
        this.apiName = DATA['pageId'];
        this.viewId = DATA['pageId'];
    }
}
exports.Decision = Decision;
// https://github.com/optimizely/client-js/blob/main/src/core/types.ts#L1976
class View {
    constructor(DATA) {
        this.id = DATA['id'];
        this.category = DATA['category'];
        this.apiName = DATA['apiName'];
        this.name = DATA['name'];
        this.staticConditions = DATA['staticConditions'];
        this.activationType = DATA['activationType'];
        this.activationCode = DATA['activationCode'];
        this.deactivationEnabled = DATA['deactivationEnabled'];
        this.undoOnDeactivation = DATA['undoOnDeactivation'];
        this.tags = DATA['tags'];
    }
}
exports.View = View;
class Tag {
    constructor(DATA) {
        this.category = DATA['category'];
        this.apiName = DATA['apiName'];
        this.locator = DATA['locator'];
        this.locatorType = DATA['locatorType'];
        this.valueType = DATA['valueType'];
    }
}
exports.Tag = Tag;
// https://github.com/optimizely/client-js/blob/main/src/core/types.ts#L1444
class Audience {
    constructor(DATA) {
        this.id = DATA['id'];
        this.name = DATA['name'];
        this.conditions = DATA['conditions'];
    }
}
exports.Audience = Audience;
class ExperienceQueue {
    constructor(DATA) {
        this.unappliedChangesetsIds = [];
        this.unevaluatedViewsIds = DATA['unevaluatedViews'];
        this.unevaluatedAudiencesIds = DATA['unevaluatedAudiences'];
        // TODO: Rename "undecidedExperiences" on web_sdk_manifest
        // https://github.com/optimizely/optimizely/pull/17401/files#diff-525248452779df7dcbe6d7507c08106a3dd949817c1e3faddc27a914d1f7e2ddR205
        this.undecidedLayerIds = DATA['undecidedExperiences'];
        this.unappliedChangesets = DATA['unappliedChangesets'];
    }
}
exports.ExperienceQueue = ExperienceQueue;
class ExperienceResults {
    constructor(DATA) {
        this.appliedChangesetsIds = [];
        this.activeViewsIds = DATA['activeViews'];
        this.inactiveViewsIds = DATA['inactiveViews'];
        this.activeAudiencesIds = DATA['activeAudiences'];
        this.inactiveAudiencesIds = DATA['inactiveAudiences'];
        // TODO: Rename "undecidedExperiences" on web_sdk_manifest
        // https://github.com/optimizely/optimizely/pull/17401/files#diff-525248452779df7dcbe6d7507c08106a3dd949817c1e3faddc27a914d1f7e2ddR214-R215
        this.activeLayerIds = DATA['activeExperiences'];
        this.inactiveLayerIds = DATA['inactiveExperiences'];
        this.appliedChangesets = DATA['appliedChangesets'];
        this.decisions = DATA['decisions'];
    }
}
exports.ExperienceResults = ExperienceResults;
class Inputs {
    constructor({ requestType = '', metadata = {}, cookies = {}, cookieDomain = '', cookieExpirationDays = 0, queryParams = new URLSearchParams(), requestHeaders = new Headers(), redirectInfo = {}, url = '', userAgent = '', visitorIp = '', bypassLogSampling = false, forceVariationIds = [], logLevel = '', priorRedirectCookie = '', webManifestS3Bucket = '', bustSnippetCache = false, optIn = false, isDebugMode = false, } = {}) {
        this.requestType = requestType;
        this.metadata = metadata;
        this.cookies = cookies;
        this.cookieDomain = cookieDomain;
        this.cookieExpirationDays = cookieExpirationDays;
        this.queryParams = queryParams;
        this.requestHeaders = requestHeaders;
        this.redirectInfo = redirectInfo;
        this.url = url;
        this.userAgent = userAgent;
        this.visitorIp = visitorIp;
        this.bypassLogSampling = bypassLogSampling;
        this.forceVariationIds = forceVariationIds;
        this.logLevel = logLevel;
        this.priorRedirectCookie = priorRedirectCookie;
        this.webManifestS3Bucket = webManifestS3Bucket;
        this.bustSnippetCache = bustSnippetCache;
        this.optIn = optIn;
        this.isDebugMode = isDebugMode;
    }
}
exports.Inputs = Inputs;
class Options {
    constructor({ accountId, snippetId, isProd, isSnippetless, nonce, position, cacheTTLs, deployId, fallback, existingSnippet, control, rewriter, environment, dev_host, dev_protocol, dev_port, dev_pathname, DATA, }) {
        this.accountId = accountId;
        this.snippetId = snippetId;
        this.isProd = isProd;
        this.isSnippetless = isSnippetless;
        this.nonce = nonce;
        this.position = position;
        this.cacheTTLs = cacheTTLs;
        this.deployId = deployId;
        this.fallback = fallback;
        this.existingSnippet = existingSnippet;
        this.control = control;
        this.rewriter = rewriter;
        this.environment = environment;
        this.dev_host = dev_host;
        this.dev_protocol = dev_protocol;
        this.dev_port = dev_port;
        this.dev_pathname = dev_pathname;
        this.DATA = DATA;
    }
}
exports.Options = Options;
