{"version":3,"sources":["jsdelivr-header.js","/npm/codekon@1.1.1/dist/src/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;OCLS,QAAW,kBACX,QAAW,wBACX,aAAgB,8BAChB,eAAgB,eAAgB,gBAAiB,mBAAoB,uBAA2B,mBAIzG,MAAM,KAAO,UACT,IAAI,YAAE,EAAW,SAAE,SAAmB,MACtC,EAAW,SAAW,IAAM,EACvB,mBAAmB,KACpB,EAAc,mBAAmB,IAErC,IACI,IAAI,iBAcA,MAAM,IAAI,MAAM,IAAI,KAAO,mCAb3B,IACI,IAAI,kBAIA,MAAM,IAAI,MAAM,IAAI,KAAO,oCAH3B,eAAe,EAAU,EAKjC,CACA,MAAO,GACH,QAAQ,MAAM,EAClB,CAKR,CACA,MAAO,GACH,QAAQ,MAAM,EAClB,GAEJ,OAAO,OAAO,IACV,QAAQ,MAAM,EAAE","file":"/npm/codekon@1.1.1/dist/src/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/codekon@1.1.1/dist/src/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#!/usr/bin/env node\nimport { red } from \"kolorist\";\nimport { cli } from \"./cli/index.js\";\nimport { ORG_NAME } from \"./constants/index.js\";\nimport { installCommand, isGitInstalled, isPnpmInstalled, isValidProjectName, toValidProjectName, } from \"./utils/index.js\";\n/**\n * Main program entry point. Sanitises the project name, checks if git and pnpm are installed, and installs the template.\n */\nconst main = async () => {\n    let { projectName, template } = await cli();\n    template = ORG_NAME + \"/\" + template;\n    if (!isValidProjectName(projectName)) {\n        projectName = toValidProjectName(projectName);\n    }\n    try {\n        if (isGitInstalled()) {\n            try {\n                if (isPnpmInstalled()) {\n                    installCommand(template, projectName);\n                }\n                else {\n                    throw new Error(red(\"✖\") + \" pnpm is required for operation.\");\n                }\n            }\n            catch (e) {\n                console.error(e);\n            }\n        }\n        else {\n            throw new Error(red(\"✖\") + \" git is required for operation.\");\n        }\n    }\n    catch (e) {\n        console.error(e);\n    }\n};\nmain().catch((e) => {\n    console.error(e);\n});\n"]}