const{parse:Te,stringify:ke}=JSON,{keys:Re}=Object,Me=String,Le="string",je={},$e="object",He=(e,t)=>t,Ge=e=>einstanceofMe?Me(e):e,Ve=(e,t)=>typeoft===Le?newMe(t):t,Je=(e,t,n,r)=>{constu=[];for(leto=Re(n),{length:i}=o,s=0;s<i;s++){consti=o[s],a=n[i];if(ainstanceofMe){consto=e[a];typeofo!==$e||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=je,u.push({k:i,a:[e,t,o,r]}))}elsen[i]!==je&&(n[i]=r.call(n,i,a))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,Je.apply(null,o))}returnn},Ue=(e,t,n)=>{constr=Me(t.push(n)-1);returne.set(n,r),r},We=(e,t)=>{constn=Te(e,Ve).map(Ge),r=n[0],u=t||He,o=typeofr===$e&&r?Je(n,newSet,r,u):r;returnu.call({"":o},"",o)};Ne.parse=We;constze=(e,t,n)=>{constr=t&&typeoft===$e?(e,n)=>""===e||-1<t.indexOf(e)?n:void0:t||He,u=newMap,o=[],i=[];lets=+Ue(u,o,r.call({"":e},"",e)),a=!s;for(;s<o.length;)a=!0,i[s]=ke(o[s++],c,n);return"["+i.join(",")+"]";functionc(e,t){if(a)returna=!a,t;constn=r.call(this,e,t);switch(typeofn){case$e:if(null===n)returnn;caseLe:returnu.get(n)||Ue(u,o,n)}returnn}};Ne.stringify=ze;Ne.toJSON=e=>Te(ze(e));Ne.fromJSON=e=>We(ke(e));constKe=Ne,qe=Pe;constYe=newclass{constructor(){conste={__LOG4JS_undefined__:void0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{constt=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeofe&&einthis.serMap}serialise(e){returnthis.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){returneinthis.deMap}deserialise(e){returnthis.canDeserialise(e)?this.deMap[e]:e}};letZe=class{constructor(e,t,n,r,u,o){if(this.startTime=newDate,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void0!==u){if(!u||"object"!=typeofu||Array.isArray(u))thrownewTypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void0!==u[e]&&(this[e]=u[e])}))}}static_getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){returnKe.stringify(this,((e,t)=>(tinstanceofError&&(t=Object.assign({message:t.message,stack:t.stack},t)),Ye.serialise(t))))}staticdeserialise(e){lett;try{constn=Ke.parse(e,((e,t)=>{if(t&&t.message&&t.stack){conste=newError(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}returnYe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=newZe(n.categoryName,qe.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=newDate(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=newZe("log4js",qe.ERROR,["Unable to parse log:",e,"because: ",n])}returnt}};varXe=Ze;constQe=$.exports("log4js:clustering"),et=Xe,tt=ce;letnt=!1,rt=null;try{rt=require("cluster")}catch(e){Qe("cluster module not present"),nt=!0}constut=[];letot=!1,it="NODE_APP_INSTANCE";constst=()=>ot&&"0"===process.env[it],at=()=>nt||rt&&rt.isMaster||st(),ct=e=>{ut.forEach((t=>t(e)))},lt=(e,t)=>{if(Qe("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void0),t&&t.topic&&"log4js:message"===t.topic){Qe("received message: ",t.data);conste=et.deserialise(t.data);ct(e)}};nt||tt.addListener((e=>{ut.length=0,({pm2:ot,disableClustering:nt,pm2InstanceVar:it="NODE_APP_INSTANCE"}=e),Qe(`clustering disabled ? ${nt}`),Qe(`cluster.isMaster ? ${rt&&rt.isMaster}`),Qe(`pm2 enabled ? ${ot}`),Qe(`pm2InstanceVar = ${it}`),Qe(`process.env[${it}] = ${process.env[it]}`),ot&&process.removeListener("message",lt),rt&&rt.removeListener&&rt.removeListener("message",lt),nt||e.disableClustering?Qe("Not listening for cluster messages, because clustering disabled."):st()?(Qe("listening for PM2 broadcast messages"),process.on("message",lt)):rt&&rt.isMaster?(Qe("listening for cluster messages"),rt.on("message",lt)):Qe("not listening for messages, because we are not a master process")}));varft={onlyOnMaster:(e,t)=>at(