@cyberskill/shared 1.198.0 → 1.199.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,a){try{var o=e[i](a);var c=o.value}catch(e){n(e);return}if(o.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 a=e.apply(t,n);function o(e){s(a,r,i,o,c,"next",e)}function c(e){s(a,r,i,o,c,"throw",e)}o(undefined)})}}function a(e,t,n){t=d(t);return D(e,x()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function o(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 f(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)I(e,t)}function p(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 a,o;try{for(n=n.call(e);!(s=(a=n.next()).done);s=true){r.push(a.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw o}}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=C(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 C(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 D(e,t){if(t&&(T(t)==="object"||typeof t==="function")){return t}return r(e)}function I(e,t){I=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return I(e,t)}function _(e,n){return t(e)||E(e,n)||A(e,n)||g()}function N(e){return t(e)||m(e)||A(e)||g()}function b(e){return n(e)||m(e)||A(e)||h()}function T(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function A(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 x(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(x=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:[]},a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=o(0),a["throw"]=o(1),a["return"]=o(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(e){return function(t){return c([e,t])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,o[0]&&(i=0)),i)try{if(n=1,r&&(s=o[0]&2?r["return"]:o[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,o[1])).done)return s;if(r=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;r=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){i.label=o[1];break}if(o[0]===6&&i.label<s[1]){i.label=s[1];s=o;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(o);break}if(s[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];r=0}finally{n=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}var G=Object.defineProperty;var P=function(e,t,n){return t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};var w=function(e,t){return G(e,"name",{value:t,configurable:!0})};var M=function(e,t,n){return P(e,(typeof t==="undefined"?"undefined":T(t))!="symbol"?t+"":t,n)};import{ApolloServer as L}from"@apollo/server";import{expressMiddleware as j}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as k}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as U,ApolloServerPluginLandingPageProductionDefault as F}from"@apollo/server/plugin/landingPage/default";var V=function(e){return e.Error="error",e.Warning="warning",e}({});import q from"chalk";import Y from"consola";import{GraphQLError as K}from"graphql";var H=".cyberskill-storage";import B from"@dotenvx/dotenvx";import{bool as W,cleanEnv as Q,str as J}from"envalid";import z from"os";import $ from"path";import X from"process";var Z=function(e){return e.PRODUCTION="production",e.STAGING="staging",e.DEVELOPMENT="development",e}({});var ee=!1;function et(){X.env.NODE_ENV!==Z.PRODUCTION&&!ee&&(B.config(),ee=!0)}w(et,"loadEnvFile");function en(){et();var e=Q(X.env,{CWD:J({default:X.cwd()}),DEBUG:W({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:J({default:$.join(z.homedir(),H)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}w(en,"getEnv");var er={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 es=en();function ei(e){var t=e.message,n=e.status,r=n===void 0?er.INTERNAL_SERVER_ERROR:n,s=e.type,i=s===void 0?"graphql":s;var a;var o=(a=t!==null&&t!==void 0?t:r.MESSAGE)!==null&&a!==void 0?a:"Internal server error";throw i==="graphql"?new K(o,{extensions:{code:r.CODE}}):new Error(o)}w(ei,"throwError");es.DEBUG||(Y.level=4);function ea(e){var t=q[e];return typeof t=="function"?t:q.green}w(ea,"chalkKeyword");var eo={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(ea(n)("Rule:")," ").concat(s)),Y.log(" ".concat(ea(n)("Message:")," ").concat(i))}),Y.box(ea(n)("".concat(e," : ").concat(t.length))),Y.log(q.gray("─".repeat(40)))}};function ec(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,s=r===void 0?!0:r,i=n.returnValue,a=n.callback,o=p(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return s&&eo.error(o.message),a&&typeof a=="function"&&a(o),i||{success:!1,message:o.message,code:er.INTERNAL_SERVER_ERROR.CODE}}w(ec,"catchError");function eu(e){return new L(y({schema:e.schema,plugins:[e.isDev?U():F(),k({httpServer:e.server})].concat(b(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),eo.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}w(eu,"createApolloServer");import el from"process";import{hideBin as ed}from"yargs/helpers";import ef from"yargs/yargs";var ep={name:"@cyberskill/shared",type:"module",version:"1.197.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"},"./config/vitest":{types:"./dist/config/vitest/index.d.ts",import:"./dist/config/vitest/index.js",require:"./dist/config/vitest/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/upload":{types:"./dist/node/upload/index.d.ts",import:"./dist/node/upload/index.js",require:"./dist/node/upload/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-client-nextjs":{types:"./dist/react/apollo-client-nextjs/index.d.ts",import:"./dist/react/apollo-client-nextjs/index.js",require:"./dist/react/apollo-client-nextjs/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/userback":{types:"./dist/react/userback/index.d.ts",import:"./dist/react/userback/index.js",require:"./dist/react/userback/index.cjs"},"./react/index.css":{import:"./dist/react/index.css",require:"./dist/react/index.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",commitlint:"tsx src/node/cli/index.ts commitlint",dev:"tsup --watch",inspect:"tsx src/node/cli/index.ts inspect",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",ready:"tsx src/node/cli/index.ts ready",reset:"tsx src/node/cli/index.ts reset","test:e2e":"tsx src/node/cli/index.ts test:e2e","test:unit":"tsx src/node/cli/index.ts test:unit"},dependencies:{"@antfu/eslint-config":"4.16.1","@apollo/client":"3.13.8","@apollo/client-integration-nextjs":"0.12.2","@apollo/server":"4.12.2","@dotenvx/dotenvx":"1.45.1","@eddeee888/gcg-typescript-resolver-files":"0.12.1","@graphql-codegen/cli":"5.0.7","@graphql-codegen/client-preset":"4.8.3","@nestjs/common":"11.1.3","@nestjs/core":"11.1.3","@userback/widget":"0.3.11","@vitejs/plugin-react-swc":"3.10.2","body-parser":"2.2.0",chalk:"5.4.1",clsx:"2.1.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",envalid:"8.0.0",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.2.0",graphql:"16.11.0","graphql-ws":"6.0.5",i18next:"25.2.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3",mongodb:"6.17.0",mongoose:"8.16.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.1","next-intl":"4.3.1","node-fetch":"3.3.2","node-persist":"4.0.4",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.3",sass:"1.89.2",slugify:"1.6.6",unorm:"1.6.0",uuid:"11.1.0",vite:"7.0.0",ws:"8.18.3",yargs:"18.0.0"},devDependencies:{"@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@eslint-react/eslint-plugin":"1.52.2","@eslint/config-inspector":"1.1.0","@microsoft/api-extractor":"7.52.8","@next/eslint-plugin-next":"15.3.4","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@types/body-parser":"1.19.6","@types/compression":"1.8.1","@types/cookie-parser":"1.4.9","@types/cors":"2.8.19","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.2","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/node":"24.0.7","@types/node-persist":"3.1.8","@types/react":"19.1.8","@types/react-dom":"19.1.6","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33","@vitest/browser":"3.2.4","esbuild-sass-plugin":"3.3.1",eslint:"9.30.0","eslint-config-next":"15.3.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20","lint-staged":"16.1.2","node-modules-inspector":"1.0.0",playwright:"1.53.1",postcss:"8.5.6","postcss-modules":"6.0.1","simple-git-hooks":"2.13.0",tsup:"8.5.0",tsx:"4.20.3",typescript:"5.8.3",vitest:"3.2.4"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"}};var em=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as eE}from"child_process";import eg from"process";import*as eh from"util";var ey=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});import ev from"node-fetch";import eS from"fs-extra";import eO from"path";var eC=eS,eD=eS.lstatSync,eI=eS.readdirSync,e_=eS.mkdirSync,eN=eS.readFileSync,eb=eS.unlinkSync,eT=eS.statSync,eA=eS.createWriteStream,ex=eS.readJsonSync;function eR(e,t,n){eS.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}w(eR,"writeFileSync");function eG(e,t,n){eS.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}w(eG,"appendFileSync");function eP(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return eS.pathExistsSync(e)})}w(eP,"pathExistsSync");function ew(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eP(e)&&eS.removeSync(e)})}w(ew,"removeSync");function eM(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.extensions,s=O(n,["extensions"]);eS.copySync(e,t,y({filter:w(function(e){return eT(e).isDirectory()||!r||r.length===0?!0:r.includes(eO.extname(e))},"filter")},s))}w(eM,"copySync");import eL from"fs-extra";import ej from"path";var ek=en(),eU=ej,eF=eU.dirname;function eV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eU).resolve.apply(r,[ek.CWD].concat(b(t)))}w(eV,"resolveWorkingPath");function eq(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eU).resolve.apply(r,b(t))}w(eq,"resolve");function eY(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eU).join.apply(r,b(t))}w(eY,"join");var eK=en(),eH=eK.CWD,eB="@cyberskill/shared",eW="node_modules",eQ="dist",eJ="public",ez="package.json",e$="package-lock.json",eX="tsconfig.json",eZ=".gitignore",e0=".simple-git-hooks.json",e1="pnpm-lock.yaml",e2=".git/hooks/",e4=".git/COMMIT_EDITMSG",e3=".migrate-mongo.config.js",e5=function(){var e=eL.readJsonSync(eV(ez)).name===eB?eH:eY(eH,eW,eB);return eY(e,eQ)}(),e8="cyberskill",e6="src/node/cli/index.ts",e7="eslint",e9="eslint",te="vitest",tt="playwright",tn="vitest",tr="@commitlint/cli",ts="@commitlint/config-conventional",ti="commitlint",ta="lint-staged",to="lint-staged",tc="typescript",tu="tsc",tl="tsx",td="git",tf="pnpm",tp="pnpm exec",tm="simple-git-hooks",tE="simple-git-hooks",tg="@eslint/config-inspector",th="eslint-config-inspector",ty="node-modules-inspector",tv="node-modules-inspector",tS="migrate-mongo",tO="./node_modules/migrate-mongo/bin/migrate-mongo",tC={CYBERSKILL_DIRECTORY:e5,WORKING_DIRECTORY:eH,PUBLIC_DIRECTORY:eV(eJ),TS_CONFIG:eV(eX),GIT_IGNORE:eV(eZ),GIT_HOOK:eV(e2),GIT_COMMIT_MSG:eV(e4),SIMPLE_GIT_HOOKS_JSON:eV(e0),PACKAGE_JSON:eV(ez),PACKAGE_LOCK_JSON:eV(e$),PNPM_LOCK_YAML:eV(e1),NODE_MODULES:eV(eW),MIGRATE_MONGO_CONFIG:eV(e3),LINT_STAGED_CONFIG:eV("".concat(e5,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:eV("".concat(e5,"/config/commitlint/index.js")),VITEST_UNIT_CONFIG:eV("".concat(e5,"/config/vitest/vitest.unit.js")),VITEST_UNIT_SETUP_CONFIG:eV("".concat(e5,"/config/vitest/vitest.unit.setup.js")),VITEST_E2E_CONFIG:eV("".concat(e5,"/config/vitest/vitest.e2e.js"))};function tD(e){var t=e.isCurrentProject;return y({"pre-commit":to,"commit-msg":ti},t&&{"pre-push":tH("".concat(td," pull"))})}w(tD,"createGitHooksConfig");function tI(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 em.CLI:return[3,1];case em.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,tR(s,{install:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,tW(tH("".concat(tp," ").concat(r))))];case 4:return[2,tW(tH(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}w(tI,"buildCommand");var t_={simpleGitHooks:tI({type:em.CLI,packages:[{name:tm,type:ey.DEV_DEPENDENCY}],command:tE}),eslintInspect:tI({type:em.CLI,packages:[{name:tg,type:ey.DEV_DEPENDENCY}],command:th}),nodeModulesInspect:tI({type:em.CLI,packages:[{name:ty,type:ey.DEV_DEPENDENCY}],command:tv}),eslintCheck:tI({type:em.CLI,packages:[{name:e7,type:ey.DEV_DEPENDENCY}],command:"".concat(e9," ").concat(tC.WORKING_DIRECTORY," --no-cache")}),eslintFix:tI({type:em.CLI,packages:[{name:e7,type:ey.DEV_DEPENDENCY}],command:"".concat(e9," ").concat(tC.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:tI({type:em.CLI,packages:[{name:tc,type:ey.DEV_DEPENDENCY}],command:"".concat(tu," -p ").concat(tC.TS_CONFIG," --noEmit")}),testUnit:tI({type:em.CLI,packages:[{name:te,type:ey.DEV_DEPENDENCY}],command:"".concat(tn," --config ").concat(tC.VITEST_UNIT_CONFIG)}),testE2e:tI({type:em.CLI,packages:[{name:te,type:ey.DEV_DEPENDENCY}],command:"".concat(tn," --config ").concat(tC.VITEST_E2E_CONFIG)}),mongoMigrateCreate:w(function(e){return tI({type:em.CLI,packages:[{name:tl,type:ey.DEPENDENCY},{name:tS,type:ey.DEPENDENCY}],command:"".concat(tl," ").concat(tO," create ").concat(e," -f ").concat(tC.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:tI({type:em.CLI,packages:[{name:tl,type:ey.DEPENDENCY},{name:tS,type:ey.DEPENDENCY}],command:"".concat(tl," ").concat(tO," up -f ").concat(tC.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:tI({type:em.CLI,packages:[{name:tl,type:ey.DEPENDENCY},{name:tS,type:ey.DEPENDENCY}],command:"".concat(tl," ").concat(tO," down -f ").concat(tC.MIGRATE_MONGO_CONFIG)}),commitLint:tI({type:em.CLI,packages:[{name:tr,type:ey.DEV_DEPENDENCY},{name:ts,type:ey.DEV_DEPENDENCY}],command:"".concat(ti," --edit ").concat(tC.GIT_COMMIT_MSG," --config ").concat(tC.COMMITLINT_CONFIG)}),lintStaged:tI({type:em.CLI,packages:[{name:ta,type:ey.DEV_DEPENDENCY}],command:"".concat(to," --config ").concat(tC.LINT_STAGED_CONFIG)}),configureGitHook:tI({type:em.STRING,command:"".concat(td," config core.hooksPath ").concat(tC.GIT_HOOK)}),build:tI({type:em.STRING,command:"".concat(tf," run --if-present build")}),pnpmInstallStandard:tI({type:em.STRING,command:"".concat(tf," install --ignore-scripts")}),pnpmInstallLegacy:tI({type:em.STRING,command:"".concat(tf," install --ignore-scripts --legacy-peer-deps")}),pnpmInstallForce:tI({type:em.STRING,command:"".concat(tf," install --ignore-scripts --force")}),pnpmPruneStore:tI({type:em.STRING,command:"".concat(tf," store prune")}),pnpmCleanCache:tI({type:em.STRING,command:"".concat(tf," cache delete")})};var tN=en();function tb(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,ev("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,ec(s)];case 4:return[2]}})})()}w(tb,"getLatestPackageVersion");function tT(e){return i(function(){var t,n,r,s,i,a,o,c,u,l,d,f,p,m,E,g,h,y,v,S,O,C,D,I;return R(this,function(_){switch(_.label){case 0:_.trys.push([0,2,,3]);if(!e){if(eP(tC.PACKAGE_JSON)){t=ex(tC.PACKAGE_JSON),n=t.name,r=n===void 0?"":n,s=t.version,i=s===void 0?"":s;return[2,{success:!0,result:{name:r,currentVersion:i,latestVersion:i,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:!1,isDevDependency:!1,installedPath:tC.PACKAGE_JSON,file:t}}]}return[2,{success:!0,result:{name:"",currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:!1,isDevDependency:!1,installedPath:"",file:{}}}]}if(!eP(tC.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===ey.DEPENDENCY,isDevDependency:e.type===ey.DEV_DEPENDENCY,installedPath:"",file:{}}}];a=ex(tC.PACKAGE_JSON),o=a.name,c=a.version,u=c===void 0?"":c,l=a.dependencies,d=l===void 0?{}:l,f=a.devDependencies,p=f===void 0?{}:f;if(e.name===o)return[2,{success:!0,result:{name:o,currentVersion:u,latestVersion:u,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===ey.DEPENDENCY,isDevDependency:e.type===ey.DEV_DEPENDENCY,installedPath:tC.PACKAGE_JSON,file:a}}];m=e.name in d,E=e.name in p;return[4,tb(e.name)];case 1:g=_.sent();if(!g.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:m,isDevDependency:E,installedPath:"",file:{}}}];if(!m&&!E)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:g.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===ey.DEPENDENCY,isDevDependency:e.type===ey.DEV_DEPENDENCY,installedPath:"",file:{}}}];v=(y=(h=d[e.name])!==null&&h!==void 0?h:p[e.name])!==null&&y!==void 0?y:"",S=eY(tN.CWD,eW,e.name,ez);if(!eP(S))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:g.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:m,isDevDependency:E,installedPath:"",file:{}}}];O=ex(S),C=O.version,D=C===void 0?"":C;return[2,v!==D?{success:!0,result:{name:e.name,currentVersion:D||v,latestVersion:g.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:m,isDevDependency:E,installedPath:S,file:O}}:{success:!0,result:{name:e.name,currentVersion:v,latestVersion:g.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:v===g.result,isDependency:m,isDevDependency:E,installedPath:S,file:O}}];case 2:I=_.sent();return[2,ec(I)];case 3:return[2]}})})()}w(tT,"getPackage");function tA(e){return i(function(){var t,n,r,s,i;return R(this,function(a){try{;r=ex(tC.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),eR(tC.PACKAGE_JSON,JSON.stringify(r,null,4)),eo.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){ec(e)}return[2]})})()}w(tA,"updatePackage");function tx(){return i(function(){var e,t,n,r,s,i,a,o,c,u,l,d,f;return R(this,function(p){switch(p.label){case 0:p.trys.push([0,12,,13]);e=[{command:w(function(){return t_.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:w(function(){return t_.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:w(function(){return t_.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];a=i.value,o=a.command,c=a.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,o()];case 4:u=p.sent();return[4,tJ("".concat(c," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();ec(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:f=p.sent();ec(f);return[3,13];case 13:return[2]}})})()}w(tx,"installDependencies");function tR(e,t){return i(function(){var n,r,s,i,a,o,c,u,l,d,f,p,m,E,g,h,y;return R(this,function(v){switch(v.label){case 0:v.trys.push([0,15,,16]);if(!eP(tC.PACKAGE_JSON)){eo.error("package.json not found. Aborting setup.");return[2]}return[4,Promise.all(e.map(tT))];case 1:s=v.sent().filter(function(e){return e.success&&!!e.result&&!e.result.isCurrentProject}).map(function(e){return e.result}),i=s.filter(function(e){return!e.isInstalled}),a=s.filter(function(e){return!e.isUpToDate}),o=[];(t===null||t===void 0?void 0:t.install)&&i.length>0&&(n=o).push.apply(n,b(i.map(tA))),(t===null||t===void 0?void 0:t.update)&&a.length>0&&(r=o).push.apply(r,b(a.map(tA)));c=o.length>0;if(!c)return[3,6];return[4,Promise.all(o)];case 2:v.sent();return[4,tx()];case 3:v.sent();u=["Running ESLint with auto-fix"];return[4,t_.eslintFix()];case 4:return[4,tJ.apply(void 0,u.concat([v.sent()]))];case 5:c=v.sent();v.label=6;case 6:c;d=true,f=false,p=undefined;v.label=7;case 7:v.trys.push([7,12,13,14]);m=((l=t===null||t===void 0?void 0:t.callbacks)!==null&&l!==void 0?l:[])[Symbol.iterator]();v.label=8;case 8:if(!!(d=(E=m.next()).done))return[3,11];g=E.value;return[4,g()];case 9:v.sent();v.label=10;case 10:d=true;return[3,8];case 11:return[3,14];case 12:h=v.sent();f=true;p=h;return[3,14];case 13:try{if(!d&&m.return!=null){m.return()}}finally{if(f){throw p}}return[7];case 14:return[3,16];case 15:y=v.sent();ec(y);return[3,16];case 16:return[2]}})})()}w(tR,"setupPackages");import tG from"node-persist";var tP=en();function tw(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=tG.defaultInstance;if(e)return[3,2];return[4,tG.init({dir:tP.CYBERSKILL_STORAGE_DIRECTORY})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}w(tw,"initNodePersist");var tM={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,tw()];case 1:r.sent();return[4,tG.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,ec(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,tw()];case 1:r.sent();return[4,tG.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();ec(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,tw()];case 1:n.sent();return[4,tG.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();ec(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,tw()];case 1:n.sent();return[4,tG.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(eo.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,ec(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return R(this,function(t){try{return[2,"".concat(tP.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,ec(e,{returnValue:null})]}return[2]})})()}};var tL=en(),tj=eh.promisify(eE);function tk(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:return[4,tT()];case 1:e=t.sent();return[2,e.success?e.result.name:Date.now().toString()]}})})()}w(tk,"getPackageName");function tU(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:if(e.length===0)return[2];return[4,tk()];case 1:t=r.sent();r.label=2;case 2:r.trys.push([2,4,,5]);return[4,tM.set(t,e)];case 3:r.sent(),setTimeout(function(){return i(function(){var e;return R(this,function(n){switch(n.label){case 0:return[4,tM.getLogLink(t)];case 1:e=n.sent();e&&eo.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},0);return[3,5];case 4:n=r.sent();ec(n);return[3,5];case 5:return[2]}})})()}w(tU,"saveErrorListToStorage");function tF(){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,tk()];case 1:e=r.sent();return[4,tM.get(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:[]];case 3:n=r.sent();return[2,ec(n,{returnValue:[]})];case 4:return[2]}})})()}w(tF,"getStoredErrorLists");function tV(){return i(function(){var e,t;return R(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tk()];case 1:e=n.sent();return[4,tM.remove(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();ec(t);return[3,4];case 4:return[2]}})})()}w(tV,"clearAllErrorLists");function tq(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.+)$/,a=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var o,c,u,l,d;var f=s.exec(e)||[],p=i.exec(e)||[],m=a.exec(e)||[];var E,g,h,y,v,S;f.length&&r?t.push({file:r,position:"".concat(f[1],":").concat(f[2]),type:f[3]===V.Error?V.Error:V.Warning,message:(E=f===null||f===void 0?void 0:(o=f[4])===null||o===void 0?void 0:o.trim())!==null&&E!==void 0?E:"",rule:(g=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):p.length?t.push({file:(h=p===null||p===void 0?void 0:p[1])!==null&&h!==void 0?h:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===V.Error?V.Error:V.Warning,message:(y=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&y!==void 0?y:""}):m.length?t.push({file:"commitlint",type:V.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&&tU(t),tL.DEBUG&&n.length&&(eo.warn("Unmatched lines:"),n.forEach(function(e){return eo.info(" ".concat(e))}))}w(tq,"parseTextErrors");function tY(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,a=e.ruleId,o=e.message;n.push({type:r===2?V.Error:V.Warning,file:t,position:"".concat(s,":").concat(i),rule:a,message:o})})}),n.length&&tU(n)}catch(t){tq(e)}}w(tY,"parseCommandOutput");function tK(e){return i(function(e){var t,n,r,s,i,a,o,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]:tY;n=new AbortController;eg.on("SIGINT",function(){eo.warn("Process interrupted. Terminating..."),n.abort(),eg.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tj(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:a=d.sent();o=a.stdout,c=a.stderr,u=a.message;[o,c].forEach(function(e){return e&&t(e)}),!c&&!o&&eo.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}w(tK,"executeCommand");function tH(e){return{raw:!0,cmd:e}}w(tH,"rawCommand");function tB(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(tp," ").concat(tl," ").concat(e6," ").concat(e):"".concat(tp," ").concat(e8," ").concat(e)}w(tB,"formatCLI");function tW(e,t){return typeof e=="function"?tB(e(t),t):(typeof e==="undefined"?"undefined":T(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tB(e,t):e}w(tW,"formatCommand");function tQ(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:return[4,tT({name:eB})];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=_(e,2),r=t[0],s=t[1];return[r,tW(s,n)]}))]}return[2]}})})()}w(tQ,"resolveCommands");function tJ(e,t){return i(function(){var n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);eo.start("".concat(e)),tL.DEBUG&&eo.info("→ ".concat(t));return[4,tK(t)];case 1:r.sent(),eo.success("".concat(e," done."));return[3,3];case 2:n=r.sent();ec(n);return[3,3];case 3:return[2]}})})()}w(tJ,"runCommand");function tz(){return i(function(){var e,t;return R(this,function(n){switch(n.label){case 0:if(!eP(tC.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,t_.typescriptCheck()];case 1:return[4,tJ.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=eo.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}w(tz,"checkTypescript");function t$(){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,t_.eslintFix()];case 1:return[4,tJ.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,t_.eslintCheck()];case 4:return[4,tJ.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}w(t$,"checkEslint");function tX(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";eo.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}w(tX,"printIssues");function tZ(){return i(function(){return R(this,function(e){setTimeout(function(){return i(function(){var e,t,n;return R(this,function(r){switch(r.label){case 0:return[4,tF()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===V.Error}),n=e.filter(function(e){return e.type===V.Warning});!t.length&&!n.length?eo.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tX("Warnings",n),tX("Errors",t),(t.length>0||n.length>0)&&el.exit(1));return[2]}})})()},0);return[2]})})()}w(tZ,"showCheckResult");function t0(){return i(function(){var e,t,n,r;return R(this,function(s){switch(s.label){case 0:return[4,tV()];case 1:s.sent();return[4,tT({name:eB})];case 2:e=s.sent();if(!e.success){eo.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,5];n=["Building package: ".concat(eB)];return[4,t_.build()];case 3:return[4,tJ.apply(void 0,n.concat([s.sent()]))];case 4:t=s.sent();s.label=5;case 5:t;r=["Executing lint-staged"];return[4,t_.lintStaged()];case 6:return[4,tJ.apply(void 0,r.concat([s.sent()]))];case 7:s.sent(),tZ();return[2]}})})()}w(t0,"lintStaged");function t1(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,t_.eslintInspect()];case 1:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}w(t1,"inspectLint");function t2(){return i(function(){return R(this,function(e){switch(e.label){case 0:return[4,tV()];case 1:e.sent();return[4,Promise.all([tz(),t$()])];case 2:e.sent(),tZ();return[2]}})})()}w(t2,"lintCheck");function t4(){return i(function(){return R(this,function(e){switch(e.label){case 0:return[4,tV()];case 1:e.sent();return[4,Promise.all([tz(),t$(!0)])];case 2:e.sent(),tZ();return[2]}})})()}w(t4,"lintFix");function t3(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:return[4,tV()];case 1:t.sent();e=["Validating commit message"];return[4,t_.commitLint()];case 2:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tZ();return[2]}})})()}w(t3,"commitLint");function t5(){return i(function(){var e,t,n,r;return R(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,t_.configureGitHook()];case 1:return[4,tJ.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),ew(tC.GIT_HOOK);return[4,tQ(tD)];case 3:t=s.sent();eR(tC.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(e0,"\n");eP(tC.GIT_IGNORE)?eN(tC.GIT_IGNORE,"utf-8").split("\n").includes(e0)||eG(tC.GIT_IGNORE,n):eR(tC.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,t_.simpleGitHooks()];case 4:return[4,tJ.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}w(t5,"setupGitHook");function t8(){return i(function(){return R(this,function(e){switch(e.label){case 0:return[4,tx()];case 1:e.sent();return[4,t5()];case 2:e.sent();return[2]}})})()}w(t8,"ready");function t6(){return i(function(){var e,t;return R(this,function(n){switch(n.label){case 0:ew(tC.NODE_MODULES,tC.PNPM_LOCK_YAML);e=["Pruning pnpm store"];return[4,t_.pnpmPruneStore()];case 1:return[4,tJ.apply(void 0,e.concat([n.sent()]))];case 2:n.sent();t=["Clearing pnpm cache"];return[4,t_.pnpmCleanCache()];case 3:return[4,tJ.apply(void 0,t.concat([n.sent()]))];case 4:n.sent();return[4,tx()];case 5:n.sent();return[4,t5()];case 6:n.sent();return[2]}})})()}w(t6,"reset");function t7(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,t_.nodeModulesInspect()];case 1:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}w(t7,"inspect");function t9(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,t_.testUnit()];case 1:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}w(t9,"testUnit");function ne(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,t_.testE2e()];case 1:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}w(ne,"testE2E");function nt(e){return i(function(){var t;return R(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,t_.mongoMigrateCreate(e)];case 1:return[4,tJ.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}w(nt,"mongoMigrateCreate");function nn(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,t_.mongoMigrateUp()];case 1:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}w(nn,"mongoMigrateUp");function nr(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,t_.mongoMigrateDown()];case 1:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}w(nr,"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,ef(ed(el.argv)).scriptName(e8).usage("$0 <command> [options]").command("lint","Check code for linting issues",t2).command("lint:fix","Fix linting issues automatically",t4).command("lint:inspect","View active ESLint configuration",t1).command("lint-staged","Run lint checks on staged files",t0).command("commitlint","Validate commit message format",t3).command("ready","Initialize project and dependencies",t8).command("reset","Reset the project and reinstall dependencies",t6).command("inspect","Analyze installed project dependencies",t7).command("test:unit","Run unit test suite",t9).command("test:e2e","Run end-to-end test suite",ne).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){eo.error("Migration name is required.");return[2]}return[4,nt(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",nn).command("mongo:migrate:down","Rollback last MongoDB migration",nr).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(ep.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();ec(e),el.exit(1);return[3,3];case 3:return[2]}})})()})();import{Router as ns}from"express";import{NestFactory as ni}from"@nestjs/core";import na from"body-parser";import no from"compression";import nc from"cookie-parser";import nu from"cors";import nl from"express";import nd from"express-session";import nf from"express-useragent";function np(e){var t=e.isDev,n=e.whiteList,r=O(e,["isDev","whiteList"]);return y({origin:w(function(e,r){t||!e||(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)}w(np,"createCorsOptions");function nm(e){return nu(np(e))}w(nm,"createCors");function nE(e){return nd(e)}w(nE,"createSession");function ng(e){e.set("trust proxy",1),e.use(nc()),e.use(nl.urlencoded({extended:!0})),e.use(no()),e.use(nf.express())}w(ng,"setupMiddleware");function nh(e,t){t&&(Array.isArray(t)?t:[t]).forEach(function(t){e.use(nl.static(t))})}w(nh,"setupStaticFolders");function ny(e){var t=nl();return ng(t),nh(t,e===null||e===void 0?void 0:e.static),t}w(ny,"createExpress");function nv(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:return[4,ni.create(e.module)];case 1:r=s.sent();return[2,(ng(r.getHttpAdapter().getInstance()),nh(r.getHttpAdapter().getInstance(),e.static),e.filters&&(t=r).useGlobalFilters.apply(t,b(e.filters)),e.pipes&&(n=r).useGlobalPipes.apply(n,b(e.pipes)),r)]}})})()}w(nv,"createNest");var nS="MONGO_MIGRATE_OPTIONS";import{Collection as nO,Db as nC}from"mongodb";import{Document as nD,Model as nI}from"mongoose";var n_=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){o(this,t);return a(this,t,arguments)}return t}(nC);w(n_,"C_Db");var nN=n_,nb=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){o(this,t);return a(this,t,arguments)}return t}(nD);w(nb,"C_Document");var nT=nb,nA=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){o(this,t);return a(this,t,arguments)}return t}(nI);w(nA,"C_Model");var nx=nA,nR=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){o(this,t);return a(this,t,arguments)}return t}(nO);w(nR,"C_Collection");var nG=nR;import{format as nP}from"date-fns";import nw from"migrate-mongo";import{Document as nM}from"mongoose";import nL from"mongoose-aggregate-paginate-v2";import nj from"mongoose-paginate-v2";import{v4 as nk}from"uuid";import nU from"unorm";var nF={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},nV=Object.entries(nF).reduce(function(e,t){var n=_(t,2),r=n[0],s=n[1];return e[r.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function nq(e){e=nU.nfkc(e);var t=y({},nF,nV);var n=true,r=false,s=undefined;try{for(var i=Object.entries(t)[Symbol.iterator](),a;!(n=(a=i.next()).done);n=true){var o=_(a.value,2),c=o[0],u=o[1];var l="[".concat(c).concat(u.join(""),"]"),d="(".concat([c].concat(b(u)).join("|"),")");e=e.replace(new RegExp(l,"g"),d)}}catch(e){r=true;s=e}finally{try{if(!n&&i.return!=null){i.return()}}finally{if(r){throw s}}}return e}w(nq,"regexSearchMapper");function nY(e){return(typeof e==="undefined"?"undefined":T(e))=="object"&&e!==null&&!Array.isArray(e)}w(nY,"isObject");function nK(e){return JSON.parse(JSON.stringify(e))}w(nK,"deepClone");function nH(e,t){return t.reduce(function(e,t){if(e&&(typeof e==="undefined"?"undefined":T(e))=="object"&&t in e)return e[t]},e)}w(nH,"getNestedValue");function nB(e,t,n){if(t.length===0)return e;var r=N(t),s=r[0],i=r.slice(1);if(i.length===0)return S(y({},e),l({},s,n));var a=e[s];return S(y({},e),l({},s,nB((typeof a==="undefined"?"undefined":T(a))=="object"&&a!==null?a:{},i,n)))}w(nB,"setNestedValue");import nW from"crypto-js";import nQ from"slugify";var nJ=nQ.default||nQ;function nz(e,t){var n=w(function(e){var n,r;return nJ(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(nY(e)){var r={};var s=true,i=false,a=undefined;try{for(var o=Object.entries(e)[Symbol.iterator](),c;!(s=(c=o.next()).done);s=true){var u=_(c.value,2),l=u[0],d=u[1];r[l]=n(d)}}catch(e){i=true;a=e}finally{try{if(!s&&o.return!=null){o.return()}}finally{if(i){throw a}}}return r}return n(e)}w(nz,"generateSlug");function n$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return nW.SHA256(e).toString(nW.enc.Hex).slice(0,t)}w(n$,"generateShortId");var nX={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":T(e))=="object"?p(e,Date)?!1:p(e,Map)||p(e,Set)?e.size===0:p(e,WeakMap)||p(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 nZ={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return nP(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"?nZ.getDateTime():new Date;return{id:nk(),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:nk,unique:!0},isDel:{type:Boolean,default:!1}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,n=e.schema,r=e.virtuals,s=r===void 0?[]:r,i=e.standalone,a=i===void 0?!1:i;var o=new t.Schema(n);return s.forEach(function(e){var t=e.name,n=e.options,r=e.get;var s=o.virtual(t,n);r&&s.get(r)}),a||o.add(nZ.createGenericSchema(t)),o},createModel:function e(e){var t=e.mongoose,n=e.name,r=e.schema,s=e.pagination,i=s===void 0?!1:s,a=e.aggregate,o=a===void 0?!1:a,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 f=nZ.createSchema({mongoose:t,schema:r,virtuals:u});return nZ.applyPlugins(f,[i&&nj,o&&nL]),nZ.applyMiddlewares(f,d),t.model(n,f)},validator:{isRequired:function e(){return function(e){return i(function(){return R(this,function(t){return[2,!nX.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!p(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({},nw),{setConfig:w(function(e){var t="// This file is automatically generated by the Cyberskill CLI.\nmodule.exports = ".concat(JSON.stringify(e,null,4));eR(tC.MIGRATE_MONGO_CONFIG,t);var n="\n".concat(e3,"\n");eP(tC.GIT_IGNORE)?eN(tC.GIT_IGNORE,"utf-8").split("\n").includes(e3)||eG(tC.GIT_IGNORE,n):eR(tC.GIT_IGNORE,n)},"setConfig")}),regexify:function e(e,t){if(!e)return{};var n=nK(e);if(!t||t.length===0)return n;var r=true,s=false,i=undefined;try{for(var a=t[Symbol.iterator](),o;!(r=(o=a.next()).done);r=true){var c=o.value;var u=c.toString().split("."),l=nH(n,u);if(typeof l=="string"&&l.length>0){var d={$regex:".*".concat(nq(l),".*"),$options:"i"};n=nB(n,u,d)}}}catch(e){s=true;i=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(s){throw i}}}return n}},n0=/*#__PURE__*/function(){"use strict";function e(t,n){o(this,e);M(this,"collection");this.collection=t.collection(n)}u(e,[{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=y({},nZ.createGenericFields(),e);return[4,this.collection.insertOne(t)];case 1:return[2,r.sent().acknowledged?{success:!0,message:"Document created successfully",result:t}:{success:!1,message:"Document creation failed",code:er.INTERNAL_SERVER_ERROR.CODE}];case 2:n=r.sent();return[2,ec(n)];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({},nZ.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:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:t}];case 2:r=s.sent();return[2,ec(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:er.NOT_FOUND.CODE}];case 2:n=r.sent();return[2,ec(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,ec(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,ec(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:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document updated successfully",result:n}];case 2:r=s.sent();return[2,ec(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:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents updated successfully",result:n}];case 2:r=s.sent();return[2,ec(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:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document deleted successfully",result:t}];case 2:n=r.sent();return[2,ec(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:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents deleted successfully",result:t}];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}}]);return e}();w(n0,"MongoController");var n1=n0,n2=/*#__PURE__*/function(){"use strict";function e(t){o(this,e);M(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,a;var o=arguments;return R(this,function(c){switch(c.label){case 0:e=o.length>0&&o[0]!==void 0?o[0]:{},t=o.length>1&&o[1]!==void 0?o[1]:{},n=o.length>2&&o[2]!==void 0?o[2]:{},r=o.length>3?o[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:er.NOT_FOUND.CODE}];case 3:a=c.sent();return[2,ec(a)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findAll",value:function e(e){return i(function(){var e,t,n,r,s,i,a;var o=arguments;return R(this,function(c){switch(c.label){case 0:e=o.length>0&&o[0]!==void 0?o[0]:{},t=o.length>1&&o[1]!==void 0?o[1]:{},n=o.length>2&&o[2]!==void 0?o[2]:{},r=o.length>3?o[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:a=c.sent();return[2,ec(a)];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,ec(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,ec(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,ec(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,ec(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 p(e,nM)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 3:r=i.sent();return[2,ec(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(a){switch(a.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]:{};a.label=1;case 1:a.trys.push([1,3,,4]);return[4,this.model.findOneAndUpdate(e,t,y({new:!0},n)).exec()];case 2:r=a.sent();return[2,r?{success:!0,result:r}:{success:!1,message:"Failed to update ".concat(this.getModelName(),"."),code:er.NOT_FOUND.CODE}];case 3:s=a.sent();return[2,ec(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(a){switch(a.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]:{};a.label=1;case 1:a.trys.push([1,3,,4]);r={success:!0};return[4,this.model.updateMany(e,t,n).exec()];case 2:return[2,(r.result=a.sent(),r)];case 3:s=a.sent();return[2,ec(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:er.NOT_FOUND.CODE}];case 3:r=i.sent();return[2,ec(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:er.NOT_FOUND.CODE}:{success:!0,result:n}];case 3:r=i.sent();return[2,ec(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,a;return R(this,function(o){switch(o.label){case 0:o.trys.push([0,6,,7]);n=new Set;r=0;o.label=1;case 1:if(!(r<10))return[3,5];s=n$(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=!o.sent();o.label=3;case 3:if(i)return[2,{success:!0,result:s}];o.label=4;case 4:r++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:er.INTERNAL_SERVER_ERROR.CODE}];case 6:a=o.sent();return[2,ec(a)];case 7:return[2]}})}).call(this)}},{key:"createSlugQuery",value:function e(e){var t=e.slug,n=e.field,r=e.isObject,s=e.filter;var i=y({},s!==null&&s!==void 0?s:{});return r?S(y({},i),{$or:[l({},"slug.".concat(n),t),{slugHistory:{$elemMatch:l({},"slug.".concat(n),t)}}]}):S(y({},i),{$or:[{slug:t},{slugHistory:t}]})}},{key:"createUniqueSlug",value:function e(e){return i(function(e){var t,n,r,s,i,a,o;return R(this,function(c){switch(c.label){case 0:t=e.slug,n=e.field,r=e.isObject,s=e.filter;i=nz(t),a=i,o=1;c.label=1;case 1:return[4,this.model.exists(this.createSlugQuery({slug:a,field:n,isObject:r,filter:s}))];case 2:if(!c.sent())return[3,4];a="".concat(i,"-").concat(o++);c.label=3;case 3:return[3,1];case 4:return[2,a]}})}).apply(this,arguments)}},{key:"createSlug",value:function e(e){return i(function(e){var t,n,r,s,a,o,c,u,l,d;return R(this,function(f){switch(f.label){case 0:t=this;n=e.field,r=e.from,s=e.filter;f.label=1;case 1:f.trys.push([1,6,,7]);a=r[n];if(!nY(a))return[3,3];c={success:!0};u=Object.fromEntries;return[4,Promise.all(Object.entries(a).map(function(e){var n=_(e,2),r=n[0],a=n[1];return i(function(){var e;return R(this,function(t){switch(t.label){case 0:return[4,this.createUniqueSlug({slug:a,field:r,isObject:!0,filter:s})];case 1:e=t.sent();return[2,[r,e]]}})}).call(t)}))];case 2:o=(c.result=u.apply(Object,[f.sent()]),c);return[3,5];case 3:l={success:!0};return[4,this.createUniqueSlug({slug:a,field:n,isObject:!1,filter:s})];case 4:o=(l.result=f.sent(),l);f.label=5;case 5:return[2,o];case 6:d=f.sent();return[2,ec(d)];case 7:return[2]}})}).apply(this,arguments)}},{key:"checkSlug",value:function e(e){return i(function(e){var t,n,r,s,i,a,o,c,u,l,d,f,p,m,E,g;return R(this,function(h){switch(h.label){case 0:t=e.slug,n=e.field,r=e.from,s=e.filter;h.label=1;case 1:h.trys.push([1,12,,13]);i=r[n];if(!nY(i))return[3,10];a=true,o=false,c=undefined;h.label=2;case 2:h.trys.push([2,7,8,9]);u=Object.values(i)[Symbol.iterator]();h.label=3;case 3:if(!!(a=(l=u.next()).done))return[3,6];d=l.value;f=nz(d);return[4,this.model.exists(this.createSlugQuery({slug:f,field:n,isObject:!0,filter:s}))];case 4:if(h.sent())return[2,{success:!0,result:!0}];h.label=5;case 5:a=true;return[3,3];case 6:return[3,9];case 7:p=h.sent();o=true;c=p;return[3,9];case 8:try{if(!a&&u.return!=null){u.return()}}finally{if(o){throw c}}return[7];case 9:return[2,{success:!0,result:!1}];case 10:m=nz(t);E={success:!0};return[4,this.model.exists(this.createSlugQuery({slug:m,field:n,isObject:!1,filter:s}))];case 11:return[2,(E.result=h.sent()!==null,E)];case 12:g=h.sent();return[2,ec(g)];case 13:return[2]}})}).apply(this,arguments)}},{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,ec(n)];case 3:return[2]}})}).call(this)}}]);return e}();w(n2,"MongooseController");var n4=n2;var n3=function(e){return e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.DOCUMENT="DOCUMENT",e.OTHER="OTHER",e}({});function n5(e){return i(function(){return R(this,function(t){return[2,new Promise(function(t,n){var r=0;e.on("data",function(e){r+=e.length}),e.on("end",function(){return t(r)}),e.on("error",n)})]})})()}w(n5,"getFileSizeFromStream");function n8(e,t){var n=e.lastIndexOf(".");if(n===-1)return!1;var r=e.substring(n+1).toLowerCase();return t.includes(r)}w(n8,"validateFileExtension");function n6(e,t,n){var r=e.filename,s=e.fileSize,i=t[n],a=i.allowedExtensions,o=i.sizeLimit;if(!n8(r,a))return{isValid:!1,error:"File extension not allowed for ".concat(n.toLowerCase()," files. Allowed extensions: ").concat(a.join(", "))};if(s!==void 0&&s>o){var c=Math.round(o/1048576);return{isValid:!1,error:"File size exceeds limit for ".concat(n.toLowerCase()," files. Maximum size: ").concat(c,"MB")}}return{isValid:!0}}w(n6,"validateUpload");function n7(e){var t;return y({},(t={},l(t,n3.IMAGE,{allowedExtensions:["jpg","jpeg","png","gif","webp","svg"],sizeLimit:5242880}),l(t,n3.VIDEO,{allowedExtensions:["mp4","avi","mov","wmv","flv","webm"],sizeLimit:524288e3}),l(t,n3.DOCUMENT,{allowedExtensions:["pdf","doc","docx","txt","rtf"],sizeLimit:0xa00000}),l(t,n3.OTHER,{allowedExtensions:["zip","rar","tar","gz"],sizeLimit:5242880}),t),e)}w(n7,"createUploadConfig");function n9(e){return i(function(){var t,n,r,s,i,a,o,c,u,l,d,f,m,E,g,h,y,v,S,O,C;return R(this,function(D){switch(D.label){case 0:t=e.path,n=e.file,r=e.config,s=e.type;if(!t||typeof t!="string")return[2,{success:!1,message:"Invalid path provided",result:""}];if(!n||(typeof n==="undefined"?"undefined":T(n))!="object")return[2,{success:!1,message:"Invalid file provided",result:""}];if(r){i=[n3.IMAGE,n3.VIDEO,n3.DOCUMENT,n3.OTHER];a=true,o=false,c=undefined;try{for(u=i[Symbol.iterator]();!(a=(l=u.next()).done);a=true){d=l.value;if(!r[d]||!Array.isArray(r[d].allowedExtensions)||r[d].allowedExtensions.length===0)return[2,{success:!1,message:"Invalid config for ".concat(d.toLowerCase()," files"),result:""}];if(typeof r[d].sizeLimit!="number"||r[d].sizeLimit<=0)return[2,{success:!1,message:"Invalid size limit for ".concat(d.toLowerCase()," files"),result:""}]}}catch(e){o=true;c=e}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(o){throw c}}}}D.label=1;case 1:D.trys.push([1,7,,8]);return[4,n];case 2:return[4,D.sent().file];case 3:f=D.sent(),m=f.filename,E=f.createReadStream;if(!r)return[3,5];g=E();return[4,n5(g)];case 4:h=D.sent(),y=n6({filename:m,fileSize:h},r,s);if(!y.isValid)return[2,{success:!1,message:y.error||"File validation failed",result:""}];D.label=5;case 5:v=eF(t);eP(v)||e_(v,{recursive:!0});S=E(),O=eA(t);S.pipe(O);return[4,new Promise(function(e,t){O.on("finish",function(){return e()}),O.on("error",t),S.on("error",t)})];case 6:return[2,(D.sent(),{success:!0,message:"File uploaded successfully",result:t})];case 7:C=D.sent();return[2,{success:!1,message:p(C,Error)?C.message:"File upload failed",result:""}];case 8:return[2]}})})()}w(n9,"upload");import{useServer as re}from"graphql-ws/use/ws";import{WebSocketServer as rt}from"ws";function rn(e){return new rt({server:e.server,path:e.path})}w(rn,"createWSServer");function rr(e){return re({schema:e.schema},e.server)}w(rr,"initGraphQLWS");export{eQ as BUILD_DIRECTORY,ti as COMMIT_LINT_CLI,ts as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,tr as COMMIT_LINT_PACKAGE_NAME,e8 as CYBERSKILL_CLI,e6 as CYBERSKILL_CLI_PATH,e5 as CYBERSKILL_DIRECTORY,eB as CYBERSKILL_PACKAGE_NAME,nG as C_Collection,nN as C_Db,nT as C_Document,nx as C_Model,e9 as ESLINT_CLI,th as ESLINT_INSPECT_CLI,tg as ESLINT_INSPECT_PACKAGE_NAME,e7 as ESLINT_PACKAGE_NAME,em as E_CommandType,V as E_IssueType,ey as E_PackageType,n3 as E_UploadType,td as GIT_CLI,e4 as GIT_COMMIT_EDITMSG,e2 as GIT_HOOK,eZ as GIT_IGNORE,to as LINT_STAGED_CLI,ta as LINT_STAGED_PACKAGE_NAME,tO as MIGRATE_MONGO_CLI,e3 as MIGRATE_MONGO_CONFIG,tS as MIGRATE_MONGO_PACKAGE_NAME,nS as MONGO_MIGRATE_OPTIONS,n1 as MongoController,n4 as MongooseController,eW as NODE_MODULES,tv as NODE_MODULES_INSPECT_CLI,ty as NODE_MODULES_INSPECT_PACKAGE_NAME,ez as PACKAGE_JSON,e$ as PACKAGE_LOCK_JSON,tC as PATH,tt as PLAYWRIGHT_PACKAGE_NAME,tf as PNPM_CLI,tp as PNPM_EXEC_CLI,e1 as PNPM_LOCK_YAML,eJ as PUBLIC_DIRECTORY,ns as Router,tm as SIMPLE_GIT_HOOKS_PACKAGE_NAME,tE as SIMPLE_GIT_HOOK_CLI,e0 as SIMPLE_GIT_HOOK_JSON,eX as TSCONFIG_JSON,tu as TSC_CLI,tc as TSC_PACKAGE_NAME,tl as TSX_CLI,tn as VITEST_CLI,te as VITEST_PACKAGE_NAME,eH as WORKING_DIRECTORY,nL as aggregatePaginate,eG as appendFileSync,na as bodyParser,ec as catchError,tV as clearAllErrorLists,t_ as command,eM as copySync,eu as createApolloServer,nm as createCors,np as createCorsOptions,ny as createExpress,tD as createGitHooksConfig,nv as createNest,nE as createSession,n7 as createUploadConfig,rn as createWSServer,eA as createWriteStream,eF as dirname,nl as express,j as expressMiddleware,tW as formatCommand,eC as fs,tb as getLatestPackageVersion,tT as getPackage,tF as getStoredErrorLists,rr as initGraphQLWS,tx as installDependencies,eY as join,eo as log,eD as lstatSync,e_ as mkdirSync,nZ as mongo,nj as mongoosePaginate,eU as path,eP as pathExistsSync,tH as rawCommand,eN as readFileSync,ex as readJsonSync,eI as readdirSync,ew as removeSync,eq as resolve,tQ as resolveCommands,eV as resolveWorkingPath,tJ as runCommand,tR as setupPackages,eT as statSync,tM as storage,ei as throwError,eb as unlinkSync,tA as updatePackage,n9 as upload,eR 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,a){try{var o=e[i](a);var c=o.value}catch(e){n(e);return}if(o.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 a=e.apply(t,n);function o(e){s(a,r,i,o,c,"next",e)}function c(e){s(a,r,i,o,c,"throw",e)}o(undefined)})}}function a(e,t,n){t=d(t);return D(e,x()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function o(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 f(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)I(e,t)}function p(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 a,o;try{for(n=n.call(e);!(s=(a=n.next()).done);s=true){r.push(a.value);if(t&&r.length===t)break}}catch(e){i=true;o=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw o}}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=C(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 C(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 D(e,t){if(t&&(T(t)==="object"||typeof t==="function")){return t}return r(e)}function I(e,t){I=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return I(e,t)}function _(e,n){return t(e)||E(e,n)||A(e,n)||g()}function N(e){return t(e)||m(e)||A(e)||g()}function b(e){return n(e)||m(e)||A(e)||h()}function T(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function A(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 x(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(x=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:[]},a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=o(0),a["throw"]=o(1),a["return"]=o(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(e){return function(t){return c([e,t])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,o[0]&&(i=0)),i)try{if(n=1,r&&(s=o[0]&2?r["return"]:o[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,o[1])).done)return s;if(r=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;r=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){i.label=o[1];break}if(o[0]===6&&i.label<s[1]){i.label=s[1];s=o;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(o);break}if(s[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];r=0}finally{n=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}var G=Object.defineProperty;var P=function(e,t,n){return t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};var w=function(e,t){return G(e,"name",{value:t,configurable:!0})};var M=function(e,t,n){return P(e,(typeof t==="undefined"?"undefined":T(t))!="symbol"?t+"":t,n)};import{ApolloServer as L}from"@apollo/server";import{expressMiddleware as j}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as k}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as U,ApolloServerPluginLandingPageProductionDefault as F}from"@apollo/server/plugin/landingPage/default";var V=function(e){return e.Error="error",e.Warning="warning",e}({});import q from"chalk";import Y from"consola";import{GraphQLError as K}from"graphql";var H=".cyberskill-storage";import B from"@dotenvx/dotenvx";import{bool as W,cleanEnv as Q,str as J}from"envalid";import z from"os";import $ from"path";import X from"process";var Z=function(e){return e.PRODUCTION="production",e.STAGING="staging",e.DEVELOPMENT="development",e}({});var ee=!1;function et(){X.env.NODE_ENV!==Z.PRODUCTION&&!ee&&(B.config(),ee=!0)}w(et,"loadEnvFile");function en(){et();var e=Q(X.env,{CWD:J({default:X.cwd()}),DEBUG:W({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:J({default:$.join(z.homedir(),H)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}w(en,"getEnv");var er={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 es=en();function ei(e){var t=e.message,n=e.status,r=n===void 0?er.INTERNAL_SERVER_ERROR:n,s=e.type,i=s===void 0?"graphql":s;var a;var o=(a=t!==null&&t!==void 0?t:r.MESSAGE)!==null&&a!==void 0?a:"Internal server error";throw i==="graphql"?new K(o,{extensions:{code:r.CODE}}):new Error(o)}w(ei,"throwError");es.DEBUG||(Y.level=4);function ea(e){var t=q[e];return typeof t=="function"?t:q.green}w(ea,"chalkKeyword");var eo={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(ea(n)("Rule:")," ").concat(s)),Y.log(" ".concat(ea(n)("Message:")," ").concat(i))}),Y.box(ea(n)("".concat(e," : ").concat(t.length))),Y.log(q.gray("─".repeat(40)))}};function ec(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,s=r===void 0?!0:r,i=n.returnValue,a=n.callback,o=p(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return s&&eo.error(o.message),a&&typeof a=="function"&&a(o),i||{success:!1,message:o.message,code:er.INTERNAL_SERVER_ERROR.CODE}}w(ec,"catchError");function eu(e){return new L(y({schema:e.schema,plugins:[e.isDev?U():F(),k({httpServer:e.server})].concat(b(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),eo.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}w(eu,"createApolloServer");import el from"process";import{hideBin as ed}from"yargs/helpers";import ef from"yargs/yargs";var ep={name:"@cyberskill/shared",type:"module",version:"1.198.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"},"./config/vitest":{types:"./dist/config/vitest/index.d.ts",import:"./dist/config/vitest/index.js",require:"./dist/config/vitest/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/upload":{types:"./dist/node/upload/index.d.ts",import:"./dist/node/upload/index.js",require:"./dist/node/upload/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-client-nextjs":{types:"./dist/react/apollo-client-nextjs/index.d.ts",import:"./dist/react/apollo-client-nextjs/index.js",require:"./dist/react/apollo-client-nextjs/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/userback":{types:"./dist/react/userback/index.d.ts",import:"./dist/react/userback/index.js",require:"./dist/react/userback/index.cjs"},"./react/index.css":{import:"./dist/react/index.css",require:"./dist/react/index.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",commitlint:"tsx src/node/cli/index.ts commitlint",dev:"tsup --watch",inspect:"tsx src/node/cli/index.ts inspect",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",ready:"tsx src/node/cli/index.ts ready",reset:"tsx src/node/cli/index.ts reset","test:e2e":"tsx src/node/cli/index.ts test:e2e","test:unit":"tsx src/node/cli/index.ts test:unit"},dependencies:{"@antfu/eslint-config":"4.16.1","@apollo/client":"3.13.8","@apollo/client-integration-nextjs":"0.12.2","@apollo/server":"4.12.2","@dotenvx/dotenvx":"1.45.1","@eddeee888/gcg-typescript-resolver-files":"0.12.1","@graphql-codegen/cli":"5.0.7","@graphql-codegen/client-preset":"4.8.3","@nestjs/common":"11.1.3","@nestjs/core":"11.1.3","@userback/widget":"0.3.11","@vitejs/plugin-react-swc":"3.10.2","body-parser":"2.2.0",chalk:"5.4.1",clsx:"2.1.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",envalid:"8.0.0",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.2.0",graphql:"16.11.0","graphql-ws":"6.0.5",i18next:"25.2.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3",mongodb:"6.17.0",mongoose:"8.16.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.1","next-intl":"4.3.1","node-fetch":"3.3.2","node-persist":"4.0.4",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.3",sass:"1.89.2",slugify:"1.6.6",unorm:"1.6.0",uuid:"11.1.0",vite:"7.0.0",ws:"8.18.3",yargs:"18.0.0"},devDependencies:{"@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@eslint-react/eslint-plugin":"1.52.2","@eslint/config-inspector":"1.1.0","@microsoft/api-extractor":"7.52.8","@next/eslint-plugin-next":"15.3.4","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@types/body-parser":"1.19.6","@types/compression":"1.8.1","@types/cookie-parser":"1.4.9","@types/cors":"2.8.19","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.2","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/node":"24.0.7","@types/node-persist":"3.1.8","@types/react":"19.1.8","@types/react-dom":"19.1.6","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33","@vitest/browser":"3.2.4","esbuild-sass-plugin":"3.3.1",eslint:"9.30.0","eslint-config-next":"15.3.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20","lint-staged":"16.1.2","node-modules-inspector":"1.0.0",playwright:"1.53.1",postcss:"8.5.6","postcss-modules":"6.0.1","simple-git-hooks":"2.13.0",tsup:"8.5.0",tsx:"4.20.3",typescript:"5.8.3",vitest:"3.2.4"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"}};var em=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as eE}from"child_process";import eg from"process";import*as eh from"util";var ey=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});import ev from"node-fetch";import eS from"fs-extra";import eO from"path";var eC=eS,eD=eS.lstatSync,eI=eS.readdirSync,e_=eS.mkdirSync,eN=eS.readFileSync,eb=eS.unlinkSync,eT=eS.statSync,eA=eS.createWriteStream,ex=eS.readJsonSync;function eR(e,t,n){eS.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}w(eR,"writeFileSync");function eG(e,t,n){eS.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}w(eG,"appendFileSync");function eP(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return eS.pathExistsSync(e)})}w(eP,"pathExistsSync");function ew(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eP(e)&&eS.removeSync(e)})}w(ew,"removeSync");function eM(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.extensions,s=O(n,["extensions"]);eS.copySync(e,t,y({filter:w(function(e){return eT(e).isDirectory()||!r||r.length===0?!0:r.includes(eO.extname(e))},"filter")},s))}w(eM,"copySync");import eL from"fs-extra";import ej from"path";var ek=en(),eU=ej,eF=eU.dirname;function eV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eU).resolve.apply(r,[ek.CWD].concat(b(t)))}w(eV,"resolveWorkingPath");function eq(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eU).resolve.apply(r,b(t))}w(eq,"resolve");function eY(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eU).join.apply(r,b(t))}w(eY,"join");var eK=en(),eH=eK.CWD,eB="@cyberskill/shared",eW="node_modules",eQ="dist",eJ="public",ez="package.json",e$="package-lock.json",eX="tsconfig.json",eZ=".gitignore",e0=".simple-git-hooks.json",e1="pnpm-lock.yaml",e2=".git/hooks/",e4=".git/COMMIT_EDITMSG",e3=".migrate-mongo.config.js",e5=function(){var e=eL.readJsonSync(eV(ez)).name===eB?eH:eY(eH,eW,eB);return eY(e,eQ)}(),e8="cyberskill",e6="src/node/cli/index.ts",e7="eslint",e9="eslint",te="vitest",tt="playwright",tn="vitest",tr="@commitlint/cli",ts="@commitlint/config-conventional",ti="commitlint",ta="lint-staged",to="lint-staged",tc="typescript",tu="tsc",tl="tsx",td="git",tf="pnpm",tp="pnpm exec",tm="simple-git-hooks",tE="simple-git-hooks",tg="@eslint/config-inspector",th="eslint-config-inspector",ty="node-modules-inspector",tv="node-modules-inspector",tS="migrate-mongo",tO="./node_modules/migrate-mongo/bin/migrate-mongo",tC={CYBERSKILL_DIRECTORY:e5,WORKING_DIRECTORY:eH,PUBLIC_DIRECTORY:eV(eJ),TS_CONFIG:eV(eX),GIT_IGNORE:eV(eZ),GIT_HOOK:eV(e2),GIT_COMMIT_MSG:eV(e4),SIMPLE_GIT_HOOKS_JSON:eV(e0),PACKAGE_JSON:eV(ez),PACKAGE_LOCK_JSON:eV(e$),PNPM_LOCK_YAML:eV(e1),NODE_MODULES:eV(eW),MIGRATE_MONGO_CONFIG:eV(e3),LINT_STAGED_CONFIG:eV("".concat(e5,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:eV("".concat(e5,"/config/commitlint/index.js")),VITEST_UNIT_CONFIG:eV("".concat(e5,"/config/vitest/vitest.unit.js")),VITEST_UNIT_SETUP_CONFIG:eV("".concat(e5,"/config/vitest/vitest.unit.setup.js")),VITEST_E2E_CONFIG:eV("".concat(e5,"/config/vitest/vitest.e2e.js"))};function tD(e){var t=e.isCurrentProject;return y({"pre-commit":to,"commit-msg":ti},t&&{"pre-push":tH("".concat(td," pull"))})}w(tD,"createGitHooksConfig");function tI(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 em.CLI:return[3,1];case em.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,tR(s,{install:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,tW(tH("".concat(tp," ").concat(r))))];case 4:return[2,tW(tH(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}w(tI,"buildCommand");var t_={simpleGitHooks:tI({type:em.CLI,packages:[{name:tm,type:ey.DEV_DEPENDENCY}],command:tE}),eslintInspect:tI({type:em.CLI,packages:[{name:tg,type:ey.DEV_DEPENDENCY}],command:th}),nodeModulesInspect:tI({type:em.CLI,packages:[{name:ty,type:ey.DEV_DEPENDENCY}],command:tv}),eslintCheck:tI({type:em.CLI,packages:[{name:e7,type:ey.DEV_DEPENDENCY}],command:"".concat(e9," ").concat(tC.WORKING_DIRECTORY," --no-cache")}),eslintFix:tI({type:em.CLI,packages:[{name:e7,type:ey.DEV_DEPENDENCY}],command:"".concat(e9," ").concat(tC.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:tI({type:em.CLI,packages:[{name:tc,type:ey.DEV_DEPENDENCY}],command:"".concat(tu," -p ").concat(tC.TS_CONFIG," --noEmit")}),testUnit:tI({type:em.CLI,packages:[{name:te,type:ey.DEV_DEPENDENCY}],command:"".concat(tn," --config ").concat(tC.VITEST_UNIT_CONFIG)}),testE2e:tI({type:em.CLI,packages:[{name:te,type:ey.DEV_DEPENDENCY}],command:"".concat(tn," --config ").concat(tC.VITEST_E2E_CONFIG)}),mongoMigrateCreate:w(function(e){return tI({type:em.CLI,packages:[{name:tl,type:ey.DEPENDENCY},{name:tS,type:ey.DEPENDENCY}],command:"".concat(tl," ").concat(tO," create ").concat(e," -f ").concat(tC.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:tI({type:em.CLI,packages:[{name:tl,type:ey.DEPENDENCY},{name:tS,type:ey.DEPENDENCY}],command:"".concat(tl," ").concat(tO," up -f ").concat(tC.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:tI({type:em.CLI,packages:[{name:tl,type:ey.DEPENDENCY},{name:tS,type:ey.DEPENDENCY}],command:"".concat(tl," ").concat(tO," down -f ").concat(tC.MIGRATE_MONGO_CONFIG)}),commitLint:tI({type:em.CLI,packages:[{name:tr,type:ey.DEV_DEPENDENCY},{name:ts,type:ey.DEV_DEPENDENCY}],command:"".concat(ti," --edit ").concat(tC.GIT_COMMIT_MSG," --config ").concat(tC.COMMITLINT_CONFIG)}),lintStaged:tI({type:em.CLI,packages:[{name:ta,type:ey.DEV_DEPENDENCY}],command:"".concat(to," --config ").concat(tC.LINT_STAGED_CONFIG)}),configureGitHook:tI({type:em.STRING,command:"".concat(td," config core.hooksPath ").concat(tC.GIT_HOOK)}),build:tI({type:em.STRING,command:"".concat(tf," run --if-present build")}),pnpmInstallStandard:tI({type:em.STRING,command:"".concat(tf," install --ignore-scripts")}),pnpmInstallLegacy:tI({type:em.STRING,command:"".concat(tf," install --ignore-scripts --legacy-peer-deps")}),pnpmInstallForce:tI({type:em.STRING,command:"".concat(tf," install --ignore-scripts --force")}),pnpmPruneStore:tI({type:em.STRING,command:"".concat(tf," store prune")}),pnpmCleanCache:tI({type:em.STRING,command:"".concat(tf," cache delete")})};var tN=en();function tb(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,ev("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,ec(s)];case 4:return[2]}})})()}w(tb,"getLatestPackageVersion");function tT(e){return i(function(){var t,n,r,s,i,a,o,c,u,l,d,f,p,m,E,g,h,y,v,S,O,C,D,I;return R(this,function(_){switch(_.label){case 0:_.trys.push([0,2,,3]);if(!e){if(eP(tC.PACKAGE_JSON)){t=ex(tC.PACKAGE_JSON),n=t.name,r=n===void 0?"":n,s=t.version,i=s===void 0?"":s;return[2,{success:!0,result:{name:r,currentVersion:i,latestVersion:i,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:!1,isDevDependency:!1,installedPath:tC.PACKAGE_JSON,file:t}}]}return[2,{success:!0,result:{name:"",currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:!1,isDevDependency:!1,installedPath:"",file:{}}}]}if(!eP(tC.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===ey.DEPENDENCY,isDevDependency:e.type===ey.DEV_DEPENDENCY,installedPath:"",file:{}}}];a=ex(tC.PACKAGE_JSON),o=a.name,c=a.version,u=c===void 0?"":c,l=a.dependencies,d=l===void 0?{}:l,f=a.devDependencies,p=f===void 0?{}:f;if(e.name===o)return[2,{success:!0,result:{name:o,currentVersion:u,latestVersion:u,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===ey.DEPENDENCY,isDevDependency:e.type===ey.DEV_DEPENDENCY,installedPath:tC.PACKAGE_JSON,file:a}}];m=e.name in d,E=e.name in p;return[4,tb(e.name)];case 1:g=_.sent();if(!g.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:m,isDevDependency:E,installedPath:"",file:{}}}];if(!m&&!E)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:g.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===ey.DEPENDENCY,isDevDependency:e.type===ey.DEV_DEPENDENCY,installedPath:"",file:{}}}];v=(y=(h=d[e.name])!==null&&h!==void 0?h:p[e.name])!==null&&y!==void 0?y:"",S=eY(tN.CWD,eW,e.name,ez);if(!eP(S))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:g.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:m,isDevDependency:E,installedPath:"",file:{}}}];O=ex(S),C=O.version,D=C===void 0?"":C;return[2,v!==D?{success:!0,result:{name:e.name,currentVersion:D||v,latestVersion:g.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:m,isDevDependency:E,installedPath:S,file:O}}:{success:!0,result:{name:e.name,currentVersion:v,latestVersion:g.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:v===g.result,isDependency:m,isDevDependency:E,installedPath:S,file:O}}];case 2:I=_.sent();return[2,ec(I)];case 3:return[2]}})})()}w(tT,"getPackage");function tA(e){return i(function(){var t,n,r,s,i;return R(this,function(a){try{;r=ex(tC.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),eR(tC.PACKAGE_JSON,JSON.stringify(r,null,4)),eo.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){ec(e)}return[2]})})()}w(tA,"updatePackage");function tx(){return i(function(){var e,t,n,r,s,i,a,o,c,u,l,d,f;return R(this,function(p){switch(p.label){case 0:p.trys.push([0,12,,13]);e=[{command:w(function(){return t_.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:w(function(){return t_.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:w(function(){return t_.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];a=i.value,o=a.command,c=a.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,o()];case 4:u=p.sent();return[4,tJ("".concat(c," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();ec(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:f=p.sent();ec(f);return[3,13];case 13:return[2]}})})()}w(tx,"installDependencies");function tR(e,t){return i(function(){var n,r,s,i,a,o,c,u,l,d,f,p,m,E,g,h,y;return R(this,function(v){switch(v.label){case 0:v.trys.push([0,15,,16]);if(!eP(tC.PACKAGE_JSON)){eo.error("package.json not found. Aborting setup.");return[2]}return[4,Promise.all(e.map(tT))];case 1:s=v.sent().filter(function(e){return e.success&&!!e.result&&!e.result.isCurrentProject}).map(function(e){return e.result}),i=s.filter(function(e){return!e.isInstalled}),a=s.filter(function(e){return!e.isUpToDate}),o=[];(t===null||t===void 0?void 0:t.install)&&i.length>0&&(n=o).push.apply(n,b(i.map(tA))),(t===null||t===void 0?void 0:t.update)&&a.length>0&&(r=o).push.apply(r,b(a.map(tA)));c=o.length>0;if(!c)return[3,6];return[4,Promise.all(o)];case 2:v.sent();return[4,tx()];case 3:v.sent();u=["Running ESLint with auto-fix"];return[4,t_.eslintFix()];case 4:return[4,tJ.apply(void 0,u.concat([v.sent()]))];case 5:c=v.sent();v.label=6;case 6:c;d=true,f=false,p=undefined;v.label=7;case 7:v.trys.push([7,12,13,14]);m=((l=t===null||t===void 0?void 0:t.callbacks)!==null&&l!==void 0?l:[])[Symbol.iterator]();v.label=8;case 8:if(!!(d=(E=m.next()).done))return[3,11];g=E.value;return[4,g()];case 9:v.sent();v.label=10;case 10:d=true;return[3,8];case 11:return[3,14];case 12:h=v.sent();f=true;p=h;return[3,14];case 13:try{if(!d&&m.return!=null){m.return()}}finally{if(f){throw p}}return[7];case 14:return[3,16];case 15:y=v.sent();ec(y);return[3,16];case 16:return[2]}})})()}w(tR,"setupPackages");import tG from"node-persist";var tP=en();function tw(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=tG.defaultInstance;if(e)return[3,2];return[4,tG.init({dir:tP.CYBERSKILL_STORAGE_DIRECTORY})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}w(tw,"initNodePersist");var tM={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,tw()];case 1:r.sent();return[4,tG.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,ec(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,tw()];case 1:r.sent();return[4,tG.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();ec(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,tw()];case 1:n.sent();return[4,tG.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();ec(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,tw()];case 1:n.sent();return[4,tG.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(eo.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,ec(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return R(this,function(t){try{return[2,"".concat(tP.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,ec(e,{returnValue:null})]}return[2]})})()}};var tL=en(),tj=eh.promisify(eE);function tk(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:return[4,tT()];case 1:e=t.sent();return[2,e.success?e.result.name:Date.now().toString()]}})})()}w(tk,"getPackageName");function tU(e){return i(function(){var t,n;return R(this,function(r){switch(r.label){case 0:if(e.length===0)return[2];return[4,tk()];case 1:t=r.sent();r.label=2;case 2:r.trys.push([2,4,,5]);return[4,tM.set(t,e)];case 3:r.sent(),setTimeout(function(){return i(function(){var e;return R(this,function(n){switch(n.label){case 0:return[4,tM.getLogLink(t)];case 1:e=n.sent();e&&eo.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},0);return[3,5];case 4:n=r.sent();ec(n);return[3,5];case 5:return[2]}})})()}w(tU,"saveErrorListToStorage");function tF(){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,tk()];case 1:e=r.sent();return[4,tM.get(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:[]];case 3:n=r.sent();return[2,ec(n,{returnValue:[]})];case 4:return[2]}})})()}w(tF,"getStoredErrorLists");function tV(){return i(function(){var e,t;return R(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tk()];case 1:e=n.sent();return[4,tM.remove(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();ec(t);return[3,4];case 4:return[2]}})})()}w(tV,"clearAllErrorLists");function tq(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.+)$/,a=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var o,c,u,l,d;var f=s.exec(e)||[],p=i.exec(e)||[],m=a.exec(e)||[];var E,g,h,y,v,S;f.length&&r?t.push({file:r,position:"".concat(f[1],":").concat(f[2]),type:f[3]===V.Error?V.Error:V.Warning,message:(E=f===null||f===void 0?void 0:(o=f[4])===null||o===void 0?void 0:o.trim())!==null&&E!==void 0?E:"",rule:(g=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):p.length?t.push({file:(h=p===null||p===void 0?void 0:p[1])!==null&&h!==void 0?h:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===V.Error?V.Error:V.Warning,message:(y=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&y!==void 0?y:""}):m.length?t.push({file:"commitlint",type:V.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&&tU(t),tL.DEBUG&&n.length&&(eo.warn("Unmatched lines:"),n.forEach(function(e){return eo.info(" ".concat(e))}))}w(tq,"parseTextErrors");function tY(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,a=e.ruleId,o=e.message;n.push({type:r===2?V.Error:V.Warning,file:t,position:"".concat(s,":").concat(i),rule:a,message:o})})}),n.length&&tU(n)}catch(t){tq(e)}}w(tY,"parseCommandOutput");function tK(e){return i(function(e){var t,n,r,s,i,a,o,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]:tY;n=new AbortController;eg.on("SIGINT",function(){eo.warn("Process interrupted. Terminating..."),n.abort(),eg.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tj(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:a=d.sent();o=a.stdout,c=a.stderr,u=a.message;[o,c].forEach(function(e){return e&&t(e)}),!c&&!o&&eo.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}w(tK,"executeCommand");function tH(e){return{raw:!0,cmd:e}}w(tH,"rawCommand");function tB(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(tp," ").concat(tl," ").concat(e6," ").concat(e):"".concat(tp," ").concat(e8," ").concat(e)}w(tB,"formatCLI");function tW(e,t){return typeof e=="function"?tB(e(t),t):(typeof e==="undefined"?"undefined":T(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tB(e,t):e}w(tW,"formatCommand");function tQ(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:return[4,tT({name:eB})];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=_(e,2),r=t[0],s=t[1];return[r,tW(s,n)]}))]}return[2]}})})()}w(tQ,"resolveCommands");function tJ(e,t){return i(function(){var n;return R(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);eo.start("".concat(e)),tL.DEBUG&&eo.info("→ ".concat(t));return[4,tK(t)];case 1:r.sent(),eo.success("".concat(e," done."));return[3,3];case 2:n=r.sent();ec(n);return[3,3];case 3:return[2]}})})()}w(tJ,"runCommand");function tz(){return i(function(){var e,t;return R(this,function(n){switch(n.label){case 0:if(!eP(tC.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,t_.typescriptCheck()];case 1:return[4,tJ.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=eo.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}w(tz,"checkTypescript");function t$(){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,t_.eslintFix()];case 1:return[4,tJ.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,t_.eslintCheck()];case 4:return[4,tJ.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}w(t$,"checkEslint");function tX(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";eo.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}w(tX,"printIssues");function tZ(){return i(function(){return R(this,function(e){setTimeout(function(){return i(function(){var e,t,n;return R(this,function(r){switch(r.label){case 0:return[4,tF()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===V.Error}),n=e.filter(function(e){return e.type===V.Warning});!t.length&&!n.length?eo.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tX("Warnings",n),tX("Errors",t),(t.length>0||n.length>0)&&el.exit(1));return[2]}})})()},0);return[2]})})()}w(tZ,"showCheckResult");function t0(){return i(function(){var e,t,n,r;return R(this,function(s){switch(s.label){case 0:return[4,tV()];case 1:s.sent();return[4,tT({name:eB})];case 2:e=s.sent();if(!e.success){eo.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,5];n=["Building package: ".concat(eB)];return[4,t_.build()];case 3:return[4,tJ.apply(void 0,n.concat([s.sent()]))];case 4:t=s.sent();s.label=5;case 5:t;r=["Executing lint-staged"];return[4,t_.lintStaged()];case 6:return[4,tJ.apply(void 0,r.concat([s.sent()]))];case 7:s.sent(),tZ();return[2]}})})()}w(t0,"lintStaged");function t1(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,t_.eslintInspect()];case 1:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}w(t1,"inspectLint");function t2(){return i(function(){return R(this,function(e){switch(e.label){case 0:return[4,tV()];case 1:e.sent();return[4,Promise.all([tz(),t$()])];case 2:e.sent(),tZ();return[2]}})})()}w(t2,"lintCheck");function t4(){return i(function(){return R(this,function(e){switch(e.label){case 0:return[4,tV()];case 1:e.sent();return[4,Promise.all([tz(),t$(!0)])];case 2:e.sent(),tZ();return[2]}})})()}w(t4,"lintFix");function t3(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:return[4,tV()];case 1:t.sent();e=["Validating commit message"];return[4,t_.commitLint()];case 2:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tZ();return[2]}})})()}w(t3,"commitLint");function t5(){return i(function(){var e,t,n,r;return R(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,t_.configureGitHook()];case 1:return[4,tJ.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),ew(tC.GIT_HOOK);return[4,tQ(tD)];case 3:t=s.sent();eR(tC.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(e0,"\n");eP(tC.GIT_IGNORE)?eN(tC.GIT_IGNORE,"utf-8").split("\n").includes(e0)||eG(tC.GIT_IGNORE,n):eR(tC.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,t_.simpleGitHooks()];case 4:return[4,tJ.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}w(t5,"setupGitHook");function t8(){return i(function(){return R(this,function(e){switch(e.label){case 0:return[4,tx()];case 1:e.sent();return[4,t5()];case 2:e.sent();return[2]}})})()}w(t8,"ready");function t6(){return i(function(){var e,t;return R(this,function(n){switch(n.label){case 0:ew(tC.NODE_MODULES,tC.PNPM_LOCK_YAML);e=["Pruning pnpm store"];return[4,t_.pnpmPruneStore()];case 1:return[4,tJ.apply(void 0,e.concat([n.sent()]))];case 2:n.sent();t=["Clearing pnpm cache"];return[4,t_.pnpmCleanCache()];case 3:return[4,tJ.apply(void 0,t.concat([n.sent()]))];case 4:n.sent();return[4,tx()];case 5:n.sent();return[4,t5()];case 6:n.sent();return[2]}})})()}w(t6,"reset");function t7(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,t_.nodeModulesInspect()];case 1:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}w(t7,"inspect");function t9(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,t_.testUnit()];case 1:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}w(t9,"testUnit");function ne(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,t_.testE2e()];case 1:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}w(ne,"testE2E");function nt(e){return i(function(){var t;return R(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,t_.mongoMigrateCreate(e)];case 1:return[4,tJ.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}w(nt,"mongoMigrateCreate");function nn(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,t_.mongoMigrateUp()];case 1:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}w(nn,"mongoMigrateUp");function nr(){return i(function(){var e;return R(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,t_.mongoMigrateDown()];case 1:return[4,tJ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}w(nr,"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,ef(ed(el.argv)).scriptName(e8).usage("$0 <command> [options]").command("lint","Check code for linting issues",t2).command("lint:fix","Fix linting issues automatically",t4).command("lint:inspect","View active ESLint configuration",t1).command("lint-staged","Run lint checks on staged files",t0).command("commitlint","Validate commit message format",t3).command("ready","Initialize project and dependencies",t8).command("reset","Reset the project and reinstall dependencies",t6).command("inspect","Analyze installed project dependencies",t7).command("test:unit","Run unit test suite",t9).command("test:e2e","Run end-to-end test suite",ne).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){eo.error("Migration name is required.");return[2]}return[4,nt(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",nn).command("mongo:migrate:down","Rollback last MongoDB migration",nr).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(ep.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();ec(e),el.exit(1);return[3,3];case 3:return[2]}})})()})();import{Router as ns}from"express";import{NestFactory as ni}from"@nestjs/core";import na from"body-parser";import no from"compression";import nc from"cookie-parser";import nu from"cors";import nl from"express";import nd from"express-session";import nf from"express-useragent";function np(e){var t=e.isDev,n=e.whiteList,r=O(e,["isDev","whiteList"]);return y({origin:w(function(e,r){t||!e||(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)}w(np,"createCorsOptions");function nm(e){return nu(np(e))}w(nm,"createCors");function nE(e){return nd(e)}w(nE,"createSession");function ng(e){e.set("trust proxy",1),e.use(nc()),e.use(nl.urlencoded({extended:!0})),e.use(no()),e.use(nf.express())}w(ng,"setupMiddleware");function nh(e,t){t&&(Array.isArray(t)?t:[t]).forEach(function(t){e.use(nl.static(t))})}w(nh,"setupStaticFolders");function ny(e){var t=nl();return ng(t),nh(t,e===null||e===void 0?void 0:e.static),t}w(ny,"createExpress");function nv(e){return i(function(){var t,n,r;return R(this,function(s){switch(s.label){case 0:return[4,ni.create(e.module)];case 1:r=s.sent();return[2,(ng(r.getHttpAdapter().getInstance()),nh(r.getHttpAdapter().getInstance(),e.static),e.filters&&(t=r).useGlobalFilters.apply(t,b(e.filters)),e.pipes&&(n=r).useGlobalPipes.apply(n,b(e.pipes)),r)]}})})()}w(nv,"createNest");var nS="MONGO_MIGRATE_OPTIONS";import{Collection as nO,Db as nC}from"mongodb";import{Document as nD,Model as nI}from"mongoose";var n_=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){o(this,t);return a(this,t,arguments)}return t}(nC);w(n_,"C_Db");var nN=n_,nb=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){o(this,t);return a(this,t,arguments)}return t}(nD);w(nb,"C_Document");var nT=nb,nA=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){o(this,t);return a(this,t,arguments)}return t}(nI);w(nA,"C_Model");var nx=nA,nR=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){o(this,t);return a(this,t,arguments)}return t}(nO);w(nR,"C_Collection");var nG=nR;import{format as nP}from"date-fns";import nw from"migrate-mongo";import{Document as nM}from"mongoose";import nL from"mongoose-aggregate-paginate-v2";import nj from"mongoose-paginate-v2";import{v4 as nk}from"uuid";import nU from"unorm";var nF={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},nV=Object.entries(nF).reduce(function(e,t){var n=_(t,2),r=n[0],s=n[1];return e[r.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function nq(e){e=nU.nfkc(e);var t=y({},nF,nV);var n=true,r=false,s=undefined;try{for(var i=Object.entries(t)[Symbol.iterator](),a;!(n=(a=i.next()).done);n=true){var o=_(a.value,2),c=o[0],u=o[1];var l="[".concat(c).concat(u.join(""),"]"),d="(".concat([c].concat(b(u)).join("|"),")");e=e.replace(new RegExp(l,"g"),d)}}catch(e){r=true;s=e}finally{try{if(!n&&i.return!=null){i.return()}}finally{if(r){throw s}}}return e}w(nq,"regexSearchMapper");function nY(e){return(typeof e==="undefined"?"undefined":T(e))=="object"&&e!==null&&!Array.isArray(e)}w(nY,"isObject");function nK(e){return JSON.parse(JSON.stringify(e))}w(nK,"deepClone");function nH(e,t){return t.reduce(function(e,t){if(e&&(typeof e==="undefined"?"undefined":T(e))=="object"&&t in e)return e[t]},e)}w(nH,"getNestedValue");function nB(e,t,n){if(t.length===0)return e;var r=N(t),s=r[0],i=r.slice(1);if(i.length===0)return S(y({},e),l({},s,n));var a=e[s];return S(y({},e),l({},s,nB((typeof a==="undefined"?"undefined":T(a))=="object"&&a!==null?a:{},i,n)))}w(nB,"setNestedValue");import nW from"crypto-js";import nQ from"slugify";var nJ=nQ.default||nQ;function nz(e,t){var n=w(function(e){var n,r;return nJ(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(nY(e)){var r={};var s=true,i=false,a=undefined;try{for(var o=Object.entries(e)[Symbol.iterator](),c;!(s=(c=o.next()).done);s=true){var u=_(c.value,2),l=u[0],d=u[1];r[l]=n(d)}}catch(e){i=true;a=e}finally{try{if(!s&&o.return!=null){o.return()}}finally{if(i){throw a}}}return r}return n(e)}w(nz,"generateSlug");function n$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return nW.SHA256(e).toString(nW.enc.Hex).slice(0,t)}w(n$,"generateShortId");var nX={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":T(e))=="object"?p(e,Date)?!1:p(e,Map)||p(e,Set)?e.size===0:p(e,WeakMap)||p(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 nZ={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return nP(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"?nZ.getDateTime():new Date;return{id:nk(),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:nk,unique:!0},isDel:{type:Boolean,default:!1}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,n=e.schema,r=e.virtuals,s=r===void 0?[]:r,i=e.standalone,a=i===void 0?!1:i;var o=new t.Schema(n);return s.forEach(function(e){var t=e.name,n=e.options,r=e.get;var s=o.virtual(t,n);r&&s.get(r)}),a||o.add(nZ.createGenericSchema(t)),o},createModel:function e(e){var t=e.mongoose,n=e.name,r=e.schema,s=e.pagination,i=s===void 0?!1:s,a=e.aggregate,o=a===void 0?!1:a,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 f=nZ.createSchema({mongoose:t,schema:r,virtuals:u});return nZ.applyPlugins(f,[i&&nj,o&&nL]),nZ.applyMiddlewares(f,d),t.model(n,f)},validator:{isRequired:function e(){return function(e){return i(function(){return R(this,function(t){return[2,!nX.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!p(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({},nw),{setConfig:w(function(e){var t="// This file is automatically generated by the Cyberskill CLI.\nmodule.exports = ".concat(JSON.stringify(e,null,4));eR(tC.MIGRATE_MONGO_CONFIG,t);var n="\n".concat(e3,"\n");eP(tC.GIT_IGNORE)?eN(tC.GIT_IGNORE,"utf-8").split("\n").includes(e3)||eG(tC.GIT_IGNORE,n):eR(tC.GIT_IGNORE,n)},"setConfig")}),regexify:function e(e,t){if(!e)return{};var n=nK(e);if(!t||t.length===0)return n;var r=true,s=false,i=undefined;try{for(var a=t[Symbol.iterator](),o;!(r=(o=a.next()).done);r=true){var c=o.value;var u=c.toString().split("."),l=nH(n,u);if(typeof l=="string"&&l.length>0){var d={$regex:".*".concat(nq(l),".*"),$options:"i"};n=nB(n,u,d)}}}catch(e){s=true;i=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(s){throw i}}}return n}},n0=/*#__PURE__*/function(){"use strict";function e(t,n){o(this,e);M(this,"collection");this.collection=t.collection(n)}u(e,[{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=y({},nZ.createGenericFields(),e);return[4,this.collection.insertOne(t)];case 1:return[2,r.sent().acknowledged?{success:!0,message:"Document created successfully",result:t}:{success:!1,message:"Document creation failed",code:er.INTERNAL_SERVER_ERROR.CODE}];case 2:n=r.sent();return[2,ec(n)];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({},nZ.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:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:t}];case 2:r=s.sent();return[2,ec(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:er.NOT_FOUND.CODE}];case 2:n=r.sent();return[2,ec(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,ec(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,ec(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:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document updated successfully",result:n}];case 2:r=s.sent();return[2,ec(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:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents updated successfully",result:n}];case 2:r=s.sent();return[2,ec(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:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document deleted successfully",result:t}];case 2:n=r.sent();return[2,ec(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:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents deleted successfully",result:t}];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}}]);return e}();w(n0,"MongoController");var n1=n0,n2=/*#__PURE__*/function(){"use strict";function e(t){o(this,e);M(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,a;var o=arguments;return R(this,function(c){switch(c.label){case 0:e=o.length>0&&o[0]!==void 0?o[0]:{},t=o.length>1&&o[1]!==void 0?o[1]:{},n=o.length>2&&o[2]!==void 0?o[2]:{},r=o.length>3?o[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:er.NOT_FOUND.CODE}];case 3:a=c.sent();return[2,ec(a)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findAll",value:function e(e){return i(function(){var e,t,n,r,s,i,a;var o=arguments;return R(this,function(c){switch(c.label){case 0:e=o.length>0&&o[0]!==void 0?o[0]:{},t=o.length>1&&o[1]!==void 0?o[1]:{},n=o.length>2&&o[2]!==void 0?o[2]:{},r=o.length>3?o[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:a=c.sent();return[2,ec(a)];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,ec(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,ec(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,ec(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,ec(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 p(e,nM)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 3:r=i.sent();return[2,ec(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(a){switch(a.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]:{};a.label=1;case 1:a.trys.push([1,3,,4]);return[4,this.model.findOneAndUpdate(e,t,y({new:!0},n)).exec()];case 2:r=a.sent();return[2,r?{success:!0,result:r}:{success:!1,message:"Failed to update ".concat(this.getModelName(),"."),code:er.NOT_FOUND.CODE}];case 3:s=a.sent();return[2,ec(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(a){switch(a.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]:{};a.label=1;case 1:a.trys.push([1,3,,4]);r={success:!0};return[4,this.model.updateMany(e,t,n).exec()];case 2:return[2,(r.result=a.sent(),r)];case 3:s=a.sent();return[2,ec(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:er.NOT_FOUND.CODE}];case 3:r=i.sent();return[2,ec(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:er.NOT_FOUND.CODE}:{success:!0,result:n}];case 3:r=i.sent();return[2,ec(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,a;return R(this,function(o){switch(o.label){case 0:o.trys.push([0,6,,7]);n=new Set;r=0;o.label=1;case 1:if(!(r<10))return[3,5];s=n$(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=!o.sent();o.label=3;case 3:if(i)return[2,{success:!0,result:s}];o.label=4;case 4:r++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:er.INTERNAL_SERVER_ERROR.CODE}];case 6:a=o.sent();return[2,ec(a)];case 7:return[2]}})}).call(this)}},{key:"createSlugQuery",value:function e(e){var t=e.slug,n=e.field,r=e.isObject,s=e.filter;var i=y({},s!==null&&s!==void 0?s:{});return r?S(y({},i),{$or:[l({},"slug.".concat(n),t),{slugHistory:{$elemMatch:l({},"slug.".concat(n),t)}}]}):S(y({},i),{$or:[{slug:t},{slugHistory:t}]})}},{key:"createUniqueSlug",value:function e(e){return i(function(e){var t,n,r,s,i,a,o;return R(this,function(c){switch(c.label){case 0:t=e.slug,n=e.field,r=e.isObject,s=e.filter;i=nz(t),a=i,o=1;c.label=1;case 1:return[4,this.model.exists(this.createSlugQuery({slug:a,field:n,isObject:r,filter:s}))];case 2:if(!c.sent())return[3,4];a="".concat(i,"-").concat(o++);c.label=3;case 3:return[3,1];case 4:return[2,a]}})}).apply(this,arguments)}},{key:"createSlug",value:function e(e){return i(function(e){var t,n,r,s,a,o,c,u,l,d;return R(this,function(f){switch(f.label){case 0:t=this;n=e.field,r=e.from,s=e.filter;f.label=1;case 1:f.trys.push([1,6,,7]);a=r[n];if(!nY(a))return[3,3];c={success:!0};u=Object.fromEntries;return[4,Promise.all(Object.entries(a).map(function(e){var n=_(e,2),r=n[0],a=n[1];return i(function(){var e;return R(this,function(t){switch(t.label){case 0:return[4,this.createUniqueSlug({slug:a,field:r,isObject:!0,filter:s})];case 1:e=t.sent();return[2,[r,e]]}})}).call(t)}))];case 2:o=(c.result=u.apply(Object,[f.sent()]),c);return[3,5];case 3:l={success:!0};return[4,this.createUniqueSlug({slug:a,field:n,isObject:!1,filter:s})];case 4:o=(l.result=f.sent(),l);f.label=5;case 5:return[2,o];case 6:d=f.sent();return[2,ec(d)];case 7:return[2]}})}).apply(this,arguments)}},{key:"checkSlug",value:function e(e){return i(function(e){var t,n,r,s,i,a,o,c,u,l,d,f,p,m,E,g;return R(this,function(h){switch(h.label){case 0:t=e.slug,n=e.field,r=e.from,s=e.filter;h.label=1;case 1:h.trys.push([1,12,,13]);i=r[n];if(!nY(i))return[3,10];a=true,o=false,c=undefined;h.label=2;case 2:h.trys.push([2,7,8,9]);u=Object.values(i)[Symbol.iterator]();h.label=3;case 3:if(!!(a=(l=u.next()).done))return[3,6];d=l.value;f=nz(d);return[4,this.model.exists(this.createSlugQuery({slug:f,field:n,isObject:!0,filter:s}))];case 4:if(h.sent())return[2,{success:!0,result:!0}];h.label=5;case 5:a=true;return[3,3];case 6:return[3,9];case 7:p=h.sent();o=true;c=p;return[3,9];case 8:try{if(!a&&u.return!=null){u.return()}}finally{if(o){throw c}}return[7];case 9:return[2,{success:!0,result:!1}];case 10:m=nz(t);E={success:!0};return[4,this.model.exists(this.createSlugQuery({slug:m,field:n,isObject:!1,filter:s}))];case 11:return[2,(E.result=h.sent()!==null,E)];case 12:g=h.sent();return[2,ec(g)];case 13:return[2]}})}).apply(this,arguments)}},{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,ec(n)];case 3:return[2]}})}).call(this)}}]);return e}();w(n2,"MongooseController");var n4=n2;var n3=function(e){return e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.DOCUMENT="DOCUMENT",e.OTHER="OTHER",e}({});function n5(e){return i(function(){return R(this,function(t){return[2,new Promise(function(t,n){var r=0;e.on("data",function(e){r+=e.length}),e.on("end",function(){return t(r)}),e.on("error",n)})]})})()}w(n5,"getFileSizeFromStream");function n8(e,t){var n=e.lastIndexOf(".");if(n===-1)return!1;var r=e.substring(n+1).toLowerCase();return t.includes(r)}w(n8,"validateFileExtension");function n6(e,t,n){var r=e.filename,s=e.fileSize,i=t[n],a=i.allowedExtensions,o=i.sizeLimit;if(!n8(r,a))return{isValid:!1,error:"File extension not allowed for ".concat(n.toLowerCase()," files. Allowed extensions: ").concat(a.join(", "))};if(s!==void 0&&s>o){var c=Math.round(o/1048576);return{isValid:!1,error:"File size exceeds limit for ".concat(n.toLowerCase()," files. Maximum size: ").concat(c,"MB")}}return{isValid:!0}}w(n6,"validateUpload");function n7(e){var t;return y({},(t={},l(t,n3.IMAGE,{allowedExtensions:["jpg","jpeg","png","gif","webp","svg"],sizeLimit:5242880}),l(t,n3.VIDEO,{allowedExtensions:["mp4","avi","mov","wmv","flv","webm"],sizeLimit:524288e3}),l(t,n3.DOCUMENT,{allowedExtensions:["pdf","doc","docx","txt","rtf"],sizeLimit:0xa00000}),l(t,n3.OTHER,{allowedExtensions:["zip","rar","tar","gz"],sizeLimit:5242880}),t),e)}w(n7,"createUploadConfig");function n9(e){return i(function(){var t,n,r,s,i,a,o,c,u,l,d,f,m,E,g,h,y,v,S,O,C;return R(this,function(D){switch(D.label){case 0:t=e.path,n=e.file,r=e.config,s=e.type;if(!t||typeof t!="string")return[2,{success:!1,message:"Invalid path provided",result:""}];if(!n||(typeof n==="undefined"?"undefined":T(n))!="object")return[2,{success:!1,message:"Invalid file provided",result:""}];if(r){i=[n3.IMAGE,n3.VIDEO,n3.DOCUMENT,n3.OTHER];a=true,o=false,c=undefined;try{for(u=i[Symbol.iterator]();!(a=(l=u.next()).done);a=true){d=l.value;if(!r[d]||!Array.isArray(r[d].allowedExtensions)||r[d].allowedExtensions.length===0)return[2,{success:!1,message:"Invalid config for ".concat(d.toLowerCase()," files"),result:""}];if(typeof r[d].sizeLimit!="number"||r[d].sizeLimit<=0)return[2,{success:!1,message:"Invalid size limit for ".concat(d.toLowerCase()," files"),result:""}]}}catch(e){o=true;c=e}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(o){throw c}}}}D.label=1;case 1:D.trys.push([1,7,,8]);return[4,n];case 2:return[4,D.sent().file];case 3:f=D.sent(),m=f.filename,E=f.createReadStream;if(!r)return[3,5];g=E();return[4,n5(g)];case 4:h=D.sent(),y=n6({filename:m,fileSize:h},r,s);if(!y.isValid)return[2,{success:!1,message:y.error||"File validation failed",result:""}];D.label=5;case 5:v=eF(t);eP(v)||e_(v,{recursive:!0});S=E(),O=eA(t);S.pipe(O);return[4,new Promise(function(e,t){O.on("finish",function(){return e()}),O.on("error",t),S.on("error",t)})];case 6:return[2,(D.sent(),{success:!0,message:"File uploaded successfully",result:t})];case 7:C=D.sent();return[2,{success:!1,message:p(C,Error)?C.message:"File upload failed",result:""}];case 8:return[2]}})})()}w(n9,"upload");import{useServer as re}from"graphql-ws/use/ws";import{WebSocketServer as rt}from"ws";function rn(e){return new rt({server:e.server,path:e.path})}w(rn,"createWSServer");function rr(e){return re({schema:e.schema},e.server)}w(rr,"initGraphQLWS");export{eQ as BUILD_DIRECTORY,ti as COMMIT_LINT_CLI,ts as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,tr as COMMIT_LINT_PACKAGE_NAME,e8 as CYBERSKILL_CLI,e6 as CYBERSKILL_CLI_PATH,e5 as CYBERSKILL_DIRECTORY,eB as CYBERSKILL_PACKAGE_NAME,nG as C_Collection,nN as C_Db,nT as C_Document,nx as C_Model,e9 as ESLINT_CLI,th as ESLINT_INSPECT_CLI,tg as ESLINT_INSPECT_PACKAGE_NAME,e7 as ESLINT_PACKAGE_NAME,em as E_CommandType,V as E_IssueType,ey as E_PackageType,n3 as E_UploadType,td as GIT_CLI,e4 as GIT_COMMIT_EDITMSG,e2 as GIT_HOOK,eZ as GIT_IGNORE,to as LINT_STAGED_CLI,ta as LINT_STAGED_PACKAGE_NAME,tO as MIGRATE_MONGO_CLI,e3 as MIGRATE_MONGO_CONFIG,tS as MIGRATE_MONGO_PACKAGE_NAME,nS as MONGO_MIGRATE_OPTIONS,n1 as MongoController,n4 as MongooseController,eW as NODE_MODULES,tv as NODE_MODULES_INSPECT_CLI,ty as NODE_MODULES_INSPECT_PACKAGE_NAME,ez as PACKAGE_JSON,e$ as PACKAGE_LOCK_JSON,tC as PATH,tt as PLAYWRIGHT_PACKAGE_NAME,tf as PNPM_CLI,tp as PNPM_EXEC_CLI,e1 as PNPM_LOCK_YAML,eJ as PUBLIC_DIRECTORY,ns as Router,tm as SIMPLE_GIT_HOOKS_PACKAGE_NAME,tE as SIMPLE_GIT_HOOK_CLI,e0 as SIMPLE_GIT_HOOK_JSON,eX as TSCONFIG_JSON,tu as TSC_CLI,tc as TSC_PACKAGE_NAME,tl as TSX_CLI,tn as VITEST_CLI,te as VITEST_PACKAGE_NAME,eH as WORKING_DIRECTORY,nL as aggregatePaginate,eG as appendFileSync,na as bodyParser,ec as catchError,tV as clearAllErrorLists,t_ as command,eM as copySync,eu as createApolloServer,nm as createCors,np as createCorsOptions,ny as createExpress,tD as createGitHooksConfig,nv as createNest,nE as createSession,n7 as createUploadConfig,rn as createWSServer,eA as createWriteStream,eF as dirname,nl as express,j as expressMiddleware,tW as formatCommand,eC as fs,tb as getLatestPackageVersion,tT as getPackage,tF as getStoredErrorLists,rr as initGraphQLWS,tx as installDependencies,eY as join,eo as log,eD as lstatSync,e_ as mkdirSync,nZ as mongo,nj as mongoosePaginate,eU as path,eP as pathExistsSync,tH as rawCommand,eN as readFileSync,ex as readJsonSync,eI as readdirSync,ew as removeSync,eq as resolve,tQ as resolveCommands,eV as resolveWorkingPath,tJ as runCommand,tR as setupPackages,eT as statSync,tM as storage,ei as throwError,eb as unlinkSync,tA as updatePackage,n9 as upload,eR 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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,t,n,o,a,u){try{var i=e[a](u);var l=i.value}catch(e){t(e);return}if(i.done){r(l)}else{Promise.resolve(l).then(n,o)}}function a(e){return function(){var r=this,t=arguments;return new Promise(function(n,a){var u=e.apply(r,t);function i(e){o(u,n,a,i,l,"next",e)}function l(e){o(u,n,a,i,l,"throw",e)}i(undefined)})}}function u(e,r,t){r=E(r);return g(e,N()?Reflect.construct(r,t||[],E(e).constructor):r.apply(e,t))}function i(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function l(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function s(e,r,t){if(r)l(e.prototype,r);if(t)l(e,t);return e}function c(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 E(e){E=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return E(e)}function f(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)O(e,r)}function d(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(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 S(){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 m(){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 A(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){c(e,r,t[r])})}return e}function y(e,r){if(e==null)return{};var t=_(e,r);var n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++){n=a[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function _(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,a;for(a=0;a<n.length;a++){o=n[a];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function g(e,r){if(r&&(C(r)==="object"||typeof r==="function")){return r}return n(e)}function O(e,r){O=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return O(e,r)}function h(e,t){return r(e)||p(e,t)||T(e,t)||S()}function b(e){return t(e)||v(e)||T(e)||m()}function C(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function T(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)}function N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(N=function(){return!!e})()}function I(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},u=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return u.next=i(0),u["throw"]=i(1),u["return"]=i(2),typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function i(e){return function(r){return l([e,r])}}function l(i){if(t)throw new TypeError("Generator is already executing.");while(u&&(u=0,i[0]&&(a=0)),a)try{if(t=1,n&&(o=i[0]&2?n["return"]:i[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;if(n=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;n=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e];n=0}finally{t=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var R=Object.create;var D=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var G=function(e,r,t){return r in e?D(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t};var k=function(e,r){return D(e,"name",{value:r,configurable:!0})};var x=function(e,r){for(var t in r)D(e,t,{get:r[t],enumerable:!0})},U=function(e,r,t,n){var o=true,a=false,u=undefined;if(r&&(typeof r==="undefined"?"undefined":C(r))=="object"||typeof r=="function")try{var i=function(){var o=s.value;!P.call(e,o)&&o!==t&&D(e,o,{get:function(){return r[o]},enumerable:!(n=L(r,o))||n.enumerable})};for(var l=M(r)[Symbol.iterator](),s;!(o=(s=l.next()).done);o=true)i()}catch(e){a=true;u=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw u}}}return e};var Q=function(e,r,t){return t=e!=null?R(w(e)):{},U(r||!e||!e.__esModule?D(t,"default",{value:e,enumerable:!0}):t,e)},q=function(e){return U(D({},"__esModule",{value:!0}),e)};var F=function(e,r,t){return G(e,(typeof r==="undefined"?"undefined":C(r))!="symbol"?r+"":r,t)};var j={};x(j,{ApolloClientContext:function(){return ea},ApolloClientProvider:function(){return eu},ApolloErrorComponent:function(){return X},ApolloErrorContext:function(){return Y},ApolloErrorProvider:function(){return et},ApolloProvider:function(){return eC},DevLoggerLink:function(){return eO},GRAPHQL_URI_DEFAULT:function(){return e_},Loading:function(){return ex},LoadingContext:function(){return eQ},LoadingProvider:function(){return ez},NEXT_INTL_DEFAULT_LANGUAGE:function(){return eB},NextIntlContext:function(){return eY},NextIntlProvider:function(){return re},Toaster:function(){return en.Toaster},catchError:function(){return ey},createApolloLinks:function(){return eh},getClient:function(){return eb},initI18next:function(){return eM},log:function(){return eA},setGlobalApolloErrorCallback:function(){return ee},showGlobalApolloError:function(){return er},storage:function(){return e5},toast:function(){return en.toast},useApolloClient:function(){return eN.useApolloClient},useApolloError:function(){return K},useBackgroundQuery:function(){return eN.useBackgroundQuery},useFragment:function(){return eN.useFragment},useLazyQuery:function(){return eN.useLazyQuery},useLoadableQuery:function(){return eN.useLoadableQuery},useLoading:function(){return eF},useMutation:function(){return eN.useMutation},useNextIntl:function(){return eZ},useQuery:function(){return eN.useQuery},useQueryRefHandlers:function(){return eN.useQueryRefHandlers},useReactiveVar:function(){return eN.useReactiveVar},useReadQuery:function(){return eN.useReadQuery},useStorage:function(){return e7},useSubscription:function(){return eN.useSubscription},useSuspenseFragment:function(){return eN.useSuspenseFragment},useSuspenseQuery:function(){return eN.useSuspenseQuery},useTranslateI18next:function(){return eR},useTranslateNextIntl:function(){return e$},withNextIntl:function(){return e0}});module.exports=q(j);var z=require("@apollo/client/react/react.cjs"),H=Q(require("react"),1);var B=Q(require("react"),1);var V=require("react"),Y=(0,V.createContext)(void 0);var W={"modal-backdrop":"_modal-backdrop_8fveh_1","modal-content":"_modal-content_8fveh_11","btn-close":"_btn-close_8fveh_22","error-title":"_error-title_8fveh_36","btn-retry":"_btn-retry_8fveh_41","error-details":"_error-details_8fveh_54",main:"_main_8fveh_72",network:"_network_8fveh_75",extra:"_extra_8fveh_78"};function X(){var e=(0,B.use)(Y),r=e===null||e===void 0?void 0:e.error;if(!r)return null;var t=k(function(e,r){return(r===null||r===void 0?void 0:r.length)?B.default.createElement("div",null,B.default.createElement("strong",null,e,":"),B.default.createElement("ul",null,r.map(function(e){return B.default.createElement("li",{key:e.message},e.message)}))):null},"renderErrorList");return B.default.createElement("div",{className:W["modal-backdrop"]},B.default.createElement("div",{className:W["modal-content"]},B.default.createElement("button",{type:"button",className:W["btn-close"],onClick:e.hideError},"✕"),B.default.createElement("div",{className:W["error-title"]},B.default.createElement("button",{type:"button",className:W["btn-retry"],onClick:k(function(){return window.location.reload()},"onClick")},"Reload")," ",r.message),B.default.createElement("div",{className:W["error-details"]},r.networkError&&B.default.createElement("pre",{className:"network"},B.default.createElement("strong",null,"Network Error:")," ",r.networkError.message),t("GraphQL Errors",b(r.graphQLErrors)),t("Protocol Errors",b(r.protocolErrors)),t("Client Errors",b(r.clientErrors)),r.extraInfo&&B.default.createElement("pre",{className:"extra"},B.default.createElement("strong",null,"Extra Info:")," ",JSON.stringify(r.extraInfo,null,4)))))}k(X,"ApolloErrorComponent");var J=require("react");function K(){var e=(0,J.use)(Y);if(!e)throw new Error("useApolloError must be used within ApolloErrorProvider");return e}k(K,"useApolloError");var Z=Q(require("react"),1);var $=null;function ee(e){$=e}k(ee,"setGlobalApolloErrorCallback");function er(e){$===null||$===void 0?void 0:$(e)}k(er,"showGlobalApolloError");function et(e){var r=e.children;var t=h((0,Z.useState)(null),2),n=t[0],o=t[1];(0,Z.useEffect)(function(){ee(o)},[]);var a=(0,Z.useMemo)(function(){return{error:n,showError:o,hideError:k(function(){return o(null)},"hideError")}},[n]);return Z.default.createElement(Y,{value:a},r)}k(et,"ApolloErrorProvider");var en=require("react-hot-toast");var eo=Q(require("react"),1);var ea=(0,eo.createContext)(null);function eu(e){var r=e.client,t=e.children;return eo.default.createElement(ea,{value:r},t)}k(eu,"ApolloClientProvider");var ei=require("@apollo/client/core/core.cjs"),el=require("@apollo/client/link/core/core.cjs"),es=require("@apollo/client/link/error/error.cjs"),ec=require("@apollo/client/link/http/http.cjs"),eE=require("@apollo/client/link/remove-typename/remove-typename.cjs"),ef=require("@apollo/client/link/subscriptions/subscriptions.cjs"),ed=require("@apollo/client/utilities/utilities.cjs"),ev=require("graphql-ws"),ep=Q(require("react"),1);var eS=require("consola/browser");var em={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 eA={silent:eS.consola.silent,level:eS.consola.level,fatal:eS.consola.fatal,error:eS.consola.error,warn:eS.consola.warn,log:eS.consola.log,info:eS.consola.info,success:eS.consola.success,ready:eS.consola.ready,start:eS.consola.start,box:eS.consola.box,debug:eS.consola.debug,trace:eS.consola.trace,verbose:eS.consola.verbose};function ey(e,r){var t=r!==null&&r!==void 0?r:{},n=t.shouldLog,o=n===void 0?!0:n,a=t.returnValue,u=t.callback,i=d(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return o&&eA.error(i.message),u&&typeof u=="function"&&u(i),a||{success:!1,message:i.message,code:em.INTERNAL_SERVER_ERROR.CODE}}k(ey,"catchError");var e_="/graphql";var eg=/*#__PURE__*/function(e){f(r,e);function r(){i(this,r);var e;e=u(this,r,arguments);F(e,"count",0);return e}s(r,[{key:"request",value:function e(e,r){var t=this;var n=Date.now();return this.count+=1,r(e).map(function(r){var o=Date.now()-n,a=e.operationName||"Unnamed";return eA.info("[Apollo] #".concat(t.count,": ").concat(a," (").concat(o,"ms)")),r})}}]);return r}(el.ApolloLink);k(eg,"DevLoggerLink");var eO=eg;function eh(e){var r=e.uri,t=e.wsUrl,n=e.customLinks,o=new eO,a=(0,es.onError)(function(e){var r=e.graphQLErrors,t=e.networkError,n=e.protocolErrors,o=e.operation;var a=(o===null||o===void 0?void 0:o.operationName)||"Unknown";if(r&&r.forEach(function(e){var r=e.message,t=e.locations,n=e.path;eA.error("[GraphQL error] ".concat(a,": ").concat(r,", Location: ").concat(JSON.stringify(t,null,4),", Path: ").concat(n))}),n&&n.forEach(function(e){var r=e.message,t=e.extensions;eA.error("[Protocol error]: ".concat(r,", Extensions: ").concat(JSON.stringify(t,null,4)))}),t&&eA.error("[Network error]: ".concat(t)),r||n||t){var u,i;var l=(r===null||r===void 0?void 0:(u=r[0])===null||u===void 0?void 0:u.message)||(n===null||n===void 0?void 0:(i=n[0])===null||i===void 0?void 0:i.message)||(t===null||t===void 0?void 0:t.message)||"Unexpected error",s=new ei.ApolloError({graphQLErrors:r||[],protocolErrors:n||[],clientErrors:[],networkError:t||null,errorMessage:l,extraInfo:{operation:o}});en.toast.error(function(e){return ep.default.createElement(ep.default.Fragment,null,l,"\xa0",ep.default.createElement("button",{type:"button",onClick:k(function(){setTimeout(function(){er(s)},0),en.toast.dismiss(e.id)},"onClick")},"Show Details"))})}}),u=(0,eE.removeTypenameFromVariables)();r||eA.warn('[Apollo] No GraphQL URI provided — using "'.concat(e_,'" as default'));var i=new ec.HttpLink({uri:r!==null&&r!==void 0?r:e_,credentials:"include"}),l=t?new ef.GraphQLWsLink((0,ev.createClient)({url:t})):el.ApolloLink.empty(),s=d(l,el.ApolloLink)?(0,el.split)(function(e){var r=e.query;var t=(0,ed.getMainDefinition)(r);return t.kind==="OperationDefinition"&&t.operation==="subscription"},l,i):i;return s===i&&t&&eA.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[o,a,u].concat(b(n!==null&&n!==void 0?n:[]),[s])}k(eh,"createApolloLinks");function eb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var r=(0,el.from)(eh(e));return new ei.ApolloClient(A({link:r,cache:new ei.InMemoryCache},e))}k(eb,"getClient");function eC(e){var r=e.options,t=e.children;var n=(0,H.useMemo)(function(){return eb(r||{})},[r]);return H.default.createElement(H.default.Fragment,null,H.default.createElement(et,null,H.default.createElement(eu,{client:n},H.default.createElement(z.ApolloProvider,{client:n},t)),H.default.createElement(X,null)),H.default.createElement(en.Toaster,{position:"top-right"}))}k(eC,"ApolloProvider");var eT=require("react");var eN=require("@apollo/client/react/hooks/hooks.cjs");var eI=require("react-i18next"),eR=eI.useTranslation;var eD=Q(require("i18next"),1),eL=require("react-i18next");function eM(e){return eD.default.use(eL.initReactI18next).init(e)}k(eM,"initI18next");var ew=Q(require("clsx"),1),eP=Q(require("react"),1);var eG={overlay:"_overlay_1ank4_1",fullscreen:"_fullscreen_1ank4_1",block:"_block_1ank4_2","overlay-fade-in":"_overlay-fade-in_1ank4_1",container:"_container_1ank4_35",ring:"_ring_1ank4_45",rotate1:"_rotate1_1ank4_1",rotate2:"_rotate2_1ank4_1",rotate3:"_rotate3_1ank4_1",rotate4:"_rotate4_1ank4_1",message:"_message_1ank4_69","text-fade":"_text-fade_1ank4_1"};function ek(){if(document.getElementById("noscroll-style"))return;var e=document.createElement("style");e.id="noscroll-style",e.innerHTML="\n .noscroll {\n overflow: hidden !important;\n height: 100vh !important;\n }\n ",document.head.appendChild(e)}k(ek,"injectNoScrollStyle");function ex(e){var r=e.full,t=r===void 0?!1:r,n=e.block,o=n===void 0?!1:n,a=e.className,u=a===void 0?"":a,i=e.message,l=i===void 0?"Loading":i,s=y(e,["full","block","className","message"]);(0,eP.useEffect)(function(){if(t){document.body.classList.add("noscroll");var e=k(function(e){return e.preventDefault()},"handleContextMenu");return document.addEventListener("contextmenu",e),function(){document.body.classList.remove("noscroll"),document.removeEventListener("contextmenu",e)}}},[t]),(0,eP.useEffect)(function(){ek()},[]);function c(){return eP.default.createElement("div",A({className:eG.container},s),eP.default.createElement("div",{className:eG.ring}),eP.default.createElement("div",{className:eG.ring}),eP.default.createElement("div",{className:eG.ring}),eP.default.createElement("div",{className:eG.ring}),l&&eP.default.createElement("div",{className:eG.message},l))}return k(c,"_renderLoading"),t?eP.default.createElement("div",{className:(0,ew.default)(eG.fullscreen,u)},c()):o?eP.default.createElement("div",{className:(0,ew.default)(eG.block,u)},c()):c()}k(ex,"Loading");var eU=require("react"),eQ=(0,eU.createContext)(void 0);var eq=require("react");function eF(){var e=(0,eq.use)(eQ);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}k(eF,"useLoading");var ej=Q(require("react"),1);function ez(e){var r=e.children;var t=h((0,ej.useState)(!1),2),n=t[0],o=t[1],a=h((0,ej.useState)(!1),2),u=a[0],i=a[1],l=(0,ej.useCallback)(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),i(e)},[]),s=(0,ej.useCallback)(function(){o(!1),i(!1)},[]),c=(0,ej.useMemo)(function(){return{isLoading:n,isGlobalLoading:u,showLoading:l,hideLoading:s}},[n,u,l,s]);return ej.default.createElement(eQ,{value:c},n?ej.default.createElement(ex,{full:u}):r)}k(ez,"LoadingProvider");var eH=require("date-fns/locale"),eB={label:"English",value:"en",flag:"\uD83C\uDDFA\uD83C\uDDF8",adapterLocale:eH.enUS,icon:"flagpack:gb-nir",numberFormat:{code:"en-US",currency:"USD"},timezone:"America/New_York"};var eV=require("react"),eY=(0,eV.createContext)(void 0);var eW=require("next-intl"),eX=Q(require("react"),1);var eJ=require("next-intl"),eK=require("react");function eZ(){var e=(0,eK.use)(eY);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}k(eZ,"useNextIntl");var e$=eJ.useTranslations;function e0(e){var r=k(function(r){var t;var n;var o=eZ(),a=o.currentLanguage,u=r.messages,i=r.languages,l="en",s=u[(a===null||a===void 0?void 0:a.value)||l],c=(n=(t=i.find(function(e){return e.value===(a===null||a===void 0?void 0:a.value)}))===null||t===void 0?void 0:t.timezone)!==null&&n!==void 0?n:eB.timezone;return u?eX.default.createElement(eW.NextIntlClientProvider,{locale:(a===null||a===void 0?void 0:a.value)||l,messages:s||null,timeZone:c},eX.default.createElement(e,r)):(eA.warn("Missing messages for language: ".concat((a===null||a===void 0?void 0:a.value)||l)),null)},"PageWithI18n");return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}k(e0,"withNextIntl");var e1=Q(require("react"),1);var e2=require("react");var e4={Date:{is:k(function(e){return d(e,Date)},"is"),serialize:k(function(e){return{__type:"Date",value:e.toISOString()}},"serialize"),deserialize:k(function(e){return new Date(e)},"deserialize")},Map:{is:k(function(e){return d(e,Map)},"is"),serialize:k(function(e){return{__type:"Map",value:Array.from(e.entries())}},"serialize"),deserialize:k(function(e){return new Map(e)},"deserialize")},Set:{is:k(function(e){return d(e,Set)},"is"),serialize:k(function(e){return{__type:"Set",value:Array.from(e)}},"serialize"),deserialize:k(function(e){return new Set(e)},"deserialize")},RegExp:{is:k(function(e){return d(e,RegExp)},"is"),serialize:k(function(e){return{__type:"RegExp",value:{source:e.source,flags:e.flags}}},"serialize"),deserialize:k(function(e){var r=e.source,t=e.flags;return new RegExp(r,t)},"deserialize")},BigInt:{is:k(function(e){return(typeof e==="undefined"?"undefined":C(e))=="bigint"},"is"),serialize:k(function(e){return{__type:"BigInt",value:e.toString()}},"serialize"),deserialize:k(function(e){return BigInt(e)},"deserialize")}},e3={serialize:function e(e){return JSON.stringify(e,function(e,r){var t=true,n=false,o=undefined;try{for(var a=Object.keys(e4)[Symbol.iterator](),u;!(t=(u=a.next()).done);t=true){var i=u.value;var l=e4[i];if(l.is(r))return l.serialize(r)}}catch(e){n=true;o=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw o}}}return r})},deserialize:function e(e){return JSON.parse(e,function(e,r){if(r&&(typeof r==="undefined"?"undefined":C(r))=="object"&&"__type"in r&&typeof r.__type=="string"){var t=r.__type,n=e4[t];if(n)return n.deserialize(r.value)}return r})}};var e8=Q(require("localforage"),1);var e5={get:function e(e){return a(function(){var r;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e8.default.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,ey(r,{returnValue:null})];case 3:return[2]}})})()},set:function e(e,r){return a(function(){var t;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,e8.default.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();ey(t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return a(function(){var r;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e8.default.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();ey(r);return[3,3];case 3:return[2]}})})()},keys:function e(){return a(function(){var e,r;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e8.default.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,ey(r,{returnValue:[]})];case 3:return[2]}})})()}};function e7(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e3;var n=h((0,e2.useState)(r),2),o=n[0],u=n[1],i=h((0,e2.useState)(!1),2),l=i[0],s=i[1];(0,e2.useEffect)(function(){var n=!0;return k(function(){return a(function(){var o,a,i,l;return I(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,e5.get(e)];case 1:o=c.sent();if(!n)return[3,5];if(!(o!==null))return[3,2];a=t.deserialize(o);u(a);return[3,5];case 2:if(!(r!==void 0))return[3,4];i=t.serialize(r);return[4,e5.set(e,i)];case 3:c.sent(),u(r);return[3,5];case 4:u(void 0);c.label=5;case 5:return[3,8];case 6:l=c.sent();ey(l),n&&u(r);return[3,8];case 7:n&&s(!0);return[7];case 8:return[2]}})})()},"loadValue")(),function(){n=!1,s(!1)}},[e,r,t]),(0,e2.useEffect)(function(){if(!l)return;k(function(){return a(function(){var r,n;return I(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];r=t.serialize(o);return[4,e5.set(e,r)];case 1:a.sent();a.label=2;case 2:return[3,4];case 3:n=a.sent();ey(n);return[3,4];case 4:return[2]}})})()},"saveValue")()},[o,e,t,l]);var c=(0,e2.useCallback)(function(e){u(function(r){return typeof e=="function"?e(r):e})},[]),E=(0,e2.useCallback)(function(){return a(function(){var r;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e5.remove(e)];case 1:t.sent(),u(void 0);return[3,3];case 2:r=t.sent();ey(r);return[3,3];case 3:return[2]}})})()},[e]);return{value:o,set:c,remove:E}}k(e7,"useStorage");function e6(e){var r=e.children;return e1.default.createElement(e1.default.Fragment,null,r)}k(e6,"LanguageWrapperBase");var e9=e0(e6);function re(e){var r=e.children,t=e.languages,n=e.messages;var o=e7("lang",t[0]),a=o.value,u=o.set,i=(0,e1.useMemo)(function(){return{languages:t,currentLanguage:a!==null&&a!==void 0?a:eB,setCurrentLanguage:u}},[t,u,a]);return e1.default.createElement(eY,{value:i},e1.default.createElement(e9,{languages:t,messages:n},r))}k(re,"NextIntlProvider");0&&(module.exports={ApolloClientContext:ApolloClientContext,ApolloClientProvider:ApolloClientProvider,ApolloErrorComponent:ApolloErrorComponent,ApolloErrorContext:ApolloErrorContext,ApolloErrorProvider:ApolloErrorProvider,ApolloProvider:ApolloProvider,DevLoggerLink:DevLoggerLink,GRAPHQL_URI_DEFAULT:GRAPHQL_URI_DEFAULT,Loading:Loading,LoadingContext:LoadingContext,LoadingProvider:LoadingProvider,NEXT_INTL_DEFAULT_LANGUAGE:NEXT_INTL_DEFAULT_LANGUAGE,NextIntlContext:NextIntlContext,NextIntlProvider:NextIntlProvider,Toaster:Toaster,catchError:catchError,createApolloLinks:createApolloLinks,getClient:getClient,initI18next:initI18next,log:log,setGlobalApolloErrorCallback:setGlobalApolloErrorCallback,showGlobalApolloError:showGlobalApolloError,storage:storage,toast:toast,useApolloClient:useApolloClient,useApolloError:useApolloError,useBackgroundQuery:useBackgroundQuery,useFragment:useFragment,useLazyQuery:useLazyQuery,useLoadableQuery:useLoadableQuery,useLoading:useLoading,useMutation:useMutation,useNextIntl:useNextIntl,useQuery:useQuery,useQueryRefHandlers:useQueryRefHandlers,useReactiveVar:useReactiveVar,useReadQuery:useReadQuery,useStorage:useStorage,useSubscription:useSubscription,useSuspenseFragment:useSuspenseFragment,useSuspenseQuery:useSuspenseQuery,useTranslateI18next:useTranslateI18next,useTranslateNextIntl:useTranslateNextIntl,withNextIntl:withNextIntl});
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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,t,n,o,a,u){try{var i=e[a](u);var l=i.value}catch(e){t(e);return}if(i.done){r(l)}else{Promise.resolve(l).then(n,o)}}function a(e){return function(){var r=this,t=arguments;return new Promise(function(n,a){var u=e.apply(r,t);function i(e){o(u,n,a,i,l,"next",e)}function l(e){o(u,n,a,i,l,"throw",e)}i(undefined)})}}function u(e,r,t){r=f(r);return g(e,N()?Reflect.construct(r,t||[],f(e).constructor):r.apply(e,t))}function i(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function l(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function c(e,r,t){if(r)l(e.prototype,r);if(t)l(e,t);return e}function s(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 f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function E(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)O(e,r)}function d(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(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 S(){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 m(){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 A(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){s(e,r,t[r])})}return e}function y(e,r){if(e==null)return{};var t=_(e,r);var n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++){n=a[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function _(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,a;for(a=0;a<n.length;a++){o=n[a];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function g(e,r){if(r&&(C(r)==="object"||typeof r==="function")){return r}return n(e)}function O(e,r){O=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return O(e,r)}function h(e,t){return r(e)||p(e,t)||T(e,t)||S()}function b(e){return t(e)||v(e)||T(e)||m()}function C(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function T(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)}function N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(N=function(){return!!e})()}function I(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},u=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return u.next=i(0),u["throw"]=i(1),u["return"]=i(2),typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function i(e){return function(r){return l([e,r])}}function l(i){if(t)throw new TypeError("Generator is already executing.");while(u&&(u=0,i[0]&&(a=0)),a)try{if(t=1,n&&(o=i[0]&2?n["return"]:i[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;if(n=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;n=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e];n=0}finally{t=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var R=Object.create;var D=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var G=function(e,r,t){return r in e?D(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t};var k=function(e,r){return D(e,"name",{value:r,configurable:!0})};var x=function(e,r){for(var t in r)D(e,t,{get:r[t],enumerable:!0})},U=function(e,r,t,n){var o=true,a=false,u=undefined;if(r&&(typeof r==="undefined"?"undefined":C(r))=="object"||typeof r=="function")try{var i=function(){var o=c.value;!P.call(e,o)&&o!==t&&D(e,o,{get:function(){return r[o]},enumerable:!(n=L(r,o))||n.enumerable})};for(var l=w(r)[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true)i()}catch(e){a=true;u=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw u}}}return e};var q=function(e,r,t){return t=e!=null?R(M(e)):{},U(r||!e||!e.__esModule?D(t,"default",{value:e,enumerable:!0}):t,e)},Q=function(e){return U(D({},"__esModule",{value:!0}),e)};var F=function(e,r,t){return G(e,(typeof r==="undefined"?"undefined":C(r))!="symbol"?r+"":r,t)};var j={};x(j,{ApolloClientContext:function(){return ea},ApolloClientProvider:function(){return eu},ApolloErrorComponent:function(){return X},ApolloErrorContext:function(){return Y},ApolloErrorProvider:function(){return et},ApolloProvider:function(){return eC},DevLoggerLink:function(){return eO},GRAPHQL_URI_DEFAULT:function(){return e_},Loading:function(){return ex},LoadingContext:function(){return eq},LoadingProvider:function(){return ez},NEXT_INTL_DEFAULT_LANGUAGE:function(){return eB},NextIntlContext:function(){return eY},NextIntlProvider:function(){return re},Toaster:function(){return en.Toaster},Userback:function(){return rn},catchError:function(){return ey},createApolloLinks:function(){return eh},getClient:function(){return eb},initI18next:function(){return ew},log:function(){return eA},setGlobalApolloErrorCallback:function(){return ee},showGlobalApolloError:function(){return er},storage:function(){return e5},toast:function(){return en.toast},useApolloClient:function(){return eN.useApolloClient},useApolloError:function(){return K},useBackgroundQuery:function(){return eN.useBackgroundQuery},useFragment:function(){return eN.useFragment},useLazyQuery:function(){return eN.useLazyQuery},useLoadableQuery:function(){return eN.useLoadableQuery},useLoading:function(){return eF},useMutation:function(){return eN.useMutation},useNextIntl:function(){return eZ},useQuery:function(){return eN.useQuery},useQueryRefHandlers:function(){return eN.useQueryRefHandlers},useReactiveVar:function(){return eN.useReactiveVar},useReadQuery:function(){return eN.useReadQuery},useStorage:function(){return e7},useSubscription:function(){return eN.useSubscription},useSuspenseFragment:function(){return eN.useSuspenseFragment},useSuspenseQuery:function(){return eN.useSuspenseQuery},useTranslateI18next:function(){return eR},useTranslateNextIntl:function(){return e$},withNextIntl:function(){return e0}});module.exports=Q(j);var z=require("@apollo/client/react/react.cjs"),H=q(require("react"),1);var B=q(require("react"),1);var V=require("react"),Y=(0,V.createContext)(void 0);var W={"modal-backdrop":"_modal-backdrop_8fveh_1","modal-content":"_modal-content_8fveh_11","btn-close":"_btn-close_8fveh_22","error-title":"_error-title_8fveh_36","btn-retry":"_btn-retry_8fveh_41","error-details":"_error-details_8fveh_54",main:"_main_8fveh_72",network:"_network_8fveh_75",extra:"_extra_8fveh_78"};function X(){var e=(0,B.use)(Y),r=e===null||e===void 0?void 0:e.error;if(!r)return null;var t=k(function(e,r){return(r===null||r===void 0?void 0:r.length)?B.default.createElement("div",null,B.default.createElement("strong",null,e,":"),B.default.createElement("ul",null,r.map(function(e){return B.default.createElement("li",{key:e.message},e.message)}))):null},"renderErrorList");return B.default.createElement("div",{className:W["modal-backdrop"]},B.default.createElement("div",{className:W["modal-content"]},B.default.createElement("button",{type:"button",className:W["btn-close"],onClick:e.hideError},"✕"),B.default.createElement("div",{className:W["error-title"]},B.default.createElement("button",{type:"button",className:W["btn-retry"],onClick:k(function(){return window.location.reload()},"onClick")},"Reload")," ",r.message),B.default.createElement("div",{className:W["error-details"]},r.networkError&&B.default.createElement("pre",{className:"network"},B.default.createElement("strong",null,"Network Error:")," ",r.networkError.message),t("GraphQL Errors",b(r.graphQLErrors)),t("Protocol Errors",b(r.protocolErrors)),t("Client Errors",b(r.clientErrors)),r.extraInfo&&B.default.createElement("pre",{className:"extra"},B.default.createElement("strong",null,"Extra Info:")," ",JSON.stringify(r.extraInfo,null,4)))))}k(X,"ApolloErrorComponent");var J=require("react");function K(){var e=(0,J.use)(Y);if(!e)throw new Error("useApolloError must be used within ApolloErrorProvider");return e}k(K,"useApolloError");var Z=q(require("react"),1);var $=null;function ee(e){$=e}k(ee,"setGlobalApolloErrorCallback");function er(e){$===null||$===void 0?void 0:$(e)}k(er,"showGlobalApolloError");function et(e){var r=e.children;var t=h((0,Z.useState)(null),2),n=t[0],o=t[1];(0,Z.useEffect)(function(){ee(o)},[]);var a=(0,Z.useMemo)(function(){return{error:n,showError:o,hideError:k(function(){return o(null)},"hideError")}},[n]);return Z.default.createElement(Y,{value:a},r)}k(et,"ApolloErrorProvider");var en=require("react-hot-toast");var eo=q(require("react"),1);var ea=(0,eo.createContext)(null);function eu(e){var r=e.client,t=e.children;return eo.default.createElement(ea,{value:r},t)}k(eu,"ApolloClientProvider");var ei=require("@apollo/client/core/core.cjs"),el=require("@apollo/client/link/core/core.cjs"),ec=require("@apollo/client/link/error/error.cjs"),es=require("@apollo/client/link/http/http.cjs"),ef=require("@apollo/client/link/remove-typename/remove-typename.cjs"),eE=require("@apollo/client/link/subscriptions/subscriptions.cjs"),ed=require("@apollo/client/utilities/utilities.cjs"),ev=require("graphql-ws"),ep=q(require("react"),1);var eS=require("consola/browser");var em={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 eA={silent:eS.consola.silent,level:eS.consola.level,fatal:eS.consola.fatal,error:eS.consola.error,warn:eS.consola.warn,log:eS.consola.log,info:eS.consola.info,success:eS.consola.success,ready:eS.consola.ready,start:eS.consola.start,box:eS.consola.box,debug:eS.consola.debug,trace:eS.consola.trace,verbose:eS.consola.verbose};function ey(e,r){var t=r!==null&&r!==void 0?r:{},n=t.shouldLog,o=n===void 0?!0:n,a=t.returnValue,u=t.callback,i=d(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return o&&eA.error(i.message),u&&typeof u=="function"&&u(i),a||{success:!1,message:i.message,code:em.INTERNAL_SERVER_ERROR.CODE}}k(ey,"catchError");var e_="/graphql";var eg=/*#__PURE__*/function(e){E(r,e);function r(){i(this,r);var e;e=u(this,r,arguments);F(e,"count",0);return e}c(r,[{key:"request",value:function e(e,r){var t=this;var n=Date.now();return this.count+=1,r(e).map(function(r){var o=Date.now()-n,a=e.operationName||"Unnamed";return eA.info("[Apollo] #".concat(t.count,": ").concat(a," (").concat(o,"ms)")),r})}}]);return r}(el.ApolloLink);k(eg,"DevLoggerLink");var eO=eg;function eh(e){var r=e.uri,t=e.wsUrl,n=e.customLinks,o=new eO,a=(0,ec.onError)(function(e){var r=e.graphQLErrors,t=e.networkError,n=e.protocolErrors,o=e.operation;var a=(o===null||o===void 0?void 0:o.operationName)||"Unknown";if(r&&r.forEach(function(e){var r=e.message,t=e.locations,n=e.path;eA.error("[GraphQL error] ".concat(a,": ").concat(r,", Location: ").concat(JSON.stringify(t,null,4),", Path: ").concat(n))}),n&&n.forEach(function(e){var r=e.message,t=e.extensions;eA.error("[Protocol error]: ".concat(r,", Extensions: ").concat(JSON.stringify(t,null,4)))}),t&&eA.error("[Network error]: ".concat(t)),r||n||t){var u,i;var l=(r===null||r===void 0?void 0:(u=r[0])===null||u===void 0?void 0:u.message)||(n===null||n===void 0?void 0:(i=n[0])===null||i===void 0?void 0:i.message)||(t===null||t===void 0?void 0:t.message)||"Unexpected error",c=new ei.ApolloError({graphQLErrors:r||[],protocolErrors:n||[],clientErrors:[],networkError:t||null,errorMessage:l,extraInfo:{operation:o}});en.toast.error(function(e){return ep.default.createElement(ep.default.Fragment,null,l,"\xa0",ep.default.createElement("button",{type:"button",onClick:k(function(){setTimeout(function(){er(c)},0),en.toast.dismiss(e.id)},"onClick")},"Show Details"))})}}),u=(0,ef.removeTypenameFromVariables)();r||eA.warn('[Apollo] No GraphQL URI provided — using "'.concat(e_,'" as default'));var i=new es.HttpLink({uri:r!==null&&r!==void 0?r:e_,credentials:"include"}),l=t?new eE.GraphQLWsLink((0,ev.createClient)({url:t})):el.ApolloLink.empty(),c=d(l,el.ApolloLink)?(0,el.split)(function(e){var r=e.query;var t=(0,ed.getMainDefinition)(r);return t.kind==="OperationDefinition"&&t.operation==="subscription"},l,i):i;return c===i&&t&&eA.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[o,a,u].concat(b(n!==null&&n!==void 0?n:[]),[c])}k(eh,"createApolloLinks");function eb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var r=(0,el.from)(eh(e));return new ei.ApolloClient(A({link:r,cache:new ei.InMemoryCache},e))}k(eb,"getClient");function eC(e){var r=e.options,t=e.children;var n=(0,H.useMemo)(function(){return eb(r||{})},[r]);return H.default.createElement(H.default.Fragment,null,H.default.createElement(et,null,H.default.createElement(eu,{client:n},H.default.createElement(z.ApolloProvider,{client:n},t)),H.default.createElement(X,null)),H.default.createElement(en.Toaster,{position:"top-right"}))}k(eC,"ApolloProvider");var eT=require("react");var eN=require("@apollo/client/react/hooks/hooks.cjs");var eI=require("react-i18next"),eR=eI.useTranslation;var eD=q(require("i18next"),1),eL=require("react-i18next");function ew(e){return eD.default.use(eL.initReactI18next).init(e)}k(ew,"initI18next");var eM=q(require("clsx"),1),eP=q(require("react"),1);var eG={overlay:"_overlay_1ank4_1",fullscreen:"_fullscreen_1ank4_1",block:"_block_1ank4_2","overlay-fade-in":"_overlay-fade-in_1ank4_1",container:"_container_1ank4_35",ring:"_ring_1ank4_45",rotate1:"_rotate1_1ank4_1",rotate2:"_rotate2_1ank4_1",rotate3:"_rotate3_1ank4_1",rotate4:"_rotate4_1ank4_1",message:"_message_1ank4_69","text-fade":"_text-fade_1ank4_1"};function ek(){if(document.getElementById("noscroll-style"))return;var e=document.createElement("style");e.id="noscroll-style",e.innerHTML="\n .noscroll {\n overflow: hidden !important;\n height: 100vh !important;\n }\n ",document.head.appendChild(e)}k(ek,"injectNoScrollStyle");function ex(e){var r=e.full,t=r===void 0?!1:r,n=e.block,o=n===void 0?!1:n,a=e.className,u=a===void 0?"":a,i=e.message,l=i===void 0?"Loading":i,c=y(e,["full","block","className","message"]);(0,eP.useEffect)(function(){if(t){document.body.classList.add("noscroll");var e=k(function(e){return e.preventDefault()},"handleContextMenu");return document.addEventListener("contextmenu",e),function(){document.body.classList.remove("noscroll"),document.removeEventListener("contextmenu",e)}}},[t]),(0,eP.useEffect)(function(){ek()},[]);function s(){return eP.default.createElement("div",A({className:eG.container},c),eP.default.createElement("div",{className:eG.ring}),eP.default.createElement("div",{className:eG.ring}),eP.default.createElement("div",{className:eG.ring}),eP.default.createElement("div",{className:eG.ring}),l&&eP.default.createElement("div",{className:eG.message},l))}return k(s,"_renderLoading"),t?eP.default.createElement("div",{className:(0,eM.default)(eG.fullscreen,u)},s()):o?eP.default.createElement("div",{className:(0,eM.default)(eG.block,u)},s()):s()}k(ex,"Loading");var eU=require("react"),eq=(0,eU.createContext)(void 0);var eQ=require("react");function eF(){var e=(0,eQ.use)(eq);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}k(eF,"useLoading");var ej=q(require("react"),1);function ez(e){var r=e.children;var t=h((0,ej.useState)(!1),2),n=t[0],o=t[1],a=h((0,ej.useState)(!1),2),u=a[0],i=a[1],l=(0,ej.useCallback)(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),i(e)},[]),c=(0,ej.useCallback)(function(){o(!1),i(!1)},[]),s=(0,ej.useMemo)(function(){return{isLoading:n,isGlobalLoading:u,showLoading:l,hideLoading:c}},[n,u,l,c]);return ej.default.createElement(eq,{value:s},n?ej.default.createElement(ex,{full:u}):r)}k(ez,"LoadingProvider");var eH=require("date-fns/locale"),eB={label:"English",value:"en",flag:"\uD83C\uDDFA\uD83C\uDDF8",adapterLocale:eH.enUS,icon:"flagpack:gb-nir",numberFormat:{code:"en-US",currency:"USD"},timezone:"America/New_York"};var eV=require("react"),eY=(0,eV.createContext)(void 0);var eW=require("next-intl"),eX=q(require("react"),1);var eJ=require("next-intl"),eK=require("react");function eZ(){var e=(0,eK.use)(eY);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}k(eZ,"useNextIntl");var e$=eJ.useTranslations;function e0(e){var r=k(function(r){var t;var n;var o=eZ(),a=o.currentLanguage,u=r.messages,i=r.languages,l="en",c=u[(a===null||a===void 0?void 0:a.value)||l],s=(n=(t=i.find(function(e){return e.value===(a===null||a===void 0?void 0:a.value)}))===null||t===void 0?void 0:t.timezone)!==null&&n!==void 0?n:eB.timezone;return u?eX.default.createElement(eW.NextIntlClientProvider,{locale:(a===null||a===void 0?void 0:a.value)||l,messages:c||null,timeZone:s},eX.default.createElement(e,r)):(eA.warn("Missing messages for language: ".concat((a===null||a===void 0?void 0:a.value)||l)),null)},"PageWithI18n");return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}k(e0,"withNextIntl");var e1=q(require("react"),1);var e2=require("react");var e4={Date:{is:k(function(e){return d(e,Date)},"is"),serialize:k(function(e){return{__type:"Date",value:e.toISOString()}},"serialize"),deserialize:k(function(e){return new Date(e)},"deserialize")},Map:{is:k(function(e){return d(e,Map)},"is"),serialize:k(function(e){return{__type:"Map",value:Array.from(e.entries())}},"serialize"),deserialize:k(function(e){return new Map(e)},"deserialize")},Set:{is:k(function(e){return d(e,Set)},"is"),serialize:k(function(e){return{__type:"Set",value:Array.from(e)}},"serialize"),deserialize:k(function(e){return new Set(e)},"deserialize")},RegExp:{is:k(function(e){return d(e,RegExp)},"is"),serialize:k(function(e){return{__type:"RegExp",value:{source:e.source,flags:e.flags}}},"serialize"),deserialize:k(function(e){var r=e.source,t=e.flags;return new RegExp(r,t)},"deserialize")},BigInt:{is:k(function(e){return(typeof e==="undefined"?"undefined":C(e))=="bigint"},"is"),serialize:k(function(e){return{__type:"BigInt",value:e.toString()}},"serialize"),deserialize:k(function(e){return BigInt(e)},"deserialize")}},e3={serialize:function e(e){return JSON.stringify(e,function(e,r){var t=true,n=false,o=undefined;try{for(var a=Object.keys(e4)[Symbol.iterator](),u;!(t=(u=a.next()).done);t=true){var i=u.value;var l=e4[i];if(l.is(r))return l.serialize(r)}}catch(e){n=true;o=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw o}}}return r})},deserialize:function e(e){return JSON.parse(e,function(e,r){if(r&&(typeof r==="undefined"?"undefined":C(r))=="object"&&"__type"in r&&typeof r.__type=="string"){var t=r.__type,n=e4[t];if(n)return n.deserialize(r.value)}return r})}};var e8=q(require("localforage"),1);var e5={get:function e(e){return a(function(){var r;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e8.default.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,ey(r,{returnValue:null})];case 3:return[2]}})})()},set:function e(e,r){return a(function(){var t;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,e8.default.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();ey(t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return a(function(){var r;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e8.default.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();ey(r);return[3,3];case 3:return[2]}})})()},keys:function e(){return a(function(){var e,r;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e8.default.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,ey(r,{returnValue:[]})];case 3:return[2]}})})()}};function e7(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e3;var n=h((0,e2.useState)(r),2),o=n[0],u=n[1],i=h((0,e2.useState)(!1),2),l=i[0],c=i[1];(0,e2.useEffect)(function(){var n=!0;return k(function(){return a(function(){var o,a,i,l;return I(this,function(s){switch(s.label){case 0:s.trys.push([0,6,7,8]);return[4,e5.get(e)];case 1:o=s.sent();if(!n)return[3,5];if(!(o!==null))return[3,2];a=t.deserialize(o);u(a);return[3,5];case 2:if(!(r!==void 0))return[3,4];i=t.serialize(r);return[4,e5.set(e,i)];case 3:s.sent(),u(r);return[3,5];case 4:u(void 0);s.label=5;case 5:return[3,8];case 6:l=s.sent();ey(l),n&&u(r);return[3,8];case 7:n&&c(!0);return[7];case 8:return[2]}})})()},"loadValue")(),function(){n=!1,c(!1)}},[e,r,t]),(0,e2.useEffect)(function(){if(!l)return;k(function(){return a(function(){var r,n;return I(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];r=t.serialize(o);return[4,e5.set(e,r)];case 1:a.sent();a.label=2;case 2:return[3,4];case 3:n=a.sent();ey(n);return[3,4];case 4:return[2]}})})()},"saveValue")()},[o,e,t,l]);var s=(0,e2.useCallback)(function(e){u(function(r){return typeof e=="function"?e(r):e})},[]),f=(0,e2.useCallback)(function(){return a(function(){var r;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e5.remove(e)];case 1:t.sent(),u(void 0);return[3,3];case 2:r=t.sent();ey(r);return[3,3];case 3:return[2]}})})()},[e]);return{value:o,set:s,remove:f}}k(e7,"useStorage");function e6(e){var r=e.children;return e1.default.createElement(e1.default.Fragment,null,r)}k(e6,"LanguageWrapperBase");var e9=e0(e6);function re(e){var r=e.children,t=e.languages,n=e.messages;var o=e7("lang",t[0]),a=o.value,u=o.set,i=(0,e1.useMemo)(function(){return{languages:t,currentLanguage:a!==null&&a!==void 0?a:eB,setCurrentLanguage:u}},[t,u,a]);return e1.default.createElement(eY,{value:i},e1.default.createElement(e9,{languages:t,messages:n},r))}k(re,"NextIntlProvider");var rr=q(require("@userback/widget"),1),rt=require("react");function rn(e){var r=e.token,t=e.options;return(0,rt.useEffect)(function(){if(!r)return;var e;return k(function(){return a(function(){var n,o,a;return I(this,function(u){switch(u.label){case 0:n=t||{},o=n.hide,a=y(n,["hide"]);return[4,(0,rr.default)(r,a)];case 1:u.sent(),o&&o.length>0&&o.forEach(function(e){document.querySelectorAll(e).forEach(function(e){return e.remove()})}),e=new MutationObserver(function(){o&&o.length>0&&o.forEach(function(e){document.querySelectorAll(e).forEach(function(e){return e.remove()})})}),e.observe(document.body,{childList:!0,subtree:!0});return[2]}})})()},"loadUserback")(),function(){e===null||e===void 0?void 0:e.disconnect()}},[r,t]),null}k(rn,"Userback");0&&(module.exports={ApolloClientContext:ApolloClientContext,ApolloClientProvider:ApolloClientProvider,ApolloErrorComponent:ApolloErrorComponent,ApolloErrorContext:ApolloErrorContext,ApolloErrorProvider:ApolloErrorProvider,ApolloProvider:ApolloProvider,DevLoggerLink:DevLoggerLink,GRAPHQL_URI_DEFAULT:GRAPHQL_URI_DEFAULT,Loading:Loading,LoadingContext:LoadingContext,LoadingProvider:LoadingProvider,NEXT_INTL_DEFAULT_LANGUAGE:NEXT_INTL_DEFAULT_LANGUAGE,NextIntlContext:NextIntlContext,NextIntlProvider:NextIntlProvider,Toaster:Toaster,Userback:Userback,catchError:catchError,createApolloLinks:createApolloLinks,getClient:getClient,initI18next:initI18next,log:log,setGlobalApolloErrorCallback:setGlobalApolloErrorCallback,showGlobalApolloError:showGlobalApolloError,storage:storage,toast:toast,useApolloClient:useApolloClient,useApolloError:useApolloError,useBackgroundQuery:useBackgroundQuery,useFragment:useFragment,useLazyQuery:useLazyQuery,useLoadableQuery:useLoadableQuery,useLoading:useLoading,useMutation:useMutation,useNextIntl:useNextIntl,useQuery:useQuery,useQueryRefHandlers:useQueryRefHandlers,useReactiveVar:useReactiveVar,useReadQuery:useReadQuery,useStorage:useStorage,useSubscription:useSubscription,useSuspenseFragment:useSuspenseFragment,useSuspenseQuery:useSuspenseQuery,useTranslateI18next:useTranslateI18next,useTranslateNextIntl:useTranslateNextIntl,withNextIntl:withNextIntl});
@@ -57,3 +57,6 @@ export { useStorage } from '../_tsup-dts-rollup.cjs';
57
57
  export { storage_alias_3 as storage } from '../_tsup-dts-rollup.cjs';
58
58
  export { toast } from '../_tsup-dts-rollup.cjs';
59
59
  export { Toaster } from '../_tsup-dts-rollup.cjs';
60
+ export { Userback } from '../_tsup-dts-rollup.cjs';
61
+ export { I_UserBackOptions } from '../_tsup-dts-rollup.cjs';
62
+ export { I_UserBackProps } from '../_tsup-dts-rollup.cjs';