/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/version-next@1.0.2/dist/cjs/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";function getUpdatedVersion(t,e){const r=t.split(".");return"patch"===e&&(r[2]=(Number(r[2])+1).toString()),"minor"===e&&(r[1]=(Number(r[1])+1).toString(),r[2]="0"),"major"===e&&(r[0]=(Number(r[0])+1).toString(),r[1]="0",r[2]="0"),r.join(".")}function getUpdatedStage(t,e){const[r,o]=(t||"").split(".");return t&&r===e?`${r}.${Number(o)+1}`:`${e}.0`}const VERSION_INCREMENT=["patch","minor","major"],VERSION_STAGE=["alpha","beta","rc"];function getNextVersion(t,e={type:"patch"}){if(!VERSION_INCREMENT.includes(e.type))throw new Error(`Incorrect version type: "${e.type}", it should be one of the following values: ${VERSION_INCREMENT.join(", ")}`);if(e.stage&&!VERSION_STAGE.includes(e.stage))throw new Error(`Incorrect version stage: "${e.stage}", it should be one of the following values: ${VERSION_STAGE.join(", ")}`);try{const[r,o]=t.split("-");return!o&&e.stage?`${getUpdatedVersion(r,e.type)}-${getUpdatedStage(o,e.stage)}`:o&&!e.stage?r:o||e.stage?`${r}-${getUpdatedStage(o,e.stage)}`:getUpdatedVersion(r,e.type)}catch(e){throw new Error(`Failed to parse version: "${t}"`)}}exports.getNextVersion=getNextVersion;
//# sourceMappingURL=/sm/981f9636af6b4994ea14551d967298d6780fa6bc2d2c29a4539f5ccdc07b87ef.map