@cyberskill/shared 1.138.0 → 1.139.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.
@@ -1 +1 @@
1
- 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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(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 i(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){s(o,r,i,a,c,"next",e)}function c(e){s(o,r,i,a,c,"throw",e)}a(undefined)})}}function o(e,t,n){t=d(t);return C(e,b()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function u(e,t,n){if(t)c(e.prototype,t);if(n)c(e,n);return e}function l(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 d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)D(e,t)}function f(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function m(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function E(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 g(){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 h(){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 y(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){l(e,t,n[t])})}return e}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function S(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{v(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function O(e,t){if(e==null)return{};var n=_(e,t);var r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++){r=i[s];if(t.indexOf(r)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;n[r]=e[r]}}return n}function _(e,t){if(e==null)return{};var n={};var r=Object.keys(e);var s,i;for(i=0;i<r.length;i++){s=r[i];if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function C(e,t){if(t&&(A(t)==="object"||typeof t==="function")){return t}return r(e)}function D(e,t){D=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return D(e,t)}function I(e,n){return t(e)||E(e,n)||T(e,n)||g()}function N(e){return n(e)||m(e)||T(e)||h()}function A(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function T(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 b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(b=function(){return!!e})()}function R(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 x=Object.defineProperty;var G=function(e,t,n){return t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};var M=function(e,t){return x(e,"name",{value:t,configurable:!0})};var P=function(e,t,n){return G(e,(typeof t==="undefined"?"undefined":A(t))!="symbol"?t+"":t,n)};import{ApolloServer as w}from"@apollo/server";import{expressMiddleware as L}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as j}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as k,ApolloServerPluginLandingPageProductionDefault as U}from"@apollo/server/plugin/landingPage/default";var F=function(e){return e.Error="error",e.Warning="warning",e}({});import q from"chalk";import Y from"consola";import{GraphQLError as V}from"graphql";var K=".cyberskill-storage";import B from"@dotenvx/dotenvx";import{bool as H,cleanEnv as W,str as Q}from"envalid";import J from"node:os";import $ from"node:path";import z from"node:process";var X=!1;function Z(){X||(B.config(),X=!0)}M(Z,"loadEnvFile");function ee(){Z();var e=W(z.env,{CWD:Q({default:z.cwd()}),DEBUG:H({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:Q({default:$.join(J.homedir(),K)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}M(ee,"getEnv");var et={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};var en=ee();function er(e){var t=e.message,n=e.status,r=n===void 0?et.INTERNAL_SERVER_ERROR:n,s=e.type,i=s===void 0?"graphql":s;var o;var a=(o=t!==null&&t!==void 0?t:r.MESSAGE)!==null&&o!==void 0?o:"Internal server error";throw i==="graphql"?new V(a,{extensions:{code:r.CODE}}):new Error(a)}M(er,"throwError");en.DEBUG||(Y.level=4);function es(e){var t=q[e];return typeof t=="function"?t:q.green}M(es,"chalkKeyword");var ei={silent:Y.silent,level:Y.level,fatal:Y.fatal,error:Y.error,warn:Y.warn,log:Y.log,info:Y.info,success:Y.success,ready:Y.ready,start:Y.start,box:Y.box,debug:Y.debug,trace:Y.trace,verbose:Y.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)){Y.box(q.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;Y.log("".concat(q.gray("File:")," ").concat(q.blue("".concat(t).concat(r?":".concat(r):"")))),s&&Y.log(" ".concat(es(n)("Rule:")," ").concat(s)),Y.log(" ".concat(es(n)("Message:")," ").concat(i))}),Y.box(es(n)("".concat(e," : ").concat(t.length))),Y.log(q.gray("─".repeat(40)))}};function eo(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,s=r===void 0?!0:r,i=n.returnValue,o=n.callback,a=f(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return s&&ei.error(a.message),o&&typeof o=="function"&&o(a),i||{success:!1,message:a.message,code:et.INTERNAL_SERVER_ERROR.CODE}}M(eo,"catchError");function ea(e){return new w(y({schema:e.schema,plugins:[e.isDev?k():U(),j({httpServer:e.server})].concat(N(e.drainServer?[{serverWillStart:function t(){return i(function(){return R(this,function(t){return[2,{drainServer:function t(){return i(function(){var t;return R(this,function(n){(t=e.drainServer)===null||t===void 0?void 0:t.call(e),ei.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}M(ea,"createApolloServer");import ec from"node:process";import{hideBin as eu}from"yargs/helpers";import el from"yargs/yargs";var ed={name:"@cyberskill/shared",type:"module",version:"1.138.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"},"./config":{types:"./dist/config/index.d.ts",import:"./dist/config/index.js",require:"./dist/config/index.cjs"},"./config/commitlint":{types:"./dist/config/commitlint/index.d.ts",import:"./dist/config/commitlint/index.js",require:"./dist/config/commitlint/index.cjs"},"./config/env":{types:"./dist/config/env/index.d.ts",import:"./dist/config/env/index.js",require:"./dist/config/env/index.cjs"},"./config/eslint":{types:"./dist/config/eslint/index.d.ts",import:"./dist/config/eslint/index.js",require:"./dist/config/eslint/index.cjs"},"./config/graphql-codegen":{types:"./dist/config/graphql-codegen/index.d.ts",import:"./dist/config/graphql-codegen/index.js",require:"./dist/config/graphql-codegen/index.cjs"},"./config/lint-staged":{types:"./dist/config/lint-staged/index.d.ts",import:"./dist/config/lint-staged/index.js",require:"./dist/config/lint-staged/index.cjs"},"./constant":{types:"./dist/constant/index.d.ts",import:"./dist/constant/index.js",require:"./dist/constant/index.cjs"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/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"},"./style/reset.css":{import:"./dist/style/reset.css",require:"./dist/style/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./util":{types:"./dist/util/index.d.ts",import:"./dist/util/index.js",require:"./dist/util/index.cjs"}},typesVersions:{"*":{config:["dist/config/index.d.ts"],constant:["dist/constant/index.d.ts"],node:["dist/node/index.d.ts"],react:["dist/react/index.d.ts"],typescript:["dist/typescript/index.d.ts"],util:["dist/util/index.d.ts"]}},bin:{cyberskill:"dist/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",reset:"tsx src/node/cli/index.ts reset",prepare:"tsx src/node/cli/index.ts prepare",inspect:"tsx src/node/cli/index.ts inspect","test:unit":"tsx src/node/cli/index.ts test:unit","test:e2e":"tsx src/node/cli/index.ts test:e2e",commitlint:"tsx src/node/cli/index.ts commitlint"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.42.2","@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.7","@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-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",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.1","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.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.4",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.2",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@commitlint/config-conventional":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@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/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.3","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.26.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var ep=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as ef}from"node:child_process";import em from"node:process";import*as eE from"node:util";var eg=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});import eh from"node-fetch";import ey from"fs-extra";import ev from"node:path";var eS=ey,eO=ey.lstatSync,e_=ey.readdirSync,eC=ey.mkdirSync,eD=ey.readFileSync,eI=ey.unlinkSync,eN=ey.statSync,eA=ey.readJsonSync;function eT(e,t,n){ey.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}M(eT,"writeFileSync");function eb(e,t,n){ey.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}M(eb,"appendFileSync");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 ey.pathExistsSync(e)})}M(eR,"pathExistsSync");function ex(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eR(e)&&ey.removeSync(e)})}M(ex,"removeSync");function eG(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.extensions,s=O(n,["extensions"]);ey.copySync(e,t,y({filter:M(function(e){return eN(e).isDirectory()||!r||r.length===0?!0:r.includes(ev.extname(e))},"filter")},s))}M(eG,"copySync");import eM from"fs-extra";import eP from"node:path";var ew=ee(),eL=eP;function ej(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eL).resolve.apply(r,[ew.CWD].concat(N(t)))}M(ej,"resolveWorkingPath");function ek(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eL).resolve.apply(r,N(t))}M(ek,"resolve");function eU(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eL).join.apply(r,N(t))}M(eU,"join");var eF=ee(),eq=eF.CWD,eY="@cyberskill/shared",eV="node_modules",eK="dist",eB="package.json",eH="package-lock.json",eW="tsconfig.json",eQ=".gitignore",eJ=".simple-git-hooks.json",e$="pnpm-lock.yaml",ez=".git/hooks/",eX=".git/COMMIT_EDITMSG",eZ=".migrate-mongo.config.js",e0=function(){var e=eM.readJsonSync(ej(eB)).name===eY?eq:eU(eq,eV,eY);return eU(e,eK)}(),e1="cyberskill",e2="src/node/cli/index.ts",e4="eslint",e3="eslint",e5="vitest",e8="playwright",e6="vitest",e7="@commitlint/cli",e9="@commitlint/config-conventional",te="commitlint",tt="lint-staged",tn="lint-staged",tr="typescript",ts="tsc",ti="tsx",to="git",ta="pnpm",tc="pnpm exec",tu="simple-git-hooks",tl="simple-git-hooks",td="@eslint/config-inspector",tp="eslint-config-inspector",tf="node-modules-inspector",tm="node-modules-inspector",tE="migrate-mongo",tg="./node_modules/migrate-mongo/bin/migrate-mongo",th={CYBERSKILL_DIRECTORY:e0,WORKING_DIRECTORY:eq,TS_CONFIG:ej(eW),GIT_IGNORE:ej(eQ),GIT_HOOK:ej(ez),GIT_COMMIT_MSG:ej(eX),SIMPLE_GIT_HOOKS_JSON:ej(eJ),PACKAGE_JSON:ej(eB),PACKAGE_LOCK_JSON:ej(eH),PNPM_LOCK_YAML:ej(e$),NODE_MODULES:ej(eV),MIGRATE_MONGO_CONFIG:ej(eZ),LINT_STAGED_CONFIG:ej("".concat(e0,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:ej("".concat(e0,"/config/commitlint/index.js")),UNIT_TEST_CONFIG:ej("".concat(e0,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ej("".concat(e0,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ej("".concat(e0,"/react/vitest/vitest.e2e.js"))};function ty(e){var t=e.isCurrentProject;return y({"pre-commit":tn,"commit-msg":te},t&&{"pre-push":tF("".concat(to," pull"))})}M(ty,"createGitHooksConfig");function tv(e){var t=e.type,n=e.packages,r=e.command;var s=n===null||n===void 0?void 0:n.reduce(function(e,t){return e.some(function(e){return e.name===t.name})||e.push(t),e},[]);return function(){return i(function(){var e;return R(this,function(n){switch(n.label){case 0:switch(t){case ep.CLI:return[3,1];case ep.STRING:return[3,4]}return[3,5];case 1:e=s===null||s===void 0?void 0:s.length;if(!e)return[3,3];return[4,tN(s,{update:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,tY(tF("".concat(tc," ").concat(r))))];case 4:return[2,tY(tF(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}M(tv,"buildCommand");var tS={simpleGitHooks:tv({type:ep.CLI,packages:[{name:tu,type:eg.DEV_DEPENDENCY}],command:tl}),eslintInspect:tv({type:ep.CLI,packages:[{name:td,type:eg.DEV_DEPENDENCY}],command:tp}),nodeModulesInspect:tv({type:ep.CLI,packages:[{name:tf,type:eg.DEV_DEPENDENCY}],command:tm}),eslintCheck:tv({type:ep.CLI,packages:[{name:e4,type:eg.DEV_DEPENDENCY}],command:"".concat(e3," ").concat(th.WORKING_DIRECTORY," --no-cache")}),eslintFix:tv({type:ep.CLI,packages:[{name:e4,type:eg.DEV_DEPENDENCY}],command:"".concat(e3," ").concat(th.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:tv({type:ep.CLI,packages:[{name:tr,type:eg.DEPENDENCY}],command:"".concat(ts," -p ").concat(th.TS_CONFIG," --noEmit")}),testUnit:tv({type:ep.CLI,packages:[{name:e5,type:eg.DEV_DEPENDENCY}],command:"".concat(e6," --config ").concat(th.UNIT_TEST_CONFIG)}),testE2e:tv({type:ep.CLI,packages:[{name:e5,type:eg.DEV_DEPENDENCY}],command:"".concat(e6," --config ").concat(th.E2E_TEST_CONFIG)}),mongoMigrateCreate:M(function(e){return tv({type:ep.CLI,packages:[{name:tE,type:eg.DEPENDENCY}],command:"".concat(ti," ").concat(tg," create ").concat(e," -f ").concat(th.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:tv({type:ep.CLI,packages:[{name:tE,type:eg.DEPENDENCY}],command:"".concat(ti," ").concat(tg," up -f ").concat(th.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:tv({type:ep.CLI,packages:[{name:tE,type:eg.DEPENDENCY}],command:"".concat(ti," ").concat(tg," down -f ").concat(th.MIGRATE_MONGO_CONFIG)}),commitLint:tv({type:ep.CLI,packages:[{name:e7,type:eg.DEV_DEPENDENCY},{name:e9,type:eg.DEV_DEPENDENCY}],command:"".concat(te," --edit ").concat(th.GIT_COMMIT_MSG," --config ").concat(th.COMMITLINT_CONFIG)}),lintStaged:tv({type:ep.CLI,packages:[{name:tt,type:eg.DEV_DEPENDENCY}],command:"".concat(tn," --config ").concat(th.LINT_STAGED_CONFIG)}),configureGitHook:tv({type:ep.STRING,command:"".concat(to," config core.hooksPath ").concat(th.GIT_HOOK)}),stageBuildDirectory:tv({type:ep.STRING,command:"".concat(to," add ").concat(eK)}),build:tv({type:ep.STRING,command:"".concat(ta," run --if-present build")}),pnpmInstallStandard:tv({type:ep.STRING,command:"".concat(ta," install --no-frozen-lockfile")}),pnpmInstallLegacy:tv({type:ep.STRING,command:"".concat(ta," install --no-frozen-lockfile --legacy-peer-deps")}),pnpmInstallForce:tv({type:ep.STRING,command:"".concat(ta," install --no-frozen-lockfile --force")})};var tO=ee();function t_(e){return i(function(){var t,n,r,s;return R(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,eh("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,{success:!0,result:r}];case 3:s=i.sent();return[2,eo(s)];case 4:return[2]}})})()}M(t_,"getLatestPackageVersion");function tC(e){return i(function(){var t,n,r,s,i,o,a,c,u,l,d,p,f,m,E,g,h,y,v;return R(this,function(S){switch(S.label){case 0:S.trys.push([0,2,,3]);if(!eR(th.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===eg.DEPENDENCY,isDevDependency:e.type===eg.DEV_DEPENDENCY,installedPath:"",file:{}}}];t=eA(th.PACKAGE_JSON),n=t.name,r=t.version,s=r===void 0?"":r,i=t.dependencies,o=i===void 0?{}:i,a=t.devDependencies,c=a===void 0?{}:a;if(e.name===n)return[2,{success:!0,result:{name:n,currentVersion:s,latestVersion:s,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===eg.DEPENDENCY,isDevDependency:e.type===eg.DEV_DEPENDENCY,installedPath:th.PACKAGE_JSON,file:t}}];u=e.name in o,l=e.name in c;return[4,t_(e.name)];case 1:d=S.sent();if(!d.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];if(!u&&!l)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===eg.DEPENDENCY,isDevDependency:e.type===eg.DEV_DEPENDENCY,installedPath:"",file:{}}}];m=(f=(p=o[e.name])!==null&&p!==void 0?p:c[e.name])!==null&&f!==void 0?f:"",E=eU(tO.CWD,eV,e.name,eB);if(!eR(E))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];g=eA(E),h=g.version,y=h===void 0?"":h;return[2,m!==y?{success:!0,result:{name:e.name,currentVersion:y||m,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:E,file:g}}:{success:!0,result:{name:e.name,currentVersion:m,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:m===d.result,isDependency:u,isDevDependency:l,installedPath:E,file:g}}];case 2:v=S.sent();return[2,eo(v)];case 3:return[2]}})})()}M(tC,"getPackage");function tD(e){return i(function(){var t,n,r,s,i;return R(this,function(o){try{;r=eA(th.PACKAGE_JSON),s=(t=r.dependencies)!==null&&t!==void 0?t:{},i=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?s[e.name]=e.latestVersion:e.isDevDependency&&(i[e.name]=e.latestVersion),eT(th.PACKAGE_JSON,JSON.stringify(r,null,4)),ei.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){eo(e)}return[2]})})()}M(tD,"updatePackage");function tI(){return i(function(){var e,t,n,r,s,i,o,a,c,u,l,d,p;return R(this,function(f){switch(f.label){case 0:f.trys.push([0,12,,13]);e=[{command:M(function(){return tS.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:M(function(){return tS.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:M(function(){return tS.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,tK("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();eo(l);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:return[3,13];case 12:p=f.sent();eo(p);return[3,13];case 13:return[2]}})})()}M(tI,"installDependencies");function tN(e,t){return i(function(){var n,r,s,i,o,a,c,u,l,d,p,f;return R(this,function(m){switch(m.label){case 0:if(!eR(th.PACKAGE_JSON)){ei.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,16,,17]);return[4,Promise.all(e.map(tC))];case 2:n=m.sent().filter(function(e){return e.success?!e.result.isCurrentProject&&(!e.result.isInstalled||!e.result.isUpToDate):!1});r=n.length>0;if(!r)return[3,7];return[4,Promise.all(n.map(function(e){return e.success?tD(e.result):Promise.resolve()}))];case 3:m.sent();return[4,tI()];case 4:m.sent();s=["Running ESLint with auto-fix"];return[4,tS.eslintFix()];case 5:return[4,tK.apply(void 0,s.concat([m.sent()]))];case 6:r=m.sent();m.label=7;case 7:r;o=true,a=false,c=undefined;m.label=8;case 8:m.trys.push([8,13,14,15]);u=((i=t===null||t===void 0?void 0:t.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();m.label=9;case 9:if(!!(o=(l=u.next()).done))return[3,12];d=l.value;return[4,d()];case 10:m.sent();m.label=11;case 11:o=true;return[3,9];case 12:return[3,15];case 13:p=m.sent();a=true;c=p;return[3,15];case 14:try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw c}}return[7];case 15:return[3,17];case 16:f=m.sent();eo(f);return[3,17];case 17:return[2]}})})()}M(tN,"setupPackages");import tA from"node-persist";var tT=ee();function tb(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=tA.defaultInstance;if(e)return[3,2];return[4,tA.init({dir:tT.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]}})})()}M(tb,"initNodePersist");var tR={get:function e(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tb()];case 1:r.sent();return[4,tA.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,eo(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tb()];case 1:r.sent();return[4,tA.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();eo(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return R(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tb()];case 1:n.sent();return[4,tA.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();eo(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return R(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tb()];case 1:n.sent();return[4,tA.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(ei.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,eo(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return R(this,function(t){try{return[2,"".concat(tT.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,eo(e,{returnValue:null})]}return[2]})})()}};var tx=ee(),tG=eE.promisify(ef);function tM(e){return"error_list:".concat(e)}M(tM,"getErrorListKey");function tP(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tM(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,tR.set(n,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(function(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:return[4,tR.getLogLink(n)];case 1:e=t.sent();e&&ei.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=s.sent();eo(r);return[3,4];case 4:return[2]}})})()}M(tP,"saveErrorListToStorage");function tw(){return i(function(){var e,t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tR.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 i(function(){var t;return R(this,function(n){switch(n.label){case 0:return[4,tR.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,eo(n,{returnValue:[]})];case 4:return[2]}})})()}M(tw,"getStoredErrorLists");function tL(){return i(function(){var e,t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tR.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 tR.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();eo(n);return[3,4];case 4:return[2]}})})()}M(tL,"clearAllErrorLists");function tj(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 p=s.exec(e)||[],f=i.exec(e)||[],m=o.exec(e)||[];var E,g,h,y,v,S;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===F.Error?F.Error:F.Warning,message:(E=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&E!==void 0?E:"",rule:(g=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):f.length?t.push({file:(h=f===null||f===void 0?void 0:f[1])!==null&&h!==void 0?h:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===F.Error?F.Error:F.Warning,message:(y=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&y!==void 0?y:""}):m.length?t.push({file:"commitlint",type:F.Error,message:(v=m===null||m===void 0?void 0:(l=m[1])===null||l===void 0?void 0:l.trim())!==null&&v!==void 0?v:"",rule:(S=m===null||m===void 0?void 0:(d=m[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):n.push(e.trim())}}),t.length&&tP(t),tx.DEBUG&&n.length&&(ei.warn("Unmatched lines:"),n.forEach(function(e){return ei.info(" ".concat(e))}))}M(tj,"parseTextErrors");function tk(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?F.Error:F.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tP(n)}catch(t){tj(e)}}M(tk,"parseCommandOutput");function tU(e){return i(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return R(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tk;n=new AbortController;em.on("SIGINT",function(){ei.warn("Process interrupted. Terminating..."),n.abort(),em.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tG(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&&ei.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}M(tU,"executeCommand");function tF(e){return{raw:!0,cmd:e}}M(tF,"rawCommand");function tq(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(tc," ").concat(ti," ").concat(e2," ").concat(e):"".concat(tc," ").concat(e1," ").concat(e)}M(tq,"formatCLI");function tY(e,t){return typeof e=="function"?tq(e(t),t):(typeof e==="undefined"?"undefined":A(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tq(e,t):e}M(tY,"formatCommand");function tV(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:return[4,tC({name:eY})];case 1:t=s.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=I(e,2),r=t[0],s=t[1];return[r,tY(s,n)]}))]}return[2]}})})()}M(tV,"resolveCommands");function tK(e,t){return i(function(){var n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);ei.start("".concat(e)),tx.DEBUG&&ei.info("→ ".concat(t));return[4,tU(t)];case 1:r.sent(),ei.success("".concat(e," done."));return[3,3];case 2:n=r.sent();eo(n);return[3,3];case 3:return[2]}})})()}M(tK,"runCommand");function tB(){return i(function(){var e,t;return R(this,function(n){switch(n.label){case 0:if(!eR(th.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tS.typescriptCheck()];case 1:return[4,tK.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=ei.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}M(tB,"checkTypescript");function tH(){return i(function(){var e,t,n,r;var s=arguments;return R(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,tS.eslintFix()];case 1:return[4,tK.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tS.eslintCheck()];case 4:return[4,tK.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}M(tH,"checkEslint");function tW(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";ei.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}M(tW,"printIssues");function tQ(){return i(function(){var e,t,n;return R(this,function(r){switch(r.label){case 0:return[4,tw()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===F.Error}),n=e.filter(function(e){return e.type===F.Warning});!t.length&&!n.length?ei.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tW("Warnings",n),tW("Errors",t),(t.length>0||n.length>0)&&ec.exit(1));return[2]}})})()}M(tQ,"showCheckResult");function tJ(){return i(function(){var e,t,n,r,s;return R(this,function(i){switch(i.label){case 0:return[4,tL()];case 1:i.sent();return[4,tC({name:eY})];case 2:e=i.sent();if(!e.success){ei.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,7];n=["Building package: ".concat(eY)];return[4,tS.build()];case 3:return[4,tK.apply(void 0,n.concat([i.sent()]))];case 4:i.sent();r=["Staging build artifacts"];return[4,tS.stageBuildDirectory()];case 5:return[4,tK.apply(void 0,r.concat([i.sent()]))];case 6:t=i.sent();i.label=7;case 7:t;s=["Executing lint-staged"];return[4,tS.lintStaged()];case 8:return[4,tK.apply(void 0,s.concat([i.sent()]))];case 9:i.sent(),tQ();return[2]}})})()}M(tJ,"lintStaged");function t$(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tS.eslintInspect()];case 1:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t$,"inspectLint");function tz(){return i(function(){return R(this,function(e){switch(e.label){case 0:return[4,tL()];case 1:e.sent();return[4,Promise.all([tB(),tH()])];case 2:e.sent(),tQ();return[2]}})})()}M(tz,"lintCheck");function tX(){return i(function(){return R(this,function(e){switch(e.label){case 0:return[4,tL()];case 1:e.sent();return[4,Promise.all([tB(),tH(!0)])];case 2:e.sent(),tQ();return[2]}})})()}M(tX,"lintFix");function tZ(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:return[4,tL()];case 1:t.sent();e=["Validating commit message"];return[4,tS.commitLint()];case 2:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tQ();return[2]}})})()}M(tZ,"commitLint");function t0(){return i(function(){var e,t,n,r;return R(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,tS.configureGitHook()];case 1:return[4,tK.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),ex(th.GIT_HOOK);return[4,tV(ty)];case 3:t=s.sent();eT(th.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eJ,"\n");eR(th.GIT_IGNORE)?eD(th.GIT_IGNORE,"utf-8").split("\n").includes(eJ)||eb(th.GIT_IGNORE,n):eT(th.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,tS.simpleGitHooks()];case 4:return[4,tK.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}M(t0,"setupGitHook");function t1(){return i(function(){return R(this,function(e){switch(e.label){case 0:return[4,tN([{name:eY,type:eg.DEPENDENCY}],{update:!0,postInstallActions:[t0]})];case 1:e.sent();return[2]}})})()}M(t1,"prepare");function t2(){return i(function(){return R(this,function(e){switch(e.label){case 0:ex(th.NODE_MODULES,th.PNPM_LOCK_YAML);return[4,tI()];case 1:e.sent();return[4,t0()];case 2:e.sent();return[2]}})})()}M(t2,"reset");function t4(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tS.nodeModulesInspect()];case 1:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t4,"inspect");function t3(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tS.testUnit()];case 1:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t3,"testUnit");function t5(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tS.testE2e()];case 1:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t5,"testE2E");function t8(e){return i(function(){var t;return R(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,tS.mongoMigrateCreate(e)];case 1:return[4,tK.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}M(t8,"mongoMigrateCreate");function t6(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,tS.mongoMigrateUp()];case 1:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t6,"mongoMigrateUp");function t7(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,tS.mongoMigrateDown()];case 1:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t7,"mongoMigrateDown");(function(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,el(eu(ec.argv)).scriptName(e1).usage("$0 <command> [options]").command("lint","Check code for linting issues",tz).command("lint:fix","Fix linting issues automatically",tX).command("lint:inspect","View active ESLint configuration",t$).command("lint-staged","Run lint checks on staged files",tJ).command("commitlint","Validate commit message format",tZ).command("prepare","Initialize project and dependencies",t1).command("reset","Reset the project and reinstall dependencies",t2).command("inspect","Analyze installed project dependencies",t4).command("test:unit","Run unit test suite",t3).command("test:e2e","Run end-to-end test suite",t5).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return i(function(){return R(this,function(t){switch(t.label){case 0:if(!e.name){ei.error("Migration name is required.");return[2]}return[4,t8(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",t6).command("mongo:migrate:down","Rollback last MongoDB migration",t7).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(ed.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();eo(e),ec.exit(1);return[3,3];case 3:return[2]}})})()})();import{Router as t9}from"express";import{NestFactory as ne}from"@nestjs/core";import nt from"body-parser";import nn from"compression";import nr from"cookie-parser";import ns from"cors";import ni from"express";import no from"express-session";import na from"express-useragent";function nc(e){var t=e.isDev,n=e.whiteList,r=O(e,["isDev","whiteList"]);return y({origin:M(function(e,r){t||(n===null||n===void 0?void 0:n.includes(e!==null&&e!==void 0?e:""))?r(null,!0):r(new Error("Not allowed by CORS"),!1)},"origin"),credentials:!0},r)}M(nc,"createCorsOptions");function nu(e){return ns(nc(e))}M(nu,"createCors");function nl(e){return no(e)}M(nl,"createSession");function nd(e){var t=ni();return t.set("trust proxy",1),t.use(nr()),t.use(ni.urlencoded({extended:!0})),t.use(nn()),t.use(na.express()),(e===null||e===void 0?void 0:e.staticFolder)&&t.use(ni.static(e.staticFolder)),t}M(nd,"createExpress");function np(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:return[4,ne.create(e.module)];case 1:r=s.sent();return[2,(r.getHttpAdapter().getInstance().set("trust proxy",1),r.use(ni.urlencoded({extended:!0})),r.use(nr()),r.use(nn()),r.use(na.express()),e.staticFolder&&r.use(ni.static(e.staticFolder)),e.filters&&(t=r).useGlobalFilters.apply(t,N(e.filters)),e.pipes&&(n=r).useGlobalPipes.apply(n,N(e.pipes)),r)]}})})()}M(np,"createNest");var nf="MONGO_MIGRATE_OPTIONS";import{Collection as nm,Db as nE}from"mongodb";import{Document as ng,Model as nh}from"mongoose";var ny=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nE);M(ny,"C_Db");var nv=ny,nS=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(ng);M(nS,"C_Document");var nO=nS,n_=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nh);M(n_,"C_Model");var nC=n_,nD=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nm);M(nD,"C_Collection");var nI=nD;import{format as nN}from"date-fns";import nA from"migrate-mongo";import{Document as nT}from"mongoose";import nb from"mongoose-aggregate-paginate-v2";import nR from"mongoose-paginate-v2";import{v4 as nx}from"uuid";import nG from"unorm";var nM={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},nP=Object.entries(nM).reduce(function(e,t){var n=I(t,2),r=n[0],s=n[1];return e[r.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function nw(e){return(typeof e==="undefined"?"undefined":A(e))=="object"&&e!==null&&!Array.isArray(e)}M(nw,"isObject");import nL from"crypto-js";import nj from"slugify";var nk=nj.default||nj;function nU(e,t){var n=M(function(e){var n,r;return nk(e!==null&&e!==void 0?e:"",y({lower:(n=t===null||t===void 0?void 0:t.lower)!==null&&n!==void 0?n:!0,locale:(r=t===null||t===void 0?void 0:t.locale)!==null&&r!==void 0?r:"vi"},t))},"slugifyWithOptions");if(nw(e)){var r={};var s=true,i=false,o=undefined;try{for(var a=Object.entries(e)[Symbol.iterator](),c;!(s=(c=a.next()).done);s=true){var u=I(c.value,2),l=u[0],d=u[1];r[l]=n(d)}}catch(e){i=true;o=e}finally{try{if(!s&&a.return!=null){a.return()}}finally{if(i){throw o}}}return r}return n(e)}M(nU,"generateSlug");function nF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return nL.SHA256(e).toString(nL.enc.Hex).slice(0,t)}M(nF,"generateShortId");var nq={isEmpty:function e(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":A(e))=="object"?f(e,Date)?!1:f(e,Map)||f(e,Set)?e.size===0:f(e,WeakMap)||f(e,WeakSet)?!0:ArrayBuffer.isView(e)?e.byteLength===0:Object.keys(e).length===0:!1},isValidIP:function e(e){var t=e.split(".");return t.length===4&&t.every(function(e){return/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255})?!0:/^(([a-f\d]{1,4}:){7}[a-f\d]{1,4}|((?:[a-f\d]{1,4}:){1,7}:)|((?:[a-f\d]{1,4}:){1,6}:[a-f\d]{1,4})|::)$/i.test(e)}};var nY={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return nN(e,"yyyy-MM-dd HH:mm:ss.SSS")},createGenericFields:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.returnDateAs,n=t===void 0?"string":t;var r=n==="string"?nY.getDateTime():new Date;return{id:nx(),isDel:!1,createdAt:r,updatedAt:r}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var n=t.method,r=t.pre,s=t.post;n&&r&&e.pre(n,r),n&&s&&e.post(n,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:nx,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,n=e.schema,r=e.virtuals,s=r===void 0?[]:r,i=e.standalone,o=i===void 0?!1:i;var a=new t.Schema(n,{strict:!0});return s.forEach(function(e){var t=e.name,n=e.options,r=e.get;var s=a.virtual(t,n);r&&s.get(r)}),o||a.add(nY.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,n=e.name,r=e.schema,s=e.pagination,i=s===void 0?!1:s,o=e.aggregate,a=o===void 0?!1:o,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!n)throw new Error("Model name is required.");if(t.models[n])return t.models[n];var p=nY.createSchema({mongoose:t,schema:r,virtuals:u});return nY.applyPlugins(p,[i&&nR,a&&nb]),nY.applyMiddlewares(p,d),t.model(n,p)},validator:{isEmpty:function e(){return function(e){return i(function(){return R(this,function(t){return[2,!nq.isEmpty(e)]})})()}},isUnique:function e(e){return function(t){return i(function(){var n;return R(this,function(r){switch(r.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");n={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.exists(n)];case 1:return[2,!r.sent()]}})}).call(this)}},matchesRegex:function e(e){return function(t){return i(function(){return R(this,function(n){if(!Array.isArray(e)||e.some(function(e){return!f(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})})()}}},migrate:S(y({},nA),{setConfig:M(function(e){var t="// This file is automatically generated by the Cyberskill CLI.\nmodule.exports = ".concat(JSON.stringify(e,null,4));eT(th.MIGRATE_MONGO_CONFIG,t);var n="\n".concat(eZ,"\n");eR(th.GIT_IGNORE)?eD(th.GIT_IGNORE,"utf-8").split("\n").includes(eZ)||eb(th.GIT_IGNORE,n):eT(th.GIT_IGNORE,n)},"setConfig")})},nV=/*#__PURE__*/function(){"use strict";function e(t,n){a(this,e);P(this,"collection");this.collection=t.collection(n)}u(e,[{key:"createOne",value:function e(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t=y({},nY.createGenericFields(),e);n={success:!0,message:"Document created successfully"};return[4,this.collection.insertOne(t)];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,eo(r)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t=e.map(function(e){return y({},nY.createGenericFields(),e)});return[4,this.collection.insertMany(t)];case 1:n=s.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted",code:et.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:n}];case 2:r=s.sent();return[2,eo(r)];case 3:return[2]}})}).call(this)}},{key:"findOne",value:function e(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.findOne(e)];case 1:t=r.sent();return[2,t?{success:!0,message:"Document found",result:t}:{success:!1,message:"Document not found",code:et.NOT_FOUND.CODE}];case 2:n=r.sent();return[2,eo(n)];case 3:return[2]}})}).call(this)}},{key:"findAll",value:function e(){return i(function(){var e,t,n;var r=arguments;return R(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0,message:"Documents retrieved successfully"};return[4,this.collection.find(e).toArray()];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,eo(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return i(function(){var e,t,n;var r=arguments;return R(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0,message:"Count retrieved successfully"};return[4,this.collection.countDocuments(e)];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,eo(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(e,t){return i(function(){var n,r;return R(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,this.collection.updateOne(e,{$set:t})];case 1:n=s.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:et.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document updated successfully",result:n}];case 2:r=s.sent();return[2,eo(r)];case 3:return[2]}})}).call(this)}},{key:"updateMany",value:function e(e,t){return i(function(){var n,r;return R(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,this.collection.updateMany(e,{$set:t})];case 1:n=s.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:et.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents updated successfully",result:n}];case 2:r=s.sent();return[2,eo(r)];case 3:return[2]}})}).call(this)}},{key:"deleteOne",value:function e(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteOne(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:et.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document deleted successfully",result:t}];case 2:n=r.sent();return[2,eo(n)];case 3:return[2]}})}).call(this)}},{key:"deleteMany",value:function e(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteMany(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:et.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents deleted successfully",result:t}];case 2:n=r.sent();return[2,eo(n)];case 3:return[2]}})}).call(this)}}]);return e}();M(nV,"MongoController");var nK=nV,nB=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);P(this,"model");this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(e){return i(function(){var e,t,n,r,s,i,o;var a=arguments;return R(this,function(c){switch(c.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{},n=a.length>2&&a[2]!==void 0?a[2]:{},r=a.length>3?a[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);s=this.model.findOne(e,t,n);r&&s.populate(r);return[4,s.exec()];case 2:i=c.sent();return[2,i?{success:!0,result:i}:{success:!1,message:"No ".concat(this.getModelName()," found."),code:et.NOT_FOUND.CODE}];case 3:o=c.sent();return[2,eo(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findAll",value:function e(e){return i(function(){var e,t,n,r,s,i,o;var a=arguments;return R(this,function(c){switch(c.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{},n=a.length>2&&a[2]!==void 0?a[2]:{},r=a.length>3?a[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);s=this.model.find(e,t,n);r&&s.populate(r);i={success:!0};return[4,s.exec()];case 2:return[2,(i.result=c.sent(),i)];case 3:o=c.sent();return[2,eo(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPaging",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return R(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.paginate(e,t)];case 2:return[2,(n.result=i.sent(),n)];case 3:r=i.sent();return[2,eo(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPagingAggregate",value:function e(e){return i(function(e){var t,n,r;var s=arguments;return R(this,function(i){switch(i.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.aggregatePaginate(this.model.aggregate(e),t)];case 2:return[2,(n.result=i.sent(),n)];case 3:r=i.sent();return[2,eo(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return i(function(){var e,t,n;var r=arguments;return R(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0};return[4,this.model.countDocuments(e)];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,eo(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createOne",value:function e(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.create(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,eo(n)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return i(function(e){var t,n,r;var s=arguments;return R(this,function(i){switch(i.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.insertMany(e,t)];case 2:return[2,(n.result=i.sent().map(function(e){return f(e,nT)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 3:r=i.sent();return[2,eo(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(){return i(function(){var e,t,n,r,s;var i=arguments;return R(this,function(o){switch(o.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:{},t=i.length>1&&i[1]!==void 0?i[1]:{},n=i.length>2&&i[2]!==void 0?i[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);return[4,this.model.findOneAndUpdate(e,t,y({new:!0},n)).exec()];case 2:r=o.sent();return[2,r?{success:!0,result:r}:{success:!1,message:"Failed to update ".concat(this.getModelName(),"."),code:et.NOT_FOUND.CODE}];case 3:s=o.sent();return[2,eo(s)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateMany",value:function e(){return i(function(){var e,t,n,r,s;var i=arguments;return R(this,function(o){switch(o.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:{},t=i.length>1&&i[1]!==void 0?i[1]:{},n=i.length>2&&i[2]!==void 0?i[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);r={success:!0};return[4,this.model.updateMany(e,t,n).exec()];case 2:return[2,(r.result=o.sent(),r)];case 3:s=o.sent();return[2,eo(s)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteOne",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return R(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.model.findOneAndDelete(e,t).exec()];case 2:n=i.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(this.getModelName()," found to delete."),code:et.NOT_FOUND.CODE}];case 3:r=i.sent();return[2,eo(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteMany",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return R(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.model.deleteMany(e,t).exec()];case 2:n=i.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:et.NOT_FOUND.CODE}:{success:!0,result:n}];case 3:r=i.sent();return[2,eo(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return i(function(){var n,r,s,i,o;return R(this,function(a){switch(a.label){case 0:a.trys.push([0,6,,7]);n=new Set;r=0;a.label=1;case 1:if(!(r<10))return[3,5];s=nF(e,r+t);i=!n.has(s);if(!i)return[3,3];n.add(s);return[4,this.model.exists({shortId:s})];case 2:i=!a.sent();a.label=3;case 3:if(i)return[2,{success:!0,result:s}];a.label=4;case 4:r++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:et.INTERNAL_SERVER_ERROR.CODE}];case 6:o=a.sent();return[2,eo(o)];case 7:return[2]}})}).call(this)}},{key:"createSlug",value:function e(e,t,n){return i(function(){var r,s,o,a,c,u,d,p,f,m;return R(this,function(E){switch(E.label){case 0:r=this;E.label=1;case 1:E.trys.push([1,5,,6]);s=t[e],o=nw(s),a=M(function(t){var r=y({},n!==null&&n!==void 0?n:{});return o?S(y({},r),{$or:[l({},"slug.".concat(e),t),{slugHistory:{$elemMatch:l({},"slug.".concat(e),t)}}]}):S(y({},r),{$or:[{slug:t},{slugHistory:t}]})},"generateSlugQuery"),c=M(function(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:t=e,n=1;r.label=1;case 1:return[4,this.model.exists(a(t))];case 2:if(!r.sent())return[3,4];t="".concat(e,"-").concat(n++);r.label=3;case 3:return[3,1];case 4:return[2,t]}})}).call(r)},"generateUniqueSlug");if(!o)return[3,3];u={success:!0};d=Object.fromEntries;return[4,Promise.all(Object.entries(s).map(function(e){var t=I(e,2),n=t[0],r=t[1];return i(function(){var e,t;return R(this,function(s){switch(s.label){case 0:e=nU(r);t=[n];return[4,c(e)];case 1:return[2,t.concat([s.sent()])]}})})()}))];case 2:return[2,(u.result=d.apply(Object,[E.sent()]),u)];case 3:p=nU(s);f={success:!0};return[4,c(p)];case 4:return[2,(f.result=E.sent(),f)];case 5:m=E.sent();return[2,eo(m)];case 6:return[2]}})}).call(this)}},{key:"aggregate",value:function e(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.aggregate(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,eo(n)];case 3:return[2]}})}).call(this)}}]);return e}();M(nB,"MongooseController");var nH=nB;import{useServer as nW}from"graphql-ws/use/ws";import{WebSocketServer as nQ}from"ws";function nJ(e){return new nQ({server:e.server,path:e.path})}M(nJ,"createWSServer");function n$(e){return nW({schema:e.schema},e.server)}M(n$,"initGraphQLWS");export{eK as BUILD_DIRECTORY,te as COMMIT_LINT_CLI,e9 as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,e7 as COMMIT_LINT_PACKAGE_NAME,e1 as CYBERSKILL_CLI,e2 as CYBERSKILL_CLI_PATH,e0 as CYBERSKILL_DIRECTORY,eY as CYBERSKILL_PACKAGE_NAME,nI as C_Collection,nv as C_Db,nO as C_Document,nC as C_Model,e3 as ESLINT_CLI,tp as ESLINT_INSPECT_CLI,td as ESLINT_INSPECT_PACKAGE_NAME,e4 as ESLINT_PACKAGE_NAME,ep as E_CommandType,F as E_IssueType,eg as E_PackageType,to as GIT_CLI,eX as GIT_COMMIT_EDITMSG,ez as GIT_HOOK,eQ as GIT_IGNORE,tn as LINT_STAGED_CLI,tt as LINT_STAGED_PACKAGE_NAME,tg as MIGRATE_MONGO_CLI,eZ as MIGRATE_MONGO_CONFIG,tE as MIGRATE_MONGO_PACKAGE_NAME,nf as MONGO_MIGRATE_OPTIONS,nK as MongoController,nH as MongooseController,eV as NODE_MODULES,tm as NODE_MODULES_INSPECT_CLI,tf as NODE_MODULES_INSPECT_PACKAGE_NAME,eB as PACKAGE_JSON,eH as PACKAGE_LOCK_JSON,th as PATH,e8 as PLAYWRIGHT_PACKAGE_NAME,ta as PNPM_CLI,tc as PNPM_EXEC_CLI,e$ as PNPM_LOCK_YAML,t9 as Router,tu as SIMPLE_GIT_HOOKS_PACKAGE_NAME,tl as SIMPLE_GIT_HOOK_CLI,eJ as SIMPLE_GIT_HOOK_JSON,eW as TSCONFIG_JSON,ts as TSC_CLI,tr as TSC_PACKAGE_NAME,ti as TSX_CLI,e6 as VITEST_CLI,e5 as VITEST_PACKAGE_NAME,eq as WORKING_DIRECTORY,nb as aggregatePaginate,eb as appendFileSync,nt as bodyParser,eo as catchError,tL as clearAllErrorLists,tS as command,eG as copySync,ea as createApolloServer,nu as createCors,nc as createCorsOptions,nd as createExpress,ty as createGitHooksConfig,np as createNest,nl as createSession,nJ as createWSServer,ni as express,L as expressMiddleware,tY as formatCommand,eS as fs,t_ as getLatestPackageVersion,tC as getPackage,tw as getStoredErrorLists,n$ as initGraphQLWS,tI as installDependencies,eU as join,ei as log,eO as lstatSync,eC as mkdirSync,nY as mongo,nR as mongoosePaginate,eL as path,eR as pathExistsSync,tF as rawCommand,eD as readFileSync,eA as readJsonSync,e_ as readdirSync,ex as removeSync,ek as resolve,tV as resolveCommands,ej as resolveWorkingPath,tK as runCommand,tN as setupPackages,eN as statSync,tR as storage,er as throwError,eI as unlinkSync,tD as updatePackage,eT as writeFileSync};
1
+ 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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(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 i(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){s(o,r,i,a,c,"next",e)}function c(e){s(o,r,i,a,c,"throw",e)}a(undefined)})}}function o(e,t,n){t=d(t);return C(e,b()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function u(e,t,n){if(t)c(e.prototype,t);if(n)c(e,n);return e}function l(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 d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)D(e,t)}function f(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function m(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function E(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 g(){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 h(){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 y(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){l(e,t,n[t])})}return e}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function S(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{v(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function O(e,t){if(e==null)return{};var n=_(e,t);var r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++){r=i[s];if(t.indexOf(r)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;n[r]=e[r]}}return n}function _(e,t){if(e==null)return{};var n={};var r=Object.keys(e);var s,i;for(i=0;i<r.length;i++){s=r[i];if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function C(e,t){if(t&&(A(t)==="object"||typeof t==="function")){return t}return r(e)}function D(e,t){D=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return D(e,t)}function I(e,n){return t(e)||E(e,n)||T(e,n)||g()}function N(e){return n(e)||m(e)||T(e)||h()}function A(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function T(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 b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(b=function(){return!!e})()}function R(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 x=Object.defineProperty;var G=function(e,t,n){return t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};var M=function(e,t){return x(e,"name",{value:t,configurable:!0})};var P=function(e,t,n){return G(e,(typeof t==="undefined"?"undefined":A(t))!="symbol"?t+"":t,n)};import{ApolloServer as w}from"@apollo/server";import{expressMiddleware as L}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as j}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as k,ApolloServerPluginLandingPageProductionDefault as U}from"@apollo/server/plugin/landingPage/default";var F=function(e){return e.Error="error",e.Warning="warning",e}({});import q from"chalk";import Y from"consola";import{GraphQLError as V}from"graphql";var K=".cyberskill-storage";import B from"@dotenvx/dotenvx";import{bool as H,cleanEnv as W,str as Q}from"envalid";import J from"node:os";import $ from"node:path";import z from"node:process";var X=!1;function Z(){X||(B.config(),X=!0)}M(Z,"loadEnvFile");function ee(){Z();var e=W(z.env,{CWD:Q({default:z.cwd()}),DEBUG:H({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:Q({default:$.join(J.homedir(),K)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}M(ee,"getEnv");var et={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};var en=ee();function er(e){var t=e.message,n=e.status,r=n===void 0?et.INTERNAL_SERVER_ERROR:n,s=e.type,i=s===void 0?"graphql":s;var o;var a=(o=t!==null&&t!==void 0?t:r.MESSAGE)!==null&&o!==void 0?o:"Internal server error";throw i==="graphql"?new V(a,{extensions:{code:r.CODE}}):new Error(a)}M(er,"throwError");en.DEBUG||(Y.level=4);function es(e){var t=q[e];return typeof t=="function"?t:q.green}M(es,"chalkKeyword");var ei={silent:Y.silent,level:Y.level,fatal:Y.fatal,error:Y.error,warn:Y.warn,log:Y.log,info:Y.info,success:Y.success,ready:Y.ready,start:Y.start,box:Y.box,debug:Y.debug,trace:Y.trace,verbose:Y.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)){Y.box(q.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;Y.log("".concat(q.gray("File:")," ").concat(q.blue("".concat(t).concat(r?":".concat(r):"")))),s&&Y.log(" ".concat(es(n)("Rule:")," ").concat(s)),Y.log(" ".concat(es(n)("Message:")," ").concat(i))}),Y.box(es(n)("".concat(e," : ").concat(t.length))),Y.log(q.gray("─".repeat(40)))}};function eo(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,s=r===void 0?!0:r,i=n.returnValue,o=n.callback,a=f(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return s&&ei.error(a.message),o&&typeof o=="function"&&o(a),i||{success:!1,message:a.message,code:et.INTERNAL_SERVER_ERROR.CODE}}M(eo,"catchError");function ea(e){return new w(y({schema:e.schema,plugins:[e.isDev?k():U(),j({httpServer:e.server})].concat(N(e.drainServer?[{serverWillStart:function t(){return i(function(){return R(this,function(t){return[2,{drainServer:function t(){return i(function(){var t;return R(this,function(n){(t=e.drainServer)===null||t===void 0?void 0:t.call(e),ei.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}M(ea,"createApolloServer");import ec from"node:process";import{hideBin as eu}from"yargs/helpers";import el from"yargs/yargs";var ed={name:"@cyberskill/shared",type:"module",version:"1.139.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"},"./config":{types:"./dist/config/index.d.ts",import:"./dist/config/index.js",require:"./dist/config/index.cjs"},"./config/commitlint":{types:"./dist/config/commitlint/index.d.ts",import:"./dist/config/commitlint/index.js",require:"./dist/config/commitlint/index.cjs"},"./config/env":{types:"./dist/config/env/index.d.ts",import:"./dist/config/env/index.js",require:"./dist/config/env/index.cjs"},"./config/eslint":{types:"./dist/config/eslint/index.d.ts",import:"./dist/config/eslint/index.js",require:"./dist/config/eslint/index.cjs"},"./config/graphql-codegen":{types:"./dist/config/graphql-codegen/index.d.ts",import:"./dist/config/graphql-codegen/index.js",require:"./dist/config/graphql-codegen/index.cjs"},"./config/lint-staged":{types:"./dist/config/lint-staged/index.d.ts",import:"./dist/config/lint-staged/index.js",require:"./dist/config/lint-staged/index.cjs"},"./constant":{types:"./dist/constant/index.d.ts",import:"./dist/constant/index.js",require:"./dist/constant/index.cjs"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/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"},"./style/reset.css":{import:"./dist/style/reset.css",require:"./dist/style/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./util":{types:"./dist/util/index.d.ts",import:"./dist/util/index.js",require:"./dist/util/index.cjs"}},typesVersions:{"*":{config:["dist/config/index.d.ts"],constant:["dist/constant/index.d.ts"],node:["dist/node/index.d.ts"],react:["dist/react/index.d.ts"],typescript:["dist/typescript/index.d.ts"],util:["dist/util/index.d.ts"]}},bin:{cyberskill:"dist/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",reset:"tsx src/node/cli/index.ts reset",prepare:"tsx src/node/cli/index.ts prepare",inspect:"tsx src/node/cli/index.ts inspect","test:unit":"tsx src/node/cli/index.ts test:unit","test:e2e":"tsx src/node/cli/index.ts test:e2e",commitlint:"tsx src/node/cli/index.ts commitlint"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.42.2","@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.7","@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-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",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.1","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.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.4",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.2",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@commitlint/config-conventional":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@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/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.3","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.26.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var ep=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as ef}from"node:child_process";import em from"node:process";import*as eE from"node:util";var eg=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});import eh from"node-fetch";import ey from"fs-extra";import ev from"node:path";var eS=ey,eO=ey.lstatSync,e_=ey.readdirSync,eC=ey.mkdirSync,eD=ey.readFileSync,eI=ey.unlinkSync,eN=ey.statSync,eA=ey.readJsonSync;function eT(e,t,n){ey.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}M(eT,"writeFileSync");function eb(e,t,n){ey.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}M(eb,"appendFileSync");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 ey.pathExistsSync(e)})}M(eR,"pathExistsSync");function ex(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eR(e)&&ey.removeSync(e)})}M(ex,"removeSync");function eG(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.extensions,s=O(n,["extensions"]);ey.copySync(e,t,y({filter:M(function(e){return eN(e).isDirectory()||!r||r.length===0?!0:r.includes(ev.extname(e))},"filter")},s))}M(eG,"copySync");import eM from"fs-extra";import eP from"node:path";var ew=ee(),eL=eP;function ej(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eL).resolve.apply(r,[ew.CWD].concat(N(t)))}M(ej,"resolveWorkingPath");function ek(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eL).resolve.apply(r,N(t))}M(ek,"resolve");function eU(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eL).join.apply(r,N(t))}M(eU,"join");var eF=ee(),eq=eF.CWD,eY="@cyberskill/shared",eV="node_modules",eK="dist",eB="package.json",eH="package-lock.json",eW="tsconfig.json",eQ=".gitignore",eJ=".simple-git-hooks.json",e$="pnpm-lock.yaml",ez=".git/hooks/",eX=".git/COMMIT_EDITMSG",eZ=".migrate-mongo.config.js",e0=function(){var e=eM.readJsonSync(ej(eB)).name===eY?eq:eU(eq,eV,eY);return eU(e,eK)}(),e1="cyberskill",e2="src/node/cli/index.ts",e4="eslint",e3="eslint",e5="vitest",e8="playwright",e6="vitest",e7="@commitlint/cli",e9="@commitlint/config-conventional",te="commitlint",tt="lint-staged",tn="lint-staged",tr="typescript",ts="tsc",ti="tsx",to="git",ta="pnpm",tc="pnpm exec",tu="simple-git-hooks",tl="simple-git-hooks",td="@eslint/config-inspector",tp="eslint-config-inspector",tf="node-modules-inspector",tm="node-modules-inspector",tE="migrate-mongo",tg="./node_modules/migrate-mongo/bin/migrate-mongo",th={CYBERSKILL_DIRECTORY:e0,WORKING_DIRECTORY:eq,TS_CONFIG:ej(eW),GIT_IGNORE:ej(eQ),GIT_HOOK:ej(ez),GIT_COMMIT_MSG:ej(eX),SIMPLE_GIT_HOOKS_JSON:ej(eJ),PACKAGE_JSON:ej(eB),PACKAGE_LOCK_JSON:ej(eH),PNPM_LOCK_YAML:ej(e$),NODE_MODULES:ej(eV),MIGRATE_MONGO_CONFIG:ej(eZ),LINT_STAGED_CONFIG:ej("".concat(e0,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:ej("".concat(e0,"/config/commitlint/index.js")),UNIT_TEST_CONFIG:ej("".concat(e0,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ej("".concat(e0,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ej("".concat(e0,"/react/vitest/vitest.e2e.js"))};function ty(e){var t=e.isCurrentProject;return y({"pre-commit":tn,"commit-msg":te},t&&{"pre-push":tF("".concat(to," pull"))})}M(ty,"createGitHooksConfig");function tv(e){var t=e.type,n=e.packages,r=e.command;var s=n===null||n===void 0?void 0:n.reduce(function(e,t){return e.some(function(e){return e.name===t.name})||e.push(t),e},[]);return function(){return i(function(){var e;return R(this,function(n){switch(n.label){case 0:switch(t){case ep.CLI:return[3,1];case ep.STRING:return[3,4]}return[3,5];case 1:e=s===null||s===void 0?void 0:s.length;if(!e)return[3,3];return[4,tN(s,{update:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,tY(tF("".concat(tc," ").concat(r))))];case 4:return[2,tY(tF(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}M(tv,"buildCommand");var tS={simpleGitHooks:tv({type:ep.CLI,packages:[{name:tu,type:eg.DEV_DEPENDENCY}],command:tl}),eslintInspect:tv({type:ep.CLI,packages:[{name:td,type:eg.DEV_DEPENDENCY}],command:tp}),nodeModulesInspect:tv({type:ep.CLI,packages:[{name:tf,type:eg.DEV_DEPENDENCY}],command:tm}),eslintCheck:tv({type:ep.CLI,packages:[{name:e4,type:eg.DEV_DEPENDENCY}],command:"".concat(e3," ").concat(th.WORKING_DIRECTORY," --no-cache")}),eslintFix:tv({type:ep.CLI,packages:[{name:e4,type:eg.DEV_DEPENDENCY}],command:"".concat(e3," ").concat(th.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:tv({type:ep.CLI,packages:[{name:tr,type:eg.DEPENDENCY}],command:"".concat(ts," -p ").concat(th.TS_CONFIG," --noEmit")}),testUnit:tv({type:ep.CLI,packages:[{name:e5,type:eg.DEV_DEPENDENCY}],command:"".concat(e6," --config ").concat(th.UNIT_TEST_CONFIG)}),testE2e:tv({type:ep.CLI,packages:[{name:e5,type:eg.DEV_DEPENDENCY}],command:"".concat(e6," --config ").concat(th.E2E_TEST_CONFIG)}),mongoMigrateCreate:M(function(e){return tv({type:ep.CLI,packages:[{name:tE,type:eg.DEPENDENCY}],command:"".concat(ti," ").concat(tg," create ").concat(e," -f ").concat(th.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:tv({type:ep.CLI,packages:[{name:tE,type:eg.DEPENDENCY}],command:"".concat(ti," ").concat(tg," up -f ").concat(th.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:tv({type:ep.CLI,packages:[{name:tE,type:eg.DEPENDENCY}],command:"".concat(ti," ").concat(tg," down -f ").concat(th.MIGRATE_MONGO_CONFIG)}),commitLint:tv({type:ep.CLI,packages:[{name:e7,type:eg.DEV_DEPENDENCY},{name:e9,type:eg.DEV_DEPENDENCY}],command:"".concat(te," --edit ").concat(th.GIT_COMMIT_MSG," --config ").concat(th.COMMITLINT_CONFIG)}),lintStaged:tv({type:ep.CLI,packages:[{name:tt,type:eg.DEV_DEPENDENCY}],command:"".concat(tn," --config ").concat(th.LINT_STAGED_CONFIG)}),configureGitHook:tv({type:ep.STRING,command:"".concat(to," config core.hooksPath ").concat(th.GIT_HOOK)}),stageBuildDirectory:tv({type:ep.STRING,command:"".concat(to," add ").concat(eK)}),build:tv({type:ep.STRING,command:"".concat(ta," run --if-present build")}),pnpmInstallStandard:tv({type:ep.STRING,command:"".concat(ta," install --no-frozen-lockfile")}),pnpmInstallLegacy:tv({type:ep.STRING,command:"".concat(ta," install --no-frozen-lockfile --legacy-peer-deps")}),pnpmInstallForce:tv({type:ep.STRING,command:"".concat(ta," install --no-frozen-lockfile --force")})};var tO=ee();function t_(e){return i(function(){var t,n,r,s;return R(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,eh("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,{success:!0,result:r}];case 3:s=i.sent();return[2,eo(s)];case 4:return[2]}})})()}M(t_,"getLatestPackageVersion");function tC(e){return i(function(){var t,n,r,s,i,o,a,c,u,l,d,p,f,m,E,g,h,y,v;return R(this,function(S){switch(S.label){case 0:S.trys.push([0,2,,3]);if(!eR(th.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===eg.DEPENDENCY,isDevDependency:e.type===eg.DEV_DEPENDENCY,installedPath:"",file:{}}}];t=eA(th.PACKAGE_JSON),n=t.name,r=t.version,s=r===void 0?"":r,i=t.dependencies,o=i===void 0?{}:i,a=t.devDependencies,c=a===void 0?{}:a;if(e.name===n)return[2,{success:!0,result:{name:n,currentVersion:s,latestVersion:s,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===eg.DEPENDENCY,isDevDependency:e.type===eg.DEV_DEPENDENCY,installedPath:th.PACKAGE_JSON,file:t}}];u=e.name in o,l=e.name in c;return[4,t_(e.name)];case 1:d=S.sent();if(!d.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];if(!u&&!l)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===eg.DEPENDENCY,isDevDependency:e.type===eg.DEV_DEPENDENCY,installedPath:"",file:{}}}];m=(f=(p=o[e.name])!==null&&p!==void 0?p:c[e.name])!==null&&f!==void 0?f:"",E=eU(tO.CWD,eV,e.name,eB);if(!eR(E))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];g=eA(E),h=g.version,y=h===void 0?"":h;return[2,m!==y?{success:!0,result:{name:e.name,currentVersion:y||m,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:E,file:g}}:{success:!0,result:{name:e.name,currentVersion:m,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:m===d.result,isDependency:u,isDevDependency:l,installedPath:E,file:g}}];case 2:v=S.sent();return[2,eo(v)];case 3:return[2]}})})()}M(tC,"getPackage");function tD(e){return i(function(){var t,n,r,s,i;return R(this,function(o){try{;r=eA(th.PACKAGE_JSON),s=(t=r.dependencies)!==null&&t!==void 0?t:{},i=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?s[e.name]=e.latestVersion:e.isDevDependency&&(i[e.name]=e.latestVersion),eT(th.PACKAGE_JSON,JSON.stringify(r,null,4)),ei.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){eo(e)}return[2]})})()}M(tD,"updatePackage");function tI(){return i(function(){var e,t,n,r,s,i,o,a,c,u,l,d,p;return R(this,function(f){switch(f.label){case 0:f.trys.push([0,12,,13]);e=[{command:M(function(){return tS.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:M(function(){return tS.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:M(function(){return tS.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,tK("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();eo(l);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:return[3,13];case 12:p=f.sent();eo(p);return[3,13];case 13:return[2]}})})()}M(tI,"installDependencies");function tN(e,t){return i(function(){var n,r,s,i,o,a,c,u,l,d,p,f;return R(this,function(m){switch(m.label){case 0:if(!eR(th.PACKAGE_JSON)){ei.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,16,,17]);return[4,Promise.all(e.map(tC))];case 2:n=m.sent().filter(function(e){return e.success?!e.result.isCurrentProject&&(!e.result.isInstalled||!e.result.isUpToDate):!1});r=n.length>0;if(!r)return[3,7];return[4,Promise.all(n.map(function(e){return e.success?tD(e.result):Promise.resolve()}))];case 3:m.sent();return[4,tI()];case 4:m.sent();s=["Running ESLint with auto-fix"];return[4,tS.eslintFix()];case 5:return[4,tK.apply(void 0,s.concat([m.sent()]))];case 6:r=m.sent();m.label=7;case 7:r;o=true,a=false,c=undefined;m.label=8;case 8:m.trys.push([8,13,14,15]);u=((i=t===null||t===void 0?void 0:t.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();m.label=9;case 9:if(!!(o=(l=u.next()).done))return[3,12];d=l.value;return[4,d()];case 10:m.sent();m.label=11;case 11:o=true;return[3,9];case 12:return[3,15];case 13:p=m.sent();a=true;c=p;return[3,15];case 14:try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw c}}return[7];case 15:return[3,17];case 16:f=m.sent();eo(f);return[3,17];case 17:return[2]}})})()}M(tN,"setupPackages");import tA from"node-persist";var tT=ee();function tb(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=tA.defaultInstance;if(e)return[3,2];return[4,tA.init({dir:tT.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]}})})()}M(tb,"initNodePersist");var tR={get:function e(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tb()];case 1:r.sent();return[4,tA.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,eo(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tb()];case 1:r.sent();return[4,tA.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();eo(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return R(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tb()];case 1:n.sent();return[4,tA.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();eo(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return R(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tb()];case 1:n.sent();return[4,tA.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(ei.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,eo(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return R(this,function(t){try{return[2,"".concat(tT.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,eo(e,{returnValue:null})]}return[2]})})()}};var tx=ee(),tG=eE.promisify(ef);function tM(e){return"error_list:".concat(e)}M(tM,"getErrorListKey");function tP(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tM(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,tR.set(n,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(function(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:return[4,tR.getLogLink(n)];case 1:e=t.sent();e&&ei.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=s.sent();eo(r);return[3,4];case 4:return[2]}})})()}M(tP,"saveErrorListToStorage");function tw(){return i(function(){var e,t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tR.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 i(function(){var t;return R(this,function(n){switch(n.label){case 0:return[4,tR.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,eo(n,{returnValue:[]})];case 4:return[2]}})})()}M(tw,"getStoredErrorLists");function tL(){return i(function(){var e,t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tR.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 tR.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();eo(n);return[3,4];case 4:return[2]}})})()}M(tL,"clearAllErrorLists");function tj(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 p=s.exec(e)||[],f=i.exec(e)||[],m=o.exec(e)||[];var E,g,h,y,v,S;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===F.Error?F.Error:F.Warning,message:(E=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&E!==void 0?E:"",rule:(g=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):f.length?t.push({file:(h=f===null||f===void 0?void 0:f[1])!==null&&h!==void 0?h:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===F.Error?F.Error:F.Warning,message:(y=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&y!==void 0?y:""}):m.length?t.push({file:"commitlint",type:F.Error,message:(v=m===null||m===void 0?void 0:(l=m[1])===null||l===void 0?void 0:l.trim())!==null&&v!==void 0?v:"",rule:(S=m===null||m===void 0?void 0:(d=m[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):n.push(e.trim())}}),t.length&&tP(t),tx.DEBUG&&n.length&&(ei.warn("Unmatched lines:"),n.forEach(function(e){return ei.info(" ".concat(e))}))}M(tj,"parseTextErrors");function tk(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?F.Error:F.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tP(n)}catch(t){tj(e)}}M(tk,"parseCommandOutput");function tU(e){return i(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return R(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tk;n=new AbortController;em.on("SIGINT",function(){ei.warn("Process interrupted. Terminating..."),n.abort(),em.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tG(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&&ei.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}M(tU,"executeCommand");function tF(e){return{raw:!0,cmd:e}}M(tF,"rawCommand");function tq(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(tc," ").concat(ti," ").concat(e2," ").concat(e):"".concat(tc," ").concat(e1," ").concat(e)}M(tq,"formatCLI");function tY(e,t){return typeof e=="function"?tq(e(t),t):(typeof e==="undefined"?"undefined":A(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tq(e,t):e}M(tY,"formatCommand");function tV(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:return[4,tC({name:eY})];case 1:t=s.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=I(e,2),r=t[0],s=t[1];return[r,tY(s,n)]}))]}return[2]}})})()}M(tV,"resolveCommands");function tK(e,t){return i(function(){var n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);ei.start("".concat(e)),tx.DEBUG&&ei.info("→ ".concat(t));return[4,tU(t)];case 1:r.sent(),ei.success("".concat(e," done."));return[3,3];case 2:n=r.sent();eo(n);return[3,3];case 3:return[2]}})})()}M(tK,"runCommand");function tB(){return i(function(){var e,t;return R(this,function(n){switch(n.label){case 0:if(!eR(th.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tS.typescriptCheck()];case 1:return[4,tK.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=ei.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}M(tB,"checkTypescript");function tH(){return i(function(){var e,t,n,r;var s=arguments;return R(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,tS.eslintFix()];case 1:return[4,tK.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tS.eslintCheck()];case 4:return[4,tK.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}M(tH,"checkEslint");function tW(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";ei.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}M(tW,"printIssues");function tQ(){return i(function(){var e,t,n;return R(this,function(r){switch(r.label){case 0:return[4,tw()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===F.Error}),n=e.filter(function(e){return e.type===F.Warning});!t.length&&!n.length?ei.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tW("Warnings",n),tW("Errors",t),(t.length>0||n.length>0)&&ec.exit(1));return[2]}})})()}M(tQ,"showCheckResult");function tJ(){return i(function(){var e,t,n,r,s;return R(this,function(i){switch(i.label){case 0:return[4,tL()];case 1:i.sent();return[4,tC({name:eY})];case 2:e=i.sent();if(!e.success){ei.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,7];n=["Building package: ".concat(eY)];return[4,tS.build()];case 3:return[4,tK.apply(void 0,n.concat([i.sent()]))];case 4:i.sent();r=["Staging build artifacts"];return[4,tS.stageBuildDirectory()];case 5:return[4,tK.apply(void 0,r.concat([i.sent()]))];case 6:t=i.sent();i.label=7;case 7:t;s=["Executing lint-staged"];return[4,tS.lintStaged()];case 8:return[4,tK.apply(void 0,s.concat([i.sent()]))];case 9:i.sent(),tQ();return[2]}})})()}M(tJ,"lintStaged");function t$(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tS.eslintInspect()];case 1:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t$,"inspectLint");function tz(){return i(function(){return R(this,function(e){switch(e.label){case 0:return[4,tL()];case 1:e.sent();return[4,Promise.all([tB(),tH()])];case 2:e.sent(),tQ();return[2]}})})()}M(tz,"lintCheck");function tX(){return i(function(){return R(this,function(e){switch(e.label){case 0:return[4,tL()];case 1:e.sent();return[4,Promise.all([tB(),tH(!0)])];case 2:e.sent(),tQ();return[2]}})})()}M(tX,"lintFix");function tZ(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:return[4,tL()];case 1:t.sent();e=["Validating commit message"];return[4,tS.commitLint()];case 2:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tQ();return[2]}})})()}M(tZ,"commitLint");function t0(){return i(function(){var e,t,n,r;return R(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,tS.configureGitHook()];case 1:return[4,tK.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),ex(th.GIT_HOOK);return[4,tV(ty)];case 3:t=s.sent();eT(th.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eJ,"\n");eR(th.GIT_IGNORE)?eD(th.GIT_IGNORE,"utf-8").split("\n").includes(eJ)||eb(th.GIT_IGNORE,n):eT(th.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,tS.simpleGitHooks()];case 4:return[4,tK.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}M(t0,"setupGitHook");function t1(){return i(function(){return R(this,function(e){switch(e.label){case 0:return[4,tN([{name:eY,type:eg.DEPENDENCY}],{update:!0,postInstallActions:[t0]})];case 1:e.sent();return[2]}})})()}M(t1,"prepare");function t2(){return i(function(){return R(this,function(e){switch(e.label){case 0:ex(th.NODE_MODULES,th.PNPM_LOCK_YAML);return[4,tI()];case 1:e.sent();return[4,t0()];case 2:e.sent();return[2]}})})()}M(t2,"reset");function t4(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tS.nodeModulesInspect()];case 1:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t4,"inspect");function t3(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tS.testUnit()];case 1:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t3,"testUnit");function t5(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tS.testE2e()];case 1:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t5,"testE2E");function t8(e){return i(function(){var t;return R(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,tS.mongoMigrateCreate(e)];case 1:return[4,tK.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}M(t8,"mongoMigrateCreate");function t6(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,tS.mongoMigrateUp()];case 1:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t6,"mongoMigrateUp");function t7(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,tS.mongoMigrateDown()];case 1:return[4,tK.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t7,"mongoMigrateDown");(function(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,el(eu(ec.argv)).scriptName(e1).usage("$0 <command> [options]").command("lint","Check code for linting issues",tz).command("lint:fix","Fix linting issues automatically",tX).command("lint:inspect","View active ESLint configuration",t$).command("lint-staged","Run lint checks on staged files",tJ).command("commitlint","Validate commit message format",tZ).command("prepare","Initialize project and dependencies",t1).command("reset","Reset the project and reinstall dependencies",t2).command("inspect","Analyze installed project dependencies",t4).command("test:unit","Run unit test suite",t3).command("test:e2e","Run end-to-end test suite",t5).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return i(function(){return R(this,function(t){switch(t.label){case 0:if(!e.name){ei.error("Migration name is required.");return[2]}return[4,t8(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",t6).command("mongo:migrate:down","Rollback last MongoDB migration",t7).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(ed.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();eo(e),ec.exit(1);return[3,3];case 3:return[2]}})})()})();import{Router as t9}from"express";import{NestFactory as ne}from"@nestjs/core";import nt from"body-parser";import nn from"compression";import nr from"cookie-parser";import ns from"cors";import ni from"express";import no from"express-session";import na from"express-useragent";function nc(e){var t=e.isDev,n=e.whiteList,r=O(e,["isDev","whiteList"]);return y({origin:M(function(e,r){t||(n===null||n===void 0?void 0:n.includes(e!==null&&e!==void 0?e:""))?r(null,!0):r(new Error("Not allowed by CORS"),!1)},"origin"),credentials:!0},r)}M(nc,"createCorsOptions");function nu(e){return ns(nc(e))}M(nu,"createCors");function nl(e){return no(e)}M(nl,"createSession");function nd(e){var t=ni();return t.set("trust proxy",1),t.use(nr()),t.use(ni.urlencoded({extended:!0})),t.use(nn()),t.use(na.express()),(e===null||e===void 0?void 0:e.staticFolder)&&t.use(ni.static(e.staticFolder)),t}M(nd,"createExpress");function np(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:return[4,ne.create(e.module)];case 1:r=s.sent();return[2,(r.getHttpAdapter().getInstance().set("trust proxy",1),r.use(ni.urlencoded({extended:!0})),r.use(nr()),r.use(nn()),r.use(na.express()),e.staticFolder&&r.use(ni.static(e.staticFolder)),e.filters&&(t=r).useGlobalFilters.apply(t,N(e.filters)),e.pipes&&(n=r).useGlobalPipes.apply(n,N(e.pipes)),r)]}})})()}M(np,"createNest");var nf="MONGO_MIGRATE_OPTIONS";import{Collection as nm,Db as nE}from"mongodb";import{Document as ng,Model as nh}from"mongoose";var ny=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nE);M(ny,"C_Db");var nv=ny,nS=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(ng);M(nS,"C_Document");var nO=nS,n_=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nh);M(n_,"C_Model");var nC=n_,nD=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nm);M(nD,"C_Collection");var nI=nD;import{format as nN}from"date-fns";import nA from"migrate-mongo";import{Document as nT}from"mongoose";import nb from"mongoose-aggregate-paginate-v2";import nR from"mongoose-paginate-v2";import{v4 as nx}from"uuid";import nG from"unorm";var nM={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},nP=Object.entries(nM).reduce(function(e,t){var n=I(t,2),r=n[0],s=n[1];return e[r.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function nw(e){return(typeof e==="undefined"?"undefined":A(e))=="object"&&e!==null&&!Array.isArray(e)}M(nw,"isObject");import nL from"crypto-js";import nj from"slugify";var nk=nj.default||nj;function nU(e,t){var n=M(function(e){var n,r;return nk(e!==null&&e!==void 0?e:"",y({lower:(n=t===null||t===void 0?void 0:t.lower)!==null&&n!==void 0?n:!0,locale:(r=t===null||t===void 0?void 0:t.locale)!==null&&r!==void 0?r:"vi"},t))},"slugifyWithOptions");if(nw(e)){var r={};var s=true,i=false,o=undefined;try{for(var a=Object.entries(e)[Symbol.iterator](),c;!(s=(c=a.next()).done);s=true){var u=I(c.value,2),l=u[0],d=u[1];r[l]=n(d)}}catch(e){i=true;o=e}finally{try{if(!s&&a.return!=null){a.return()}}finally{if(i){throw o}}}return r}return n(e)}M(nU,"generateSlug");function nF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return nL.SHA256(e).toString(nL.enc.Hex).slice(0,t)}M(nF,"generateShortId");var nq={isEmpty:function e(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":A(e))=="object"?f(e,Date)?!1:f(e,Map)||f(e,Set)?e.size===0:f(e,WeakMap)||f(e,WeakSet)?!0:ArrayBuffer.isView(e)?e.byteLength===0:Object.keys(e).length===0:!1},isValidIP:function e(e){var t=e.split(".");return t.length===4&&t.every(function(e){return/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255})?!0:/^(([a-f\d]{1,4}:){7}[a-f\d]{1,4}|((?:[a-f\d]{1,4}:){1,7}:)|((?:[a-f\d]{1,4}:){1,6}:[a-f\d]{1,4})|::)$/i.test(e)}};var nY={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return nN(e,"yyyy-MM-dd HH:mm:ss.SSS")},createGenericFields:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.returnDateAs,n=t===void 0?"string":t;var r=n==="string"?nY.getDateTime():new Date;return{id:nx(),isDel:!1,createdAt:r,updatedAt:r}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var n=t.method,r=t.pre,s=t.post;n&&r&&e.pre(n,r),n&&s&&e.post(n,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:nx,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,n=e.schema,r=e.virtuals,s=r===void 0?[]:r,i=e.standalone,o=i===void 0?!1:i;var a=new t.Schema(n,{strict:!0});return s.forEach(function(e){var t=e.name,n=e.options,r=e.get;var s=a.virtual(t,n);r&&s.get(r)}),o||a.add(nY.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,n=e.name,r=e.schema,s=e.pagination,i=s===void 0?!1:s,o=e.aggregate,a=o===void 0?!1:o,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!n)throw new Error("Model name is required.");if(t.models[n])return t.models[n];var p=nY.createSchema({mongoose:t,schema:r,virtuals:u});return nY.applyPlugins(p,[i&&nR,a&&nb]),nY.applyMiddlewares(p,d),t.model(n,p)},validator:{isEmpty:function e(){return function(e){return i(function(){return R(this,function(t){return[2,!nq.isEmpty(e)]})})()}},isUnique:function e(e){return function(t){return i(function(){var n;return R(this,function(r){switch(r.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");n={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.exists(n)];case 1:return[2,!r.sent()]}})}).call(this)}},matchesRegex:function e(e){return function(t){return i(function(){return R(this,function(n){if(!Array.isArray(e)||e.some(function(e){return!f(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})})()}}},migrate:S(y({},nA),{setConfig:M(function(e){var t="// This file is automatically generated by the Cyberskill CLI.\nmodule.exports = ".concat(JSON.stringify(e,null,4));eT(th.MIGRATE_MONGO_CONFIG,t);var n="\n".concat(eZ,"\n");eR(th.GIT_IGNORE)?eD(th.GIT_IGNORE,"utf-8").split("\n").includes(eZ)||eb(th.GIT_IGNORE,n):eT(th.GIT_IGNORE,n)},"setConfig")})},nV=/*#__PURE__*/function(){"use strict";function e(t,n){a(this,e);P(this,"collection");this.collection=t.collection(n)}u(e,[{key:"createOne",value:function e(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t=y({},nY.createGenericFields(),e);n={success:!0,message:"Document created successfully"};return[4,this.collection.insertOne(t)];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,eo(r)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t=e.map(function(e){return y({},nY.createGenericFields(),e)});return[4,this.collection.insertMany(t)];case 1:n=s.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted",code:et.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:n}];case 2:r=s.sent();return[2,eo(r)];case 3:return[2]}})}).call(this)}},{key:"findOne",value:function e(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.findOne(e)];case 1:t=r.sent();return[2,t?{success:!0,message:"Document found",result:t}:{success:!1,message:"Document not found",code:et.NOT_FOUND.CODE}];case 2:n=r.sent();return[2,eo(n)];case 3:return[2]}})}).call(this)}},{key:"findAll",value:function e(){return i(function(){var e,t,n;var r=arguments;return R(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0,message:"Documents retrieved successfully"};return[4,this.collection.find(e).toArray()];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,eo(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return i(function(){var e,t,n;var r=arguments;return R(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0,message:"Count retrieved successfully"};return[4,this.collection.countDocuments(e)];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,eo(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(e,t){return i(function(){var n,r;return R(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,this.collection.updateOne(e,{$set:t})];case 1:n=s.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:et.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document updated successfully",result:n}];case 2:r=s.sent();return[2,eo(r)];case 3:return[2]}})}).call(this)}},{key:"updateMany",value:function e(e,t){return i(function(){var n,r;return R(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,this.collection.updateMany(e,{$set:t})];case 1:n=s.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:et.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents updated successfully",result:n}];case 2:r=s.sent();return[2,eo(r)];case 3:return[2]}})}).call(this)}},{key:"deleteOne",value:function e(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteOne(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:et.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document deleted successfully",result:t}];case 2:n=r.sent();return[2,eo(n)];case 3:return[2]}})}).call(this)}},{key:"deleteMany",value:function e(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteMany(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:et.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents deleted successfully",result:t}];case 2:n=r.sent();return[2,eo(n)];case 3:return[2]}})}).call(this)}}]);return e}();M(nV,"MongoController");var nK=nV,nB=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);P(this,"model");this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(e){return i(function(){var e,t,n,r,s,i,o;var a=arguments;return R(this,function(c){switch(c.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{},n=a.length>2&&a[2]!==void 0?a[2]:{},r=a.length>3?a[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);s=this.model.findOne(e,t,n);r&&s.populate(r);return[4,s.exec()];case 2:i=c.sent();return[2,i?{success:!0,result:i}:{success:!1,message:"No ".concat(this.getModelName()," found."),code:et.NOT_FOUND.CODE}];case 3:o=c.sent();return[2,eo(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findAll",value:function e(e){return i(function(){var e,t,n,r,s,i,o;var a=arguments;return R(this,function(c){switch(c.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{},n=a.length>2&&a[2]!==void 0?a[2]:{},r=a.length>3?a[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);s=this.model.find(e,t,n);r&&s.populate(r);i={success:!0};return[4,s.exec()];case 2:return[2,(i.result=c.sent(),i)];case 3:o=c.sent();return[2,eo(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPaging",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return R(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.paginate(e,t)];case 2:return[2,(n.result=i.sent(),n)];case 3:r=i.sent();return[2,eo(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPagingAggregate",value:function e(e){return i(function(e){var t,n,r;var s=arguments;return R(this,function(i){switch(i.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.aggregatePaginate(this.model.aggregate(e),t)];case 2:return[2,(n.result=i.sent(),n)];case 3:r=i.sent();return[2,eo(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return i(function(){var e,t,n;var r=arguments;return R(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0};return[4,this.model.countDocuments(e)];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,eo(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createOne",value:function e(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.create(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,eo(n)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return i(function(e){var t,n,r;var s=arguments;return R(this,function(i){switch(i.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.insertMany(e,t)];case 2:return[2,(n.result=i.sent().map(function(e){return f(e,nT)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 3:r=i.sent();return[2,eo(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(){return i(function(){var e,t,n,r,s;var i=arguments;return R(this,function(o){switch(o.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:{},t=i.length>1&&i[1]!==void 0?i[1]:{},n=i.length>2&&i[2]!==void 0?i[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);return[4,this.model.findOneAndUpdate(e,t,y({new:!0},n)).exec()];case 2:r=o.sent();return[2,r?{success:!0,result:r}:{success:!1,message:"Failed to update ".concat(this.getModelName(),"."),code:et.NOT_FOUND.CODE}];case 3:s=o.sent();return[2,eo(s)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateMany",value:function e(){return i(function(){var e,t,n,r,s;var i=arguments;return R(this,function(o){switch(o.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:{},t=i.length>1&&i[1]!==void 0?i[1]:{},n=i.length>2&&i[2]!==void 0?i[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);r={success:!0};return[4,this.model.updateMany(e,t,n).exec()];case 2:return[2,(r.result=o.sent(),r)];case 3:s=o.sent();return[2,eo(s)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteOne",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return R(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.model.findOneAndDelete(e,t).exec()];case 2:n=i.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(this.getModelName()," found to delete."),code:et.NOT_FOUND.CODE}];case 3:r=i.sent();return[2,eo(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteMany",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return R(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.model.deleteMany(e,t).exec()];case 2:n=i.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:et.NOT_FOUND.CODE}:{success:!0,result:n}];case 3:r=i.sent();return[2,eo(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return i(function(){var n,r,s,i,o;return R(this,function(a){switch(a.label){case 0:a.trys.push([0,6,,7]);n=new Set;r=0;a.label=1;case 1:if(!(r<10))return[3,5];s=nF(e,r+t);i=!n.has(s);if(!i)return[3,3];n.add(s);return[4,this.model.exists({shortId:s})];case 2:i=!a.sent();a.label=3;case 3:if(i)return[2,{success:!0,result:s}];a.label=4;case 4:r++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:et.INTERNAL_SERVER_ERROR.CODE}];case 6:o=a.sent();return[2,eo(o)];case 7:return[2]}})}).call(this)}},{key:"createSlug",value:function e(e,t,n){return i(function(){var r,s,o,a,c,u,d,p,f,m;return R(this,function(E){switch(E.label){case 0:r=this;E.label=1;case 1:E.trys.push([1,5,,6]);s=t[e],o=nw(s),a=M(function(t){var r=y({},n!==null&&n!==void 0?n:{});return o?S(y({},r),{$or:[l({},"slug.".concat(e),t),{slugHistory:{$elemMatch:l({},"slug.".concat(e),t)}}]}):S(y({},r),{$or:[{slug:t},{slugHistory:t}]})},"generateSlugQuery"),c=M(function(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:t=e,n=1;r.label=1;case 1:return[4,this.model.exists(a(t))];case 2:if(!r.sent())return[3,4];t="".concat(e,"-").concat(n++);r.label=3;case 3:return[3,1];case 4:return[2,t]}})}).call(r)},"generateUniqueSlug");if(!o)return[3,3];u={success:!0};d=Object.fromEntries;return[4,Promise.all(Object.entries(s).map(function(e){var t=I(e,2),n=t[0],r=t[1];return i(function(){var e,t;return R(this,function(s){switch(s.label){case 0:e=nU(r);t=[n];return[4,c(e)];case 1:return[2,t.concat([s.sent()])]}})})()}))];case 2:return[2,(u.result=d.apply(Object,[E.sent()]),u)];case 3:p=nU(s);f={success:!0};return[4,c(p)];case 4:return[2,(f.result=E.sent(),f)];case 5:m=E.sent();return[2,eo(m)];case 6:return[2]}})}).call(this)}},{key:"aggregate",value:function e(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.aggregate(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,eo(n)];case 3:return[2]}})}).call(this)}}]);return e}();M(nB,"MongooseController");var nH=nB;import{useServer as nW}from"graphql-ws/use/ws";import{WebSocketServer as nQ}from"ws";function nJ(e){return new nQ({server:e.server,path:e.path})}M(nJ,"createWSServer");function n$(e){return nW({schema:e.schema},e.server)}M(n$,"initGraphQLWS");export{eK as BUILD_DIRECTORY,te as COMMIT_LINT_CLI,e9 as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,e7 as COMMIT_LINT_PACKAGE_NAME,e1 as CYBERSKILL_CLI,e2 as CYBERSKILL_CLI_PATH,e0 as CYBERSKILL_DIRECTORY,eY as CYBERSKILL_PACKAGE_NAME,nI as C_Collection,nv as C_Db,nO as C_Document,nC as C_Model,e3 as ESLINT_CLI,tp as ESLINT_INSPECT_CLI,td as ESLINT_INSPECT_PACKAGE_NAME,e4 as ESLINT_PACKAGE_NAME,ep as E_CommandType,F as E_IssueType,eg as E_PackageType,to as GIT_CLI,eX as GIT_COMMIT_EDITMSG,ez as GIT_HOOK,eQ as GIT_IGNORE,tn as LINT_STAGED_CLI,tt as LINT_STAGED_PACKAGE_NAME,tg as MIGRATE_MONGO_CLI,eZ as MIGRATE_MONGO_CONFIG,tE as MIGRATE_MONGO_PACKAGE_NAME,nf as MONGO_MIGRATE_OPTIONS,nK as MongoController,nH as MongooseController,eV as NODE_MODULES,tm as NODE_MODULES_INSPECT_CLI,tf as NODE_MODULES_INSPECT_PACKAGE_NAME,eB as PACKAGE_JSON,eH as PACKAGE_LOCK_JSON,th as PATH,e8 as PLAYWRIGHT_PACKAGE_NAME,ta as PNPM_CLI,tc as PNPM_EXEC_CLI,e$ as PNPM_LOCK_YAML,t9 as Router,tu as SIMPLE_GIT_HOOKS_PACKAGE_NAME,tl as SIMPLE_GIT_HOOK_CLI,eJ as SIMPLE_GIT_HOOK_JSON,eW as TSCONFIG_JSON,ts as TSC_CLI,tr as TSC_PACKAGE_NAME,ti as TSX_CLI,e6 as VITEST_CLI,e5 as VITEST_PACKAGE_NAME,eq as WORKING_DIRECTORY,nb as aggregatePaginate,eb as appendFileSync,nt as bodyParser,eo as catchError,tL as clearAllErrorLists,tS as command,eG as copySync,ea as createApolloServer,nu as createCors,nc as createCorsOptions,nd as createExpress,ty as createGitHooksConfig,np as createNest,nl as createSession,nJ as createWSServer,ni as express,L as expressMiddleware,tY as formatCommand,eS as fs,t_ as getLatestPackageVersion,tC as getPackage,tw as getStoredErrorLists,n$ as initGraphQLWS,tI as installDependencies,eU as join,ei as log,eO as lstatSync,eC as mkdirSync,nY as mongo,nR as mongoosePaginate,eL as path,eR as pathExistsSync,tF as rawCommand,eD as readFileSync,eA as readJsonSync,e_ as readdirSync,ex as removeSync,ek as resolve,tV as resolveCommands,ej as resolveWorkingPath,tK as runCommand,tN as setupPackages,eN as statSync,tR as storage,er as throwError,eI as unlinkSync,tD as updatePackage,eT as writeFileSync};
@@ -1 +1 @@
1
- "use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(r){if(Array.isArray(r))return e(r)}function n(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var a=false;var u,i;try{for(t=t.call(e);!(o=(u=t.next()).done);o=true){n.push(u.value);if(r&&n.length===r)break}}catch(e){a=true;i=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(a)throw i}}return n}function u(){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 i(){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 c(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var o=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}o.forEach(function(r){n(e,r,t[r])})}return e}function l(e,t){return r(e)||a(e,t)||p(e,t)||u()}function f(e){return t(e)||o(e)||p(e)||i()}function y(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function p(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}var b=Object.create;var v=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var h=function(e,r){return v(e,"name",{value:r,configurable:!0})};var O=function(e,r){for(var t in r)v(e,t,{get:r[t],enumerable:!0})},j=function(e,r,t,n){var o=true,a=false,u=undefined;if(r&&(typeof r==="undefined"?"undefined":y(r))=="object"||typeof r=="function")try{var i=function(){var o=l.value;!g.call(e,o)&&o!==t&&v(e,o,{get:function(){return r[o]},enumerable:!(n=s(r,o))||n.enumerable})};for(var c=m(r)[Symbol.iterator](),l;!(o=(l=c.next()).done);o=true)i()}catch(e){a=true;u=e}finally{try{if(!o&&c.return!=null){c.return()}}finally{if(a){throw u}}}return e};var S=function(e,r,t){return t=e!=null?b(d(e)):{},j(r||!e||!e.__esModule?v(t,"default",{value:e,enumerable:!0}):t,e)},w=function(e){return j(v({},"__esModule",{value:!0}),e)};var A={};O(A,{regexSearchMapper:function(){return E},removeAccent:function(){return I}});module.exports=w(A);var x=S(require("unorm"),1);var P={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},M=Object.entries(P).reduce(function(e,r){var t=l(r,2),n=t[0],o=t[1];return e[n.toUpperCase()]=o.map(function(e){return e.toUpperCase()}),e},{});function E(e){e=x.default.nfkc(e);var r=c({},P,M);var t=true,n=false,o=undefined;try{for(var a=Object.entries(r)[Symbol.iterator](),u;!(t=(u=a.next()).done);t=true){var i=l(u.value,2),y=i[0],p=i[1];var b="[".concat(y).concat(p.join(""),"]"),v="(".concat([y].concat(f(p)).join("|"),")");e=e.replace(new RegExp(b,"g"),v)}}catch(e){n=true;o=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw o}}}return e}h(E,"regexSearchMapper");function I(e){return e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}h(I,"removeAccent");0&&(module.exports={regexSearchMapper:regexSearchMapper,removeAccent:removeAccent});
1
+ "use strict";function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(r){if(Array.isArray(r))return r}function t(e){if(Array.isArray(e))return r(e)}function n(r,e,t){if(e in r){Object.defineProperty(r,e,{value:t,enumerable:true,configurable:true,writable:true})}else{r[e]=t}return r}function u(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function o(r,e){var t=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t==null)return;var n=[];var u=true;var o=false;var a,i;try{for(t=t.call(r);!(u=(a=t.next()).done);u=true){n.push(a.value);if(e&&n.length===e)break}}catch(r){o=true;i=r}finally{try{if(!u&&t["return"]!=null)t["return"]()}finally{if(o)throw i}}return n}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 i(){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 c(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};var u=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){u=u.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}u.forEach(function(e){n(r,e,t[e])})}return r}function l(r,t){return e(r)||o(r,t)||p(r,t)||a()}function f(r){return t(r)||u(r)||p(r)||i()}function y(r){"@swc/helpers - typeof";return r&&typeof Symbol!=="undefined"&&r.constructor===Symbol?"symbol":typeof r}function p(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}var v=Object.create;var b=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var g=function(r,e){return b(r,"name",{value:e,configurable:!0})};var O=function(r,e){for(var t in e)b(r,t,{get:e[t],enumerable:!0})},S=function(r,e,t,n){var u=true,o=false,a=undefined;if(e&&(typeof e==="undefined"?"undefined":y(e))=="object"||typeof e=="function")try{var i=function(){var u=l.value;!h.call(r,u)&&u!==t&&b(r,u,{get:function(){return e[u]},enumerable:!(n=s(e,u))||n.enumerable})};for(var c=m(e)[Symbol.iterator](),l;!(u=(l=c.next()).done);u=true)i()}catch(r){o=true;a=r}finally{try{if(!u&&c.return!=null){c.return()}}finally{if(o){throw a}}}return r};var j=function(r,e,t){return t=r!=null?v(d(r)):{},S(e||!r||!r.__esModule?b(t,"default",{value:r,enumerable:!0}):t,r)},w=function(r){return S(b({},"__esModule",{value:!0}),r)};var A={};O(A,{regexSearchMapper:function(){return q},removeAccent:function(){return E},uniqueArray:function(){return I}});module.exports=w(A);var x=j(require("unorm"),1);var P={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},M=Object.entries(P).reduce(function(r,e){var t=l(e,2),n=t[0],u=t[1];return r[n.toUpperCase()]=u.map(function(r){return r.toUpperCase()}),r},{});function q(r){r=x.default.nfkc(r);var e=c({},P,M);var t=true,n=false,u=undefined;try{for(var o=Object.entries(e)[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var i=l(a.value,2),y=i[0],p=i[1];var v="[".concat(y).concat(p.join(""),"]"),b="(".concat([y].concat(f(p)).join("|"),")");r=r.replace(new RegExp(v,"g"),b)}}catch(r){n=true;u=r}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw u}}}return r}g(q,"regexSearchMapper");function E(r){return r.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}g(E,"removeAccent");function I(r,e){if(!e)return Array.from(new Set(r));var t=new Set,n=[];var u=true,o=false,a=undefined;try{for(var i=r[Symbol.iterator](),c;!(u=(c=i.next()).done);u=true){var l=c.value;var f=e(l);t.has(f)||(t.add(f),n.push(l))}}catch(r){o=true;a=r}finally{try{if(!u&&i.return!=null){i.return()}}finally{if(o){throw a}}}return n}g(I,"uniqueArray");0&&(module.exports={regexSearchMapper:regexSearchMapper,removeAccent:removeAccent,uniqueArray:uniqueArray});
@@ -1,2 +1,3 @@
1
1
  export { regexSearchMapper_alias_1 as regexSearchMapper } from '../../_tsup-dts-rollup.cjs';
2
2
  export { removeAccent_alias_1 as removeAccent } from '../../_tsup-dts-rollup.cjs';
3
+ export { uniqueArray_alias_1 as uniqueArray } from '../../_tsup-dts-rollup.cjs';
@@ -1,2 +1,3 @@
1
1
  export { regexSearchMapper_alias_1 as regexSearchMapper } from '../../_tsup-dts-rollup.js';
2
2
  export { removeAccent_alias_1 as removeAccent } from '../../_tsup-dts-rollup.js';
3
+ export { uniqueArray_alias_1 as uniqueArray } from '../../_tsup-dts-rollup.js';
@@ -1 +1 @@
1
- function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(r){if(Array.isArray(r))return r}function t(e){if(Array.isArray(e))return r(e)}function n(r,e,t){if(e in r){Object.defineProperty(r,e,{value:t,enumerable:true,configurable:true,writable:true})}else{r[e]=t}return r}function o(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function a(r,e){var t=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t==null)return;var n=[];var o=true;var a=false;var u,i;try{for(t=t.call(r);!(o=(u=t.next()).done);o=true){n.push(u.value);if(e&&n.length===e)break}}catch(r){a=true;i=r}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(a)throw i}}return n}function u(){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 i(){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 c(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};var o=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}o.forEach(function(e){n(r,e,t[e])})}return r}function l(r,t){return e(r)||a(r,t)||y(r,t)||u()}function f(r){return t(r)||o(r)||y(r)||i()}function y(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}var p=Object.defineProperty;var b=function(r,e){return p(r,"name",{value:e,configurable:!0})};import m from"unorm";var s={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},v=Object.entries(s).reduce(function(r,e){var t=l(e,2),n=t[0],o=t[1];return r[n.toUpperCase()]=o.map(function(r){return r.toUpperCase()}),r},{});function d(r){r=m.nfkc(r);var e=c({},s,v);var t=true,n=false,o=undefined;try{for(var a=Object.entries(e)[Symbol.iterator](),u;!(t=(u=a.next()).done);t=true){var i=l(u.value,2),y=i[0],p=i[1];var b="[".concat(y).concat(p.join(""),"]"),d="(".concat([y].concat(f(p)).join("|"),")");r=r.replace(new RegExp(b,"g"),d)}}catch(r){n=true;o=r}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw o}}}return r}b(d,"regexSearchMapper");function h(r){return r.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}b(h,"removeAccent");export{d as regexSearchMapper,h as removeAccent};
1
+ function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(r){if(Array.isArray(r))return r}function t(e){if(Array.isArray(e))return r(e)}function n(r,e,t){if(e in r){Object.defineProperty(r,e,{value:t,enumerable:true,configurable:true,writable:true})}else{r[e]=t}return r}function a(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function o(r,e){var t=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t==null)return;var n=[];var a=true;var o=false;var u,i;try{for(t=t.call(r);!(a=(u=t.next()).done);a=true){n.push(u.value);if(e&&n.length===e)break}}catch(r){o=true;i=r}finally{try{if(!a&&t["return"]!=null)t["return"]()}finally{if(o)throw i}}return n}function u(){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 i(){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(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};var a=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){a=a.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}a.forEach(function(e){n(r,e,t[e])})}return r}function c(r,t){return e(r)||o(r,t)||y(r,t)||u()}function f(r){return t(r)||a(r)||y(r)||i()}function y(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}var p=Object.defineProperty;var b=function(r,e){return p(r,"name",{value:e,configurable:!0})};import v from"unorm";var s={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},m=Object.entries(s).reduce(function(r,e){var t=c(e,2),n=t[0],a=t[1];return r[n.toUpperCase()]=a.map(function(r){return r.toUpperCase()}),r},{});function d(r){r=v.nfkc(r);var e=l({},s,m);var t=true,n=false,a=undefined;try{for(var o=Object.entries(e)[Symbol.iterator](),u;!(t=(u=o.next()).done);t=true){var i=c(u.value,2),y=i[0],p=i[1];var b="[".concat(y).concat(p.join(""),"]"),d="(".concat([y].concat(f(p)).join("|"),")");r=r.replace(new RegExp(b,"g"),d)}}catch(r){n=true;a=r}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw a}}}return r}b(d,"regexSearchMapper");function h(r){return r.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}b(h,"removeAccent");function g(r,e){if(!e)return Array.from(new Set(r));var t=new Set,n=[];var a=true,o=false,u=undefined;try{for(var i=r[Symbol.iterator](),l;!(a=(l=i.next()).done);a=true){var c=l.value;var f=e(c);t.has(f)||(t.add(f),n.push(c))}}catch(r){o=true;u=r}finally{try{if(!a&&i.return!=null){i.return()}}finally{if(o){throw u}}}return n}b(g,"uniqueArray");export{d as regexSearchMapper,h as removeAccent,g as uniqueArray};
@@ -1 +1 @@
1
- "use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(r){if(Array.isArray(r))return e(r)}function n(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var a=false;var u,i;try{for(t=t.call(e);!(o=(u=t.next()).done);o=true){n.push(u.value);if(r&&n.length===r)break}}catch(e){a=true;i=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(a)throw i}}return n}function u(){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 i(){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 c(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var o=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}o.forEach(function(r){n(e,r,t[r])})}return e}function l(e,t){return r(e)||a(e,t)||p(e,t)||u()}function f(e){return t(e)||o(e)||p(e)||i()}function y(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function p(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}var b=Object.create;var v=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var h=function(e,r){return v(e,"name",{value:r,configurable:!0})};var O=function(e,r){for(var t in r)v(e,t,{get:r[t],enumerable:!0})},j=function(e,r,t,n){var o=true,a=false,u=undefined;if(r&&(typeof r==="undefined"?"undefined":y(r))=="object"||typeof r=="function")try{var i=function(){var o=l.value;!g.call(e,o)&&o!==t&&v(e,o,{get:function(){return r[o]},enumerable:!(n=s(r,o))||n.enumerable})};for(var c=m(r)[Symbol.iterator](),l;!(o=(l=c.next()).done);o=true)i()}catch(e){a=true;u=e}finally{try{if(!o&&c.return!=null){c.return()}}finally{if(a){throw u}}}return e};var S=function(e,r,t){return t=e!=null?b(d(e)):{},j(r||!e||!e.__esModule?v(t,"default",{value:e,enumerable:!0}):t,e)},w=function(e){return j(v({},"__esModule",{value:!0}),e)};var A={};O(A,{regexSearchMapper:function(){return E},removeAccent:function(){return I}});module.exports=w(A);var x=S(require("unorm"),1);var P={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},M=Object.entries(P).reduce(function(e,r){var t=l(r,2),n=t[0],o=t[1];return e[n.toUpperCase()]=o.map(function(e){return e.toUpperCase()}),e},{});function E(e){e=x.default.nfkc(e);var r=c({},P,M);var t=true,n=false,o=undefined;try{for(var a=Object.entries(r)[Symbol.iterator](),u;!(t=(u=a.next()).done);t=true){var i=l(u.value,2),y=i[0],p=i[1];var b="[".concat(y).concat(p.join(""),"]"),v="(".concat([y].concat(f(p)).join("|"),")");e=e.replace(new RegExp(b,"g"),v)}}catch(e){n=true;o=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw o}}}return e}h(E,"regexSearchMapper");function I(e){return e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}h(I,"removeAccent");0&&(module.exports={regexSearchMapper:regexSearchMapper,removeAccent:removeAccent});
1
+ "use strict";function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(r){if(Array.isArray(r))return r}function t(e){if(Array.isArray(e))return r(e)}function n(r,e,t){if(e in r){Object.defineProperty(r,e,{value:t,enumerable:true,configurable:true,writable:true})}else{r[e]=t}return r}function u(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function o(r,e){var t=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t==null)return;var n=[];var u=true;var o=false;var a,i;try{for(t=t.call(r);!(u=(a=t.next()).done);u=true){n.push(a.value);if(e&&n.length===e)break}}catch(r){o=true;i=r}finally{try{if(!u&&t["return"]!=null)t["return"]()}finally{if(o)throw i}}return n}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 i(){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 c(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};var u=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){u=u.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}u.forEach(function(e){n(r,e,t[e])})}return r}function l(r,t){return e(r)||o(r,t)||p(r,t)||a()}function f(r){return t(r)||u(r)||p(r)||i()}function y(r){"@swc/helpers - typeof";return r&&typeof Symbol!=="undefined"&&r.constructor===Symbol?"symbol":typeof r}function p(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}var v=Object.create;var b=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var g=function(r,e){return b(r,"name",{value:e,configurable:!0})};var O=function(r,e){for(var t in e)b(r,t,{get:e[t],enumerable:!0})},S=function(r,e,t,n){var u=true,o=false,a=undefined;if(e&&(typeof e==="undefined"?"undefined":y(e))=="object"||typeof e=="function")try{var i=function(){var u=l.value;!h.call(r,u)&&u!==t&&b(r,u,{get:function(){return e[u]},enumerable:!(n=s(e,u))||n.enumerable})};for(var c=m(e)[Symbol.iterator](),l;!(u=(l=c.next()).done);u=true)i()}catch(r){o=true;a=r}finally{try{if(!u&&c.return!=null){c.return()}}finally{if(o){throw a}}}return r};var j=function(r,e,t){return t=r!=null?v(d(r)):{},S(e||!r||!r.__esModule?b(t,"default",{value:r,enumerable:!0}):t,r)},w=function(r){return S(b({},"__esModule",{value:!0}),r)};var A={};O(A,{regexSearchMapper:function(){return q},removeAccent:function(){return E},uniqueArray:function(){return I}});module.exports=w(A);var x=j(require("unorm"),1);var P={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},M=Object.entries(P).reduce(function(r,e){var t=l(e,2),n=t[0],u=t[1];return r[n.toUpperCase()]=u.map(function(r){return r.toUpperCase()}),r},{});function q(r){r=x.default.nfkc(r);var e=c({},P,M);var t=true,n=false,u=undefined;try{for(var o=Object.entries(e)[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var i=l(a.value,2),y=i[0],p=i[1];var v="[".concat(y).concat(p.join(""),"]"),b="(".concat([y].concat(f(p)).join("|"),")");r=r.replace(new RegExp(v,"g"),b)}}catch(r){n=true;u=r}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw u}}}return r}g(q,"regexSearchMapper");function E(r){return r.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}g(E,"removeAccent");function I(r,e){if(!e)return Array.from(new Set(r));var t=new Set,n=[];var u=true,o=false,a=undefined;try{for(var i=r[Symbol.iterator](),c;!(u=(c=i.next()).done);u=true){var l=c.value;var f=e(l);t.has(f)||(t.add(f),n.push(l))}}catch(r){o=true;a=r}finally{try{if(!u&&i.return!=null){i.return()}}finally{if(o){throw a}}}return n}g(I,"uniqueArray");0&&(module.exports={regexSearchMapper:regexSearchMapper,removeAccent:removeAccent,uniqueArray:uniqueArray});
@@ -1,2 +1,3 @@
1
1
  export { regexSearchMapper_alias_2 as regexSearchMapper } from '../../_tsup-dts-rollup.cjs';
2
2
  export { removeAccent_alias_2 as removeAccent } from '../../_tsup-dts-rollup.cjs';
3
+ export { uniqueArray_alias_2 as uniqueArray } from '../../_tsup-dts-rollup.cjs';
@@ -1,2 +1,3 @@
1
1
  export { regexSearchMapper_alias_2 as regexSearchMapper } from '../../_tsup-dts-rollup.js';
2
2
  export { removeAccent_alias_2 as removeAccent } from '../../_tsup-dts-rollup.js';
3
+ export { uniqueArray_alias_2 as uniqueArray } from '../../_tsup-dts-rollup.js';
@@ -1 +1 @@
1
- function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(r){if(Array.isArray(r))return r}function t(e){if(Array.isArray(e))return r(e)}function n(r,e,t){if(e in r){Object.defineProperty(r,e,{value:t,enumerable:true,configurable:true,writable:true})}else{r[e]=t}return r}function o(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function a(r,e){var t=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t==null)return;var n=[];var o=true;var a=false;var u,i;try{for(t=t.call(r);!(o=(u=t.next()).done);o=true){n.push(u.value);if(e&&n.length===e)break}}catch(r){a=true;i=r}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(a)throw i}}return n}function u(){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 i(){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 c(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};var o=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}o.forEach(function(e){n(r,e,t[e])})}return r}function l(r,t){return e(r)||a(r,t)||y(r,t)||u()}function f(r){return t(r)||o(r)||y(r)||i()}function y(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}var p=Object.defineProperty;var b=function(r,e){return p(r,"name",{value:e,configurable:!0})};import m from"unorm";var s={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},v=Object.entries(s).reduce(function(r,e){var t=l(e,2),n=t[0],o=t[1];return r[n.toUpperCase()]=o.map(function(r){return r.toUpperCase()}),r},{});function d(r){r=m.nfkc(r);var e=c({},s,v);var t=true,n=false,o=undefined;try{for(var a=Object.entries(e)[Symbol.iterator](),u;!(t=(u=a.next()).done);t=true){var i=l(u.value,2),y=i[0],p=i[1];var b="[".concat(y).concat(p.join(""),"]"),d="(".concat([y].concat(f(p)).join("|"),")");r=r.replace(new RegExp(b,"g"),d)}}catch(r){n=true;o=r}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw o}}}return r}b(d,"regexSearchMapper");function g(r){return r.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}b(g,"removeAccent");export{d as regexSearchMapper,g as removeAccent};
1
+ function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(r){if(Array.isArray(r))return r}function t(e){if(Array.isArray(e))return r(e)}function n(r,e,t){if(e in r){Object.defineProperty(r,e,{value:t,enumerable:true,configurable:true,writable:true})}else{r[e]=t}return r}function a(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function o(r,e){var t=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t==null)return;var n=[];var a=true;var o=false;var u,i;try{for(t=t.call(r);!(a=(u=t.next()).done);a=true){n.push(u.value);if(e&&n.length===e)break}}catch(r){o=true;i=r}finally{try{if(!a&&t["return"]!=null)t["return"]()}finally{if(o)throw i}}return n}function u(){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 i(){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(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};var a=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){a=a.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}a.forEach(function(e){n(r,e,t[e])})}return r}function c(r,t){return e(r)||o(r,t)||y(r,t)||u()}function f(r){return t(r)||a(r)||y(r)||i()}function y(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}var p=Object.defineProperty;var b=function(r,e){return p(r,"name",{value:e,configurable:!0})};import v from"unorm";var s={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},m=Object.entries(s).reduce(function(r,e){var t=c(e,2),n=t[0],a=t[1];return r[n.toUpperCase()]=a.map(function(r){return r.toUpperCase()}),r},{});function d(r){r=v.nfkc(r);var e=l({},s,m);var t=true,n=false,a=undefined;try{for(var o=Object.entries(e)[Symbol.iterator](),u;!(t=(u=o.next()).done);t=true){var i=c(u.value,2),y=i[0],p=i[1];var b="[".concat(y).concat(p.join(""),"]"),d="(".concat([y].concat(f(p)).join("|"),")");r=r.replace(new RegExp(b,"g"),d)}}catch(r){n=true;a=r}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw a}}}return r}b(d,"regexSearchMapper");function h(r){return r.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}b(h,"removeAccent");function g(r,e){if(!e)return Array.from(new Set(r));var t=new Set,n=[];var a=true,o=false,u=undefined;try{for(var i=r[Symbol.iterator](),l;!(a=(l=i.next()).done);a=true){var c=l.value;var f=e(c);t.has(f)||(t.add(f),n.push(c))}}catch(r){o=true;u=r}finally{try{if(!a&&i.return!=null){i.return()}}finally{if(o){throw u}}}return n}b(g,"uniqueArray");export{d as regexSearchMapper,h as removeAccent,g as uniqueArray};
@@ -1 +1 @@
1
- "use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(r){if(Array.isArray(r))return e(r)}function n(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function i(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function u(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var i=true;var a=false;var u,o;try{for(t=t.call(e);!(i=(u=t.next()).done);i=true){n.push(u.value);if(r&&n.length===r)break}}catch(e){a=true;o=e}finally{try{if(!i&&t["return"]!=null)t["return"]()}finally{if(a)throw o}}return n}function o(){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 l(){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 f(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var i=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){i=i.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}i.forEach(function(r){n(e,r,t[r])})}return e}function c(e,t){return r(e)||u(e,t)||y(e,t)||o()}function s(e){return t(e)||a(e)||y(e)||l()}function d(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function y(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}var v=Object.create;var p=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var S=function(e,r){return p(e,"name",{value:r,configurable:!0})};var O=function(e,r){for(var t in r)p(e,t,{get:r[t],enumerable:!0})},w=function(e,r,t,n){var i=true,a=false,u=undefined;if(r&&(typeof r==="undefined"?"undefined":d(r))=="object"||typeof r=="function")try{var o=function(){var i=f.value;!h.call(e,i)&&i!==t&&p(e,i,{get:function(){return r[i]},enumerable:!(n=g(r,i))||n.enumerable})};for(var l=b(r)[Symbol.iterator](),f;!(i=(f=l.next()).done);i=true)o()}catch(e){a=true;u=e}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(a){throw u}}}return e};var j=function(e,r,t){return t=e!=null?v(m(e)):{},w(r||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)},z=function(e){return w(p({},"__esModule",{value:!0}),e)};var A={};O(A,{deepMerge:function(){return R},generateRandomPassword:function(){return U},generateShortId:function(){return C},generateSlug:function(){return q},getFileName:function(){return W},isJson:function(){return N},isObject:function(){return E},regexSearchMapper:function(){return I},removeAccent:function(){return P},serializer:function(){return B},substringBetween:function(){return $},validate:function(){return H}});module.exports=z(A);var x=j(require("unorm"),1);var _={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},M=Object.entries(_).reduce(function(e,r){var t=c(r,2),n=t[0],i=t[1];return e[n.toUpperCase()]=i.map(function(e){return e.toUpperCase()}),e},{});function I(e){e=x.default.nfkc(e);var r=f({},_,M);var t=true,n=false,i=undefined;try{for(var a=Object.entries(r)[Symbol.iterator](),u;!(t=(u=a.next()).done);t=true){var o=c(u.value,2),l=o[0],d=o[1];var y="[".concat(l).concat(d.join(""),"]"),v="(".concat([l].concat(s(d)).join("|"),")");e=e.replace(new RegExp(y,"g"),v)}}catch(e){n=true;i=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw i}}}return e}S(I,"regexSearchMapper");function P(e){return e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}S(P,"removeAccent");function N(e){try{return JSON.parse(e),!0}catch(e){return!1}}S(N,"isJson");function E(e){return(typeof e==="undefined"?"undefined":d(e))=="object"&&e!==null&&!Array.isArray(e)}S(E,"isObject");function R(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n={};var i=true,a=false,u=undefined,o=true,l=false,f=undefined;try{for(var d=r.flat()[Symbol.iterator](),y;!(o=(y=d.next()).done);o=true){var v=y.value;try{for(var p=Object.entries(v)[Symbol.iterator](),g;!(i=(g=p.next()).done);i=true){var b=c(g.value,2),m=b[0],h=b[1];var S=n[m];if(Array.isArray(h)){var O=Array.isArray(S)?S:[];n[m]=s(new Set(s(O).concat(s(h))));continue}if(E(h)){n[m]=R(E(S)?S:{},h);continue}n[m]=h}}catch(e){a=true;u=e}finally{try{if(!i&&p.return!=null){p.return()}}finally{if(a){throw u}}}}}catch(e){l=true;f=e}finally{try{if(!o&&d.return!=null){d.return()}}finally{if(l){throw f}}}return n}S(R,"deepMerge");var D={Date:{is:S(function(e){return i(e,Date)},"is"),serialize:S(function(e){return{__type:"Date",value:e.toISOString()}},"serialize"),deserialize:S(function(e){return new Date(e)},"deserialize")},Map:{is:S(function(e){return i(e,Map)},"is"),serialize:S(function(e){return{__type:"Map",value:Array.from(e.entries())}},"serialize"),deserialize:S(function(e){return new Map(e)},"deserialize")},Set:{is:S(function(e){return i(e,Set)},"is"),serialize:S(function(e){return{__type:"Set",value:Array.from(e)}},"serialize"),deserialize:S(function(e){return new Set(e)},"deserialize")},RegExp:{is:S(function(e){return i(e,RegExp)},"is"),serialize:S(function(e){return{__type:"RegExp",value:{source:e.source,flags:e.flags}}},"serialize"),deserialize:S(function(e){var r=e.source,t=e.flags;return new RegExp(r,t)},"deserialize")},BigInt:{is:S(function(e){return(typeof e==="undefined"?"undefined":d(e))=="bigint"},"is"),serialize:S(function(e){return{__type:"BigInt",value:e.toString()}},"serialize"),deserialize:S(function(e){return BigInt(e)},"deserialize")}},B={serialize:function e(e){return JSON.stringify(e,function(e,r){var t=true,n=false,i=undefined;try{for(var a=Object.keys(D)[Symbol.iterator](),u;!(t=(u=a.next()).done);t=true){var o=u.value;var l=D[o];if(l.is(r))return l.serialize(r)}}catch(e){n=true;i=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw i}}}return r})},deserialize:function e(e){return JSON.parse(e,function(e,r){if(r&&(typeof r==="undefined"?"undefined":d(r))=="object"&&"__type"in r&&typeof r.__type=="string"){var t=r.__type,n=D[t];if(n)return n.deserialize(r.value)}return r})}};var k=j(require("crypto-js"),1),J=j(require("slugify"),1);var F=J.default.default||J.default;function q(e,r){var t=S(function(e){var t,n;return F(e!==null&&e!==void 0?e:"",f({lower:(t=r===null||r===void 0?void 0:r.lower)!==null&&t!==void 0?t:!0,locale:(n=r===null||r===void 0?void 0:r.locale)!==null&&n!==void 0?n:"vi"},r))},"slugifyWithOptions");if(E(e)){var n={};var i=true,a=false,u=undefined;try{for(var o=Object.entries(e)[Symbol.iterator](),l;!(i=(l=o.next()).done);i=true){var s=c(l.value,2),d=s[0],y=s[1];n[d]=t(y)}}catch(e){a=true;u=e}finally{try{if(!i&&o.return!=null){o.return()}}finally{if(a){throw u}}}return n}return t(e)}S(q,"generateSlug");function C(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return k.default.SHA256(e).toString(k.default.enc.Hex).slice(0,r)}S(C,"generateShortId");function U(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:8;var r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+[]{}|;:,.<>?",t="";for(var n=0;n<e;n++){var i=Math.floor(Math.random()*r.length);t+=r.charAt(i)}return t}S(U,"generateRandomPassword");function W(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var t=e.split(/[?#]/)[0]||"",n=t.substring(t.lastIndexOf("/")+1);if(r)return n;var i=n.lastIndexOf(".");return i>0?n.slice(0,i):n}S(W,"getFileName");function $(e,r,t){var n=e.indexOf(r);if(n===-1)return"";var i=n+r.length,a=e.indexOf(t,i);return a===-1?"":e.slice(i,a)}S($,"substringBetween");var H={isEmpty:function e(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":d(e))=="object"?i(e,Date)?!1:i(e,Map)||i(e,Set)?e.size===0:i(e,WeakMap)||i(e,WeakSet)?!0:ArrayBuffer.isView(e)?e.byteLength===0:Object.keys(e).length===0:!1},isValidIP:function e(e){var r=e.split(".");return r.length===4&&r.every(function(e){return/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255})?!0:/^(([a-f\d]{1,4}:){7}[a-f\d]{1,4}|((?:[a-f\d]{1,4}:){1,7}:)|((?:[a-f\d]{1,4}:){1,6}:[a-f\d]{1,4})|::)$/i.test(e)}};0&&(module.exports={deepMerge:deepMerge,generateRandomPassword:generateRandomPassword,generateShortId:generateShortId,generateSlug:generateSlug,getFileName:getFileName,isJson:isJson,isObject:isObject,regexSearchMapper:regexSearchMapper,removeAccent:removeAccent,serializer:serializer,substringBetween:substringBetween,validate:validate});
1
+ "use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(r){if(Array.isArray(r))return e(r)}function n(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function i(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function u(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var i=true;var a=false;var u,o;try{for(t=t.call(e);!(i=(u=t.next()).done);i=true){n.push(u.value);if(r&&n.length===r)break}}catch(e){a=true;o=e}finally{try{if(!i&&t["return"]!=null)t["return"]()}finally{if(a)throw o}}return n}function o(){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 l(){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 f(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var i=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){i=i.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}i.forEach(function(r){n(e,r,t[r])})}return e}function c(e,t){return r(e)||u(e,t)||y(e,t)||o()}function s(e){return t(e)||a(e)||y(e)||l()}function d(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function y(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}var v=Object.create;var p=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var S=function(e,r){return p(e,"name",{value:r,configurable:!0})};var w=function(e,r){for(var t in r)p(e,t,{get:r[t],enumerable:!0})},O=function(e,r,t,n){var i=true,a=false,u=undefined;if(r&&(typeof r==="undefined"?"undefined":d(r))=="object"||typeof r=="function")try{var o=function(){var i=f.value;!h.call(e,i)&&i!==t&&p(e,i,{get:function(){return r[i]},enumerable:!(n=g(r,i))||n.enumerable})};for(var l=b(r)[Symbol.iterator](),f;!(i=(f=l.next()).done);i=true)o()}catch(e){a=true;u=e}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(a){throw u}}}return e};var j=function(e,r,t){return t=e!=null?v(m(e)):{},O(r||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)},A=function(e){return O(p({},"__esModule",{value:!0}),e)};var z={};w(z,{deepMerge:function(){return D},generateRandomPassword:function(){return W},generateShortId:function(){return U},generateSlug:function(){return C},getFileName:function(){return $},isJson:function(){return E},isObject:function(){return R},regexSearchMapper:function(){return I},removeAccent:function(){return P},serializer:function(){return k},substringBetween:function(){return H},uniqueArray:function(){return N},validate:function(){return T}});module.exports=A(z);var x=j(require("unorm"),1);var _={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},M=Object.entries(_).reduce(function(e,r){var t=c(r,2),n=t[0],i=t[1];return e[n.toUpperCase()]=i.map(function(e){return e.toUpperCase()}),e},{});function I(e){e=x.default.nfkc(e);var r=f({},_,M);var t=true,n=false,i=undefined;try{for(var a=Object.entries(r)[Symbol.iterator](),u;!(t=(u=a.next()).done);t=true){var o=c(u.value,2),l=o[0],d=o[1];var y="[".concat(l).concat(d.join(""),"]"),v="(".concat([l].concat(s(d)).join("|"),")");e=e.replace(new RegExp(y,"g"),v)}}catch(e){n=true;i=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw i}}}return e}S(I,"regexSearchMapper");function P(e){return e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}S(P,"removeAccent");function N(e,r){if(!r)return Array.from(new Set(e));var t=new Set,n=[];var i=true,a=false,u=undefined;try{for(var o=e[Symbol.iterator](),l;!(i=(l=o.next()).done);i=true){var f=l.value;var c=r(f);t.has(c)||(t.add(c),n.push(f))}}catch(e){a=true;u=e}finally{try{if(!i&&o.return!=null){o.return()}}finally{if(a){throw u}}}return n}S(N,"uniqueArray");function E(e){try{return JSON.parse(e),!0}catch(e){return!1}}S(E,"isJson");function R(e){return(typeof e==="undefined"?"undefined":d(e))=="object"&&e!==null&&!Array.isArray(e)}S(R,"isObject");function D(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n={};var i=true,a=false,u=undefined,o=true,l=false,f=undefined;try{for(var d=r.flat()[Symbol.iterator](),y;!(o=(y=d.next()).done);o=true){var v=y.value;try{for(var p=Object.entries(v)[Symbol.iterator](),g;!(i=(g=p.next()).done);i=true){var b=c(g.value,2),m=b[0],h=b[1];var S=n[m];if(Array.isArray(h)){var w=Array.isArray(S)?S:[];n[m]=s(new Set(s(w).concat(s(h))));continue}if(R(h)){n[m]=D(R(S)?S:{},h);continue}n[m]=h}}catch(e){a=true;u=e}finally{try{if(!i&&p.return!=null){p.return()}}finally{if(a){throw u}}}}}catch(e){l=true;f=e}finally{try{if(!o&&d.return!=null){d.return()}}finally{if(l){throw f}}}return n}S(D,"deepMerge");var B={Date:{is:S(function(e){return i(e,Date)},"is"),serialize:S(function(e){return{__type:"Date",value:e.toISOString()}},"serialize"),deserialize:S(function(e){return new Date(e)},"deserialize")},Map:{is:S(function(e){return i(e,Map)},"is"),serialize:S(function(e){return{__type:"Map",value:Array.from(e.entries())}},"serialize"),deserialize:S(function(e){return new Map(e)},"deserialize")},Set:{is:S(function(e){return i(e,Set)},"is"),serialize:S(function(e){return{__type:"Set",value:Array.from(e)}},"serialize"),deserialize:S(function(e){return new Set(e)},"deserialize")},RegExp:{is:S(function(e){return i(e,RegExp)},"is"),serialize:S(function(e){return{__type:"RegExp",value:{source:e.source,flags:e.flags}}},"serialize"),deserialize:S(function(e){var r=e.source,t=e.flags;return new RegExp(r,t)},"deserialize")},BigInt:{is:S(function(e){return(typeof e==="undefined"?"undefined":d(e))=="bigint"},"is"),serialize:S(function(e){return{__type:"BigInt",value:e.toString()}},"serialize"),deserialize:S(function(e){return BigInt(e)},"deserialize")}},k={serialize:function e(e){return JSON.stringify(e,function(e,r){var t=true,n=false,i=undefined;try{for(var a=Object.keys(B)[Symbol.iterator](),u;!(t=(u=a.next()).done);t=true){var o=u.value;var l=B[o];if(l.is(r))return l.serialize(r)}}catch(e){n=true;i=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw i}}}return r})},deserialize:function e(e){return JSON.parse(e,function(e,r){if(r&&(typeof r==="undefined"?"undefined":d(r))=="object"&&"__type"in r&&typeof r.__type=="string"){var t=r.__type,n=B[t];if(n)return n.deserialize(r.value)}return r})}};var q=j(require("crypto-js"),1),J=j(require("slugify"),1);var F=J.default.default||J.default;function C(e,r){var t=S(function(e){var t,n;return F(e!==null&&e!==void 0?e:"",f({lower:(t=r===null||r===void 0?void 0:r.lower)!==null&&t!==void 0?t:!0,locale:(n=r===null||r===void 0?void 0:r.locale)!==null&&n!==void 0?n:"vi"},r))},"slugifyWithOptions");if(R(e)){var n={};var i=true,a=false,u=undefined;try{for(var o=Object.entries(e)[Symbol.iterator](),l;!(i=(l=o.next()).done);i=true){var s=c(l.value,2),d=s[0],y=s[1];n[d]=t(y)}}catch(e){a=true;u=e}finally{try{if(!i&&o.return!=null){o.return()}}finally{if(a){throw u}}}return n}return t(e)}S(C,"generateSlug");function U(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return q.default.SHA256(e).toString(q.default.enc.Hex).slice(0,r)}S(U,"generateShortId");function W(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:8;var r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+[]{}|;:,.<>?",t="";for(var n=0;n<e;n++){var i=Math.floor(Math.random()*r.length);t+=r.charAt(i)}return t}S(W,"generateRandomPassword");function $(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var t=e.split(/[?#]/)[0]||"",n=t.substring(t.lastIndexOf("/")+1);if(r)return n;var i=n.lastIndexOf(".");return i>0?n.slice(0,i):n}S($,"getFileName");function H(e,r,t){var n=e.indexOf(r);if(n===-1)return"";var i=n+r.length,a=e.indexOf(t,i);return a===-1?"":e.slice(i,a)}S(H,"substringBetween");var T={isEmpty:function e(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":d(e))=="object"?i(e,Date)?!1:i(e,Map)||i(e,Set)?e.size===0:i(e,WeakMap)||i(e,WeakSet)?!0:ArrayBuffer.isView(e)?e.byteLength===0:Object.keys(e).length===0:!1},isValidIP:function e(e){var r=e.split(".");return r.length===4&&r.every(function(e){return/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255})?!0:/^(([a-f\d]{1,4}:){7}[a-f\d]{1,4}|((?:[a-f\d]{1,4}:){1,7}:)|((?:[a-f\d]{1,4}:){1,6}:[a-f\d]{1,4})|::)$/i.test(e)}};0&&(module.exports={deepMerge:deepMerge,generateRandomPassword:generateRandomPassword,generateShortId:generateShortId,generateSlug:generateSlug,getFileName:getFileName,isJson:isJson,isObject:isObject,regexSearchMapper:regexSearchMapper,removeAccent:removeAccent,serializer:serializer,substringBetween:substringBetween,uniqueArray:uniqueArray,validate:validate});