@ckirg/corelib-cloud 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +252 -0
  3. package/dist/aws/RequestUnlimited-EKXQGSQT.mjs +2 -0
  4. package/dist/aws/bun-GK5CEVAU.mjs +2 -0
  5. package/dist/aws/chunk-27GDSGEE.mjs +2 -0
  6. package/dist/aws/chunk-F2KTMAO3.mjs +6 -0
  7. package/dist/aws/chunk-QCE23AKJ.mjs +8 -0
  8. package/dist/aws/chunk-STPKE4A5.mjs +24 -0
  9. package/dist/aws/chunk-V3XZ4XYN.mjs +2 -0
  10. package/dist/aws/chunk-VULBPPPP.mjs +2 -0
  11. package/dist/aws/chunk-Y7RZHZ53.mjs +2 -0
  12. package/dist/aws/cloudflare-BDB3FS4Y.mjs +2 -0
  13. package/dist/aws/deno-AIUOFIXG.mjs +2 -0
  14. package/dist/aws/dist-VV3A6A7N.mjs +118 -0
  15. package/dist/aws/gcp-ZEEIATV7.mjs +438 -0
  16. package/dist/aws/handler.mjs +63 -0
  17. package/dist/aws/lambda-S3DVSSBV.mjs +3 -0
  18. package/dist/aws/node-A7ZN443L.mjs +2 -0
  19. package/dist/aws/node-RM2WPPZL.mjs +8 -0
  20. package/dist/aws/src-W4SC2UPB.mjs +23 -0
  21. package/dist/aws/utils-KMHFLZAJ.mjs +2 -0
  22. package/dist/cloudflare/RequestUnlimited-QCOTVU4G.js +1 -0
  23. package/dist/cloudflare/bun-O4EJPGLH.js +1 -0
  24. package/dist/cloudflare/chunk-DGDAVQYC.js +1 -0
  25. package/dist/cloudflare/chunk-EQSCULS7.js +2 -0
  26. package/dist/cloudflare/chunk-O3XYZ4KS.js +1 -0
  27. package/dist/cloudflare/chunk-PVAE643M.js +1 -0
  28. package/dist/cloudflare/chunk-QPTGW2LL.js +1 -0
  29. package/dist/cloudflare/cloudflare-I5A4OJEG.js +1 -0
  30. package/dist/cloudflare/deno-KE6IVNNU.js +1 -0
  31. package/dist/cloudflare/dist-GZV6T6K3.js +117 -0
  32. package/dist/cloudflare/gcp-MNKOPDML.js +1 -0
  33. package/dist/cloudflare/lambda-PLZQW4BF.js +1 -0
  34. package/dist/cloudflare/node-DRV76TUB.js +1 -0
  35. package/dist/cloudflare/utils-7K7MHQMD.js +1 -0
  36. package/dist/cloudflare/worker.js +62 -0
  37. package/dist/cloudrun/RequestUnlimited-YQAPYTOH.js +2 -0
  38. package/dist/cloudrun/bun-BONNABBU.js +2 -0
  39. package/dist/cloudrun/chunk-5B5BV7SP.js +8 -0
  40. package/dist/cloudrun/chunk-5CIUNKHO.js +2 -0
  41. package/dist/cloudrun/chunk-CFQMQATE.js +24 -0
  42. package/dist/cloudrun/chunk-FYZPEVAA.js +2 -0
  43. package/dist/cloudrun/chunk-GB4XIPDS.js +6 -0
  44. package/dist/cloudrun/chunk-JUVTJQ7I.js +2 -0
  45. package/dist/cloudrun/chunk-ZXZVHMQF.js +2 -0
  46. package/dist/cloudrun/cloudflare-Q3ZW7CDF.js +2 -0
  47. package/dist/cloudrun/deno-CPTVGH3A.js +2 -0
  48. package/dist/cloudrun/dist-VT4HJLSH.js +118 -0
  49. package/dist/cloudrun/gcp-W76U73T6.js +438 -0
  50. package/dist/cloudrun/lambda-NKM4QA4M.js +3 -0
  51. package/dist/cloudrun/node-LVHXMIYI.js +8 -0
  52. package/dist/cloudrun/node-SKMPZMFE.js +2 -0
  53. package/dist/cloudrun/server.js +67 -0
  54. package/dist/cloudrun/src-2WWXNWVC.js +23 -0
  55. package/dist/cloudrun/utils-SDRX3ZUT.js +2 -0
  56. package/package.json +52 -0
