"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.taskRnvTargetLaunch = exports["default"] = void 0;var _platformManager = require("../../core/platformManager");
var _logger = require("../../core/systemManager/logger");
var _constants = require("../../core/constants");












var _tizen = require("../../core/sdkManager/deviceUtils/tizen");
var _webos = require("../../core/sdkManager/deviceUtils/webos");
var _android = require("../../core/sdkManager/deviceUtils/android");
var _apple = require("../../core/sdkManager/deviceUtils/apple");
var _kaios = require("../../core/sdkManager/deviceUtils/kaios");
var _taskManager = require("../../core/taskManager");function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}

var taskRnvTargetLaunch = /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(c, parentTask, originTask) {var platform, program, target;return regeneratorRuntime.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
            (0, _logger.logTask)('taskRnvTargetLaunch');_context.next = 3;return (

              (0, _platformManager.isPlatformSupported)(c, true));case 3:_context.next = 5;return (
              (0, _taskManager.executeTask)(c, _constants.TASK_WORKSPACE_CONFIGURE, _constants.TASK_TARGET_LAUNCH, originTask));case 5:

            platform = c.platform, program = c.program;
            target = program.target || c.files.workspace.config.defaultTargets[platform];_context.t0 =

            platform;_context.next = _context.t0 ===
            _constants.ANDROID ? 10 : _context.t0 ===
            _constants.ANDROID_TV ? 10 : _context.t0 ===
            _constants.FIRE_TV ? 10 : _context.t0 ===
            _constants.ANDROID_WEAR ? 10 : _context.t0 ===

            _constants.IOS ? 11 : _context.t0 ===
            _constants.TVOS ? 11 : _context.t0 ===

            _constants.TIZEN ? 12 : _context.t0 ===

            _constants.WEBOS ? 13 : _context.t0 ===

            _constants.KAIOS ? 14 : 15;break;case 10:return _context.abrupt("return", (0, _android.launchAndroidSimulator)(c, target));case 11:return _context.abrupt("return", (0, _apple.launchAppleSimulator)(c, target));case 12:return _context.abrupt("return", (0, _tizen.launchTizenSimulator)(c, target));case 13:return _context.abrupt("return", (0, _webos.launchWebOSimulator)(c, target));case 14:return _context.abrupt("return",
            (0, _kaios.launchKaiOSSimulator)(c, target));case 15:return _context.abrupt("return",

            Promise.reject("\"target launch\" command does not support ".concat(
            (0, _logger.chalk)().white.bold(
            platform), " platform yet. You will have to launch the emulator manually. Working on it!")));case 16:case "end":return _context.stop();}}}, _callee);}));return function taskRnvTargetLaunch(_x, _x2, _x3) {return _ref.apply(this, arguments);};}();exports.taskRnvTargetLaunch = taskRnvTargetLaunch;var _default =





{
  description: 'Launch specific emulator',
  fn: taskRnvTargetLaunch,
  task: 'target launch',
  params: _constants.PARAMS.withBase(),
  platforms: [],
  isGlobalScope: true };exports["default"] = _default;
//# sourceMappingURL=task.rnv.target.launch.js.map