@cyberskill/shared 1.119.0 → 1.121.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +3 -8
  2. package/dist/_tsup-dts-rollup.d.ts +3 -8
  3. package/dist/configs/config.util.cjs +1 -1
  4. package/dist/configs/config.util.js +1 -1
  5. package/dist/configs/eslint/index.cjs +1 -1
  6. package/dist/configs/eslint/index.js +1 -1
  7. package/dist/configs/index.cjs +1 -1
  8. package/dist/configs/index.js +1 -1
  9. package/dist/index.cjs +1 -1
  10. package/dist/index.d.cts +2 -3
  11. package/dist/index.d.ts +2 -3
  12. package/dist/index.js +1 -1
  13. package/dist/nodejs/cli/cli.util.cjs +1 -1
  14. package/dist/nodejs/cli/cli.util.js +1 -1
  15. package/dist/nodejs/cli/index.cjs +1 -1
  16. package/dist/nodejs/cli/index.js +1 -1
  17. package/dist/nodejs/command/command.util.cjs +1 -1
  18. package/dist/nodejs/command/command.util.js +1 -1
  19. package/dist/nodejs/command/index.cjs +1 -1
  20. package/dist/nodejs/command/index.js +1 -1
  21. package/dist/nodejs/fs/fs.util.cjs +1 -1
  22. package/dist/nodejs/fs/fs.util.d.cts +2 -3
  23. package/dist/nodejs/fs/fs.util.d.ts +2 -3
  24. package/dist/nodejs/fs/fs.util.js +1 -1
  25. package/dist/nodejs/fs/index.cjs +1 -1
  26. package/dist/nodejs/fs/index.d.cts +2 -3
  27. package/dist/nodejs/fs/index.d.ts +2 -3
  28. package/dist/nodejs/fs/index.js +1 -1
  29. package/dist/nodejs/index.cjs +1 -1
  30. package/dist/nodejs/index.d.cts +2 -3
  31. package/dist/nodejs/index.d.ts +2 -3
  32. package/dist/nodejs/index.js +1 -1
  33. package/dist/nodejs/mongo/index.cjs +1 -1
  34. package/dist/nodejs/mongo/index.js +1 -1
  35. package/dist/nodejs/mongo/mongo.util.cjs +1 -1
  36. package/dist/nodejs/mongo/mongo.util.js +1 -1
  37. package/dist/nodejs/package/index.cjs +1 -1
  38. package/dist/nodejs/package/index.js +1 -1
  39. package/dist/nodejs/package/package.util.cjs +1 -1
  40. package/dist/nodejs/package/package.util.js +1 -1
  41. package/dist/nodejs/path/index.cjs +1 -1
  42. package/dist/nodejs/path/index.js +1 -1
  43. package/dist/nodejs/path/path.constant.cjs +1 -1
  44. package/dist/nodejs/path/path.constant.js +1 -1
  45. package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
  46. package/dist/react/apollo-client/apollo-client.component.js +1 -1
  47. package/dist/react/apollo-client/index.cjs +1 -1
  48. package/dist/react/apollo-client/index.js +1 -1
  49. package/dist/react/index.cjs +1 -1
  50. package/dist/react/index.js +1 -1
  51. package/dist/react/vitest/index.cjs +1 -1
  52. package/dist/react/vitest/index.js +1 -1
  53. package/dist/react/vitest/vitest.unit.cjs +1 -1
  54. package/dist/react/vitest/vitest.unit.js +1 -1
  55. package/package.json +1 -2
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function a(e){r(o,s,i,a,c,"next",e)}function c(e){r(o,s,i,a,c,"throw",e)}a(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||a(e,n)||g(e,n)||c()}function f(e){return n(e)||o(e)||g(e)||u()}function p(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var v=Object.create;var y=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var b=function(e,t){return y(e,"name",{value:t,configurable:!0})};var E=function(e,t,n,r){var s=true,i=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":p(t))=="object"||typeof t=="function")try{var a=function(){var s=u.value;!j.call(e,s)&&s!==n&&y(e,s,{get:function(){return t[s]},enumerable:!(r=h(t,s))||r.enumerable})};for(var c=_(t)[Symbol.iterator](),u;!(s=(u=c.next()).done);s=true)a()}catch(e){i=true;o=e}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(i){throw o}}}return e};var I=function(e,t,n){return n=e!=null?v(x(e)):{},E(t||!e||!e.__esModule?y(n,"default",{value:e,enumerable:!0}):n,e)};var w=I(require("process"),1),S=require("yargs/helpers"),R=I(require("yargs/yargs"),1);var O={name:"@cyberskill/shared",type:"module",version:"1.118.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/nodejs/cli/index.ts lint","lint:fix":"tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"tsx src/nodejs/cli/index.ts lint:inspect",reset:"tsx src/nodejs/cli/index.ts reset",setup:"tsx src/nodejs/cli/index.ts setup",inspect:"tsx src/nodejs/cli/index.ts inspect","test:unit":"tsx src/nodejs/cli/index.ts test:unit","test:e2e":"tsx src/nodejs/cli/index.ts test:e2e",commitlint:"tsx src/nodejs/cli/index.ts commitlint","lint-staged":"tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.41.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.22","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.0","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.3",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var C=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var k=require("child_process"),P=I(require("process"),1),T=I(require("util"),1);var G=".cyberskill-storage";var U=I(require("@dotenvx/dotenvx"),1),N=require("envalid"),L=I(require("os"),1),q=I(require("path"),1),D=I(require("process"),1);var M=!1;function A(){M||(U.default.config(),M=!0)}b(A,"loadEnvFile");function F(){A();var e=(0,N.cleanEnv)(D.default.env,{CWD:(0,N.str)({default:D.default.cwd()}),DEBUG:(0,N.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,N.str)({default:q.default.join(L.default.homedir(),G)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}b(F,"getEnv");var B=function(e){return e.Error="error",e.Warning="warning",e}({});var K=I(require("chalk"),1),W=I(require("consola"),1),Y=require("graphql");var H=F();H.DEBUG||(W.default.level=4);function J(e){var t=K.default[e];return typeof t=="function"?t:K.default.green}b(J,"chalkKeyword");var $={silent:W.default.silent,level:W.default.level,fatal:W.default.fatal,error:W.default.error,warn:W.default.warn,log:W.default.log,info:W.default.info,success:W.default.success,ready:W.default.ready,start:W.default.start,box:W.default.box,debug:W.default.debug,trace:W.default.trace,verbose:W.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){W.default.box(K.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;W.default.log("".concat(K.default.gray("File:")," ").concat(K.default.blue("".concat(t).concat(r?":".concat(r):"")))),s&&W.default.log(" ".concat(J(n)("Rule:")," ").concat(s)),W.default.log(" ".concat(J(n)("Message:")," ").concat(i))}),W.default.box(J(n)("".concat(e," : ").concat(t.length))),W.default.log(K.default.gray("─".repeat(40)))}};var V={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var z=I(require("node-fetch"),1);var Q=I(require("fs-extra"),1),X=require("path");var Z=Q.default,ee=Z.lstatSync,et=Z.readdirSync,en=Z.mkdirSync,er=Z.readFileSync,es=Z.writeFileSync,ei=Z.appendFileSync,eo=Z.unlinkSync,ea=Z.statSync,ec=Q.default.readJsonSync,eu=Q.default.writeJsonSync;function el(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return Q.default.pathExistsSync(e)})}b(el,"pathExistsSync");function ed(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){el(e)&&Q.default.removeSync(e)})}b(ed,"removeSync");var ef=I(require("path"),1);var ep=F();function eg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,ef.resolve).apply(this,[ep.CWD].concat(f(t)))}b(eg,"resolveWorkingPath");function em(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,ef.join).apply(this,f(t))}b(em,"join");var ev=F(),ey=ev.CWD,eh="@cyberskill/shared",e_="node_modules",ex="dist",ej="package.json",eb="package-lock.json",eE="tsconfig.json",eI=".gitignore",ew=".simple-git-hooks.json",eS="pnpm-lock.yaml",eR=".git/hooks/",eO=".git/COMMIT_EDITMSG",eC=".migrate-mongo.config.js",ek=em(ey,e_,eh,ex),eP="cyberskill",eT="src/nodejs/cli/index.ts",eG="eslint",eU="eslint",eN="vitest",eL="playwright",eq="vitest",eD="@commitlint/cli",eM="commitlint",eA="lint-staged",eF="lint-staged",eB="typescript",eK="tsc",eW="tsx",eY="git",eH="pnpm",eJ="pnpm exec",e$="simple-git-hooks",eV="simple-git-hooks",ez="@eslint/config-inspector",eQ="eslint-config-inspector",eX="node-modules-inspector",eZ="node-modules-inspector",e0="migrate-mongo",e1="./node_modules/migrate-mongo/bin/migrate-mongo",e2={CYBERSKILL_DIRECTORY:ek,WORKING_DIRECTORY:ey,TS_CONFIG:eg(eE),GIT_IGNORE:eg(eI),GIT_HOOK:eg(eR),GIT_COMMIT_MSG:eg(eO),SIMPLE_GIT_HOOKS_JSON:eg(ew),PACKAGE_JSON:eg(ej),PACKAGE_LOCK_JSON:eg(eb),PNPM_LOCK_YAML:eg(eS),NODE_MODULES:eg(e_),MIGRATE_MONGO_CONFIG:eg(eC),LINT_STAGED_CONFIG:eg("".concat(ek,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:eg("".concat(ek,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:eg("".concat(ek,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eg("".concat(ek,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eg("".concat(ek,"/react/vitest/vitest.e2e.js"))};function e4(e){var t=e.isCurrentProject;return l({"pre-commit":eF,"commit-msg":eM},t&&{"pre-push":tv("".concat(eY," pull"))})}b(e4,"createGitHooksConfig");function e3(e,t,n){return /*#__PURE__*/s(function(){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case C.CLI:return[3,1];case C.STRING:return[3,3]}return[3,4];case 1:return[4,tn(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),th(tv("".concat(eJ," ").concat(n))))];case 3:return[2,th(tv(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}b(e3,"buildCommand");function e8(e,t,n){return function(){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,e3(e,t,n)]})})()}}b(e8,"commandFactory");var e5={simpleGitHooks:e8(C.CLI,e$,eV),eslintInspect:e8(C.CLI,ez,eQ),nodeModulesInspect:e8(C.CLI,eX,eZ),eslintCheck:e8(C.CLI,eG,"".concat(eU," ").concat(e2.WORKING_DIRECTORY)),eslintFix:e8(C.CLI,eG,"".concat(eU," ").concat(e2.WORKING_DIRECTORY," --fix")),typescriptCheck:e8(C.CLI,eB,"".concat(eK," -p ").concat(e2.TS_CONFIG," --noEmit")),configureGitHook:e8(C.STRING,"".concat(eY," config core.hooksPath ").concat(e2.GIT_HOOK)),testUnit:e8(C.CLI,eN,"".concat(eq," --config ").concat(e2.UNIT_TEST_CONFIG)),testE2e:e8(C.CLI,"".concat(eN," ").concat(eL),"".concat(eq," --config ").concat(e2.E2E_TEST_CONFIG)),mongoMigrateCreate:b(function(e){return e8(C.CLI,e0,"".concat(eW," ").concat(e1," create ").concat(e," -f ").concat(e2.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:e8(C.CLI,e0,"".concat(eW," ").concat(e1," up -f ").concat(e2.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:e8(C.CLI,e0,"".concat(eW," ").concat(e1," down -f ").concat(e2.MIGRATE_MONGO_CONFIG)),commitLint:e8(C.CLI,eD,"".concat(eM," --edit ").concat(e2.GIT_COMMIT_MSG," --config ").concat(e2.COMMITLINT_CONFIG)),lintStaged:e8(C.CLI,eA,"".concat(eF," --config ").concat(e2.LINT_STAGED_CONFIG)),stageBuildDirectory:e8(C.STRING,"".concat(eY," add ").concat(ex)),build:e8(C.STRING,"".concat(eH," run build")),pnpmInstallStandard:e8(C.STRING,"".concat(eH," install")),pnpmInstallLegacy:e8(C.STRING,"".concat(eH," install --legacy-peer-deps")),pnpmInstallForce:e8(C.STRING,"".concat(eH," install --force"))};var e6=F();function e7(e){var t=em(e6.CWD,ej);if(!el(t))return!1;try{var n=ec(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,a=o===void 0?{}:o,c=r===e,u=e in i,l=e in a;return c||u||l?{path:t,file:n,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return $.warn("Failed to read package.json: ".concat(e.message)),!1}}b(e7,"getPackage");function e9(e){return /*#__PURE__*/s(function(){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,(0,z.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw $.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}b(e9,"getLatestPackageVersion");function te(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,a,c,u,d,f,p,g,v,y,h,_,x,j,b,E,I;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e7(e);if(!n)return[2,l({},V)];c=n.path,u=n.file,d=n.isCurrentProject,f=n.isDepend,p=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},v=(s=u.devDependencies)!==null&&s!==void 0?s:{},y=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":f?(o=g[e])!==null&&o!==void 0?o:"0.0.0":p?(a=v[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!d)return[3,1];x=y;return[3,3];case 1:return[4,e9(e)];case 2:x=m.sent();m.label=3;case 3:h=x,_=d||y===h;if(!_&&(t===null||t===void 0?void 0:t.update)){;b=f?"dependencies":p?"devDependencies":null;b&&((j=u[b])===null||j===void 0?void 0:j[e])!==h&&(u[b]=(E=u[b])!==null&&E!==void 0?E:{},u[b][e]=h,eu(c,u),$.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:c,file:u,isUpToDate:_}];case 4:I=m.sent();return[2,($.error('Error checking package "'.concat(e,'": ').concat(I.message)),l({},V))];case 5:return[2]}})})()}b(te,"checkPackage");function tt(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i,o,a,c,u,l,d;return m(this,function(f){switch(f.label){case 0:e=[{command:b(function(){return e5.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:b(function(){return e5.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:b(function(){return e5.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,tx("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();$.warn("Installation attempt failed: ".concat(c)),$.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}b(tt,"installDependencies");function tn(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,a,c,u,d,p,g;return m(this,function(m){switch(m.label){case 0:if(!el(e2.PACKAGE_JSON)){$.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=f(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return te(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,tt()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,a=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=c.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:p=m.sent();o=true;a=p;return[3,12];case 11:try{if(!i&&c.return!=null){c.return()}}finally{if(o){throw a}}return[7];case 12:return[3,14];case 13:g=m.sent();throw $.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}b(tn,"setupPackages");var tr=I(require("node-persist"),1);var ts=F();function ti(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=tr.default.defaultInstance;if(e)return[3,2];return[4,tr.default.init({dir:ts.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}b(ti,"initNodePersist");var to={get:function e(e){return /*#__PURE__*/s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti()];case 1:r.sent();return[4,tr.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,($.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti()];case 1:r.sent();return[4,tr.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();$.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ti()];case 1:n.sent();return[4,tr.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();$.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ti()];case 1:n.sent();return[4,tr.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:($.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,($.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return /*#__PURE__*/s(function(){return m(this,function(t){try{return[2,"".concat(ts.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,($.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var ta=F(),tc=T.promisify(k.exec);function tu(e){return"error_list:".concat(e)}b(tu,"getErrorListKey");function tl(e){return /*#__PURE__*/s(function(){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tu(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,to.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,to.getLogLink(n)];case 1:e=t.sent();e&&$.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();$.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}b(tl,"saveErrorListToStorage");function td(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,to.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,to.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,($.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}b(td,"getStoredErrorLists");function tf(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,to.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return to.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();$.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}b(tf,"clearAllErrorLists");function tp(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var f=s.exec(e)||[],p=i.exec(e)||[],g=o.exec(e)||[];var m,v,y,h,_,x;f.length&&r?t.push({file:r,position:"".concat(f[1],":").concat(f[2]),type:f[3]===B.Error?B.Error:B.Warning,message:(m=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(v=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:""}):p.length?t.push({file:(y=p===null||p===void 0?void 0:p[1])!==null&&y!==void 0?y:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===B.Error?B.Error:B.Warning,message:(h=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):g.length?t.push({file:"commitlint",type:B.Error,message:(_=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&_!==void 0?_:"",rule:(x=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&x!==void 0?x:""}):n.push(e.trim())}}),t.length&&tl(t),ta.DEBUG&&n.length&&($.warn("Unmatched lines:"),n.forEach(function(e){return $.info(" ".concat(e))}))}b(tp,"parseTextErrors");function tg(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?B.Error:B.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tl(n)}catch(t){tp(e)}}b(tg,"parseCommandOutput");function tm(e){return /*#__PURE__*/s(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tg;n=new AbortController;P.default.on("SIGINT",function(){$.warn("Process interrupted. Terminating..."),n.abort(),P.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tc(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&$.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}b(tm,"executeCommand");function tv(e){return{raw:!0,cmd:e}}b(tv,"rawCommand");function ty(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eJ," ").concat(eh," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eJ," ").concat(eW," ").concat(eT," ").concat(e):"".concat(eJ," ").concat(eP," ").concat(e)}b(ty,"formatCLI");function th(e,t){return typeof e=="function"?ty(e(t),t):(typeof e==="undefined"?"undefined":p(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?ty(e,t):e}b(th,"formatCommand");function t_(e){return /*#__PURE__*/s(function(e){var t,n,r,s,i,o,a;var c=arguments;return m(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];a=!1;return[3,3];case 1:return[4,te(eh)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,th(r,i)]}))]}})}).apply(this,arguments)}b(t_,"resolveCommands");function tx(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);$.start("".concat(e)),ta.DEBUG&&$.info("→ ".concat(t));return[4,tm(t)];case 1:r.sent(),$.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw $.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}b(tx,"runCommand");function tj(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!el(e2.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e5.typescriptCheck()];case 1:return[4,tx.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=$.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}b(tj,"checkTypescript");function tb(){return /*#__PURE__*/s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e5.eslintFix()];case 1:return[4,tx.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e5.eslintCheck()];case 4:return[4,tx.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}b(tb,"checkEslint");function tE(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";$.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}b(tE,"printIssues");function tI(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,td()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===B.Error}),n=e.filter(function(e){return e.type===B.Warning});!t.length&&!n.length?$.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tE("Warnings",n),tE("Errors",t),(t.length>0||n.length>0)&&w.default.exit(1));return[2]}})})()}b(tI,"showCheckResult");function tw(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,tf()];case 1:o.sent();return[4,te(eh)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(eh)];return[4,e5.build()];case 4:return[4,tx.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e5.stageBuildDirectory()];case 6:return[4,tx.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw $.error("Error building and staging ".concat(eh,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,e5.lintStaged()];case 10:return[4,tx.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tI();return[2]}})})()}b(tw,"lintStaged");function tS(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e5.eslintInspect()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tS,"inspectLint");function tR(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tf()];case 1:e.sent();return[4,Promise.all([tj(),tb()])];case 2:e.sent(),tI();return[2]}})})()}b(tR,"lintCheck");function tO(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tf()];case 1:e.sent();return[4,Promise.all([tj(),tb(!0)])];case 2:e.sent(),tI();return[2]}})})()}b(tO,"lintFix");function tC(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,tf()];case 1:t.sent();e=["Validating commit message"];return[4,e5.commitLint()];case 2:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tI();return[2]}})})()}b(tC,"commitLint");function tk(){return /*#__PURE__*/s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,e5.configureGitHook()];case 1:return[4,tx.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),ed(e2.GIT_HOOK);return[4,t_(e4)];case 3:t=s.sent();eu(e2.SIMPLE_GIT_HOOKS_JSON,t);n="\n".concat(ew,"\n");el(e2.GIT_IGNORE)?er(e2.GIT_IGNORE,"utf-8").split("\n").includes(ew)||ei(e2.GIT_IGNORE,n,"utf-8"):es(e2.GIT_IGNORE,n,"utf-8");r=["Setting up simple-git-hooks"];return[4,e5.simpleGitHooks()];case 4:return[4,tx.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}b(tk,"setupGitHook");function tP(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tn([eh],{update:!0,postInstallActions:[tk]})];case 1:e.sent();return[2]}})})()}b(tP,"setup");function tT(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:ed(e2.NODE_MODULES,e2.PNPM_LOCK_YAML);return[4,tt()];case 1:e.sent();return[4,tk()];case 2:e.sent();return[2]}})})()}b(tT,"reset");function tG(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e5.nodeModulesInspect()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tG,"inspect");function tU(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e5.testUnit()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tU,"testUnit");function tN(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e5.testE2e()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tN,"testE2E");function tL(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e5.mongoMigrateCreate(e)];case 1:return[4,tx.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}b(tL,"mongoMigrateCreate");function tq(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e5.mongoMigrateUp()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tq,"mongoMigrateUp");function tD(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e5.mongoMigrateDown()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tD,"mongoMigrateDown");(function(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,R.default)((0,S.hideBin)(w.default.argv)).scriptName(eP).usage("$0 <command> [options]").command("lint","Check code for linting issues",tR).command("lint:fix","Fix linting issues automatically",tO).command("lint:inspect","View active ESLint configuration",tS).command("lint-staged","Run lint checks on staged files",tw).command("commitlint","Validate commit message format",tC).command("setup","Initialize project setup and dependencies",tP).command("reset","Reset the project and reinstall dependencies",tT).command("inspect","Analyze installed project dependencies",tG).command("test:unit","Run unit test suite",tU).command("test:e2e","Run end-to-end test suite",tN).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return /*#__PURE__*/s(function(){return m(this,function(t){switch(t.label){case 0:if(!e.name){$.error("Migration name is required.");return[2]}return[4,tL(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tq).command("mongo:migrate:down","Rollback last MongoDB migration",tD).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(O.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();$.error("Fatal: ".concat(e.message)),w.default.exit(1);return[3,3];case 3:return[2]}})})()})();
2
+ "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function a(e){r(o,s,i,a,c,"next",e)}function c(e){r(o,s,i,a,c,"throw",e)}a(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||a(e,n)||g(e,n)||c()}function f(e){return n(e)||o(e)||g(e)||u()}function p(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var v=Object.create;var y=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var b=function(e,t){return y(e,"name",{value:t,configurable:!0})};var E=function(e,t,n,r){var s=true,i=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":p(t))=="object"||typeof t=="function")try{var a=function(){var s=u.value;!j.call(e,s)&&s!==n&&y(e,s,{get:function(){return t[s]},enumerable:!(r=h(t,s))||r.enumerable})};for(var c=_(t)[Symbol.iterator](),u;!(s=(u=c.next()).done);s=true)a()}catch(e){i=true;o=e}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(i){throw o}}}return e};var I=function(e,t,n){return n=e!=null?v(x(e)):{},E(t||!e||!e.__esModule?y(n,"default",{value:e,enumerable:!0}):n,e)};var w=I(require("process"),1),S=require("yargs/helpers"),O=I(require("yargs/yargs"),1);var R={name:"@cyberskill/shared",type:"module",version:"1.120.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/nodejs/cli/index.ts lint","lint:fix":"tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"tsx src/nodejs/cli/index.ts lint:inspect",reset:"tsx src/nodejs/cli/index.ts reset",setup:"tsx src/nodejs/cli/index.ts setup",inspect:"tsx src/nodejs/cli/index.ts inspect","test:unit":"tsx src/nodejs/cli/index.ts test:unit","test:e2e":"tsx src/nodejs/cli/index.ts test:e2e",commitlint:"tsx src/nodejs/cli/index.ts commitlint","lint-staged":"tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.41.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.0","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.3",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var C=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var k=require("child_process"),P=I(require("process"),1),T=I(require("util"),1);var G=".cyberskill-storage";var N=I(require("@dotenvx/dotenvx"),1),U=require("envalid"),L=I(require("os"),1),q=I(require("path"),1),D=I(require("process"),1);var M=!1;function A(){M||(N.default.config(),M=!0)}b(A,"loadEnvFile");function F(){A();var e=(0,U.cleanEnv)(D.default.env,{CWD:(0,U.str)({default:D.default.cwd()}),DEBUG:(0,U.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,U.str)({default:q.default.join(L.default.homedir(),G)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}b(F,"getEnv");var B=function(e){return e.Error="error",e.Warning="warning",e}({});var K=I(require("chalk"),1),W=I(require("consola"),1),Y=require("graphql");var H=F();H.DEBUG||(W.default.level=4);function J(e){var t=K.default[e];return typeof t=="function"?t:K.default.green}b(J,"chalkKeyword");var $={silent:W.default.silent,level:W.default.level,fatal:W.default.fatal,error:W.default.error,warn:W.default.warn,log:W.default.log,info:W.default.info,success:W.default.success,ready:W.default.ready,start:W.default.start,box:W.default.box,debug:W.default.debug,trace:W.default.trace,verbose:W.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){W.default.box(K.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;W.default.log("".concat(K.default.gray("File:")," ").concat(K.default.blue("".concat(t).concat(r?":".concat(r):"")))),s&&W.default.log(" ".concat(J(n)("Rule:")," ").concat(s)),W.default.log(" ".concat(J(n)("Message:")," ").concat(i))}),W.default.box(J(n)("".concat(e," : ").concat(t.length))),W.default.log(K.default.gray("─".repeat(40)))}};var V={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var z=I(require("node-fetch"),1);var Q=I(require("fs-extra"),1),X=require("path");var Z=Q.default,ee=Z.lstatSync,et=Z.readdirSync,en=Z.mkdirSync,er=Z.readFileSync,es=Z.unlinkSync,ei=Z.statSync,eo=Q.default.readJsonSync;function ea(e,t,n){Q.default.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}b(ea,"writeFileSync");function ec(e,t,n){Q.default.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}b(ec,"appendFileSync");function eu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return Q.default.pathExistsSync(e)})}b(eu,"pathExistsSync");function el(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eu(e)&&Q.default.removeSync(e)})}b(el,"removeSync");var ed=I(require("path"),1);var ef=F();function ep(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,ed.resolve).apply(this,[ef.CWD].concat(f(t)))}b(ep,"resolveWorkingPath");function eg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,ed.join).apply(this,f(t))}b(eg,"join");var em=F(),ev=em.CWD,ey="@cyberskill/shared",eh="node_modules",e_="dist",ex="package.json",ej="package-lock.json",eb="tsconfig.json",eE=".gitignore",eI=".simple-git-hooks.json",ew="pnpm-lock.yaml",eS=".git/hooks/",eO=".git/COMMIT_EDITMSG",eR=".migrate-mongo.config.js",eC=eg(ev,eh,ey,e_),ek="cyberskill",eP="src/nodejs/cli/index.ts",eT="eslint",eG="eslint",eN="vitest",eU="playwright",eL="vitest",eq="@commitlint/cli",eD="commitlint",eM="lint-staged",eA="lint-staged",eF="typescript",eB="tsc",eK="tsx",eW="git",eY="pnpm",eH="pnpm exec",eJ="simple-git-hooks",e$="simple-git-hooks",eV="@eslint/config-inspector",ez="eslint-config-inspector",eQ="node-modules-inspector",eX="node-modules-inspector",eZ="migrate-mongo",e0="./node_modules/migrate-mongo/bin/migrate-mongo",e1={CYBERSKILL_DIRECTORY:eC,WORKING_DIRECTORY:ev,TS_CONFIG:ep(eb),GIT_IGNORE:ep(eE),GIT_HOOK:ep(eS),GIT_COMMIT_MSG:ep(eO),SIMPLE_GIT_HOOKS_JSON:ep(eI),PACKAGE_JSON:ep(ex),PACKAGE_LOCK_JSON:ep(ej),PNPM_LOCK_YAML:ep(ew),NODE_MODULES:ep(eh),MIGRATE_MONGO_CONFIG:ep(eR),LINT_STAGED_CONFIG:ep("".concat(eC,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:ep("".concat(eC,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:ep("".concat(eC,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ep("".concat(eC,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ep("".concat(eC,"/react/vitest/vitest.e2e.js"))};function e2(e){var t=e.isCurrentProject;return l({"pre-commit":eA,"commit-msg":eD},t&&{"pre-push":tm("".concat(eW," pull"))})}b(e2,"createGitHooksConfig");function e4(e,t,n){return /*#__PURE__*/s(function(){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case C.CLI:return[3,1];case C.STRING:return[3,3]}return[3,4];case 1:return[4,tt(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),ty(tm("".concat(eH," ").concat(n))))];case 3:return[2,ty(tm(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}b(e4,"buildCommand");function e3(e,t,n){return function(){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,e4(e,t,n)]})})()}}b(e3,"commandFactory");var e5={simpleGitHooks:e3(C.CLI,eJ,e$),eslintInspect:e3(C.CLI,eV,ez),nodeModulesInspect:e3(C.CLI,eQ,eX),eslintCheck:e3(C.CLI,eT,"".concat(eG," ").concat(e1.WORKING_DIRECTORY," --no-cache")),eslintFix:e3(C.CLI,eT,"".concat(eG," ").concat(e1.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:e3(C.CLI,eF,"".concat(eB," -p ").concat(e1.TS_CONFIG," --noEmit")),configureGitHook:e3(C.STRING,"".concat(eW," config core.hooksPath ").concat(e1.GIT_HOOK)),testUnit:e3(C.CLI,eN,"".concat(eL," --config ").concat(e1.UNIT_TEST_CONFIG)),testE2e:e3(C.CLI,"".concat(eN," ").concat(eU),"".concat(eL," --config ").concat(e1.E2E_TEST_CONFIG)),mongoMigrateCreate:b(function(e){return e3(C.CLI,eZ,"".concat(eK," ").concat(e0," create ").concat(e," -f ").concat(e1.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:e3(C.CLI,eZ,"".concat(eK," ").concat(e0," up -f ").concat(e1.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:e3(C.CLI,eZ,"".concat(eK," ").concat(e0," down -f ").concat(e1.MIGRATE_MONGO_CONFIG)),commitLint:e3(C.CLI,eq,"".concat(eD," --edit ").concat(e1.GIT_COMMIT_MSG," --config ").concat(e1.COMMITLINT_CONFIG)),lintStaged:e3(C.CLI,eM,"".concat(eA," --config ").concat(e1.LINT_STAGED_CONFIG)),stageBuildDirectory:e3(C.STRING,"".concat(eW," add ").concat(e_)),build:e3(C.STRING,"".concat(eY," run build")),pnpmInstallStandard:e3(C.STRING,"".concat(eY," install")),pnpmInstallLegacy:e3(C.STRING,"".concat(eY," install --legacy-peer-deps")),pnpmInstallForce:e3(C.STRING,"".concat(eY," install --force"))};var e8=F();function e6(e){var t=eg(e8.CWD,ex);if(!eu(t))return!1;try{var n=eo(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,a=o===void 0?{}:o,c=r===e,u=e in i,l=e in a;return c||u||l?{path:t,file:n,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return $.warn("Failed to read package.json: ".concat(e.message)),!1}}b(e6,"getPackage");function e7(e){return /*#__PURE__*/s(function(){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,(0,z.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw $.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}b(e7,"getLatestPackageVersion");function e9(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,a,c,u,d,f,p,g,v,y,h,_,x,j,b,E,I;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e6(e);if(!n)return[2,l({},V)];c=n.path,u=n.file,d=n.isCurrentProject,f=n.isDepend,p=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},v=(s=u.devDependencies)!==null&&s!==void 0?s:{},y=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":f?(o=g[e])!==null&&o!==void 0?o:"0.0.0":p?(a=v[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!d)return[3,1];x=y;return[3,3];case 1:return[4,e7(e)];case 2:x=m.sent();m.label=3;case 3:h=x,_=d||y===h;if(!_&&(t===null||t===void 0?void 0:t.update)){;b=f?"dependencies":p?"devDependencies":null;b&&((j=u[b])===null||j===void 0?void 0:j[e])!==h&&(u[b]=(E=u[b])!==null&&E!==void 0?E:{},u[b][e]=h,ea(c,JSON.stringify(u,null,4)),$.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:c,file:u,isUpToDate:_}];case 4:I=m.sent();return[2,($.error('Error checking package "'.concat(e,'": ').concat(I.message)),l({},V))];case 5:return[2]}})})()}b(e9,"checkPackage");function te(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i,o,a,c,u,l,d;return m(this,function(f){switch(f.label){case 0:e=[{command:b(function(){return e5.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:b(function(){return e5.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:b(function(){return e5.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,t_("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();$.warn("Installation attempt failed: ".concat(c)),$.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}b(te,"installDependencies");function tt(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,a,c,u,d,p,g;return m(this,function(m){switch(m.label){case 0:if(!eu(e1.PACKAGE_JSON)){$.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=f(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e9(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,te()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,a=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=c.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:p=m.sent();o=true;a=p;return[3,12];case 11:try{if(!i&&c.return!=null){c.return()}}finally{if(o){throw a}}return[7];case 12:return[3,14];case 13:g=m.sent();throw $.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}b(tt,"setupPackages");var tn=I(require("node-persist"),1);var tr=F();function ts(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=tn.default.defaultInstance;if(e)return[3,2];return[4,tn.default.init({dir:tr.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}b(ts,"initNodePersist");var ti={get:function e(e){return /*#__PURE__*/s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ts()];case 1:r.sent();return[4,tn.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,($.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ts()];case 1:r.sent();return[4,tn.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();$.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ts()];case 1:n.sent();return[4,tn.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();$.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ts()];case 1:n.sent();return[4,tn.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:($.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,($.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return /*#__PURE__*/s(function(){return m(this,function(t){try{return[2,"".concat(tr.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,($.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var to=F(),ta=T.promisify(k.exec);function tc(e){return"error_list:".concat(e)}b(tc,"getErrorListKey");function tu(e){return /*#__PURE__*/s(function(){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tc(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,ti.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,ti.getLogLink(n)];case 1:e=t.sent();e&&$.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();$.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}b(tu,"saveErrorListToStorage");function tl(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,ti.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,($.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}b(tl,"getStoredErrorLists");function td(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return ti.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();$.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}b(td,"clearAllErrorLists");function tf(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var f=s.exec(e)||[],p=i.exec(e)||[],g=o.exec(e)||[];var m,v,y,h,_,x;f.length&&r?t.push({file:r,position:"".concat(f[1],":").concat(f[2]),type:f[3]===B.Error?B.Error:B.Warning,message:(m=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(v=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:""}):p.length?t.push({file:(y=p===null||p===void 0?void 0:p[1])!==null&&y!==void 0?y:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===B.Error?B.Error:B.Warning,message:(h=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):g.length?t.push({file:"commitlint",type:B.Error,message:(_=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&_!==void 0?_:"",rule:(x=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&x!==void 0?x:""}):n.push(e.trim())}}),t.length&&tu(t),to.DEBUG&&n.length&&($.warn("Unmatched lines:"),n.forEach(function(e){return $.info(" ".concat(e))}))}b(tf,"parseTextErrors");function tp(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?B.Error:B.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tu(n)}catch(t){tf(e)}}b(tp,"parseCommandOutput");function tg(e){return /*#__PURE__*/s(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tp;n=new AbortController;P.default.on("SIGINT",function(){$.warn("Process interrupted. Terminating..."),n.abort(),P.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,ta(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&$.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}b(tg,"executeCommand");function tm(e){return{raw:!0,cmd:e}}b(tm,"rawCommand");function tv(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eH," ").concat(ey," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eH," ").concat(eK," ").concat(eP," ").concat(e):"".concat(eH," ").concat(ek," ").concat(e)}b(tv,"formatCLI");function ty(e,t){return typeof e=="function"?tv(e(t),t):(typeof e==="undefined"?"undefined":p(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tv(e,t):e}b(ty,"formatCommand");function th(e){return /*#__PURE__*/s(function(e){var t,n,r,s,i,o,a;var c=arguments;return m(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];a=!1;return[3,3];case 1:return[4,e9(ey)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,ty(r,i)]}))]}})}).apply(this,arguments)}b(th,"resolveCommands");function t_(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);$.start("".concat(e)),to.DEBUG&&$.info("→ ".concat(t));return[4,tg(t)];case 1:r.sent(),$.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw $.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}b(t_,"runCommand");function tx(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!eu(e1.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e5.typescriptCheck()];case 1:return[4,t_.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=$.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}b(tx,"checkTypescript");function tj(){return /*#__PURE__*/s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e5.eslintFix()];case 1:return[4,t_.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e5.eslintCheck()];case 4:return[4,t_.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}b(tj,"checkEslint");function tb(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";$.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}b(tb,"printIssues");function tE(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,tl()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===B.Error}),n=e.filter(function(e){return e.type===B.Warning});!t.length&&!n.length?$.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tb("Warnings",n),tb("Errors",t),(t.length>0||n.length>0)&&w.default.exit(1));return[2]}})})()}b(tE,"showCheckResult");function tI(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,td()];case 1:o.sent();return[4,e9(ey)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ey)];return[4,e5.build()];case 4:return[4,t_.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e5.stageBuildDirectory()];case 6:return[4,t_.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw $.error("Error building and staging ".concat(ey,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,e5.lintStaged()];case 10:return[4,t_.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tE();return[2]}})})()}b(tI,"lintStaged");function tw(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e5.eslintInspect()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tw,"inspectLint");function tS(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tx(),tj()])];case 2:e.sent(),tE();return[2]}})})()}b(tS,"lintCheck");function tO(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tx(),tj(!0)])];case 2:e.sent(),tE();return[2]}})})()}b(tO,"lintFix");function tR(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,td()];case 1:t.sent();e=["Validating commit message"];return[4,e5.commitLint()];case 2:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tE();return[2]}})})()}b(tR,"commitLint");function tC(){return /*#__PURE__*/s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,e5.configureGitHook()];case 1:return[4,t_.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),el(e1.GIT_HOOK);return[4,th(e2)];case 3:t=s.sent();ea(e1.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eI,"\n");eu(e1.GIT_IGNORE)?er(e1.GIT_IGNORE,"utf-8").split("\n").includes(eI)||ec(e1.GIT_IGNORE,n):ea(e1.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,e5.simpleGitHooks()];case 4:return[4,t_.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}b(tC,"setupGitHook");function tk(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tt([ey],{update:!0,postInstallActions:[tC]})];case 1:e.sent();return[2]}})})()}b(tk,"setup");function tP(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:el(e1.NODE_MODULES,e1.PNPM_LOCK_YAML);return[4,te()];case 1:e.sent();return[4,tC()];case 2:e.sent();return[2]}})})()}b(tP,"reset");function tT(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e5.nodeModulesInspect()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tT,"inspect");function tG(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e5.testUnit()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tG,"testUnit");function tN(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e5.testE2e()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tN,"testE2E");function tU(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e5.mongoMigrateCreate(e)];case 1:return[4,t_.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}b(tU,"mongoMigrateCreate");function tL(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e5.mongoMigrateUp()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tL,"mongoMigrateUp");function tq(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e5.mongoMigrateDown()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tq,"mongoMigrateDown");(function(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,O.default)((0,S.hideBin)(w.default.argv)).scriptName(ek).usage("$0 <command> [options]").command("lint","Check code for linting issues",tS).command("lint:fix","Fix linting issues automatically",tO).command("lint:inspect","View active ESLint configuration",tw).command("lint-staged","Run lint checks on staged files",tI).command("commitlint","Validate commit message format",tR).command("setup","Initialize project setup and dependencies",tk).command("reset","Reset the project and reinstall dependencies",tP).command("inspect","Analyze installed project dependencies",tT).command("test:unit","Run unit test suite",tG).command("test:e2e","Run end-to-end test suite",tN).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return /*#__PURE__*/s(function(){return m(this,function(t){switch(t.label){case 0:if(!e.name){$.error("Migration name is required.");return[2]}return[4,tU(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tL).command("mongo:migrate:down","Rollback last MongoDB migration",tq).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(R.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();$.error("Fatal: ".concat(e.message)),w.default.exit(1);return[3,3];case 3:return[2]}})})()})();
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var c=e[i](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function c(e){r(o,s,i,c,a,"next",e)}function a(e){r(o,s,i,c,a,"throw",e)}c(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,c;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;c=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw c}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||c(e,n)||g(e,n)||a()}function p(e){return n(e)||o(e)||g(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=c(0),o["throw"]=c(1),o["return"]=c(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(t){return a([e,t])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(i=0)),i)try{if(n=1,r&&(s=c[0]&2?r["return"]:c[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;if(r=0,s)c=[c[0]&2,s.value];switch(c[0]){case 0:case 1:s=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;r=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(c[0]===6&&i.label<s[1]){i.label=s[1];s=c;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(c);break}if(s[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];r=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var v=Object.defineProperty;var y=function(e,t){return v(e,"name",{value:t,configurable:!0})};import h from"node:process";import{hideBin as _}from"yargs/helpers";import x from"yargs/yargs";var j={name:"@cyberskill/shared",type:"module",version:"1.118.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/nodejs/cli/index.ts lint","lint:fix":"tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"tsx src/nodejs/cli/index.ts lint:inspect",reset:"tsx src/nodejs/cli/index.ts reset",setup:"tsx src/nodejs/cli/index.ts setup",inspect:"tsx src/nodejs/cli/index.ts inspect","test:unit":"tsx src/nodejs/cli/index.ts test:unit","test:e2e":"tsx src/nodejs/cli/index.ts test:e2e",commitlint:"tsx src/nodejs/cli/index.ts commitlint","lint-staged":"tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.41.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.22","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.0","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.3",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var b=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as E}from"node:child_process";import I from"node:process";import*as w from"node:util";var S=".cyberskill-storage";import R from"@dotenvx/dotenvx";import{bool as C,cleanEnv as O,str as k}from"envalid";import T from"node:os";import P from"node:path";import G from"node:process";var U=!1;function L(){U||(R.config(),U=!0)}y(L,"loadEnvFile");function N(){L();var e=O(G.env,{CWD:k({default:G.cwd()}),DEBUG:C({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:k({default:P.join(T.homedir(),S)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}y(N,"getEnv");var D=function(e){return e.Error="error",e.Warning="warning",e}({});import M from"chalk";import A from"consola";import{GraphQLError as q}from"graphql";var F=N();F.DEBUG||(A.level=4);function B(e){var t=M[e];return typeof t=="function"?t:M.green}y(B,"chalkKeyword");var K={silent:A.silent,level:A.level,fatal:A.fatal,error:A.error,warn:A.warn,log:A.log,info:A.info,success:A.success,ready:A.ready,start:A.start,box:A.box,debug:A.debug,trace:A.trace,verbose:A.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){A.box(M.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;A.log("".concat(M.gray("File:")," ").concat(M.blue("".concat(t).concat(r?":".concat(r):"")))),s&&A.log(" ".concat(B(n)("Rule:")," ").concat(s)),A.log(" ".concat(B(n)("Message:")," ").concat(i))}),A.box(B(n)("".concat(e," : ").concat(t.length))),A.log(M.gray("─".repeat(40)))}};var W={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import Y from"node-fetch";import H from"fs-extra";var J=H.lstatSync,$=H.readdirSync,V=H.mkdirSync,z=H.readFileSync,Q=H.writeFileSync,X=H.appendFileSync,Z=H.unlinkSync,ee=H.statSync,et=H.readJsonSync,en=H.writeJsonSync;function er(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return H.pathExistsSync(e)})}y(er,"pathExistsSync");function es(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){er(e)&&H.removeSync(e)})}y(es,"removeSync");import ei,{join as eo,resolve as ec}from"node:path";var ea=N();function eu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return ec.apply(void 0,[ea.CWD].concat(p(t)))}y(eu,"resolveWorkingPath");function el(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return eo.apply(void 0,p(t))}y(el,"join");var ed=N(),ep=ed.CWD,ef="@cyberskill/shared",eg="node_modules",em="dist",ev="package.json",ey="package-lock.json",eh="tsconfig.json",e_=".gitignore",ex=".simple-git-hooks.json",ej="pnpm-lock.yaml",eb=".git/hooks/",eE=".git/COMMIT_EDITMSG",eI=".migrate-mongo.config.js",ew=el(ep,eg,ef,em),eS="cyberskill",eR="src/nodejs/cli/index.ts",eC="eslint",eO="eslint",ek="vitest",eT="playwright",eP="vitest",eG="@commitlint/cli",eU="commitlint",eL="lint-staged",eN="lint-staged",eD="typescript",eM="tsc",eA="tsx",eq="git",eF="pnpm",eB="pnpm exec",eK="simple-git-hooks",eW="simple-git-hooks",eY="@eslint/config-inspector",eH="eslint-config-inspector",eJ="node-modules-inspector",e$="node-modules-inspector",eV="migrate-mongo",ez="./node_modules/migrate-mongo/bin/migrate-mongo",eQ={CYBERSKILL_DIRECTORY:ew,WORKING_DIRECTORY:ep,TS_CONFIG:eu(eh),GIT_IGNORE:eu(e_),GIT_HOOK:eu(eb),GIT_COMMIT_MSG:eu(eE),SIMPLE_GIT_HOOKS_JSON:eu(ex),PACKAGE_JSON:eu(ev),PACKAGE_LOCK_JSON:eu(ey),PNPM_LOCK_YAML:eu(ej),NODE_MODULES:eu(eg),MIGRATE_MONGO_CONFIG:eu(eI),LINT_STAGED_CONFIG:eu("".concat(ew,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:eu("".concat(ew,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:eu("".concat(ew,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eu("".concat(ew,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eu("".concat(ew,"/react/vitest/vitest.e2e.js"))};function eX(e){var t=e.isCurrentProject;return l({"pre-commit":eN,"commit-msg":eU},t&&{"pre-push":td("".concat(eq," pull"))})}y(eX,"createGitHooksConfig");function eZ(e,t,n){return /*#__PURE__*/s(function(){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case b.CLI:return[3,1];case b.STRING:return[3,3]}return[3,4];case 1:return[4,e6(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),tf(td("".concat(eB," ").concat(n))))];case 3:return[2,tf(td(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}y(eZ,"buildCommand");function e0(e,t,n){return function(){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,eZ(e,t,n)]})})()}}y(e0,"commandFactory");var e1={simpleGitHooks:e0(b.CLI,eK,eW),eslintInspect:e0(b.CLI,eY,eH),nodeModulesInspect:e0(b.CLI,eJ,e$),eslintCheck:e0(b.CLI,eC,"".concat(eO," ").concat(eQ.WORKING_DIRECTORY)),eslintFix:e0(b.CLI,eC,"".concat(eO," ").concat(eQ.WORKING_DIRECTORY," --fix")),typescriptCheck:e0(b.CLI,eD,"".concat(eM," -p ").concat(eQ.TS_CONFIG," --noEmit")),configureGitHook:e0(b.STRING,"".concat(eq," config core.hooksPath ").concat(eQ.GIT_HOOK)),testUnit:e0(b.CLI,ek,"".concat(eP," --config ").concat(eQ.UNIT_TEST_CONFIG)),testE2e:e0(b.CLI,"".concat(ek," ").concat(eT),"".concat(eP," --config ").concat(eQ.E2E_TEST_CONFIG)),mongoMigrateCreate:y(function(e){return e0(b.CLI,eV,"".concat(eA," ").concat(ez," create ").concat(e," -f ").concat(eQ.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:e0(b.CLI,eV,"".concat(eA," ").concat(ez," up -f ").concat(eQ.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:e0(b.CLI,eV,"".concat(eA," ").concat(ez," down -f ").concat(eQ.MIGRATE_MONGO_CONFIG)),commitLint:e0(b.CLI,eG,"".concat(eU," --edit ").concat(eQ.GIT_COMMIT_MSG," --config ").concat(eQ.COMMITLINT_CONFIG)),lintStaged:e0(b.CLI,eL,"".concat(eN," --config ").concat(eQ.LINT_STAGED_CONFIG)),stageBuildDirectory:e0(b.STRING,"".concat(eq," add ").concat(em)),build:e0(b.STRING,"".concat(eF," run build")),pnpmInstallStandard:e0(b.STRING,"".concat(eF," install")),pnpmInstallLegacy:e0(b.STRING,"".concat(eF," install --legacy-peer-deps")),pnpmInstallForce:e0(b.STRING,"".concat(eF," install --force"))};var e2=N();function e4(e){var t=el(e2.CWD,ev);if(!er(t))return!1;try{var n=et(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,c=o===void 0?{}:o,a=r===e,u=e in i,l=e in c;return a||u||l?{path:t,file:n,isCurrentProject:a,isDepend:u,isDevDepend:l}:!1}catch(e){return K.warn("Failed to read package.json: ".concat(e.message)),!1}}y(e4,"getPackage");function e3(e){return /*#__PURE__*/s(function(){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,Y("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw K.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}y(e3,"getLatestPackageVersion");function e8(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,c,a,u,d,p,f,g,v,y,h,_,x,j,b,E,I;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e4(e);if(!n)return[2,l({},W)];a=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},v=(s=u.devDependencies)!==null&&s!==void 0?s:{},y=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=g[e])!==null&&o!==void 0?o:"0.0.0":f?(c=v[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!d)return[3,1];x=y;return[3,3];case 1:return[4,e3(e)];case 2:x=m.sent();m.label=3;case 3:h=x,_=d||y===h;if(!_&&(t===null||t===void 0?void 0:t.update)){;b=p?"dependencies":f?"devDependencies":null;b&&((j=u[b])===null||j===void 0?void 0:j[e])!==h&&(u[b]=(E=u[b])!==null&&E!==void 0?E:{},u[b][e]=h,en(a,u),K.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:a,file:u,isUpToDate:_}];case 4:I=m.sent();return[2,(K.error('Error checking package "'.concat(e,'": ').concat(I.message)),l({},W))];case 5:return[2]}})})()}y(e8,"checkPackage");function e5(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i,o,c,a,u,l,d;return m(this,function(p){switch(p.label){case 0:e=[{command:y(function(){return e1.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:y(function(){return e1.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:y(function(){return e1.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,c=o.command,a=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,tm("".concat(a," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();K.warn("Installation attempt failed: ".concat(a)),K.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}y(e5,"installDependencies");function e6(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,c,a,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!er(eQ.PACKAGE_JSON)){K.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e8(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,e5()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,c=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);a=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=a.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:f=m.sent();o=true;c=f;return[3,12];case 11:try{if(!i&&a.return!=null){a.return()}}finally{if(o){throw c}}return[7];case 12:return[3,14];case 13:g=m.sent();throw K.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}y(e6,"setupPackages");import e7 from"node-persist";var e9=N();function te(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=e7.defaultInstance;if(e)return[3,2];return[4,e7.init({dir:e9.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}y(te,"initNodePersist");var tt={get:function e(e){return /*#__PURE__*/s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,te()];case 1:r.sent();return[4,e7.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(K.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,te()];case 1:r.sent();return[4,e7.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,te()];case 1:n.sent();return[4,e7.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();K.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,te()];case 1:n.sent();return[4,e7.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(K.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(K.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return /*#__PURE__*/s(function(){return m(this,function(t){try{return[2,"".concat(e9.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(K.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var tn=N(),tr=w.promisify(E);function ts(e){return"error_list:".concat(e)}y(ts,"getErrorListKey");function ti(e){return /*#__PURE__*/s(function(){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=ts(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,tt.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,tt.getLogLink(n)];case 1:e=t.sent();e&&K.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();K.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}y(ti,"saveErrorListToStorage");function to(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tt.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,tt.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(K.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}y(to,"getStoredErrorLists");function tc(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tt.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return tt.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}y(tc,"clearAllErrorLists");function ta(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c,a,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],g=o.exec(e)||[];var m,v,y,h,_,x;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===D.Error?D.Error:D.Warning,message:(m=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:"",rule:(v=p===null||p===void 0?void 0:(a=p[5])===null||a===void 0?void 0:a.trim())!==null&&v!==void 0?v:""}):f.length?t.push({file:(y=f===null||f===void 0?void 0:f[1])!==null&&y!==void 0?y:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===D.Error?D.Error:D.Warning,message:(h=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):g.length?t.push({file:"commitlint",type:D.Error,message:(_=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&_!==void 0?_:"",rule:(x=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&x!==void 0?x:""}):n.push(e.trim())}}),t.length&&ti(t),tn.DEBUG&&n.length&&(K.warn("Unmatched lines:"),n.forEach(function(e){return K.info(" ".concat(e))}))}y(ta,"parseTextErrors");function tu(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?D.Error:D.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&ti(n)}catch(t){ta(e)}}y(tu,"parseCommandOutput");function tl(e){return /*#__PURE__*/s(function(e){var t,n,r,s,i,o,c,a,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tu;n=new AbortController;I.on("SIGINT",function(){K.warn("Process interrupted. Terminating..."),n.abort(),I.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tr(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&K.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}y(tl,"executeCommand");function td(e){return{raw:!0,cmd:e}}y(td,"rawCommand");function tp(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eB," ").concat(ef," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eB," ").concat(eA," ").concat(eR," ").concat(e):"".concat(eB," ").concat(eS," ").concat(e)}y(tp,"formatCLI");function tf(e,t){return typeof e=="function"?tp(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tp(e,t):e}y(tf,"formatCommand");function tg(e){return /*#__PURE__*/s(function(e){var t,n,r,s,i,o,c;var a=arguments;return m(this,function(u){switch(u.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,e8(ef)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:s=c,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,tf(r,i)]}))]}})}).apply(this,arguments)}y(tg,"resolveCommands");function tm(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);K.start("".concat(e)),tn.DEBUG&&K.info("→ ".concat(t));return[4,tl(t)];case 1:r.sent(),K.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw K.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}y(tm,"runCommand");function tv(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!er(eQ.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e1.typescriptCheck()];case 1:return[4,tm.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=K.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}y(tv,"checkTypescript");function ty(){return /*#__PURE__*/s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e1.eslintFix()];case 1:return[4,tm.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e1.eslintCheck()];case 4:return[4,tm.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}y(ty,"checkEslint");function th(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";K.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}y(th,"printIssues");function t_(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,to()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===D.Error}),n=e.filter(function(e){return e.type===D.Warning});!t.length&&!n.length?K.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(th("Warnings",n),th("Errors",t),(t.length>0||n.length>0)&&h.exit(1));return[2]}})})()}y(t_,"showCheckResult");function tx(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,tc()];case 1:o.sent();return[4,e8(ef)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ef)];return[4,e1.build()];case 4:return[4,tm.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e1.stageBuildDirectory()];case 6:return[4,tm.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw K.error("Error building and staging ".concat(ef,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,e1.lintStaged()];case 10:return[4,tm.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),t_();return[2]}})})()}y(tx,"lintStaged");function tj(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e1.eslintInspect()];case 1:return[4,tm.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tj,"inspectLint");function tb(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tc()];case 1:e.sent();return[4,Promise.all([tv(),ty()])];case 2:e.sent(),t_();return[2]}})})()}y(tb,"lintCheck");function tE(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tc()];case 1:e.sent();return[4,Promise.all([tv(),ty(!0)])];case 2:e.sent(),t_();return[2]}})})()}y(tE,"lintFix");function tI(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,tc()];case 1:t.sent();e=["Validating commit message"];return[4,e1.commitLint()];case 2:return[4,tm.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),t_();return[2]}})})()}y(tI,"commitLint");function tw(){return /*#__PURE__*/s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,e1.configureGitHook()];case 1:return[4,tm.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),es(eQ.GIT_HOOK);return[4,tg(eX)];case 3:t=s.sent();en(eQ.SIMPLE_GIT_HOOKS_JSON,t);n="\n".concat(ex,"\n");er(eQ.GIT_IGNORE)?z(eQ.GIT_IGNORE,"utf-8").split("\n").includes(ex)||X(eQ.GIT_IGNORE,n,"utf-8"):Q(eQ.GIT_IGNORE,n,"utf-8");r=["Setting up simple-git-hooks"];return[4,e1.simpleGitHooks()];case 4:return[4,tm.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}y(tw,"setupGitHook");function tS(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,e6([ef],{update:!0,postInstallActions:[tw]})];case 1:e.sent();return[2]}})})()}y(tS,"setup");function tR(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:es(eQ.NODE_MODULES,eQ.PNPM_LOCK_YAML);return[4,e5()];case 1:e.sent();return[4,tw()];case 2:e.sent();return[2]}})})()}y(tR,"reset");function tC(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e1.nodeModulesInspect()];case 1:return[4,tm.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tC,"inspect");function tO(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e1.testUnit()];case 1:return[4,tm.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tO,"testUnit");function tk(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e1.testE2e()];case 1:return[4,tm.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tk,"testE2E");function tT(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e1.mongoMigrateCreate(e)];case 1:return[4,tm.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}y(tT,"mongoMigrateCreate");function tP(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e1.mongoMigrateUp()];case 1:return[4,tm.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tP,"mongoMigrateUp");function tG(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e1.mongoMigrateDown()];case 1:return[4,tm.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tG,"mongoMigrateDown");(function(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,x(_(h.argv)).scriptName(eS).usage("$0 <command> [options]").command("lint","Check code for linting issues",tb).command("lint:fix","Fix linting issues automatically",tE).command("lint:inspect","View active ESLint configuration",tj).command("lint-staged","Run lint checks on staged files",tx).command("commitlint","Validate commit message format",tI).command("setup","Initialize project setup and dependencies",tS).command("reset","Reset the project and reinstall dependencies",tR).command("inspect","Analyze installed project dependencies",tC).command("test:unit","Run unit test suite",tO).command("test:e2e","Run end-to-end test suite",tk).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return /*#__PURE__*/s(function(){return m(this,function(t){switch(t.label){case 0:if(!e.name){K.error("Migration name is required.");return[2]}return[4,tT(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tP).command("mongo:migrate:down","Rollback last MongoDB migration",tG).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(j.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();K.error("Fatal: ".concat(e.message)),h.exit(1);return[3,3];case 3:return[2]}})})()})();
2
+ function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var c=e[i](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function c(e){r(o,s,i,c,a,"next",e)}function a(e){r(o,s,i,c,a,"throw",e)}c(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,c;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;c=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw c}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||c(e,n)||g(e,n)||a()}function p(e){return n(e)||o(e)||g(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=c(0),o["throw"]=c(1),o["return"]=c(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(t){return a([e,t])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(i=0)),i)try{if(n=1,r&&(s=c[0]&2?r["return"]:c[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;if(r=0,s)c=[c[0]&2,s.value];switch(c[0]){case 0:case 1:s=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;r=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(c[0]===6&&i.label<s[1]){i.label=s[1];s=c;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(c);break}if(s[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];r=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var v=Object.defineProperty;var y=function(e,t){return v(e,"name",{value:t,configurable:!0})};import h from"node:process";import{hideBin as _}from"yargs/helpers";import x from"yargs/yargs";var j={name:"@cyberskill/shared",type:"module",version:"1.120.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/nodejs/cli/index.ts lint","lint:fix":"tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"tsx src/nodejs/cli/index.ts lint:inspect",reset:"tsx src/nodejs/cli/index.ts reset",setup:"tsx src/nodejs/cli/index.ts setup",inspect:"tsx src/nodejs/cli/index.ts inspect","test:unit":"tsx src/nodejs/cli/index.ts test:unit","test:e2e":"tsx src/nodejs/cli/index.ts test:e2e",commitlint:"tsx src/nodejs/cli/index.ts commitlint","lint-staged":"tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.41.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.0","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.3",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var b=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as E}from"node:child_process";import I from"node:process";import*as w from"node:util";var S=".cyberskill-storage";import R from"@dotenvx/dotenvx";import{bool as C,cleanEnv as O,str as k}from"envalid";import T from"node:os";import P from"node:path";import G from"node:process";var U=!1;function N(){U||(R.config(),U=!0)}y(N,"loadEnvFile");function L(){N();var e=O(G.env,{CWD:k({default:G.cwd()}),DEBUG:C({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:k({default:P.join(T.homedir(),S)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}y(L,"getEnv");var D=function(e){return e.Error="error",e.Warning="warning",e}({});import M from"chalk";import A from"consola";import{GraphQLError as q}from"graphql";var F=L();F.DEBUG||(A.level=4);function B(e){var t=M[e];return typeof t=="function"?t:M.green}y(B,"chalkKeyword");var K={silent:A.silent,level:A.level,fatal:A.fatal,error:A.error,warn:A.warn,log:A.log,info:A.info,success:A.success,ready:A.ready,start:A.start,box:A.box,debug:A.debug,trace:A.trace,verbose:A.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){A.box(M.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;A.log("".concat(M.gray("File:")," ").concat(M.blue("".concat(t).concat(r?":".concat(r):"")))),s&&A.log(" ".concat(B(n)("Rule:")," ").concat(s)),A.log(" ".concat(B(n)("Message:")," ").concat(i))}),A.box(B(n)("".concat(e," : ").concat(t.length))),A.log(M.gray("─".repeat(40)))}};var W={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import Y from"node-fetch";import H from"fs-extra";var J=H.lstatSync,$=H.readdirSync,V=H.mkdirSync,z=H.readFileSync,Q=H.unlinkSync,X=H.statSync,Z=H.readJsonSync;function ee(e,t,n){H.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}y(ee,"writeFileSync");function et(e,t,n){H.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}y(et,"appendFileSync");function en(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return H.pathExistsSync(e)})}y(en,"pathExistsSync");function er(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){en(e)&&H.removeSync(e)})}y(er,"removeSync");import es,{join as ei,resolve as eo}from"node:path";var ec=L();function ea(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return eo.apply(void 0,[ec.CWD].concat(p(t)))}y(ea,"resolveWorkingPath");function eu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return ei.apply(void 0,p(t))}y(eu,"join");var el=L(),ed=el.CWD,ep="@cyberskill/shared",ef="node_modules",eg="dist",em="package.json",ev="package-lock.json",ey="tsconfig.json",eh=".gitignore",e_=".simple-git-hooks.json",ex="pnpm-lock.yaml",ej=".git/hooks/",eb=".git/COMMIT_EDITMSG",eE=".migrate-mongo.config.js",eI=eu(ed,ef,ep,eg),ew="cyberskill",eS="src/nodejs/cli/index.ts",eR="eslint",eC="eslint",eO="vitest",ek="playwright",eT="vitest",eP="@commitlint/cli",eG="commitlint",eU="lint-staged",eN="lint-staged",eL="typescript",eD="tsc",eM="tsx",eA="git",eq="pnpm",eF="pnpm exec",eB="simple-git-hooks",eK="simple-git-hooks",eW="@eslint/config-inspector",eY="eslint-config-inspector",eH="node-modules-inspector",eJ="node-modules-inspector",e$="migrate-mongo",eV="./node_modules/migrate-mongo/bin/migrate-mongo",ez={CYBERSKILL_DIRECTORY:eI,WORKING_DIRECTORY:ed,TS_CONFIG:ea(ey),GIT_IGNORE:ea(eh),GIT_HOOK:ea(ej),GIT_COMMIT_MSG:ea(eb),SIMPLE_GIT_HOOKS_JSON:ea(e_),PACKAGE_JSON:ea(em),PACKAGE_LOCK_JSON:ea(ev),PNPM_LOCK_YAML:ea(ex),NODE_MODULES:ea(ef),MIGRATE_MONGO_CONFIG:ea(eE),LINT_STAGED_CONFIG:ea("".concat(eI,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:ea("".concat(eI,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:ea("".concat(eI,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ea("".concat(eI,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ea("".concat(eI,"/react/vitest/vitest.e2e.js"))};function eQ(e){var t=e.isCurrentProject;return l({"pre-commit":eN,"commit-msg":eG},t&&{"pre-push":tl("".concat(eA," pull"))})}y(eQ,"createGitHooksConfig");function eX(e,t,n){return /*#__PURE__*/s(function(){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case b.CLI:return[3,1];case b.STRING:return[3,3]}return[3,4];case 1:return[4,e8(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),tp(tl("".concat(eF," ").concat(n))))];case 3:return[2,tp(tl(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}y(eX,"buildCommand");function eZ(e,t,n){return function(){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,eX(e,t,n)]})})()}}y(eZ,"commandFactory");var e0={simpleGitHooks:eZ(b.CLI,eB,eK),eslintInspect:eZ(b.CLI,eW,eY),nodeModulesInspect:eZ(b.CLI,eH,eJ),eslintCheck:eZ(b.CLI,eR,"".concat(eC," ").concat(ez.WORKING_DIRECTORY," --no-cache")),eslintFix:eZ(b.CLI,eR,"".concat(eC," ").concat(ez.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:eZ(b.CLI,eL,"".concat(eD," -p ").concat(ez.TS_CONFIG," --noEmit")),configureGitHook:eZ(b.STRING,"".concat(eA," config core.hooksPath ").concat(ez.GIT_HOOK)),testUnit:eZ(b.CLI,eO,"".concat(eT," --config ").concat(ez.UNIT_TEST_CONFIG)),testE2e:eZ(b.CLI,"".concat(eO," ").concat(ek),"".concat(eT," --config ").concat(ez.E2E_TEST_CONFIG)),mongoMigrateCreate:y(function(e){return eZ(b.CLI,e$,"".concat(eM," ").concat(eV," create ").concat(e," -f ").concat(ez.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eZ(b.CLI,e$,"".concat(eM," ").concat(eV," up -f ").concat(ez.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eZ(b.CLI,e$,"".concat(eM," ").concat(eV," down -f ").concat(ez.MIGRATE_MONGO_CONFIG)),commitLint:eZ(b.CLI,eP,"".concat(eG," --edit ").concat(ez.GIT_COMMIT_MSG," --config ").concat(ez.COMMITLINT_CONFIG)),lintStaged:eZ(b.CLI,eU,"".concat(eN," --config ").concat(ez.LINT_STAGED_CONFIG)),stageBuildDirectory:eZ(b.STRING,"".concat(eA," add ").concat(eg)),build:eZ(b.STRING,"".concat(eq," run build")),pnpmInstallStandard:eZ(b.STRING,"".concat(eq," install")),pnpmInstallLegacy:eZ(b.STRING,"".concat(eq," install --legacy-peer-deps")),pnpmInstallForce:eZ(b.STRING,"".concat(eq," install --force"))};var e1=L();function e2(e){var t=eu(e1.CWD,em);if(!en(t))return!1;try{var n=Z(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,c=o===void 0?{}:o,a=r===e,u=e in i,l=e in c;return a||u||l?{path:t,file:n,isCurrentProject:a,isDepend:u,isDevDepend:l}:!1}catch(e){return K.warn("Failed to read package.json: ".concat(e.message)),!1}}y(e2,"getPackage");function e4(e){return /*#__PURE__*/s(function(){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,Y("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw K.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}y(e4,"getLatestPackageVersion");function e3(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,c,a,u,d,p,f,g,v,y,h,_,x,j,b,E,I;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e2(e);if(!n)return[2,l({},W)];a=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},v=(s=u.devDependencies)!==null&&s!==void 0?s:{},y=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=g[e])!==null&&o!==void 0?o:"0.0.0":f?(c=v[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!d)return[3,1];x=y;return[3,3];case 1:return[4,e4(e)];case 2:x=m.sent();m.label=3;case 3:h=x,_=d||y===h;if(!_&&(t===null||t===void 0?void 0:t.update)){;b=p?"dependencies":f?"devDependencies":null;b&&((j=u[b])===null||j===void 0?void 0:j[e])!==h&&(u[b]=(E=u[b])!==null&&E!==void 0?E:{},u[b][e]=h,ee(a,JSON.stringify(u,null,4)),K.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:a,file:u,isUpToDate:_}];case 4:I=m.sent();return[2,(K.error('Error checking package "'.concat(e,'": ').concat(I.message)),l({},W))];case 5:return[2]}})})()}y(e3,"checkPackage");function e5(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i,o,c,a,u,l,d;return m(this,function(p){switch(p.label){case 0:e=[{command:y(function(){return e0.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:y(function(){return e0.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:y(function(){return e0.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,c=o.command,a=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,tg("".concat(a," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();K.warn("Installation attempt failed: ".concat(a)),K.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}y(e5,"installDependencies");function e8(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,c,a,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!en(ez.PACKAGE_JSON)){K.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e3(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,e5()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,c=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);a=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=a.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:f=m.sent();o=true;c=f;return[3,12];case 11:try{if(!i&&a.return!=null){a.return()}}finally{if(o){throw c}}return[7];case 12:return[3,14];case 13:g=m.sent();throw K.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}y(e8,"setupPackages");import e6 from"node-persist";var e7=L();function e9(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=e6.defaultInstance;if(e)return[3,2];return[4,e6.init({dir:e7.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}y(e9,"initNodePersist");var te={get:function e(e){return /*#__PURE__*/s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e9()];case 1:r.sent();return[4,e6.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(K.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e9()];case 1:r.sent();return[4,e6.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e9()];case 1:n.sent();return[4,e6.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();K.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e9()];case 1:n.sent();return[4,e6.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(K.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(K.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return /*#__PURE__*/s(function(){return m(this,function(t){try{return[2,"".concat(e7.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(K.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var tt=L(),tn=w.promisify(E);function tr(e){return"error_list:".concat(e)}y(tr,"getErrorListKey");function ts(e){return /*#__PURE__*/s(function(){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tr(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,te.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,te.getLogLink(n)];case 1:e=t.sent();e&&K.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();K.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}y(ts,"saveErrorListToStorage");function ti(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,te.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,te.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(K.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}y(ti,"getStoredErrorLists");function to(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,te.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return te.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}y(to,"clearAllErrorLists");function tc(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c,a,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],g=o.exec(e)||[];var m,v,y,h,_,x;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===D.Error?D.Error:D.Warning,message:(m=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:"",rule:(v=p===null||p===void 0?void 0:(a=p[5])===null||a===void 0?void 0:a.trim())!==null&&v!==void 0?v:""}):f.length?t.push({file:(y=f===null||f===void 0?void 0:f[1])!==null&&y!==void 0?y:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===D.Error?D.Error:D.Warning,message:(h=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):g.length?t.push({file:"commitlint",type:D.Error,message:(_=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&_!==void 0?_:"",rule:(x=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&x!==void 0?x:""}):n.push(e.trim())}}),t.length&&ts(t),tt.DEBUG&&n.length&&(K.warn("Unmatched lines:"),n.forEach(function(e){return K.info(" ".concat(e))}))}y(tc,"parseTextErrors");function ta(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?D.Error:D.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&ts(n)}catch(t){tc(e)}}y(ta,"parseCommandOutput");function tu(e){return /*#__PURE__*/s(function(e){var t,n,r,s,i,o,c,a,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:ta;n=new AbortController;I.on("SIGINT",function(){K.warn("Process interrupted. Terminating..."),n.abort(),I.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tn(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&K.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}y(tu,"executeCommand");function tl(e){return{raw:!0,cmd:e}}y(tl,"rawCommand");function td(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eF," ").concat(ep," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eF," ").concat(eM," ").concat(eS," ").concat(e):"".concat(eF," ").concat(ew," ").concat(e)}y(td,"formatCLI");function tp(e,t){return typeof e=="function"?td(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?td(e,t):e}y(tp,"formatCommand");function tf(e){return /*#__PURE__*/s(function(e){var t,n,r,s,i,o,c;var a=arguments;return m(this,function(u){switch(u.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,e3(ep)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:s=c,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,tp(r,i)]}))]}})}).apply(this,arguments)}y(tf,"resolveCommands");function tg(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);K.start("".concat(e)),tt.DEBUG&&K.info("→ ".concat(t));return[4,tu(t)];case 1:r.sent(),K.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw K.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}y(tg,"runCommand");function tm(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!en(ez.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e0.typescriptCheck()];case 1:return[4,tg.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=K.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}y(tm,"checkTypescript");function tv(){return /*#__PURE__*/s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e0.eslintFix()];case 1:return[4,tg.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e0.eslintCheck()];case 4:return[4,tg.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}y(tv,"checkEslint");function ty(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";K.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}y(ty,"printIssues");function th(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,ti()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===D.Error}),n=e.filter(function(e){return e.type===D.Warning});!t.length&&!n.length?K.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(ty("Warnings",n),ty("Errors",t),(t.length>0||n.length>0)&&h.exit(1));return[2]}})})()}y(th,"showCheckResult");function t_(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,to()];case 1:o.sent();return[4,e3(ep)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ep)];return[4,e0.build()];case 4:return[4,tg.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e0.stageBuildDirectory()];case 6:return[4,tg.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw K.error("Error building and staging ".concat(ep,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,e0.lintStaged()];case 10:return[4,tg.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),th();return[2]}})})()}y(t_,"lintStaged");function tx(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e0.eslintInspect()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tx,"inspectLint");function tj(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,to()];case 1:e.sent();return[4,Promise.all([tm(),tv()])];case 2:e.sent(),th();return[2]}})})()}y(tj,"lintCheck");function tb(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,to()];case 1:e.sent();return[4,Promise.all([tm(),tv(!0)])];case 2:e.sent(),th();return[2]}})})()}y(tb,"lintFix");function tE(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,to()];case 1:t.sent();e=["Validating commit message"];return[4,e0.commitLint()];case 2:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),th();return[2]}})})()}y(tE,"commitLint");function tI(){return /*#__PURE__*/s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,e0.configureGitHook()];case 1:return[4,tg.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),er(ez.GIT_HOOK);return[4,tf(eQ)];case 3:t=s.sent();ee(ez.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(e_,"\n");en(ez.GIT_IGNORE)?z(ez.GIT_IGNORE,"utf-8").split("\n").includes(e_)||et(ez.GIT_IGNORE,n):ee(ez.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,e0.simpleGitHooks()];case 4:return[4,tg.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}y(tI,"setupGitHook");function tw(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,e8([ep],{update:!0,postInstallActions:[tI]})];case 1:e.sent();return[2]}})})()}y(tw,"setup");function tS(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:er(ez.NODE_MODULES,ez.PNPM_LOCK_YAML);return[4,e5()];case 1:e.sent();return[4,tI()];case 2:e.sent();return[2]}})})()}y(tS,"reset");function tR(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e0.nodeModulesInspect()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tR,"inspect");function tC(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e0.testUnit()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tC,"testUnit");function tO(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e0.testE2e()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tO,"testE2E");function tk(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e0.mongoMigrateCreate(e)];case 1:return[4,tg.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}y(tk,"mongoMigrateCreate");function tT(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e0.mongoMigrateUp()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tT,"mongoMigrateUp");function tP(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e0.mongoMigrateDown()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tP,"mongoMigrateDown");(function(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,x(_(h.argv)).scriptName(ew).usage("$0 <command> [options]").command("lint","Check code for linting issues",tj).command("lint:fix","Fix linting issues automatically",tb).command("lint:inspect","View active ESLint configuration",tx).command("lint-staged","Run lint checks on staged files",t_).command("commitlint","Validate commit message format",tE).command("setup","Initialize project setup and dependencies",tw).command("reset","Reset the project and reinstall dependencies",tS).command("inspect","Analyze installed project dependencies",tR).command("test:unit","Run unit test suite",tC).command("test:e2e","Run end-to-end test suite",tO).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return /*#__PURE__*/s(function(){return m(this,function(t){switch(t.label){case 0:if(!e.name){K.error("Migration name is required.");return[2]}return[4,tk(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tT).command("mongo:migrate:down","Rollback last MongoDB migration",tP).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(j.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();K.error("Fatal: ".concat(e.message)),h.exit(1);return[3,3];case 3:return[2]}})})()})();