web-node 1.0.581 → 1.0.582

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.
package/configurator.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- import { Configuration } from './type';
1
+ import type { Configuration } from './type';
2
+ export declare const currentRequire: NodeJS.Require | null;
2
3
  export declare let configuration: Configuration;
3
4
  export default configuration;
package/index.js CHANGED
@@ -1,2 +1,640 @@
1
1
  #!/usr/bin/env node
2
- "use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter(function(path){return eval("require.main.paths").includes(path)})))}module===eval("require.main")&&module.paths.unshift("/application/node_modules"),(()=>{var __webpack_modules__=[(module,__webpack_exports__,__webpack_require__)=>{var __webpack_dirname__="/";__webpack_require__.d(__webpack_exports__,{Ad:()=>hotReloadFiles,Ay:()=>__WEBPACK_DEFAULT_EXPORT__,GH:()=>isInLocations,Gy:()=>determineInternalName,Hh:()=>load,MM:()=>pluginAPI,Vx:()=>hotReloadConfigurationFile,ZN:()=>loadFile,dw:()=>hotReloadAPIFile,gh:()=>loadAll,gl:()=>callStackSynchronous,i9:()=>loadConfigurations,lE:()=>currentRequire,lT:()=>_callStack,m7:()=>determineLocations,nQ:()=>loadAPI,u2:()=>evaluateConfiguration,vF:()=>loadConfiguration});var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(3),_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4),_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__),child_process__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(9),child_process__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_3__),clientnode__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(6),clientnode__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(clientnode__WEBPACK_IMPORTED_MODULE_4__),fs__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(7),fs__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_5__),module__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(10),module__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(module__WEBPACK_IMPORTED_MODULE_6__),path__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(8),path__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_7__),_configurator__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(1);function _createForOfIteratorHelperLoose(e,_){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||_&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,_){if(e){if("string"==typeof e)return _arrayLikeToArray(e,_);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,_):void 0}}function _arrayLikeToArray(e,_){(null==_||_>e.length)&&(_=e.length);for(var r=0,n=Array(_);r<_;r++)n[r]=e[r];return n}module=__webpack_require__.hmd(module);var log=new clientnode__WEBPACK_IMPORTED_MODULE_4__.Logger({name:"web-node.plugin-api"}),currentRequire=eval("require"),oldResolveFilename=module__WEBPACK_IMPORTED_MODULE_6__.Module._resolveFilename;module__WEBPACK_IMPORTED_MODULE_6__.Module._resolveFilename=function(e,_,r){var n;return"web-node"===e&&null!=(n=currentRequire.main)&&n.id?oldResolveFilename(currentRequire.main.id,_,r):oldResolveFilename(e,_,r)};var _callStack=function(){var e=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function e(_){var r,n,t,a,o,i,l,c,u,s,p,d,E,b,f,P,m,O,g=arguments;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},_,{pluginAPI}),n=r.configuration,t=r.hook,a=r.plugins,o=t.endsWith("ConfigurationLoaded")||t.endsWith("ConfigurationHotLoaded"),!n.core.plugin.hotReloading){e.next=3;break}if(o){e.next=2;break}if(!(i=hotReloadConfigurationFile(a,n.core.plugin.configuration.propertyNames)).length){e.next=2;break}return log.info('Configuration for "'+i.map(function(e){return e.name}).join('", "')+'" has been changed: reloading initialized.'),l=_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},r,{triggerHook:r.hook,pluginsWithChangedConfiguration:i}),e.next=1,_callStack(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},l,{hook:"preConfigurationHotLoaded"}));case 1:return loadConfigurations(a,n),e.next=2,_callStack(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},l,{hook:"postConfigurationHotLoaded"}));case 2:if("apiFileReloaded"===t){e.next=3;break}if(!(c=hotReloadAPIFile(a)).length){e.next=3;break}return log.info('API-file for "'+c.map(function(e){return e.name}).join('", "')+'"',"has been changed: reloading initialized."),e.next=3,_callStack(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},r,{hook:"apiFileReloaded",pluginsWithChangedAPIFiles:c,triggerHook:r.hook}));case 3:for(u=_.data,s=g.length,p=Array(1<s?s-1:0),d=1;d<s;d++)p[d-1]=g[d];E=_createForOfIteratorHelperLoose(a);case 4:if((b=E()).done){e.next=11;break}if(!(f=b.value).api){e.next=10;break}return P=void 0,e.prev=5,e.next=6,f.api.apply(f,[r].concat(p));case 6:P=e.sent,e.next=9;break;case 7:if(e.prev=7,O=e.catch(5),null==(m=O.message)||!m.startsWith("NotImplemented:")){e.next=8;break}return e.abrupt("continue",10);case 8:throw new Error('Plugin "'+f.internalName+'" '+(f.internalName===f.name?"":"("+f.name+") ")+"throws: "+(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.represent)(O)+' during asynchronous hook "'+t+'".',{cause:O});case 9:u=P,log.info('Ran asynchronous hook "'+t+'" for plugin "'+f.name+'".');case 10:e.next=4;break;case 11:if(null===u||"object"!=typeof u||!("then"in u)){e.next=12;break}return e.abrupt("return",{promise:u});case 12:return e.abrupt("return",u);case 13:case"end":return e.stop()}},e,null,[[5,7]])}));return function(){return e.apply(this,arguments)}}(),callStackSynchronous=function(e){for(var _=_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},e,{pluginAPI}),r=_.configuration,n=_.hook,t=_.plugins,a=e.data,o=arguments.length,i=Array(1<o?o-1:0),l=1;l<o;l++)i[l-1]=arguments[l];for(var c,u,s=_createForOfIteratorHelperLoose(t);!(c=s()).done;)if((u=c.value).api){var p=void 0;try{p=u.api.apply(u,[_].concat(i))}catch(e){var d;if(null!=(d=e.message)&&d.startsWith("NotImplemented:"))continue;throw new Error('Plugin "'+u.internalName+'" '+(u.internalName===u.name?"":"("+u.name+") ")+"throws: "+(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.represent)(e)+' during synchronous hook"'+n+'".',{cause:e})}a=p,r.core.debug&&log.info('Ran synchronous hook "'+n+'" for plugin','"'+u.name+'".')}return a},determineInternalName=function(e,_){return(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.delimitedToCamelCase)(e.replace(_,function(e,_){return"string"==typeof _?_:e}))},evaluateConfiguration=function(e){for(var _={},r=0,n=Object.entries(e);r<n.length;r++){var t=n[r],a=t[0],o=t[1];o.package&&(_[a]=o.package,delete o.package)}var i=new Date;e=(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.evaluateDynamicData)((0,clientnode__WEBPACK_IMPORTED_MODULE_4__.removeKeysInEvaluation)(e),_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},clientnode__WEBPACK_IMPORTED_MODULE_4__.UTILITY_SCOPE,{currentPath:process.cwd(),fs:fs__WEBPACK_IMPORTED_MODULE_5___default(),path:path__WEBPACK_IMPORTED_MODULE_7___default(),module,webNodePath:__webpack_dirname__,now:i,nowUTCTimestamp:(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.getUTCTimestamp)(i)}));for(var l=0,c=Object.entries(_);l<c.length;l++){var u=c[l],s=u[0],p=u[1];e[s].package=p}return e},hotReloadAPIFile=function(e){for(var _,r=[],n=0,t=hotReloadFiles("api","scope",e);n<t.length;n++)if((_=t[n]).oldScope){for(var a=0,o=Object.entries(_.oldScope);a<o.length;a++){var i=o[a],l=i[0],c=i[1];if(Object.prototype.hasOwnProperty.call(_.newScope,l)&&!(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFunction)(_.newScope[l])){var u,s,p=Object.getOwnPropertyDescriptor(_.newScope,l),d=!0;if(p)d=!1!==p.writable,p.configurable&&!d&&Object.defineProperties(_.newScope,((s={})[l]={writable:!0},s));try{_.newScope[l]=c}catch(e){log.warn("Could not update new constant value for",'variable "'+l+'".')}!d&&null!=p&&p.configurable&&Object.defineProperties(_.newScope,((u={})[l]={writable:!1},u))}}r.push(_.plugin)}return r},hotReloadConfigurationFile=function(e,_){for(var r,n=[],t=0,a=hotReloadFiles("configuration","packageConfiguration",e);t<a.length;t++)(r=a[t]).plugin.configuration=loadConfiguration(r.plugin.internalName,r.plugin.packageConfiguration,_),n.push(r.plugin);return n},hotReloadFiles=function(e,_,r){for(var n,t,a=[],o=_createForOfIteratorHelperLoose(r);!(n=o()).done;)if((t=n.value)[_])for(var i,l=0,c=_createForOfIteratorHelperLoose(t[e+"FilePaths"]);!(i=c()).done;){var u=i.value,s=(0,fs__WEBPACK_IMPORTED_MODULE_5__.statSync)(u).mtime.getTime();if(t[e+"FileLoadTimestamps"][l]<s){log.info('Determined updated file "'+u+'".',"Doing a reload."),delete currentRequire.cache[currentRequire.resolve(u)];var p=t[_];t[_]=loadFile(u,t.name,t[_]),log.info('File "'+u+'" reloaded.'),a.push({newScope:t[_],oldScope:p,plugin:t,target:_})}t[e+"FileLoadTimestamps"][l]=s,l+=1}return a},load=function(){var e=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function e(_,r,n,t,a,o){var i,l,c,u,s,p,d,E,b;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:void 0===o&&(o="utf8"),i=[],l={},c=_createForOfIteratorHelperLoose(t.fileNames);case 1:if((u=c()).done){e.next=4;break}return s=u.value,p=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(a,s),e.next=2,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFile)(p);case 2:if(!e.sent){e.next=3;break}d=loadFile(p,_),(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(!0,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.modifyObject)(l,d),d),i.push(p);case 3:e.next=1;break;case 4:if(E=["index.js"],!Object.keys(l).length){e.next=6;break}return r=l.webNodeInternalName||r,(b=loadConfiguration(r,l,t.propertyNames))[r].package.main&&(E[0]=b[r].package.main),e.next=5,loadAPI(E,a,_,r,n,o,b,i);case 5:return e.abrupt("return",e.sent);case 6:return e.next=7,loadAPI(E,a,_,r,n,o);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),loadAPI=function(){var e=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function e(_,r,n,t,a,o,i,l){var c,u,s,p,d,E,b,f,P,m,O;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===o&&(o="utf8"),void 0===i&&(i=null),void 0===l&&(l=[]),s=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(r,_[0]),e.next=1,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFile)(s);case 1:if(e.sent){e.next=6;break}p=_createForOfIteratorHelperLoose((0,fs__WEBPACK_IMPORTED_MODULE_5__.readdirSync)(r));case 2:if((d=p()).done){e.next=6;break}if(E=d.value,m=!l.map(function(e){return(0,path__WEBPACK_IMPORTED_MODULE_7__.basename)(e)}).includes(E),!m){e.next=4;break}return e.next=3,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFile)((0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(r,E));case 3:m=e.sent;case 4:if(!m){e.next=5;break}if(s=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(r,s),!["index","main"].includes((0,path__WEBPACK_IMPORTED_MODULE_7__.basename)(s,(0,path__WEBPACK_IMPORTED_MODULE_7__.extname)(E)))){e.next=5;break}return e.abrupt("continue",6);case 5:e.next=2;break;case 6:if(b=null,f=!1,!(O=i&&(1<Object.keys(i).length||Object.prototype.hasOwnProperty.call(i,t)&&1<Object.keys(i[t]).length))){e.next=8;break}return e.next=7,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFile)(s);case 7:O=e.sent;case 8:if(!O){e.next=9;break}s.endsWith(".js")?(f=!0,b=function(e){for(var _,r=arguments.length,t=Array(1<r?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];if(a[n].scope&&e.hook in a[n].scope)return(_=a[n].scope)[e.hook].apply(_,[e].concat(t,[module]));throw new Error('NotImplemented: API method "'+e.hook+'" is not implemented in plugin "'+n+'".')}):b=function(e){for(var _=e.hook,r=e.data,n=arguments.length,t=Array(1<n?n-1:0),a=1;a<n;a++)t[a-1]=arguments[a];var i=(0,child_process__WEBPACK_IMPORTED_MODULE_3__.spawnSync)(s,[_].concat(t.map(function(e){return JSON.stringify(e)})),{cwd:process.cwd(),encoding:o,env:process.env,input:JSON.stringify(r),shell:!0,stdio:"inherit"});return 404===i.status?r:i.stdout.startsWith("##!JSON!##")?JSON.parse(i.stdout.substring(10)):r};case 9:return P=null!==(c=i)&&void 0!==c?c:((u={})[t]={package:{}},u),e.abrupt("return",{api:b,apiFileLoadTimestamps:b?[(0,fs__WEBPACK_IMPORTED_MODULE_5__.statSync)(s).mtime.getTime()]:[],apiFilePaths:b?[s]:[],configuration:P,configurationFilePaths:l,configurationFileLoadTimestamps:l.map(function(e){return(0,fs__WEBPACK_IMPORTED_MODULE_5__.statSync)(e).mtime.getTime()}),dependencies:Object.prototype.hasOwnProperty.call(P,t)&&P[t].dependencies?P[t].dependencies:[],internalName:t,name:n,packageConfiguration:P[t].package,path:r,scope:f?loadFile(s,n):null});case 10:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),loadConfiguration=function(e,_,r){for(var n,t,a,o=(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.removeKeyPrefixes)((0,clientnode__WEBPACK_IMPORTED_MODULE_4__.copy)(_)),i=((n={})[e]={package:o},n),l=_createForOfIteratorHelperLoose(r);!(t=l()).done;)if(_[a=t.value]){(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(!0,i,_[a]),delete i[e].package[a];break}return i},loadConfigurations=function(e,_){for(var r=0,n=Object.keys(_);r<n.length;r++)delete _[n[r]];(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(_,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.copy)(_configurator__WEBPACK_IMPORTED_MODULE_8__.A));for(var t,a,o=_createForOfIteratorHelperLoose(e);!(t=o()).done;)if(a=t.value,Object.prototype.hasOwnProperty.call(a,"configuration")){var i=(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.copy)(a.configuration);(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(!0,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.modifyObject)(_,i),i),_.core.runtimeConfiguration&&(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(!0,_,_.core.runtimeConfiguration)}return evaluateConfiguration(_)},loadFile=function(e,_,r,n){var t,a;void 0===r&&(r=null),void 0===n&&(n=!0);try{t=currentRequire.resolve(e)}catch(e){}t&&t in currentRequire.cache&&delete currentRequire.cache[t];try{a=currentRequire(e)}catch(t){if(!r)throw new Error("Couldn't load plugin file \""+e+'" for plugin "'+_+'": '+(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.represent)(t),{cause:t});a=r,n&&log.warn("Couldn't load new api plugin file \""+e+'" for','plugin "'+_+'": '+(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.represent)(t)+". Using","fallback one.")}return Object.prototype.hasOwnProperty.call(a,"default")&&a.default?a.default:a},loadAll=function(){var e=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function e(_){var r,n,t,a,o,i,l,c,u,s,p,d,E,b,f,P,m,O,g,M,D,h,A,I,v,T;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r={},"web-node"===_.name){e.next=2;break}return e.next=1,load(_.name,determineInternalName(_.name,new RegExp(_.core.plugin.directories.external.nameRegularExpressionPattern)),r,_.core.plugin.configuration,_.core.context.path,_.core.encoding);case 1:r[_.name]=e.sent;case 2:n=0,t=Object.values(_.core.plugin.directories);case 3:if(!(n<t.length)){e.next=10;break}return a=t[n],e.next=4,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isDirectory)(a.path);case 4:if(!e.sent){e.next=9;break}o=new RegExp(a.nameRegularExpressionPattern),i=_createForOfIteratorHelperLoose((0,fs__WEBPACK_IMPORTED_MODULE_5__.readdirSync)(a.path));case 5:if((l=i()).done){e.next=9;break}if(c=l.value,o.test(c)){e.next=6;break}return e.abrupt("continue",8);case 6:return u=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(a.path,c),s=determineInternalName(c,o),e.next=7,load(c,s,r,_.core.plugin.configuration,u,_.core.encoding);case 7:r[c]=e.sent;case 8:e.next=5;break;case 9:n++,e.next=3;break;case 10:for(p={},d=0,E=Object.values(r);d<E.length;d++)if(b=E[d],p[b.internalName]=b.dependencies,Object.prototype.hasOwnProperty.call(_.core.interDependencies,b.internalName))for(f=_createForOfIteratorHelperLoose([].concat(_.core.interDependencies[b.internalName]));!(P=f()).done;)m=P.value,p[b.internalName].includes(m)||p[b.internalName].push(m);O=[],g=_createForOfIteratorHelperLoose((0,clientnode__WEBPACK_IMPORTED_MODULE_4__.sortTopological)(p));case 11:if((M=g()).done){e.next=15;break}D=M.value,h=0,A=Object.entries(r);case 12:if(!(h<A.length)){e.next=14;break}if(I=A[h],v=I[0],![(T=I[1]).internalName,v].includes(D)){e.next=13;break}return O.push(T),e.abrupt("continue",14);case 13:h++,e.next=12;break;case 14:e.next=11;break;case 15:return e.abrupt("return",{configuration:loadConfigurations(O,_),plugins:O});case 16:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),determineLocations=function(e,_){var r=e.core.context.path;return void 0===_&&(_=[]),(_=[].concat(_)).length?_.map(function(e){return(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(r,e)}):[r]},isInLocations=function(e,_,r,n){for(var t,a,o=_.map(function(e){return e.path}),i=_createForOfIteratorHelperLoose([].concat(n));!(t=i()).done;)if((a=t.value).startsWith("/")){if(r.startsWith((0,path__WEBPACK_IMPORTED_MODULE_7__.join)(e.core.context.path,a)))return!0}else for(var l,c,u=_createForOfIteratorHelperLoose(o);!(l=u()).done;)if(c=l.value,r.startsWith((0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(c,a)))return!0;return!1},pluginAPI={callStack:_callStack,callStackSynchronous,determineInternalName,determineLocations,evaluateConfiguration,hotReloadAPIFile,hotReloadConfigurationFile,hotReloadFiles,isInLocations,load,loadAll,loadAPI,loadConfiguration,loadConfigurations,loadFile};const __WEBPACK_DEFAULT_EXPORT__=pluginAPI},(e,_,r)=>{r.d(_,{H:()=>M,A:()=>T});var n=r(3),t=r.n(n),a=r(6),o=r(7),i=r.n(o),l=r(8),c=r.n(l);const u=JSON.parse('{"name":"web-node","version":"1.0.581","description":"High level javaScript backend plugin system and configuration merger.","keywords":["api","backend","management","plugin","web"],"homepage":"https://torben.website/web-node","bugs":{"email":"info@torben.website","url":"https://github.com/thaibault/web-node/issues"},"license":"CC-BY-3.0","author":{"name":"Torben Sickert","email":"info@torben.website","url":"https://torben.website"},"files":["configurator.d.ts","index.d.ts","index.js","pluginAPI.d.ts","type.d.ts","unixCrypt.d.ts","unixCrypt.js"],"bin":"index.js","repository":{"type":"git","url":"https://github.com/thaibault/web-node.git"},"scripts":{"build":"yarn build:types; yarn build:plain","build:plain":"weboptimizer build","build:types":"weboptimizer build:types","check":"yarn check:types; yarn lint","check:types":"weboptimizer check:types","clear":"weboptimizer clear","document":"weboptimizer document","lint":"weboptimizer lint","prepare":"yarn build","serve":"yarn build:plain && yarn start","start":"./index.js \'{plugin: {hotReloading: true}}\'","prepare:test":"yarn clear && cd dummyPlugin && shx touch yarn.lock && yarn build && cd ..","test":"yarn prepare:test && weboptimizer test","test:coverage":"yarn prepare:test && weboptimizer test:coverage","test:coverage:report":"yarn prepare:test && weboptimizer test:coverage:report","update:documentation":"web-documentation","watch":"weboptimizer build --watch"},"runkitExample":"require(\'@babel/runtime/package.json\')\\nrequire(\'clientnode/package.json\')\\n\\nconst {loadFile} = require(\'web-node\')\\n\\nloadFile(\'./unixCrypt.js\', \'crypt\')(\'test\')","devDependencies":{"@babel/cli":"^7.28.6","@babel/eslint-parser":"^7.28.6","@babel/runtime":"^7.29.2","@eslint/js":"^10.0.1","@stylistic/eslint-plugin":"^5.10.0","@types/node":"^25.6.0","@types/webpack-env":"^1.18.8","@typescript-eslint/eslint-plugin":"^8.59.0","@typescript-eslint/parser":"^8.59.0","clientnode":"^4.0.1388","eslint":"^10.2.1","eslint-config-google":"^0.14.0","eslint-plugin-jsdoc":"^62.9.0","jest":"^30.3.0","jsdoc":"^4.0.5","shx":"^0.4.0","typescript-eslint":"^8.59.0","web-documentation":"^1.0.2","weboptimizer":"^3.0.22"},"peerDependencies":{"@babel/runtime":"*","clientnode":"*"},"peerDependenciesMeta":{"@babel/runtime":{"optional":true}},"engines":{"node":">=24","npm":">=11","yarn":">=4"},"resolutions":{"colors":"1.4.0","globals@npm:^14.0.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^11.1.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^9.18.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"},"sideEffects":true,"documentationWebsite":{"name":"web-node","trackingCode":"UA-40192634-9"},"webNode":{"core":{"context":{"path":"./","type":"relative"},"debug":false,"encoding":"utf8","interDependencies":{},"name":"web-node","plugin":{"configuration":{"fileNames":["package.json","private-package.json"],"propertyNames":["webNode","webnode","web-node"]},"directories":{"external":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-]+?)-?[wW]eb-?[nN]ode-?[pP]lugin$","path":{"__evaluate__":"`${currentPath}/node_modules/`"}},"internal":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-_].*)$","path":{"__evaluate__":"`${currentPath}/plugins/`"}}},"hotReloading":false}}},"webOptimizer":{"assetPattern":{"javaScript":{"includeFilePathRegularExpression":"^(.+/)?index\\\\.js$","pattern":{"#":"This is how we can make our main exported artefact executable.","__evaluate__":"`#!/usr/bin/env node\\n// -*- coding: utf-8 -*-\\n${self.generic.assetPattern.javaScript.pattern}if(module===eval(\'require.main\'))module.paths.unshift(\'/application/node_modules\');{1}`"}}},"exportFormat":{"external":"commonjs2","self":"commonjs2"},"injection":{"entry":{"__evaluate__":"2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith(\'test\') ? {testBundle: \'test\'} : {index: \'./index.ts\', unixCrypt: \'./unixCrypt.ts\'}"}},"module":{"optimizer":{"babelMinify":{"#":"To provide a logging output we need to exclude this feature.","__evaluate__":"self.debug ? {bundle: null, module: null} : {bundle: {transform: {removeConsole: false}}, module: {removeConsole: false}}"}}},"targetTechnology":{"boilerplate":"node","payload":"node"}},"packageManager":"yarn@4.14.1+sha512.64df448055b2d37ba269d7db535a469b8da93f8ef1140c25fd7a83c00a8fbaacb214ca0e02553b92a2c54cef78bb67d0b4817fab02001df0e24fac0faccc3b42"}');var s,p,d=r(0);function E(e,_){(null==_||_>e.length)&&(_=e.length);for(var r=0,n=Array(_);r<_;r++)n[r]=e[r];return n}u.webNode.core.context={path:"/",type:"relative"};for(var b=0;b<a.MAXIMAL_NUMBER_OF_ITERATIONS.value&&(u.webNode.core.context.path=(0,l.resolve)(u.webNode.core.context.path,"../../"),"node_modules"===(0,l.basename)((0,l.dirname)(u.webNode.core.context.path)));b++);if("/"===u.webNode.core.context.path||"node_modules"===(0,l.basename)((0,l.dirname)(process.cwd()))||".staging"===(0,l.basename)((0,l.dirname)(process.cwd()))&&"node_modules"===(0,l.basename)((0,l.dirname)((0,l.dirname)(process.cwd()))))u.webNode.core.context.path=process.cwd();else try{(0,o.lstatSync)((0,l.join)(process.cwd(),"node_modules")).isSymbolicLink()&&(u.webNode.core.context.path=process.cwd())}catch(e){}var f={name:"main"};try{f=(0,a.currentRequire)((0,l.join)(u.webNode.core.context.path,"package"))}catch(e){u.webNode.core.context.path=process.cwd()}var P=(null==(s=f.documentationWebsite)?void 0:s.name)||f.name||"main",m=f.webNode||((p={})[P]={name:P,package:f},p);u.webNode.core.name=u.documentationWebsite.name;var O=new Date,g=t()({},a.UTILITY_SCOPE,{currentPath:process.cwd(),fs:i(),path:c(),pluginAPI:d.Ay,webNodePath:"/",now:O,nowUTCTimestamp:(0,a.getUTCTimestamp)(O)}),M=(0,a.evaluateDynamicData)(u.webNode,g);delete u.webNode,(0,a.extend)(!0,(0,a.modifyObject)(M,m),m);for(var D,h={},A=function(e,_){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,_){if(e){if("string"==typeof e)return E(e,_);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,_):void 0}}(e))||_&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(process.argv.slice(1));!(D=A()).done;){var I=D.value,v=(0,a.parseEncodedObject)(I,M,"configuration");(0,a.isPlainObject)(v)&&(0,a.extend)(!0,h,v)}0<Object.keys(h).length&&((0,a.extend)(!0,(0,a.modifyObject)(M,h),h),M.core.runtimeConfiguration=h),(M=(0,a.evaluateDynamicData)((0,a.removeKeysInEvaluation)(M),g)).name=P,M.core.package=u;const T=M},(module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{callStack:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lT,callStackSynchronous:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.gl,configuration:()=>_configurator__WEBPACK_IMPORTED_MODULE_3__.H,currentRequire:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lE,default:()=>__WEBPACK_DEFAULT_EXPORT__,determineInternalName:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Gy,determineLocations:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.m7,evaluateConfiguration:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.u2,hotReloadAPIFile:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.dw,hotReloadConfigurationFile:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Vx,hotReloadFiles:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Ad,isInLocations:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.GH,load:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Hh,loadAPI:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.nQ,loadAll:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.gh,loadConfiguration:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.vF,loadConfigurations:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.i9,loadFile:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZN,log:()=>log,main:()=>main,pluginAPI:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.MM});var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(3),_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4),_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__),_configurator__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1),_pluginAPI__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(0),clientnode__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(6),clientnode__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(clientnode__WEBPACK_IMPORTED_MODULE_5__);function _createForOfIteratorHelperLoose(e,_){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||_&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,_){if(e){if("string"==typeof e)return _arrayLikeToArray(e,_);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,_):void 0}}function _arrayLikeToArray(e,_){(null==_||_>e.length)&&(_=e.length);for(var r=0,n=Array(_);r<_;r++)n[r]=e[r];return n}module=__webpack_require__.hmd(module),clientnode__WEBPACK_IMPORTED_MODULE_5__.Logger.configureAllInstances({name:"web-node"});var log=new clientnode__WEBPACK_IMPORTED_MODULE_5__.Logger,handleError=function(){var e=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function e(_){var r;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lT)(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},_,{hook:"error"}));case 1:e.next=4;break;case 2:if(e.prev=2,r=e.catch(0),!_.configuration.core.debug){e.next=3;break}throw r;case 3:log.error(r);case 4:case"end":return e.stop()}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}(),main=function(){var e=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function e(){var _,r,n,t,a,o,i,l,c,u,s,p,d,E,b,f,P,m,O,g,M,D,h,A,I,v,T,C,L,y,k,R;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.gh)((0,clientnode__WEBPACK_IMPORTED_MODULE_5__.copy)(_configurator__WEBPACK_IMPORTED_MODULE_3__.A));case 1:return _=e.sent,r=_.configuration,n=_.plugins,e.next=2,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lT)({configuration:r,data:void 0,hook:"initialize",plugins:n});case 2:n.length&&log.info('Loaded plugins: "'+n.map(function(e){return e.internalName}).join('", "')+'".'),t=n.filter(function(e){return!!e.configurationFilePaths.length}),a=_createForOfIteratorHelperLoose(["pre","post"]);case 3:if((o=a()).done){e.next=5;break}return i=o.value,e.next=4,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lT)({configuration:r,data:void 0,hook:i+"ConfigurationLoaded",plugins:n,pluginsWithChangedConfiguration:t});case 4:e.next=3;break;case 5:return l={},c={},u=!1,e.prev=6,e.next=7,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lT)({configuration:r,data:void 0,hook:"preLoadService",plugins:n,services:l});case 7:for(s=0,p=Object.keys(l);s<p.length;s++)d=p[s],log.info('Service "'+d+'" initialized.');E=_createForOfIteratorHelperLoose(n);case 8:if((b=E()).done){e.next=15;break}if(!(f=b.value).api){e.next=14;break}return e.next=9,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lT)({configuration:r,data:void 0,hook:"preLoad"+(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.capitalize)(f.internalName)+"Service",plugins:n,services:l});case 9:return P=null,e.prev=10,e.next=11,f.api({configuration:r,hook:"loadService",pluginAPI:_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Ay,plugins:n,servicePromises:c,services:l});case 11:P=e.sent,e.next=13;break;case 12:if(e.prev=12,null!=(y=e.catch(10))&&null!=(m=y.message)&&m.startsWith("NotImplemented:")){e.next=13;break}throw new Error('Plugin "'+f.internalName+'" '+(f.internalName===f.name?"":"("+f.name+") ")+"throws: "+(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.represent)(y)+' \'during asynchrone hook "loadService".',{cause:y});case 13:if(P)for(O=0,g=Object.entries(P);O<g.length;O++)M=g[O],D=M[0],h=M[1],(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.isObject)(h)&&"then"in h?(log.info('Service "'+D+'" started.'),c[D]=h):log.info('Service "'+D+'" loaded.');return e.next=14,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lT)({configuration:r,data:void 0,hook:"postLoad"+(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.capitalize)(f.internalName)+"Service",plugins:n,servicePromises:c,services:l});case 14:e.next=8;break;case 15:return e.next=16,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lT)({configuration:r,data:void 0,hook:"postLoadService",plugins:n,servicePromises:c,services:l});case 16:for(A=!1,I=function(){A||(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.gl)({configuration:r,data:void 0,hook:"exit",plugins:n.slice().reverse(),servicePromises:c,services:l}),A=!0},v=_createForOfIteratorHelperLoose(clientnode__WEBPACK_IMPORTED_MODULE_5__.CLOSE_EVENT_NAMES);!(T=v()).done;)C=T.value,process.on(C,I);return L=!1,(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.isFunction)(process.stdin.setRawMode)&&process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding(r.core.encoding),process.stdin.on("data",function(e){_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _(){return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(""!==e){_.next=3;break}if(!L){_.next=1;break}log.warn("Stopping ungracefully."),_.next=2;break;case 1:return L=!0,log.info("You have requested to shut down all services. A","second request will force to stop ungracefully."),_.next=2,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lT)({configuration:r,data:void 0,hook:"shouldExit",plugins:n,servicePromises:c,services:l});case 2:process.exit();case 3:process.stdout.write(e);case 4:case"end":return _.stop()}},_)}))()}),e.prev=17,e.next=18,Promise.all(Object.keys(c).map(function(e){return c[e]}));case 18:e.next=20;break;case 19:e.prev=19,e.catch(17);case 20:return u=!0,e.next=21,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lT)({configuration:r,data:void 0,hook:"shouldExit",plugins:n,servicePromises:c,services:l});case 21:process.exit(),e.next=30;break;case 22:return e.prev=22,k=e.catch(6),e.next=23,handleError({configuration:r,data:k,plugins:n,servicePromises:c,services:l});case 23:if(u){e.next=27;break}return e.prev=24,e.next=25,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lT)({configuration:r,data:void 0,hook:"shouldExit",plugins:n,servicePromises:c,services:l});case 25:e.next=27;break;case 26:return e.prev=26,R=e.catch(24),e.next=27,handleError({configuration:r,data:R,plugins:n,servicePromises:c,services:l});case 27:if(!r.core.debug){e.next=28;break}throw k;case 28:log.error(k);case 29:process.exit(1);case 30:case"end":return e.stop()}},e,null,[[6,22],[10,12],[17,19],[24,26]])}));return function(){return e.apply(this,arguments)}}();(__webpack_require__.c[__webpack_require__.s]===module||eval("require.main")!==__webpack_require__.c[__webpack_require__.s]&&void 0!==ORIGINAL_MAIN_MODULE&&ORIGINAL_MAIN_MODULE===eval("require.main"))&&main();const __WEBPACK_DEFAULT_EXPORT__=main},e=>{e.exports=require("@babel/runtime/helpers/extends")},e=>{e.exports=require("@babel/runtime/helpers/asyncToGenerator")},e=>{e.exports=require("@babel/runtime/regenerator")},e=>{e.exports=require("clientnode")},e=>{e.exports=require("fs")},e=>{e.exports=require("path")},e=>{e.exports=require("child_process")},e=>{e.exports=require("module")}],__webpack_module_cache__={};function __webpack_require__(e){var _=__webpack_module_cache__[e];if(void 0!==_)return _.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.c=__webpack_module_cache__,__webpack_require__.n=e=>{var _=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(_,{a:_}),_},__webpack_require__.d=(e,_)=>{for(var r in _)__webpack_require__.o(_,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:_[r]})},__webpack_require__.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(__webpack_require__.s=2);module.exports=__webpack_exports__})();
2
+ // -*- coding: utf-8 -*-
3
+ if(import.meta.main)module.paths.unshift('/application/node_modules');import {fileURLToPath as __webpack_fileURLToPath__} from "node:url";
4
+ var __webpack_dirname__ = __webpack_fileURLToPath__(import.meta.url.replace(/\/(?:[^\/]*)$/, ""));
5
+ import * as __WEBPACK_EXTERNAL_MODULE_child_process__ from "child_process";
6
+ import * as __WEBPACK_EXTERNAL_MODULE_clientnode__ from "clientnode";
7
+ import * as __WEBPACK_EXTERNAL_MODULE_core_js_modules_es_array_includes_js_66c3fd7d__ from "core-js/modules/es.array.includes.js";
8
+ import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
9
+ import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
10
+ /******/ var __webpack_modules__ = ([
11
+ /* 0 */
12
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
13
+
14
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
15
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16
+ /* harmony export */ Ad: () => (/* binding */ hotReloadFiles),
17
+ /* harmony export */ Ay: () => (__WEBPACK_DEFAULT_EXPORT__),
18
+ /* harmony export */ GH: () => (/* binding */ isInLocations),
19
+ /* harmony export */ Gy: () => (/* binding */ determineInternalName),
20
+ /* harmony export */ Hh: () => (/* binding */ load),
21
+ /* harmony export */ MM: () => (/* binding */ pluginAPI),
22
+ /* harmony export */ Vx: () => (/* binding */ hotReloadConfigurationFile),
23
+ /* harmony export */ ZN: () => (/* binding */ loadFile),
24
+ /* harmony export */ dw: () => (/* binding */ hotReloadAPIFile),
25
+ /* harmony export */ gh: () => (/* binding */ loadAll),
26
+ /* harmony export */ gl: () => (/* binding */ callStackSynchronous),
27
+ /* harmony export */ i9: () => (/* binding */ loadConfigurations),
28
+ /* harmony export */ lT: () => (/* binding */ _callStack),
29
+ /* harmony export */ m7: () => (/* binding */ determineLocations),
30
+ /* harmony export */ nQ: () => (/* binding */ loadAPI),
31
+ /* harmony export */ u2: () => (/* binding */ evaluateConfiguration),
32
+ /* harmony export */ vF: () => (/* binding */ loadConfiguration)
33
+ /* harmony export */ });
34
+ /* unused harmony export log */
35
+ /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
36
+ /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
37
+ /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
38
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3);
39
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4);
40
+ /* harmony import */ var _configurator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2);
41
+ /* module decorator */ module = __webpack_require__.hmd(module);
42
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_configurator_js__WEBPACK_IMPORTED_MODULE_5__]);
43
+ var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
44
+ _configurator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_async_dependencies_result__[0];
45
+ // #!/usr/bin/env babel-node
46
+ // -*- coding: utf-8 -*-
47
+ /** @module pluginAPI *//* !
48
+ region header
49
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
50
+
51
+ License
52
+ -------
53
+
54
+ This library written by Torben Sickert stands under a creative commons
55
+ naming 3.0 unported license.
56
+ See https://creativecommons.org/licenses/by/3.0/deed.de
57
+ endregion
58
+ */// region imports
59
+ function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){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 _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)};function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){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 _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}};// endregion
60
+ var log=new clientnode__WEBPACK_IMPORTED_MODULE_2__.Logger({name:"web-node.plugin-api"});await (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.importFilesystemAPI)();var currentRequire=await (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.getCurrentRequire)();if(currentRequire===null)throw new Error("Missing synchronous module loading mechanism (require method).");// region allow plugins to import "web-node" as already loaded main module
61
+ /*
62
+ Commonjs specific logic to deduplicate the main module's scope for plugins
63
+ to avoid loading it twice and therefore having two different scopes of the
64
+ same module in memory:
65
+
66
+ import {Module} from 'module'
67
+
68
+ type ModuleType =
69
+ typeof Module &
70
+ {_resolveFilename: (
71
+ request: string, module: typeof Module, isMain: boolean
72
+ ) => string}
73
+ const oldResolveFilename = (Module as ModuleType)._resolveFilename
74
+ ;(Module as ModuleType)._resolveFilename = (
75
+ request: string, parent: typeof Module, isMain: boolean
76
+ ): string => {
77
+ if (request === 'main-module' && currentRequire.main?.id)
78
+ return oldResolveFilename(currentRequire.main.id, parent, isMain)
79
+
80
+ return oldResolveFilename(request, parent, isMain)
81
+ }
82
+ *//*
83
+ Esmodule specific logic to deduplicate the main module's scope for plugins
84
+ to avoid loading it twice and therefore having two different scopes of the
85
+ same module in memory:
86
+
87
+ // main-module-hook.ts (must compile/run as a standalone module)
88
+ import type {ResolveHook, InitializeHook} from 'node:module'
89
+
90
+ let mainModuleURL: string | undefined
91
+
92
+ export const initialize: InitializeHook = (
93
+ data: {mainModuleURL?: string}
94
+ ): void => {
95
+ mainModuleURL = data.mainModuleURL
96
+ }
97
+
98
+ export const resolve: ResolveHook = (specifier, context, nextResolve) => {
99
+ if (specifier === 'main-module' && mainModuleURL)
100
+ // Redirect to the entry module's URL; the ESM cache is keyed by
101
+ // resolved URL, so every importer shares that one instance.
102
+ return nextResolve(mainModuleURL, context)
103
+
104
+ return nextResolve(specifier, context)
105
+ }
106
+
107
+ Registering it
108
+
109
+ // setup.ts (imported first, before anything does import 'main-module')
110
+ import {register} from 'node:module'
111
+ import {pathToFileURL} from 'node:url'
112
+
113
+ register('./main-module-hook.js', {
114
+ parentURL: import.meta.url,
115
+ data: {mainModuleURL: pathToFileURL(process.argv[1]).href}
116
+ })
117
+ */// endregion
118
+ /**
119
+ * Calls all plugin methods for given trigger description asynchronous and
120
+ * waits for their resolved promises.
121
+ * @param givenState - Contains runtime information about current hook.
122
+ * @param parameters - Additional parameters to forward into plugin api.
123
+ * @returns A promise which resolves when all callbacks have resolved their
124
+ * promise holding given potentially modified data.
125
+ */var _callStack=/*#__PURE__*/function(){var _callStack2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(givenState){var state,configuration,hook,plugins,isConfigurationHook,pluginsWithChangedConfiguration,localState,pluginsWithChangedAPIFiles,data,_len,parameters,_key,_iterator,_step,plugin,result,_message,_args=arguments,_t,_t2;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:state=_objectSpread(_objectSpread({},givenState),{},{pluginAPI:pluginAPI});configuration=state.configuration,hook=state.hook,plugins=state.plugins;isConfigurationHook=hook.endsWith("ConfigurationLoaded")||hook.endsWith("ConfigurationHotLoaded");if(!configuration.core.plugin.hotReloading){_context.n=4;break}if(isConfigurationHook){_context.n=3;break}pluginsWithChangedConfiguration=hotReloadConfigurationFile(plugins,configuration.core.plugin.configuration.propertyNames);if(!pluginsWithChangedConfiguration.length){_context.n=3;break}log.info("Configuration for \""+pluginsWithChangedConfiguration.map(function(plugin){return plugin.name}).join("\", \"")+"\" has been changed: reloading initialized.");localState=_objectSpread(_objectSpread({},state),{},{triggerHook:state.hook,pluginsWithChangedConfiguration:pluginsWithChangedConfiguration});_context.n=1;return _callStack(_objectSpread(_objectSpread({},localState),{},{hook:"preConfigurationHotLoaded"}));case 1:_context.n=2;return loadConfigurations(plugins,configuration);case 2:_context.n=3;return _callStack(_objectSpread(_objectSpread({},localState),{},{hook:"postConfigurationHotLoaded"}));case 3:if(!(hook!=="apiFileReloaded")){_context.n=4;break}pluginsWithChangedAPIFiles=hotReloadAPIFile(plugins);if(!pluginsWithChangedAPIFiles.length){_context.n=4;break}log.info("API-file for \""+"".concat(pluginsWithChangedAPIFiles.map(function(plugin){return plugin.name}).join("\", \""),"\""),"has been changed: reloading initialized.");_context.n=4;return _callStack(_objectSpread(_objectSpread({},state),{},{hook:"apiFileReloaded",pluginsWithChangedAPIFiles:pluginsWithChangedAPIFiles,triggerHook:state.hook}));case 4:data=givenState.data;for(_len=_args.length,parameters=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){parameters[_key-1]=_args[_key]}_iterator=_createForOfIteratorHelper(plugins);_context.p=5;_iterator.s();case 6:if((_step=_iterator.n()).done){_context.n=13;break}plugin=_step.value;if(!plugin.api){_context.n=12;break}result=void 0;_context.p=7;_context.n=8;return plugin.api.apply(plugin,[state].concat(parameters));case 8:result=_context.v;_context.n=11;break;case 9:_context.p=9;_t=_context.v;if(!((_message=_t.message)!==null&&_message!==void 0&&_message.startsWith("NotImplemented:"))){_context.n=10;break}return _context.a(3,12);case 10:throw new Error("Plugin \"".concat(plugin.internalName,"\" ")+(plugin.internalName===plugin.name?"":"(".concat(plugin.name,") "))+"throws: ".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.represent)(_t)," during asynchronous ")+"hook \"".concat(hook,"\"."),{cause:_t});case 11:data=result;log.info("Ran asynchronous hook \"".concat(hook,"\" for plugin \"").concat(plugin.name,"\"."));case 12:_context.n=6;break;case 13:_context.n=15;break;case 14:_context.p=14;_t2=_context.v;_iterator.e(_t2);case 15:_context.p=15;_iterator.f();return _context.f(15);case 16:if(!(data!==null&&_typeof(data)==="object"&&"then"in data)){_context.n=17;break}return _context.a(2,{promise:data});case 17:return _context.a(2,data)}},_callee,null,[[7,9],[5,14,15,16]])}));function callStack(_x){return _callStack2.apply(this,arguments)}return callStack}();/**
126
+ * Calls all plugin methods for given trigger description synchronous.
127
+ * @param givenState - Contains runtime information about current hook.
128
+ * @param parameters - Additional parameters to forward into plugin api.
129
+ * @returns Given potentially modified data.
130
+ */var callStackSynchronous=function callStackSynchronous(givenState){var state=_objectSpread(_objectSpread({},givenState),{},{pluginAPI:pluginAPI});var configuration=state.configuration,hook=state.hook,plugins=state.plugins;var data=givenState.data;for(var _len2=arguments.length,parameters=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){parameters[_key2-1]=arguments[_key2]}var _iterator2=_createForOfIteratorHelper(plugins),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var plugin=_step2.value;if(plugin.api){var result=void 0;try{result=plugin.api.apply(plugin,[state].concat(parameters))}catch(error){var _message2;if((_message2=error.message)!==null&&_message2!==void 0&&_message2.startsWith("NotImplemented:"))continue;throw new Error("Plugin \"".concat(plugin.internalName,"\" ")+(plugin.internalName===plugin.name?"":"(".concat(plugin.name,") "))+"throws: ".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.represent)(error)," during synchronous hook")+"\"".concat(hook,"\"."),{cause:error})}data=result;if(configuration.core.debug)log.info("Ran synchronous hook \"".concat(hook,"\" for plugin"),"\"".concat(plugin.name,"\"."))}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return data};/**
131
+ * Converts given plugin name into the corresponding internal representation.
132
+ * @param name - Name to convert.
133
+ * @param regularExpression - Regular expression pattern which extracts
134
+ * relevant name path as first match group.
135
+ * @returns Transformed name.
136
+ */var determineInternalName=function determineInternalName(name,regularExpression){return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.delimitedToCamelCase)(name.replace(regularExpression,function(fullMatch,firstMatch){return typeof firstMatch==="string"?firstMatch:fullMatch}))};/**
137
+ * Evaluates given configuration object by letting plugins package sub
138
+ * structure untouched.
139
+ * @param configuration - Evaluable configuration structure.
140
+ * @returns Resolved configuration.
141
+ */var evaluateConfiguration=/*#__PURE__*/function(){var _evaluateConfiguration=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(configuration){var pluginPackageConfigurationBackup,_i,_Object$entries,_Object$entries$_i,name,subConfiguration,now,evaluationOptions,_i2,_Object$entries2,_Object$entries2$_i,_name,pluginPackageConfiguration;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:/*
142
+ NOTE: We have to back up, remove and restore all plugin specific
143
+ package configuration to avoid evaluation non web node#
144
+ configuration structures.
145
+ */pluginPackageConfigurationBackup={};for(_i=0,_Object$entries=Object.entries(configuration);_i<_Object$entries.length;_i++){_Object$entries$_i=_slicedToArray(_Object$entries[_i],2),name=_Object$entries$_i[0],subConfiguration=_Object$entries$_i[1];if(subConfiguration.package){pluginPackageConfigurationBackup[name]=subConfiguration.package;delete subConfiguration.package}}now=new Date;evaluationOptions={scope:_objectSpread(_objectSpread({},clientnode__WEBPACK_IMPORTED_MODULE_2__.UTILITY_SCOPE),{},{currentPath:process.cwd(),fs:fs__WEBPACK_IMPORTED_MODULE_3__["default"],path:path__WEBPACK_IMPORTED_MODULE_4__["default"],module:module,webNodePath:__webpack_dirname__,now:now,nowUTCTimestamp:(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.getUTCTimestamp)(now)})};_context2.n=1;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.evaluateAsyncDynamicData)((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.evaluateDynamicData)((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.removeKeysInEvaluation)(configuration),evaluationOptions),evaluationOptions);case 1:configuration=_context2.v;for(_i2=0,_Object$entries2=Object.entries(pluginPackageConfigurationBackup);_i2<_Object$entries2.length;_i2++){_Object$entries2$_i=_slicedToArray(_Object$entries2[_i2],2),_name=_Object$entries2$_i[0],pluginPackageConfiguration=_Object$entries2$_i[1];configuration[_name].package=pluginPackageConfiguration}return _context2.a(2,configuration)}},_callee2)}));function evaluateConfiguration(_x2){return _evaluateConfiguration.apply(this,arguments)}return evaluateConfiguration}();/**
146
+ * Checks for changed plugin api file in given plugins and reloads them if
147
+ * necessary (new timestamp).
148
+ * @param plugins - List of plugins to search for updates in.
149
+ * @returns A list with plugins which have a changed api scope.
150
+ */var hotReloadAPIFile=function hotReloadAPIFile(plugins){var pluginsWithChangedFiles=[];var pluginChanges=hotReloadFiles("api","scope",plugins);for(var _i3=0,_pluginChanges=pluginChanges;_i3<_pluginChanges.length;_i3++){var pluginChange=_pluginChanges[_i3];if(pluginChange.oldScope){// NOTE: We have to migrate old plugin api's scope state.
151
+ for(var _i4=0,_Object$entries3=Object.entries(pluginChange.oldScope);_i4<_Object$entries3.length;_i4++){var _Object$entries3$_i=_slicedToArray(_Object$entries3[_i4],2),name=_Object$entries3$_i[0],value=_Object$entries3$_i[1];if(Object.prototype.hasOwnProperty.call(pluginChange.newScope,name)&&!(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFunction)(pluginChange.newScope[name])){var propertyDescriptor=Object.getOwnPropertyDescriptor(pluginChange.newScope,name);var isWritable=true;if(propertyDescriptor){isWritable=propertyDescriptor.writable!==false;if(propertyDescriptor.configurable&&!isWritable)Object.defineProperties(pluginChange.newScope,_defineProperty({},name,{writable:true}))}try{pluginChange.newScope[name]=value}catch(_unused){log.warn("Could not update new constant value for","variable \"".concat(name,"\"."))}if(!isWritable&&propertyDescriptor!==null&&propertyDescriptor!==void 0&&propertyDescriptor.configurable)Object.defineProperties(pluginChange.newScope,_defineProperty({},name,{writable:false}))}}pluginsWithChangedFiles.push(pluginChange.plugin)}}return pluginsWithChangedFiles};/**
152
+ * Checks for changed plugin configurations in given plugins and reloads them
153
+ * if necessary (new timestamp).
154
+ * @param plugins - List of plugins to search for updates in.
155
+ * @param configurationPropertyNames - Property names to search for to use as
156
+ * entry in plugin configuration file.
157
+ * @returns A list with plugins which have a changed configurations.
158
+ */var hotReloadConfigurationFile=function hotReloadConfigurationFile(plugins,configurationPropertyNames){var pluginsWithChangedFiles=[];var pluginChanges=hotReloadFiles("configuration","packageConfiguration",plugins);for(var _i5=0,_pluginChanges2=pluginChanges;_i5<_pluginChanges2.length;_i5++){var change=_pluginChanges2[_i5];change.plugin.configuration=loadConfiguration(change.plugin.internalName,change.plugin.packageConfiguration,configurationPropertyNames);pluginsWithChangedFiles.push(change.plugin)}return pluginsWithChangedFiles};/**
159
+ * Checks for changed plugin file type in given plugins and reloads them if
160
+ * necessary (timestamp has changed).
161
+ * @param type - Plugin file type to search for updates.
162
+ * @param target - Property name existing in plugin meta information objects
163
+ * which should be updated.
164
+ * @param plugins - List of plugins to search for updates in.
165
+ * @returns A list with plugin changes.
166
+ */var hotReloadFiles=function hotReloadFiles(type,target,plugins){var pluginChanges=[];var _iterator3=_createForOfIteratorHelper(plugins),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var plugin=_step3.value;if(plugin[target]){var index=0;var _iterator4=_createForOfIteratorHelper(plugin["".concat(type,"FilePaths")]),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var filePath=_step4.value;var timestamp=(0,fs__WEBPACK_IMPORTED_MODULE_3__.statSync)(filePath).mtime.getTime();if(plugin["".concat(type,"FileLoadTimestamps")][index]<timestamp){log.info("Determined updated file \"".concat(filePath,"\"."),"Doing a reload.");// Enforce to reload new file version.
167
+ delete currentRequire.cache[currentRequire.resolve(filePath)];var oldScope=plugin[target];plugin[target]=loadFile(filePath,plugin.name,plugin[target]);log.info("File \"".concat(filePath,"\" reloaded."));pluginChanges.push({newScope:plugin[target],oldScope:oldScope,plugin:plugin,target:target})}plugin["".concat(type,"FileLoadTimestamps")][index]=timestamp;index+=1}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}return pluginChanges};/**
168
+ * Extends given configuration object with given plugin specific ones and
169
+ * returns a plugin specific meta information object.
170
+ * @param name - Name of plugin to extend.
171
+ * @param internalName - Internal name of plugin to extend.
172
+ * @param plugins - List of all yet determined plugin information.
173
+ * @param metaConfiguration - Configuration file configuration.
174
+ * @param pluginPath - Path to given plugin.
175
+ * @param encoding - Encoding to use to read and write from child process's.
176
+ * @returns An object of plugin specific meta information.
177
+ */var load=/*#__PURE__*/function(){var _load=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(name,internalName,plugins,metaConfiguration,pluginPath,encoding){var configurationFilePaths,packageConfiguration,_iterator5,_step5,fileName,filePath,sourceConfiguration,apiFilePaths,configuration,_t3;return _regenerator().w(function(_context3){while(1)switch(_context3.p=_context3.n){case 0:if(encoding===void 0){encoding="utf8"}configurationFilePaths=[];packageConfiguration={};_iterator5=_createForOfIteratorHelper(metaConfiguration.fileNames);_context3.p=1;_iterator5.s();case 2:if((_step5=_iterator5.n()).done){_context3.n=5;break}fileName=_step5.value;filePath=(0,path__WEBPACK_IMPORTED_MODULE_4__.resolve)(pluginPath,fileName);_context3.n=3;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)(filePath);case 3:if(!_context3.v){_context3.n=4;break}sourceConfiguration=loadFile(filePath,name);(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(true,/*
178
+ NOTE: Source and target configuration got modified.
179
+ While the target configuration receives the modifications
180
+ the source configuration will lose their modification
181
+ expressions therefore we can use the source configuration
182
+ afterward to extend the target configuration.
183
+ */(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.modifyObject)(packageConfiguration,sourceConfiguration),sourceConfiguration);configurationFilePaths.push(filePath);case 4:_context3.n=2;break;case 5:_context3.n=7;break;case 6:_context3.p=6;_t3=_context3.v;_iterator5.e(_t3);case 7:_context3.p=7;_iterator5.f();return _context3.f(7);case 8:apiFilePaths=["index.js"];if(!Object.keys(packageConfiguration).length){_context3.n=10;break}internalName=packageConfiguration.webNodeInternalName||internalName;configuration=loadConfiguration(internalName,packageConfiguration,metaConfiguration.propertyNames);if(configuration[internalName].package.main)apiFilePaths[0]=configuration[internalName].package.main;_context3.n=9;return loadAPI(apiFilePaths,pluginPath,name,internalName,plugins,encoding,configuration,configurationFilePaths);case 9:return _context3.a(2,_context3.v);case 10:_context3.n=11;return loadAPI(apiFilePaths,pluginPath,name,internalName,plugins,encoding);case 11:return _context3.a(2,_context3.v)}},_callee3,null,[[1,6,7,8]])}));function load(_x3,_x4,_x5,_x6,_x7,_x8){return _load.apply(this,arguments)}return load}();/**
184
+ * Load given plugin api file in given path and generates a plugin specific
185
+ * data structure with useful meta information.
186
+ * @param relativeFilePaths - Paths to file to load relatively from given
187
+ * plugin path.
188
+ * @param pluginPath - Path to plugin directory.
189
+ * @param name - Plugin name to use for proper error messages.
190
+ * @param internalName - Internal plugin name to use for proper error messages.
191
+ * @param plugins - List of plugins to search for trigger callbacks in.
192
+ * @param encoding - Encoding to use to read and write from child process.
193
+ * @param configuration - Plugin specific configurations.
194
+ * @param configurationFilePaths - Plugin specific configuration file paths.
195
+ * @returns Plugin meta information object.
196
+ */var loadAPI=/*#__PURE__*/function(){var _loadAPI=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(relativeFilePaths,pluginPath,name,internalName,plugins,encoding,configuration,configurationFilePaths){var filePath,_iterator6,_step6,fileName,api,nativeAPI,pluginConfiguration,_t4,_t5,_t6;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(encoding===void 0){encoding="utf8"}if(configuration===void 0){configuration=null}if(configurationFilePaths===void 0){configurationFilePaths=[]}filePath=(0,path__WEBPACK_IMPORTED_MODULE_4__.resolve)(pluginPath,relativeFilePaths[0]);_context4.n=1;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)(filePath);case 1:if(_context4.v){_context4.n=10;break}// Determine entry file if given one does not exist.
197
+ _iterator6=_createForOfIteratorHelper((0,fs__WEBPACK_IMPORTED_MODULE_3__.readdirSync)(pluginPath));_context4.p=2;_iterator6.s();case 3:if((_step6=_iterator6.n()).done){_context4.n=7;break}fileName=_step6.value;_t4=!configurationFilePaths.map(function(filePath){return (0,path__WEBPACK_IMPORTED_MODULE_4__.basename)(filePath)}).includes(fileName);if(!_t4){_context4.n=5;break}_context4.n=4;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)((0,path__WEBPACK_IMPORTED_MODULE_4__.resolve)(pluginPath,fileName));case 4:_t4=_context4.v;case 5:if(!_t4){_context4.n=6;break}filePath=(0,path__WEBPACK_IMPORTED_MODULE_4__.resolve)(pluginPath,filePath);if(!["index","main"].includes((0,path__WEBPACK_IMPORTED_MODULE_4__.basename)(filePath,(0,path__WEBPACK_IMPORTED_MODULE_4__.extname)(fileName)))){_context4.n=6;break}return _context4.a(3,7);case 6:_context4.n=3;break;case 7:_context4.n=9;break;case 8:_context4.p=8;_t5=_context4.v;_iterator6.e(_t5);case 9:_context4.p=9;_iterator6.f();return _context4.f(9);case 10:api=null;nativeAPI=false;_t6=configuration&&(/*
198
+ NOTE: Check if a webNode plugin configuration is available
199
+ indicating a backend responsibility for api file.
200
+
201
+ NOTE: One key is always there representing the whole package
202
+ configuration.
203
+ */Object.keys(configuration).length>1||Object.prototype.hasOwnProperty.call(configuration,internalName)&&Object.keys(configuration[internalName]).length>1);if(!_t6){_context4.n=12;break}_context4.n=11;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)(filePath);case 11:_t6=_context4.v;case 12:if(!_t6){_context4.n=13;break}if(filePath.endsWith(".js")){nativeAPI=true;api=function api(state){var _ref;for(var _len3=arguments.length,parameters=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){parameters[_key3-1]=arguments[_key3]}if(plugins[name].scope&&state.hook in plugins[name].scope)return(_ref=plugins[name].scope)[state.hook].apply(_ref,[state].concat(parameters,[module]));throw new Error("NotImplemented: API method \"".concat(state.hook,"\" is not ")+"implemented in plugin \"".concat(name,"\"."))}}else// NOTE: Any executable file can represent an api.
204
+ api=function api(_ref2){var hook=_ref2.hook,data=_ref2.data;for(var _len4=arguments.length,parameters=new Array(_len4>1?_len4-1:0),_key4=1;_key4<_len4;_key4++){parameters[_key4-1]=arguments[_key4]}var childProcessResult=(0,child_process__WEBPACK_IMPORTED_MODULE_1__.spawnSync)(filePath,[hook].concat(_toConsumableArray(parameters.map(function(item){return JSON.stringify(item)}))),{cwd:process.cwd(),encoding:encoding,env:process.env,input:JSON.stringify(data),shell:true,stdio:"inherit"});if(childProcessResult.status===404)return data;var jsonIndicatorPrefix="##!JSON!##";if(childProcessResult.stdout.startsWith(jsonIndicatorPrefix))return JSON.parse(childProcessResult.stdout.substring(jsonIndicatorPrefix.length));return data};case 13:pluginConfiguration=configuration!==null&&configuration!==void 0?configuration:_defineProperty({},internalName,{package:{}});return _context4.a(2,{api:api,apiFileLoadTimestamps:api?[(0,fs__WEBPACK_IMPORTED_MODULE_3__.statSync)(filePath).mtime.getTime()]:[],apiFilePaths:api?[filePath]:[],configuration:pluginConfiguration,configurationFilePaths:configurationFilePaths,configurationFileLoadTimestamps:configurationFilePaths.map(function(filePath){return (0,fs__WEBPACK_IMPORTED_MODULE_3__.statSync)(filePath).mtime.getTime()}),dependencies:Object.prototype.hasOwnProperty.call(pluginConfiguration,internalName)&&pluginConfiguration[internalName].dependencies?pluginConfiguration[internalName].dependencies:[],internalName:internalName,name:name,packageConfiguration:pluginConfiguration[internalName].package,path:pluginPath,scope:nativeAPI?loadFile(filePath,name):null})}},_callee4,null,[[2,8,9,10]])}));function loadAPI(_x9,_x0,_x1,_x10,_x11,_x12,_x13,_x14){return _loadAPI.apply(this,arguments)}return loadAPI}();/**
205
+ * Loads plugin specific configuration object.
206
+ * @param name - Property name where to inject resolved configuration into
207
+ * global one.
208
+ * @param packageConfiguration - Plugin specific package configuration object.
209
+ * @param configurationPropertyNames - Property names to search for to use as
210
+ * entry in plugin configuration file.
211
+ * @returns Determined configuration object.
212
+ */var loadConfiguration=function loadConfiguration(name,packageConfiguration,configurationPropertyNames){/*
213
+ No plugin specific configuration found. Only provide package
214
+ configuration.
215
+ Removing comments (default key prefix to delete is "#").
216
+ */var packageConfigurationCopy=(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.removeKeyPrefixes)((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.copy)(packageConfiguration));var result=_defineProperty({},name,{package:packageConfigurationCopy});var _iterator7=_createForOfIteratorHelper(configurationPropertyNames),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var propertyName=_step7.value;if(packageConfiguration[propertyName]){(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(true,result,packageConfiguration[propertyName]);/*
217
+ NOTE: We should break the cycle here to avoid endless loops
218
+ when traversing this data structure.
219
+ */delete result[name].package[propertyName];break}}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}return result};/**
220
+ * Loads given plugin configurations into global configuration.
221
+ * @param plugins - Topological sorted list of plugins to check for
222
+ * configurations.
223
+ * @param configuration - Global configuration to extend with.
224
+ * @returns Updated given configuration object.
225
+ */var loadConfigurations=function loadConfigurations(plugins,configuration){/*
226
+ First clear current configuration content key by key to let old top
227
+ level configuration object instance untouched.
228
+ */for(var _i6=0,_Object$keys=Object.keys(configuration);_i6<_Object$keys.length;_i6++){var key=_Object$keys[_i6];delete configuration[key]};(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(configuration,(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.copy)(_configurator_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Ay));var _iterator8=_createForOfIteratorHelper(plugins),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var plugin=_step8.value;if(Object.prototype.hasOwnProperty.call(plugin,"configuration")){var pluginConfiguration=(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.copy)(plugin.configuration);(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(true,(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.modifyObject)(configuration,pluginConfiguration),/*
229
+ NOTE: Should be resolved via preceding
230
+ "object.modifyObject" call.
231
+ */pluginConfiguration);/*
232
+ NOTE: We apply provided runtime configuration after each plugin
233
+ specific configuration set to give runtime configuration always
234
+ the highest priority when resolving intermediate configuration
235
+ states.
236
+ */if(configuration.core.runtimeConfiguration)(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(true,configuration,configuration.core.runtimeConfiguration)}}}catch(err){_iterator8.e(err)}finally{_iterator8.f()}return evaluateConfiguration(configuration)};/**
237
+ * Load given api file path and returns exported scope.
238
+ * @param filePath - Path to file to load.
239
+ * @param name - Plugin name to use for proper error messages.
240
+ * @param fallbackScope - Scope to return if an error occurs during loading.
241
+ * If a "null" is given an error will be thrown.
242
+ * @param doLogging - Enables logging.
243
+ * @returns Exported api file scope.
244
+ */var loadFile=function loadFile(filePath,name,fallbackScope,doLogging){if(fallbackScope===void 0){fallbackScope=null}if(doLogging===void 0){doLogging=true}var reference;try{reference=currentRequire.resolve(filePath)}catch(_unused2){// Ignore error.
245
+ }// Clear module cache to get actual new module scope.
246
+ if(reference&&reference in currentRequire.cache)delete currentRequire.cache[reference];var scope;try{scope=currentRequire(filePath)}catch(error){if(fallbackScope){scope=fallbackScope;if(doLogging)log.warn("Couldn't load new api plugin file \"".concat(filePath,"\" for"),"plugin \"".concat(name,"\": ").concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.represent)(error),". Using"),"fallback one.")}else throw new Error("Couldn't load plugin file \"".concat(filePath,"\" for plugin ")+"\"".concat(name,"\": ").concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.represent)(error)),{cause:error})}if(Object.prototype.hasOwnProperty.call(scope,"default")&&scope.default)return scope.default;return scope};/**
247
+ * Extends given configuration object with all plugin specific ones and returns
248
+ * a topological sorted list of plugins with plugins specific meta information
249
+ * stored.
250
+ * @param configuration - Configuration object to extend and use.
251
+ * @returns A topological sorted list of plugins objects.
252
+ */var loadAll=/*#__PURE__*/function(){var _loadAll=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(configuration){var plugins,_i7,_Object$values,directory,compiledRegularExpression,_iterator9,_step9,pluginName,currentPluginPath,internalName,temporaryPlugins,_i8,_Object$values2,plugin,_iterator0,_step0,name,sortedPlugins,_iterator1,_step1,_pluginName,_i9,_Object$entries4,_Object$entries4$_i,_name2,_plugin,_t7,_t8,_t9,_t0;return _regenerator().w(function(_context5){while(1)switch(_context5.p=_context5.n){case 0:plugins={};/*
253
+ Load main plugin configuration at first.
254
+
255
+ NOTE: If application's main is this itself avoid loading it twice.
256
+ */if(!(configuration.name!=="web-node")){_context5.n=2;break}_context5.n=1;return load(configuration.name,determineInternalName(configuration.name,new RegExp(configuration.core.plugin.directories.external.nameRegularExpressionPattern)),plugins,configuration.core.plugin.configuration,configuration.core.context.path,configuration.core.encoding);case 1:plugins[configuration.name]=_context5.v;case 2:_i7=0,_Object$values=Object.values(configuration.core.plugin.directories);case 3:if(!(_i7<_Object$values.length)){_context5.n=14;break}directory=_Object$values[_i7];_context5.n=4;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isDirectory)(directory.path);case 4:if(!_context5.v){_context5.n=13;break}compiledRegularExpression=new RegExp(directory.nameRegularExpressionPattern);_iterator9=_createForOfIteratorHelper((0,fs__WEBPACK_IMPORTED_MODULE_3__.readdirSync)(directory.path));_context5.p=5;_iterator9.s();case 6:if((_step9=_iterator9.n()).done){_context5.n=10;break}pluginName=_step9.value;if(compiledRegularExpression.test(pluginName)){_context5.n=7;break}return _context5.a(3,9);case 7:currentPluginPath=(0,path__WEBPACK_IMPORTED_MODULE_4__.resolve)(directory.path,pluginName);internalName=determineInternalName(pluginName,compiledRegularExpression);_context5.n=8;return load(pluginName,internalName,plugins,configuration.core.plugin.configuration,currentPluginPath,configuration.core.encoding);case 8:plugins[pluginName]=_context5.v;case 9:_context5.n=6;break;case 10:_context5.n=12;break;case 11:_context5.p=11;_t7=_context5.v;_iterator9.e(_t7);case 12:_context5.p=12;_iterator9.f();return _context5.f(12);case 13:_i7++;_context5.n=3;break;case 14:temporaryPlugins={};for(_i8=0,_Object$values2=Object.values(plugins);_i8<_Object$values2.length;_i8++){plugin=_Object$values2[_i8];temporaryPlugins[plugin.internalName]=plugin.dependencies;if(Object.prototype.hasOwnProperty.call(configuration.core.interDependencies,plugin.internalName)){_iterator0=_createForOfIteratorHelper([].concat(configuration.core.interDependencies[plugin.internalName]));try{for(_iterator0.s();!(_step0=_iterator0.n()).done;){name=_step0.value;if(!temporaryPlugins[plugin.internalName].includes(name))temporaryPlugins[plugin.internalName].push(name)}}catch(err){_iterator0.e(err)}finally{_iterator0.f()}}}sortedPlugins=[];_iterator1=_createForOfIteratorHelper((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.sortTopological)(temporaryPlugins));_context5.p=15;_iterator1.s();case 16:if((_step1=_iterator1.n()).done){_context5.n=20;break}_pluginName=_step1.value;_i9=0,_Object$entries4=Object.entries(plugins);case 17:if(!(_i9<_Object$entries4.length)){_context5.n=19;break}_Object$entries4$_i=_slicedToArray(_Object$entries4[_i9],2),_name2=_Object$entries4$_i[0],_plugin=_Object$entries4$_i[1];if(![_plugin.internalName,_name2].includes(_pluginName)){_context5.n=18;break}sortedPlugins.push(_plugin);return _context5.a(3,19);case 18:_i9++;_context5.n=17;break;case 19:_context5.n=16;break;case 20:_context5.n=22;break;case 21:_context5.p=21;_t8=_context5.v;_iterator1.e(_t8);case 22:_context5.p=22;_iterator1.f();return _context5.f(22);case 23:_context5.n=24;return loadConfigurations(sortedPlugins,configuration);case 24:_t9=_context5.v;_t0=sortedPlugins;return _context5.a(2,{configuration:_t9,plugins:_t0})}},_callee5,null,[[15,21,22,23],[5,11,12,13]])}));function loadAll(_x15){return _loadAll.apply(this,arguments)}return loadAll}();/**
257
+ * Transform a list of absolute paths respecting the application context.
258
+ * @param configuration - Configuration object.
259
+ * @param configuration.core - Sub configuration web-node.
260
+ * @param configuration.core.context - Sub web-node context configurations.
261
+ * @param configuration.core.context.path - Current web-nodes path.
262
+ * @param locations - Locations to process.
263
+ * @returns Given and processed locations.
264
+ */var determineLocations=function determineLocations(_ref4,locations){var contextPath=_ref4.core.context.path;if(locations===void 0){locations=[]}locations=[].concat(locations);return locations.length?locations.map(function(location){return (0,path__WEBPACK_IMPORTED_MODULE_4__.resolve)(contextPath,location)}):[contextPath]};/**
265
+ * Checks whether given file path is in provided locations.
266
+ * @param configuration - Configuration object.
267
+ * @param plugins - List of active plugins.
268
+ * @param filePath - Path to search for.
269
+ * @param locations - Locations to search in.
270
+ * @returns A boolean indicating whether given file path is in provided
271
+ * locations.
272
+ */var isInLocations=function isInLocations(configuration,plugins,filePath,locations){var pluginPaths=plugins.map(function(plugin){return plugin.path});var _iterator10=_createForOfIteratorHelper([].concat(locations)),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var location=_step10.value;if(location.startsWith("/")){if(filePath.startsWith((0,path__WEBPACK_IMPORTED_MODULE_4__.join)(configuration.core.context.path,location)))return true}else{var _iterator11=_createForOfIteratorHelper(pluginPaths),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var pluginPath=_step11.value;if(filePath.startsWith((0,path__WEBPACK_IMPORTED_MODULE_4__.resolve)(pluginPath,location)))return true}}catch(err){_iterator11.e(err)}finally{_iterator11.f()}}}}catch(err){_iterator10.e(err)}finally{_iterator10.f()}return false};var pluginAPI={callStack:_callStack,callStackSynchronous:callStackSynchronous,determineInternalName:determineInternalName,determineLocations:determineLocations,evaluateConfiguration:evaluateConfiguration,hotReloadAPIFile:hotReloadAPIFile,hotReloadConfigurationFile:hotReloadConfigurationFile,hotReloadFiles:hotReloadFiles,isInLocations:isInLocations,load:load,loadAll:loadAll,loadAPI:loadAPI,loadConfiguration:loadConfiguration,loadConfigurations:loadConfigurations,loadFile:loadFile};/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (pluginAPI);
273
+ __webpack_async_result__();
274
+ } catch(e) { __webpack_async_result__(e); } }, 1);
275
+
276
+ /***/ }),
277
+ /* 1 */
278
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
279
+
280
+ const x = (y) => {
281
+ const x = {}; __webpack_require__.d(x, y); return x
282
+ }
283
+ const y = (x) => (() => (x))
284
+ module.exports = x({ ["CLOSE_EVENT_NAMES"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.CLOSE_EVENT_NAMES), ["Logger"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.Logger), ["MAXIMAL_NUMBER_OF_ITERATIONS"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.MAXIMAL_NUMBER_OF_ITERATIONS), ["UTILITY_SCOPE"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.UTILITY_SCOPE), ["capitalize"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.capitalize), ["copy"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.copy), ["delimitedToCamelCase"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.delimitedToCamelCase), ["evaluateAsyncDynamicData"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.evaluateAsyncDynamicData), ["evaluateDynamicData"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.evaluateDynamicData), ["extend"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.extend), ["getCurrentRequire"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.getCurrentRequire), ["getUTCTimestamp"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.getUTCTimestamp), ["importFilesystemAPI"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.importFilesystemAPI), ["isDirectory"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.isDirectory), ["isFile"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.isFile), ["isFunction"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.isFunction), ["isObject"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.isObject), ["isPlainObject"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.isPlainObject), ["modifyObject"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.modifyObject), ["parseEncodedObject"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.parseEncodedObject), ["removeKeyPrefixes"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.removeKeyPrefixes), ["removeKeysInEvaluation"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.removeKeysInEvaluation), ["represent"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.represent), ["sortTopological"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.sortTopological) });
285
+
286
+ /***/ }),
287
+ /* 2 */
288
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
289
+
290
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
291
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
292
+ /* harmony export */ Ay: () => (__WEBPACK_DEFAULT_EXPORT__),
293
+ /* harmony export */ HF: () => (/* binding */ configuration),
294
+ /* harmony export */ lE: () => (/* binding */ currentRequire)
295
+ /* harmony export */ });
296
+ /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
297
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
298
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
299
+ /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
300
+ /* harmony import */ var _pluginAPI_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(0);
301
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pluginAPI_js__WEBPACK_IMPORTED_MODULE_4__]);
302
+ var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
303
+ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_async_dependencies_result__[0];
304
+ // #!/usr/bin/env node
305
+ // -*- coding: utf-8 -*-
306
+ /* !
307
+ region header
308
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
309
+
310
+ License
311
+ -------
312
+
313
+ This library written by Torben Sickert stands under a creative commons
314
+ naming 3.0 unported license.
315
+ See https://creativecommons.org/licenses/by/3.0/deed.de
316
+ endregion
317
+ */// region imports
318
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var _mainPackageConfigura;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)};// endregion
319
+ var currentRequire=await (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.getCurrentRequire)();if(currentRequire===null)throw new Error("Missing synchronous module loading mechanism (require method).");/*
320
+ To assume to go two folder up from this file until there is no
321
+ "node_modules" parent folder is usually resilient again dealing with
322
+ projects where current working directory isn't the projects directory and
323
+ this library is located as a nested dependency.
324
+ */_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.context={path:__webpack_dirname__,type:"relative"};for(var iteration=0;iteration<clientnode__WEBPACK_IMPORTED_MODULE_0__.MAXIMAL_NUMBER_OF_ITERATIONS.value;iteration++){_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.context.path=(0,path__WEBPACK_IMPORTED_MODULE_2__.resolve)(_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.context.path,"../../");if((0,path__WEBPACK_IMPORTED_MODULE_2__.basename)((0,path__WEBPACK_IMPORTED_MODULE_2__.dirname)(_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.context.path))!=="node_modules")break}if(_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.context.path==="/"||(0,path__WEBPACK_IMPORTED_MODULE_2__.basename)((0,path__WEBPACK_IMPORTED_MODULE_2__.dirname)(process.cwd()))==="node_modules"||(0,path__WEBPACK_IMPORTED_MODULE_2__.basename)((0,path__WEBPACK_IMPORTED_MODULE_2__.dirname)(process.cwd()))===".staging"&&(0,path__WEBPACK_IMPORTED_MODULE_2__.basename)((0,path__WEBPACK_IMPORTED_MODULE_2__.dirname)((0,path__WEBPACK_IMPORTED_MODULE_2__.dirname)(process.cwd())))==="node_modules")/*
325
+ NOTE: If we are dealing was a dependent project use current directory
326
+ as context.
327
+ */_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.context.path=process.cwd();else/*
328
+ NOTE: If the current working directory references this file via a
329
+ linked "node_modules" folder using current working directory as context
330
+ is a better assumption than two folders up the hierarchy.
331
+ */try{if((0,fs__WEBPACK_IMPORTED_MODULE_1__.lstatSync)((0,path__WEBPACK_IMPORTED_MODULE_2__.join)(process.cwd(),"node_modules")).isSymbolicLink())_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.context.path=process.cwd()}catch(_unused){// Ignore error.
332
+ }var mainPackageConfiguration={name:"main"};try{mainPackageConfiguration=currentRequire((0,path__WEBPACK_IMPORTED_MODULE_2__.join)(_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.context.path,"package"))}catch(_unused2){_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.context.path=process.cwd()}var name=((_mainPackageConfigura=mainPackageConfiguration.webDocumentation)===null||_mainPackageConfigura===void 0?void 0:_mainPackageConfigura.name)||mainPackageConfiguration.name||"main";var applicationConfiguration=mainPackageConfiguration.webNode||_defineProperty({},name,{name:name,package:mainPackageConfiguration});// endregion
333
+ _package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.name=_package_json__WEBPACK_IMPORTED_MODULE_3__.webDocumentation.name||_package_json__WEBPACK_IMPORTED_MODULE_3__.name;var now=new Date;var scope=_objectSpread(_objectSpread({},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE),{},{currentPath:process.cwd(),fs:fs__WEBPACK_IMPORTED_MODULE_1__["default"],path:path__WEBPACK_IMPORTED_MODULE_2__["default"],pluginAPI:_pluginAPI_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Ay,webNodePath:__webpack_dirname__,now:now,nowUTCTimestamp:(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.getUTCTimestamp)(now)});var configuration=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluateDynamicData)(_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode,{scope:scope});delete _package_json__WEBPACK_IMPORTED_MODULE_3__.webNode;(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.extend)(true,(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.modifyObject)(configuration,applicationConfiguration),applicationConfiguration);var result={};var _iterator=_createForOfIteratorHelper(process.argv.slice(1)),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var argument=_step.value;var subResult=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.parseEncodedObject)(argument,configuration,"configuration");if((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(subResult))(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.extend)(true,result,subResult)}}catch(err){_iterator.e(err)}finally{_iterator.f()}if(Object.keys(result).length>0){(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.extend)(true,/*
334
+ NOTE: "object.modifyObject" removes modifications in "result"
335
+ in-place before it is used as extending source.
336
+ */(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.modifyObject)(configuration,result),result);configuration.core.runtimeConfiguration=result}configuration=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluateDynamicData)((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.removeKeysInEvaluation)(configuration),{scope:scope});configuration.name=name;configuration.core.package=_package_json__WEBPACK_IMPORTED_MODULE_3__;/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (configuration);
337
+ __webpack_async_result__();
338
+ } catch(e) { __webpack_async_result__(e); } }, 1);
339
+
340
+ /***/ }),
341
+ /* 3 */
342
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
343
+
344
+ const x = (y) => {
345
+ const x = {}; __webpack_require__.d(x, y); return x
346
+ }
347
+ const y = (x) => (() => (x))
348
+ module.exports = x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_fs__["default"]), ["lstatSync"]: () => (__WEBPACK_EXTERNAL_MODULE_fs__.lstatSync), ["readdirSync"]: () => (__WEBPACK_EXTERNAL_MODULE_fs__.readdirSync), ["statSync"]: () => (__WEBPACK_EXTERNAL_MODULE_fs__.statSync) });
349
+
350
+ /***/ }),
351
+ /* 4 */
352
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
353
+
354
+ const x = (y) => {
355
+ const x = {}; __webpack_require__.d(x, y); return x
356
+ }
357
+ const y = (x) => (() => (x))
358
+ module.exports = x({ ["basename"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.basename), ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_path__["default"]), ["dirname"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.dirname), ["extname"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.extname), ["join"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.join), ["resolve"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.resolve) });
359
+
360
+ /***/ }),
361
+ /* 5 */
362
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
363
+
364
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
365
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
366
+ /* harmony export */ Ad: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.Ad),
367
+ /* harmony export */ GH: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.GH),
368
+ /* harmony export */ Gy: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.Gy),
369
+ /* harmony export */ HF: () => (/* reexport safe */ _configurator_js__WEBPACK_IMPORTED_MODULE_0__.HF),
370
+ /* harmony export */ Hh: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.Hh),
371
+ /* harmony export */ MM: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.MM),
372
+ /* harmony export */ Rm: () => (/* binding */ log),
373
+ /* harmony export */ Vx: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.Vx),
374
+ /* harmony export */ ZN: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.ZN),
375
+ /* harmony export */ dw: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.dw),
376
+ /* harmony export */ gh: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.gh),
377
+ /* harmony export */ gl: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.gl),
378
+ /* harmony export */ i9: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.i9),
379
+ /* harmony export */ iW: () => (/* binding */ main),
380
+ /* harmony export */ lE: () => (/* reexport safe */ _configurator_js__WEBPACK_IMPORTED_MODULE_0__.lE),
381
+ /* harmony export */ lT: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.lT),
382
+ /* harmony export */ m7: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.m7),
383
+ /* harmony export */ nQ: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.nQ),
384
+ /* harmony export */ u2: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.u2),
385
+ /* harmony export */ vF: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.vF)
386
+ /* harmony export */ });
387
+ /* harmony import */ var _configurator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
388
+ /* harmony import */ var _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
389
+ /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
390
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_configurator_js__WEBPACK_IMPORTED_MODULE_0__, _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__]);
391
+ ([_configurator_js__WEBPACK_IMPORTED_MODULE_0__, _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
392
+ // #!/usr/bin/env babel-node
393
+ // -*- coding: utf-8 -*-
394
+ /** @module web-node *//* !
395
+ region header
396
+ [Project page](https://torben.website/webNode)
397
+
398
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
399
+
400
+ License
401
+ -------
402
+
403
+ This library written by Torben Sickert stands under a creative commons
404
+ naming 3.0 unported license.
405
+ See https://creativecommons.org/licenses/by/3.0/deed.de
406
+ endregion
407
+ */function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){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 _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}// region imports
408
+ ;// endregion
409
+ var log=new clientnode__WEBPACK_IMPORTED_MODULE_2__.Logger({name:"web-node"});clientnode__WEBPACK_IMPORTED_MODULE_2__.Logger.configureAllInstances();var handleError=/*#__PURE__*/function(){var _handleError=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(state){var _t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:_context.p=0;_context.n=1;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)(_objectSpread(_objectSpread({},state),{},{hook:"error"}));case 1:_context.n=4;break;case 2:_context.p=2;_t=_context.v;if(!state.configuration.core.debug){_context.n=3;break}throw _t;case 3:log.error(_t);case 4:return _context.a(2)}},_callee,null,[[0,2]])}));function handleError(_x){return _handleError.apply(this,arguments)}return handleError}();var main=/*#__PURE__*/function(){var _main=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(){var _yield$loadAll,configuration,plugins,pluginsWithChangedConfiguration,_iterator,_step,type,services,servicePromises,exitTriggered,_i,_Object$keys,name,_iterator2,_step2,plugin,result,_message,_i2,_Object$entries,_Object$entries$_i,_name,promise,finished,closeHandler,_iterator3,_step3,closeEventName,cancelTriggered,_t2,_t3,_t4,_t5,_t6,_t7;return _regenerator().w(function(_context3){while(1)switch(_context3.p=_context3.n){case 0:_context3.n=1;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .loadAll */ .gh)((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.copy)(_configurator_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay));case 1:_yield$loadAll=_context3.v;configuration=_yield$loadAll.configuration;plugins=_yield$loadAll.plugins;_context3.n=2;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"initialize",plugins:plugins});case 2:if(plugins.length)log.info("Loaded plugins: \""+plugins.map(function(plugin){return plugin.internalName}).join("\", \"")+"\".");pluginsWithChangedConfiguration=plugins.filter(function(plugin){return Boolean(plugin.configurationFilePaths.length)});_iterator=_createForOfIteratorHelper(["pre","post"]);_context3.p=3;_iterator.s();case 4:if((_step=_iterator.n()).done){_context3.n=6;break}type=_step.value;_context3.n=5;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"".concat(type,"ConfigurationLoaded"),plugins:plugins,pluginsWithChangedConfiguration:pluginsWithChangedConfiguration});case 5:_context3.n=4;break;case 6:_context3.n=8;break;case 7:_context3.p=7;_t2=_context3.v;_iterator.e(_t2);case 8:_context3.p=8;_iterator.f();return _context3.f(8);case 9:// endregion
410
+ services={};servicePromises={};exitTriggered=false;_context3.p=10;_context3.n=11;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"preLoadService",plugins:plugins,services:services});case 11:for(_i=0,_Object$keys=Object.keys(services);_i<_Object$keys.length;_i++){name=_Object$keys[_i];log.info("Service \"".concat(name,"\" initialized."))}_iterator2=_createForOfIteratorHelper(plugins);_context3.p=12;_iterator2.s();case 13:if((_step2=_iterator2.n()).done){_context3.n=20;break}plugin=_step2.value;if(!plugin.api){_context3.n=19;break}_context3.n=14;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"preLoad".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.capitalize)(plugin.internalName),"Service"),plugins:plugins,services:services});case 14:result=null;_context3.p=15;_context3.n=16;return plugin.api({configuration:configuration,hook:"loadService",pluginAPI:_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Ay,plugins:plugins,servicePromises:servicePromises,services:services});case 16:result=_context3.v;_context3.n=18;break;case 17:_context3.p=17;_t3=_context3.v;if(_t3!==null&&_t3!==void 0&&(_message=_t3.message)!==null&&_message!==void 0&&_message.startsWith("NotImplemented:")){_context3.n=18;break}throw new Error("Plugin \"".concat(plugin.internalName,"\" ")+(plugin.internalName===plugin.name?"":"(".concat(plugin.name,") "))+"throws: ".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.represent)(_t3)," 'during asynchrone ")+"hook \"loadService\".",{cause:_t3});case 18:if(result)for(_i2=0,_Object$entries=Object.entries(result);_i2<_Object$entries.length;_i2++){_Object$entries$_i=_slicedToArray(_Object$entries[_i2],2),_name=_Object$entries$_i[0],promise=_Object$entries$_i[1];if((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isObject)(promise)&&"then"in promise){log.info("Service \"".concat(_name,"\" started."));servicePromises[_name]=promise}else log.info("Service \"".concat(_name,"\" loaded."))}_context3.n=19;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"postLoad".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.capitalize)(plugin.internalName),"Service"),plugins:plugins,servicePromises:servicePromises,services:services});case 19:_context3.n=13;break;case 20:_context3.n=22;break;case 21:_context3.p=21;_t4=_context3.v;_iterator2.e(_t4);case 22:_context3.p=22;_iterator2.f();return _context3.f(22);case 23:_context3.n=24;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"postLoadService",plugins:plugins,servicePromises:servicePromises,services:services});case 24:// endregion
411
+ // region register close handler
412
+ finished=false;closeHandler=function closeHandler(){if(!finished)(0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStackSynchronous */ .gl)({configuration:configuration,data:undefined,hook:"exit",plugins:plugins.slice().reverse(),servicePromises:servicePromises,services:services});finished=true};_iterator3=_createForOfIteratorHelper(clientnode__WEBPACK_IMPORTED_MODULE_2__.CLOSE_EVENT_NAMES);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){closeEventName=_step3.value;process.on(closeEventName,closeHandler)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}cancelTriggered=false;/*
413
+ NOTE: "setRawMode" is only available when the input is provided by
414
+ a TTY and not as direct stream from stdin.
415
+
416
+ NOTE: Access property via string to avoid lint error
417
+ "@typescript-eslint/unbound-method".
418
+ */// eslint-disable-next-line @typescript-eslint/unbound-method
419
+ if((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFunction)(process.stdin["setRawMode"]))process.stdin.setRawMode(true);process.stdin.resume();process.stdin.setEncoding(configuration.core.encoding);process.stdin.on("data",function(key){void _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(){return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(!(key==="\x03")){_context2.n=3;break}if(!cancelTriggered){_context2.n=1;break}log.warn("Stopping ungracefully.");_context2.n=2;break;case 1:cancelTriggered=true;log.info("You have requested to shut down all services. A","second request will force to stop ungracefully.");_context2.n=2;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"shouldExit",plugins:plugins,servicePromises:servicePromises,services:services});case 2:process.exit();case 3:process.stdout.write(key);case 4:return _context2.a(2)}},_callee2)}))()});// endregion
420
+ _context3.p=25;_context3.n=26;return Promise.all(Object.keys(servicePromises).map(function(name){return servicePromises[name]}));case 26:_context3.n=28;break;case 27:_context3.p=27;_t5=_context3.v;case 28:exitTriggered=true;_context3.n=29;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"shouldExit",plugins:plugins,servicePromises:servicePromises,services:services});case 29:process.exit();_context3.n=38;break;case 30:_context3.p=30;_t6=_context3.v;_context3.n=31;return handleError({configuration:configuration,data:_t6,plugins:plugins,servicePromises:servicePromises,services:services});case 31:if(exitTriggered){_context3.n=35;break}_context3.p=32;_context3.n=33;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"shouldExit",plugins:plugins,servicePromises:servicePromises,services:services});case 33:_context3.n=35;break;case 34:_context3.p=34;_t7=_context3.v;_context3.n=35;return handleError({configuration:configuration,data:_t7,plugins:plugins,servicePromises:servicePromises,services:services});case 35:if(!configuration.core.debug){_context3.n=36;break}throw _t6;case 36:log.error(_t6);case 37:process.exit(1);case 38:return _context3.a(2)}},_callee3,null,[[32,34],[25,27],[15,17],[12,21,22,23],[10,30],[3,7,8,9]])}));function main(){return _main.apply(this,arguments)}return main}();if(__webpack_require__.c[__webpack_require__.s] === module)void main();/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (main);
421
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, [
422
+ /* harmony export */ "Ay", 0, /* export default binding */ __WEBPACK_DEFAULT_EXPORT__
423
+ /* harmony export */ ]);
424
+
425
+ __webpack_async_result__();
426
+ } catch(e) { __webpack_async_result__(e); } });
427
+
428
+ /***/ }),
429
+ /* 6 */
430
+ /***/ ((module) => {
431
+
432
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"web-node","version":"1.0.582","description":"High level javaScript backend plugin system and configuration merger.","keywords":["api","backend","management","plugin","web"],"homepage":"https://torben.website/web-node","bugs":{"email":"info@torben.website","url":"https://github.com/thaibault/web-node/issues"},"license":"CC-BY-3.0","author":{"name":"Torben Sickert","email":"info@torben.website","url":"https://torben.website"},"files":["configurator.d.ts","index.d.ts","index.js","pluginAPI.d.ts","type.d.ts","unixCrypt.d.ts","unixCrypt.js"],"bin":"index.js","type":"module","repository":{"type":"git","url":"https://github.com/thaibault/web-node.git"},"scripts":{"build":"yarn build:types; yarn build:plain","build:plain":"weboptimizer build","build:types":"weboptimizer build:types","check":"yarn check:types; yarn lint","check:types":"weboptimizer check:types","clear":"weboptimizer clear","document":"weboptimizer document","lint":"weboptimizer lint","prepare":"yarn build","serve":"yarn build:plain && yarn start","start":"./index.js \'{plugin: {hotReloading: true}}\'","prepare:test":"yarn clear && cd dummyPlugin && shx touch yarn.lock && yarn build && cd ..","test":"yarn prepare:test && weboptimizer test","test:coverage":"yarn prepare:test && weboptimizer test:coverage","test:coverage:report":"yarn prepare:test && weboptimizer test:coverage:report","update:documentation":"web-documentation","watch":"weboptimizer build --watch"},"devDependencies":{"@babel/cli":"^8.0.4","@babel/eslint-parser":"^8.0.1","@babel/runtime":"^8.0.0","@eslint/js":"^10.0.1","@stylistic/eslint-plugin":"^5.10.0","@types/node":"^26.1.2","@types/webpack-env":"^1.18.8","@typescript-eslint/eslint-plugin":"^8.65.0","@typescript-eslint/parser":"^8.65.0","clientnode":"^4.0.1481","eslint":"^10.8.0","eslint-config-google":"^0.14.0","eslint-plugin-jsdoc":"^63.3.2","jest":"^30.4.2","jsdoc":"^4.0.5","shx":"^0.4.0","typescript-eslint":"^8.65.0","web-documentation":"^1.0.44","weboptimizer":"^4.0.47"},"peerDependencies":{"@babel/runtime":"*","clientnode":"*"},"peerDependenciesMeta":{"@babel/runtime":{"optional":true}},"engines":{"node":">=24","npm":">=11","yarn":">=4"},"resolutions":{"colors":"1.4.0","globals@npm:^14.0.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^11.1.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^9.18.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"},"sideEffects":true,"webDocumentation":{"trackingCode":"UA-40192634-9"},"webNode":{"core":{"context":{"path":"./","type":"relative"},"debug":false,"encoding":"utf8","interDependencies":{},"name":"web-node","plugin":{"configuration":{"fileNames":["package.json","private-package.json"],"propertyNames":["webNode","webnode","web-node"]},"directories":{"external":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-]+?)-?[wW]eb-?[nN]ode-?[pP]lugin$","path":{"__evaluate__":"`${currentPath}/node_modules/`"}},"internal":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-_].*)$","path":{"__evaluate__":"`${currentPath}/plugins/`"}}},"hotReloading":false}}},"webOptimizer":{"assetPattern":{"javaScript":{"includeFilePathRegularExpression":"^(.+/)?index\\\\.js$","pattern":{"#":"This is how we can make our main exported artefact executable.","__evaluate__":"`#!/usr/bin/env node\\n// -*- coding: utf-8 -*-\\nif(import.meta.main)module.paths.unshift(\'/application/node_modules\');{1}`"}}},"injection":{"entry":{"__evaluate__":"2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith(\'test\') ? {testBundle: \'test\'} : {index: \'./index.ts\', unixCrypt: \'./unixCrypt.ts\'}"}},"module":{"optimizer":{"terser":{"terserOptions":{"compress":{"#":"To provide a logging output we need to exclude this feature.","drop_console":{"__evaluate__":"false"},"drop_debugger":{"__evaluate__":"false"}}}}}},"targetTechnology":{"boilerplate":"node","payload":"node"}},"packageManager":"yarn@4.14.1+sha512.64df448055b2d37ba269d7db535a469b8da93f8ef1140c25fd7a83c00a8fbaacb214ca0e02553b92a2c54cef78bb67d0b4817fab02001df0e24fac0faccc3b42"}');
433
+
434
+ /***/ }),
435
+ /* 7 */
436
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
437
+
438
+ const x = (y) => {
439
+ const x = {}; __webpack_require__.d(x, y); return x
440
+ }
441
+ const y = (x) => (() => (x))
442
+ module.exports = x({ });
443
+
444
+ /***/ }),
445
+ /* 8 */
446
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
447
+
448
+ const x = (y) => {
449
+ const x = {}; __webpack_require__.d(x, y); return x
450
+ }
451
+ const y = (x) => (() => (x))
452
+ module.exports = x({ ["spawnSync"]: () => (__WEBPACK_EXTERNAL_MODULE_child_process__.spawnSync) });
453
+
454
+ /***/ })
455
+ /******/ ]);
456
+ /************************************************************************/
457
+ /******/ // The module cache
458
+ /******/ const __webpack_module_cache__ = {};
459
+ /******/
460
+ /******/ // The require function
461
+ /******/ function __webpack_require__(moduleId) {
462
+ /******/ // Check if module is in cache
463
+ /******/ const cachedModule = __webpack_module_cache__[moduleId];
464
+ /******/ if (cachedModule !== undefined) {
465
+ /******/ return cachedModule.exports;
466
+ /******/ }
467
+ /******/ // Create a new module (and put it into the cache)
468
+ /******/ const module = __webpack_module_cache__[moduleId] = {
469
+ /******/ id: moduleId,
470
+ /******/ loaded: false,
471
+ /******/ exports: {}
472
+ /******/ };
473
+ /******/
474
+ /******/ // Execute the module function
475
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
476
+ /******/
477
+ /******/ // Flag the module as loaded
478
+ /******/ module.loaded = true;
479
+ /******/
480
+ /******/ // Return the exports of the module
481
+ /******/ return module.exports;
482
+ /******/ }
483
+ /******/
484
+ /******/ // expose the module cache
485
+ /******/ __webpack_require__.c = __webpack_module_cache__;
486
+ /******/
487
+ /************************************************************************/
488
+ /******/ /* webpack/runtime/async module */
489
+ /******/ (() => {
490
+ /******/ const webpackQueues = Symbol("webpack queues");
491
+ /******/ const webpackExports = Symbol("webpack exports");
492
+ /******/ const webpackError = Symbol("webpack error");
493
+ /******/
494
+ /******/ const resolveQueue = (queue) => {
495
+ /******/ if(queue?.d < 1) {
496
+ /******/ queue.d = 1;
497
+ /******/ queue.forEach((fn) => (fn.r--));
498
+ /******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));
499
+ /******/ }
500
+ /******/ }
501
+ /******/ const wrapDeps = (deps) => (deps.map((dep) => {
502
+ /******/ if(dep !== null && typeof dep === "object") {
503
+ /******/
504
+ /******/ if(dep[webpackQueues]) return dep;
505
+ /******/ if(dep.then) {
506
+ /******/ const queue = [];
507
+ /******/ queue.d = 0;
508
+ /******/ dep.then((r) => {
509
+ /******/ obj[webpackExports] = r;
510
+ /******/ resolveQueue(queue);
511
+ /******/ }, (e) => {
512
+ /******/ obj[webpackError] = e;
513
+ /******/ resolveQueue(queue);
514
+ /******/ });
515
+ /******/ const obj = {};
516
+ /******/
517
+ /******/ obj[webpackQueues] = (fn) => (fn(queue));
518
+ /******/ return obj;
519
+ /******/ }
520
+ /******/ }
521
+ /******/ const ret = {};
522
+ /******/ ret[webpackQueues] = x => {};
523
+ /******/ ret[webpackExports] = dep;
524
+ /******/ return ret;
525
+ /******/ }));
526
+ /******/ __webpack_require__.a = (module, body, hasAwait) => {
527
+ /******/ let queue;
528
+ /******/ hasAwait && ((queue = []).d = -1);
529
+ /******/ const depQueues = new Set();
530
+ /******/ const exports = module.exports;
531
+ /******/ let currentDeps;
532
+ /******/ let outerResolve;
533
+ /******/ let reject;
534
+ /******/ const promise = new Promise((resolve, rej) => {
535
+ /******/ reject = rej;
536
+ /******/ outerResolve = resolve;
537
+ /******/ });
538
+ /******/ promise[webpackExports] = exports;
539
+ /******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {}));
540
+ /******/ module.exports = promise;
541
+ /******/ const handle = (deps) => {
542
+ /******/ currentDeps = wrapDeps(deps);
543
+ /******/ let fn;
544
+ /******/ const getResult = () => (currentDeps.map((d) => {
545
+ /******/
546
+ /******/ if(d[webpackError]) throw d[webpackError];
547
+ /******/ return d[webpackExports];
548
+ /******/ }))
549
+ /******/ const promise = new Promise((resolve) => {
550
+ /******/ fn = () => (resolve(getResult));
551
+ /******/ fn.r = 0;
552
+ /******/ const fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));
553
+ /******/ currentDeps.forEach((dep) => (dep[webpackQueues](fnQueue)));
554
+ /******/ });
555
+ /******/ return fn.r ? promise : getResult();
556
+ /******/ }
557
+ /******/ const done = (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))
558
+ /******/
559
+ /******/ body(handle, done);
560
+ /******/ queue?.d < 0 && (queue.d = 0);
561
+ /******/ };
562
+ /******/ })();
563
+ /******/
564
+ /******/ /* webpack/runtime/define property getters */
565
+ /******/ (() => {
566
+ /******/ // define getter/value functions for harmony exports
567
+ /******/ __webpack_require__.d = (exports, definition) => {
568
+ /******/ if(Array.isArray(definition)) {
569
+ /******/ var i = 0;
570
+ /******/ while(i < definition.length) {
571
+ /******/ var key = definition[i++];
572
+ /******/ var binding = definition[i++];
573
+ /******/ if(!__webpack_require__.o(exports, key)) {
574
+ /******/ if(binding === 0) {
575
+ /******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
576
+ /******/ } else {
577
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
578
+ /******/ }
579
+ /******/ } else if(binding === 0) { i++; }
580
+ /******/ }
581
+ /******/ } else {
582
+ /******/ for(var key in definition) {
583
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
584
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
585
+ /******/ }
586
+ /******/ }
587
+ /******/ }
588
+ /******/ };
589
+ /******/ })();
590
+ /******/
591
+ /******/ /* webpack/runtime/harmony module decorator */
592
+ /******/ (() => {
593
+ /******/ __webpack_require__.hmd = (module) => {
594
+ /******/ module = Object.create(module);
595
+ /******/ if (!module.children) module.children = [];
596
+ /******/ Object.defineProperty(module, 'exports', {
597
+ /******/ enumerable: true,
598
+ /******/ set() {
599
+ /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
600
+ /******/ }
601
+ /******/ });
602
+ /******/ return module;
603
+ /******/ };
604
+ /******/ })();
605
+ /******/
606
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
607
+ /******/ (() => {
608
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
609
+ /******/ })();
610
+ /******/
611
+ /************************************************************************/
612
+ /******/
613
+ /******/ // module cache are used so entry inlining is disabled
614
+ /******/ // startup
615
+ /******/ // Load entry module and return exports
616
+ /******/ let __webpack_exports__ = __webpack_require__(__webpack_require__.s = 5);
617
+ /******/ __webpack_exports__ = await __webpack_exports__;
618
+ /******/ const __webpack_exports__callStack = __webpack_exports__.lT;
619
+ /******/ const __webpack_exports__callStackSynchronous = __webpack_exports__.gl;
620
+ /******/ const __webpack_exports__configuration = __webpack_exports__.HF;
621
+ /******/ const __webpack_exports__currentRequire = __webpack_exports__.lE;
622
+ /******/ const __webpack_exports__default = __webpack_exports__.Ay;
623
+ /******/ const __webpack_exports__determineInternalName = __webpack_exports__.Gy;
624
+ /******/ const __webpack_exports__determineLocations = __webpack_exports__.m7;
625
+ /******/ const __webpack_exports__evaluateConfiguration = __webpack_exports__.u2;
626
+ /******/ const __webpack_exports__hotReloadAPIFile = __webpack_exports__.dw;
627
+ /******/ const __webpack_exports__hotReloadConfigurationFile = __webpack_exports__.Vx;
628
+ /******/ const __webpack_exports__hotReloadFiles = __webpack_exports__.Ad;
629
+ /******/ const __webpack_exports__isInLocations = __webpack_exports__.GH;
630
+ /******/ const __webpack_exports__load = __webpack_exports__.Hh;
631
+ /******/ const __webpack_exports__loadAPI = __webpack_exports__.nQ;
632
+ /******/ const __webpack_exports__loadAll = __webpack_exports__.gh;
633
+ /******/ const __webpack_exports__loadConfiguration = __webpack_exports__.vF;
634
+ /******/ const __webpack_exports__loadConfigurations = __webpack_exports__.i9;
635
+ /******/ const __webpack_exports__loadFile = __webpack_exports__.ZN;
636
+ /******/ const __webpack_exports__log = __webpack_exports__.Rm;
637
+ /******/ const __webpack_exports__main = __webpack_exports__.iW;
638
+ /******/ const __webpack_exports__pluginAPI = __webpack_exports__.MM;
639
+ /******/ export { __webpack_exports__callStack as callStack, __webpack_exports__callStackSynchronous as callStackSynchronous, __webpack_exports__configuration as configuration, __webpack_exports__currentRequire as currentRequire, __webpack_exports__default as default, __webpack_exports__determineInternalName as determineInternalName, __webpack_exports__determineLocations as determineLocations, __webpack_exports__evaluateConfiguration as evaluateConfiguration, __webpack_exports__hotReloadAPIFile as hotReloadAPIFile, __webpack_exports__hotReloadConfigurationFile as hotReloadConfigurationFile, __webpack_exports__hotReloadFiles as hotReloadFiles, __webpack_exports__isInLocations as isInLocations, __webpack_exports__load as load, __webpack_exports__loadAPI as loadAPI, __webpack_exports__loadAll as loadAll, __webpack_exports__loadConfiguration as loadConfiguration, __webpack_exports__loadConfigurations as loadConfigurations, __webpack_exports__loadFile as loadFile, __webpack_exports__log as log, __webpack_exports__main as main, __webpack_exports__pluginAPI as pluginAPI };
640
+ /******/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-node",
3
- "version": "1.0.581",
3
+ "version": "1.0.582",
4
4
  "description": "High level javaScript backend plugin system and configuration merger.",
