"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const core_1 = require("@oclif/core");
const open = require("open");
const command_base_exec_tenant_1 = require("../command-base-exec-tenant");
class Portal extends command_base_exec_tenant_1.CommandBaseExecTenant {
    captureArgs() {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const { flags } = yield this.parse(Portal);
            return [{}, false];
        });
    }
    buildCandidate_silently(partial, rootMap) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            return {};
        });
    }
    buildCandidate_interactively(partial, takeDefaults, rootMap) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            return {};
        });
    }
    buildCommandString(candidate, cmd) {
        cmd.push("--silent");
        return cmd;
    }
    executeTask(candidate) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const portalUrl = 'https://app.codiac.io/#/public/login';
            yield open(portalUrl, {});
        });
    }
}
exports.default = Portal;
Portal.description = 'Starts the codiac relay services, maintains container instance, and opens the web app.';
Portal.flags = {
    help: core_1.Flags.help({ char: 'h' }),
    silent: core_1.Flags.boolean({ exclusive: ["echo", "to-script"], description: 'Executes without any user interaction; fails on missing or invalid arguments.' }),
    echo: core_1.Flags.boolean({ exclusive: ["to-script", "silent"], description: 'Renders the equivalent non-interactive command for future use before executing.' }),
    "to-script": core_1.Flags.boolean({ exclusive: ["echo", "silent"], description: 'Renders the equivalent non-interactive command without executing it.' }),
};
Portal.args = {};
Portal.examples = [
    { description: "Open the Codiac portal.", command: "<%= config.bin %> <%= command.id %>" },
    { description: "Non-interactive invocation.", command: "<%= config.bin %> <%= command.id %> --silent" },
    { description: "Renders the equivalent silent command without executing.", command: "<%= config.bin %> <%= command.id %> --to-script" },
];
//# sourceMappingURL=portal.js.map