"use strict";
exports.id = "lib-intermediate-esm_logic_operations_PnpmSyncCopyOperationPlugin_js";
exports.ids = ["lib-intermediate-esm_logic_operations_PnpmSyncCopyOperationPlugin_js"];
exports.modules = {

/***/ 714174
/*!******************************************************************************!*\
  !*** ./lib-intermediate-esm/logic/operations/PnpmSyncCopyOperationPlugin.js ***!
  \******************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   PnpmSyncCopyOperationPlugin: () => (/* binding */ PnpmSyncCopyOperationPlugin)
/* harmony export */ });
/* harmony import */ var pnpm_sync_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! pnpm-sync-lib */ 567749);
/* harmony import */ var pnpm_sync_lib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(pnpm_sync_lib__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rushstack/node-core-library */ 277275);
/* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _OperationStatus__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperationStatus */ 743278);
/* harmony import */ var _utilities_PnpmSyncUtilities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utilities/PnpmSyncUtilities */ 796490);
/* harmony import */ var _RushConstants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../RushConstants */ 370253);
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.





const PLUGIN_NAME = 'PnpmSyncCopyOperationPlugin';
class PnpmSyncCopyOperationPlugin {
    constructor(terminal) {
        this._terminal = terminal;
    }
    apply(hooks) {
        hooks.afterExecuteOperation.tapPromise(PLUGIN_NAME, async (runnerContext) => {
            const record = runnerContext;
            const { status, operation: { associatedProject: project } } = record;
            //skip if the phase is skipped or no operation
            if (status === _OperationStatus__WEBPACK_IMPORTED_MODULE_2__.OperationStatus.Skipped ||
                status === _OperationStatus__WEBPACK_IMPORTED_MODULE_2__.OperationStatus.NoOp ||
                status === _OperationStatus__WEBPACK_IMPORTED_MODULE_2__.OperationStatus.Failure) {
                return;
            }
            const pnpmSyncJsonPath = `${project.projectFolder}/${_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.nodeModulesFolderName}/${_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.pnpmSyncFilename}`;
            if (await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.FileSystem.exists(pnpmSyncJsonPath)) {
                const { PackageExtractor } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @rushstack/package-extractor */ 783380, 23));
                await (0,pnpm_sync_lib__WEBPACK_IMPORTED_MODULE_0__.pnpmSyncCopyAsync)({
                    pnpmSyncJsonPath,
                    ensureFolderAsync: _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.FileSystem.ensureFolderAsync,
                    forEachAsyncWithConcurrency: _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.Async.forEachAsync,
                    getPackageIncludedFiles: PackageExtractor.getPackageIncludedFilesAsync,
                    logMessageCallback: (logMessageOptions) => _utilities_PnpmSyncUtilities__WEBPACK_IMPORTED_MODULE_3__.PnpmSyncUtilities.processLogMessage(logMessageOptions, this._terminal)
                });
            }
        });
    }
}
//# sourceMappingURL=PnpmSyncCopyOperationPlugin.js.map

/***/ }

};
;
//# sourceMappingURL=lib-intermediate-esm_logic_operations_PnpmSyncCopyOperationPlugin_js.js.map