"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
const api_1 = __importDefault(require("../manager/api"));
const manager_1 = require("../manager");
exports.default = (transport, deviceInfo) => (0, rxjs_1.from)(api_1.default.getDeviceVersion(deviceInfo.targetId, (0, manager_1.getProviderId)(deviceInfo))).pipe((0, operators_1.switchMap)(deviceVersion => (0, rxjs_1.from)(api_1.default.getCurrentFirmware({
    deviceId: deviceVersion.id,
    version: deviceInfo.version,
    provider: (0, manager_1.getProviderId)(deviceInfo),
}))), (0, operators_1.switchMap)(firmware => api_1.default.genuineCheck(transport, {
    targetId: deviceInfo.targetId,
    perso: firmware.perso,
})));
//# sourceMappingURL=genuineCheck.js.map