"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ModelThreadWorker = void 0;
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
const BufferEnc_1 = require("./BufferEnc");
const zzstatic_1 = require("./zzstatic");
let myArgs = process.argv.slice(2);
class ModelThreadWorker {
    constructor() { }
    work() {
        let zz = new zzstatic_1.zzstatic(parseInt(myArgs[1]));
        let decrypter = new BufferEnc_1.BufferEnc();
        decrypter.key = Buffer.from(myArgs[1], 'base64');
        let buf = decrypter.decrypt(fs_1.default.readFileSync(myArgs[0]));
        let cache = zz.generateCache(buf);
        let outf = path_1.default.join(__dirname, path_1.default.parse(myArgs[0]).name + '.zzcache');
        fs_1.default.writeFileSync(outf, Buffer.from(JSON.stringify(cache, null, 2)));
    }
}
exports.ModelThreadWorker = ModelThreadWorker;
const thread = new ModelThreadWorker();
thread.work();
//# sourceMappingURL=ModelThreadWorker.js.map