5
5
  "keywords": [
6
6
  "api",
@@ -30,6 +30,7 @@
30
30
  "unixCrypt.js"
31
31
  ],
32
32
  "bin": "index.js",
33
+ "type": "module",
33
34
  "repository": {
34
35
  "type": "git",
35
36
  "url": "https://github.com/thaibault/web-node.git"
@@ -53,27 +54,26 @@
53
54
  "update:documentation": "web-documentation",
54
55
  "watch": "weboptimizer build --watch"
55
56
  },
56
- "runkitExample": "require('@babel/runtime/package.json')\nrequire('clientnode/package.json')\n\nconst {loadFile} = require('web-node')\n\nloadFile('./unixCrypt.js', 'crypt')('test')",
57
57
  "devDependencies": {
58
- "@babel/cli": "^7.28.6",
59
- "@babel/eslint-parser": "^7.28.6",
60
- "@babel/runtime": "^7.29.2",
58
+ "@babel/cli": "^8.0.4",
59
+ "@babel/eslint-parser": "^8.0.1",
60
+ "@babel/runtime": "^8.0.0",
61
61
  "@eslint/js": "^10.0.1",
62
62
  "@stylistic/eslint-plugin": "^5.10.0",
63
- "@types/node": "^25.6.0",
63
+ "@types/node": "^26.1.2",
64
64
  "@types/webpack-env": "^1.18.8",
65
- "@typescript-eslint/eslint-plugin": "^8.59.0",
66
- "@typescript-eslint/parser": "^8.59.0",
67
- "clientnode": "^4.0.1388",
68
- "eslint": "^10.2.1",
65
+ "@typescript-eslint/eslint-plugin": "^8.65.0",
66
+ "@typescript-eslint/parser": "^8.65.0",
67
+ "clientnode": "^4.0.1481",
68
+ "eslint": "^10.8.0",
69
69
  "eslint-config-google": "^0.14.0",
70
- "eslint-plugin-jsdoc": "^62.9.0",
71
- "jest": "^30.3.0",
70
+ "eslint-plugin-jsdoc": "^63.3.2",
71
+ "jest": "^30.4.2",
72
72
  "jsdoc": "^4.0.5",
73
73
  "shx": "^0.4.0",
74
- "typescript-eslint": "^8.59.0",
75
- "web-documentation": "^1.0.2",
76
- "weboptimizer": "^3.0.22"
74
+ "typescript-eslint": "^8.65.0",
75
+ "web-documentation": "^1.0.44",
76
+ "weboptimizer": "^4.0.47"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "@babel/runtime": "*",
@@ -96,8 +96,7 @@
96
96
  "globals@npm:^9.18.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"
97
97
  },