@@ -0,0 +1,24 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{c as bt}from"./chunk-V3XZ4XYN.mjs";import{a as B,c as v,g as x,h as w}from"./chunk-VULBPPPP.mjs";var ve=v((ul,_t)=>{"use strict";w();var ee=e=>e&&typeof e.message=="string",xe=e=>{if(!e)return;let t=e.cause;if(typeof t=="function"){let n=e.cause();return ee(n)?n:void 0}else return ee(t)?t:void 0},wt=(e,t)=>{if(!ee(e))return"";let n=e.stack||"";if(t.has(e))return n+`
3
+ causes have become circular...`;let r=xe(e);return r?(t.add(e),n+`
4
+ caused by: `+wt(r,t)):n},vr=e=>wt(e,new Set),St=(e,t,n)=>{if(!ee(e))return"";let r=n?"":e.message||"";if(t.has(e))return r+": ...";let i=xe(e);if(i){t.add(e);let s=typeof e.cause=="function";return r+(s?"":": ")+St(i,t,s)}else return r},Ar=e=>St(e,new Set);_t.exports={isErrorLike:ee,getErrorCause:xe,stackWithCauses:vr,messageWithCauses:Ar}});var Ae=v((al,Ot)=>{"use strict";w();var Lr=Symbol("circular-ref-tag"),ie=Symbol("pino-raw-err-ref"),Et=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[ie]},set:function(e){this[ie]=e}}});Object.defineProperty(Et,ie,{writable:!0,value:{}});Ot.exports={pinoErrProto:Et,pinoErrorSymbols:{seen:Lr,rawSymbol:ie}}});var At=v((dl,vt)=>{"use strict";w();vt.exports=Te;var{messageWithCauses:Tr,stackWithCauses:kr,isErrorLike:xt}=ve(),{pinoErrProto:Ir,pinoErrorSymbols:Cr}=Ae(),{seen:Le}=Cr,{toString:Br}=Object.prototype;function Te(e){if(!xt(e))return e;e[Le]=void 0;let t=Object.create(Ir);t.type=Br.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=Tr(e),t.stack=kr(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(n=>Te(n)));for(let n in e)if(t[n]===void 0){let r=e[n];xt(r)?n!=="cause"&&!Object.prototype.hasOwnProperty.call(r,Le)&&(t[n]=Te(r)):t[n]=r}return delete e[Le],t.raw=e,t}});var Tt=v((gl,Lt)=>{"use strict";w();Lt.exports=oe;var{isErrorLike:ke}=ve(),{pinoErrProto:jr,pinoErrorSymbols:Pr}=Ae(),{seen:se}=Pr,{toString:$r}=Object.prototype;function oe(e){if(!ke(e))return e;e[se]=void 0;let t=Object.create(jr);t.type=$r.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(n=>oe(n))),ke(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,se)&&(t.cause=oe(e.cause));for(let n in e)if(t[n]===void 0){let r=e[n];ke(r)?Object.prototype.hasOwnProperty.call(r,se)||(t[n]=oe(r)):t[n]=r}return delete e[se],t.raw=e,t}});var Bt=v((pl,Ct)=>{"use strict";w();Ct.exports={mapHttpRequest:Nr,reqSerializer:It};var Ie=Symbol("pino-raw-req-ref"),kt=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Ie]},set:function(e){this[Ie]=e}}});Object.defineProperty(kt,Ie,{writable:!0,value:{}});function It(e){let t=e.info||e.socket,n=Object.create(kt);if(n.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),n.method=e.method,e.originalUrl)n.url=e.originalUrl;else{let r=e.path;n.url=typeof r=="string"?r:e.url?e.url.path||e.url:void 0}return e.query&&(n.query=e.query),e.params&&(n.params=e.params),n.headers=e.headers,n.remoteAddress=t&&t.remoteAddress,n.remotePort=t&&t.remotePort,n.raw=e.raw||e,n}function Nr(e){return{req:It(e)}}});var Nt=v((wl,$t)=>{"use strict";w();$t.exports={mapHttpResponse:Dr,resSerializer:Pt};var Ce=Symbol("pino-raw-res-ref"),jt=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Ce]},set:function(e){this[Ce]=e}}});Object.defineProperty(jt,Ce,{writable:!0,value:{}});function Pt(e){let t=Object.create(jt);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function Dr(e){return{res:Pt(e)}}});var je=v((_l,Dt)=>{"use strict";w();var Be=At(),Rr=Tt(),fe=Bt(),le=Nt();Dt.exports={err:Be,errWithCause:Rr,mapHttpRequest:fe.mapHttpRequest,mapHttpResponse:le.mapHttpResponse,req:fe.reqSerializer,res:le.resSerializer,wrapErrorSerializer:function(t){return t===Be?t:function(r){return t(Be(r))}},wrapRequestSerializer:function(t){return t===fe.reqSerializer?t:function(r){return t(fe.reqSerializer(r))}},wrapResponseSerializer:function(t){return t===le.resSerializer?t:function(r){return t(le.resSerializer(r))}}}});var Pe=v((Ol,Rt)=>{"use strict";w();function qr(e,t){return t}Rt.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=qr;let n=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(n))return;let r=n.slice(2),i=[];for(let s of r)s&&i.push(s.getFileName());return i}});var Vt=v((vl,zt)=>{"use strict";w();function $e(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let n=0;n<e.length;n++)t[n]=$e(e[n]);return t}if(typeof e=="object"){let t=Object.create(Object.getPrototypeOf(e));for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=$e(e[n]));return t}return e}function qt(e){let t=[],n="",r=!1,i=!1,s="";for(let u=0;u<e.length;u++){let l=e[u];!r&&l==="."?n&&(t.push(n),n=""):l==="["?(n&&(t.push(n),n=""),r=!0):l==="]"&&r?(t.push(n),n="",r=!1,i=!1):(l==='"'||l==="'")&&r?i?l===s?(i=!1,s=""):n+=l:(i=!0,s=l):n+=l}return n&&t.push(n),t}function Wt(e,t,n){let r=e;for(let s=0;s<t.length-1;s++){let u=t[s];if(typeof r!="object"||r===null||!(u in r)||typeof r[u]!="object"||r[u]===null)return!1;r=r[u]}let i=t[t.length-1];if(i==="*"){if(Array.isArray(r))for(let s=0;s<r.length;s++)r[s]=n;else if(typeof r=="object"&&r!==null)for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(r[s]=n)}else typeof r=="object"&&r!==null&&i in r&&Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n);return!0}function Ft(e,t){let n=e;for(let i=0;i<t.length-1;i++){let s=t[i];if(typeof n!="object"||n===null||!(s in n)||typeof n[s]!="object"||n[s]===null)return!1;n=n[s]}let r=t[t.length-1];if(r==="*"){if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i]=void 0;else if(typeof n=="object"&&n!==null)for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&delete n[i]}else typeof n=="object"&&n!==null&&r in n&&Object.prototype.hasOwnProperty.call(n,r)&&delete n[r];return!0}var ue=Symbol("PATH_NOT_FOUND");function Wr(e,t){let n=e;for(let r of t){if(n==null||typeof n!="object"||n===null||!(r in n))return ue;n=n[r]}return n}function Fr(e,t){let n=e;for(let r of t){if(n==null||typeof n!="object"||n===null)return;n=n[r]}return n}function Mr(e,t,n,r=!1){for(let i of t){let s=qt(i);if(s.includes("*"))Mt(e,s,n,i,r);else if(r)Ft(e,s);else{let u=Wr(e,s);if(u===ue)continue;let l=typeof n=="function"?n(u,s):n;Wt(e,s,l)}}}function Mt(e,t,n,r,i=!1){let s=t.indexOf("*");if(s===t.length-1){let u=t.slice(0,-1),l=e;for(let f of u){if(l==null||typeof l!="object"||l===null)return;l=l[f]}if(Array.isArray(l))if(i)for(let f=0;f<l.length;f++)l[f]=void 0;else for(let f=0;f<l.length;f++){let h=[...u,f.toString()],d=typeof n=="function"?n(l[f],h):n;l[f]=d}else if(typeof l=="object"&&l!==null)if(i){let f=[];for(let h in l)Object.prototype.hasOwnProperty.call(l,h)&&f.push(h);for(let h of f)delete l[h]}else for(let f in l){let h=[...u,f],d=typeof n=="function"?n(l[f],h):n;l[f]=d}}else zr(e,t,n,s,r,i)}function zr(e,t,n,r,i,s=!1){let u=t.slice(0,r),l=t.slice(r+1),f=[];function h(d,c){if(c===u.length){if(Array.isArray(d))for(let m=0;m<d.length;m++)f[c]=m.toString(),h(d[m],c+1);else if(typeof d=="object"&&d!==null)for(let m in d)f[c]=m,h(d[m],c+1)}else if(c<u.length){let m=u[c];d&&typeof d=="object"&&d!==null&&m in d&&(f[c]=m,h(d[m],c+1))}else if(l.includes("*"))Mt(d,l,typeof n=="function"?(y,o)=>{let g=[...f.slice(0,c),...o];return n(y,g)}:n,i,s);else if(s)Ft(d,l);else{let m=typeof n=="function"?n(Fr(d,l),[...f.slice(0,c),...l]):n;Wt(d,l,m)}}if(u.length===0)h(e,0);else{let d=e;for(let c=0;c<u.length;c++){let m=u[c];if(d==null||typeof d!="object"||d===null)return;d=d[m],f[c]=m}d!=null&&h(d,u.length)}}function Vr(e){if(e.length===0)return null;let t=new Map;for(let n of e){let r=qt(n),i=t;for(let s=0;s<r.length;s++){let u=r[s];i.has(u)||i.set(u,new Map),i=i.get(u)}}return t}function Kr(e,t){if(!t)return e;function n(r,i,s=0){if(!i||i.size===0||r===null||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if(Array.isArray(r)){let l=[];for(let f=0;f<r.length;f++){let h=f.toString();i.has(h)||i.has("*")?l[f]=n(r[f],i.get(h)||i.get("*")):l[f]=r[f]}return l}let u=Object.create(Object.getPrototypeOf(r));for(let l in r)Object.prototype.hasOwnProperty.call(r,l)&&(i.has(l)||i.has("*")?u[l]=n(r[l],i.get(l)||i.get("*")):u[l]=r[l]);return u}return n(e,t)}function Jr(e){if(typeof e!="string")throw new Error("Paths must be (non-empty) strings");if(e==="")throw new Error("Invalid redaction path ()");if(e.includes(".."))throw new Error(`Invalid redaction path (${e})`);if(e.includes(","))throw new Error(`Invalid redaction path (${e})`);let t=0,n=!1,r="";for(let i=0;i<e.length;i++){let s=e[i];if((s==='"'||s==="'")&&t>0)n?s===r&&(n=!1,r=""):(n=!0,r=s);else if(s==="["&&!n)t++;else if(s==="]"&&!n&&(t--,t<0))throw new Error(`Invalid redaction path (${e})`)}if(t!==0)throw new Error(`Invalid redaction path (${e})`)}function Ur(e){if(!Array.isArray(e))throw new TypeError("paths must be an array");for(let t of e)Jr(t)}function Gr(e={}){let{paths:t=[],censor:n="[REDACTED]",serialize:r=JSON.stringify,strict:i=!0,remove:s=!1}=e;Ur(t);let u=Vr(t);return function(f){if(i&&(f===null||typeof f!="object")&&(f==null||typeof f!="object"))return r?r(f):f;let h=Kr(f,u),d=f,c=n;return typeof n=="function"&&(c=n),Mr(h,t,c,s),r===!1?(h.restore=function(){return $e(d)},h):typeof r=="function"?r(h):JSON.stringify(h)}}zt.exports=Gr});var Y=v((Ll,Kt)=>{"use strict";w();var Hr=Symbol("pino.setLevel"),Xr=Symbol("pino.getLevel"),Yr=Symbol("pino.levelVal"),Qr=Symbol("pino.levelComp"),Zr=Symbol("pino.useLevelLabels"),ei=Symbol("pino.useOnlyCustomLevels"),ti=Symbol("pino.mixin"),ni=Symbol("pino.lsCache"),ri=Symbol("pino.chindings"),ii=Symbol("pino.asJson"),si=Symbol("pino.write"),oi=Symbol("pino.redactFmt"),fi=Symbol("pino.time"),li=Symbol("pino.timeSliceIndex"),ui=Symbol("pino.stream"),ci=Symbol("pino.stringify"),ai=Symbol("pino.stringifySafe"),hi=Symbol("pino.stringifiers"),di=Symbol("pino.end"),yi=Symbol("pino.formatOpts"),gi=Symbol("pino.messageKey"),mi=Symbol("pino.errorKey"),pi=Symbol("pino.nestedKey"),bi=Symbol("pino.nestedKeyStr"),wi=Symbol("pino.mixinMergeStrategy"),Si=Symbol("pino.msgPrefix"),_i=Symbol("pino.wildcardFirst"),Ei=Symbol.for("pino.serializers"),Oi=Symbol.for("pino.formatters"),xi=Symbol.for("pino.hooks"),vi=Symbol.for("pino.metadata");Kt.exports={setLevelSym:Hr,getLevelSym:Xr,levelValSym:Yr,levelCompSym:Qr,useLevelLabelsSym:Zr,mixinSym:ti,lsCacheSym:ni,chindingsSym:ri,asJsonSym:ii,writeSym:si,serializersSym:Ei,redactFmtSym:oi,timeSym:fi,timeSliceIndexSym:li,streamSym:ui,stringifySym:ci,stringifySafeSym:ai,stringifiersSym:hi,endSym:di,formatOptsSym:yi,messageKeySym:gi,errorKeySym:mi,nestedKeySym:pi,wildcardFirstSym:_i,needsMetadataGsym:vi,useOnlyCustomLevelsSym:ei,formattersSym:Oi,hooksSym:xi,nestedKeyStrSym:bi,mixinMergeStrategySym:wi,msgPrefixSym:Si}});var De=v((kl,Ht)=>{"use strict";w();var Jt=Vt(),{redactFmtSym:Ai,wildcardFirstSym:ce}=Y(),Ne=/[^.[\]]+|\[([^[\]]*?)\]/g,Ut="[Redacted]",Gt=!1;function Li(e,t){let{paths:n,censor:r,remove:i}=Ti(e),s=n.reduce((f,h)=>{Ne.lastIndex=0;let d=Ne.exec(h),c=Ne.exec(h),m=d[1]!==void 0?d[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):d[0];if(m==="*"&&(m=ce),c===null)return f[m]=null,f;if(f[m]===null)return f;let{index:y}=c,o=`${h.substr(y,h.length-1)}`;return f[m]=f[m]||[],m!==ce&&f[m].length===0&&f[m].push(...f[ce]||[]),m===ce&&Object.keys(f).forEach(function(g){f[g]&&f[g].push(o)}),f[m].push(o),f},{}),u={[Ai]:Jt({paths:n,censor:r,serialize:t,strict:Gt,remove:i})},l=(...f)=>t(typeof r=="function"?r(...f):r);return[...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((f,h)=>{if(s[h]===null)f[h]=d=>l(d,[h]);else{let d=typeof r=="function"?(c,m)=>r(c,[h,...m]):r;f[h]=Jt({paths:s[h],censor:d,serialize:t,strict:Gt,remove:i})}return f},u)}function Ti(e){if(Array.isArray(e))return e={paths:e,censor:Ut},e;let{paths:t,censor:n=Ut,remove:r}=e;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return r===!0&&(n=void 0),{paths:t,censor:n,remove:r}}Ht.exports=Li});var Qt=v((Cl,Yt)=>{"use strict";w();var ki=()=>"",Ii=()=>`,"time":${Date.now()}`,Ci=()=>`,"time":${Math.round(Date.now()/1e3)}`,Bi=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,ji=1000000n,Xt=1000000000n,Pi=BigInt(Date.now())*ji,$i=process.hrtime.bigint(),Ni=()=>{let e=process.hrtime.bigint()-$i,t=Pi+e,n=t/Xt,r=t%Xt,i=Number(n*1000n+r/1000000n),s=new Date(i),u=s.getUTCFullYear(),l=(s.getUTCMonth()+1).toString().padStart(2,"0"),f=s.getUTCDate().toString().padStart(2,"0"),h=s.getUTCHours().toString().padStart(2,"0"),d=s.getUTCMinutes().toString().padStart(2,"0"),c=s.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${u}-${l}-${f}T${h}:${d}:${c}.${r.toString().padStart(9,"0")}Z"`};Yt.exports={nullTime:ki,epochTime:Ii,unixTime:Ci,isoTime:Bi,isoTimeNano:Ni}});var en=v((jl,Zt)=>{"use strict";w();function Di(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}Zt.exports=Ri;function Ri(e,t,n){var r=n&&n.stringify||Di,i=1;if(typeof e=="object"&&e!==null){var s=t.length+i;if(s===1)return e;var u=new Array(s);u[0]=r(e);for(var l=1;l<s;l++)u[l]=r(t[l]);return u.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var h="",d=1-i,c=-1,m=e&&e.length||0,y=0;y<m;){if(e.charCodeAt(y)===37&&y+1<m){switch(c=c>-1?c:0,e.charCodeAt(y+1)){case 100:case 102:if(d>=f||t[d]==null)break;c<y&&(h+=e.slice(c,y)),h+=Number(t[d]),c=y+2,y++;break;case 105:if(d>=f||t[d]==null)break;c<y&&(h+=e.slice(c,y)),h+=Math.floor(Number(t[d])),c=y+2,y++;break;case 79:case 111:case 106:if(d>=f||t[d]===void 0)break;c<y&&(h+=e.slice(c,y));var o=typeof t[d];if(o==="string"){h+="'"+t[d]+"'",c=y+2,y++;break}if(o==="function"){h+=t[d].name||"<anonymous>",c=y+2,y++;break}h+=r(t[d]),c=y+2,y++;break;case 115:if(d>=f)break;c<y&&(h+=e.slice(c,y)),h+=String(t[d]),c=y+2,y++;break;case 37:c<y&&(h+=e.slice(c,y)),h+="%",c=y+2,y++,d--;break}++d}++y}return c===-1?e:(c<m&&(h+=e.slice(c)),h)}});var qe=v(($l,Re)=>{"use strict";w();if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(n){if((n>0&&n<1/0)===!1)throw typeof n!="number"&&typeof n!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(e,0,0,Number(n))},e=new Int32Array(new SharedArrayBuffer(4));Re.exports=t}else{let e=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let r=Date.now()+Number(t);for(;r>Date.now(););};Re.exports=e}});var un=v((Dl,ln)=>{"use strict";w();var k=B("fs"),qi=B("events"),Wi=B("util").inherits,tn=B("path"),Fe=qe(),Fi=B("assert"),ae=100,he=Buffer.allocUnsafe(0),Mi=16*1024,nn="buffer",rn="utf8",[zi,Vi]=(process.versions.node||"0.0").split(".").map(Number),Ki=zi>=22&&Vi>=7;function sn(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function n(s,u){if(s){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",s)}):t.emit("error",s);return}let l=t._reopening;t.fd=u,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():l&&process.nextTick(()=>t.emit("drain")))}let r=t.append?"a":"w",i=t.mode;if(t.sync)try{t.mkdir&&k.mkdirSync(tn.dirname(e),{recursive:!0});let s=k.openSync(e,r,i);n(null,s)}catch(s){throw n(s),s}else t.mkdir?k.mkdir(tn.dirname(e),{recursive:!0},s=>{if(s)return n(s);k.open(e,r,i,n)}):k.open(e,r,i,n)}function F(e){if(!(this instanceof F))return new F(e);let{fd:t,dest:n,minLength:r,maxLength:i,maxWrite:s,periodicFlush:u,sync:l,append:f=!0,mkdir:h,retryEAGAIN:d,fsync:c,contentMode:m,mode:y}=e||{};t=t||n,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(r||0,16387),this.file=null,this.destroyed=!1,this.minLength=r||0,this.maxLength=i||0,this.maxWrite=s||Mi,this._periodicFlush=u||0,this._periodicFlushTimer=void 0,this.sync=l||!1,this.writable=!0,this._fsync=c||!1,this.append=f||!1,this.mode=y,this.retryEAGAIN=d||(()=>!0),this.mkdir=h||!1;let o,g;if(m===nn)this._writingBuf=he,this.write=Gi,this.flush=Xi,this.flushSync=Qi,this._actualWrite=es,o=()=>k.writeSync(this.fd,this._writingBuf),g=()=>k.write(this.fd,this._writingBuf,this.release);else if(m===void 0||m===rn)this._writingBuf="",this.write=Ui,this.flush=Hi,this.flushSync=Yi,this._actualWrite=Zi,o=()=>Buffer.isBuffer(this._writingBuf)?k.writeSync(this.fd,this._writingBuf):k.writeSync(this.fd,this._writingBuf,"utf8"),g=()=>Buffer.isBuffer(this._writingBuf)?k.write(this.fd,this._writingBuf,this.release):k.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${rn}" and "${nn}", but passed ${m}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")sn(t,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(p,S)=>{if(p){if((p.code==="EAGAIN"||p.code==="EBUSY")&&this.retryEAGAIN(p,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Fe(ae),this.release(void 0,0)}catch(E){this.release(E)}else setTimeout(g,ae);else this._writing=!1,this.emit("error",p);return}this.emit("write",S);let _=We(this._writingBuf,this._len,S);if(this._len=_.len,this._writingBuf=_.writingBuf,this._writingBuf.length){if(!this.sync){g();return}try{do{let E=o(),T=We(this._writingBuf,this._len,E);this._len=T.len,this._writingBuf=T.writingBuf}while(this._writingBuf.length)}catch(E){this.release(E);return}}this._fsync&&k.fsyncSync(this.fd);let b=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):b>this.minLength?this._actualWrite():this._ending?b>0?this._actualWrite():(this._writing=!1,de(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(Ji,this)):this.emit("drain"))},this.on("newListener",function(p){p==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function We(e,t,n){return typeof e=="string"&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function Ji(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"))}Wi(F,qi);function on(e,t){return e.length===0?he:e.length===1?e[0]:Buffer.concat(e,t)}function Ui(e){if(this.destroyed)throw new Error("SonicBoom destroyed");e=""+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function Gi(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function fn(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{k.fsync(this.fd,r=>{this._flushPending=!1,e(r)})}catch(r){e(r)}this.off("error",n)},n=r=>{this._flushPending=!1,e(r),this.off("drain",t)};this.once("drain",t),this.once("error",n)}function Hi(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&fn.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function Xi(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&fn.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}F.prototype.reopen=function(e){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&k.close(t,n=>{if(n)return this.emit("error",n)})}),sn(this.file,this)};F.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():de(this)))};function Yi(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let e="";for(;this._bufs.length||e.length;){e.length<=0&&(e=this._bufs[0]);try{let t=Buffer.isBuffer(e)?k.writeSync(this.fd,e):k.writeSync(this.fd,e,"utf8"),n=We(e,this._len,t);e=n.writingBuf,this._len=n.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;Fe(ae)}}try{k.fsyncSync(this.fd)}catch{}}function Qi(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=he);let e=he;for(;this._bufs.length||e.length;){e.length<=0&&(e=on(this._bufs[0],this._lens[0]));try{let t=k.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;Fe(ae)}}}F.prototype.destroy=function(){this.destroyed||de(this)};function Zi(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let t=Buffer.isBuffer(this._writingBuf)?k.writeSync(this.fd,this._writingBuf):k.writeSync(this.fd,this._writingBuf,"utf8");e(null,t)}catch(t){e(t)}else k.write(this.fd,this._writingBuf,e)}function es(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:on(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=k.writeSync(this.fd,this._writingBuf);e(null,t)}catch(t){e(t)}else Ki&&(this._writingBuf=Buffer.from(this._writingBuf)),k.write(this.fd,this._writingBuf,e)}function de(e){if(e.fd===-1){e.once("ready",de.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],Fi(typeof e.fd=="number",`sonic.fd must be a number, got ${typeof e.fd}`);try{k.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?k.close(e.fd,n):n()}function n(r){if(r){e.emit("error",r);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close")}}F.SonicBoom=F;F.default=F;ln.exports=F});var Me=v((ql,yn)=>{"use strict";w();var M={exit:[],beforeExit:[]},cn={exit:rs,beforeExit:is},Q;function ts(){Q===void 0&&(Q=new FinalizationRegistry(ss))}function ns(e){M[e].length>0||process.on(e,cn[e])}function an(e){M[e].length>0||(process.removeListener(e,cn[e]),M.exit.length===0&&M.beforeExit.length===0&&(Q=void 0))}function rs(){hn("exit")}function is(){hn("beforeExit")}function hn(e){for(let t of M[e]){let n=t.deref(),r=t.fn;n!==void 0&&r(n,e)}M[e]=[]}function ss(e){for(let t of["exit","beforeExit"]){let n=M[t].indexOf(e);M[t].splice(n,n+1),an(t)}}function dn(e,t,n){if(t===void 0)throw new Error("the object can't be undefined");ns(e);let r=new WeakRef(t);r.fn=n,ts(),Q.register(t,r),M[e].push(r)}function os(e,t){dn("exit",e,t)}function fs(e,t){dn("beforeExit",e,t)}function ls(e){if(Q!==void 0){Q.unregister(e);for(let t of["exit","beforeExit"])M[t]=M[t].filter(n=>{let r=n.deref();return r&&r!==e}),an(t)}}yn.exports={register:os,registerBeforeExit:fs,unregister:ls}});var gn=v((Fl,us)=>{us.exports={name:"thread-stream",version:"4.0.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^22.0.0","@yao-pkg/pkg":"^6.0.0",borp:"^0.21.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",husky:"^9.0.6",neostandard:"^0.12.2","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:"npm run lint && npm run build && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:ci":"npm run lint && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:yarn":"npm run transpile && borp --pattern 'test/*.test.js'",transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var pn=v((Ml,mn)=>{"use strict";w();function cs(e,t,n,r,i){let s=r===1/0?1/0:Date.now()+r,u=()=>{let l=Atomics.load(e,t);if(l===n){i(null,"ok");return}if(s!==1/0&&Date.now()>s){i(null,"timed-out");return}let f=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),h=Atomics.waitAsync(e,t,l,f);h.async?h.value.then(u):setImmediate(u)};u()}function as(e,t,n,r,i){let s=r===1/0?1/0:Date.now()+r,u=()=>{if(Atomics.load(e,t)!==n){i(null,"ok");return}if(s!==1/0&&Date.now()>s){i(null,"timed-out");return}let f=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),h=Atomics.waitAsync(e,t,n,f);h.async?h.value.then(u):setImmediate(u)};u()}mn.exports={wait:cs,waitDiff:as}});var wn=v((Vl,bn)=>{"use strict";w();bn.exports={WRITE_INDEX:4,READ_INDEX:8}});var xn=v((Jl,On)=>{"use strict";w();var{version:hs}=gn(),{EventEmitter:ds}=B("events"),{Worker:ys}=B("worker_threads"),{join:gs}=B("path"),{pathToFileURL:ms}=B("url"),{wait:ps}=pn(),{WRITE_INDEX:D,READ_INDEX:N}=wn(),bs=B("buffer"),ws=B("assert"),a=Symbol("kImpl"),Ss=bs.constants.MAX_STRING_LENGTH,te=class{constructor(t){this._value=t}deref(){return this._value}},ge=class{register(){}unregister(){}},_s=process.env.NODE_V8_COVERAGE?ge:global.FinalizationRegistry||ge,Es=process.env.NODE_V8_COVERAGE?te:global.WeakRef||te,Sn=new _s(e=>{e.exited||e.terminate()});function Os(e,t){let{filename:n,workerData:r}=t,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||gs(x,"lib","worker.js"),u=new ys(s,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:n.indexOf("file://")===0?n:ms(n).href,dataBuf:e[a].dataBuf,stateBuf:e[a].stateBuf,workerData:{$context:{threadStreamVersion:hs},...r}}});return u.stream=new te(e),u.on("message",xs),u.on("exit",En),Sn.register(e,u),u}function _n(e){ws(!e[a].sync),e[a].needDrain&&(e[a].needDrain=!1,e.emit("drain"))}function ye(e){let t=Atomics.load(e[a].state,D),n=e[a].data.length-t;if(n>0){if(e[a].buf.length===0){e[a].flushing=!1,e[a].ending?Ue(e):e[a].needDrain&&process.nextTick(_n,e);return}let r=e[a].buf.slice(0,n),i=Buffer.byteLength(r);i<=n?(e[a].buf=e[a].buf.slice(n),me(e,r,ye.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[a].state,N,0),Atomics.store(e[a].state,D,0),Atomics.notify(e[a].state,N);i>e[a].data.length;)n=n/2,r=e[a].buf.slice(0,n),i=Buffer.byteLength(r);e[a].buf=e[a].buf.slice(n),me(e,r,ye.bind(null,e))}})}else if(n===0){if(t===0&&e[a].buf.length===0)return;e.flush(()=>{Atomics.store(e[a].state,N,0),Atomics.store(e[a].state,D,0),Atomics.notify(e[a].state,N),ye(e)})}else z(e,new Error("overwritten"))}function xs(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new Es(t),t.flush(()=>{t[a].ready=!0,t.emit("ready")});break;case"ERROR":z(t,e.err);break;case"EVENT":Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case"WARNING":process.emitWarning(e.err);break;default:z(t,new Error("this should not happen: "+e.code))}}function En(e){let t=this.stream.deref();t!==void 0&&(Sn.unregister(t),t.worker.exited=!0,t.worker.off("exit",En),z(t,e!==0?new Error("the worker thread exited"):null))}var Ve=class extends ds{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[a]={},this[a].stateBuf=new SharedArrayBuffer(128),this[a].state=new Int32Array(this[a].stateBuf),this[a].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[a].data=Buffer.from(this[a].dataBuf),this[a].sync=t.sync||!1,this[a].ending=!1,this[a].ended=!1,this[a].needDrain=!1,this[a].destroyed=!1,this[a].flushing=!1,this[a].ready=!1,this[a].finished=!1,this[a].errored=null,this[a].closed=!1,this[a].buf="",this.worker=Os(this,t),this.on("message",(n,r)=>{this.worker.postMessage(n,r)})}write(t){if(this[a].destroyed)return Ke(this,new Error("the worker has exited")),!1;if(this[a].ending)return Ke(this,new Error("the worker is ending")),!1;if(this[a].flushing&&this[a].buf.length+t.length>=Ss)try{ze(this),this[a].flushing=!0}catch(n){return z(this,n),!1}if(this[a].buf+=t,this[a].sync)try{return ze(this),!0}catch(n){return z(this,n),!1}return this[a].flushing||(this[a].flushing=!0,setImmediate(ye,this)),this[a].needDrain=this[a].data.length-this[a].buf.length-Atomics.load(this[a].state,D)<=0,!this[a].needDrain}end(){this[a].destroyed||(this[a].ending=!0,Ue(this))}flush(t){if(this[a].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let n=Atomics.load(this[a].state,D);ps(this[a].state,N,n,1/0,(r,i)=>{if(r){z(this,r),process.nextTick(t,r);return}if(i==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[a].destroyed||(ze(this),Je(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[a].ready}get destroyed(){return this[a].destroyed}get closed(){return this[a].closed}get writable(){return!this[a].destroyed&&!this[a].ending}get writableEnded(){return this[a].ending}get writableFinished(){return this[a].finished}get writableNeedDrain(){return this[a].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[a].errored}};function Ke(e,t){setImmediate(()=>{e.emit("error",t)})}function z(e,t){e[a].destroyed||(e[a].destroyed=!0,t&&(e[a].errored=t,Ke(e,t)),e.worker.exited?setImmediate(()=>{e[a].closed=!0,e.emit("close")}):e.worker.terminate().catch(()=>{}).then(()=>{e[a].closed=!0,e.emit("close")}))}function me(e,t,n){let r=Atomics.load(e[a].state,D),i=Buffer.byteLength(t);return e[a].data.write(t,r),Atomics.store(e[a].state,D,r+i),Atomics.notify(e[a].state,D),n(),!0}function Ue(e){if(!(e[a].ended||!e[a].ending||e[a].flushing)){e[a].ended=!0;try{e.flushSync();let t=Atomics.load(e[a].state,N);Atomics.store(e[a].state,D,-1),Atomics.notify(e[a].state,D);let n=0;for(;t!==-1;){if(Atomics.wait(e[a].state,N,t,1e3),t=Atomics.load(e[a].state,N),t===-2){z(e,new Error("end() failed"));return}if(++n===10){z(e,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{e[a].finished=!0,e.emit("finish")})}catch(t){z(e,t)}}}function ze(e){let t=()=>{e[a].ending?Ue(e):e[a].needDrain&&process.nextTick(_n,e)};for(e[a].flushing=!1;e[a].buf.length!==0;){let n=Atomics.load(e[a].state,D),r=e[a].data.length-n;if(r===0){Je(e),Atomics.store(e[a].state,N,0),Atomics.store(e[a].state,D,0),Atomics.notify(e[a].state,N);continue}else if(r<0)throw new Error("overwritten");let i=e[a].buf.slice(0,r),s=Buffer.byteLength(i);if(s<=r)e[a].buf=e[a].buf.slice(r),me(e,i,t);else{for(Je(e),Atomics.store(e[a].state,N,0),Atomics.store(e[a].state,D,0),Atomics.notify(e[a].state,N);s>e[a].buf.length;)r=r/2,i=e[a].buf.slice(0,r),s=Buffer.byteLength(i);e[a].buf=e[a].buf.slice(r),me(e,i,t)}}}function Je(e){if(e[a].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[a].state,D),n=0;for(;;){let r=Atomics.load(e[a].state,N);if(r===-2)throw Error("_flushSync failed");if(r!==t)Atomics.wait(e[a].state,N,r,1e3);else break;if(++n===10)throw new Error("_flushSync took too long (10s)")}}On.exports=Ve});var Xe=v((Gl,Ln)=>{"use strict";w();var{createRequire:vs}=B("module"),{existsSync:As}=B("fs"),Ls=Pe(),{join:Ge,isAbsolute:An,sep:Ts}=B("path"),{fileURLToPath:ks}=B("url"),Is=qe(),He=Me(),Cs=xn();function Bs(e){He.register(e,Ds),He.registerBeforeExit(e,Rs),e.on("close",function(){He.unregister(e)})}function js(){let e=process.execArgv;for(let t=0;t<e.length;t++){let n=e[t];if(n==="--import"||n==="--require"||n==="-r"||n.startsWith("--import=")||n.startsWith("--require=")||n.startsWith("-r="))return!0}return!1}function Ps(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let n=[],r=!1;for(let i=0;i<t.length;i++){let s=t[i];if(s==="--require"||s==="-r"||s==="--import"){let u=t[i+1];if(u&&vn(u)){r=!0,i++;continue}n.push(s),u&&(n.push(u),i++);continue}if(s.startsWith("--require=")||s.startsWith("-r=")||s.startsWith("--import=")){let u=s.slice(s.indexOf("=")+1);if(vn(u)){r=!0;continue}}n.push(s)}return r?n.join(" "):e}function vn(e){let t=$s(e);if(!t)return!1;let n=t;if(n.startsWith("file://"))try{n=ks(n)}catch{return!1}return An(n)&&!As(n)}function $s(e){let t=e[0],n=e[e.length-1];return t==='"'&&n==='"'||t==="'"&&n==="'"?e.slice(1,-1):e}function Ns(e,t,n,r,i){if(!n.execArgv&&js()&&B.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let f=Ps(process.env.NODE_OPTIONS);f!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:f}})}n={...n,name:i};let s=new Cs({filename:e,workerData:t,workerOpts:n,sync:r});s.on("ready",u),s.on("close",function(){process.removeListener("exit",l)}),process.on("exit",l);function u(){process.removeListener("exit",l),s.unref(),n.autoEnd!==!1&&Bs(s)}function l(){s.closed||(s.flushSync(),Is(100),s.end())}return s}function Ds(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref()})}function Rs(e){e.flushSync()}function qs(e){let{pipeline:t,targets:n,levels:r,dedupe:i,worker:s={},caller:u=Ls(),sync:l=!1}=e,f={...e.options},h=typeof u=="string"?[u]:u,d=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),c=e.target;if(c&&n)throw new Error("only one of target or targets can be specified");n?(c=d["pino-worker"]||Ge(x,"worker.js"),f.targets=n.filter(o=>o.target).map(o=>({...o,target:y(o.target)})),f.pipelines=n.filter(o=>o.pipeline).map(o=>o.pipeline.map(g=>({...g,level:o.level,target:y(g.target)})))):t&&(c=d["pino-worker"]||Ge(x,"worker.js"),f.pipelines=[t.map(o=>({...o,target:y(o.target)}))]),r&&(f.levels=r),i&&(f.dedupe=i),f.pinoWillSendConfig=!0;let m=n||t?"pino.transport":c;return Ns(y(c),f,s,l,m);function y(o){if(o=d[o]||o,An(o)||o.indexOf("file://")===0)return o;if(o==="pino/file")return Ge(x,"..","file.js");let g;for(let p of h)try{let S=p==="node:repl"?process.cwd()+Ts:p;g=vs(S).resolve(o);break}catch{continue}if(!g)throw new Error(`unable to determine transport target for "${o}"`);return g}}Ln.exports=qs});var we=v((Yl,Wn)=>{"use strict";w();var Ws=B("diagnostics_channel"),Tn=en(),{mapHttpRequest:Fs,mapHttpResponse:Ms}=je(),Qe=un(),kn=Me(),{lsCacheSym:zs,chindingsSym:Pn,writeSym:In,serializersSym:$n,formatOptsSym:Cn,endSym:Vs,stringifiersSym:Nn,stringifySym:Dn,stringifySafeSym:Ze,wildcardFirstSym:Rn,nestedKeySym:Ks,formattersSym:qn,messageKeySym:Js,errorKeySym:Us,nestedKeyStrSym:Gs,msgPrefixSym:pe}=Y(),{isMainThread:Hs}=B("worker_threads"),Xs=Xe(),[Ys]=process.versions.node.split(".").map(e=>Number(e)),Bn=Ws.tracingChannel("pino_asJson"),Ye=Ys>=25?e=>JSON.stringify(e):Zs;function Z(){}function Qs(e,t){if(!t)return n;return function(...i){t.call(this,i,n,e)};function n(r,...i){if(typeof r=="object"){let s=r;r!==null&&(r.method&&r.headers&&r.socket?r=Fs(r):typeof r.setHeader=="function"&&(r=Ms(r)));let u;s===null&&i.length===0?u=[null]:(s=i.shift(),u=i),typeof this[pe]=="string"&&s!==void 0&&s!==null&&(s=this[pe]+s),this[In](r,Tn(s,u,this[Cn]),e)}else{let s=r===void 0?i.shift():r;typeof this[pe]=="string"&&s!==void 0&&s!==null&&(s=this[pe]+s),this[In](null,Tn(s,i,this[Cn]),e)}}}function Zs(e){let t="",n=0,r=!1,i=255,s=e.length;if(s>100)return JSON.stringify(e);for(var u=0;u<s&&i>=32;u++)i=e.charCodeAt(u),(i===34||i===92)&&(t+=e.slice(n,u)+"\\",n=u,r=!0);return r?t+=e.slice(n):t=e,i<32?JSON.stringify(e):'"'+t+'"'}function eo(e,t,n,r){if(Bn.hasSubscribers===!1)return jn.call(this,e,t,n,r);let i={instance:this,arguments};return Bn.traceSync(jn,i,this,e,t,n,r)}function jn(e,t,n,r){let i=this[Dn],s=this[Ze],u=this[Nn],l=this[Vs],f=this[Pn],h=this[$n],d=this[qn],c=this[Js],m=this[Us],y=this[zs][n]+r;y=y+f;let o;d.log&&(e=d.log(e));let g=u[Rn],p="";for(let _ in e)if(o=e[_],Object.prototype.hasOwnProperty.call(e,_)&&o!==void 0){h[_]?o=h[_](o):_===m&&h.err&&(o=h.err(o));let b=u[_]||g;switch(typeof o){case"undefined":case"function":continue;case"number":Number.isFinite(o)===!1&&(o=null);case"boolean":b&&(o=b(o));break;case"string":o=(b||Ye)(o);break;default:o=(b||i)(o,s)}if(o===void 0)continue;let E=Ye(_);p+=","+E+":"+o}let S="";if(t!==void 0){o=h[c]?h[c](t):t;let _=u[c]||g;switch(typeof o){case"function":break;case"number":Number.isFinite(o)===!1&&(o=null);case"boolean":_&&(o=_(o)),S=',"'+c+'":'+o;break;case"string":o=(_||Ye)(o),S=',"'+c+'":'+o;break;default:o=(_||i)(o,s),S=',"'+c+'":'+o}}return this[Ks]&&p?y+this[Gs]+p.slice(1)+"}"+S+l:y+p+S+l}function to(e,t){let n,r=e[Pn],i=e[Dn],s=e[Ze],u=e[Nn],l=u[Rn],f=e[$n],h=e[qn].bindings;t=h(t);for(let d in t)if(n=t[d],((d.length<5||d!=="level"&&d!=="serializers"&&d!=="formatters"&&d!=="customLevels")&&t.hasOwnProperty(d)&&n!==void 0)===!0){if(n=f[d]?f[d](n):n,n=(u[d]||l||i)(n,s),n===void 0)continue;r+=',"'+d+'":'+n}return r}function no(e){return e.write!==e.constructor.prototype.write}function be(e){let t=new Qe(e);return t.on("error",n),!e.sync&&Hs&&(kn.register(t,ro),t.on("close",function(){kn.unregister(t)})),t;function n(r){if(r.code==="EPIPE"){t.write=Z,t.end=Z,t.flushSync=Z,t.destroy=Z;return}t.removeListener("error",n),t.emit("error",r)}}function ro(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}function io(e){return function(n,r,i={},s){if(typeof i=="string")s=be({dest:i}),i={};else if(typeof s=="string"){if(i&&i.transport)throw Error("only one of option.transport or stream can be specified");s=be({dest:s})}else if(i instanceof Qe||i.writable||i._writableState)s=i,i={};else if(i.transport){if(i.transport instanceof Qe||i.transport.writable||i.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(i.transport.targets&&i.transport.targets.length&&i.formatters&&typeof i.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let f;i.customLevels&&(f=i.useOnlyCustomLevels?i.customLevels:Object.assign({},i.levels,i.customLevels)),s=Xs({caller:r,...i.transport,levels:f})}if(i=Object.assign({},e,i),i.serializers=Object.assign({},e.serializers,i.serializers),i.formatters=Object.assign({},e.formatters,i.formatters),i.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:u,onChild:l}=i;return u===!1&&(i.level="silent"),l||(i.onChild=Z),s||(no(process.stdout)?s=process.stdout:s=be({fd:process.stdout.fd||1})),{opts:i,stream:s}}}function so(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[Ze])(e)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function oo(e,t,n){return{level:e,bindings:t,log:n}}function fo(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e===void 0?1:e}Wn.exports={noop:Z,buildSafeSonicBoom:be,asChindings:to,asJson:eo,genLog:Qs,createArgsNormalizer:io,stringify:so,buildFormatters:oo,normalizeDestFileDescriptor:fo}});var Se=v((Zl,Fn)=>{"use strict";w();var lo={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},uo={ASC:"ASC",DESC:"DESC"};Fn.exports={DEFAULT_LEVELS:lo,SORTING_ORDER:uo}});var nt=v((tu,Kn)=>{"use strict";w();var{lsCacheSym:co,levelValSym:et,useOnlyCustomLevelsSym:ao,streamSym:ho,formattersSym:yo,hooksSym:go,levelCompSym:Mn}=Y(),{noop:mo,genLog:U}=we(),{DEFAULT_LEVELS:V,SORTING_ORDER:zn}=Se(),Vn={fatal:e=>{let t=U(V.fatal,e);return function(...n){let r=this[ho];if(t.call(this,...n),typeof r.flushSync=="function")try{r.flushSync()}catch{}}},error:e=>U(V.error,e),warn:e=>U(V.warn,e),info:e=>U(V.info,e),debug:e=>U(V.debug,e),trace:e=>U(V.trace,e)},tt=Object.keys(V).reduce((e,t)=>(e[V[t]]=t,e),{}),po=Object.keys(tt).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function bo(e){let t=e[yo].level,{labels:n}=e.levels,r={};for(let i in n){let s=t(n[i],Number(i));r[i]=JSON.stringify(s).slice(0,-1)}return e[co]=r,e}function wo(e,t){if(t)return!1;switch(e){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function So(e){let{labels:t,values:n}=this.levels;if(typeof e=="number"){if(t[e]===void 0)throw Error("unknown level value"+e);e=t[e]}if(n[e]===void 0)throw Error("unknown level "+e);let r=this[et],i=this[et]=n[e],s=this[ao],u=this[Mn],l=this[go].logMethod;for(let f in n){if(u(n[f],i)===!1){this[f]=mo;continue}this[f]=wo(f,s)?Vn[f](l):U(n[f],l)}this.emit("level-change",e,i,t[r],r,this)}function _o(e){let{levels:t,levelVal:n}=this;return t&&t.labels?t.labels[n]:""}function Eo(e){let{values:t}=this.levels,n=t[e];return n!==void 0&&this[Mn](n,this[et])}function Oo(e,t,n){return e===zn.DESC?t<=n:t>=n}function xo(e){return typeof e=="string"?Oo.bind(null,e):e}function vo(e=null,t=!1){let n=e?Object.keys(e).reduce((s,u)=>(s[e[u]]=u,s),{}):null,r=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:tt,n),i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:V,e);return{labels:r,values:i}}function Ao(e,t,n){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(s=>t[s]),n?[]:Object.keys(tt).map(s=>+s),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}let r=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),n?null:V,t);if(!(e in r))throw Error(`default level:${e} must be included in custom levels`)}function Lo(e,t){let{labels:n,values:r}=e;for(let i in t){if(i in r)throw Error("levels cannot be overridden");if(t[i]in n)throw Error("pre-existing level values cannot be used for new levels")}}function To(e){if(typeof e!="function"&&!(typeof e=="string"&&Object.values(zn).includes(e)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}Kn.exports={initialLsCache:po,genLsCache:bo,levelMethods:Vn,getLevel:_o,setLevel:So,isLevelEnabled:Eo,mappings:vo,assertNoLevelCollisions:Lo,assertDefaultLevelFound:Ao,genLevelComparison:xo,assertLevelComparison:To}});var rt=v((ru,Jn)=>{"use strict";w();Jn.exports={version:"10.3.1"}});var er=v((ou,Zn)=>{"use strict";w();var{EventEmitter:ko}=B("events"),{lsCacheSym:Io,levelValSym:Co,setLevelSym:st,getLevelSym:Un,chindingsSym:Ee,mixinSym:Bo,asJsonSym:Hn,writeSym:jo,mixinMergeStrategySym:Po,timeSym:$o,timeSliceIndexSym:No,streamSym:Xn,serializersSym:G,formattersSym:ne,errorKeySym:Do,messageKeySym:Ro,useOnlyCustomLevelsSym:qo,needsMetadataGsym:Wo,redactFmtSym:Fo,stringifySym:Mo,formatOptsSym:zo,stringifiersSym:Vo,msgPrefixSym:ot,hooksSym:Ko}=Y(),{getLevel:Jo,setLevel:Uo,isLevelEnabled:Go,mappings:Ho,initialLsCache:Xo,genLsCache:Yo,assertNoLevelCollisions:Qo}=nt(),{asChindings:ft,asJson:Zo,buildFormatters:it,stringify:Gn,noop:Yn}=we(),{version:ef}=rt(),tf=De(),nf=class{},Qn={constructor:nf,child:rf,bindings:sf,setBindings:of,flush:uf,isLevelEnabled:Go,version:ef,get level(){return this[Un]()},set level(e){this[st](e)},get levelVal(){return this[Co]},set levelVal(e){throw Error("levelVal is read-only")},get msgPrefix(){return this[ot]},get[Symbol.toStringTag](){return"Pino"},[Io]:Xo,[jo]:lf,[Hn]:Zo,[Un]:Jo,[st]:Uo};Object.setPrototypeOf(Qn,ko.prototype);Zn.exports=function(){return Object.create(Qn)};var _e=e=>e;function rf(e,t){if(!e)throw Error("missing bindings for child Pino");let n=this[G],r=this[ne],i=Object.create(this);if(t==null)return i[ne].bindings!==_e&&(i[ne]=it(r.level,_e,r.log)),i[Ee]=ft(i,e),this.onChild!==Yn&&this.onChild(i),i;if(t.hasOwnProperty("serializers")===!0){i[G]=Object.create(null);for(let h in n)i[G][h]=n[h];let l=Object.getOwnPropertySymbols(n);for(var s=0;s<l.length;s++){let h=l[s];i[G][h]=n[h]}for(let h in t.serializers)i[G][h]=t.serializers[h];let f=Object.getOwnPropertySymbols(t.serializers);for(var u=0;u<f.length;u++){let h=f[u];i[G][h]=t.serializers[h]}}else i[G]=n;if(t.hasOwnProperty("formatters")){let{level:l,bindings:f,log:h}=t.formatters;i[ne]=it(l||r.level,f||_e,h||r.log)}else i[ne]=it(r.level,_e,r.log);if(t.hasOwnProperty("customLevels")===!0&&(Qo(this.levels,t.customLevels),i.levels=Ho(t.customLevels,i[qo]),Yo(i)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let l=tf(i.redact,Gn),f={stringify:l[Fo]};i[Mo]=Gn,i[Vo]=l,i[zo]=f}if(typeof t.msgPrefix=="string"&&(i[ot]=(this[ot]||"")+t.msgPrefix),i[Ee]=ft(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty("customLevels")){let l=t.level||this.level;i[st](l)}return this.onChild(i),i}function sf(){let t=`{${this[Ee].substr(1)}}`,n=JSON.parse(t);return delete n.pid,delete n.hostname,n}function of(e){let t=ft(this,e);this[Ee]=t}function ff(e,t){return Object.assign(t,e)}function lf(e,t,n){let r=this[$o](),i=this[Bo],s=this[Do],u=this[Ro],l=this[Po]||ff,f,h=this[Ko].streamWrite;e==null?f={}:e instanceof Error?(f={[s]:e},t===void 0&&(t=e.message)):(f=e,t===void 0&&e[u]===void 0&&e[s]&&(t=e[s].message)),i&&(f=l(f,i(f,n,this)));let d=this[Hn](f,t,n,r),c=this[Xn];c[Wo]===!0&&(c.lastLevel=n,c.lastObj=f,c.lastMsg=t,c.lastTime=r.slice(this[No]),c.lastLogger=this),c.write(h?h(d):d)}function uf(e){if(e!=null&&typeof e!="function")throw Error("callback must be a function");let t=this[Xn];typeof t.flush=="function"?t.flush(e||Yn):e&&e()}});var ir=v((at,rr)=>{"use strict";w();var{hasOwnProperty:re}=Object.prototype,X=ct();X.configure=ct;X.stringify=X;X.default=X;at.stringify=X;at.configure=ct;rr.exports=X;var cf=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function K(e){return e.length<5e3&&!cf.test(e)?`"${e}"`:JSON.stringify(e)}function lt(e,t){if(e.length>200||t)return e.sort(t);for(let n=1;n<e.length;n++){let r=e[n],i=n;for(;i!==0&&e[i-1]>r;)e[i]=e[i-1],i--;e[i]=r}return e}var af=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function ut(e){return af.call(e)!==void 0&&e.length!==0}function tr(e,t,n){e.length<n&&(n=e.length);let r=t===","?"":" ",i=`"0":${r}${e[0]}`;for(let s=1;s<n;s++)i+=`${t}"${s}":${r}${e[s]}`;return i}function hf(e){if(re.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function df(e){let t;if(re.call(e,"deterministic")&&(t=e.deterministic,typeof t!="boolean"&&typeof t!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return t===void 0?!0:t}function yf(e,t){let n;if(re.call(e,t)&&(n=e[t],typeof n!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return n===void 0?!0:n}function nr(e,t){let n;if(re.call(e,t)){if(n=e[t],typeof n!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(n))throw new TypeError(`The "${t}" argument must be an integer`);if(n<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return n===void 0?1/0:n}function H(e){return e===1?"1 item":`${e} items`}function gf(e){let t=new Set;for(let n of e)(typeof n=="string"||typeof n=="number")&&t.add(String(n));return t}function mf(e){if(re.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return n=>{let r=`Object can not safely be stringified. Received type ${typeof n}`;throw typeof n!="function"&&(r+=` (${n.toString()})`),new Error(r)}}}function ct(e){e={...e};let t=mf(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let n=hf(e),r=yf(e,"bigint"),i=df(e),s=typeof i=="function"?i:void 0,u=nr(e,"maximumDepth"),l=nr(e,"maximumBreadth");function f(y,o,g,p,S,_){let b=o[y];switch(typeof b=="object"&&b!==null&&typeof b.toJSON=="function"&&(b=b.toJSON(y)),b=p.call(o,y,b),typeof b){case"string":return K(b);case"object":{if(b===null)return"null";if(g.indexOf(b)!==-1)return n;let E="",T=",",C=_;if(Array.isArray(b)){if(b.length===0)return"[]";if(u<g.length+1)return'"[Array]"';g.push(b),S!==""&&(_+=S,E+=`
5
+ ${_}`,T=`,
6
+ ${_}`);let P=Math.min(b.length,l),R=0;for(;R<P-1;R++){let J=f(String(R),b,g,p,S,_);E+=J!==void 0?J:"null",E+=T}let q=f(String(R),b,g,p,S,_);if(E+=q!==void 0?q:"null",b.length-1>l){let J=b.length-l-1;E+=`${T}"... ${H(J)} not stringified"`}return S!==""&&(E+=`
7
+ ${C}`),g.pop(),`[${E}]`}let A=Object.keys(b),I=A.length;if(I===0)return"{}";if(u<g.length+1)return'"[Object]"';let O="",j="";S!==""&&(_+=S,T=`,
8
+ ${_}`,O=" ");let $=Math.min(I,l);i&&!ut(b)&&(A=lt(A,s)),g.push(b);for(let P=0;P<$;P++){let R=A[P],q=f(R,b,g,p,S,_);q!==void 0&&(E+=`${j}${K(R)}:${O}${q}`,j=T)}if(I>l){let P=I-l;E+=`${j}"...":${O}"${H(P)} not stringified"`,j=T}return S!==""&&j.length>1&&(E=`
9
+ ${_}${E}
10
+ ${C}`),g.pop(),`{${E}}`}case"number":return isFinite(b)?String(b):t?t(b):"null";case"boolean":return b===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(b);default:return t?t(b):void 0}}function h(y,o,g,p,S,_){switch(typeof o=="object"&&o!==null&&typeof o.toJSON=="function"&&(o=o.toJSON(y)),typeof o){case"string":return K(o);case"object":{if(o===null)return"null";if(g.indexOf(o)!==-1)return n;let b=_,E="",T=",";if(Array.isArray(o)){if(o.length===0)return"[]";if(u<g.length+1)return'"[Array]"';g.push(o),S!==""&&(_+=S,E+=`
11
+ ${_}`,T=`,
12
+ ${_}`);let I=Math.min(o.length,l),O=0;for(;O<I-1;O++){let $=h(String(O),o[O],g,p,S,_);E+=$!==void 0?$:"null",E+=T}let j=h(String(O),o[O],g,p,S,_);if(E+=j!==void 0?j:"null",o.length-1>l){let $=o.length-l-1;E+=`${T}"... ${H($)} not stringified"`}return S!==""&&(E+=`
13
+ ${b}`),g.pop(),`[${E}]`}g.push(o);let C="";S!==""&&(_+=S,T=`,
14
+ ${_}`,C=" ");let A="";for(let I of p){let O=h(I,o[I],g,p,S,_);O!==void 0&&(E+=`${A}${K(I)}:${C}${O}`,A=T)}return S!==""&&A.length>1&&(E=`
15
+ ${_}${E}
16
+ ${b}`),g.pop(),`{${E}}`}case"number":return isFinite(o)?String(o):t?t(o):"null";case"boolean":return o===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(o);default:return t?t(o):void 0}}function d(y,o,g,p,S){switch(typeof o){case"string":return K(o);case"object":{if(o===null)return"null";if(typeof o.toJSON=="function"){if(o=o.toJSON(y),typeof o!="object")return d(y,o,g,p,S);if(o===null)return"null"}if(g.indexOf(o)!==-1)return n;let _=S;if(Array.isArray(o)){if(o.length===0)return"[]";if(u<g.length+1)return'"[Array]"';g.push(o),S+=p;let O=`
17
+ ${S}`,j=`,
18
+ ${S}`,$=Math.min(o.length,l),P=0;for(;P<$-1;P++){let q=d(String(P),o[P],g,p,S);O+=q!==void 0?q:"null",O+=j}let R=d(String(P),o[P],g,p,S);if(O+=R!==void 0?R:"null",o.length-1>l){let q=o.length-l-1;O+=`${j}"... ${H(q)} not stringified"`}return O+=`
19
+ ${_}`,g.pop(),`[${O}]`}let b=Object.keys(o),E=b.length;if(E===0)return"{}";if(u<g.length+1)return'"[Object]"';S+=p;let T=`,
20
+ ${S}`,C="",A="",I=Math.min(E,l);ut(o)&&(C+=tr(o,T,l),b=b.slice(o.length),I-=o.length,A=T),i&&(b=lt(b,s)),g.push(o);for(let O=0;O<I;O++){let j=b[O],$=d(j,o[j],g,p,S);$!==void 0&&(C+=`${A}${K(j)}: ${$}`,A=T)}if(E>l){let O=E-l;C+=`${A}"...": "${H(O)} not stringified"`,A=T}return A!==""&&(C=`
21
+ ${S}${C}
22
+ ${_}`),g.pop(),`{${C}}`}case"number":return isFinite(o)?String(o):t?t(o):"null";case"boolean":return o===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(o);default:return t?t(o):void 0}}function c(y,o,g){switch(typeof o){case"string":return K(o);case"object":{if(o===null)return"null";if(typeof o.toJSON=="function"){if(o=o.toJSON(y),typeof o!="object")return c(y,o,g);if(o===null)return"null"}if(g.indexOf(o)!==-1)return n;let p="",S=o.length!==void 0;if(S&&Array.isArray(o)){if(o.length===0)return"[]";if(u<g.length+1)return'"[Array]"';g.push(o);let C=Math.min(o.length,l),A=0;for(;A<C-1;A++){let O=c(String(A),o[A],g);p+=O!==void 0?O:"null",p+=","}let I=c(String(A),o[A],g);if(p+=I!==void 0?I:"null",o.length-1>l){let O=o.length-l-1;p+=`,"... ${H(O)} not stringified"`}return g.pop(),`[${p}]`}let _=Object.keys(o),b=_.length;if(b===0)return"{}";if(u<g.length+1)return'"[Object]"';let E="",T=Math.min(b,l);S&&ut(o)&&(p+=tr(o,",",l),_=_.slice(o.length),T-=o.length,E=","),i&&(_=lt(_,s)),g.push(o);for(let C=0;C<T;C++){let A=_[C],I=c(A,o[A],g);I!==void 0&&(p+=`${E}${K(A)}:${I}`,E=",")}if(b>l){let C=b-l;p+=`${E}"...":"${H(C)} not stringified"`}return g.pop(),`{${p}}`}case"number":return isFinite(o)?String(o):t?t(o):"null";case"boolean":return o===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(o);default:return t?t(o):void 0}}function m(y,o,g){if(arguments.length>1){let p="";if(typeof g=="number"?p=" ".repeat(Math.min(g,10)):typeof g=="string"&&(p=g.slice(0,10)),o!=null){if(typeof o=="function")return f("",{"":y},[],o,p,"");if(Array.isArray(o))return h("",y,[],gf(o),p,"")}if(p.length!==0)return d("",y,[],p,"")}return c("",y,[])}return m}});var lr=v((uu,fr)=>{"use strict";w();var ht=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:or}=Se(),pf=or.info;function bf(e,t){e=e||[],t=t||{dedupe:!1};let n=Object.create(or);n.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(c=>{n[c]=t.levels[c]});let r={write:i,add:l,remove:f,emit:s,flushSync:u,end:h,minLevel:0,lastId:0,streams:[],clone:d,[ht]:!0,streamLevels:n};return Array.isArray(e)?e.forEach(l,r):l.call(r,e),e=null,r;function i(c){let m,y=this.lastLevel,{streams:o}=this,g=0,p;for(let S=wf(o.length,t.dedupe);_f(S,o.length,t.dedupe);S=Sf(S,t.dedupe))if(m=o[S],m.level<=y){if(g!==0&&g!==m.level)break;if(p=m.stream,p[ht]){let{lastTime:_,lastMsg:b,lastObj:E,lastLogger:T}=this;p.lastLevel=y,p.lastTime=_,p.lastMsg=b,p.lastObj=E,p.lastLogger=T}p.write(c),t.dedupe&&(g=m.level)}else if(!t.dedupe)break}function s(...c){for(let{stream:m}of this.streams)typeof m.emit=="function"&&m.emit(...c)}function u(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync()}function l(c){if(!c)return r;let m=typeof c.write=="function"||c.stream,y=c.write?c:c.stream;if(!m)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:o,streamLevels:g}=this,p;typeof c.levelVal=="number"?p=c.levelVal:typeof c.level=="string"?p=g[c.level]:typeof c.level=="number"?p=c.level:p=pf;let S={stream:y,level:p,levelVal:void 0,id:++r.lastId};return o.unshift(S),o.sort(sr),this.minLevel=o[0].level,r}function f(c){let{streams:m}=this,y=m.findIndex(o=>o.id===c);return y>=0&&(m.splice(y,1),m.sort(sr),this.minLevel=m.length>0?m[0].level:-1),r}function h(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync(),c.end()}function d(c){let m=new Array(this.streams.length);for(let y=0;y<m.length;y++)m[y]={level:c,stream:this.streams[y].stream};return{write:i,add:l,remove:f,minLevel:c,streams:m,clone:d,emit:s,flushSync:u,[ht]:!0}}}function sr(e,t){return e.level-t.level}function wf(e,t){return t?e-1:0}function Sf(e,t){return t?e-1:e+1}function _f(e,t,n){return n?e>=0:e<t}fr.exports=bf});var fl=v((au,W)=>{"use strict";w();var Ef=B("os"),mr=je(),Of=Pe(),xf=De(),pr=Qt(),vf=er(),br=Y(),{configure:Af}=ir(),{assertDefaultLevelFound:Lf,mappings:wr,genLsCache:Tf,genLevelComparison:kf,assertLevelComparison:If}=nt(),{DEFAULT_LEVELS:Sr,SORTING_ORDER:Cf}=Se(),{createArgsNormalizer:Bf,asChindings:jf,buildSafeSonicBoom:ur,buildFormatters:Pf,stringify:dt,normalizeDestFileDescriptor:cr,noop:$f}=we(),{version:Nf}=rt(),{chindingsSym:ar,redactFmtSym:Df,serializersSym:hr,timeSym:Rf,timeSliceIndexSym:qf,streamSym:Wf,stringifySym:dr,stringifySafeSym:yt,stringifiersSym:yr,setLevelSym:Ff,endSym:Mf,formatOptsSym:zf,messageKeySym:Vf,errorKeySym:Kf,nestedKeySym:Jf,mixinSym:Uf,levelCompSym:Gf,useOnlyCustomLevelsSym:Hf,formattersSym:gr,hooksSym:Xf,nestedKeyStrSym:Yf,mixinMergeStrategySym:Qf,msgPrefixSym:Zf}=br,{epochTime:_r,nullTime:el}=pr,{pid:tl}=process,nl=Ef.hostname(),rl=mr.err,il={level:"info",levelComparison:Cf.ASC,levels:Sr,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:tl,hostname:nl},serializers:Object.assign(Object.create(null),{err:rl}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:_r,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},sl=Bf(il),ol=Object.assign(Object.create(null),mr);function gt(...e){let t={},{opts:n,stream:r}=sl(t,Of(),...e);n.level&&typeof n.level=="string"&&Sr[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:i,crlf:s,serializers:u,timestamp:l,messageKey:f,errorKey:h,nestedKey:d,base:c,name:m,level:y,customLevels:o,levelComparison:g,mixin:p,mixinMergeStrategy:S,useOnlyCustomLevels:_,formatters:b,hooks:E,depthLimit:T,edgeLimit:C,onChild:A,msgPrefix:I}=n,O=Af({maximumDepth:T,maximumBreadth:C}),j=Pf(b.level,b.bindings,b.log),$=dt.bind({[yt]:O}),P=i?xf(i,$):{},R=i?{stringify:P[Df]}:{stringify:$},q="}"+(s?`\r
23
+ `:`
24
+ `),J=jf.bind(null,{[ar]:"",[hr]:u,[yr]:P,[dr]:dt,[yt]:O,[gr]:j}),Oe="";c!==null&&(m===void 0?Oe=J(c):Oe=J(Object.assign({},c,{name:m})));let mt=l instanceof Function?l:l?_r:el,Or=mt().indexOf(":")+1;if(_&&!o)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(p&&typeof p!="function")throw Error(`Unknown mixin type "${typeof p}" - expected "function"`);if(I&&typeof I!="string")throw Error(`Unknown msgPrefix type "${typeof I}" - expected "string"`);Lf(y,o,_);let pt=wr(o,_);typeof r.emit=="function"&&r.emit("message",{code:"PINO_CONFIG",config:{levels:pt,messageKey:f,errorKey:h}}),If(g);let xr=kf(g);return Object.assign(t,{levels:pt,[Gf]:xr,[Hf]:_,[Wf]:r,[Rf]:mt,[qf]:Or,[dr]:dt,[yt]:O,[yr]:P,[Mf]:q,[zf]:R,[Vf]:f,[Kf]:h,[Jf]:d,[Yf]:d?`,${JSON.stringify(d)}:{`:"",[hr]:u,[Uf]:p,[Qf]:S,[ar]:Oe,[gr]:j,[Xf]:E,silent:$f,onChild:A,[Zf]:I}),Object.setPrototypeOf(t,vf()),Tf(t),t[Ff](y),t}W.exports=gt;W.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=cr(e.dest||process.stdout.fd),ur(e)):ur({dest:cr(e),minLength:0});W.exports.transport=Xe();W.exports.multistream=lr();W.exports.levels=wr();W.exports.stdSerializers=ol;W.exports.stdTimeFunctions=Object.assign({},pr);W.exports.symbols=br;W.exports.version=Nf;W.exports.default=gt;W.exports.pino=gt});w();var ll=5e3,Er=class e{pinoInstance;state;context;telemetryCache=null;constructor(t,n={telemetryEnabled:!1},r={}){this.pinoInstance=t,this.state=n,this.context=r}getTelemetry(){if(!this.state.telemetryEnabled)return;let t=Date.now();return(!this.telemetryCache||t>=this.telemetryCache.expiresAt)&&(this.telemetryCache={value:bt.get(),expiresAt:t+ll}),this.telemetryCache.value}validate(t,n){if(typeof t!="string")throw new Error("Logger requires string message first, optional object second");if(n!==void 0&&(typeof n!="object"||n===null||Array.isArray(n)))throw new Error("Logger requires string message first, optional object second")}trace(t,n){this.validate(t,n),this.pinoInstance.trace({...this.context,...n,telemetry:this.getTelemetry()},t)}debug(t,n){this.validate(t,n),this.pinoInstance.debug({...this.context,...n,telemetry:this.getTelemetry()},t)}info(t,n){this.validate(t,n),this.pinoInstance.info({...this.context,...n,telemetry:this.getTelemetry()},t)}warn(t,n){this.validate(t,n),this.pinoInstance.warn({...this.context,...n,telemetry:this.getTelemetry()},t)}error(t,n){this.validate(t,n),this.pinoInstance.error({...this.context,...n,telemetry:this.getTelemetry()},t)}fatal(t,n){this.validate(t,n),this.pinoInstance.fatal({...this.context,...n,telemetry:this.getTelemetry()},t)}child(t){return new e(this.pinoInstance,this.state,{...this.context,...t})}setTelemetry(t){if(t!=="on"&&t!=="off")throw new Error("setTelemetry accepts only 'on' or 'off'");this.state.telemetryEnabled=t==="on"}get level(){return this.pinoInstance.level}set level(t){this.pinoInstance.level=t}get levelVal(){return this.pinoInstance.levelVal}bindings(){return{...this.context}}silent(){this.pinoInstance.level="silent"}flush(t){typeof this.pinoInstance.flush=="function"?this.pinoInstance.flush(t):t?.()}};export{un as a,Me as b,fl as c,Er as d};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{h as t}from"./chunk-VULBPPPP.mjs";t();var s;function R(){try{if(typeof process<"u"&&process.env&&process.env.RUNTIME){let e=process.env.RUNTIME.toLowerCase();if(["node","bun","deno","cloudflare","aws-lambda","gcp-cloudrun"].includes(e))return e}}catch{}try{if(typeof globalThis<"u"&&(globalThis.cloudflare||globalThis.caches||globalThis.WebSocketPair||globalThis.__CFW__)||typeof process<"u"&&process.env&&process.env.PLATFORM==="cloudflare")return"cloudflare"}catch{}try{if(typeof process<"u"&&process.env&&process.env.AWS_LAMBDA_FUNCTION_NAME)return"aws-lambda"}catch{}try{if(typeof process<"u"&&process.env&&(process.env.K_SERVICE||process.env.K_REVISION||process.env.GOOGLE_CLOUD_PROJECT))return"gcp-cloudrun"}catch{}return typeof Bun<"u"?"bun":typeof Deno<"u"&&Deno.version&&Deno.version.deno?"deno":"node"}function u(){return s!==void 0||(s=R()),s}t();t();var i;(typeof __EDGE_RUNTIME__>"u"||!__EDGE_RUNTIME__)&&(i=(await import("module")).createRequire);var o,g=()=>{if(!o){let e=u();if(i&&typeof import.meta<"u"&&import.meta.url)try{o=i(import.meta.url)}catch{}!o&&typeof globalThis.require=="function"&&(o=globalThis.require),o||(o=n=>{throw new Error(`require("${n}") is not available in this runtime (${e}).`)})}return o};function p(e){let n={},r=["KEY","SECRET","PASSWORD","TOKEN","AUTH","CREDENTIAL","APIKEY","PRIVATE","CERT","KEYSTORE"];for(let[c,a]of Object.entries(e)){if(a===void 0)continue;let f=c.toUpperCase(),m=r.some(y=>f.includes(y));n[c]=m?"[REDACTED]":a}return n}function E(e){let n=g()("node:os"),r=typeof process.memoryUsage=="function"?process.memoryUsage():{};return{runtime:e,os:process.platform,arch:process.arch,pid:process.pid,ppid:process.ppid??null,cwd:process.cwd(),uptime:process.uptime(),osVersion:n.release?.()??null,loadAvg:n.loadavg?.()??[0,0,0],memory:{rss:r.rss??null,heapTotal:r.heapTotal??null,heapUsed:r.heapUsed??null,external:r.external??null},env:p({...process.env})}}function _(){let e=typeof Deno<"u"?Deno:null,n=e&&typeof e.systemMemoryInfo=="function"?e.systemMemoryInfo():{};return{runtime:"deno",os:e?.build?.os??"unknown",arch:e?.build?.arch??"unknown",pid:e?.pid??null,ppid:e?.ppid??null,cwd:e?.cwd?.()??"",uptime:typeof performance<"u"?performance.now()/1e3:0,osVersion:e?.osRelease?.()??null,loadAvg:e?.loadavg?.()??[0,0,0],memory:{rss:n.total??null,heapTotal:null,heapUsed:null,external:null},env:p(e?.env?.toObject()??{})}}function h(){return{runtime:"unknown",os:"unknown",arch:"unknown",pid:null,ppid:null,cwd:"",uptime:0,osVersion:null,loadAvg:[0,0,0],memory:{rss:null,heapTotal:null,heapUsed:null,external:null},env:{}}}function v(){let e=u();switch(e){case"node":case"bun":return E(e);case"deno":return _();default:return h()}}var U={get:v};export{u as a,v as b,U as c};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ var a=Object.create;var r=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var u=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var s=(t,e)=>()=>(t&&(e=t(t=0)),e);var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),F=(t,e)=>{for(var o in e)r(t,o,{get:e[o],enumerable:!0})},n=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!l.call(t,m)&&m!==o&&r(t,m,{get:()=>e[m],enumerable:!(i=p(e,m))||i.enumerable});return t};var L=(t,e,o)=>(o=t!=null?a(f(t)):{},n(e||!t||!t.__esModule?r(o,"default",{value:t,enumerable:!0}):o,t)),P=t=>n(r({},"__esModule",{value:!0}),t);import _ from"path";import{fileURLToPath as d}from"url";var g,h,b,x=s(()=>{"use strict";g=()=>d(import.meta.url),h=()=>_.dirname(g()),b=h()});export{u as a,s as b,D as c,F as d,L as e,P as f,b as g,x as h};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as m}from"./chunk-V3XZ4XYN.mjs";import{h as g}from"./chunk-VULBPPPP.mjs";g();g();var L=m();async function F(){let t;switch(L){case"cloudflare":t=await import("./cloudflare-BDB3FS4Y.mjs");break;case"aws-lambda":t=await import("./lambda-S3DVSSBV.mjs");break;case"gcp-cloudrun":t=await import("./gcp-ZEEIATV7.mjs");break;case"bun":t=await import("./bun-GK5CEVAU.mjs");break;case"deno":t=await import("./deno-AIUOFIXG.mjs");break;default:t=await import("./node-A7ZN443L.mjs");break}let e=t.default,r=typeof e=="function"?e():e;return globalThis.logger=r,r}var M=await F();g();g();function T(t){return Date.UTC(t.y,t.m-1,t.d,t.h,t.i,t.s)}function N(t,e){return t.y===e.y&&t.m===e.m&&t.d===e.d&&t.h===e.h&&t.i===e.i&&t.s===e.s}function $(t,e){let r=new Date(Date.parse(t));if(isNaN(r))throw new Error("Invalid ISO8601 passed to timezone parser.");let i=t.substring(9);return i.includes("Z")||i.includes("+")||i.includes("-")?R(r.getUTCFullYear(),r.getUTCMonth()+1,r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),"Etc/UTC"):R(r.getFullYear(),r.getMonth()+1,r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),e)}function U(t,e,r){return S($(t,e),r)}function S(t,e){let r=new Date(T(t)),i=v(r,t.tz),n=T(t),s=T(i),o=n-s,a=new Date(r.getTime()+o),h=v(a,t.tz);if(N(h,t)){let u=new Date(a.getTime()-36e5),f=v(u,t.tz);return N(f,t)?u:a}let l=new Date(a.getTime()+T(t)-T(h)),p=v(l,t.tz);if(N(p,t))return l;if(e)throw new Error("Invalid date passed to fromTZ()");return a.getTime()>l.getTime()?a:l}function v(t,e){let r,i;try{r=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),i=r.formatToParts(t)}catch(s){let o=s instanceof Error?s.message:String(s);throw new RangeError(`toTZ: Invalid timezone '${e}' or date. Please provide a valid IANA timezone (e.g., 'America/New_York', 'Europe/Stockholm'). Original error: ${o}`)}let n={year:0,month:0,day:0,hour:0,minute:0,second:0};for(let s of i)(s.type==="year"||s.type==="month"||s.type==="day"||s.type==="hour"||s.type==="minute"||s.type==="second")&&(n[s.type]=parseInt(s.value,10));if(isNaN(n.year)||isNaN(n.month)||isNaN(n.day)||isNaN(n.hour)||isNaN(n.minute)||isNaN(n.second))throw new Error(`toTZ: Failed to parse all date components from timezone '${e}'. This may indicate an invalid date or timezone configuration. Parsed components: ${JSON.stringify(n)}`);return n.hour===24&&(n.hour=0),{y:n.year,m:n.month,d:n.day,h:n.hour,i:n.minute,s:n.second,tz:e}}function R(t,e,r,i,n,s,o){return{y:t,m:e,d:r,h:i,i:n,s,tz:o}}var z=[1,2,4,8,16],P=class{pattern;timezone;mode;alternativeWeekdays;sloppyRanges;second;minute;hour;day;month;dayOfWeek;year;lastDayOfMonth;lastWeekday;nearestWeekdays;starDOM;starDOW;starYear;useAndLogic;constructor(t,e,r){this.pattern=t,this.timezone=e,this.mode=r?.mode??"auto",this.alternativeWeekdays=r?.alternativeWeekdays??!1,this.sloppyRanges=r?.sloppyRanges??!1,this.second=Array(60).fill(0),this.minute=Array(60).fill(0),this.hour=Array(24).fill(0),this.day=Array(31).fill(0),this.month=Array(12).fill(0),this.dayOfWeek=Array(7).fill(0),this.year=Array(1e4).fill(0),this.lastDayOfMonth=!1,this.lastWeekday=!1,this.nearestWeekdays=Array(31).fill(0),this.starDOM=!1,this.starDOW=!1,this.starYear=!1,this.useAndLogic=!1,this.parse()}parse(){if(!(typeof this.pattern=="string"||this.pattern instanceof String))throw new TypeError("CronPattern: Pattern has to be of type string.");this.pattern.indexOf("@")>=0&&(this.pattern=this.handleNicknames(this.pattern).trim());let t=this.pattern.match(/\S+/g)||[""],e=t.length;if(t.length<5||t.length>7)throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five, six, or seven space separated parts are required.");if(this.mode!=="auto"){let i;switch(this.mode){case"5-part":i=5;break;case"6-part":i=6;break;case"7-part":i=7;break;case"5-or-6-parts":i=[5,6];break;case"6-or-7-parts":i=[6,7];break;default:i=0}if(!(Array.isArray(i)?i.includes(e):e===i)){let n=Array.isArray(i)?i.join(" or "):i.toString();throw new TypeError(`CronPattern: mode '${this.mode}' requires exactly ${n} parts, but pattern '${this.pattern}' has ${e} parts.`)}}if(t.length===5&&t.unshift("0"),t.length===6&&t.push("*"),t[3].toUpperCase()==="LW"?(this.lastWeekday=!0,t[3]=""):t[3].toUpperCase().indexOf("L")>=0&&(t[3]=t[3].replace(/L/gi,""),this.lastDayOfMonth=!0),t[3]=="*"&&(this.starDOM=!0),t[6]=="*"&&(this.starYear=!0),t[4].length>=3&&(t[4]=this.replaceAlphaMonths(t[4])),t[5].length>=3&&(t[5]=this.alternativeWeekdays?this.replaceAlphaDaysQuartz(t[5]):this.replaceAlphaDays(t[5])),t[5].startsWith("+")&&(this.useAndLogic=!0,t[5]=t[5].substring(1),t[5]===""))throw new TypeError("CronPattern: Day-of-week field cannot be empty after '+' modifier.");switch(t[5]=="*"&&(this.starDOW=!0),this.pattern.indexOf("?")>=0&&(t[0]=t[0].replace(/\?/g,"*"),t[1]=t[1].replace(/\?/g,"*"),t[2]=t[2].replace(/\?/g,"*"),t[3]=t[3].replace(/\?/g,"*"),t[4]=t[4].replace(/\?/g,"*"),t[5]=t[5].replace(/\?/g,"*"),t[6]&&(t[6]=t[6].replace(/\?/g,"*"))),this.mode){case"5-part":t[0]="0",t[6]="*";break;case"6-part":t[6]="*";break;case"5-or-6-parts":t[6]="*";break;case"6-or-7-parts":break;case"7-part":case"auto":break}this.throwAtIllegalCharacters(t),this.partToArray("second",t[0],0,1),this.partToArray("minute",t[1],0,1),this.partToArray("hour",t[2],0,1),this.partToArray("day",t[3],-1,1),this.partToArray("month",t[4],-1,1);let r=this.alternativeWeekdays?-1:0;this.partToArray("dayOfWeek",t[5],r,63),this.partToArray("year",t[6],0,1),!this.alternativeWeekdays&&this.dayOfWeek[7]&&(this.dayOfWeek[0]=this.dayOfWeek[7])}partToArray(t,e,r,i){let n=this[t],s=t==="day"&&this.lastDayOfMonth,o=t==="day"&&this.lastWeekday;if(e===""&&!s&&!o)throw new TypeError("CronPattern: configuration entry "+t+" ("+e+") is empty, check for trailing spaces.");if(e==="*")return n.fill(i);let a=e.split(",");if(a.length>1)for(let h=0;h<a.length;h++)this.partToArray(t,a[h],r,i);else e.indexOf("-")!==-1&&e.indexOf("/")!==-1?this.handleRangeWithStepping(e,t,r,i):e.indexOf("-")!==-1?this.handleRange(e,t,r,i):e.indexOf("/")!==-1?this.handleStepping(e,t,r,i):e!==""&&this.handleNumber(e,t,r,i)}throwAtIllegalCharacters(t){for(let e=0;e<t.length;e++)if((e===3?/[^/*0-9,\-WwLl]+/:e===5?/[^/*0-9,\-#Ll]+/:/[^/*0-9,\-]+/).test(t[e]))throw new TypeError("CronPattern: configuration entry "+e+" ("+t[e]+") contains illegal characters.")}handleNumber(t,e,r,i){let n=this.extractNth(t,e),s=t.toUpperCase().includes("W");if(e!=="day"&&s)throw new TypeError("CronPattern: Nearest weekday modifier (W) only allowed in day-of-month.");s&&(e="nearestWeekdays");let o=parseInt(n[0],10)+r;if(isNaN(o))throw new TypeError("CronPattern: "+e+" is not a number: '"+t+"'");this.setPart(e,o,n[1]||i)}setPart(t,e,r){if(!Object.prototype.hasOwnProperty.call(this,t))throw new TypeError("CronPattern: Invalid part specified: "+t);if(t==="dayOfWeek"){if(e===7&&(e=0),e<0||e>6)throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+e);this.setNthWeekdayOfMonth(e,r);return}if(t==="second"||t==="minute"){if(e<0||e>=60)throw new RangeError("CronPattern: Invalid value for "+t+": "+e)}else if(t==="hour"){if(e<0||e>=24)throw new RangeError("CronPattern: Invalid value for "+t+": "+e)}else if(t==="day"||t==="nearestWeekdays"){if(e<0||e>=31)throw new RangeError("CronPattern: Invalid value for "+t+": "+e)}else if(t==="month"){if(e<0||e>=12)throw new RangeError("CronPattern: Invalid value for "+t+": "+e)}else if(t==="year"&&(e<1||e>=1e4))throw new RangeError("CronPattern: Invalid value for "+t+": "+e+" (supported range: 1-9999)");this[t][e]=r}validateNotNaN(t,e){if(isNaN(t))throw new TypeError(e)}validateRange(t,e,r,i,n){if(t>e)throw new TypeError("CronPattern: From value is larger than to value: '"+n+"'");if(r!==void 0){if(r===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(r>this[i].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[i].length+")")}}handleRangeWithStepping(t,e,r,i){if(t.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in ranges with stepping.");let n=this.extractNth(t,e),s=n[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(s===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+t+"'");let[,o,a,h]=s,l=parseInt(o,10)+r,p=parseInt(a,10)+r,u=parseInt(h,10);this.validateNotNaN(l,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(p,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateNotNaN(u,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(l,p,u,e,t);for(let f=l;f<=p;f+=u)this.setPart(e,f,n[1]||i)}extractNth(t,e){let r=t,i;if(r.includes("#")){if(e!=="dayOfWeek")throw new Error("CronPattern: nth (#) only allowed in day-of-week field");i=r.split("#")[1],r=r.split("#")[0]}else if(r.toUpperCase().endsWith("L")){if(e!=="dayOfWeek")throw new Error("CronPattern: L modifier only allowed in day-of-week field (use L alone for day-of-month)");i="L",r=r.slice(0,-1)}return[r,i]}handleRange(t,e,r,i){if(t.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in a range.");let n=this.extractNth(t,e),s=n[0].split("-");if(s.length!==2)throw new TypeError("CronPattern: Syntax error, illegal range: '"+t+"'");let o=parseInt(s[0],10)+r,a=parseInt(s[1],10)+r;this.validateNotNaN(o,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(a,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateRange(o,a,void 0,e,t);for(let h=o;h<=a;h++)this.setPart(e,h,n[1]||i)}handleStepping(t,e,r,i){if(t.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in parts with stepping.");let n=this.extractNth(t,e),s=n[0].split("/");if(s.length!==2)throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+t+"'");if(this.sloppyRanges)s[0]===""&&(s[0]="*");else{if(s[0]==="")throw new TypeError("CronPattern: Syntax error, stepping with missing prefix ('"+t+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.");if(s[0]!=="*")throw new TypeError("CronPattern: Syntax error, stepping with numeric prefix ('"+t+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.")}let o=0;s[0]!=="*"&&(o=parseInt(s[0],10)+r);let a=parseInt(s[1],10);this.validateNotNaN(a,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(0,this[e].length-1,a,e,t);for(let h=o;h<this[e].length;h+=a)this.setPart(e,h,n[1]||i)}replaceAlphaDays(t){return t.replace(/-sun/gi,"-7").replace(/sun/gi,"0").replace(/mon/gi,"1").replace(/tue/gi,"2").replace(/wed/gi,"3").replace(/thu/gi,"4").replace(/fri/gi,"5").replace(/sat/gi,"6")}replaceAlphaDaysQuartz(t){return t.replace(/sun/gi,"1").replace(/mon/gi,"2").replace(/tue/gi,"3").replace(/wed/gi,"4").replace(/thu/gi,"5").replace(/fri/gi,"6").replace(/sat/gi,"7")}replaceAlphaMonths(t){return t.replace(/jan/gi,"1").replace(/feb/gi,"2").replace(/mar/gi,"3").replace(/apr/gi,"4").replace(/may/gi,"5").replace(/jun/gi,"6").replace(/jul/gi,"7").replace(/aug/gi,"8").replace(/sep/gi,"9").replace(/oct/gi,"10").replace(/nov/gi,"11").replace(/dec/gi,"12")}handleNicknames(t){let e=t.trim().toLowerCase();if(e==="@yearly"||e==="@annually")return"0 0 1 1 *";if(e==="@monthly")return"0 0 1 * *";if(e==="@weekly")return"0 0 * * 0";if(e==="@daily"||e==="@midnight")return"0 0 * * *";if(e==="@hourly")return"0 * * * *";if(e==="@reboot")throw new TypeError("CronPattern: @reboot is not supported in this environment. This is an event-based trigger that requires system startup detection.");return t}setNthWeekdayOfMonth(t,e){if(typeof e!="number"&&e.toUpperCase()==="L")this.dayOfWeek[t]=this.dayOfWeek[t]|32;else if(e===63)this.dayOfWeek[t]=63;else if(e<6&&e>0)this.dayOfWeek[t]=this.dayOfWeek[t]|z[e-1];else throw new TypeError(`CronPattern: nth weekday out of range, should be 1-5 or L. Value: ${e}, Type: ${typeof e}`)}},b=[31,28,31,30,31,30,31,31,30,31,30,31],d=[["month","year",0],["day","month",-1],["hour","day",0],["minute","hour",0],["second","minute",0]],y=class I{tz;ms;second;minute;hour;day;month;year;constructor(e,r){if(this.tz=r,e&&e instanceof Date)if(!isNaN(e))this.fromDate(e);else throw new TypeError("CronDate: Invalid date passed to CronDate constructor");else if(e==null)this.fromDate(new Date);else if(e&&typeof e=="string")this.fromString(e);else if(e instanceof I)this.fromCronDate(e);else throw new TypeError("CronDate: Invalid type ("+typeof e+") passed to CronDate constructor")}getLastDayOfMonth(e,r){return r!==1?b[r]:new Date(Date.UTC(e,r+1,0)).getUTCDate()}getLastWeekday(e,r){let i=this.getLastDayOfMonth(e,r),n=new Date(Date.UTC(e,r,i)).getUTCDay();return n===0?i-2:n===6?i-1:i}getNearestWeekday(e,r,i){let n=this.getLastDayOfMonth(e,r);if(i>n)return-1;let s=new Date(Date.UTC(e,r,i)).getUTCDay();return s===0?i===n?i-2:i+1:s===6?i===1?i+2:i-1:i}isNthWeekdayOfMonth(e,r,i,n){let s=new Date(Date.UTC(e,r,i)).getUTCDay(),o=0;for(let a=1;a<=i;a++)new Date(Date.UTC(e,r,a)).getUTCDay()===s&&o++;if(n&63&&z[o-1]&n)return!0;if(n&32){let a=this.getLastDayOfMonth(e,r);for(let h=i+1;h<=a;h++)if(new Date(Date.UTC(e,r,h)).getUTCDay()===s)return!1;return!0}return!1}fromDate(e){if(this.tz!==void 0)if(typeof this.tz=="number")this.ms=e.getUTCMilliseconds(),this.second=e.getUTCSeconds(),this.minute=e.getUTCMinutes()+this.tz,this.hour=e.getUTCHours(),this.day=e.getUTCDate(),this.month=e.getUTCMonth(),this.year=e.getUTCFullYear(),this.apply();else try{let r=v(e,this.tz);this.ms=e.getMilliseconds(),this.second=r.s,this.minute=r.i,this.hour=r.h,this.day=r.d,this.month=r.m-1,this.year=r.y}catch(r){let i=r instanceof Error?r.message:String(r);throw new TypeError(`CronDate: Failed to convert date to timezone '${this.tz}'. This may happen with invalid timezone names or dates. Original error: ${i}`)}else this.ms=e.getMilliseconds(),this.second=e.getSeconds(),this.minute=e.getMinutes(),this.hour=e.getHours(),this.day=e.getDate(),this.month=e.getMonth(),this.year=e.getFullYear()}fromCronDate(e){this.tz=e.tz,this.year=e.year,this.month=e.month,this.day=e.day,this.hour=e.hour,this.minute=e.minute,this.second=e.second,this.ms=e.ms}apply(){if(this.month>11||this.month<0||this.day>b[this.month]||this.day<1||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){let e=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));return this.ms=e.getUTCMilliseconds(),this.second=e.getUTCSeconds(),this.minute=e.getUTCMinutes(),this.hour=e.getUTCHours(),this.day=e.getUTCDate(),this.month=e.getUTCMonth(),this.year=e.getUTCFullYear(),!0}else return!1}fromString(e){if(typeof this.tz=="number"){let r=U(e);this.ms=r.getUTCMilliseconds(),this.second=r.getUTCSeconds(),this.minute=r.getUTCMinutes(),this.hour=r.getUTCHours(),this.day=r.getUTCDate(),this.month=r.getUTCMonth(),this.year=r.getUTCFullYear(),this.apply()}else return this.fromDate(U(e,this.tz))}findNext(e,r,i,n){return this._findMatch(e,r,i,n,1)}_findMatch(e,r,i,n,s){let o=this[r],a;i.lastDayOfMonth&&(a=this.getLastDayOfMonth(this.year,this.month));let h=!i.starDOW&&r=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():void 0,l=this[r]+n,p=s===1?u=>u<i[r].length:u=>u>=0;for(let u=l;p(u);u+=s){let f=i[r][u];if(r==="day"&&!f){for(let c=0;c<i.nearestWeekdays.length;c++)if(i.nearestWeekdays[c]){let E=this.getNearestWeekday(this.year,this.month,c-n);if(E===-1)continue;if(E===u-n){f=1;break}}}if(r==="day"&&i.lastWeekday){let c=this.getLastWeekday(this.year,this.month);u-n===c&&(f=1)}if(r==="day"&&i.lastDayOfMonth&&u-n==a&&(f=1),r==="day"&&!i.starDOW){let c=i.dayOfWeek[(h+(u-n-1))%7];if(c&&c&63)c=this.isNthWeekdayOfMonth(this.year,this.month,u-n,c)?1:0;else if(c)throw new Error(`CronDate: Invalid value for dayOfWeek encountered. ${c}`);i.useAndLogic?f=f&&c:!e.domAndDow&&!i.starDOM?f=f||c:f=f&&c}if(f)return this[r]=u-n,o!==this[r]?2:1}return 3}recurse(e,r,i){if(i===0&&!e.starYear){if(this.year>=0&&this.year<e.year.length&&e.year[this.year]===0){let s=-1;for(let o=this.year+1;o<e.year.length&&o<1e4;o++)if(e.year[o]===1){s=o;break}if(s===-1)return null;this.year=s,this.month=0,this.day=1,this.hour=0,this.minute=0,this.second=0,this.ms=0}if(this.year>=1e4)return null}let n=this.findNext(r,d[i][0],e,d[i][2]);if(n>1){let s=i+1;for(;s<d.length;)this[d[s][0]]=-d[s][2],s++;if(n===3){if(this[d[i][1]]++,this[d[i][0]]=-d[i][2],this.apply(),i===0&&!e.starYear){for(;this.year>=0&&this.year<e.year.length&&e.year[this.year]===0&&this.year<1e4;)this.year++;if(this.year>=1e4||this.year>=e.year.length)return null}return this.recurse(e,r,0)}else if(this.apply())return this.recurse(e,r,i-1)}return i+=1,i>=d.length?this:(e.starYear?this.year>=3e3:this.year>=1e4)?null:this.recurse(e,r,i)}increment(e,r,i){return this.second+=r.interval!==void 0&&r.interval>1&&i?r.interval:1,this.ms=0,this.apply(),this.recurse(e,r,0)}decrement(e,r){return this.second-=r.interval!==void 0&&r.interval>1?r.interval:1,this.ms=0,this.apply(),this.recurseBackward(e,r,0,0)}recurseBackward(e,r,i,n=0){if(n>1e4)return null;if(i===0&&!e.starYear){if(this.year>=0&&this.year<e.year.length&&e.year[this.year]===0){let o=-1;for(let a=this.year-1;a>=0;a--)if(e.year[a]===1){o=a;break}if(o===-1)return null;this.year=o,this.month=11,this.day=31,this.hour=23,this.minute=59,this.second=59,this.ms=0}if(this.year<0)return null}let s=this.findPrevious(r,d[i][0],e,d[i][2]);if(s>1){let o=i+1;for(;o<d.length;){let a=d[o][0],h=d[o][2],l=this.getMaxPatternValue(a,e,h);this[a]=l,o++}if(s===3){if(this[d[i][1]]--,i===0){let p=this.getLastDayOfMonth(this.year,this.month);this.day>p&&(this.day=p)}if(i===1)if(this.day<=0)this.day=1;else{let p=this.year,u=this.month;for(;u<0;)u+=12,p--;for(;u>11;)u-=12,p++;let f=u!==1?b[u]:new Date(Date.UTC(p,u+1,0)).getUTCDate();this.day>f&&(this.day=f)}this.apply();let a=d[i][0],h=d[i][2],l=this.getMaxPatternValue(a,e,h);if(a==="day"){let p=this.getLastDayOfMonth(this.year,this.month);this[a]=Math.min(l,p)}else this[a]=l;if(this.apply(),i===0){let p=d[1][2],u=this.getMaxPatternValue("day",e,p),f=this.getLastDayOfMonth(this.year,this.month),c=Math.min(u,f);c!==this.day&&(this.day=c,this.hour=this.getMaxPatternValue("hour",e,d[2][2]),this.minute=this.getMaxPatternValue("minute",e,d[3][2]),this.second=this.getMaxPatternValue("second",e,d[4][2]))}if(i===0&&!e.starYear){for(;this.year>=0&&this.year<e.year.length&&e.year[this.year]===0;)this.year--;if(this.year<0)return null}return this.recurseBackward(e,r,0,n+1)}else if(this.apply())return this.recurseBackward(e,r,i-1,n+1)}return i+=1,i>=d.length?this:this.year<0?null:this.recurseBackward(e,r,i,n+1)}getMaxPatternValue(e,r,i){if(e==="day"&&r.lastDayOfMonth)return this.getLastDayOfMonth(this.year,this.month);if(e==="day"&&!r.starDOW)return this.getLastDayOfMonth(this.year,this.month);for(let n=r[e].length-1;n>=0;n--)if(r[e][n])return n-i;return r[e].length-1-i}findPrevious(e,r,i,n){return this._findMatch(e,r,i,n,-1)}getDate(e){return e||this.tz===void 0?new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms):typeof this.tz=="number"?new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms)):S(R(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz),!1)}getTime(){return this.getDate(!1).getTime()}match(e,r){if(!e.starYear&&(this.year<0||this.year>=e.year.length||e.year[this.year]===0))return!1;for(let i=0;i<d.length;i++){let n=d[i][0],s=d[i][2],o=this[n];if(o+s<0||o+s>=e[n].length)return!1;let a=e[n][o+s];if(n==="day"){if(!a){for(let h=0;h<e.nearestWeekdays.length;h++)if(e.nearestWeekdays[h]){let l=this.getNearestWeekday(this.year,this.month,h-s);if(l!==-1&&l===o){a=1;break}}}if(e.lastWeekday){let h=this.getLastWeekday(this.year,this.month);o===h&&(a=1)}if(e.lastDayOfMonth){let h=this.getLastDayOfMonth(this.year,this.month);o===h&&(a=1)}if(!e.starDOW){let h=new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay(),l=e.dayOfWeek[(h+(o-1))%7];l&&l&63&&(l=this.isNthWeekdayOfMonth(this.year,this.month,o,l)?1:0),e.useAndLogic?a=a&&l:!r.domAndDow&&!e.starDOM?a=a||l:a=a&&l}}if(!a)return!1}return!0}};function Y(t){if(t===void 0&&(t={}),delete t.name,t.legacyMode!==void 0&&t.domAndDow===void 0?t.domAndDow=!t.legacyMode:t.domAndDow===void 0&&(t.domAndDow=!1),t.legacyMode=!t.domAndDow,t.paused=t.paused===void 0?!1:t.paused,t.maxRuns=t.maxRuns===void 0?1/0:t.maxRuns,t.catch=t.catch===void 0?!1:t.catch,t.interval=t.interval===void 0?0:parseInt(t.interval.toString(),10),t.utcOffset=t.utcOffset===void 0?void 0:parseInt(t.utcOffset.toString(),10),t.dayOffset=t.dayOffset===void 0?0:parseInt(t.dayOffset.toString(),10),t.unref=t.unref===void 0?!1:t.unref,t.mode=t.mode===void 0?"auto":t.mode,t.alternativeWeekdays=t.alternativeWeekdays===void 0?!1:t.alternativeWeekdays,t.sloppyRanges=t.sloppyRanges===void 0?!1:t.sloppyRanges,!["auto","5-part","6-part","7-part","5-or-6-parts","6-or-7-parts"].includes(t.mode))throw new Error("CronOptions: mode must be one of 'auto', '5-part', '6-part', '7-part', '5-or-6-parts', or '6-or-7-parts'.");if(t.startAt&&(t.startAt=new y(t.startAt,t.timezone)),t.stopAt&&(t.stopAt=new y(t.stopAt,t.timezone)),t.interval!==null){if(isNaN(t.interval))throw new Error("CronOptions: Supplied value for interval is not a number");if(t.interval<0)throw new Error("CronOptions: Supplied value for interval can not be negative")}if(t.utcOffset!==void 0){if(isNaN(t.utcOffset))throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.");if(t.utcOffset<-870||t.utcOffset>870)throw new Error("CronOptions: utcOffset out of bounds.");if(t.utcOffset!==void 0&&t.timezone)throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.")}if(t.unref!==!0&&t.unref!==!1)throw new Error("CronOptions: Unref should be either true, false or undefined(false).");if(t.dayOffset!==void 0&&t.dayOffset!==0&&isNaN(t.dayOffset))throw new Error("CronOptions: Invalid value passed for dayOffset, should be a number representing days to offset.");return t}function D(t){return Object.prototype.toString.call(t)==="[object Function]"||typeof t=="function"||t instanceof Function}function j(t){return D(t)}function q(t){typeof Deno<"u"&&typeof Deno.unrefTimer<"u"?Deno.unrefTimer(t):t&&typeof t.unref<"u"&&t.unref()}var A=30*1e3,O=[],_=class{name;options;_states;fn;getTz(){return this.options.timezone||this.options.utcOffset}applyDayOffset(t){if(this.options.dayOffset!==void 0&&this.options.dayOffset!==0){let e=this.options.dayOffset*24*60*60*1e3;return new Date(t.getTime()+e)}return t}constructor(t,e,r){let i,n;if(D(e))n=e;else if(typeof e=="object")i=e;else if(e!==void 0)throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).");if(D(r))n=r;else if(typeof r=="object")i=r;else if(r!==void 0)throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).");if(this.name=i?.name,this.options=Y(i),this._states={kill:!1,blocking:!1,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:i?i.maxRuns:void 0,paused:i?i.paused:!1,pattern:new P("* * * * *",void 0,{mode:"auto"})},t&&(t instanceof Date||typeof t=="string"&&t.indexOf(":")>0)?this._states.once=new y(t,this.getTz()):this._states.pattern=new P(t,this.options.timezone,{mode:this.options.mode,alternativeWeekdays:this.options.alternativeWeekdays,sloppyRanges:this.options.sloppyRanges}),this.name){if(O.find(s=>s.name===this.name))throw new Error("Cron: Tried to initialize new named job '"+this.name+"', but name already taken.");O.push(this)}return n!==void 0&&j(n)&&(this.fn=n,this.schedule()),this}nextRun(t){let e=this._next(t);return e?this.applyDayOffset(e.getDate(!1)):null}nextRuns(t,e){this._states.maxRuns!==void 0&&t>this._states.maxRuns&&(t=this._states.maxRuns);let r=e||this._states.currentRun||void 0;return this._enumerateRuns(t,r,"next")}previousRuns(t,e){return this._enumerateRuns(t,e||void 0,"previous")}_enumerateRuns(t,e,r){let i=[],n=e?new y(e,this.getTz()):null,s=r==="next"?this._next:this._previous;for(;t--;){let o=s.call(this,n);if(!o)break;let a=o.getDate(!1);i.push(this.applyDayOffset(a)),n=o}return i}match(t){if(this._states.once){let r=new y(t,this.getTz());r.ms=0;let i=new y(this._states.once,this.getTz());return i.ms=0,r.getTime()===i.getTime()}let e=new y(t,this.getTz());return e.ms=0,e.match(this._states.pattern,this.options)}getPattern(){if(!this._states.once)return this._states.pattern?this._states.pattern.pattern:void 0}getOnce(){return this._states.once?this._states.once.getDate():null}isRunning(){let t=this.nextRun(this._states.currentRun),e=!this._states.paused,r=this.fn!==void 0,i=!this._states.kill;return e&&r&&i&&t!==null}isStopped(){return this._states.kill}isBusy(){return this._states.blocking}currentRun(){return this._states.currentRun?this._states.currentRun.getDate():null}previousRun(){return this._states.previousRun?this._states.previousRun.getDate():null}msToNext(t){let e=this._next(t);return e?t instanceof y||t instanceof Date?e.getTime()-t.getTime():e.getTime()-new y(t).getTime():null}stop(){this._states.kill=!0,this._states.currentTimeout&&clearTimeout(this._states.currentTimeout);let t=O.indexOf(this);t>=0&&O.splice(t,1)}pause(){return this._states.paused=!0,!this._states.kill}resume(){return this._states.paused=!1,!this._states.kill}schedule(t){if(t&&this.fn)throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance.");t&&(this.fn=t);let e=this.msToNext(),r=this.nextRun(this._states.currentRun);return e==null||isNaN(e)||r===null?this:(e>A&&(e=A),this._states.currentTimeout=setTimeout(()=>this._checkTrigger(r),e),this._states.currentTimeout&&this.options.unref&&q(this._states.currentTimeout),this)}async _trigger(t){this._states.blocking=!0,this._states.currentRun=new y(void 0,this.getTz());try{if(this.options.catch)try{this.fn!==void 0&&await this.fn(this,this.options.context)}catch(e){if(D(this.options.catch))try{this.options.catch(e,this)}catch{}}else this.fn!==void 0&&await this.fn(this,this.options.context)}finally{this._states.previousRun=new y(t,this.getTz()),this._states.blocking=!1}}async trigger(){await this._trigger()}runsLeft(){return this._states.maxRuns}_checkTrigger(t){let e=new Date,r=!this._states.paused&&e.getTime()>=t.getTime(),i=this._states.blocking&&this.options.protect;r&&!i?(this._states.maxRuns!==void 0&&this._states.maxRuns--,this._trigger()):r&&i&&D(this.options.protect)&&setTimeout(()=>this.options.protect(this),0),this.schedule()}_next(t){let e=!!(t||this._states.currentRun),r=!1;!t&&this.options.startAt&&this.options.interval&&([t,e]=this._calculatePreviousRun(t,e),r=!t),t=new y(t,this.getTz()),this.options.startAt&&t&&t.getTime()<this.options.startAt.getTime()&&(t=this.options.startAt);let i=this._states.once||new y(t,this.getTz());return!r&&i!==this._states.once&&(i=i.increment(this._states.pattern,this.options,e)),this._states.once&&this._states.once.getTime()<=t.getTime()||i===null||this._states.maxRuns!==void 0&&this._states.maxRuns<=0||this._states.kill||this.options.stopAt&&i.getTime()>=this.options.stopAt.getTime()?null:i}_previous(t){let e=new y(t,this.getTz());this.options.stopAt&&e.getTime()>this.options.stopAt.getTime()&&(e=this.options.stopAt);let r=new y(e,this.getTz());return this._states.once?this._states.once.getTime()<e.getTime()?this._states.once:null:(r=r.decrement(this._states.pattern,this.options),r===null||this.options.startAt&&r.getTime()<this.options.startAt.getTime()?null:r)}_calculatePreviousRun(t,e){let r=new y(void 0,this.getTz()),i=t;if(this.options.startAt.getTime()<=r.getTime()){i=this.options.startAt;let n=i.getTime()+this.options.interval*1e3;for(;n<=r.getTime();)i=new y(i,this.getTz()).increment(this._states.pattern,this.options,!0),n=i.getTime()+this.options.interval*1e3;e=!0}return i===null&&(i=void 0),[i,e]}};function V(t,e,r,i){let n=i?{timezone:i}:{};return new _("* * * * * *",()=>{let o=new Date;if(!t.some(l=>new _(l,n).nextRun(o)===null))return;e.some(l=>new _(l,n).nextRun(o)===null)||r()})}g();var B=0;function H(){return++B}var W;(typeof __EDGE_RUNTIME__>"u"||!__EDGE_RUNTIME__)&&(W=(await import("module")).createRequire);var Z=M.child({section:"Utils"}),w,C=()=>{if(!w){let t=m();if(W&&typeof import.meta<"u"&&import.meta.url)try{w=W(import.meta.url)}catch{}!w&&typeof globalThis.require=="function"&&(w=globalThis.require),w||(w=e=>{throw new Error(`require("${e}") is not available in this runtime (${t}).`)})}return w},pt={run:()=>Z.info(`Running on ${m()}`)},G=t=>{try{if(typeof Deno<"u"&&Deno.env)return Deno.env.get(t)}catch{}try{if(typeof process<"u"&&process.env)return process.env[t]}catch{}},ct=()=>{try{if(typeof Deno<"u"&&Deno.env)return Deno.env.toObject()}catch{}try{if(typeof process<"u"&&process.env)return{...process.env}}catch{}return{}},yt=t=>{if(typeof Deno<"u"&&Deno.readTextFileSync)return Deno.readTextFileSync(t);let{readFileSync:e}=C()("node:fs");return e(t,"utf8")},gt=t=>{if(typeof Deno<"u"&&Deno.statSync)try{return Deno.statSync(t),!0}catch{return!1}let{existsSync:e}=C()("node:fs");return e(t)},mt=()=>typeof Deno<"u"&&Deno.cwd?Deno.cwd():typeof process<"u"&&process.cwd?process.cwd():"/",wt=()=>{if(m()==="deno")return new URL(".",import.meta.url).pathname;if(typeof import.meta<"u"&&import.meta.url){let e=new URL(import.meta.url);if(e.protocol==="file:"){let{dirname:i}=C()("node:path"),{fileURLToPath:n}=C()("node:url");return i(n(import.meta.url))}let r=e.pathname;return r.substring(0,r.lastIndexOf("/"))}return""},Tt=()=>{let t=m(),e;return t==="deno"?e=Deno.build.os:e=process.platform,e==="win32"||e==="windows"?"windows":"linux"},vt=()=>G("NODE_ENV")?.toLowerCase()==="production"?"production":"development",Dt=()=>m()==="deno"?Deno.env.get("TMPDIR")||Deno.env.get("TEMP")||"/tmp":C()("node:os").tmpdir(),Ct=t=>new Promise(e=>setTimeout(e,t));export{M as a,V as b,H as c,C as d,pt as e,G as f,ct as g,yt as h,gt as i,mt as j,wt as k,Tt as l,vt as m,Dt as n,Ct as o};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{b as i}from"./chunk-V3XZ4XYN.mjs";import{h as o}from"./chunk-VULBPPPP.mjs";o();var s={trace:10,debug:20,info:30,warn:40,error:50,fatal:60,silent:1/0},n=class l{state;context;_level=process.env.LOG_LEVEL||"info";constructor(e={telemetryEnabled:!1},t={}){this.state=e,this.context=t}getTelemetry(){return this.state.telemetryEnabled?i():void 0}validate(e,t){if(typeof e!="string")throw new Error("Logger requires string message first, optional object second");if(t!==void 0&&(typeof t!="object"||t===null||Array.isArray(t)))throw new Error("Logger requires string message first, optional object second")}log(e,t,r){if((s[e]??30)<this.levelVal)return;this.validate(t,r);let g={level:e,time:Date.now(),...this.context,...r,...this.state.telemetryEnabled&&{telemetry:this.getTelemetry()},msg:t};console.log(JSON.stringify(g))}trace(e,t){this.log("trace",e,t)}debug(e,t){this.log("debug",e,t)}info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}fatal(e,t){this.log("fatal",e,t)}child(e){return new l(this.state,{...this.context,...e})}setTelemetry(e){if(e!=="on"&&e!=="off")throw new Error("setTelemetry accepts only 'on' or 'off'");this.state.telemetryEnabled=e==="on"}get level(){return this._level}set level(e){this._level=e}get levelVal(){return s[this._level]??30}bindings(){return{...this.context}}silent(){this._level="silent"}flush(e){e?.()}};function a(){return new n}export{a as default};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as g}from"./chunk-F2KTMAO3.mjs";import"./chunk-27GDSGEE.mjs";import{c as p,d as i}from"./chunk-STPKE4A5.mjs";import"./chunk-V3XZ4XYN.mjs";import{e as s,h as n}from"./chunk-VULBPPPP.mjs";n();var o=s(p(),1),a=s(g(),1);import{Writable as d}from"stream";var f=process.env.LOG_PRETTY==="true"||process.env.NODE_ENV!=="production"&&process.env.LOG_PRETTY!=="false",e=process.env.LOG_LEVEL||"info",m=new d({write(t,v,c){let r=globalThis.__wsLogWrite;r&&r(typeof t=="string"?t:t.toString("utf8")),c()}}),l=o.default.multistream([{level:e,stream:f?(0,a.default)({colorize:!0,translateTime:"SYS:standard",ignore:"pid,hostname"}):process.stdout},{level:e,stream:m}]),u=(0,o.default)({level:e,redact:["password","secret","token","authorization","apiKey"]},l),L=new i(u),S=L;export{S as default};