zaileys 0.28.91-dev → 0.28.93-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +77 -8
- package/dist/Modules/Action.d.ts +14 -0
- package/dist/Modules/Action.js +16 -0
- package/dist/Modules/Client.d.ts +36 -0
- package/dist/Modules/Client.js +274 -0
- package/dist/Modules/Config.d.ts +72 -0
- package/dist/Modules/Config.js +75 -0
- package/dist/Modules/Utils.d.ts +2 -0
- package/dist/Modules/Utils.js +26 -0
- package/dist/Parser/Message.d.ts +18 -0
- package/dist/Parser/Message.js +127 -0
- package/dist/Types/Action.d.ts +9 -0
- package/dist/Types/Action.js +2 -0
- package/dist/Types/General.d.ts +38 -0
- package/dist/Types/General.js +2 -0
- package/dist/Types/Message.d.ts +44 -0
- package/dist/Types/Message.js +2 -0
- package/dist/index.d.ts +3 -183
- package/dist/index.js +6 -102
- package/package.json +52 -41
- package/dist/index.d.mts +0 -183
- package/dist/index.mjs +0 -102
- package/docs.css +0 -10
package/dist/index.d.mts
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import * as baileys from '@whiskeysockets/baileys';
|
|
2
|
-
import NodeCache from 'node-cache';
|
|
3
|
-
import BLog from 'beautify-console-log';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Decode a JID
|
|
7
|
-
* @param jid The JID to decode
|
|
8
|
-
* @returns The decoded JID
|
|
9
|
-
*/
|
|
10
|
-
declare const decodeJid: (jid: string) => string;
|
|
11
|
-
/**
|
|
12
|
-
* Serialize a message
|
|
13
|
-
* @param client The Baileys client
|
|
14
|
-
* @param msg The message to serialize
|
|
15
|
-
* @returns The serialized message
|
|
16
|
-
*/
|
|
17
|
-
declare function Serialize(client: Client['client'], config: Client, msg: any): SerializedMessage | undefined;
|
|
18
|
-
interface SerializedMessage {
|
|
19
|
-
roomId: string;
|
|
20
|
-
roomType: RoomType;
|
|
21
|
-
senderId: string;
|
|
22
|
-
senderName: string;
|
|
23
|
-
isMe: boolean;
|
|
24
|
-
isBot: boolean;
|
|
25
|
-
isMedia: boolean;
|
|
26
|
-
isEphemeral: boolean;
|
|
27
|
-
isAuthor: boolean;
|
|
28
|
-
msgType: string;
|
|
29
|
-
msgBody: string;
|
|
30
|
-
msgMentions: string[];
|
|
31
|
-
msgExpiration: number;
|
|
32
|
-
msgTimestamp: number;
|
|
33
|
-
msgMedia?: {
|
|
34
|
-
url: string;
|
|
35
|
-
mimetype: string;
|
|
36
|
-
size: number;
|
|
37
|
-
height: number;
|
|
38
|
-
width: number;
|
|
39
|
-
isAnimated: boolean;
|
|
40
|
-
isAvatar: boolean;
|
|
41
|
-
isAiSticker: boolean;
|
|
42
|
-
isLottie: boolean;
|
|
43
|
-
};
|
|
44
|
-
msgQuoted?: SerializedMessage;
|
|
45
|
-
payload(): baileys.WAProto.IWebMessageInfo;
|
|
46
|
-
key(): baileys.WAProto.IMessageKey;
|
|
47
|
-
}
|
|
48
|
-
type RoomType = 'group' | 'private' | 'channel';
|
|
49
|
-
|
|
50
|
-
interface ClientProps {
|
|
51
|
-
phoneNumber: number;
|
|
52
|
-
method: 'pairing';
|
|
53
|
-
showLogs?: boolean;
|
|
54
|
-
markOnline?: boolean;
|
|
55
|
-
autoRead?: boolean;
|
|
56
|
-
authors?: number[];
|
|
57
|
-
ignoreMe?: boolean;
|
|
58
|
-
}
|
|
59
|
-
declare class Client {
|
|
60
|
-
private client;
|
|
61
|
-
private listeners;
|
|
62
|
-
private pino;
|
|
63
|
-
private authPath;
|
|
64
|
-
private credsPath;
|
|
65
|
-
private storePath;
|
|
66
|
-
private logger;
|
|
67
|
-
private actions;
|
|
68
|
-
readonly phoneNumber: number;
|
|
69
|
-
readonly method: 'pairing';
|
|
70
|
-
readonly showLogs: boolean;
|
|
71
|
-
readonly markOnline: boolean;
|
|
72
|
-
readonly autoRead: boolean;
|
|
73
|
-
readonly authors: number[];
|
|
74
|
-
readonly ignoreMe: boolean;
|
|
75
|
-
constructor(props: ClientProps);
|
|
76
|
-
initialize(): Promise<void>;
|
|
77
|
-
private pairingCode;
|
|
78
|
-
private handler;
|
|
79
|
-
private emit;
|
|
80
|
-
on(event: string, callback: (data: SerializedMessage) => void): void;
|
|
81
|
-
parseMentions(text: any): any;
|
|
82
|
-
send(data: SerializedMessage, text: any): Promise<SerializedMessage | undefined>;
|
|
83
|
-
reply(data: any, text: any): Promise<SerializedMessage | undefined>;
|
|
84
|
-
edit(data: any, target: any, text: any): Promise<SerializedMessage | undefined>;
|
|
85
|
-
reaction(data: any, emoji: any): Promise<SerializedMessage | undefined>;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
declare class Actions {
|
|
89
|
-
private client;
|
|
90
|
-
constructor(client: Client['client']);
|
|
91
|
-
getGroupName(id: string): any;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
declare class Logger {
|
|
95
|
-
private bannerLogo;
|
|
96
|
-
private copyright;
|
|
97
|
-
private client;
|
|
98
|
-
private actions;
|
|
99
|
-
private spinner;
|
|
100
|
-
constructor(client: Logger['client']);
|
|
101
|
-
banner(): void;
|
|
102
|
-
msgLogs(data: SerializedMessage): Promise<void>;
|
|
103
|
-
runSpinner(text: string): void;
|
|
104
|
-
editSpinner(text: string): void;
|
|
105
|
-
stopSpinner(status: ("succeed" | "fail" | "warn" | "info") | undefined, text: string): void;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
declare const bLog: BLog;
|
|
109
|
-
declare const cLog: {
|
|
110
|
-
(...data: any[]): void;
|
|
111
|
-
(message?: any, ...optionalParams: any[]): void;
|
|
112
|
-
};
|
|
113
|
-
declare const cache: NodeCache;
|
|
114
|
-
declare const logBlock: (status?: "succeed" | "fail" | "warn" | "info") => any;
|
|
115
|
-
declare const sleep: (ms: number) => Promise<unknown>;
|
|
116
|
-
|
|
117
|
-
declare const MESSAGE_TYPE: {
|
|
118
|
-
readonly text: "text";
|
|
119
|
-
readonly conversation: "text";
|
|
120
|
-
readonly imageMessage: "image";
|
|
121
|
-
readonly contactMessage: "contact";
|
|
122
|
-
readonly locationMessage: "location";
|
|
123
|
-
readonly extendedTextMessage: "text";
|
|
124
|
-
readonly documentMessage: "document";
|
|
125
|
-
readonly audioMessage: "audio";
|
|
126
|
-
readonly videoMessage: "video";
|
|
127
|
-
readonly protocolMessage: "protocol";
|
|
128
|
-
readonly contactsArrayMessage: "contactsArray";
|
|
129
|
-
readonly highlyStructuredMessage: "highlyStructured";
|
|
130
|
-
readonly sendPaymentMessage: "sendPayment";
|
|
131
|
-
readonly liveLocationMessage: "liveLocation";
|
|
132
|
-
readonly requestPaymentMessage: "requestPayment";
|
|
133
|
-
readonly declinePaymentRequestMessage: "declinePaymentRequest";
|
|
134
|
-
readonly cancelPaymentRequestMessage: "cancelPaymentRequest";
|
|
135
|
-
readonly templateMessage: "template";
|
|
136
|
-
readonly stickerMessage: "sticker";
|
|
137
|
-
readonly groupInviteMessage: "groupInvite";
|
|
138
|
-
readonly templateButtonReplyMessage: "templateButtonReply";
|
|
139
|
-
readonly productMessage: "product";
|
|
140
|
-
readonly deviceSentMessage: "deviceSent";
|
|
141
|
-
readonly listMessage: "list";
|
|
142
|
-
readonly viewOnceMessage: "viewOnce";
|
|
143
|
-
readonly orderMessage: "order";
|
|
144
|
-
readonly listResponseMessage: "listResponse";
|
|
145
|
-
readonly ephemeralMessage: "ephemeral";
|
|
146
|
-
readonly invoiceMessage: "invoice";
|
|
147
|
-
readonly buttonsMessage: "buttons";
|
|
148
|
-
readonly buttonsResponseMessage: "buttonsResponse";
|
|
149
|
-
readonly paymentInviteMessage: "paymentInvite";
|
|
150
|
-
readonly interactiveMessage: "interactive";
|
|
151
|
-
readonly reactionMessage: "reaction";
|
|
152
|
-
readonly stickerSyncRmrMessage: "sticker";
|
|
153
|
-
readonly interactiveResponseMessage: "interactiveResponse";
|
|
154
|
-
readonly pollCreationMessage: "pollCreation";
|
|
155
|
-
readonly pollUpdateMessage: "pollUpdate";
|
|
156
|
-
readonly keepInChatMessage: "keepInChat";
|
|
157
|
-
readonly documentWithCaptionMessage: "document";
|
|
158
|
-
readonly requestPhoneNumberMessage: "requestPhoneNumber";
|
|
159
|
-
readonly viewOnceMessageV2: "viewOnce";
|
|
160
|
-
readonly encReactionMessage: "reaction";
|
|
161
|
-
readonly editedMessage: "text";
|
|
162
|
-
readonly viewOnceMessageV2Extension: "viewOnce";
|
|
163
|
-
readonly pollCreationMessageV2: "pollCreation";
|
|
164
|
-
readonly scheduledCallCreationMessage: "scheduledCallCreation";
|
|
165
|
-
readonly groupMentionedMessage: "groupMentioned";
|
|
166
|
-
readonly pinInChatMessage: "pinInChat";
|
|
167
|
-
readonly pollCreationMessageV3: "pollCreation";
|
|
168
|
-
readonly scheduledCallEditMessage: "scheduledCallEdit";
|
|
169
|
-
readonly ptvMessage: "ptv";
|
|
170
|
-
readonly botInvokeMessage: "botInvoke";
|
|
171
|
-
readonly callLogMesssage: "callLog";
|
|
172
|
-
readonly encCommentMessage: "encComment";
|
|
173
|
-
readonly bcallMessage: "bcall";
|
|
174
|
-
readonly lottieStickerMessage: "lottieSticker";
|
|
175
|
-
readonly eventMessage: "event";
|
|
176
|
-
readonly commentMessage: "comment";
|
|
177
|
-
readonly newsletterAdminInviteMessage: "text";
|
|
178
|
-
readonly extendedTextMessageWithParentKey: "text";
|
|
179
|
-
readonly placeholderMessage: "placeholder";
|
|
180
|
-
readonly encEventUpdateMessage: "encEventUpdate";
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
export { Actions, Client, Logger, MESSAGE_TYPE, Serialize, type SerializedMessage, bLog, cLog, cache, decodeJid, logBlock, sleep };
|
package/dist/index.mjs
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
var fs=Object.create;var Yt=Object.defineProperty;var hs=Object.getOwnPropertyDescriptor;var ds=Object.getOwnPropertyNames;var ps=Object.getPrototypeOf,gs=Object.prototype.hasOwnProperty;var I=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ys=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ds(t))!gs.call(e,i)&&i!==r&&Yt(e,i,{get:()=>t[i],enumerable:!(n=hs(t,i))||n.enumerable});return e};var be=(e,t,r)=>(r=e!=null?fs(ps(e)):{},ys(t||!e||!e.__esModule?Yt(r,"default",{value:e,enumerable:!0}):r,e));var We=x((Fc,Xt)=>{"use strict";Xt.exports=class extends Error{name="AssertError";constructor(t,r){super(t||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,r)}}});var Ke=x((Wc,Qt)=>{"use strict";Qt.exports=function(...e){try{return JSON.stringify(...e)}catch(t){return"[Cannot display object: "+t.message+"]"}}});var ee=x((Kc,Zt)=>{"use strict";var ms=We(),bs=Ke(),ws=Zt.exports=function(e,...t){if(e)return;if(t.length===1&&t[0]instanceof Error)throw t[0];let r=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:bs(n));throw new ms(r.join(" "),ws)}});var pe=x((Vc,tr)=>{"use strict";var Ve=ee(),er={};tr.exports=function(e,t,r){if(t===!1||t===null||t===void 0)return e;r=r||{},typeof r=="string"&&(r={separator:r});let n=Array.isArray(t);Ve(!n||!r.separator,"Separator option is not valid for array-based chain");let i=n?t:t.split(r.separator||"."),o=e;for(let a=0;a<i.length;++a){let f=i[a],s=r.iterables&&er.iterables(o);if(Array.isArray(o)||s==="set"){let u=Number(f);Number.isInteger(u)&&(f=u<0?o.length+u:u)}if(!o||typeof o=="function"&&r.functions===!1||!s&&o[f]===void 0){Ve(!r.strict||a+1===i.length,"Missing segment",f,"in reach path ",t),Ve(typeof o=="object"||r.functions===!0||typeof o!="function","Invalid segment",f,"in reach path ",t),o=r.default;break}s?s==="set"?o=[...o][f]:o=o.get(f):o=o[f]}return o};er.iterables=function(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map"}});var Ue=x(($,nr)=>{"use strict";var rr={};$=nr.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,url:URL.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};rr.typeMap=new Map([["[object Error]",$.error],["[object Map]",$.map],["[object Promise]",$.promise],["[object Set]",$.set],["[object URL]",$.url],["[object WeakMap]",$.weakMap],["[object WeakSet]",$.weakSet]]);$.getInternalProto=function(e){if(Array.isArray(e))return $.array;if(Buffer&&e instanceof Buffer)return $.buffer;if(e instanceof Date)return $.date;if(e instanceof RegExp)return $.regex;if(e instanceof Error)return $.error;let t=Object.prototype.toString.call(e);return rr.typeMap.get(t)||$.generic}});var we=x(ir=>{"use strict";ir.keys=function(e,t={}){return t.symbols!==!1?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}});var Se=x((Jc,sr)=>{"use strict";var Ss=pe(),D=Ue(),vs=we(),Y={needsProtoHack:new Set([D.set,D.map,D.weakSet,D.weakMap])};sr.exports=Y.clone=function(e,t={},r=null){if(typeof e!="object"||e===null)return e;let n=Y.clone,i=r;if(t.shallow){if(t.shallow!==!0)return Y.cloneWithShallow(e,t);n=s=>s}else if(i){let s=i.get(e);if(s)return s}else i=new Map;let o=D.getInternalProto(e);switch(o){case D.buffer:return Buffer?.from(e);case D.date:return new Date(e.getTime());case D.regex:case D.url:return new o.constructor(e)}let a=Y.base(e,o,t);if(a===e)return e;if(i&&i.set(e,a),o===D.set)for(let s of e)a.add(n(s,t,i));else if(o===D.map)for(let[s,u]of e)a.set(s,n(u,t,i));let f=vs.keys(e,t);for(let s of f){if(s==="__proto__")continue;if(o===D.array&&s==="length"){a.length=e.length;continue}let u=Object.getOwnPropertyDescriptor(e,s);u?u.get||u.set?Object.defineProperty(a,s,u):u.enumerable?a[s]=n(e[s],t,i):Object.defineProperty(a,s,{enumerable:!1,writable:!0,configurable:!0,value:n(e[s],t,i)}):Object.defineProperty(a,s,{enumerable:!0,writable:!0,configurable:!0,value:n(e[s],t,i)})}return a};Y.cloneWithShallow=function(e,t){let r=t.shallow;t=Object.assign({},t),t.shallow=!1;let n=new Map;for(let i of r){let o=Ss(e,i);(typeof o=="object"||typeof o=="function")&&n.set(o,o)}return Y.clone(e,t,n)};Y.base=function(e,t,r){if(r.prototype===!1)return Y.needsProtoHack.has(t)?new t.constructor:t===D.array?[]:{};let n=Object.getPrototypeOf(e);if(n&&n.isImmutable)return e;if(t===D.array){let i=[];return n!==t&&Object.setPrototypeOf(i,n),i}if(Y.needsProtoHack.has(t)){let i=new n.constructor;return n!==t&&Object.setPrototypeOf(i,n),i}return Object.create(n)}});var He=x((Hc,lr)=>{"use strict";var Je=ee(),or=Se(),Os=we(),ar={};lr.exports=ar.merge=function(e,t,r){if(Je(e&&typeof e=="object","Invalid target value: must be an object"),Je(t==null||typeof t=="object","Invalid source value: must be null, undefined, or an object"),!t)return e;if(r=Object.assign({nullOverride:!0,mergeArrays:!0},r),Array.isArray(t)){Je(Array.isArray(e),"Cannot merge array onto an object"),r.mergeArrays||(e.length=0);for(let i=0;i<t.length;++i)e.push(or(t[i],{symbols:r.symbols}));return e}let n=Os.keys(t,r);for(let i=0;i<n.length;++i){let o=n[i];if(o==="__proto__"||!Object.prototype.propertyIsEnumerable.call(t,o))continue;let a=t[o];if(a&&typeof a=="object"){if(e[o]===a)continue;!e[o]||typeof e[o]!="object"||Array.isArray(e[o])!==Array.isArray(a)||a instanceof Date||Buffer&&Buffer.isBuffer(a)||a instanceof RegExp?e[o]=or(a,{symbols:r.symbols}):ar.merge(e[o],a,r)}else(a!=null||r.nullOverride)&&(e[o]=a)}return e}});var dr=x((Gc,hr)=>{"use strict";var ve=ee(),ur=Se(),fr=He(),cr=pe(),Oe={};hr.exports=function(e,t,r={}){if(ve(e&&typeof e=="object","Invalid defaults value: must be an object"),ve(!t||t===!0||typeof t=="object","Invalid source value: must be true, falsy or an object"),ve(typeof r=="object","Invalid options: must be an object"),!t)return null;if(r.shallow)return Oe.applyToDefaultsWithShallow(e,t,r);let n=ur(e);if(t===!0)return n;let i=r.nullOverride!==void 0?r.nullOverride:!1;return fr(n,t,{nullOverride:i,mergeArrays:!1})};Oe.applyToDefaultsWithShallow=function(e,t,r){let n=r.shallow;ve(Array.isArray(n),"Invalid keys");let i=new Map,o=t===!0?null:new Set;for(let s of n){s=Array.isArray(s)?s:s.split(".");let u=cr(e,s);u&&typeof u=="object"?i.set(u,o&&cr(t,s)||u):o&&o.add(s)}let a=ur(e,{},i);if(!o)return a;for(let s of o)Oe.reachCopy(a,t,s);let f=r.nullOverride!==void 0?r.nullOverride:!1;return fr(a,t,{nullOverride:f,mergeArrays:!1})};Oe.reachCopy=function(e,t,r){for(let o of r){if(!(o in t))return;let a=t[o];if(typeof a!="object"||a===null)return;t=a}let n=t,i=e;for(let o=0;o<r.length-1;++o){let a=r[o];typeof i[a]!="object"&&(i[a]={}),i=i[a]}i[r[r.length-1]]=n}});var gr=x((Yc,pr)=>{"use strict";var Ge={};pr.exports=Ge.Bench=class{constructor(){this.ts=0,this.reset()}reset(){this.ts=Ge.Bench.now()}elapsed(){return Ge.Bench.now()-this.ts}static now(){let e=process.hrtime();return e[0]*1e3+e[1]/1e6}}});var Ye=x((Qc,yr)=>{"use strict";yr.exports=function(){}});var br=x((Zc,mr)=>{"use strict";var xs=Ye();mr.exports=function(){return new Promise(xs)}});var Xe=x((eu,wr)=>{"use strict";var J=Ue(),B={mismatched:null};wr.exports=function(e,t,r){return r=Object.assign({prototype:!0},r),!!B.isDeepEqual(e,t,r,[])};B.isDeepEqual=function(e,t,r,n){if(e===t)return e!==0||1/e===1/t;let i=typeof e;if(i!==typeof t||e===null||t===null)return!1;if(i==="function"){if(!r.deepFunction||e.toString()!==t.toString())return!1}else if(i!=="object")return e!==e&&t!==t;let o=B.getSharedType(e,t,!!r.prototype);switch(o){case J.buffer:return Buffer&&Buffer.prototype.equals.call(e,t);case J.promise:return e===t;case J.regex:case J.url:return e.toString()===t.toString();case B.mismatched:return!1}for(let a=n.length-1;a>=0;--a)if(n[a].isSame(e,t))return!0;n.push(new B.SeenEntry(e,t));try{return!!B.isDeepEqualObj(o,e,t,r,n)}finally{n.pop()}};B.getSharedType=function(e,t,r){if(r)return Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?B.mismatched:J.getInternalProto(e);let n=J.getInternalProto(e);return n!==J.getInternalProto(t)?B.mismatched:n};B.valueOf=function(e){let t=e.valueOf;if(t===void 0)return e;try{return t.call(e)}catch(r){return r}};B.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)};B.isSetSimpleEqual=function(e,t){for(let r of Set.prototype.values.call(e))if(!Set.prototype.has.call(t,r))return!1;return!0};B.isDeepEqualObj=function(e,t,r,n,i){let{isDeepEqual:o,valueOf:a,hasOwnEnumerableProperty:f}=B,{keys:s,getOwnPropertySymbols:u}=Object;if(e===J.array)if(n.part){for(let l of t)for(let b of r)if(o(l,b,n,i))return!0}else{if(t.length!==r.length)return!1;for(let l=0;l<t.length;++l)if(!o(t[l],r[l],n,i))return!1;return!0}else if(e===J.set){if(t.size!==r.size)return!1;if(!B.isSetSimpleEqual(t,r)){let l=new Set(Set.prototype.values.call(r));for(let b of Set.prototype.values.call(t)){if(l.delete(b))continue;let w=!1;for(let S of l)if(o(b,S,n,i)){l.delete(S),w=!0;break}if(!w)return!1}}}else if(e===J.map){if(t.size!==r.size)return!1;for(let[l,b]of Map.prototype.entries.call(t))if(b===void 0&&!Map.prototype.has.call(r,l)||!o(b,Map.prototype.get.call(r,l),n,i))return!1}else if(e===J.error&&(t.name!==r.name||t.message!==r.message))return!1;let c=a(t),h=a(r);if((t!==c||r!==h)&&!o(c,h,n,i))return!1;let p=s(t);if(!n.part&&p.length!==s(r).length&&!n.skip)return!1;let d=0;for(let l of p){if(n.skip&&n.skip.includes(l)){r[l]===void 0&&++d;continue}if(!f(r,l)||!o(t[l],r[l],n,i))return!1}if(!n.part&&p.length-d!==s(r).length)return!1;if(n.symbols!==!1){let l=u(t),b=new Set(u(r));for(let w of l){if(!n.skip?.includes(w)){if(f(t,w)){if(!f(r,w)||!o(t[w],r[w],n,i))return!1}else if(f(r,w))return!1}b.delete(w)}for(let w of b)if(f(r,w))return!1}return!0};B.SeenEntry=class{constructor(e,t){this.obj=e,this.ref=t}isSame(e,t){return this.obj===e&&this.ref===t}}});var Qe=x((ru,Sr)=>{"use strict";Sr.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var Or=x((nu,vr)=>{"use strict";var xe=ee(),Es=Xe(),_s=Qe(),ks=we(),W={};vr.exports=function(e,t,r={}){return typeof t!="object"&&(t=[t]),xe(!Array.isArray(t)||t.length,"Values array cannot be empty"),typeof e=="string"?W.string(e,t,r):Array.isArray(e)?W.array(e,t,r):(xe(typeof e=="object","Reference must be string or an object"),W.object(e,t,r))};W.array=function(e,t,r){if(Array.isArray(t)||(t=[t]),!e.length||r.only&&r.once&&e.length!==t.length)return!1;let n,i=new Map;for(let a of t)if(!r.deep||!a||typeof a!="object"){let f=i.get(a);f?++f.allowed:i.set(a,{allowed:1,hits:0})}else{n=n??W.compare(r);let f=!1;for(let[s,u]of i.entries())if(n(s,a)){++u.allowed,f=!0;break}f||i.set(a,{allowed:1,hits:0})}let o=0;for(let a of e){let f;if(!r.deep||!a||typeof a!="object")f=i.get(a);else{n=n??W.compare(r);for(let[s,u]of i.entries())if(n(s,a)){f=u;break}}if(f&&(++f.hits,++o,r.once&&f.hits>f.allowed))return!1}if(r.only&&o!==e.length)return!1;for(let a of i.values())if(a.hits!==a.allowed&&a.hits<a.allowed&&!r.part)return!1;return!!o};W.object=function(e,t,r){xe(r.once===void 0,"Cannot use option once with object");let n=ks.keys(e,r);if(!n.length)return!1;if(Array.isArray(t))return W.array(n,t,r);let i=Object.getOwnPropertySymbols(t).filter(s=>t.propertyIsEnumerable(s)),o=[...Object.keys(t),...i],a=W.compare(r),f=new Set(o);for(let s of n){if(!f.has(s)){if(r.only)return!1;continue}if(!a(t[s],e[s]))return!1;f.delete(s)}return f.size?r.part?f.size<o.length:!1:!0};W.string=function(e,t,r){if(e==="")return t.length===1&&t[0]===""||!r.once&&!t.some(s=>s!=="");let n=new Map,i=[];for(let s of t)if(xe(typeof s=="string","Cannot compare string reference to non-string value"),s){let u=n.get(s);u?++u.allowed:(n.set(s,{allowed:1,hits:0}),i.push(_s(s)))}else if(r.once||r.only)return!1;if(!i.length)return!0;let o=new RegExp(`(${i.join("|")})`,"g"),a=e.replace(o,(s,u)=>(++n.get(u).hits,""));if(r.only&&a)return!1;let f=!1;for(let s of n.values())if(s.hits&&(f=!0),s.hits!==s.allowed&&(s.hits<s.allowed&&!r.part||r.once))return!1;return!!f};W.compare=function(e){if(!e.deep)return W.shallow;let t=e.only!==void 0,r=e.part!==void 0,n={prototype:t?e.only:r?!e.part:!1,part:t?!e.only:r?e.part:!1};return(i,o)=>Es(i,o,n)};W.shallow=function(e,t){return e===t}});var Er=x((iu,xr)=>{"use strict";var Ts=ee();xr.exports=function(e){return Ts(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(e),"Bad attribute value ("+e+")"),e.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}});var kr=x((su,_r)=>{"use strict";var Q={};_r.exports=function(e){if(!e)return"";let t="";for(let r=0;r<e.length;++r){let n=e.charCodeAt(r);Q.isSafe(n)?t+=e[r]:t+=Q.escapeHtmlChar(n)}return t};Q.escapeHtmlChar=function(e){let t=Q.namedHtml.get(e);return t||(e>=256?"&#"+e+";":`&#x${e.toString(16).padStart(2,"0")};`)};Q.isSafe=function(e){return Q.safeCharCodes.has(e)};Q.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]);Q.safeCharCodes=function(){let e=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||t===32||t===46||t===44||t===45||t===58||t===95)&&e.add(t);return e}()});var Mr=x((ou,Tr)=>{"use strict";var Ee={};Tr.exports=function(e){return e?e.replace(/[<>&\u2028\u2029]/g,Ee.escape):""};Ee.escape=function(e){return Ee.replacements.get(e)};Ee.replacements=new Map([["<","\\u003c"],[">","\\u003e"],["&","\\u0026"],["\u2028","\\u2028"],["\u2029","\\u2029"]])});var jr=x((au,Rr)=>{"use strict";var Ar={};Rr.exports=Ar.flatten=function(e,t){let r=t||[];for(let n of e)Array.isArray(n)?Ar.flatten(n,r):r.push(n);return r}});var Ir=x((lu,qr)=>{"use strict";var Lr={};qr.exports=function(e,t,r={}){if(!e||!t)return r.first?null:[];let n=[],i=Array.isArray(e)?new Set(e):e,o=new Set;for(let a of t)if(Lr.has(i,a)&&!o.has(a)){if(r.first)return a;n.push(a),o.add(a)}return r.first?null:n};Lr.has=function(e,t){return typeof e.has=="function"?e.has(t):e[t]!==void 0}});var Cr=x((cu,Pr)=>{"use strict";Pr.exports=function(e){return typeof e?.then=="function"}});var Dr=x((uu,Br)=>{"use strict";var $r={wrapped:Symbol("wrapped")};Br.exports=function(e){if(e[$r.wrapped])return e;let t=!1,r=function(...n){t||(t=!0,e(...n))};return r[$r.wrapped]=!0,r}});var Nr=x((fu,zr)=>{"use strict";var Ms=pe();zr.exports=function(e,t,r){return t.replace(/{([^{}]+)}/g,(n,i)=>Ms(e,i,r)??"")}});var Wr=x((hu,Fr)=>{"use strict";var As={maxTimer:2147483647};Fr.exports=function(e,t,r){if(typeof e=="bigint"&&(e=Number(e)),e>=Number.MAX_SAFE_INTEGER&&(e=1/0),typeof e!="number"&&e!==void 0)throw new TypeError("Timeout must be a number or bigint");return new Promise(n=>{let i=r?r.setTimeout:setTimeout,o=()=>{let a=Math.min(e,As.maxTimer);e-=a,i(()=>e>0?o():n(t),a)};e!==1/0&&o()})}});var Kr=x(j=>{"use strict";j.applyToDefaults=dr();j.assert=ee();j.AssertError=We();j.Bench=gr();j.block=br();j.clone=Se();j.contain=Or();j.deepEqual=Xe();j.escapeHeaderAttribute=Er();j.escapeHtml=kr();j.escapeJson=Mr();j.escapeRegex=Qe();j.flatten=jr();j.ignore=Ye();j.intersect=Ir();j.isPromise=Cr();j.merge=He();j.once=Dr();j.reach=pe();j.reachTemplate=Nr();j.stringify=Ke();j.wait=Wr()});var Vr=x(y=>{"use strict";var te=Kr(),z={codes:new Map([[100,"Continue"],[101,"Switching Protocols"],[102,"Processing"],[200,"OK"],[201,"Created"],[202,"Accepted"],[203,"Non-Authoritative Information"],[204,"No Content"],[205,"Reset Content"],[206,"Partial Content"],[207,"Multi-Status"],[300,"Multiple Choices"],[301,"Moved Permanently"],[302,"Moved Temporarily"],[303,"See Other"],[304,"Not Modified"],[305,"Use Proxy"],[307,"Temporary Redirect"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Time-out"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Request Entity Too Large"],[414,"Request-URI Too Large"],[415,"Unsupported Media Type"],[416,"Requested Range Not Satisfiable"],[417,"Expectation Failed"],[418,"I'm a teapot"],[422,"Unprocessable Entity"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Time-out"],[505,"HTTP Version Not Supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[509,"Bandwidth Limit Exceeded"],[510,"Not Extended"],[511,"Network Authentication Required"]])};y.Boom=class extends Error{constructor(e,t={}){if(e instanceof Error)return y.boomify(te.clone(e),t);let{statusCode:r=500,data:n=null,ctor:i=y.Boom}=t,o=new Error(e||void 0);Error.captureStackTrace(o,i),o.data=n;let a=z.initialize(o,r);return Object.defineProperty(a,"typeof",{value:i}),t.decorate&&Object.assign(a,t.decorate),a}static[Symbol.hasInstance](e){return this===y.Boom?y.isBoom(e):this.prototype.isPrototypeOf(e)}};y.isBoom=function(e,t){return e instanceof Error&&!!e.isBoom&&(!t||e.output.statusCode===t)};y.boomify=function(e,t){return te.assert(e instanceof Error,"Cannot wrap non-Error object"),t=t||{},t.data!==void 0&&(e.data=t.data),t.decorate&&Object.assign(e,t.decorate),e.isBoom?t.override===!1||!t.statusCode&&!t.message?e:z.initialize(e,t.statusCode??e.output.statusCode,t.message):z.initialize(e,t.statusCode??500,t.message)};y.badRequest=function(e,t){return new y.Boom(e,{statusCode:400,data:t,ctor:y.badRequest})};y.unauthorized=function(e,t,r){let n=new y.Boom(e,{statusCode:401,ctor:y.unauthorized});if(!t)return n;if(typeof t!="string")return n.output.headers["WWW-Authenticate"]=t.join(", "),n;let i=`${t}`;return(r||e)&&(n.output.payload.attributes={}),r&&(typeof r=="string"?(i+=" "+te.escapeHeaderAttribute(r),n.output.payload.attributes=r):i+=" "+Object.keys(r).map(o=>{let a=r[o]??"";return n.output.payload.attributes[o]=a,`${o}="${te.escapeHeaderAttribute(a.toString())}"`}).join(", ")),e?(r&&(i+=","),i+=` error="${te.escapeHeaderAttribute(e)}"`,n.output.payload.attributes.error=e):n.isMissing=!0,n.output.headers["WWW-Authenticate"]=i,n};y.paymentRequired=function(e,t){return new y.Boom(e,{statusCode:402,data:t,ctor:y.paymentRequired})};y.forbidden=function(e,t){return new y.Boom(e,{statusCode:403,data:t,ctor:y.forbidden})};y.notFound=function(e,t){return new y.Boom(e,{statusCode:404,data:t,ctor:y.notFound})};y.methodNotAllowed=function(e,t,r){let n=new y.Boom(e,{statusCode:405,data:t,ctor:y.methodNotAllowed});return typeof r=="string"&&(r=[r]),Array.isArray(r)&&(n.output.headers.Allow=r.join(", ")),n};y.notAcceptable=function(e,t){return new y.Boom(e,{statusCode:406,data:t,ctor:y.notAcceptable})};y.proxyAuthRequired=function(e,t){return new y.Boom(e,{statusCode:407,data:t,ctor:y.proxyAuthRequired})};y.clientTimeout=function(e,t){return new y.Boom(e,{statusCode:408,data:t,ctor:y.clientTimeout})};y.conflict=function(e,t){return new y.Boom(e,{statusCode:409,data:t,ctor:y.conflict})};y.resourceGone=function(e,t){return new y.Boom(e,{statusCode:410,data:t,ctor:y.resourceGone})};y.lengthRequired=function(e,t){return new y.Boom(e,{statusCode:411,data:t,ctor:y.lengthRequired})};y.preconditionFailed=function(e,t){return new y.Boom(e,{statusCode:412,data:t,ctor:y.preconditionFailed})};y.entityTooLarge=function(e,t){return new y.Boom(e,{statusCode:413,data:t,ctor:y.entityTooLarge})};y.uriTooLong=function(e,t){return new y.Boom(e,{statusCode:414,data:t,ctor:y.uriTooLong})};y.unsupportedMediaType=function(e,t){return new y.Boom(e,{statusCode:415,data:t,ctor:y.unsupportedMediaType})};y.rangeNotSatisfiable=function(e,t){return new y.Boom(e,{statusCode:416,data:t,ctor:y.rangeNotSatisfiable})};y.expectationFailed=function(e,t){return new y.Boom(e,{statusCode:417,data:t,ctor:y.expectationFailed})};y.teapot=function(e,t){return new y.Boom(e,{statusCode:418,data:t,ctor:y.teapot})};y.badData=function(e,t){return new y.Boom(e,{statusCode:422,data:t,ctor:y.badData})};y.locked=function(e,t){return new y.Boom(e,{statusCode:423,data:t,ctor:y.locked})};y.failedDependency=function(e,t){return new y.Boom(e,{statusCode:424,data:t,ctor:y.failedDependency})};y.tooEarly=function(e,t){return new y.Boom(e,{statusCode:425,data:t,ctor:y.tooEarly})};y.preconditionRequired=function(e,t){return new y.Boom(e,{statusCode:428,data:t,ctor:y.preconditionRequired})};y.tooManyRequests=function(e,t){return new y.Boom(e,{statusCode:429,data:t,ctor:y.tooManyRequests})};y.illegal=function(e,t){return new y.Boom(e,{statusCode:451,data:t,ctor:y.illegal})};y.internal=function(e,t,r=500){return z.serverError(e,t,r,y.internal)};y.notImplemented=function(e,t){return z.serverError(e,t,501,y.notImplemented)};y.badGateway=function(e,t){return z.serverError(e,t,502,y.badGateway)};y.serverUnavailable=function(e,t){return z.serverError(e,t,503,y.serverUnavailable)};y.gatewayTimeout=function(e,t){return z.serverError(e,t,504,y.gatewayTimeout)};y.badImplementation=function(e,t){let r=z.serverError(e,t,500,y.badImplementation);return r.isDeveloperError=!0,r};z.initialize=function(e,t,r){let n=parseInt(t,10);if(te.assert(!isNaN(n)&&n>=400,"First argument must be a number (400+):",t),e.isBoom=!0,e.isServer=n>=500,e.hasOwnProperty("data")||(e.data=null),e.output={statusCode:n,payload:{},headers:{}},Object.defineProperty(e,"reformat",{value:z.reformat,configurable:!0}),!r&&!e.message&&(e.reformat(),r=e.output.payload.error),r){let i=Object.getOwnPropertyDescriptor(e,"message")||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"message");te.assert(!i||i.configurable&&!i.get,"The error is not compatible with boom"),e.message=r+(e.message?": "+e.message:""),e.output.payload.message=e.message}return e.reformat(),e};z.reformat=function(e=!1){this.output.payload.statusCode=this.output.statusCode,this.output.payload.error=z.codes.get(this.output.statusCode)||"Unknown",this.output.statusCode===500&&e!==!0?this.output.payload.message="An internal server error occurred":this.message&&(this.output.payload.message=this.message)};z.serverError=function(e,t,r,n){return t instanceof Error&&!t.isBoom?y.boomify(t,{statusCode:r,message:e}):new y.Boom(e,{statusCode:r,data:t,ctor:n})}});var Ur=x((yu,_e)=>{"use strict";var Rs=function(){"use strict";function e(c,h){return h!=null&&c instanceof h}var t;try{t=Map}catch{t=function(){}}var r;try{r=Set}catch{r=function(){}}var n;try{n=Promise}catch{n=function(){}}function i(c,h,p,d,l){typeof h=="object"&&(p=h.depth,d=h.prototype,l=h.includeNonEnumerable,h=h.circular);var b=[],w=[],S=typeof Buffer<"u";typeof h>"u"&&(h=!0),typeof p>"u"&&(p=1/0);function v(m,E){if(m===null)return null;if(E===0)return m;var O,k;if(typeof m!="object")return m;if(e(m,t))O=new t;else if(e(m,r))O=new r;else if(e(m,n))O=new n(function(U,he){m.then(function(de){U(v(de,E-1))},function(de){he(v(de,E-1))})});else if(i.__isArray(m))O=[];else if(i.__isRegExp(m))O=new RegExp(m.source,u(m)),m.lastIndex&&(O.lastIndex=m.lastIndex);else if(i.__isDate(m))O=new Date(m.getTime());else{if(S&&Buffer.isBuffer(m))return Buffer.allocUnsafe?O=Buffer.allocUnsafe(m.length):O=new Buffer(m.length),m.copy(O),O;e(m,Error)?O=Object.create(m):typeof d>"u"?(k=Object.getPrototypeOf(m),O=Object.create(k)):(O=Object.create(d),k=d)}if(h){var M=b.indexOf(m);if(M!=-1)return w[M];b.push(m),w.push(O)}e(m,t)&&m.forEach(function(U,he){var de=v(he,E-1),us=v(U,E-1);O.set(de,us)}),e(m,r)&&m.forEach(function(U){var he=v(U,E-1);O.add(he)});for(var T in m){var _;k&&(_=Object.getOwnPropertyDescriptor(k,T)),!(_&&_.set==null)&&(O[T]=v(m[T],E-1))}if(Object.getOwnPropertySymbols)for(var R=Object.getOwnPropertySymbols(m),T=0;T<R.length;T++){var q=R[T],A=Object.getOwnPropertyDescriptor(m,q);A&&!A.enumerable&&!l||(O[q]=v(m[q],E-1),A.enumerable||Object.defineProperty(O,q,{enumerable:!1}))}if(l)for(var C=Object.getOwnPropertyNames(m),T=0;T<C.length;T++){var P=C[T],A=Object.getOwnPropertyDescriptor(m,P);A&&A.enumerable||(O[P]=v(m[P],E-1),Object.defineProperty(O,P,{enumerable:!1}))}return O}return v(c,p)}i.clonePrototype=function(h){if(h===null)return null;var p=function(){};return p.prototype=h,new p};function o(c){return Object.prototype.toString.call(c)}i.__objToStr=o;function a(c){return typeof c=="object"&&o(c)==="[object Date]"}i.__isDate=a;function f(c){return typeof c=="object"&&o(c)==="[object Array]"}i.__isArray=f;function s(c){return typeof c=="object"&&o(c)==="[object RegExp]"}i.__isRegExp=s;function u(c){var h="";return c.global&&(h+="g"),c.ignoreCase&&(h+="i"),c.multiline&&(h+="m"),h}return i.__getRegExpFlags=u,i}();typeof _e=="object"&&_e.exports&&(_e.exports=Rs)});var Gr=x((Jr,Hr)=>{"use strict";(function(){var e,t,r,n=[].splice,i=function(a,f){if(!(a instanceof f))throw new Error("Bound instance method accessed before binding")},o=[].indexOf;r=Ur(),e=I("events").EventEmitter,Hr.exports=t=function(){class a extends e{constructor(s={}){super(),this.get=this.get.bind(this),this.mget=this.mget.bind(this),this.set=this.set.bind(this),this.mset=this.mset.bind(this),this.del=this.del.bind(this),this.take=this.take.bind(this),this.ttl=this.ttl.bind(this),this.getTtl=this.getTtl.bind(this),this.keys=this.keys.bind(this),this.has=this.has.bind(this),this.getStats=this.getStats.bind(this),this.flushAll=this.flushAll.bind(this),this.flushStats=this.flushStats.bind(this),this.close=this.close.bind(this),this._checkData=this._checkData.bind(this),this._check=this._check.bind(this),this._isInvalidKey=this._isInvalidKey.bind(this),this._wrap=this._wrap.bind(this),this._getValLength=this._getValLength.bind(this),this._error=this._error.bind(this),this._initErrors=this._initErrors.bind(this),this.options=s,this._initErrors(),this.data={},this.options=Object.assign({forceString:!1,objectValueSize:80,promiseValueSize:80,arrayValueSize:40,stdTTL:0,checkperiod:600,useClones:!0,deleteOnExpire:!0,enableLegacyCallbacks:!1,maxKeys:-1},this.options),this.options.enableLegacyCallbacks&&(console.warn("WARNING! node-cache legacy callback support will drop in v6.x"),["get","mget","set","del","ttl","getTtl","keys","has"].forEach(u=>{var c;c=this[u],this[u]=function(...h){var p,d,l,b;if(l=h,[...h]=l,[p]=n.call(h,-1),typeof p=="function")try{b=c(...h),p(null,b)}catch(w){d=w,p(d)}else return c(...h,p)}})),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.validKeyTypes=["string","number"],this._checkData()}get(s){var u,c;if(i(this,a),(c=this._isInvalidKey(s))!=null)throw c;if(this.data[s]!=null&&this._check(s,this.data[s]))return this.stats.hits++,u=this._unwrap(this.data[s]),u;this.stats.misses++}mget(s){var u,c,h,p,d,l;if(i(this,a),!Array.isArray(s))throw u=this._error("EKEYSTYPE"),u;for(l={},h=0,d=s.length;h<d;h++){if(p=s[h],(c=this._isInvalidKey(p))!=null)throw c;this.data[p]!=null&&this._check(p,this.data[p])?(this.stats.hits++,l[p]=this._unwrap(this.data[p])):this.stats.misses++}return l}set(s,u,c){var h,p,d;if(i(this,a),this.options.maxKeys>-1&&this.stats.keys>=this.options.maxKeys)throw h=this._error("ECACHEFULL"),h;if(this.options.forceString&&!1==="string"&&(u=JSON.stringify(u)),c==null&&(c=this.options.stdTTL),(p=this._isInvalidKey(s))!=null)throw p;return d=!1,this.data[s]&&(d=!0,this.stats.vsize-=this._getValLength(this._unwrap(this.data[s],!1))),this.data[s]=this._wrap(u,c),this.stats.vsize+=this._getValLength(u),d||(this.stats.ksize+=this._getKeyLength(s),this.stats.keys++),this.emit("set",s,u),!0}mset(s){var u,c,h,p,d,l,b,w,S,v;if(i(this,a),this.options.maxKeys>-1&&this.stats.keys+s.length>=this.options.maxKeys)throw u=this._error("ECACHEFULL"),u;for(h=0,b=s.length;h<b;h++){if(l=s[h],{key:d,val:v,ttl:S}=l,S&&typeof S!="number")throw u=this._error("ETTLTYPE"),u;if((c=this._isInvalidKey(d))!=null)throw c}for(p=0,w=s.length;p<w;p++)l=s[p],{key:d,val:v,ttl:S}=l,this.set(d,v,S);return!0}del(s){var u,c,h,p,d,l;for(i(this,a),Array.isArray(s)||(s=[s]),u=0,h=0,d=s.length;h<d;h++){if(p=s[h],(c=this._isInvalidKey(p))!=null)throw c;this.data[p]!=null&&(this.stats.vsize-=this._getValLength(this._unwrap(this.data[p],!1)),this.stats.ksize-=this._getKeyLength(p),this.stats.keys--,u++,l=this.data[p],delete this.data[p],this.emit("del",p,l.v))}return u}take(s){var u;return i(this,a),u=this.get(s),u!=null&&this.del(s),u}ttl(s,u){var c;if(i(this,a),u||(u=this.options.stdTTL),!s)return!1;if((c=this._isInvalidKey(s))!=null)throw c;return this.data[s]!=null&&this._check(s,this.data[s])?(u>=0?this.data[s]=this._wrap(this.data[s].v,u,!1):this.del(s),!0):!1}getTtl(s){var u,c;if(i(this,a),!!s){if((c=this._isInvalidKey(s))!=null)throw c;if(this.data[s]!=null&&this._check(s,this.data[s]))return u=this.data[s].t,u}}keys(){var s;return i(this,a),s=Object.keys(this.data),s}has(s){var u;return i(this,a),u=this.data[s]!=null&&this._check(s,this.data[s]),u}getStats(){return i(this,a),this.stats}flushAll(s=!0){i(this,a),this.data={},this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this._killCheckPeriod(),this._checkData(s),this.emit("flush")}flushStats(){i(this,a),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.emit("flush_stats")}close(){i(this,a),this._killCheckPeriod()}_checkData(s=!0){var u,c,h;i(this,a),c=this.data;for(u in c)h=c[u],this._check(u,h);s&&this.options.checkperiod>0&&(this.checkTimeout=setTimeout(this._checkData,this.options.checkperiod*1e3,s),this.checkTimeout!=null&&this.checkTimeout.unref!=null&&this.checkTimeout.unref())}_killCheckPeriod(){if(this.checkTimeout!=null)return clearTimeout(this.checkTimeout)}_check(s,u){var c;return i(this,a),c=!0,u.t!==0&&u.t<Date.now()&&(this.options.deleteOnExpire&&(c=!1,this.del(s)),this.emit("expired",s,this._unwrap(u))),c}_isInvalidKey(s){var u;if(i(this,a),u=typeof s,o.call(this.validKeyTypes,u)<0)return this._error("EKEYTYPE",{type:typeof s})}_wrap(s,u,c=!0){var h,p,d,l;return i(this,a),this.options.useClones||(c=!1),p=Date.now(),h=0,l=1e3,u===0?h=0:u?h=p+u*l:this.options.stdTTL===0?h=this.options.stdTTL:h=p+this.options.stdTTL*l,d={t:h,v:c?r(s):s}}_unwrap(s,u=!0){return this.options.useClones||(u=!1),s.v!=null?u?r(s.v):s.v:null}_getKeyLength(s){return s.toString().length}_getValLength(s){return i(this,a),typeof s=="string"?s.length:this.options.forceString?JSON.stringify(s).length:Array.isArray(s)?this.options.arrayValueSize*s.length:typeof s=="number"?8:typeof s?.then=="function"?this.options.promiseValueSize:typeof Buffer<"u"&&Buffer!==null&&Buffer.isBuffer(s)?s.length:s!=null&&typeof s=="object"?this.options.objectValueSize*Object.keys(s).length:typeof s=="boolean"?8:0}_error(s,u={}){var c;return i(this,a),c=new Error,c.name=s,c.errorcode=s,c.message=this.ERRORS[s]!=null?this.ERRORS[s](u):"-",c.data=u,c}_initErrors(){var s,u,c;i(this,a),this.ERRORS={},c=this._ERRORS;for(u in c)s=c[u],this.ERRORS[u]=this.createErrorMessage(s)}createErrorMessage(s){return function(u){return s.replace("__key",u.type)}}}return a.prototype._ERRORS={ENOTFOUND:"Key `__key` not found",ECACHEFULL:"Cache max keys amount exceeded",EKEYTYPE:"The key argument has to be of type `string` or `number`. Found: `__key`",EKEYSTYPE:"The keys argument has to be an array.",ETTLTYPE:"The ttl argument has to be a number."},a}.call(this)}).call(Jr)});var Ze=x((Yr,Xr)=>{"use strict";(function(){var e;e=Xr.exports=Gr(),e.version="5.1.2"}).call(Yr)});var tn=x((mu,en)=>{"use strict";en.exports=Zr;var{toString:js}=Object.prototype,et=Symbol("circular-ref-tag"),tt=Symbol("pino-raw-err-ref"),Qr=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},raw:{enumerable:!1,get:function(){return this[tt]},set:function(e){this[tt]=e}}});Object.defineProperty(Qr,tt,{writable:!0,value:{}});function Zr(e){if(!(e instanceof Error))return e;e[et]=void 0;let t=Object.create(Qr);t.type=js.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack;for(let r in e)if(t[r]===void 0){let n=e[r];n instanceof Error?n.hasOwnProperty(et)||(t[r]=Zr(n)):t[r]=n}return delete e[et],t.raw=e,t}});var on=x((bu,sn)=>{"use strict";sn.exports={mapHttpRequest:Ls,reqSerializer:nn};var rt=Symbol("pino-raw-req-ref"),rn=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[rt]},set:function(e){this[rt]=e}}});Object.defineProperty(rn,rt,{writable:!0,value:{}});function nn(e){let t=e.info||e.socket,r=Object.create(rn);return r.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),r.method=e.method,e.originalUrl?(r.url=e.originalUrl,r.query=e.query,r.params=e.params):r.url=e.path||(e.url?e.url.path||e.url:void 0),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function Ls(e){return{req:nn(e)}}});var un=x((wu,cn)=>{"use strict";cn.exports={mapHttpResponse:qs,resSerializer:ln};var nt=Symbol("pino-raw-res-ref"),an=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[nt]},set:function(e){this[nt]=e}}});Object.defineProperty(an,nt,{writable:!0,value:{}});function ln(e){let t=Object.create(an);return t.statusCode=e.statusCode,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function qs(e){return{res:ln(e)}}});var st=x((Su,fn)=>{"use strict";var it=tn(),ke=on(),Te=un();fn.exports={err:it,mapHttpRequest:ke.mapHttpRequest,mapHttpResponse:Te.mapHttpResponse,req:ke.reqSerializer,res:Te.resSerializer,wrapErrorSerializer:function(t){return t===it?t:function(n){return t(it(n))}},wrapRequestSerializer:function(t){return t===ke.reqSerializer?t:function(n){return t(ke.reqSerializer(n))}},wrapResponseSerializer:function(t){return t===Te.resSerializer?t:function(n){return t(Te.resSerializer(n))}}}});var ot=x((vu,hn)=>{"use strict";function Is(e,t){return t}hn.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=Is;let r=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(r))return;let n=r.slice(2),i=[];for(let o of n)o&&i.push(o.getFileName());return i}});var pn=x((Ou,dn)=>{"use strict";dn.exports=Ps;function Ps(e={}){let{ERR_PATHS_MUST_BE_STRINGS:t=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=n=>`fast-redact \u2013 Invalid path (${n})`}=e;return function({paths:i}){i.forEach(o=>{if(typeof o!="string")throw Error(t());try{if(/〇/.test(o))throw Error();let a=(o[0]==="["?"":".")+o.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(a)||/\/\*/.test(a))throw Error();Function(`
|
|
2
|
-
'use strict'
|
|
3
|
-
const o = new Proxy({}, { get: () => o, set: () => { throw Error() } });
|
|
4
|
-
const \u3007 = null;
|
|
5
|
-
o${a}
|
|
6
|
-
if ([o${a}].length !== 1) throw Error()`)()}catch{throw Error(r(o))}})}}});var Me=x((xu,gn)=>{"use strict";gn.exports=/[^.[\]]+|\[((?:.)*?)\]/g});var mn=x((Eu,yn)=>{"use strict";var Cs=Me();yn.exports=$s;function $s({paths:e}){let t=[];var r=0;let n=e.reduce(function(i,o,a){var f=o.match(Cs).map(c=>c.replace(/'|"|`/g,""));let s=o[0]==="[";f=f.map(c=>c[0]==="["?c.substr(1,c.length-2):c);let u=f.indexOf("*");if(u>-1){let c=f.slice(0,u),h=c.join("."),p=f.slice(u+1,f.length),d=p.length>0;r++,t.push({before:c,beforeStr:h,after:p,nested:d})}else i[o]={path:f,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(o),leadingBracket:s};return i},{});return{wildcards:t,wcLen:r,secret:n}}});var wn=x((_u,bn)=>{"use strict";var Bs=Me();bn.exports=Ds;function Ds({secret:e,serialize:t,wcLen:r,strict:n,isCensorFct:i,censorFctTakesPath:o},a){let f=Function("o",`
|
|
7
|
-
if (typeof o !== 'object' || o == null) {
|
|
8
|
-
${Ws(n,t)}
|
|
9
|
-
}
|
|
10
|
-
const { censor, secret } = this
|
|
11
|
-
const originalSecret = {}
|
|
12
|
-
const secretKeys = Object.keys(secret)
|
|
13
|
-
for (var i = 0; i < secretKeys.length; i++) {
|
|
14
|
-
originalSecret[secretKeys[i]] = secret[secretKeys[i]]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
${zs(e,i,o)}
|
|
18
|
-
this.compileRestore()
|
|
19
|
-
${Ns(r>0,i,o)}
|
|
20
|
-
this.secret = originalSecret
|
|
21
|
-
${Fs(t)}
|
|
22
|
-
`).bind(a);return f.state=a,t===!1&&(f.restore=s=>a.restore(s)),f}function zs(e,t,r){return Object.keys(e).map(n=>{let{escPath:i,leadingBracket:o,path:a}=e[n],f=o?1:0,s=o?"":".",u=[];for(var c;(c=Bs.exec(n))!==null;){let[,l]=c,{index:b,input:w}=c;b>f&&u.push(w.substring(0,b-(l?0:1)))}var h=u.map(l=>`o${s}${l}`).join(" && ");h.length===0?h+=`o${s}${n} != null`:h+=` && o${s}${n} != null`;let p=`
|
|
23
|
-
switch (true) {
|
|
24
|
-
${u.reverse().map(l=>`
|
|
25
|
-
case o${s}${l} === censor:
|
|
26
|
-
secret[${i}].circle = ${JSON.stringify(l)}
|
|
27
|
-
break
|
|
28
|
-
`).join(`
|
|
29
|
-
`)}
|
|
30
|
-
}
|
|
31
|
-
`,d=r?`val, ${JSON.stringify(a)}`:"val";return`
|
|
32
|
-
if (${h}) {
|
|
33
|
-
const val = o${s}${n}
|
|
34
|
-
if (val === censor) {
|
|
35
|
-
secret[${i}].precensored = true
|
|
36
|
-
} else {
|
|
37
|
-
secret[${i}].val = val
|
|
38
|
-
o${s}${n} = ${t?`censor(${d})`:"censor"}
|
|
39
|
-
${p}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
`}).join(`
|
|
43
|
-
`)}function Ns(e,t,r){return e===!0?`
|
|
44
|
-
{
|
|
45
|
-
const { wildcards, wcLen, groupRedact, nestedRedact } = this
|
|
46
|
-
for (var i = 0; i < wcLen; i++) {
|
|
47
|
-
const { before, beforeStr, after, nested } = wildcards[i]
|
|
48
|
-
if (nested === true) {
|
|
49
|
-
secret[beforeStr] = secret[beforeStr] || []
|
|
50
|
-
nestedRedact(secret[beforeStr], o, before, after, censor, ${t}, ${r})
|
|
51
|
-
} else secret[beforeStr] = groupRedact(o, before, censor, ${t}, ${r})
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`:""}function Fs(e){return e===!1?"return o":`
|
|
55
|
-
var s = this.serialize(o)
|
|
56
|
-
this.restore(o)
|
|
57
|
-
return s
|
|
58
|
-
`}function Ws(e,t){return e===!0?"throw Error('fast-redact: primitives cannot be redacted')":t===!1?"return o":"return this.serialize(o)"}});var lt=x((ku,On)=>{"use strict";On.exports={groupRedact:Vs,groupRestore:Ks,nestedRedact:Js,nestedRestore:Us};function Ks({keys:e,values:t,target:r}){if(r==null||typeof r=="string")return;let n=e.length;for(var i=0;i<n;i++){let o=e[i];r[o]=t[i]}}function Vs(e,t,r,n,i){let o=Sn(e,t);if(o==null||typeof o=="string")return{keys:null,values:null,target:o,flat:!0};let a=Object.keys(o),f=a.length,s=t.length,u=i?[...t]:void 0,c=new Array(f);for(var h=0;h<f;h++){let p=a[h];c[h]=o[p],i?(u[s]=p,o[p]=r(o[p],u)):n?o[p]=r(o[p]):o[p]=r}return{keys:a,values:c,target:o,flat:!0}}function Us(e){for(let t=0;t<e.length;t++){let{target:r,path:n,value:i}=e[t],o=r;for(let a=n.length-1;a>0;a--)o=o[n[a]];o[n[0]]=i}}function Js(e,t,r,n,i,o,a){let f=Sn(t,r);if(f==null)return;let s=Object.keys(f),u=s.length;for(var c=0;c<u;c++){let h=s[c];Hs(e,f,h,r,n,i,o,a)}return e}function at(e,t){return e!=null?"hasOwn"in Object?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t):!1}function Hs(e,t,r,n,i,o,a,f){let s=i.length,u=s-1,c=r;var h=-1,p,d,l,b=null,w=null,S,v,m=!1,E=0,O=0,k=Gs();if(l=p=t[r],typeof p=="object"){for(;p!=null&&++h<s&&(O+=1,r=i[h],b=l,!(r!=="*"&&!w&&!(typeof p=="object"&&r in p)));)if(!(r==="*"&&(w==="*"&&(m=!0),w=r,h!==u))){if(w){let T=Object.keys(p);for(var M=0;M<T.length;M++){let _=T[M];if(v=p[_],S=r==="*",m)k=X(k,_,O),E=h,l=vn(v,E-1,r,n,i,o,a,f,c,p,d,l,S,_,h,u,k,e,t[c],O+1);else if(S||typeof v=="object"&&v!==null&&r in v){if(S?l=v:l=v[r],d=h!==u?l:a?f?o(l,[...n,c,...i]):o(l):o,S){let R=ge(X(k,_,O),l,t[c]);e.push(R),p[_]=d}else if(v[r]!==d)if(d===void 0&&o!==void 0||at(v,r)&&d===l)k=X(k,_,O);else{k=X(k,_,O);let R=ge(X(k,r,O+1),l,t[c]);e.push(R),v[r]=d}}}w=null}else{if(l=p[r],k=X(k,r,O),d=h!==u?l:a?f?o(l,[...n,c,...i]):o(l):o,!(at(p,r)&&d===l||d===void 0&&o!==void 0)){let T=ge(k,l,t[c]);e.push(T),p[r]=d}p=p[r]}if(typeof p!="object")break}}}function Sn(e,t){for(var r=-1,n=t.length,i=e;i!=null&&++r<n;)i=i[t[r]];return i}function vn(e,t,r,n,i,o,a,f,s,u,c,h,p,d,l,b,w,S,v,m){if(t===0&&(p||typeof e=="object"&&e!==null&&r in e)){if(p?h=e:h=e[r],c=l!==b?h:a?f?o(h,[...n,s,...i]):o(h):o,p){let E=ge(w,h,v);S.push(E),u[d]=c}else if(e[r]!==c){if(!(c===void 0&&o!==void 0||at(e,r)&&c===h)){let E=ge(X(w,r,m+1),h,v);S.push(E),e[r]=c}}}for(let E in e)typeof e[E]=="object"&&(w=X(w,E,m),vn(e[E],t-1,r,n,i,o,a,f,s,u,c,h,p,d,l,b,w,S,v,m+1))}function Gs(){return{parent:null,key:null,children:[],depth:0}}function X(e,t,r){if(e.depth===r)return X(e.parent,t,r);var n={parent:e,key:t,depth:r,children:[]};return e.children.push(n),n}function ge(e,t,r){let n=e,i=[];do i.push(n.key),n=n.parent;while(n.parent!=null);return{path:i,value:t,target:r}}});var En=x((Tu,xn)=>{"use strict";var{groupRestore:Ys,nestedRestore:Xs}=lt();xn.exports=Qs;function Qs(){return function(){if(this.restore){this.restore.state.secret=this.secret;return}let{secret:t,wcLen:r}=this,n=Object.keys(t),i=Zs(t,n),o=r>0,a=o?{secret:t,groupRestore:Ys,nestedRestore:Xs}:{secret:t};this.restore=Function("o",eo(i,n,o)).bind(a),this.restore.state=a}}function Zs(e,t){return t.map(r=>{let{circle:n,escPath:i,leadingBracket:o}=e[r],f=n?`o.${n} = secret[${i}].val`:`o${o?"":"."}${r} = secret[${i}].val`,s=`secret[${i}].val = undefined`;return`
|
|
59
|
-
if (secret[${i}].val !== undefined) {
|
|
60
|
-
try { ${f} } catch (e) {}
|
|
61
|
-
${s}
|
|
62
|
-
}
|
|
63
|
-
`}).join("")}function eo(e,t,r){return`
|
|
64
|
-
const secret = this.secret
|
|
65
|
-
${r===!0?`
|
|
66
|
-
const keys = Object.keys(secret)
|
|
67
|
-
const len = keys.length
|
|
68
|
-
for (var i = len - 1; i >= ${t.length}; i--) {
|
|
69
|
-
const k = keys[i]
|
|
70
|
-
const o = secret[k]
|
|
71
|
-
if (o) {
|
|
72
|
-
if (o.flat === true) this.groupRestore(o)
|
|
73
|
-
else this.nestedRestore(o)
|
|
74
|
-
secret[k] = null
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
`:""}
|
|
78
|
-
${e}
|
|
79
|
-
return o
|
|
80
|
-
`}});var kn=x((Mu,_n)=>{"use strict";_n.exports=to;function to(e){let{secret:t,censor:r,compileRestore:n,serialize:i,groupRedact:o,nestedRedact:a,wildcards:f,wcLen:s}=e,u=[{secret:t,censor:r,compileRestore:n}];return i!==!1&&u.push({serialize:i}),s>0&&u.push({groupRedact:o,nestedRedact:a,wildcards:f,wcLen:s}),Object.assign(...u)}});var An=x((Au,Mn)=>{"use strict";var Tn=pn(),ro=mn(),no=wn(),io=En(),{groupRedact:so,nestedRedact:oo}=lt(),ao=kn(),lo=Me(),co=Tn(),ct=e=>e;ct.restore=ct;var uo="[REDACTED]";ut.rx=lo;ut.validator=Tn;Mn.exports=ut;function ut(e={}){let t=Array.from(new Set(e.paths||[])),r="serialize"in e&&(e.serialize===!1||typeof e.serialize=="function")?e.serialize:JSON.stringify,n=e.remove;if(n===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let i=n===!0?void 0:"censor"in e?e.censor:uo,o=typeof i=="function",a=o&&i.length>1;if(t.length===0)return r||ct;co({paths:t,serialize:r,censor:i});let{wildcards:f,wcLen:s,secret:u}=ro({paths:t,censor:i}),c=io(),h="strict"in e?e.strict:!0;return no({secret:u,wcLen:s,serialize:r,strict:h,isCensorFct:o,censorFctTakesPath:a},ao({secret:u,censor:i,compileRestore:c,serialize:r,groupRedact:so,nestedRedact:oo,wildcards:f,wcLen:s}))}});var ce=x((Ru,Rn)=>{"use strict";var fo=Symbol("pino.setLevel"),ho=Symbol("pino.getLevel"),po=Symbol("pino.levelVal"),go=Symbol("pino.useLevelLabels"),yo=Symbol("pino.useOnlyCustomLevels"),mo=Symbol("pino.mixin"),bo=Symbol("pino.lsCache"),wo=Symbol("pino.chindings"),So=Symbol("pino.parsedChindings"),vo=Symbol("pino.asJson"),Oo=Symbol("pino.write"),xo=Symbol("pino.redactFmt"),Eo=Symbol("pino.time"),_o=Symbol("pino.timeSliceIndex"),ko=Symbol("pino.stream"),To=Symbol("pino.stringify"),Mo=Symbol("pino.stringifySafe"),Ao=Symbol("pino.stringifiers"),Ro=Symbol("pino.end"),jo=Symbol("pino.formatOpts"),Lo=Symbol("pino.messageKey"),qo=Symbol("pino.nestedKey"),Io=Symbol("pino.nestedKeyStr"),Po=Symbol("pino.mixinMergeStrategy"),Co=Symbol("pino.wildcardFirst"),$o=Symbol.for("pino.serializers"),Bo=Symbol.for("pino.formatters"),Do=Symbol.for("pino.hooks"),zo=Symbol.for("pino.metadata");Rn.exports={setLevelSym:fo,getLevelSym:ho,levelValSym:po,useLevelLabelsSym:go,mixinSym:mo,lsCacheSym:bo,chindingsSym:wo,parsedChindingsSym:So,asJsonSym:vo,writeSym:Oo,serializersSym:$o,redactFmtSym:xo,timeSym:Eo,timeSliceIndexSym:_o,streamSym:ko,stringifySym:To,stringifySafeSym:Mo,stringifiersSym:Ao,endSym:Ro,formatOptsSym:jo,messageKeySym:Lo,nestedKeySym:qo,wildcardFirstSym:Co,needsMetadataGsym:zo,useOnlyCustomLevelsSym:yo,formattersSym:Bo,hooksSym:Do,nestedKeyStrSym:Io,mixinMergeStrategySym:Po}});var dt=x((ju,In)=>{"use strict";var ht=An(),{redactFmtSym:No,wildcardFirstSym:Ae}=ce(),{rx:ft,validator:Fo}=ht,jn=Fo({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:e=>`pino \u2013 redact paths array contains an invalid path (${e})`}),Ln="[Redacted]",qn=!1;function Wo(e,t){let{paths:r,censor:n}=Ko(e),i=r.reduce((f,s)=>{ft.lastIndex=0;let u=ft.exec(s),c=ft.exec(s),h=u[1]!==void 0?u[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):u[0];if(h==="*"&&(h=Ae),c===null)return f[h]=null,f;if(f[h]===null)return f;let{index:p}=c,d=`${s.substr(p,s.length-1)}`;return f[h]=f[h]||[],h!==Ae&&f[h].length===0&&f[h].push(...f[Ae]||[]),h===Ae&&Object.keys(f).forEach(function(l){f[l]&&f[l].push(d)}),f[h].push(d),f},{}),o={[No]:ht({paths:r,censor:n,serialize:t,strict:qn})},a=(...f)=>t(typeof n=="function"?n(...f):n);return[...Object.keys(i),...Object.getOwnPropertySymbols(i)].reduce((f,s)=>{if(i[s]===null)f[s]=u=>a(u,[s]);else{let u=typeof n=="function"?(c,h)=>n(c,[s,...h]):n;f[s]=ht({paths:i[s],censor:u,serialize:t,strict:qn})}return f},o)}function Ko(e){if(Array.isArray(e))return e={paths:e,censor:Ln},jn(e),e;let{paths:t,censor:r=Ln,remove:n}=e;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),jn({paths:t,censor:r}),{paths:t,censor:r}}In.exports=Wo});var Cn=x((Lu,Pn)=>{"use strict";var Vo=()=>"",Uo=()=>`,"time":${Date.now()}`,Jo=()=>`,"time":${Math.round(Date.now()/1e3)}`,Ho=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;Pn.exports={nullTime:Vo,epochTime:Uo,unixTime:Jo,isoTime:Ho}});var Bn=x((qu,$n)=>{"use strict";function Go(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}$n.exports=Yo;function Yo(e,t,r){var n=r&&r.stringify||Go,i=1;if(typeof e=="object"&&e!==null){var o=t.length+i;if(o===1)return e;var a=new Array(o);a[0]=n(e);for(var f=1;f<o;f++)a[f]=n(t[f]);return a.join(" ")}if(typeof e!="string")return e;var s=t.length;if(s===0)return e;for(var u="",c=1-i,h=-1,p=e&&e.length||0,d=0;d<p;){if(e.charCodeAt(d)===37&&d+1<p){switch(h=h>-1?h:0,e.charCodeAt(d+1)){case 100:case 102:if(c>=s||t[c]==null)break;h<d&&(u+=e.slice(h,d)),u+=Number(t[c]),h=d+2,d++;break;case 105:if(c>=s||t[c]==null)break;h<d&&(u+=e.slice(h,d)),u+=Math.floor(Number(t[c])),h=d+2,d++;break;case 79:case 111:case 106:if(c>=s||t[c]===void 0)break;h<d&&(u+=e.slice(h,d));var l=typeof t[c];if(l==="string"){u+="'"+t[c]+"'",h=d+2,d++;break}if(l==="function"){u+=t[c].name||"<anonymous>",h=d+2,d++;break}u+=n(t[c]),h=d+2,d++;break;case 115:if(c>=s)break;h<d&&(u+=e.slice(h,d)),u+=String(t[c]),h=d+2,d++;break;case 37:h<d&&(u+=e.slice(h,d)),u+="%",h=d+2,d++,c--;break}++c}++d}return h===-1?e:(h<p&&(u+=e.slice(h)),u)}});var gt=x((Iu,pt)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="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(r))},e=new Int32Array(new SharedArrayBuffer(4));pt.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 n=Date.now()+Number(t);for(;n>Date.now(););};pt.exports=e}});var Wn=x((Pu,Fn)=>{"use strict";var K=I("fs"),Xo=I("events"),Qo=I("util").inherits,Dn=I("path"),zn=gt(),yt=100,Zo=16*1024;function Nn(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(o,a){if(o){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",o)}):t.emit("error",o);return}t.fd=a,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!t._reopening&&!t._writing&&t._len>t.minLength&&!t.destroyed&&ue(t)}let n=t.append?"a":"w",i=t.mode;if(t.sync)try{t.mkdir&&K.mkdirSync(Dn.dirname(e),{recursive:!0});let o=K.openSync(e,n,i);r(null,o)}catch(o){throw r(o),o}else t.mkdir?K.mkdir(Dn.dirname(e),{recursive:!0},o=>{if(o)return r(o);K.open(e,n,i,r)}):K.open(e,n,i,r)}function N(e){if(!(this instanceof N))return new N(e);let{fd:t,dest:r,minLength:n,maxLength:i,maxWrite:o,sync:a,append:f=!0,mode:s,mkdir:u,retryEAGAIN:c}=e||{};if(t=t||r,this._bufs=[],this._len=0,this.fd=-1,this._writing=!1,this._writingBuf="",this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=i||0,this.maxWrite=o||Zo,this.sync=a||!1,this.append=f||!1,this.mode=s,this.retryEAGAIN=c||(()=>!0),this.mkdir=u||!1,typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")Nn(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=(h,p)=>{if(h){if(h.code==="EAGAIN"&&this.retryEAGAIN(h,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{zn(yt),this.release(void 0,0)}catch(l){this.release(l)}else setTimeout(()=>{K.write(this.fd,this._writingBuf,"utf8",this.release)},yt);else this._writing=!1,this.emit("error",h);return}if(this.emit("write",p),this._len-=p,this._writingBuf=this._writingBuf.slice(p),this._writingBuf.length){if(!this.sync){K.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let l=K.writeSync(this.fd,this._writingBuf,"utf8");this._len-=l,this._writingBuf=this._writingBuf.slice(l)}while(this._writingBuf)}catch(l){this.release(l);return}}let d=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):d>this.minLength?ue(this):this._ending?d>0?ue(this):(this._writing=!1,Re(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(ea,this)):this.emit("drain"))},this.on("newListener",function(h){h==="drain"&&(this._asyncDrainScheduled=!1)})}function ea(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"))}Qo(N,Xo);N.prototype.write=function(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||r[r.length-1].length+e.length>this.maxWrite?r.push(""+e):r[r.length-1]+=e,this._len=t,!this._writing&&this._len>=this.minLength&&ue(this),this._len<this._hwm)};N.prototype.flush=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");this._writing||this.minLength<=0||(this._bufs.length===0&&this._bufs.push(""),ue(this))};N.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(this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&K.close(t,r=>{if(r)return this.emit("error",r)})}),Nn(e||this.file,this)};N.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?ue(this):Re(this)))};N.prototype.flushSync=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");for(!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");this._bufs.length;){let e=this._bufs[0];try{this._len-=K.writeSync(this.fd,e,"utf8"),this._bufs.shift()}catch(t){if(t.code!=="EAGAIN"||!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;zn(yt)}}};N.prototype.destroy=function(){this.destroyed||Re(this)};function ue(e){let t=e.release;if(e._writing=!0,e._writingBuf=e._writingBuf||e._bufs.shift()||"",e.sync)try{let r=K.writeSync(e.fd,e._writingBuf,"utf8");t(null,r)}catch(r){t(r)}else K.write(e.fd,e._writingBuf,"utf8",t)}function Re(e){if(e.fd===-1){e.once("ready",Re.bind(null,e));return}e.destroyed=!0,e._bufs=[],e.fd!==1&&e.fd!==2?K.close(e.fd,t):setImmediate(t);function t(r){if(r){e.emit("error",r);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close")}}N.SonicBoom=N;N.default=N;Fn.exports=N});var Vn=x((Cu,Kn)=>{"use strict";var{format:mt}=I("util");function ta(){let e={},t=new Map;function r(i,o,a){if(!i)throw new Error("Warning name must not be empty");if(!o)throw new Error("Warning code must not be empty");if(!a)throw new Error("Warning message must not be empty");if(o=o.toUpperCase(),e[o]!==void 0)throw new Error(`The code '${o}' already exist`);function f(s,u,c){let h;return s&&u&&c?h=mt(a,s,u,c):s&&u?h=mt(a,s,u):s?h=mt(a,s):h=a,{code:o,name:i,message:h}}return t.set(o,!1),e[o]=f,e[o]}function n(i,o,a,f){if(e[i]===void 0)throw new Error(`The code '${i}' does not exist`);if(t.get(i)===!0)return;t.set(i,!0);let s=e[i](o,a,f);process.emitWarning(s.message,s.name,s.code)}return{create:r,emit:n,emitted:t}}Kn.exports=ta});var Hn=x(($u,Jn)=>{"use strict";var bt=Vn()();Jn.exports=bt;var Un="PinoWarning";bt.create(Un,"PINODEP008","prettyPrint is deprecated, look at https://github.com/pinojs/pino-pretty for alternatives.");bt.create(Un,"PINODEP009","The use of pino.final is discouraged in Node.js v14+ and not required. It will be removed in the next major version")});var St=x((Bu,Qn)=>{"use strict";function Gn(e,t,r,n){function i(){let o=t.deref();o!==void 0&&r(o,n)}e[n]=i,process.once(n,i)}var Yn=new FinalizationRegistry(Xn),wt=new WeakMap;function Xn(e){process.removeListener("exit",e.exit),process.removeListener("beforeExit",e.beforeExit)}function ra(e,t){if(e===void 0)throw new Error("the object can't be undefined");let r=new WeakRef(e),n={};wt.set(e,n),Yn.register(e,n),Gn(n,r,t,"exit"),Gn(n,r,t,"beforeExit")}function na(e){let t=wt.get(e);wt.delete(e),t&&Xn(t),Yn.unregister(e)}Qn.exports={register:ra,unregister:na}});var ei=x((Du,Zn)=>{"use strict";function ia(e,t,r,n,i){let o=Date.now()+n,a=Atomics.load(e,t);if(a===r){i(null,"ok");return}let f=a,s=u=>{Date.now()>o?i(null,"timed-out"):setTimeout(()=>{f=a,a=Atomics.load(e,t),a===f?s(u>=1e3?1e3:u*2):a===r?i(null,"ok"):i(null,"not-equal")},u)};s(1)}function sa(e,t,r,n,i){let o=Date.now()+n,a=Atomics.load(e,t);if(a!==r){i(null,"ok");return}let f=s=>{Date.now()>o?i(null,"timed-out"):setTimeout(()=>{a=Atomics.load(e,t),a!==r?i(null,"ok"):f(s>=1e3?1e3:s*2)},s)};f(1)}Zn.exports={wait:ia,waitDiff:sa}});var ri=x((zu,ti)=>{"use strict";ti.exports={WRITE_INDEX:4,READ_INDEX:8}});var ai=x((Fu,oi)=>{"use strict";var{EventEmitter:oa}=I("events"),{Worker:aa}=I("worker_threads"),{join:la}=I("path"),{pathToFileURL:ca}=I("url"),{wait:ua}=ei(),{WRITE_INDEX:F,READ_INDEX:G}=ri(),fa=I("buffer"),ha=I("assert"),g=Symbol("kImpl"),da=fa.constants.MAX_STRING_LENGTH,Le=class{constructor(t){this._value=t}deref(){return this._value}},pa=global.FinalizationRegistry||class{register(){}unregister(){}},ga=global.WeakRef||Le,ni=new pa(e=>{e.exited||e.terminate()});function ya(e,t){let{filename:r,workerData:n}=t,o=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||la(__dirname,"lib","worker.js"),a=new aa(o,{...t.workerOpts,workerData:{filename:r.indexOf("file://")===0?r:ca(r).href,dataBuf:e[g].dataBuf,stateBuf:e[g].stateBuf,workerData:n}});return a.stream=new Le(e),a.on("message",ma),a.on("exit",si),ni.register(e,a),a}function ii(e){ha(!e[g].sync),e[g].needDrain&&(e[g].needDrain=!1,e.emit("drain"))}function je(e){let t=Atomics.load(e[g].state,F),r=e[g].data.length-t;if(r>0){if(e[g].buf.length===0){e[g].flushing=!1,e[g].ending?Et(e):e[g].needDrain&&process.nextTick(ii,e);return}let n=e[g].buf.slice(0,r),i=Buffer.byteLength(n);i<=r?(e[g].buf=e[g].buf.slice(r),qe(e,n,je.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[g].state,G,0),Atomics.store(e[g].state,F,0);i>e[g].data.length;)r=r/2,n=e[g].buf.slice(0,r),i=Buffer.byteLength(n);e[g].buf=e[g].buf.slice(r),qe(e,n,je.bind(null,e))}})}else if(r===0){if(t===0&&e[g].buf.length===0)return;e.flush(()=>{Atomics.store(e[g].state,G,0),Atomics.store(e[g].state,F,0),je(e)})}else throw new Error("overwritten")}function ma(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new ga(t),t.flush(()=>{t[g].ready=!0,t.emit("ready")});break;case"ERROR":fe(t,e.err);break;default:throw new Error("this should not happen: "+e.code)}}function si(e){let t=this.stream.deref();t!==void 0&&(ni.unregister(t),t.worker.exited=!0,t.worker.off("exit",si),fe(t,e!==0?new Error("The worker thread exited"):null))}var Ot=class extends oa{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[g]={},this[g].stateBuf=new SharedArrayBuffer(128),this[g].state=new Int32Array(this[g].stateBuf),this[g].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[g].data=Buffer.from(this[g].dataBuf),this[g].sync=t.sync||!1,this[g].ending=!1,this[g].ended=!1,this[g].needDrain=!1,this[g].destroyed=!1,this[g].flushing=!1,this[g].ready=!1,this[g].finished=!1,this[g].errored=null,this[g].closed=!1,this[g].buf="",this.worker=ya(this,t)}write(t){if(this[g].destroyed)throw new Error("the worker has exited");if(this[g].ending)throw new Error("the worker is ending");if(this[g].flushing&&this[g].buf.length+t.length>=da)try{vt(this),this[g].flushing=!0}catch(r){return fe(this,r),!1}if(this[g].buf+=t,this[g].sync)try{return vt(this),!0}catch(r){return fe(this,r),!1}return this[g].flushing||(this[g].flushing=!0,setImmediate(je,this)),this[g].needDrain=this[g].data.length-this[g].buf.length-Atomics.load(this[g].state,F)<=0,!this[g].needDrain}end(){this[g].destroyed||(this[g].ending=!0,Et(this))}flush(t){if(this[g].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let r=Atomics.load(this[g].state,F);ua(this[g].state,G,r,1/0,(n,i)=>{if(n){fe(this,n),process.nextTick(t,n);return}if(i==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[g].destroyed||(vt(this),xt(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[g].ready}get destroyed(){return this[g].destroyed}get closed(){return this[g].closed}get writable(){return!this[g].destroyed&&!this[g].ending}get writableEnded(){return this[g].ending}get writableFinished(){return this[g].finished}get writableNeedDrain(){return this[g].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[g].errored}};function fe(e,t){e[g].destroyed||(e[g].destroyed=!0,t&&(e[g].errored=t,e.emit("error",t)),e.worker.exited?setImmediate(()=>{e[g].closed=!0,e.emit("close")}):e.worker.terminate().catch(()=>{}).then(()=>{e[g].closed=!0,e.emit("close")}))}function qe(e,t,r){let n=Atomics.load(e[g].state,F),i=Buffer.byteLength(t);return e[g].data.write(t,n),Atomics.store(e[g].state,F,n+i),Atomics.notify(e[g].state,F),r(),!0}function Et(e){if(!(e[g].ended||!e[g].ending||e[g].flushing)){e[g].ended=!0;try{e.flushSync();let t=Atomics.load(e[g].state,G);Atomics.store(e[g].state,F,-1),Atomics.notify(e[g].state,F);let r=0;for(;t!==-1;){if(Atomics.wait(e[g].state,G,t,1e3),t=Atomics.load(e[g].state,G),t===-2)throw new Error("end() failed");if(++r===10)throw new Error("end() took too long (10s)")}process.nextTick(()=>{e[g].finished=!0,e.emit("finish")})}catch(t){fe(e,t)}}}function vt(e){let t=()=>{e[g].ending?Et(e):e[g].needDrain&&process.nextTick(ii,e)};for(e[g].flushing=!1;e[g].buf.length!==0;){let r=Atomics.load(e[g].state,F),n=e[g].data.length-r;if(n===0){xt(e),Atomics.store(e[g].state,G,0),Atomics.store(e[g].state,F,0);continue}else if(n<0)throw new Error("overwritten");let i=e[g].buf.slice(0,n),o=Buffer.byteLength(i);if(o<=n)e[g].buf=e[g].buf.slice(n),qe(e,i,t);else{for(xt(e),Atomics.store(e[g].state,G,0),Atomics.store(e[g].state,F,0);o>e[g].buf.length;)n=n/2,i=e[g].buf.slice(0,n),o=Buffer.byteLength(i);e[g].buf=e[g].buf.slice(n),qe(e,i,t)}}}function xt(e){if(e[g].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[g].state,F),r=0;for(;;){let n=Atomics.load(e[g].state,G);if(n===-2)throw new Error("_flushSync failed");if(n!==t)Atomics.wait(e[g].state,G,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}oi.exports=Ot});var kt=x((Wu,ci)=>{"use strict";var{createRequire:ba}=I("module"),wa=ot(),{join:_t,isAbsolute:Sa}=I("path"),va=gt(),Ie;global.WeakRef&&global.WeakMap&&global.FinalizationRegistry&&(Ie=St());var Oa=ai();function xa(e){if(Ie)Ie.register(e,li),e.on("close",function(){Ie.unregister(e)});else{let t=li.bind(null,e);process.once("beforeExit",t),process.once("exit",t),e.on("close",function(){process.removeListener("beforeExit",t),process.removeListener("exit",t)})}}function Ea(e,t,r){let n=new Oa({filename:e,workerData:t,workerOpts:r});n.on("ready",i),n.on("close",function(){process.removeListener("exit",o)}),process.on("exit",o);function i(){process.removeListener("exit",o),n.unref(),r.autoEnd!==!1&&xa(n)}function o(){n.closed||(n.flushSync(),va(100),n.end())}return n}function li(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref()})}function _a(e){let{pipeline:t,targets:r,levels:n,options:i={},worker:o={},caller:a=wa()}=e,f=typeof a=="string"?[a]:a,s="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},u=e.target;if(u&&r)throw new Error("only one of target or targets can be specified");return r?(u=s["pino-worker"]||_t(__dirname,"worker.js"),i.targets=r.map(h=>({...h,target:c(h.target)}))):t&&(u=s["pino-pipeline-worker"]||_t(__dirname,"worker-pipeline.js"),i.targets=t.map(h=>({...h,target:c(h.target)}))),n&&(i.levels=n),Ea(c(u),i,o);function c(h){if(h=s[h]||h,Sa(h)||h.indexOf("file://")===0)return h;if(h==="pino/file")return _t(__dirname,"..","file.js");let p;for(let d of f)try{p=ba(d).resolve(h);break}catch{continue}if(!p)throw new Error(`unable to determine transport target for "${h}"`);return p}}ci.exports=_a});var Ce=x((Ku,vi)=>{"use strict";var ui=Bn(),{mapHttpRequest:ka,mapHttpResponse:Ta}=st(),At=Wn(),gi=Hn(),{lsCacheSym:Ma,chindingsSym:Rt,parsedChindingsSym:Tt,writeSym:fi,serializersSym:jt,formatOptsSym:hi,endSym:Aa,stringifiersSym:Lt,stringifySym:yi,stringifySafeSym:qt,wildcardFirstSym:mi,needsMetadataGsym:bi,redactFmtSym:Ra,streamSym:ja,nestedKeySym:La,formattersSym:It,messageKeySym:wi,nestedKeyStrSym:qa}=ce(),{isMainThread:Ia}=I("worker_threads"),Pa=kt();function ye(){}function Ca(e,t){if(!t)return r;return function(...i){t.call(this,i,r,e)};function r(n,...i){if(typeof n=="object"){let o=n;n!==null&&(n.method&&n.headers&&n.socket?n=ka(n):typeof n.setHeader=="function"&&(n=Ta(n)));let a;o===null&&i.length===0?a=[null]:(o=i.shift(),a=i),this[fi](n,ui(o,a,this[hi]),e)}else this[fi](null,ui(n,i,this[hi]),e)}}function di(e){let t="",r=0,n=!1,i=255,o=e.length;if(o>100)return JSON.stringify(e);for(var a=0;a<o&&i>=32;a++)i=e.charCodeAt(a),(i===34||i===92)&&(t+=e.slice(r,a)+"\\",r=a,n=!0);return n?t+=e.slice(r):t=e,i<32?JSON.stringify(e):'"'+t+'"'}function $a(e,t,r,n){let i=this[yi],o=this[qt],a=this[Lt],f=this[Aa],s=this[Rt],u=this[jt],c=this[It],h=this[wi],p=this[Ma][r]+n;p=p+s;let d;c.log&&(e=c.log(e));let l=a[mi],b="";for(let S in e)if(d=e[S],Object.prototype.hasOwnProperty.call(e,S)&&d!==void 0){d=u[S]?u[S](d):d;let v=a[S]||l;switch(typeof d){case"undefined":case"function":continue;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":v&&(d=v(d));break;case"string":d=(v||di)(d);break;default:d=(v||i)(d,o)}if(d===void 0)continue;b+=',"'+S+'":'+d}let w="";if(t!==void 0){d=u[h]?u[h](t):t;let S=a[h]||l;switch(typeof d){case"function":break;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":S&&(d=S(d)),w=',"'+h+'":'+d;break;case"string":d=(S||di)(d),w=',"'+h+'":'+d;break;default:d=(S||i)(d,o),w=',"'+h+'":'+d}}return this[La]&&b?p+this[qa]+b.slice(1)+"}"+w+f:p+b+w+f}function Ba(e,t){let r,n=e[Rt],i=e[yi],o=e[qt],a=e[Lt],f=a[mi],s=e[jt],u=e[It].bindings;t=u(t);for(let c in t)if(r=t[c],(c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels"&&t.hasOwnProperty(c)&&r!==void 0)===!0){if(r=s[c]?s[c](r):r,r=(a[c]||f||i)(r,o),r===void 0)continue;n+=',"'+c+'":'+r}return n}function Si(e,t,r,n){if(t&&typeof t=="function")return t=t.bind(n),Mt(t(e),r,e);try{let i=I("pino-pretty").prettyFactory;return i.asMetaWrapper=Mt,Mt(i(e),r,e)}catch(i){throw i.message.startsWith("Cannot find module 'pino-pretty'")?Error("Missing `pino-pretty` module: `pino-pretty` must be installed separately"):i}}function Mt(e,t,r){r=Object.assign({suppressFlushSyncWarning:!1},r);let n=!1;return{[bi]:!0,lastLevel:0,lastMsg:null,lastObj:null,lastLogger:null,flushSync(){r.suppressFlushSyncWarning||n||(n=!0,pi(t,this),t.write(e(Object.assign({level:40,msg:"pino.final with prettyPrint does not support flushing",time:Date.now()},this.chindings()))))},chindings(){let i=this.lastLogger,o=null;return i?(i.hasOwnProperty(Tt)?o=i[Tt]:(o=JSON.parse("{"+i[Rt].substr(1)+"}"),i[Tt]=o),o):null},write(i){let o=this.lastLogger,a=this.chindings(),f=this.lastTime;typeof f=="number"||(f.match(/^\d+/)?f=parseInt(f):f=f.slice(1,-1));let s=this.lastObj,u=this.lastMsg,c=null,h=o[It],p=h.log?h.log(s):s,d=o[wi];u&&p&&!Object.prototype.hasOwnProperty.call(p,d)&&(p[d]=u);let l=Object.assign({level:this.lastLevel,time:f},p,c),b=o[jt],w=Object.keys(b);for(var S=0;S<w.length;S++){let O=w[S];l[O]!==void 0&&(l[O]=b[O](l[O]))}for(let O in a)l.hasOwnProperty(O)||(l[O]=a[O]);let m=o[Lt][Ra],E=e(typeof m=="function"?m(l):l);E!==void 0&&(pi(t,this),t.write(E))}}}function Da(e){return e.write!==e.constructor.prototype.write}function Pe(e){let t=new At(e);return t.on("error",r),!e.sync&&Ia&&za(t),t;function r(n){if(n.code==="EPIPE"){t.write=ye,t.end=ye,t.flushSync=ye,t.destroy=ye;return}t.removeListener("error",r),t.emit("error",n)}}function za(e){if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let t=St();t.register(e,Na),e.on("close",function(){t.unregister(e)})}}function Na(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}function Fa(e){return function(r,n,i={},o){if(typeof i=="string")o=Pe({dest:i,sync:!0}),i={};else if(typeof o=="string"){if(i&&i.transport)throw Error("only one of option.transport or stream can be specified");o=Pe({dest:o,sync:!0})}else if(i instanceof At||i.writable||i._writableState)o=i,i={};else if(i.transport){if(i.transport instanceof At||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 c;i.customLevels&&(c=i.useOnlyCustomLevels?i.customLevels:Object.assign({},i.levels,i.customLevels)),o=Pa({caller:n,...i.transport,levels:c})}if(i=Object.assign({},e,i),i.serializers=Object.assign({},e.serializers,i.serializers),i.formatters=Object.assign({},e.formatters,i.formatters),"onTerminated"in i)throw Error("The onTerminated option has been removed, use pino.final instead");"changeLevelName"in i&&(process.emitWarning("The changeLevelName option is deprecated and will be removed in v7. Use levelKey instead.",{code:"changeLevelName_deprecation"}),i.levelKey=i.changeLevelName,delete i.changeLevelName);let{enabled:a,prettyPrint:f,prettifier:s,messageKey:u}=i;if(a===!1&&(i.level="silent"),o=o||process.stdout,o===process.stdout&&o.fd>=0&&!Da(o)&&(o=Pe({fd:o.fd,sync:!0})),f){gi.emit("PINODEP008");let c=Object.assign({messageKey:u},f);o=Si(c,s,o,r)}return{opts:i,stream:o}}}function Wa(e,t){if(Number(process.versions.node.split(".")[0])>=14&&gi.emit("PINODEP009"),typeof e>"u"||typeof e.child!="function")throw Error("expected a pino logger instance");let n=typeof t<"u";if(n&&typeof t!="function")throw Error("if supplied, the handler parameter should be a function");let i=e[ja];if(typeof i.flushSync!="function")throw Error("final requires a stream that has a flushSync method, such as pino.destination");let o=new Proxy(e,{get:(a,f)=>f in a.levels.values?(...s)=>{a[f](...s),i.flushSync()}:a[f]});if(!n){try{i.flushSync()}catch{}return o}return(a=null,...f)=>{try{i.flushSync()}catch{}return t(a,o,...f)}}function Ka(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[qt])(e)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function Va(e,t,r){return{level:e,bindings:t,log:r}}function pi(e,t){e[bi]===!0&&(e.lastLevel=t.lastLevel,e.lastMsg=t.lastMsg,e.lastObj=t.lastObj,e.lastTime=t.lastTime,e.lastLogger=t.lastLogger)}function Ua(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e}vi.exports={noop:ye,buildSafeSonicBoom:Pe,getPrettyStream:Si,asChindings:Ba,asJson:$a,genLog:Ca,createArgsNormalizer:Fa,final:Wa,stringify:Ka,buildFormatters:Va,normalizeDestFileDescriptor:Ua}});var $e=x((Vu,xi)=>{"use strict";var{lsCacheSym:Ja,levelValSym:Pt,useOnlyCustomLevelsSym:Ha,streamSym:Ga,formattersSym:Ya,hooksSym:Xa}=ce(),{noop:Qa,genLog:re}=Ce(),H={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Oi={fatal:e=>{let t=re(H.fatal,e);return function(...r){let n=this[Ga];if(t.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:e=>re(H.error,e),warn:e=>re(H.warn,e),info:e=>re(H.info,e),debug:e=>re(H.debug,e),trace:e=>re(H.trace,e)},Ct=Object.keys(H).reduce((e,t)=>(e[H[t]]=t,e),{}),Za=Object.keys(Ct).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function el(e){let t=e[Ya].level,{labels:r}=e.levels,n={};for(let i in r){let o=t(r[i],Number(i));n[i]=JSON.stringify(o).slice(0,-1)}return e[Ja]=n,e}function tl(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 rl(e){let{labels:t,values:r}=this.levels;if(typeof e=="number"){if(t[e]===void 0)throw Error("unknown level value"+e);e=t[e]}if(r[e]===void 0)throw Error("unknown level "+e);let n=this[Pt],i=this[Pt]=r[e],o=this[Ha],a=this[Xa].logMethod;for(let f in r){if(i>r[f]){this[f]=Qa;continue}this[f]=tl(f,o)?Oi[f](a):re(r[f],a)}this.emit("level-change",e,i,t[n],n)}function nl(e){let{levels:t,levelVal:r}=this;return t&&t.labels?t.labels[r]:""}function il(e){let{values:t}=this.levels,r=t[e];return r!==void 0&&r>=this[Pt]}function sl(e=null,t=!1){let r=e?Object.keys(e).reduce((o,a)=>(o[e[a]]=a,o),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:Ct,r),i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:H,e);return{labels:n,values:i}}function ol(e,t,r){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(o=>t[o]),r?[]:Object.keys(Ct).map(o=>+o),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:H,t);if(!(e in n))throw Error(`default level:${e} must be included in custom levels`)}function al(e,t){let{labels:r,values:n}=e;for(let i in t){if(i in n)throw Error("levels cannot be overridden");if(t[i]in r)throw Error("pre-existing level values cannot be used for new levels")}}xi.exports={initialLsCache:Za,genLsCache:el,levelMethods:Oi,getLevel:nl,setLevel:rl,isLevelEnabled:il,mappings:sl,levels:H,assertNoLevelCollisions:al,assertDefaultLevelFound:ol}});var Ei=x((Uu,ll)=>{ll.exports={name:"pino",version:"7.11.0",description:"super fast, all natural json logger",main:"pino.js",type:"commonjs",types:"pino.d.ts",browser:"./browser.js",files:["pino.js","file.js","pino.d.ts","bin.js","browser.js","pretty.js","usage.txt","test","docs","example.js","lib"],scripts:{docs:"docsify serve","browser-test":"airtap --local 8080 test/browser*test.js",lint:"eslint .",test:"npm run lint && npm run transpile && tap --ts && jest test/jest && npm run test-types","test-ci":"npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types","test-ci-pnpm":"pnpm run lint && npm run transpile && tap --ts --no-coverage --no-check-coverage && pnpm run test-types","test-ci-yarn-pnp":"yarn run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly","test-types":"tsc && tsd && ts-node test/types/pino.ts",transpile:"node ./test/fixtures/ts/transpile.cjs","cov-ui":"tap --ts --coverage-report=html",bench:"node benchmarks/utils/runbench all","bench-basic":"node benchmarks/utils/runbench basic","bench-object":"node benchmarks/utils/runbench object","bench-deep-object":"node benchmarks/utils/runbench deep-object","bench-multi-arg":"node benchmarks/utils/runbench multi-arg","bench-longs-tring":"node benchmarks/utils/runbench long-string","bench-child":"node benchmarks/utils/runbench child","bench-child-child":"node benchmarks/utils/runbench child-child","bench-child-creation":"node benchmarks/utils/runbench child-creation","bench-formatters":"node benchmarks/utils/runbench formatters","update-bench-doc":"node benchmarks/utils/generate-benchmark-doc > docs/benchmarks.md"},bin:{pino:"./bin.js"},precommit:"test",repository:{type:"git",url:"git+https://github.com/pinojs/pino.git"},keywords:["fast","logger","stream","json"],author:"Matteo Collina <hello@matteocollina.com>",contributors:["David Mark Clements <huperekchuno@googlemail.com>","James Sumners <james.sumners@gmail.com>","Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)"],license:"MIT",bugs:{url:"https://github.com/pinojs/pino/issues"},homepage:"http://getpino.io",devDependencies:{"@types/flush-write-stream":"^1.0.0","@types/node":"^17.0.0","@types/tap":"^15.0.6",airtap:"4.0.4",benchmark:"^2.1.4",bole:"^4.0.0",bunyan:"^1.8.14","docsify-cli":"^4.4.1",eslint:"^7.17.0","eslint-config-standard":"^16.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0",execa:"^5.0.0",fastbench:"^1.0.1","flush-write-stream":"^2.0.0","import-fresh":"^3.2.1",jest:"^27.3.1",log:"^6.0.0",loglevel:"^1.6.7","pino-pretty":"^v7.6.0","pre-commit":"^1.2.2",proxyquire:"^2.1.3",pump:"^3.0.0",rimraf:"^3.0.2",semver:"^7.0.0",split2:"^4.0.0",steed:"^1.1.3","strip-ansi":"^6.0.0",tap:"^16.0.0",tape:"^5.0.0",through2:"^4.0.0","ts-node":"^10.7.0",tsd:"^0.20.0",typescript:"^4.4.4",winston:"^3.3.3"},dependencies:{"atomic-sleep":"^1.0.0","fast-redact":"^3.0.0","on-exit-leak-free":"^0.2.0","pino-abstract-transport":"v0.5.0","pino-std-serializers":"^4.0.0","process-warning":"^1.0.0","quick-format-unescaped":"^4.0.3","real-require":"^0.1.0","safe-stable-stringify":"^2.1.0","sonic-boom":"^2.2.1","thread-stream":"^0.15.1"},tsd:{directory:"test/types"}}});var $t=x((Ju,_i)=>{"use strict";var{version:cl}=Ei();_i.exports={version:cl}});var Pi=x((Gu,Ii)=>{"use strict";var{EventEmitter:ul}=I("events"),{lsCacheSym:fl,levelValSym:hl,setLevelSym:Dt,getLevelSym:ki,chindingsSym:zt,parsedChindingsSym:dl,mixinSym:pl,asJsonSym:Ri,writeSym:gl,mixinMergeStrategySym:yl,timeSym:ml,timeSliceIndexSym:bl,streamSym:ji,serializersSym:ne,formattersSym:Bt,useOnlyCustomLevelsSym:wl,needsMetadataGsym:Sl,redactFmtSym:vl,stringifySym:Ol,formatOptsSym:xl,stringifiersSym:El}=ce(),{getLevel:_l,setLevel:kl,isLevelEnabled:Tl,mappings:Ml,initialLsCache:Al,genLsCache:Rl,assertNoLevelCollisions:jl}=$e(),{asChindings:Li,asJson:Ll,buildFormatters:Ti,stringify:Mi}=Ce(),{version:ql}=$t(),Il=dt(),Pl=class{},qi={constructor:Pl,child:Cl,bindings:$l,setBindings:Bl,flush:Fl,isLevelEnabled:Tl,version:ql,get level(){return this[ki]()},set level(e){this[Dt](e)},get levelVal(){return this[hl]},set levelVal(e){throw Error("levelVal is read-only")},[fl]:Al,[gl]:zl,[Ri]:Ll,[ki]:_l,[Dt]:kl};Object.setPrototypeOf(qi,ul.prototype);Ii.exports=function(){return Object.create(qi)};var Ai=e=>e;function Cl(e,t){if(!e)throw Error("missing bindings for child Pino");t=t||{};let r=this[ne],n=this[Bt],i=Object.create(this);if(t.hasOwnProperty("serializers")===!0){i[ne]=Object.create(null);for(let c in r)i[ne][c]=r[c];let s=Object.getOwnPropertySymbols(r);for(var o=0;o<s.length;o++){let c=s[o];i[ne][c]=r[c]}for(let c in t.serializers)i[ne][c]=t.serializers[c];let u=Object.getOwnPropertySymbols(t.serializers);for(var a=0;a<u.length;a++){let c=u[a];i[ne][c]=t.serializers[c]}}else i[ne]=r;if(t.hasOwnProperty("formatters")){let{level:s,bindings:u,log:c}=t.formatters;i[Bt]=Ti(s||n.level,u||Ai,c||n.log)}else i[Bt]=Ti(n.level,Ai,n.log);if(t.hasOwnProperty("customLevels")===!0&&(jl(this.levels,t.customLevels),i.levels=Ml(t.customLevels,i[wl]),Rl(i)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let s=Il(i.redact,Mi),u={stringify:s[vl]};i[Ol]=Mi,i[El]=s,i[xl]=u}i[zt]=Li(i,e);let f=t.level||this.level;return i[Dt](f),i}function $l(){let t=`{${this[zt].substr(1)}}`,r=JSON.parse(t);return delete r.pid,delete r.hostname,r}function Bl(e){let t=Li(this,e);this[zt]=t,delete this[dl]}function Dl(e,t){return Object.assign(t,e)}function zl(e,t,r){let n=this[ml](),i=this[pl],o=this[yl]||Dl,a;e==null?a={}:e instanceof Error?(a={err:e},t===void 0&&(t=e.message)):(a=e,t===void 0&&e.err&&(t=e.err.message)),i&&(a=o(a,i(a,r)));let f=this[Ri](a,t,r,n),s=this[ji];s[Sl]===!0&&(s.lastLevel=r,s.lastObj=a,s.lastMsg=t,s.lastTime=n.slice(this[bl]),s.lastLogger=this),s.write(f)}function Nl(){}function Fl(){let e=this[ji];"flush"in e&&e.flush(Nl)}});var Di=x((Kt,Bi)=>{"use strict";var{hasOwnProperty:me}=Object.prototype,se=Wt();se.configure=Wt;se.stringify=se;se.default=se;Kt.stringify=se;Kt.configure=Wt;Bi.exports=se;var Wl=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Z(e){return e.length<5e3&&!Wl.test(e)?`"${e}"`:JSON.stringify(e)}function Nt(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let n=e[r],i=r;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var Kl=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Ft(e){return Kl.call(e)!==void 0&&e.length!==0}function Ci(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let o=1;o<r;o++)i+=`${t}"${o}":${n}${e[o]}`;return i}function Vl(e){if(me.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 Ul(e){let t;if(me.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 Jl(e,t){let r;if(me.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function $i(e,t){let r;if(me.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function ie(e){return e===1?"1 item":`${e} items`}function Hl(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function Gl(e){if(me.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 r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function Wt(e){e={...e};let t=Gl(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=Vl(e),n=Jl(e,"bigint"),i=Ul(e),o=typeof i=="function"?i:void 0,a=$i(e,"maximumDepth"),f=$i(e,"maximumBreadth");function s(d,l,b,w,S,v){let m=l[d];switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(d)),m=w.call(l,d,m),typeof m){case"string":return Z(m);case"object":{if(m===null)return"null";if(b.indexOf(m)!==-1)return r;let E="",O=",",k=v;if(Array.isArray(m)){if(m.length===0)return"[]";if(a<b.length+1)return'"[Array]"';b.push(m),S!==""&&(v+=S,E+=`
|
|
81
|
-
${v}`,O=`,
|
|
82
|
-
${v}`);let A=Math.min(m.length,f),C=0;for(;C<A-1;C++){let U=s(String(C),m,b,w,S,v);E+=U!==void 0?U:"null",E+=O}let P=s(String(C),m,b,w,S,v);if(E+=P!==void 0?P:"null",m.length-1>f){let U=m.length-f-1;E+=`${O}"... ${ie(U)} not stringified"`}return S!==""&&(E+=`
|
|
83
|
-
${k}`),b.pop(),`[${E}]`}let M=Object.keys(m),T=M.length;if(T===0)return"{}";if(a<b.length+1)return'"[Object]"';let _="",R="";S!==""&&(v+=S,O=`,
|
|
84
|
-
${v}`,_=" ");let q=Math.min(T,f);i&&!Ft(m)&&(M=Nt(M,o)),b.push(m);for(let A=0;A<q;A++){let C=M[A],P=s(C,m,b,w,S,v);P!==void 0&&(E+=`${R}${Z(C)}:${_}${P}`,R=O)}if(T>f){let A=T-f;E+=`${R}"...":${_}"${ie(A)} not stringified"`,R=O}return S!==""&&R.length>1&&(E=`
|
|
85
|
-
${v}${E}
|
|
86
|
-
${k}`),b.pop(),`{${E}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return t?t(m):void 0}}function u(d,l,b,w,S,v){switch(typeof l=="object"&&l!==null&&typeof l.toJSON=="function"&&(l=l.toJSON(d)),typeof l){case"string":return Z(l);case"object":{if(l===null)return"null";if(b.indexOf(l)!==-1)return r;let m=v,E="",O=",";if(Array.isArray(l)){if(l.length===0)return"[]";if(a<b.length+1)return'"[Array]"';b.push(l),S!==""&&(v+=S,E+=`
|
|
87
|
-
${v}`,O=`,
|
|
88
|
-
${v}`);let T=Math.min(l.length,f),_=0;for(;_<T-1;_++){let q=u(String(_),l[_],b,w,S,v);E+=q!==void 0?q:"null",E+=O}let R=u(String(_),l[_],b,w,S,v);if(E+=R!==void 0?R:"null",l.length-1>f){let q=l.length-f-1;E+=`${O}"... ${ie(q)} not stringified"`}return S!==""&&(E+=`
|
|
89
|
-
${m}`),b.pop(),`[${E}]`}b.push(l);let k="";S!==""&&(v+=S,O=`,
|
|
90
|
-
${v}`,k=" ");let M="";for(let T of w){let _=u(T,l[T],b,w,S,v);_!==void 0&&(E+=`${M}${Z(T)}:${k}${_}`,M=O)}return S!==""&&M.length>1&&(E=`
|
|
91
|
-
${v}${E}
|
|
92
|
-
${m}`),b.pop(),`{${E}}`}case"number":return isFinite(l)?String(l):t?t(l):"null";case"boolean":return l===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(l);default:return t?t(l):void 0}}function c(d,l,b,w,S){switch(typeof l){case"string":return Z(l);case"object":{if(l===null)return"null";if(typeof l.toJSON=="function"){if(l=l.toJSON(d),typeof l!="object")return c(d,l,b,w,S);if(l===null)return"null"}if(b.indexOf(l)!==-1)return r;let v=S;if(Array.isArray(l)){if(l.length===0)return"[]";if(a<b.length+1)return'"[Array]"';b.push(l),S+=w;let _=`
|
|
93
|
-
${S}`,R=`,
|
|
94
|
-
${S}`,q=Math.min(l.length,f),A=0;for(;A<q-1;A++){let P=c(String(A),l[A],b,w,S);_+=P!==void 0?P:"null",_+=R}let C=c(String(A),l[A],b,w,S);if(_+=C!==void 0?C:"null",l.length-1>f){let P=l.length-f-1;_+=`${R}"... ${ie(P)} not stringified"`}return _+=`
|
|
95
|
-
${v}`,b.pop(),`[${_}]`}let m=Object.keys(l),E=m.length;if(E===0)return"{}";if(a<b.length+1)return'"[Object]"';S+=w;let O=`,
|
|
96
|
-
${S}`,k="",M="",T=Math.min(E,f);Ft(l)&&(k+=Ci(l,O,f),m=m.slice(l.length),T-=l.length,M=O),i&&(m=Nt(m,o)),b.push(l);for(let _=0;_<T;_++){let R=m[_],q=c(R,l[R],b,w,S);q!==void 0&&(k+=`${M}${Z(R)}: ${q}`,M=O)}if(E>f){let _=E-f;k+=`${M}"...": "${ie(_)} not stringified"`,M=O}return M!==""&&(k=`
|
|
97
|
-
${S}${k}
|
|
98
|
-
${v}`),b.pop(),`{${k}}`}case"number":return isFinite(l)?String(l):t?t(l):"null";case"boolean":return l===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(l);default:return t?t(l):void 0}}function h(d,l,b){switch(typeof l){case"string":return Z(l);case"object":{if(l===null)return"null";if(typeof l.toJSON=="function"){if(l=l.toJSON(d),typeof l!="object")return h(d,l,b);if(l===null)return"null"}if(b.indexOf(l)!==-1)return r;let w="",S=l.length!==void 0;if(S&&Array.isArray(l)){if(l.length===0)return"[]";if(a<b.length+1)return'"[Array]"';b.push(l);let k=Math.min(l.length,f),M=0;for(;M<k-1;M++){let _=h(String(M),l[M],b);w+=_!==void 0?_:"null",w+=","}let T=h(String(M),l[M],b);if(w+=T!==void 0?T:"null",l.length-1>f){let _=l.length-f-1;w+=`,"... ${ie(_)} not stringified"`}return b.pop(),`[${w}]`}let v=Object.keys(l),m=v.length;if(m===0)return"{}";if(a<b.length+1)return'"[Object]"';let E="",O=Math.min(m,f);S&&Ft(l)&&(w+=Ci(l,",",f),v=v.slice(l.length),O-=l.length,E=","),i&&(v=Nt(v,o)),b.push(l);for(let k=0;k<O;k++){let M=v[k],T=h(M,l[M],b);T!==void 0&&(w+=`${E}${Z(M)}:${T}`,E=",")}if(m>f){let k=m-f;w+=`${E}"...":"${ie(k)} not stringified"`}return b.pop(),`{${w}}`}case"number":return isFinite(l)?String(l):t?t(l):"null";case"boolean":return l===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(l);default:return t?t(l):void 0}}function p(d,l,b){if(arguments.length>1){let w="";if(typeof b=="number"?w=" ".repeat(Math.min(b,10)):typeof b=="string"&&(w=b.slice(0,10)),l!=null){if(typeof l=="function")return s("",{"":d},[],l,w,"");if(Array.isArray(l))return u("",d,[],Hl(l),w,"")}if(w.length!==0)return c("",d,[],w,"")}return h("",d,[])}return p}});var Wi=x((Yu,Fi)=>{"use strict";var Vt=Symbol.for("pino.metadata"),{levels:zi}=$e(),Ni=Object.create(zi);Ni.silent=1/0;var Yl=zi.info;function Xl(e,t){let r=0;e=e||[],t=t||{dedupe:!1};let n=Ni;t.levels&&typeof t.levels=="object"&&(n=t.levels);let i={write:o,add:f,flushSync:a,end:s,minLevel:0,streams:[],clone:u,[Vt]:!0};return Array.isArray(e)?e.forEach(f,i):f.call(i,e),e=null,i;function o(c){let h,p=this.lastLevel,{streams:d}=this,l;for(let b=0;b<d.length&&(h=d[b],h.level<=p);b++){if(l=h.stream,l[Vt]){let{lastTime:w,lastMsg:S,lastObj:v,lastLogger:m}=this;l.lastLevel=p,l.lastTime=w,l.lastMsg=S,l.lastObj=v,l.lastLogger=m}(!t.dedupe||h.level===p)&&l.write(c)}}function a(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync()}function f(c){if(!c)return i;let h=typeof c.write=="function"||c.stream,p=c.write?c:c.stream;if(!h)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:d}=this,l;typeof c.levelVal=="number"?l=c.levelVal:typeof c.level=="string"?l=n[c.level]:typeof c.level=="number"?l=c.level:l=Yl;let b={stream:p,level:l,levelVal:void 0,id:r++};return d.unshift(b),d.sort(Ql),this.minLevel=d[0].level,i}function s(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync(),c.end()}function u(c){let h=new Array(this.streams.length);for(let p=0;p<h.length;p++)h[p]={level:c,stream:this.streams[p].stream};return{write:o,add:f,minLevel:c,streams:h,clone:u,flushSync:a,[Vt]:!0}}}function Ql(e,t){return e.level-t.level}Fi.exports=Xl});var rs=x((Xu,V)=>{"use strict";var Zl=I("os"),Xi=st(),ec=ot(),tc=dt(),Qi=Cn(),rc=Pi(),Zi=ce(),{configure:nc}=Di(),{assertDefaultLevelFound:ic,mappings:es,genLsCache:sc,levels:oc}=$e(),{createArgsNormalizer:ac,asChindings:lc,final:cc,buildSafeSonicBoom:Ki,buildFormatters:uc,stringify:Be,normalizeDestFileDescriptor:Vi,noop:fc}=Ce(),{version:hc}=$t(),{chindingsSym:Ui,redactFmtSym:dc,serializersSym:Ji,timeSym:pc,timeSliceIndexSym:gc,streamSym:yc,stringifySym:Hi,stringifySafeSym:Ut,stringifiersSym:Gi,setLevelSym:mc,endSym:bc,formatOptsSym:wc,messageKeySym:Sc,nestedKeySym:vc,mixinSym:Oc,useOnlyCustomLevelsSym:xc,formattersSym:Yi,hooksSym:Ec,nestedKeyStrSym:_c,mixinMergeStrategySym:kc}=Zi,{epochTime:ts,nullTime:Tc}=Qi,{pid:Mc}=process,Ac=Zl.hostname(),Rc=Xi.err,jc={level:"info",levels:oc,messageKey:"msg",nestedKey:null,enabled:!0,prettyPrint:!1,base:{pid:Mc,hostname:Ac},serializers:Object.assign(Object.create(null),{err:Rc}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0},timestamp:ts,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},Lc=ac(jc),qc=Object.assign(Object.create(null),Xi);function Jt(...e){let t={},{opts:r,stream:n}=Lc(t,ec(),...e),{redact:i,crlf:o,serializers:a,timestamp:f,messageKey:s,nestedKey:u,base:c,name:h,level:p,customLevels:d,mixin:l,mixinMergeStrategy:b,useOnlyCustomLevels:w,formatters:S,hooks:v,depthLimit:m,edgeLimit:E}=r,O=nc({maximumDepth:m,maximumBreadth:E}),k=uc(S.level,S.bindings,S.log),M=i?tc(i,Be):{},T=Be.bind({[Ut]:O}),_=i?{stringify:M[dc]}:{stringify:T},R="}"+(o?`\r
|
|
99
|
-
`:`
|
|
100
|
-
`),q=lc.bind(null,{[Ui]:"",[Ji]:a,[Gi]:M,[Hi]:Be,[Ut]:O,[Yi]:k}),A="";c!==null&&(h===void 0?A=q(c):A=q(Object.assign({},c,{name:h})));let C=f instanceof Function?f:f?ts:Tc,P=C().indexOf(":")+1;if(w&&!d)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(l&&typeof l!="function")throw Error(`Unknown mixin type "${typeof l}" - expected "function"`);ic(p,d,w);let U=es(d,w);return Object.assign(t,{levels:U,[xc]:w,[yc]:n,[pc]:C,[gc]:P,[Hi]:Be,[Ut]:O,[Gi]:M,[bc]:R,[wc]:_,[Sc]:s,[vc]:u,[_c]:u?`,${JSON.stringify(u)}:{`:"",[Ji]:a,[Oc]:l,[kc]:b,[Ui]:A,[Yi]:k,[Ec]:v,silent:fc}),Object.setPrototypeOf(t,rc()),sc(t),t[mc](p),t}V.exports=Jt;V.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=Vi(e.dest||process.stdout.fd),Ki(e)):Ki({dest:Vi(e),minLength:0,sync:!0});V.exports.transport=kt();V.exports.multistream=Wi();V.exports.final=cc;V.exports.levels=es();V.exports.stdSerializers=qc;V.exports.stdTimeFunctions=Object.assign({},Qi);V.exports.symbols=Zi;V.exports.version=hc;V.exports.default=Jt;V.exports.pino=Jt});var le=class{client;constructor(t){this.client=t}getGroupName(t){let r=this.client?.contacts[t]||this.client?.messages["status@broadcast"]?.array?.find(n=>n?.key?.participant===t);return r?.name||r?.subject||(r=this.client?.groupMetadata[t]||{}),r?.name}};var ls=be(Vr()),Fe=be(Ze()),cs=be(rs());import*as L from"@whiskeysockets/baileys";import Ne from"chalk";import Cc from"cfonts";import oe from"chalk";import $c from"dayjs";import Bc from"ora";var ns=be(Ze());import Ic from"beautify-console-log";import Pc from"chalk";var is=Ic.getInstance();is.setPadStartText({title:"",logType:"error"}).setPadStartText({title:"",logType:"info"}).setPadStartText({title:"",logType:"log"}).setPadStartText({title:"",logType:"warn"});var ef=is,Ht=console.log,tf=new ns.default,ss=(e="succeed")=>Pc[{succeed:"bgGreen",fail:"bgRed",warn:"bgYellow",info:"bgCyan"}[e]](" "),rf=e=>new Promise(t=>setTimeout(t,e));var os={text:"text",conversation:"text",imageMessage:"image",contactMessage:"contact",locationMessage:"location",extendedTextMessage:"text",documentMessage:"document",audioMessage:"audio",videoMessage:"video",protocolMessage:"protocol",contactsArrayMessage:"contactsArray",highlyStructuredMessage:"highlyStructured",sendPaymentMessage:"sendPayment",liveLocationMessage:"liveLocation",requestPaymentMessage:"requestPayment",declinePaymentRequestMessage:"declinePaymentRequest",cancelPaymentRequestMessage:"cancelPaymentRequest",templateMessage:"template",stickerMessage:"sticker",groupInviteMessage:"groupInvite",templateButtonReplyMessage:"templateButtonReply",productMessage:"product",deviceSentMessage:"deviceSent",listMessage:"list",viewOnceMessage:"viewOnce",orderMessage:"order",listResponseMessage:"listResponse",ephemeralMessage:"ephemeral",invoiceMessage:"invoice",buttonsMessage:"buttons",buttonsResponseMessage:"buttonsResponse",paymentInviteMessage:"paymentInvite",interactiveMessage:"interactive",reactionMessage:"reaction",stickerSyncRmrMessage:"sticker",interactiveResponseMessage:"interactiveResponse",pollCreationMessage:"pollCreation",pollUpdateMessage:"pollUpdate",keepInChatMessage:"keepInChat",documentWithCaptionMessage:"document",requestPhoneNumberMessage:"requestPhoneNumber",viewOnceMessageV2:"viewOnce",encReactionMessage:"reaction",editedMessage:"text",viewOnceMessageV2Extension:"viewOnce",pollCreationMessageV2:"pollCreation",scheduledCallCreationMessage:"scheduledCallCreation",groupMentionedMessage:"groupMentioned",pinInChatMessage:"pinInChat",pollCreationMessageV3:"pollCreation",scheduledCallEditMessage:"scheduledCallEdit",ptvMessage:"ptv",botInvokeMessage:"botInvoke",callLogMesssage:"callLog",encCommentMessage:"encComment",bcallMessage:"bcall",lottieStickerMessage:"lottieSticker",eventMessage:"event",commentMessage:"comment",newsletterAdminInviteMessage:"text",extendedTextMessageWithParentKey:"text",placeholderMessage:"placeholder",encEventUpdateMessage:"encEventUpdate"};var De=class{bannerLogo;copyright;client;actions;spinner;constructor(t){this.client=t,this.bannerLogo=" Zaileys ",this.copyright=`Copyright \xA9 ${new Date().getFullYear()} by zaadevofc`,this.spinner=Bc({color:"yellow",spinner:"dots3"}),this.banner(),this.actions=new le(this.client)}banner(){Cc.say(this.bannerLogo,{font:"slick",colors:["#ffce51","blue"],letterSpacing:0}),Ht(" ".repeat(5),oe`{yellowBright.italic.bold ${this.copyright} }`),Ht(`
|
|
101
|
-
`+oe`{dim =}`.repeat(42)+`
|
|
102
|
-
`)}async msgLogs(t){if(!t)return;let{roomType:r,msgType:n,msgBody:i,msgTimestamp:o,roomId:a,senderId:f,senderName:s}=t,u=a.split("@")[0],c=f.split("@")[0],h=$c(o).format("HH:mm:ss DD/MM/YYYY"),p=this.actions.getGroupName(a),d=oe`{dim.bold.underline ${h}}\n`;d+=oe`{bgBlue.underline } {yellow.bold [${r=="group"?p:s}]} {cyan >>} {green.bold ${r=="group"?u:c}}\n`,d+=r=="group"?oe`{bgBlue.underline } {yellow.bold [${s}]} {cyan >>} {green.bold ${c}}\n`:"",d+=oe`{bgBlue } {yellow.bold [${n.toUpperCase()}]} {cyan >>} {bold ${i}}`,console.log(d)}runSpinner(t){this.spinner.start(oe`${t}`)}editSpinner(t){this.spinner&&(this.spinner.text=t)}stopSpinner(t="succeed",r){this.spinner&&this.spinner.stopAndPersist({text:r,symbol:ss(t)})}};import*as ze from"@whiskeysockets/baileys";var Gt=e=>/:\d+@/gi.test(e)?ze.jidNormalizedUser(e):e;function ae(e,t,r){if(!r?.message||r?.messageStubType||r?.key?.remoteJid==="status@broadcast")return;let n=s=>{if(s)return Object.keys(s).find(h=>(h==="conversation"||h.endsWith("Message")||h.endsWith("V2")||h.endsWith("V3"))&&h!=="senderKeyDistributionMessage")},i=Gt(e.user?.id),o=()=>r?.key?.remoteJid?.endsWith("@g.us")?"group":r?.key?.remoteJid?.endsWith("@s.whatsapp.net")?"private":r?.key?.remoteJid?.endsWith("@newsletter")?"channel":"private",a={},f=ze?.extractMessageContent(r?.message);if(a.roomId=Gt(r?.key?.remoteJid),a.roomType=o(),a.senderId=Gt(r?.participant||r?.key?.participant||r?.key?.remoteJid||r?.message?.participant),a.senderName=r?.pushName||r?.verifiedBizName,a.isMe=!!r?.key?.fromMe||!!i.match(a.senderId),a.isBot=!!r?.key?.id?.startsWith("BAE5"),a.isMedia=!1,a.isEphemeral=!1,a.isAuthor=!!t.authors.some(s=>!!s.toString().match(a.senderId.split("@")[0])),f){a.msgType=n(f);let s=ze?.extractMessageContent(f[a?.msgType])||f[a?.msgType];if(a.msgBody=s?.text||s?.caption||f?.conversation||s?.selectedButtonId||s?.singleSelectReply?.selectedRowId||s?.selectedId||s?.contentText||s?.selectedDisplayText||s?.title||s?.name||"",a.msgMentions=s?.contextInfo?.mentionedJid||[],a.msgExpiration=s?.contextInfo?.expiration||0,a.msgTimestamp=typeof r?.messageTimestamp=="number"?r?.messageTimestamp:r?.messageTimestamp?.low?r?.messageTimestamp?.low:r?.messageTimestamp?.high,a.isEphemeral=a.msgExpiration>0,a.isMedia=!!s?.mimetype||!!s?.thumbnailDirectPath,a?.isMedia&&Object.assign(a,{msgMedia:{url:s?.url,mimetype:s?.mimetype,size:s?.fileLength,height:s?.height||0,width:s?.width||0,isAnimated:/webp/i.test(s?.mimetype)?!!s?.isAnimated:!1,isAvatar:!!s?.isAvatar,isAiSticker:!!s?.isAiSticker,isLottie:!!s?.isLottie}}),s?.contextInfo?.quotedMessage){let u=e?.messages?.[a.roomId]?.get(s?.contextInfo?.stanzaId);a.msgQuoted=ae(e,t,u)}}return a.payload=()=>r,a.key=()=>r.key,a.msgType=os[a?.msgType],a.msgTimestamp=a.msgTimestamp*1e3,a}var as=class{client;listeners;pino;authPath;credsPath;storePath;logger;actions;phoneNumber;method;showLogs;markOnline;autoRead;authors;ignoreMe;constructor(t){this.phoneNumber=t.phoneNumber,this.method=t.method,this.showLogs=t.showLogs??!0,this.markOnline=t.markOnline??!0,this.autoRead=t.autoRead??!0,this.authors=t.authors??[],this.ignoreMe=t.ignoreMe??!0,this.pino=(0,cs.default)({enabled:!1}),this.authPath="./.zaileys/zaileys-auth/",this.credsPath=this.authPath+"creds.json",this.storePath=this.authPath+"store.json",this.listeners=new Map,this.initialize()}async initialize(){let{state:t,saveCreds:r}=await L.useMultiFileAuthState(this.authPath),n=L.makeInMemoryStore({});n.readFromFile(this.storePath),this.client=L.default({logger:this.pino,markOnlineOnConnect:this.markOnline,browser:L.Browsers.ubuntu("Safari"),auth:{creds:t.creds,keys:L.makeCacheableSignalKeyStore(t.keys,this.pino)},qrTimeout:6e4,userDevicesCache:new Fe.default,msgRetryCounterCache:new Fe.default,placeholderResendCache:new Fe.default,getMessage:async i=>n?(await n.loadMessage(i.remoteJid,i.id))?.message||void 0:L.proto.Message.fromObject({})}),this.actions=new le(this.client),this.logger=new De(this.client),this.logger.runSpinner("Initializing zaileys connection..."),n.bind(this.client.ev);for(let i in n)i!="groupMetadata"&&(this.client[i]=n[i]);this.client.ev.on("creds.update",r),await this.pairingCode(),this.handler(),this.client.authState.creds.registered&&setInterval(()=>{n.writeToFile(this.storePath)},5e3)}async pairingCode(){if(!this.client.authState.creds.registered&&this.method==="pairing"){let t=this.phoneNumber.toString().replace(/[^0-9]/g,"");Object.keys(L.PHONENUMBER_MCC).some(n=>t.startsWith(n))||(this.logger.stopSpinner("fail","Invalid phone number, please try again"),process.exit(0)),setTimeout(async()=>{try{let n=await this.client.requestPairingCode(t);n=n?.match(/.{1,4}/g)?.join("-")??"",this.logger.runSpinner(Ne`{blueBright.bold.underline Login with Pairing}`),this.logger.stopSpinner("info",Ne`Generating code: {bgYellowBright.bold.black ${n} }`),this.logger.stopSpinner("info",Ne`Code expired on ${new Date(Date.now()+160*1e3).toLocaleTimeString()}`)}catch(n){this.logger.stopSpinner("fail",n.toString()),process.exit(0)}},1e3)}}handler(){this.client?.ev?.on("connection.update",t=>{let{lastDisconnect:r,connection:n,qr:i,receivedPendingNotifications:o}=t;if(o&&this.client?.ev.flush(),n==="close"){let a=new ls.Boom(r?.error)?.output,f=a?.statusCode;f===L.DisconnectReason.badSession?(this.logger.stopSpinner("fail","Session file corrupted. Please delete session and scan again"),this.initialize()):f===L.DisconnectReason.connectionClosed?(this.logger.stopSpinner("warn","Connection closed. Reconnecting..."),this.initialize()):f===L.DisconnectReason.connectionLost?(this.logger.stopSpinner("warn","Lost connection to server. Reconnecting..."),this.initialize()):f===L.DisconnectReason.connectionReplaced?(this.logger.stopSpinner("fail","Connection replaced. Please close current session"),process.exit(0)):f===L.DisconnectReason.loggedOut?(this.logger.stopSpinner("fail","Device logged out. Please scan again"),process.exit(0)):f===L.DisconnectReason.restartRequired?(this.logger.stopSpinner("info","Restart required. Restarting..."),this.initialize()):f===L.DisconnectReason.timedOut?(this.logger.stopSpinner("warn","Connection timeout. Restarting..."),this.initialize()):f===L.DisconnectReason.multideviceMismatch?(this.logger.stopSpinner("fail","Multi-device mismatch. Please scan again"),process.exit(0)):f===1006?(this.logger.stopSpinner("fail","Error at internal system, trying to reconnect..."),this.initialize()):(this.logger.stopSpinner("warn",`Disconnected: ${a}`),this.initialize())}if(n==="connecting"&&this.logger.editSpinner("Connecting to WhatsApp..."),n==="open"){let a=this.client.authState.creds.me?.name||this.client.authState.creds.me?.verifiedName||this.client.authState.creds.me?.id;this.logger.stopSpinner("succeed","Connected to WhatsApp"),this.logger.stopSpinner("succeed",Ne`Connected as {yellowBright.bold ${a}}\n`)}}),this.client?.ev?.on("messages.upsert",t=>{let r=t.messages.map(n=>{let i=ae(this.client,this,n);if(!(i?.isMe&&this.ignoreMe))return i});this.showLogs&&r.map(async n=>await this.logger.msgLogs(n)),r.map(n=>n&&this.emit("message",n))})}emit(t,r){let n=this.listeners.get(t);n&&n(r)}on(t,r){this.listeners.set(t,r)}parseMentions(t){try{return t.match(/@\d+/g).map(n=>n.slice(1)+"@s.whatsapp.net")}catch{return[]}}async send(t,r){let n=await this.client.sendMessage(t.roomId,{text:r,mentions:this.parseMentions(r)});return ae(this.client,this,n)}async reply(t,r){let n=await this.client.sendMessage(t?.roomId,{text:r,mentions:this.parseMentions(r)},{quoted:t?.payload()});return ae(this.client,this,n)}async edit(t,r,n){let i=await this.client.sendMessage(t?.roomId,{text:n,mentions:this.parseMentions(n),edit:r.key()});return ae(this.client,this,i)}async reaction(t,r){let n=await this.client.sendMessage(t?.roomId,{react:{text:r,key:t.key()}});return ae(this.client,this,n)}};export{le as Actions,as as Client,De as Logger,os as MESSAGE_TYPE,ae as Serialize,ef as bLog,Ht as cLog,tf as cache,Gt as decodeJid,ss as logBlock,rf as sleep};
|