98
98
  "sideEffects": true,
99
- "documentationWebsite": {
100
- "name": "web-node",
99
+ "webDocumentation": {
101
100
  "trackingCode": "UA-40192634-9"
102
101
  },
103
102
  "webNode": {
@@ -146,14 +145,10 @@
146
145
  "includeFilePathRegularExpression": "^(.+/)?index\\.js$",
147
146
  "pattern": {
148
147
  "#": "This is how we can make our main exported artefact executable.",
149
- "__evaluate__": "`#!/usr/bin/env node\n// -*- coding: utf-8 -*-\n${self.generic.assetPattern.javaScript.pattern}if(module===eval('require.main'))module.paths.unshift('/application/node_modules');{1}`"
148
+ "__evaluate__": "`#!/usr/bin/env node\n// -*- coding: utf-8 -*-\nif(import.meta.main)module.paths.unshift('/application/node_modules');{1}`"
150
149
  }
151
150
  }
152
151
  },
153
- "exportFormat": {
154
- "external": "commonjs2",
155
- "self": "commonjs2"
156
- },
157
152
  "injection": {
158
153
  "entry": {
159
154
  "__evaluate__": "2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith('test') ? {testBundle: 'test'} : {index: './index.ts', unixCrypt: './unixCrypt.ts'}"
@@ -161,9 +156,18 @@
161
156
  },
162
157
  "module": {
163
158
  "optimizer": {
164
- "babelMinify": {
165
- "#": "To provide a logging output we need to exclude this feature.",
166
- "__evaluate__": "self.debug ? {bundle: null, module: null} : {bundle: {transform: {removeConsole: false}}, module: {removeConsole: false}}"
159
+ "terser": {
160
+ "terserOptions": {
161
+ "compress": {
162
+ "#": "To provide a logging output we need to exclude this feature.",
163
+ "drop_console": {
164
+ "__evaluate__": "false"
165
+ },
166
+ "drop_debugger": {
167
+ "__evaluate__": "false"
168
+ }
169
+ }
170
+ }
167
171
  }
168
172
  }
169
173
  },
package/pluginAPI.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Encoding, Logger, Mapping, RecursiveEvaluateable } from 'clientnode';
2
- import { BaseState, Configuration, EvaluateablePartialConfiguration, HookPromiseResult, MetaPluginConfiguration, PackageConfiguration, Plugin, PluginChange, ServicePromisesState } from './type';
1
+ import type { Encoding, Mapping, RecursiveEvaluateable } from 'clientnode';
2
+ import type { BaseState, Configuration, EvaluateablePartialConfiguration, HookPromiseResult, MetaPluginConfiguration, PackageConfiguration, Plugin, PluginChange, ServicePromisesState } from './type';
3
+ import { Logger } from 'clientnode';
3
4
  export declare const log: Logger;
4
- export declare const currentRequire: typeof require;
5
5
  /**
6
6
  * Calls all plugin methods for given trigger description asynchronous and
7
7
  * waits for their resolved promises.
@@ -32,7 +32,7 @@ export declare const determineInternalName: (name: string, regularExpression: Re
32
32
  * @param configuration - Evaluable configuration structure.
33
33
  * @returns Resolved configuration.
34
34
  */
35
- export declare const evaluateConfiguration: <Type extends Mapping<unknown> = Configuration>(configuration: RecursiveEvaluateable<Type> | Type) => Type;
35
+ export declare const evaluateConfiguration: <Type extends Mapping<unknown> = Configuration>(configuration: RecursiveEvaluateable<Type> | Type) => Promise<Type>;
36
36
  /**
37
37
  * Checks for changed plugin api file in given plugins and reloads them if
38
38
  * necessary (new timestamp).
@@ -103,17 +103,17 @@ export declare const loadConfiguration: (name: string, packageConfiguration: Pac
103
103
  * @param configuration - Global configuration to extend with.
104
104
  * @returns Updated given configuration object.
105
105
  */
106
- export declare const loadConfigurations: (plugins: Array<Plugin>, configuration: Configuration) => Configuration;
106
+ export declare const loadConfigurations: (plugins: Array<Plugin>, configuration: Configuration) => Promise<Configuration>;
107
107
  /**
108
108
  * Load given api file path and returns exported scope.
109
109
  * @param filePath - Path to file to load.
110
110
  * @param name - Plugin name to use for proper error messages.
111
111
  * @param fallbackScope - Scope to return if an error occurs during loading.
112
112
  * If a "null" is given an error will be thrown.
113
- * @param dologging - Enables logging.
113
+ * @param doLogging - Enables logging.
114
114
  * @returns Exported api file scope.
115
115
  */
116
- export declare const loadFile: (filePath: string, name: string, fallbackScope?: null | object, dologging?: boolean) => object;
116
+ export declare const loadFile: (filePath: string, name: string, fallbackScope?: null | object, doLogging?: boolean) => object;
117
117
  /**
118
118
  * Extends given configuration object with all plugin specific ones and returns
119
119
  * a topological sorted list of plugins with plugins specific meta information
@@ -150,7 +150,7 @@ export declare const pluginAPI: {
150
150
  readonly callStackSynchronous: <State extends BaseState<unknown> = ServicePromisesState<undefined, Configuration<Mapping<unknown>>, Mapping<unknown>, import("./type").ServicePromises<Mapping<unknown>>>, Output = void>(givenState: Omit<State, "pluginAPI">, ...parameters: Array<unknown>) => Output;
151
151
  readonly determineInternalName: (name: string, regularExpression: RegExp) => string;
152
152
  readonly determineLocations: ({ core: { context: { path: contextPath } } }: Configuration, locations?: Array<string> | string) => Array<string>;
153
- readonly evaluateConfiguration: <Type extends Mapping<unknown> = Configuration>(configuration: RecursiveEvaluateable<Type> | Type) => Type;
153
+ readonly evaluateConfiguration: <Type extends Mapping<unknown> = Configuration>(configuration: RecursiveEvaluateable<Type> | Type) => Promise<Type>;
154
154
  readonly hotReloadAPIFile: (plugins: Array<Plugin>) => Array<Plugin>;
155
155
  readonly hotReloadConfigurationFile: (plugins: Array<Plugin>, configurationPropertyNames: Array<string>) => Array<Plugin>;
156
156
  readonly hotReloadFiles: (type: "api" | "configuration", target: "packageConfiguration" | "scope", plugins: Array<Plugin>) => Array<PluginChange>;
@@ -162,7 +162,7 @@ export declare const pluginAPI: {
162
162
  }>;
163
163
  readonly loadAPI: (relativeFilePaths: Array<string>, pluginPath: string, name: string, internalName: string, plugins: Mapping<Plugin>, encoding?: Encoding, configuration?: EvaluateablePartialConfiguration | null, configurationFilePaths?: Array<string>) => Promise<Plugin>;
164
164
  readonly loadConfiguration: (name: string, packageConfiguration: PackageConfiguration, configurationPropertyNames: Array<string>) => EvaluateablePartialConfiguration;
165
- readonly loadConfigurations: (plugins: Array<Plugin>, configuration: Configuration) => Configuration;
166
- readonly loadFile: (filePath: string, name: string, fallbackScope?: null | object, dologging?: boolean) => object;
165
+ readonly loadConfigurations: (plugins: Array<Plugin>, configuration: Configuration) => Promise<Configuration>;
166
+ readonly loadFile: (filePath: string, name: string, fallbackScope?: null | object, doLogging?: boolean) => object;
167
167
  };
168
168
  export default pluginAPI;
package/readme.md CHANGED
@@ -6,7 +6,7 @@ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
6
6
  License
7
7
  -------
8
8
 
9
- This library written by Torben Sickert stand under a creative commons naming
9
+ This library written by Torben Sickert stands under a creative commons naming
10
10
  3.0 unported license. See https://creativecommons.org/licenses/by/3.0/deed.de
11
11
  endregion -->
12
12
 
@@ -26,12 +26,12 @@ Project status
26
26
  [![code coverage](https://img.shields.io/coverallsCoverage/github/thaibault/web-node?label=code%20coverage&style=for-the-badge)](https://coveralls.io/github/thaibault/web-node)
27
27
 
28
28
  [![deploy web documentation](https://img.shields.io/github/actions/workflow/status/thaibault/web-node/deploy-web-documentation.yaml?label=deploy%20web%20documentation&style=for-the-badge)](https://github.com/thaibault/web-node/actions/workflows/deploy-web-documentation.yaml)
29
- [![documentation website](https://img.shields.io/website-up-down-green-red/https/torben.website/web-node.svg?label=documentation-website&style=for-the-badge)](https://torben.website/web-node)
29
+ [![web documentation](https://img.shields.io/website-up-down-green-red/https/torben.website/web-node.svg?label=web-documentation&style=for-the-badge)](https://torben.website/web-node)
30
30
 
31
- [![Try out](https://img.shields.io/badge/Try%20it%20on%20runkit-%2345cc11?style=for-the-badge)](https://npm.runkit.com/web-node)
31
+ [![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=for-the-badge&logo=codesandbox)](https://githubbox.com/thaibault/web-node)
32
32
 
33
33
  Use case
34
34
  --------
35
35
 
36
- webNode is a high level javaScript backend plugin system and configuration
36
+ WebNode is a high-level JavaScript backend plugin system and configuration
37
37
  merger.
package/type.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { Encoding, Mapping, RecursiveEvaluateable, RecursivePartial, UTILITY_SCOPE } from 'clientnode';
2
- import pluginAPI, { callStack, callStackSynchronous, determineInternalName, determineLocations, evaluateConfiguration, hotReloadAPIFile, hotReloadConfigurationFile, hotReloadFiles, isInLocations, load, loadAll, loadAPI, loadConfiguration, loadConfigurations, loadFile } from './pluginAPI';
1
+ import type { Encoding, Mapping, RecursiveEvaluateable, RecursivePartial, UTILITY_SCOPE } from 'clientnode';
2
+ import type { WebDocumentationConfiguration } from 'web-documentation/build/deploy';
3
+ import type { callStack, callStackSynchronous, default as pluginAPI, determineInternalName, determineLocations, evaluateConfiguration, hotReloadAPIFile, hotReloadConfigurationFile, hotReloadFiles, isInLocations, load, loadAll, loadAPI, loadConfiguration, loadConfigurations, loadFile } from './pluginAPI';
3
4
  export type EvaluateConfigurationScope = typeof UTILITY_SCOPE & {
4
5
  currentPath: string;
5
6
  fs: typeof import('fs');
@@ -51,9 +52,7 @@ export type EvaluateablePartialConfiguration = {
51
52
  name?: string;
52
53
  } & Mapping<PluginConfiguration>;
53
54
  export type PackageConfiguration = Mapping<unknown> & {
54
- documentationWebsite?: {
55
- name?: string;
56
- };
55
+ webDocumentation?: WebDocumentationConfiguration;
57
56
  main?: string;
58
57
  name?: string;
59
58
  webnode?: EvaluateablePartialConfiguration;
package/unixCrypt.js CHANGED
@@ -1 +1,125 @@
1
- (()=>{"use strict";var r={d:(o,a)=>{for(var f in a)r.o(a,f)&&!r.o(o,f)&&Object.defineProperty(o,f,{enumerable:!0,get:a[f]})},o:(r,o)=>Object.prototype.hasOwnProperty.call(r,o),r:r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},o={};r.r(o),r.d(o,{default:()=>T,unixCrypt:()=>M});for(var a=[58,50,42,34,26,18,10,2,60,52,44,36,28,20,12,4,62,54,46,38,30,22,14,6,64,56,48,40,32,24,16,8,57,49,41,33,25,17,9,1,59,51,43,35,27,19,11,3,61,53,45,37,29,21,13,5,63,55,47,39,31,23,15,7],f=[40,8,48,16,56,24,64,32,39,7,47,15,55,23,63,31,38,6,46,14,54,22,62,30,37,5,45,13,53,21,61,29,36,4,44,12,52,20,60,28,35,3,43,11,51,19,59,27,34,2,42,10,50,18,58,26,33,1,41,9,49,17,57,25],v=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36],e=[63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],t=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1],n=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2],i=[41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[],d=[],l=[],c=0;16>c;c++)l[c]=[];var p=function(r){for(var o=0;28>o;o++)u[o]=r[v[o]-1],d[o]=r[e[o]-1];for(var a=0;16>a;a++){for(var f,c=0;c<t[a];c++){f=u[0];for(var p=0;p<27;p++)u[p]=u[p+1];u[27]=f,f=d[0];for(var y=0;y<27;y++)d[y]=d[y+1];d[27]=f}for(var g=0;24>g;g++)l[a][g]=u[n[g]-1],l[a][g+24]=d[i[g]-28-1]}},y=[],g=[32,1,2,3,4,5,4,5,6,7,8,9,8,9,10,11,12,13,12,13,14,15,16,17,16,17,18,19,20,21,20,21,22,23,24,25,24,25,26,27,28,29,28,29,30,31,32,1],b=[[14,4,13,1,2,15,11,8,3,10,6,12,5,9,0,7,0,15,7,4,14,2,13,1,10,6,12,11,9,5,3,8,4,1,14,8,13,6,2,11,15,12,9,7,3,10,5,0,15,12,8,2,4,9,1,7,5,11,3,14,10,0,6,13],[15,1,8,14,6,11,3,4,9,7,2,13,12,0,5,10,3,13,4,7,15,2,8,14,12,0,1,10,6,9,11,5,0,14,7,11,10,4,13,1,5,8,12,6,9,3,2,15,13,8,10,1,3,15,4,2,11,6,7,12,0,5,14,9],[10,0,9,14,6,3,15,5,1,13,12,7,11,4,2,8,13,7,0,9,3,4,6,10,2,8,5,14,12,11,15,1,13,6,4,9,8,15,3,0,11,1,2,12,5,10,14,7,1,10,13,0,6,9,8,7,4,15,14,3,11,5,2,12],[7,13,14,3,0,6,9,10,1,2,8,5,11,12,4,15,13,8,11,5,6,15,0,3,4,7,2,12,1,10,14,9,10,6,9,0,12,11,7,13,15,1,3,14,5,2,8,4,3,15,0,6,10,1,13,8,9,4,5,11,12,7,2,14],[2,12,4,1,7,10,11,6,8,5,3,15,13,0,14,9,14,11,2,12,4,7,13,1,5,0,15,10,3,9,8,6,4,2,1,11,10,13,7,8,15,9,12,5,6,3,0,14,11,8,12,7,1,14,2,13,6,15,0,9,10,4,5,3],[12,1,10,15,9,2,6,8,0,13,3,4,14,7,5,11,10,15,4,2,7,12,9,5,6,1,13,14,0,11,3,8,9,14,15,5,2,8,12,3,7,0,4,10,1,13,11,6,4,3,2,12,9,5,15,10,11,14,1,7,6,0,8,13],[4,11,2,14,15,0,8,13,3,12,9,7,5,10,6,1,13,0,11,7,4,9,1,10,14,3,5,12,2,15,8,6,1,4,11,13,12,3,7,14,10,15,6,8,0,5,9,2,6,11,13,8,1,4,10,7,9,5,0,15,14,2,3,12],[13,2,8,4,6,15,11,1,10,9,3,14,5,0,12,7,1,15,13,8,10,3,7,4,12,5,6,11,0,14,9,2,7,11,4,1,9,12,14,2,0,6,10,13,15,3,5,8,2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11]],s=[16,7,20,21,29,12,28,17,1,15,23,26,5,18,31,10,2,8,24,14,32,27,3,9,19,13,30,6,22,11,4,25],S=[],m=[],O=[],h=[],j=[],C=function(r,o){void 0===o&&(o=!1);for(var v=[],e=0;64>e;e++)v[e]=r[a[e]-1];for(var t=0;32>t;t++)S[t]=v[t],m[t]=v[t+32];for(var n,i=0;16>i;i++){n=o?15-i:i;for(var u=0;32>u;u++)O[u]=m[u];for(var d=0;48>d;d++)j[d]=m[y[d]-1]^l[n][d];for(var c=0;8>c;c++){var p=6*c,g=b[c][(j[p]<<5)+(j[p+1]<<3)+(j[p+2]<<2)+(j[p+3]<<1)+(j[p+4]|0)+(j[p+5]<<4)];h[p=4*c]=1&g>>3,h[p+1]=1&g>>2,h[p+2]=1&g>>1,h[p+3]=1&g}for(var C=0;32>C;C++)m[C]=S[C]^h[s[C]-1];for(var P=0;32>P;P++)S[P]=O[P]}for(var x,M=0;32>M;M++)x=S[M],S[M]=m[M],m[M]=x;for(var T=0;32>T;T++)v[T]=S[T],v[T+32]=m[T];for(var _=0;64>_;_++)r[_]=v[f[_]-1]},P=function(r){for(var o=[],a=0;a<r.length;a++)o[a]=r.charCodeAt(a);return o},x=function(r){return String.fromCharCode.apply(String,r)};function M(r,o,a){void 0===o&&(o="aa"),void 0===a&&(a=!1);var f="string"==typeof r?P(r):r,v=o;"string"==typeof o&&(""===o&&(o="aa"),v=P(o));for(var e=[],t=[],n=0;66>n;n++)e[n]=0;for(var i,u=0,d=0;(i=f[d])&&64>u;d++){for(var l=0;7>l;l++,u++)e[u]=1&i>>6-l;u++}p(e);for(var c=0;66>c;c++)e[c]=0;for(var b=0;48>b;b++)y[b]=g[b];for(var s,S=0,m=0;2>S;S++,m++){s=v[m],t[S]=s,90<s&&(s-=6),57<s&&(s-=7),s-=46;for(var O=0;6>O;O++)if(1&s>>O){var h=y[6*S+O];y[6*S+O]=y[6*S+O+24],y[6*S+O+24]=h}}for(var j=0;25>j;j++)C(e);for(var M=0;11>M;M++){i=0;for(var T=0;6>T;T++)i<<=1,i|=e[6*M+T];57<(i+=46)&&(i+=7),90<i&&(i+=6),t[M+2]=i}return 0===t[1]&&(t[1]=t[0]),a?t:x(t)}const T=M;module.exports=o})();
1
+ /******/ // The require scope
2
+ /******/ const __webpack_require__ = {};
3
+ /******/
4
+ /************************************************************************/
5
+ /******/ /* webpack/runtime/define property getters */
6
+ /******/ (() => {
7
+ /******/ // define getter/value functions for harmony exports
8
+ /******/ __webpack_require__.d = (exports, definition) => {
9
+ /******/ if(Array.isArray(definition)) {
10
+ /******/ var i = 0;
11
+ /******/ while(i < definition.length) {
12
+ /******/ var key = definition[i++];
13
+ /******/ var binding = definition[i++];
14
+ /******/ if(!__webpack_require__.o(exports, key)) {
15
+ /******/ if(binding === 0) {
16
+ /******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
17
+ /******/ } else {
18
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
19
+ /******/ }
20
+ /******/ } else if(binding === 0) { i++; }
21
+ /******/ }
22
+ /******/ } else {
23
+ /******/ for(var key in definition) {
24
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
25
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
26
+ /******/ }
27
+ /******/ }
28
+ /******/ }
29
+ /******/ };
30
+ /******/ })();
31
+ /******/
32
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
33
+ /******/ (() => {
34
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
35
+ /******/ })();
36
+ /******/
37
+ /************************************************************************/
38
+ let __webpack_exports__ = {};
39
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
40
+ /* harmony export */ V: () => (/* binding */ unixCrypt)
41
+ /* harmony export */ });
42
+ // #!/usr/bin/env babel-node
43
+ // -*- coding: utf-8 -*-
44
+ /** @module unixCrypt *//* !
45
+ region header
46
+ [Project page](https://torben.website/webNode)
47
+
48
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
49
+
50
+ License
51
+ -------
52
+
53
+ This library written by Torben Sickert stands under a creative commons
54
+ naming 3.0 unported license.
55
+ See https://creativecommons.org/licenses/by/3.0/deed.de
56
+ endregion
57
+ *//**
58
+ * Unix crypt(3) JavaScript implementation.
59
+ *
60
+ * Straightforward implementation of the DES-based Unix crypt(3) hash, based
61
+ * largely on crypt.c in the Seventh Edition Unix distribution released by
62
+ * caldera systems under a BSD-style license.
63
+ */// Initial permutation:
64
+ function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var IP=[58,50,42,34,26,18,10,2,60,52,44,36,28,20,12,4,62,54,46,38,30,22,14,6,64,56,48,40,32,24,16,8,/* eslint-disable no-multi-spaces */57,49,41,33,25,17,9,1,/* eslint-enable no-multi-spaces */59,51,43,35,27,19,11,3,61,53,45,37,29,21,13,5,63,55,47,39,31,23,15,7];// Final permutation, FP = IP^(-1)
65
+ var FP=[40,8,48,16,56,24,64,32,39,7,47,15,55,23,63,31,38,6,46,14,54,22,62,30,37,5,45,13,53,21,61,29,36,4,44,12,52,20,60,28,35,3,43,11,51,19,59,27,34,2,42,10,50,18,58,26,/* eslint-disable no-multi-spaces */33,1,41,9,49,17,57,25/* eslint-enable no-multi-spaces */];/*
66
+ * Permuted-choice 1 from the key bits to yield C and D.
67
+ * NOTE: that bits 8,16... are left out: They are intended for a parity check.
68
+ */var PC1_C=[57,49,41,33,25,17,9,/* eslint-disable indent */1,58,50,42,34,26,18,/* eslint-disable no-multi-spaces */10,2,59,51,43,35,27,19,11,3,60,52,44,36/* eslint-enable indent,no-multi-spaces */];var PC1_D=[63,55,47,39,31,23,15,/* eslint-disable indent */7,62,54,46,38,30,22,/* eslint-disable no-multi-spaces */14,6,61,53,45,37,29,21,13,5,28,20,12,4/* eslint-enable indent,no-multi-spaces */];// Sequence of shifts used for the key schedule.
69
+ var shifts=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];/*
70
+ * Permuted-choice 2, to pick out the bits from the CD array that generate the
71
+ * key schedule.
72
+ */var PC2_C=[/* eslint-disable indent,no-multi-spaces */14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2/* eslint-enable indent,no-multi-spaces */];var PC2_D=[41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32];// The C and D arrays used to calculate the key schedule.
73
+ var C=[];var D=[];// The key schedule. Generated from the key.
74
+ var keySchedule=[];for(var index=0;index<16;index++)keySchedule[index]=[];// Set up the key schedule from the key.
75
+ var setKey=function setKey(key){/*
76
+ * First, generate C and D by permuting the key. The low order bit of each
77
+ * 8-bit char is not used, so C and D are only 28 bits apiece.
78
+ */for(var _index=0;_index<28;_index++){C[_index]=key[PC1_C[_index]-1];D[_index]=key[PC1_D[_index]-1]}/*
79
+ * To generate Ki, rotate C and D according to schedule and pick up a
80
+ * permutation using PC2.
81
+ */for(var _index2=0;_index2<16;_index2++){// Rotate
82
+ for(var subIndex=0;subIndex<shifts[_index2];subIndex++){var t=C[0];for(var subSubIndex=0;subSubIndex<28-1;subSubIndex++)C[subSubIndex]=C[subSubIndex+1];C[27]=t;t=D[0];for(var _subSubIndex=0;_subSubIndex<28-1;_subSubIndex++)D[_subSubIndex]=D[_subSubIndex+1];D[27]=t}// get Ki. Note C and D are concatenated.
83
+ for(var _subIndex=0;_subIndex<24;_subIndex++){keySchedule[_index2][_subIndex]=C[PC2_C[_subIndex]-1];keySchedule[_index2][_subIndex+24]=D[PC2_D[_subIndex]-28-1]}}};// The E bit-selection table.
84
+ var E=[];var e=[/* eslint-disable indent,no-multi-spaces */32,1,2,3,4,5,4,5,6,7,8,9,8,9,10,11,12,13,12,13,14,15,16,17,16,17,18,19,20,21,20,21,22,23,24,25,24,25,26,27,28,29,28,29,30,31,32,1/* eslint-enable indent,no-multi-spaces */];/*
85
+ * The 8 selection functions. For some reason, they give a 0-origin index,
86
+ * unlike everything else.
87
+ */var S=[[/* eslint-disable indent,no-multi-spaces */14,4,13,1,2,15,11,8,3,10,6,12,5,9,0,7,0,15,7,4,14,2,13,1,10,6,12,11,9,5,3,8,4,1,14,8,13,6,2,11,15,12,9,7,3,10,5,0,15,12,8,2,4,9,1,7,5,11,3,14,10,0,6,13/* eslint-enable indent,no-multi-spaces */],[/* eslint-disable indent,no-multi-spaces */15,1,8,14,6,11,3,4,9,7,2,13,12,0,5,10,3,13,4,7,15,2,8,14,12,0,1,10,6,9,11,5,0,14,7,11,10,4,13,1,5,8,12,6,9,3,2,15,13,8,10,1,3,15,4,2,11,6,7,12,0,5,14,9/* eslint-enable indent,no-multi-spaces */],[/* eslint-disable indent,no-multi-spaces */10,0,9,14,6,3,15,5,1,13,12,7,11,4,2,8,13,7,0,9,3,4,6,10,2,8,5,14,12,11,15,1,13,6,4,9,8,15,3,0,11,1,2,12,5,10,14,7,1,10,13,0,6,9,8,7,4,15,14,3,11,5,2,12/* eslint-enable indent,no-multi-spaces */],[/* eslint-disable indent,no-multi-spaces */7,13,14,3,0,6,9,10,1,2,8,5,11,12,4,15,13,8,11,5,6,15,0,3,4,7,2,12,1,10,14,9,10,6,9,0,12,11,7,13,15,1,3,14,5,2,8,4,3,15,0,6,10,1,13,8,9,4,5,11,12,7,2,14/* eslint-enable indent,no-multi-spaces */],[/* eslint-disable indent,no-multi-spaces */2,12,4,1,7,10,11,6,8,5,3,15,13,0,14,9,14,11,2,12,4,7,13,1,5,0,15,10,3,9,8,6,4,2,1,11,10,13,7,8,15,9,12,5,6,3,0,14,11,8,12,7,1,14,2,13,6,15,0,9,10,4,5,3/* eslint-enable indent,no-multi-spaces */],[/* eslint-disable indent,no-multi-spaces */12,1,10,15,9,2,6,8,0,13,3,4,14,7,5,11,10,15,4,2,7,12,9,5,6,1,13,14,0,11,3,8,9,14,15,5,2,8,12,3,7,0,4,10,1,13,11,6,4,3,2,12,9,5,15,10,11,14,1,7,6,0,8,13/* eslint-enable indent,no-multi-spaces */],[/* eslint-disable indent,no-multi-spaces */4,11,2,14,15,0,8,13,3,12,9,7,5,10,6,1,13,0,11,7,4,9,1,10,14,3,5,12,2,15,8,6,1,4,11,13,12,3,7,14,10,15,6,8,0,5,9,2,6,11,13,8,1,4,10,7,9,5,0,15,14,2,3,12/* eslint-enable indent,no-multi-spaces */],[/* eslint-disable indent,no-multi-spaces */13,2,8,4,6,15,11,1,10,9,3,14,5,0,12,7,1,15,13,8,10,3,7,4,12,5,6,11,0,14,9,2,7,11,4,1,9,12,14,2,0,6,10,13,15,3,5,8,2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11/* eslint-enable indent,no-multi-spaces */]];// P is a permutation on the selected combination of the current L and key.
88
+ var P=[/* eslint-disable indent,no-multi-spaces */16,7,20,21,29,12,28,17,1,15,23,26,5,18,31,10,2,8,24,14,32,27,3,9,19,13,30,6,22,11,4,25/* eslint-enable indent,no-multi-spaces */];// The current block, divided into 2 halves.
89
+ var L=[];var R=[];var tempL=[];var f=[];// The combination of the key and the input, before selection.
90
+ var preS=[];// The payoff: encrypt a block.
91
+ var encrypt=function encrypt(block,edflag){if(edflag===void 0){edflag=false}// First, permute the bits in the input.
92
+ var perm=[];for(var _index3=0;_index3<64;_index3++)perm[_index3]=block[IP[_index3]-1];for(var _index4=0;_index4<32;_index4++){L[_index4]=perm[_index4];R[_index4]=perm[_index4+32]}// Perform an encryption operation 16 times.
93
+ for(var _index5=0;_index5<16;_index5++){// Set direction
94
+ var direction=edflag?15-_index5:_index5;// Save the R array, which will be the new L.
95
+ for(var _index6=0;_index6<32;_index6++)tempL[_index6]=R[_index6];/*
96
+ * Expand R to 48 bits using the E selector; exclusive-or with the
97
+ * current key bits.
98
+ */for(var _index7=0;_index7<48;_index7++)preS[_index7]=R[E[_index7]-1]^keySchedule[direction][_index7];/*
99
+ * The pre-select bits are now considered in 8 groups of 6 bits each.
100
+ * The 8 selection functions map these 6-bit quantities into 4-bit
101
+ * quantities and the results permuted to make an f(R, K). The
102
+ * indexing into the selection functions is peculiar; it could be
103
+ * simplified by rewriting the tables.
104
+ */for(var _index8=0;_index8<8;_index8++){var t=6*_index8;var k=S[_index8][(preS[t/* + 0*/]<<5)+(preS[t+1]<<3)+(preS[t+2]<<2)+(preS[t+3]<<1)+(preS[t+4]<<0)+(preS[t+5]<<4)];t=4*_index8;f[t/* + 0*/]=k>>3&1;f[t+1]=k>>2&1;f[t+2]=k>>1&1;f[t+3]=k>>0&1}/*
105
+ * The new R is L ^ f(R, K). The f here has to be permuted first,
106
+ * though.
107
+ */for(var _index9=0;_index9<32;_index9++)R[_index9]=L[_index9]^f[P[_index9]-1];// Finally, the new L (the original R) is copied back.
108
+ for(var _index0=0;_index0<32;_index0++)L[_index0]=tempL[_index0]}// The output L and R are reversed.
109
+ for(var _index1=0;_index1<32;_index1++){var _t=L[_index1];L[_index1]=R[_index1];R[_index1]=_t}// The final output gets the inverse permutation of the very original.
110
+ for(var _index10=0;_index10<32;_index10++){perm[_index10]=L[_index10];perm[_index10+32]=R[_index10]}for(var _index11=0;_index11<64;_index11++)block[_index11]=perm[FP[_index11]-1]};// Transform a string to an array of bytes.
111
+ var stringToBytes=function stringToBytes(string){var result=[];for(var _index12=0;_index12<string.length;_index12++)result[_index12]=string.charCodeAt(_index12);return result};var bytesToStr=function bytesToStr(bytes){return String.fromCharCode.apply(String,_toConsumableArray(bytes))};/**
112
+ * Implements the Unix crypt(3) DES-based hash.
113
+ * @param givenPassword - The string to hash.
114
+ * @param givenSalt - The salt to use (two character string from
115
+ * [a-zA-Z0-9./]).
116
+ * @param returnBytes - If "true", return an array of bytes or a string
117
+ * otherwise.
118
+ * @returns Returns crypted or encrypted buffer or string.
119
+ */function unixCrypt(givenPassword,givenSalt,returnBytes){if(givenSalt===void 0){givenSalt="aa"}if(returnBytes===void 0){returnBytes=false}var password=typeof givenPassword==="string"?stringToBytes(givenPassword):givenPassword;var salt=givenSalt;if(typeof givenSalt==="string"){if(givenSalt==="")givenSalt="aa";salt=stringToBytes(givenSalt)}var block=[];var iobuf=[];for(var _index13=0;_index13<66;_index13++)block[_index13]=0;var c;for(var _index14=0,otherIndex=0;(c=password[otherIndex])&&_index14<64;otherIndex++){for(var subIndex=0;subIndex<7;subIndex++,_index14++)block[_index14]=c>>6-subIndex&1;_index14++}setKey(block);for(var _index15=0;_index15<66;_index15++)block[_index15]=0;for(var _index16=0;_index16<48;_index16++)E[_index16]=e[_index16];for(var _index17=0,_otherIndex=0;_index17<2;_index17++,_otherIndex++){var _c=salt[_otherIndex];iobuf[_index17]=_c;if(_c>"Z".charCodeAt(0))_c-=6;if(_c>"9".charCodeAt(0))_c-=7;_c-=".".charCodeAt(0);for(var _subIndex2=0;_subIndex2<6;_subIndex2++)if(_c>>_subIndex2&1){var temp=E[6*_index17+_subIndex2];E[6*_index17+_subIndex2]=E[6*_index17+_subIndex2+24];E[6*_index17+_subIndex2+24]=temp}}for(var _index18=0;_index18<25;_index18++)encrypt(block);for(var _index19=0;_index19<11;_index19++){c=0;for(var _subIndex3=0;_subIndex3<6;_subIndex3++){c<<=1;c|=block[6*_index19+_subIndex3]}c+=".".charCodeAt(0);if(c>"9".charCodeAt(0))c+=7;if(c>"Z".charCodeAt(0))c+=6;iobuf[_index19+2]=c}if(iobuf[1]===0)iobuf[1]=iobuf[0];return returnBytes?iobuf:bytesToStr(iobuf)}/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (unixCrypt);
120
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, [
121
+ /* harmony export */ "A", 0, /* export default binding */ __WEBPACK_DEFAULT_EXPORT__
122
+ /* harmony export */ ]);
123
+
124
+ const __webpack_exports__default = __webpack_exports__.A;
125
+ export { __webpack_exports__default as default, unixCrypt };