devicely 2.2.16 → 2.2.17
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/bin/devicely.js +1 -1
- package/lib/advanced-logger.js +1 -515
- package/lib/aiProviders.js +1 -1
- package/lib/aiProvidersConfig.js +1 -1
- package/lib/androidDeviceDetection.js +1 -1
- package/lib/appMappings.js +1 -1
- package/lib/commanderService.js +1 -1
- package/lib/deviceDetection.js +1 -1
- package/lib/devices.js +1 -1
- package/lib/doctor.js +1 -1
- package/lib/encryption.js +1 -1
- package/lib/executor.js +1 -1
- package/lib/frontend/asset-manifest.json +5 -5
- package/lib/frontend/index.html +1 -1
- package/lib/hybridAI.js +1 -1
- package/lib/intelligentLocatorService.js +1 -1
- package/lib/lightweightAI.js +1 -1
- package/lib/localBuiltInAI.js +1 -1
- package/lib/localBuiltInAI_backup.js +1 -1
- package/lib/localBuiltInAI_simple.js +1 -1
- package/lib/locatorStrategy.js +1 -1
- package/lib/logger-demo.js +1 -180
- package/lib/logger.js +1 -40
- package/lib/package.json +1 -1
- package/lib/quick-start-logger.js +1 -83
- package/lib/scriptLoader.js +1 -1
- package/lib/server.js +1 -1
- package/lib/tensorflowAI.js +1 -1
- package/lib/tinyAI.js +1 -1
- package/lib/universalSessionManager.js +1 -1
- package/package.json +2 -1
package/lib/advanced-logger.js
CHANGED
|
@@ -1,515 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Devicely Advanced Logging System v2.0
|
|
3
|
-
* 3-Tier Logging: Public → Developer → Creator
|
|
4
|
-
* Technologies: Consola + Custom Analytics + File Logging
|
|
5
|
-
* Security: Built-in sensitive data redaction
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const consola = require('consola');
|
|
9
|
-
const { v4: uuidv4 } = require('uuid');
|
|
10
|
-
const fs = require('fs').promises;
|
|
11
|
-
const path = require('path');
|
|
12
|
-
const os = require('os');
|
|
13
|
-
|
|
14
|
-
// ============================================================================
|
|
15
|
-
// LOGGING LEVELS & MODES
|
|
16
|
-
// ============================================================================
|
|
17
|
-
|
|
18
|
-
const LOG_LEVELS = {
|
|
19
|
-
PUBLIC: 0, // Clean user experience only
|
|
20
|
-
DEVELOPER: 1, // --debug flag
|
|
21
|
-
CREATOR: 2 // --dev-mode or CREATOR_MODE=true
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const CURRENT_LEVEL = (() => {
|
|
25
|
-
if (process.env.CREATOR_MODE === 'true' || process.argv.includes('--dev-mode')) {
|
|
26
|
-
return LOG_LEVELS.CREATOR;
|
|
27
|
-
}
|
|
28
|
-
if (process.argv.includes('--debug') || process.env.DEBUG === 'true' || process.env.NODE_ENV === 'development') {
|
|
29
|
-
return LOG_LEVELS.DEVELOPER;
|
|
30
|
-
}
|
|
31
|
-
return LOG_LEVELS.PUBLIC;
|
|
32
|
-
})();
|
|
33
|
-
|
|
34
|
-
// ============================================================================
|
|
35
|
-
// SENSITIVE DATA REDACTION
|
|
36
|
-
// ============================================================================
|
|
37
|
-
|
|
38
|
-
const SENSITIVE_PATTERNS = {
|
|
39
|
-
// Device identifiers
|
|
40
|
-
udid: /([a-fA-F0-9]{8}-[a-fA-F0-9]{16})/g,
|
|
41
|
-
serial: /([A-Z0-9]{10,})/g,
|
|
42
|
-
|
|
43
|
-
// Network & Auth
|
|
44
|
-
token: /(token|auth|key|secret|password)/i,
|
|
45
|
-
ip: /(\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b)/g,
|
|
46
|
-
port: /(localhost:\d+|127\.0\.0\.1:\d+)/g,
|
|
47
|
-
|
|
48
|
-
// Paths & URLs
|
|
49
|
-
homePath: new RegExp(os.homedir().replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g'),
|
|
50
|
-
|
|
51
|
-
// Command data
|
|
52
|
-
coordinates: /("x":\d+,"y":\d+)/g,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
function redactSensitiveData(data, level = CURRENT_LEVEL) {
|
|
56
|
-
if (level === LOG_LEVELS.CREATOR) return data; // No redaction for creator
|
|
57
|
-
|
|
58
|
-
let str = typeof data === 'object' ? JSON.stringify(data, null, 2) : String(data);
|
|
59
|
-
|
|
60
|
-
if (level === LOG_LEVELS.PUBLIC) {
|
|
61
|
-
// Heavy redaction for public
|
|
62
|
-
str = str.replace(SENSITIVE_PATTERNS.udid, '[DEVICE-ID]');
|
|
63
|
-
str = str.replace(SENSITIVE_PATTERNS.ip, '[IP-ADDRESS]');
|
|
64
|
-
str = str.replace(SENSITIVE_PATTERNS.port, '[ENDPOINT]');
|
|
65
|
-
str = str.replace(SENSITIVE_PATTERNS.homePath, '[USER-PATH]');
|
|
66
|
-
str = str.replace(SENSITIVE_PATTERNS.coordinates, '"x":[X],"y":[Y]');
|
|
67
|
-
} else if (level === LOG_LEVELS.DEVELOPER) {
|
|
68
|
-
// Partial redaction for developers
|
|
69
|
-
str = str.replace(SENSITIVE_PATTERNS.udid, (match) => `${match.slice(0, 8)}...${match.slice(-4)}`);
|
|
70
|
-
str = str.replace(SENSITIVE_PATTERNS.homePath, '~/[...]');
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return str;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// ============================================================================
|
|
77
|
-
// SESSION & PERFORMANCE TRACKING
|
|
78
|
-
// ============================================================================
|
|
79
|
-
|
|
80
|
-
class SessionTracker {
|
|
81
|
-
constructor() {
|
|
82
|
-
this.sessionId = uuidv4().split('-')[0];
|
|
83
|
-
this.startTime = Date.now();
|
|
84
|
-
this.devices = new Map();
|
|
85
|
-
this.commands = [];
|
|
86
|
-
this.performance = {
|
|
87
|
-
memory: [],
|
|
88
|
-
timing: new Map()
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
addDevice(deviceId, deviceInfo) {
|
|
93
|
-
this.devices.set(deviceId, {
|
|
94
|
-
...deviceInfo,
|
|
95
|
-
connectedAt: Date.now(),
|
|
96
|
-
commandCount: 0
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
addCommand(deviceId, command, duration) {
|
|
101
|
-
const cmd = {
|
|
102
|
-
deviceId,
|
|
103
|
-
command,
|
|
104
|
-
duration,
|
|
105
|
-
timestamp: Date.now(),
|
|
106
|
-
sessionTime: Date.now() - this.startTime
|
|
107
|
-
};
|
|
108
|
-
this.commands.push(cmd);
|
|
109
|
-
|
|
110
|
-
if (this.devices.has(deviceId)) {
|
|
111
|
-
this.devices.get(deviceId).commandCount++;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
startTimer(label) {
|
|
116
|
-
this.performance.timing.set(label, Date.now());
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
endTimer(label) {
|
|
120
|
-
const start = this.performance.timing.get(label);
|
|
121
|
-
if (start) {
|
|
122
|
-
const duration = Date.now() - start;
|
|
123
|
-
this.performance.timing.delete(label);
|
|
124
|
-
return duration;
|
|
125
|
-
}
|
|
126
|
-
return 0;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
getMemoryUsage() {
|
|
130
|
-
const usage = process.memoryUsage();
|
|
131
|
-
const memInfo = {
|
|
132
|
-
rss: Math.round(usage.rss / 1024 / 1024), // MB
|
|
133
|
-
heapUsed: Math.round(usage.heapUsed / 1024 / 1024),
|
|
134
|
-
heapTotal: Math.round(usage.heapTotal / 1024 / 1024),
|
|
135
|
-
external: Math.round(usage.external / 1024 / 1024),
|
|
136
|
-
timestamp: Date.now()
|
|
137
|
-
};
|
|
138
|
-
this.performance.memory.push(memInfo);
|
|
139
|
-
return memInfo;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
getStats() {
|
|
143
|
-
return {
|
|
144
|
-
sessionId: this.sessionId,
|
|
145
|
-
uptime: Date.now() - this.startTime,
|
|
146
|
-
deviceCount: this.devices.size,
|
|
147
|
-
totalCommands: this.commands.length,
|
|
148
|
-
avgCommandTime: this.commands.length ?
|
|
149
|
-
this.commands.reduce((sum, cmd) => sum + cmd.duration, 0) / this.commands.length : 0,
|
|
150
|
-
currentMemory: this.getMemoryUsage()
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const sessionTracker = new SessionTracker();
|
|
156
|
-
|
|
157
|
-
// ============================================================================
|
|
158
|
-
// FILE LOGGING SYSTEM
|
|
159
|
-
// ============================================================================
|
|
160
|
-
|
|
161
|
-
class FileLogger {
|
|
162
|
-
constructor() {
|
|
163
|
-
this.logDir = path.join(__dirname, '../../logs');
|
|
164
|
-
this.initPromise = this.initialize();
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
async initialize() {
|
|
168
|
-
try {
|
|
169
|
-
await fs.mkdir(this.logDir, { recursive: true });
|
|
170
|
-
await fs.mkdir(path.join(this.logDir, 'devices'), { recursive: true });
|
|
171
|
-
await fs.mkdir(path.join(this.logDir, 'sessions'), { recursive: true });
|
|
172
|
-
await fs.mkdir(path.join(this.logDir, 'performance'), { recursive: true });
|
|
173
|
-
} catch (error) {
|
|
174
|
-
// Continue without file logging if directory creation fails
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
async log(category, level, message, data = {}) {
|
|
179
|
-
if (CURRENT_LEVEL < LOG_LEVELS.DEVELOPER) return;
|
|
180
|
-
|
|
181
|
-
await this.initPromise;
|
|
182
|
-
|
|
183
|
-
const logEntry = {
|
|
184
|
-
timestamp: new Date().toISOString(),
|
|
185
|
-
sessionId: sessionTracker.sessionId,
|
|
186
|
-
level,
|
|
187
|
-
category,
|
|
188
|
-
message,
|
|
189
|
-
data: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? data : redactSensitiveData(data, CURRENT_LEVEL)
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
const logLine = JSON.stringify(logEntry) + '\n';
|
|
193
|
-
|
|
194
|
-
try {
|
|
195
|
-
// Write to main log
|
|
196
|
-
const mainLogFile = path.join(this.logDir, 'devicely-main.log');
|
|
197
|
-
await fs.appendFile(mainLogFile, logLine);
|
|
198
|
-
|
|
199
|
-
// Write to category-specific log
|
|
200
|
-
if (category) {
|
|
201
|
-
const categoryLogFile = path.join(this.logDir, `${category}.log`);
|
|
202
|
-
await fs.appendFile(categoryLogFile, logLine);
|
|
203
|
-
}
|
|
204
|
-
} catch (error) {
|
|
205
|
-
// Silent fail if file logging doesn't work
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const fileLogger = new FileLogger();
|
|
211
|
-
|
|
212
|
-
// ============================================================================
|
|
213
|
-
// ADVANCED DEVICELY LOGGER CLASS
|
|
214
|
-
// ============================================================================
|
|
215
|
-
|
|
216
|
-
class DevicelyLogger {
|
|
217
|
-
constructor(module) {
|
|
218
|
-
this.module = module;
|
|
219
|
-
this.deviceLoggers = new Map();
|
|
220
|
-
this.timers = new Map();
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// ========================================================================
|
|
224
|
-
// PUBLIC LEVEL METHODS (Always visible, user-friendly)
|
|
225
|
-
// ========================================================================
|
|
226
|
-
|
|
227
|
-
success(message, ...args) {
|
|
228
|
-
const cleanMessage = redactSensitiveData(message, LOG_LEVELS.PUBLIC);
|
|
229
|
-
// Don't add emoji prefix if message already contains emojis
|
|
230
|
-
const hasEmoji = /[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u.test(message);
|
|
231
|
-
consola.success(hasEmoji ? cleanMessage : `✅ ${cleanMessage}`);
|
|
232
|
-
|
|
233
|
-
fileLogger.log(this.module, 'success', message, { args });
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
info(message, ...args) {
|
|
237
|
-
const cleanMessage = redactSensitiveData(message, LOG_LEVELS.PUBLIC);
|
|
238
|
-
// Don't add emoji prefix if message already contains emojis
|
|
239
|
-
const hasEmoji = /[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u.test(message);
|
|
240
|
-
consola.info(hasEmoji ? cleanMessage : `📱 ${cleanMessage}`);
|
|
241
|
-
|
|
242
|
-
fileLogger.log(this.module, 'info', message, { args });
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
warn(message, ...args) {
|
|
246
|
-
const cleanMessage = redactSensitiveData(message, LOG_LEVELS.PUBLIC);
|
|
247
|
-
const cleanArgs = args.map(arg => redactSensitiveData(arg, LOG_LEVELS.PUBLIC));
|
|
248
|
-
// Don't add emoji prefix if message already contains emojis
|
|
249
|
-
const hasEmoji = /[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u.test(message);
|
|
250
|
-
consola.warn(hasEmoji ? `${cleanMessage}` : `⚠️ ${cleanMessage}`, ...cleanArgs);
|
|
251
|
-
|
|
252
|
-
fileLogger.log(this.module, 'warn', message, { args });
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
error(message, error, ...args) {
|
|
256
|
-
const cleanMessage = redactSensitiveData(message, LOG_LEVELS.PUBLIC);
|
|
257
|
-
// Don't add emoji prefix if message already contains emojis
|
|
258
|
-
const hasEmoji = /[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u.test(message);
|
|
259
|
-
consola.error(hasEmoji ? cleanMessage : `❌ ${cleanMessage}`, error?.message || error);
|
|
260
|
-
|
|
261
|
-
fileLogger.log(this.module, 'error', message, {
|
|
262
|
-
error: {
|
|
263
|
-
message: error?.message,
|
|
264
|
-
stack: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? error?.stack : '[REDACTED]',
|
|
265
|
-
name: error?.name
|
|
266
|
-
},
|
|
267
|
-
args
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// ========================================================================
|
|
272
|
-
// DEVELOPER LEVEL METHODS (--debug flag)
|
|
273
|
-
// ========================================================================
|
|
274
|
-
|
|
275
|
-
debug(message, data = {}) {
|
|
276
|
-
if (CURRENT_LEVEL < LOG_LEVELS.DEVELOPER) return;
|
|
277
|
-
|
|
278
|
-
const cleanMessage = redactSensitiveData(message, LOG_LEVELS.DEVELOPER);
|
|
279
|
-
const cleanData = redactSensitiveData(data, LOG_LEVELS.DEVELOPER);
|
|
280
|
-
|
|
281
|
-
consola.debug(`🔍 [${this.module}] ${cleanMessage}`, cleanData);
|
|
282
|
-
fileLogger.log(this.module, 'debug', message, { data });
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
command(deviceId, command, data = {}, duration = null) {
|
|
286
|
-
if (duration) {
|
|
287
|
-
sessionTracker.addCommand(deviceId, command, duration);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
const message = `Command: ${command}`;
|
|
291
|
-
|
|
292
|
-
if (CURRENT_LEVEL === LOG_LEVELS.PUBLIC) {
|
|
293
|
-
consola.info(`📱 Executing ${command}`);
|
|
294
|
-
} else if (CURRENT_LEVEL === LOG_LEVELS.DEVELOPER) {
|
|
295
|
-
const cleanData = redactSensitiveData(data, LOG_LEVELS.DEVELOPER);
|
|
296
|
-
const deviceDisplay = redactSensitiveData(deviceId, LOG_LEVELS.DEVELOPER);
|
|
297
|
-
consola.info(`📱 [${deviceDisplay}] ${command}${duration ? ` (${duration}ms)` : ''}`, cleanData);
|
|
298
|
-
} else {
|
|
299
|
-
// Creator mode - full details
|
|
300
|
-
consola.info(`📱 [${deviceId}] ${command}${duration ? ` (${duration}ms)` : ''}`, data);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
fileLogger.log('device', 'command', message, {
|
|
304
|
-
command,
|
|
305
|
-
data,
|
|
306
|
-
duration,
|
|
307
|
-
deviceId: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? deviceId : redactSensitiveData(deviceId, CURRENT_LEVEL)
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
network(method, url, statusCode, data = {}, duration = null) {
|
|
312
|
-
if (CURRENT_LEVEL < LOG_LEVELS.DEVELOPER) return;
|
|
313
|
-
|
|
314
|
-
const cleanUrl = redactSensitiveData(url, CURRENT_LEVEL);
|
|
315
|
-
const message = `${method} ${cleanUrl} → ${statusCode}`;
|
|
316
|
-
|
|
317
|
-
if (statusCode >= 400) {
|
|
318
|
-
consola.error(`🌐 ${message}${duration ? ` (${duration}ms)` : ''}`);
|
|
319
|
-
} else {
|
|
320
|
-
consola.debug(`🌐 ${message}${duration ? ` (${duration}ms)` : ''}`);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
fileLogger.log('network', 'http', 'HTTP Request', {
|
|
324
|
-
method,
|
|
325
|
-
url: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? url : cleanUrl,
|
|
326
|
-
statusCode,
|
|
327
|
-
duration,
|
|
328
|
-
data: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? data : redactSensitiveData(data, CURRENT_LEVEL)
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
// ========================================================================
|
|
333
|
-
// CREATOR LEVEL METHODS (Full system visibility)
|
|
334
|
-
// ========================================================================
|
|
335
|
-
|
|
336
|
-
trace(message, data = {}) {
|
|
337
|
-
if (CURRENT_LEVEL < LOG_LEVELS.CREATOR) return;
|
|
338
|
-
|
|
339
|
-
consola.debug(`🔧 [TRACE][${this.module}] ${message}`, data);
|
|
340
|
-
fileLogger.log(this.module, 'trace', message, { data });
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
security(event, details = {}) {
|
|
344
|
-
if (CURRENT_LEVEL < LOG_LEVELS.CREATOR) return;
|
|
345
|
-
|
|
346
|
-
consola.warn(`🔒 [SECURITY][${this.module}] ${event}`, details);
|
|
347
|
-
fileLogger.log('security', 'security', event, { details });
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
performance(metric, value, unit = 'ms') {
|
|
351
|
-
if (CURRENT_LEVEL >= LOG_LEVELS.DEVELOPER) {
|
|
352
|
-
consola.debug(`📊 ${metric}: ${value}${unit}`);
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
fileLogger.log('performance', 'metric', `Performance metric: ${metric}`, {
|
|
356
|
-
metric,
|
|
357
|
-
value,
|
|
358
|
-
unit,
|
|
359
|
-
timestamp: Date.now(),
|
|
360
|
-
sessionId: sessionTracker.sessionId
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
memory() {
|
|
365
|
-
if (CURRENT_LEVEL < LOG_LEVELS.CREATOR) return;
|
|
366
|
-
|
|
367
|
-
const usage = sessionTracker.getMemoryUsage();
|
|
368
|
-
consola.debug(`💾 Memory: ${usage.heapUsed}MB / ${usage.heapTotal}MB (RSS: ${usage.rss}MB)`);
|
|
369
|
-
|
|
370
|
-
this.performance('memory_heap_used', usage.heapUsed, 'MB');
|
|
371
|
-
this.performance('memory_rss', usage.rss, 'MB');
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
// ========================================================================
|
|
375
|
-
// DEVICE-SPECIFIC LOGGING
|
|
376
|
-
// ========================================================================
|
|
377
|
-
|
|
378
|
-
device(deviceId, deviceInfo = null) {
|
|
379
|
-
if (deviceInfo) {
|
|
380
|
-
sessionTracker.addDevice(deviceId, deviceInfo);
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
return {
|
|
384
|
-
connect: (info) => {
|
|
385
|
-
if (CURRENT_LEVEL === LOG_LEVELS.PUBLIC) {
|
|
386
|
-
consola.success(`✅ Connected to ${info.platform || 'device'}-${deviceId.slice(-5)}`);
|
|
387
|
-
} else if (CURRENT_LEVEL === LOG_LEVELS.DEVELOPER) {
|
|
388
|
-
const cleanDeviceId = redactSensitiveData(deviceId, CURRENT_LEVEL);
|
|
389
|
-
consola.success(`✅ Connected to ${cleanDeviceId}`, redactSensitiveData(info, CURRENT_LEVEL));
|
|
390
|
-
} else {
|
|
391
|
-
consola.success(`✅ Connected to ${deviceId}`, info);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
fileLogger.log('device', 'connect', 'Device connected', {
|
|
395
|
-
deviceId: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? deviceId : redactSensitiveData(deviceId, CURRENT_LEVEL),
|
|
396
|
-
info
|
|
397
|
-
});
|
|
398
|
-
},
|
|
399
|
-
|
|
400
|
-
disconnect: () => {
|
|
401
|
-
if (CURRENT_LEVEL === LOG_LEVELS.PUBLIC) {
|
|
402
|
-
consola.info(`📱 Device disconnected`);
|
|
403
|
-
} else {
|
|
404
|
-
const cleanDeviceId = redactSensitiveData(deviceId, CURRENT_LEVEL);
|
|
405
|
-
consola.info(`📱 ${cleanDeviceId} disconnected`);
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
fileLogger.log('device', 'disconnect', 'Device disconnected', {
|
|
409
|
-
deviceId: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? deviceId : redactSensitiveData(deviceId, CURRENT_LEVEL)
|
|
410
|
-
});
|
|
411
|
-
},
|
|
412
|
-
|
|
413
|
-
error: (message, error) => {
|
|
414
|
-
const cleanMessage = redactSensitiveData(message, LOG_LEVELS.PUBLIC);
|
|
415
|
-
consola.error(`❌ Device error: ${cleanMessage}`, error?.message || error);
|
|
416
|
-
|
|
417
|
-
fileLogger.log('device', 'error', 'Device error', {
|
|
418
|
-
message,
|
|
419
|
-
error: {
|
|
420
|
-
message: error?.message,
|
|
421
|
-
stack: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? error?.stack : '[REDACTED]'
|
|
422
|
-
},
|
|
423
|
-
deviceId: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? deviceId : redactSensitiveData(deviceId, CURRENT_LEVEL)
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
// ========================================================================
|
|
430
|
-
// PERFORMANCE TIMING
|
|
431
|
-
// ========================================================================
|
|
432
|
-
|
|
433
|
-
startTimer(label) {
|
|
434
|
-
this.timers.set(label, Date.now());
|
|
435
|
-
sessionTracker.startTimer(label);
|
|
436
|
-
|
|
437
|
-
if (CURRENT_LEVEL >= LOG_LEVELS.CREATOR) {
|
|
438
|
-
this.trace(`Timer started: ${label}`);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
endTimer(label, logResult = true) {
|
|
443
|
-
const startTime = this.timers.get(label);
|
|
444
|
-
const sessionDuration = sessionTracker.endTimer(label);
|
|
445
|
-
|
|
446
|
-
if (startTime) {
|
|
447
|
-
const duration = Date.now() - startTime;
|
|
448
|
-
this.timers.delete(label);
|
|
449
|
-
|
|
450
|
-
if (logResult && CURRENT_LEVEL >= LOG_LEVELS.DEVELOPER) {
|
|
451
|
-
this.performance(label, duration);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
return duration;
|
|
455
|
-
}
|
|
456
|
-
return sessionDuration;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
// ========================================================================
|
|
460
|
-
// HELPER METHODS
|
|
461
|
-
// ========================================================================
|
|
462
|
-
|
|
463
|
-
getSessionStats() {
|
|
464
|
-
return sessionTracker.getStats();
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
// ========================================================================
|
|
468
|
-
// STARTUP BANNER
|
|
469
|
-
// ========================================================================
|
|
470
|
-
|
|
471
|
-
static showStartupBanner() {
|
|
472
|
-
const modeNames = ['PUBLIC', 'DEVELOPER', 'CREATOR'];
|
|
473
|
-
const currentMode = modeNames[CURRENT_LEVEL];
|
|
474
|
-
|
|
475
|
-
if (CURRENT_LEVEL === LOG_LEVELS.PUBLIC) {
|
|
476
|
-
consola.info('🚀 Devicely starting...');
|
|
477
|
-
} else {
|
|
478
|
-
consola.box({
|
|
479
|
-
title: '🚀 Devicely Advanced Logging System',
|
|
480
|
-
message: [
|
|
481
|
-
`📊 Mode: ${currentMode}`,
|
|
482
|
-
`🔧 Session: ${sessionTracker.sessionId}`,
|
|
483
|
-
`💾 Memory tracking: ${CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? 'ON' : 'OFF'}`,
|
|
484
|
-
`🔒 Data redaction: ${CURRENT_LEVEL === LOG_LEVELS.PUBLIC ? 'FULL' : CURRENT_LEVEL === LOG_LEVELS.DEVELOPER ? 'PARTIAL' : 'OFF'}`,
|
|
485
|
-
`📁 File logging: ${CURRENT_LEVEL >= LOG_LEVELS.DEVELOPER ? 'ON' : 'OFF'}`,
|
|
486
|
-
'',
|
|
487
|
-
CURRENT_LEVEL === LOG_LEVELS.DEVELOPER ?
|
|
488
|
-
'💡 Use --dev-mode for full creator logging' :
|
|
489
|
-
'💡 Remove --debug for clean public mode'
|
|
490
|
-
].join('\n')
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
// ============================================================================
|
|
497
|
-
// INITIALIZATION
|
|
498
|
-
// ============================================================================
|
|
499
|
-
|
|
500
|
-
// Show startup banner
|
|
501
|
-
DevicelyLogger.showStartupBanner();
|
|
502
|
-
|
|
503
|
-
// ============================================================================
|
|
504
|
-
// EXPORTS
|
|
505
|
-
// ============================================================================
|
|
506
|
-
|
|
507
|
-
module.exports = {
|
|
508
|
-
DevicelyLogger,
|
|
509
|
-
LOG_LEVELS,
|
|
510
|
-
CURRENT_LEVEL,
|
|
511
|
-
sessionTracker,
|
|
512
|
-
|
|
513
|
-
// Backward compatibility
|
|
514
|
-
Logger: DevicelyLogger
|
|
515
|
-
};
|
|
1
|
+
function _0x4c51(){const _0x5f0589=['igrPC2nVBM5Ly3rLza','zMTxDLq','CuHvshi','rg15vxO','nZi0me5gvKPdwG','ufLWrxO','BM93','zgvIDwC','8j+tSsbfEgvJDxrPBMCG','Ahvkv2W','rgfcyxO','C2vZC2LVBLrYywnRzxi','C3rdzuS','z0H3r2q','uKHyEhi','zxHWB3j0CW','nte5ndaYsfrXqM9n','8j+AGcbezxzPy2vSEsbbzhzHBMnLzcbmB2DNAw5Nifn5C3rLBq','8j+mKca','CNnZ','rfHHEuq','zgv2AwnL','BgvUz3rO','yLHdvKe','ELfszxy','ChvZAa','vgHyEgO','EK1hrNa','ChjVBwLZzxm','C2vZC2LVBNm','uevJAMq','y1zizKC','tuTouuG','ENDvzMG','rvLjv2m','DxvPza','yxHRwfu','rgv2AwnLigrPC2nVBM5Ly3rLza','yxbWzw5KrMLSzq','Ag9TzvbHDgG','Dhj1zq','DLHUwLy','EejIBKm','zgf0yq','Cw1et0u','wwrjuuy','Eurlswm','Bwv0CMLJ','Bejhyw8','tg9Nz2vY','y29TBwfUzhm','BwvTB3j5','sfruucbszxf1zxn0','AxHvt1i','ywrKq29TBwfUza','zKzOCfO','yM94','uhzXBwC','mxW0Fdj8mhWZ','CfPLBMS','Aw5JBhvKzxm','w1vtrviTuefusf0','AxbgCLi','v09zAve','rg1zvvi','rMfyCgm','DwrPza','C2HVD1n0yxj0Dxbcyw5Uzxi','C1LvCe8','DMTwEMS','8j+tGsbgAwXLigXVz2DPBMC6ia','rgv2AwnLBhLmB2DNzxi','C0XKyLK','q29HzMe','DgLTzxjZ','CMvKDwnL','u0zwDKK','t0zg','C3vJy2vZCW','zfrOu0G','lI4U','zxz4wLO','zwzrALC','wMfdBw4','rhz1y3i','z2v0u2vZC2LVBLn0yxrZ','ENrHCKe','BwXduNm','BwvTB3j5vxnHz2u','Cwf5uvG','C2Lbvwm','u2TuANO','tgriDM0','8j+sOsbvC2uGls1KzxyTBw9KzsbMB3iGzNvSBcbJCMvHDg9YigXVz2DPBMC','DgLTAw5N','vfLiquy','CMXxt00','vK5oDum','FI9BlI4Uxq','zhvYyxrPB24','ugvYzM9YBwfUy2uGBwv0CMLJoIa','4PQG77Ipica','D2fYBG','z1D5vfi','z2v0twvTB3j5vxnHz2u','ueDiCvy','sev0DgK','CfPyv1K','w0Lqluferfjfu1nD','CMvJDxjZAxzL','su1Ns28','rKHrr3y','yMHQBKq','y29VCMrPBMf0zxm','zK5eDxu','zgvSzxrL','ELvSr2K','8j+uKIbeyxrHihjLzgfJDgLVBJOG','BxmP','s3zIwLy','8j+sVIbnzw1VCNK6ia','8j+tSsbezxzPy2uGzgLZy29UBMvJDgvK','quH2uKS','qKjOu1a','4P2mierLDMLJzsbLCNjVCJOG','v3n6rvm','vvbWCKK','w1jfrefdvevexq','CfboDvO','CgvYzM9YBwfUy2u','nte1nZC2mNHQEvDLzG','mte4zvPYtwfS','odG5nvD5Ee9WuW','q29TBwfUzdOG','te9hx0XfvKvmuW','rLvmta','ufvcteLd','8j+tIIa','ndK0mdu1ntrkBezpD2W','uefsveLbta','EvbryNO','yM5quNu','ALLTvLC','vgLTzxiGC3rHCNrLzdOG','AM9PBG','rwfJsg4','C3bSAxq','zgv2zwXVCg1LBNq','q2rSyKy','C2vJDxjPDhK','C1zZB1i','yxjNDG','C3rHCNruAw1L','Ag9TzwrPCG','Aw5MBW','C3rYAw5NAwz5','Ahr0Ca','Bg9N','8j+tSsa','zgv0ywLSCW','zeDUEeu','C2vZC2LVBKLK','ue5xrKy','8j+tSsbB','z2v0','yKTjD3K','ywrbv2O','tuiGkfjtuZOG','BMfTzq','nJnzvfDKy0e','BNzfq3u','zvjXvK0','rgv2AwnLignVBM5Ly3rLza','wNDYA1O','Aw5PDfbYB21PC2u','zgv2AwnLBhKTBwfPBI5SB2C','q3DKy2y','iNGIoLTyxsWIEsi6w1LD','C3rHy2S','q1nhv0y','Cg9YDa','Bw9KDwXL','A3bPB04','BwvTB3j5x3jZCW','iokgKIa','AgvHCfrVDgfS','4PYfienVBM5Ly3rLzcb0BYa','z2v0u3rHDhm','BfbZAey','DwHqyuy','CgXHDgzVCM0','DhjHy2u','wvj4qwi','zgLZy29UBMvJDa','DhvlC2W','CM91BMq','C3rHCNruAw1LCG','C2L6zq','vgzuqLG','tNjWsMO','8j+sOsbszw1VDMuGls1Kzwj1zYbMB3iGy2XLyw4GChvIBgLJig1Vzgu','BwvZC2fNzq','B2jQzwn0','8j+sVIbnzw1VCNKGDhjHy2TPBMC6ia','A3DMq1O','BwTKAxi','s0j2Cxe','ExD4uM4','DgvZDa','Chn4ALe','t3fcAvO','8j+uKIbBu0vdvvjjvfLDwW','Cxf1v1K','q05Hswe','C3LmvfK','CMvWBgfJzq','mZaWmZCXnwrXyMT4vG','swnhzMK','sNjYtfe','rgv2AwnLigvYCM9Y','tuiGlYa','z01kweW','CwTqzhK','z3L3uKe','rwLcz1e','DwjVq1K','C2rvCwi','zxjYB3i','uK9lyK4','r05WA2S','ugHlDwy','nhWZFdb8mNWX','wLbszeG','yu1duhy','y29TBwfUza','lMXVzW','C2XPy2u','AejPyw0','q1vwEMq','y1rgBeW','8j+uPYbBvfjbq0vDwW','tuiP','wKfisvy','y29UC29Syq','ruftt1a','nJy0m2jitLLHBa','revwruXpuevs','ls1KzxyTBw9Kzq','Dg9ju09tDhjPBMC','B2rkww8','q1jfqvrpuG','ogLfvwXLAa','wNbAyNu','uvjVs3K','ndm5mdbIBeLlwM0','t3vYA1m','zw5KvgLTzxi','BwvTB3j5x2HLyxbFDxnLza','AgvHCfvZzwq','wuHcyuS','CLfmuee','w0vorfbpsu5uxq','AgT5BvG','8j+uPYbtzxnZAw9UoIa','Bg9NrgLY','zMrcBeO','AgfZ','vfjLELK','sNvWy3K','zgv2AwnLCW','C2v0','ww1VqMm','sLPmsfG','CLDnD0e','zgHRwMm','qMDquuW','CfbKuKe','8j+tIIbnB2rLoIa','q1vsuKvovf9mrvzfta','yxjNCW','BMPdChe','w0rfvKLdrs1jrf0','Aw5PDgLHBgL6zq','qNjLvgu','uwrVvMe'];_0x4c51=function(){return _0x5f0589;};return _0x4c51();}const _0x33b216=_0x43ef;(function(_0xd4b37a,_0x4205bd){const _0x3f0465=_0x43ef,_0x58efb3=_0xd4b37a();while(!![]){try{const _0x92165b=-parseInt(_0x3f0465(0x126))/0x1+parseInt(_0x3f0465(0x199))/0x2*(-parseInt(_0x3f0465(0x19a))/0x3)+-parseInt(_0x3f0465(0xf4))/0x4*(parseInt(_0x3f0465(0xd1))/0x5)+-parseInt(_0x3f0465(0x198))/0x6+-parseInt(_0x3f0465(0xee))/0x7*(parseInt(_0x3f0465(0x11a))/0x8)+parseInt(_0x3f0465(0x1bf))/0x9*(parseInt(_0x3f0465(0xf7))/0xa)+parseInt(_0x3f0465(0x1a0))/0xb;if(_0x92165b===_0x4205bd)break;else _0x58efb3['push'](_0x58efb3['shift']());}catch(_0xe0a2cf){_0x58efb3['push'](_0x58efb3['shift']());}}}(_0x4c51,0xdda49));const consola=require(_0x33b216(0xec)),{v4:uuidv4}=require(_0x33b216(0x139)),fs=require('fs')[_0x33b216(0x132)],path=require('path'),os=require('os'),_0xfeb619={};_0xfeb619[_0x33b216(0x19e)]=0x0,_0xfeb619[_0x33b216(0xef)]=0x1,_0xfeb619[_0x33b216(0xf3)]=0x2;const LOG_LEVELS=_0xfeb619,CURRENT_LEVEL=((()=>{const _0x4f690b=_0x33b216,_0x43d1cc={};_0x43d1cc[_0x4f690b(0x119)]=function(_0x1825f7,_0x15bd52){return _0x1825f7>=_0x15bd52;},_0x43d1cc[_0x4f690b(0x135)]=function(_0x513c87,_0x2a8104){return _0x513c87-_0x2a8104;},_0x43d1cc[_0x4f690b(0x154)]=function(_0xc9f482,_0x4e7281){return _0xc9f482===_0x4e7281;},_0x43d1cc[_0x4f690b(0x184)]=_0x4f690b(0x13e),_0x43d1cc[_0x4f690b(0xdb)]=_0x4f690b(0xf0),_0x43d1cc[_0x4f690b(0xd3)]=_0x4f690b(0xf2),_0x43d1cc['LdHvm']='--debug',_0x43d1cc[_0x4f690b(0xc7)]=_0x4f690b(0x1a9),_0x43d1cc[_0x4f690b(0x12e)]=_0x4f690b(0x1a3);const _0x2c8a3a=_0x43d1cc;if(_0x2c8a3a[_0x4f690b(0x154)](process.env.CREATOR_MODE,_0x2c8a3a[_0x4f690b(0x184)])||process[_0x4f690b(0x1ad)][_0x4f690b(0x152)](_0x2c8a3a[_0x4f690b(0xdb)])){if('jJBWC'!==_0x2c8a3a['JrrLQ'])return LOG_LEVELS[_0x4f690b(0xf3)];else this[_0x4f690b(0x160)]['set'](_0x4ed43c,_0x11af08[_0x4f690b(0x11c)]()),_0xcb2ce0['startTimer'](_0x230ef4),_0x2c8a3a[_0x4f690b(0x119)](_0xcffffe,_0x2a8cc7[_0x4f690b(0xf3)])&&this['trace'](_0x4f690b(0x1a5)+_0x5cb539);}if(process[_0x4f690b(0x1ad)][_0x4f690b(0x152)](_0x2c8a3a[_0x4f690b(0x172)])||_0x2c8a3a[_0x4f690b(0x154)](process.env.DEBUG,'true')||_0x2c8a3a['ipFrR'](process.env.NODE_ENV,_0x2c8a3a[_0x4f690b(0xc7)])){if(_0x2c8a3a[_0x4f690b(0x154)](_0x2c8a3a[_0x4f690b(0x12e)],_0x2c8a3a[_0x4f690b(0x12e)]))return LOG_LEVELS[_0x4f690b(0xef)];else{const _0x1ec880=_0x2c8a3a[_0x4f690b(0x135)](_0x9e0a38[_0x4f690b(0x11c)](),_0x5e7938);return this[_0x4f690b(0x197)][_0x4f690b(0x174)]['delete'](_0x26febe),_0x1ec880;}}return LOG_LEVELS[_0x4f690b(0x19e)];})()),SENSITIVE_PATTERNS={'udid':/([a-fA-F0-9]{8}-[a-fA-F0-9]{16})/g,'serial':/([A-Z0-9]{10,})/g,'token':/(token|auth|key|secret|password)/i,'ip':/(\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b)/g,'port':/(localhost:\d+|127\.0\.0\.1:\d+)/g,'homePath':new RegExp(os[_0x33b216(0x1af)]()[_0x33b216(0xd0)](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'g'),'coordinates':/("x":\d+,"y":\d+)/g};function redactSensitiveData(_0x5240e8,_0x5692bf=CURRENT_LEVEL){const _0x4efee2=_0x33b216,_0xfda95f={'pPNuZ':function(_0x54cffd,_0x202720){return _0x54cffd-_0x202720;},'aAuJj':function(_0x4cd08d,_0x47578a){return _0x4cd08d>=_0x47578a;},'mlCRs':function(_0x4d5555,_0x47a5){return _0x4d5555===_0x47a5;},'EacHn':function(_0x5bffbc,_0x500d73,_0x4bc9a1){return _0x5bffbc(_0x500d73,_0x4bc9a1);},'MeBrF':'device','bKIwy':_0x4efee2(0xba),'zMGFp':_0x4efee2(0x13b),'sLdbY':function(_0x2cc4b8,_0x58e15f){return _0x2cc4b8>=_0x58e15f;},'DXayD':_0x4efee2(0x142),'SFVvI':_0x4efee2(0x112),'EASOP':'[ENDPOINT]','kpioN':_0x4efee2(0x153),'PYpEz':function(_0x39bdcf,_0x6b841e){return _0x39bdcf!==_0x6b841e;},'pZXWY':'dpDpx'};if(_0x5692bf===LOG_LEVELS[_0x4efee2(0xf3)])return _0x5240e8;let _0x3b818c=typeof _0x5240e8===_0x4efee2(0xc3)?JSON['stringify'](_0x5240e8,null,0x2):String(_0x5240e8);if(_0xfda95f['mlCRs'](_0x5692bf,LOG_LEVELS[_0x4efee2(0x19e)])){if(_0xfda95f[_0x4efee2(0x12a)]==='qmDOE')_0x3b818c=_0x3b818c['replace'](SENSITIVE_PATTERNS['udid'],_0xfda95f[_0x4efee2(0x162)]),_0x3b818c=_0x3b818c[_0x4efee2(0xd0)](SENSITIVE_PATTERNS['ip'],_0x4efee2(0x182)),_0x3b818c=_0x3b818c[_0x4efee2(0xd0)](SENSITIVE_PATTERNS['port'],_0xfda95f[_0x4efee2(0xed)]),_0x3b818c=_0x3b818c['replace'](SENSITIVE_PATTERNS[_0x4efee2(0x13d)],_0xfda95f[_0x4efee2(0xaf)]),_0x3b818c=_0x3b818c[_0x4efee2(0xd0)](SENSITIVE_PATTERNS[_0x4efee2(0x187)],'\x22x\x22:[X],\x22y\x22:[Y]');else{const _0x11b263=this[_0x4efee2(0x160)]['get'](_0x3f5ddc),_0x23ad76=_0x450c0e[_0x4efee2(0xf9)](_0x5767ea);if(_0x11b263){const _0x21cc15=_0xfda95f[_0x4efee2(0x196)](_0xe272c6['now'](),_0x11b263);return this[_0x4efee2(0x160)][_0x4efee2(0x189)](_0x9a0697),_0x4de48e&&_0xfda95f['aAuJj'](_0x4ca42e,_0xe73ed3[_0x4efee2(0xef)])&&this['performance'](_0x2fd896,_0x21cc15),_0x21cc15;}return _0x23ad76;}}else{if(_0xfda95f[_0x4efee2(0x16d)](_0x5692bf,LOG_LEVELS[_0x4efee2(0xef)])){if(_0xfda95f[_0x4efee2(0x11b)](_0xfda95f[_0x4efee2(0x181)],_0xfda95f['pZXWY'])){if(_0xfda95f[_0x4efee2(0x16d)](_0x1cf04a,_0xa5d075['PUBLIC']))_0x42a909[_0x4efee2(0x1b0)]('📱\x20Device\x20disconnected');else{const _0xf3081d=_0xfda95f[_0x4efee2(0x1a7)](_0x542f7c,_0x4f1441,_0x463460);_0x2daf43['info'](_0x4efee2(0x1b4)+_0xf3081d+'\x20disconnected');}_0x38e63[_0x4efee2(0x1b3)](_0xfda95f['MeBrF'],_0xfda95f[_0x4efee2(0x1bb)],_0xfda95f[_0x4efee2(0x131)],{'deviceId':_0xfda95f[_0x4efee2(0x15e)](_0x5a21f1,_0x43faf4[_0x4efee2(0xf3)])?_0xc05a0e:_0x2ffd4b(_0x10e780,_0x163bdc)});}else _0x3b818c=_0x3b818c[_0x4efee2(0xd0)](SENSITIVE_PATTERNS['udid'],_0x3a715a=>_0x3a715a[_0x4efee2(0xe5)](0x0,0x8)+'...'+_0x3a715a[_0x4efee2(0xe5)](-0x4)),_0x3b818c=_0x3b818c[_0x4efee2(0xd0)](SENSITIVE_PATTERNS['homePath'],_0x4efee2(0x178));}}return _0x3b818c;}class SessionTracker{constructor(){const _0x58c030=_0x33b216,_0x36295e={};_0x36295e[_0x58c030(0x136)]=_0x58c030(0x150);const _0x22be2c=_0x36295e,_0x2ae6a8=_0x22be2c[_0x58c030(0x136)][_0x58c030(0x1a8)]('|');let _0x41ddde=0x0;while(!![]){switch(_0x2ae6a8[_0x41ddde++]){case'0':this['commands']=[];continue;case'1':this[_0x58c030(0x1b7)]=uuidv4()['split']('-')[0x0];continue;case'2':this[_0x58c030(0x106)]=new Map();continue;case'3':this['performance']={'memory':[],'timing':new Map()};continue;case'4':this[_0x58c030(0x1ae)]=Date[_0x58c030(0x11c)]();continue;}break;}}['addDevice'](_0x4389a7,_0x50ab8a){const _0x108fa8=_0x33b216;this[_0x108fa8(0x106)][_0x108fa8(0x107)](_0x4389a7,{..._0x50ab8a,'connectedAt':Date[_0x108fa8(0x11c)](),'commandCount':0x0});}[_0x33b216(0x14c)](_0x38dc82,_0x4a84a2,_0x3f6a31){const _0x20b74f=_0x33b216,_0x5109e8={};_0x5109e8[_0x20b74f(0x186)]=function(_0x9232da,_0x2607ec){return _0x9232da-_0x2607ec;};const _0x1860f4=_0x5109e8,_0x6ae3bd={'deviceId':_0x38dc82,'command':_0x4a84a2,'duration':_0x3f6a31,'timestamp':Date[_0x20b74f(0x11c)](),'sessionTime':_0x1860f4['bhjnD'](Date[_0x20b74f(0x11c)](),this['startTime'])};this['commands'][_0x20b74f(0x12f)](_0x6ae3bd),this[_0x20b74f(0x106)][_0x20b74f(0x103)](_0x38dc82)&&this[_0x20b74f(0x106)][_0x20b74f(0x1ba)](_0x38dc82)['commandCount']++;}[_0x33b216(0xbd)](_0x19ee54){const _0x371fa1=_0x33b216;this[_0x371fa1(0x197)]['timing'][_0x371fa1(0x107)](_0x19ee54,Date[_0x371fa1(0x11c)]());}[_0x33b216(0xf9)](_0x198a75){const _0x1a42b0=_0x33b216,_0x37bd55={};_0x37bd55[_0x1a42b0(0x10c)]=function(_0x476280,_0x341505){return _0x476280-_0x341505;};const _0x5b2644=_0x37bd55,_0x5e76ad=this[_0x1a42b0(0x197)]['timing']['get'](_0x198a75);if(_0x5e76ad){const _0x87b445=_0x5b2644[_0x1a42b0(0x10c)](Date[_0x1a42b0(0x11c)](),_0x5e76ad);return this['performance'][_0x1a42b0(0x174)][_0x1a42b0(0x189)](_0x198a75),_0x87b445;}return 0x0;}[_0x33b216(0x17e)](){const _0x6d93b=_0x33b216,_0x2ec4ef={};_0x2ec4ef['uhPaF']=function(_0x52962e,_0x61e78a){return _0x52962e/_0x61e78a;},_0x2ec4ef[_0x6d93b(0x1c0)]=function(_0x5c6ae7,_0x32faac){return _0x5c6ae7/_0x32faac;};const _0x23fdbc=_0x2ec4ef,_0x4a4785=process[_0x6d93b(0x16e)](),_0x3bc730={'rss':Math['round'](_0x23fdbc[_0x6d93b(0xb6)](_0x4a4785['rss']/0x400,0x400)),'heapUsed':Math['round'](_0x23fdbc['uhPaF'](_0x4a4785[_0x6d93b(0xfb)],0x400)/0x400),'heapTotal':Math[_0x6d93b(0xbc)](_0x23fdbc[_0x6d93b(0x1c0)](_0x23fdbc[_0x6d93b(0xb6)](_0x4a4785['heapTotal'],0x400),0x400)),'external':Math[_0x6d93b(0xbc)](_0x23fdbc[_0x6d93b(0xb6)](_0x4a4785['external']/0x400,0x400)),'timestamp':Date[_0x6d93b(0x11c)]()};return this[_0x6d93b(0x197)][_0x6d93b(0x149)]['push'](_0x3bc730),_0x3bc730;}['getStats'](){const _0x20a1b8=_0x33b216,_0x4a6d67={};_0x4a6d67[_0x20a1b8(0xd2)]=function(_0x1913cc,_0x40e9e0){return _0x1913cc-_0x40e9e0;},_0x4a6d67['FaXpc']=function(_0x4fc60b,_0x11a915){return _0x4fc60b/_0x11a915;};const _0x1308d9=_0x4a6d67;return{'sessionId':this[_0x20a1b8(0x1b7)],'uptime':_0x1308d9['IcGfi'](Date['now'](),this[_0x20a1b8(0x1ae)]),'deviceCount':this[_0x20a1b8(0x106)][_0x20a1b8(0xbe)],'totalCommands':this[_0x20a1b8(0x148)][_0x20a1b8(0x12c)],'avgCommandTime':this[_0x20a1b8(0x148)][_0x20a1b8(0x12c)]?_0x1308d9[_0x20a1b8(0x157)](this[_0x20a1b8(0x148)][_0x20a1b8(0x161)]((_0x4b6438,_0x14d88b)=>_0x4b6438+_0x14d88b[_0x20a1b8(0x179)],0x0),this[_0x20a1b8(0x148)][_0x20a1b8(0x12c)]):0x0,'currentMemory':this[_0x20a1b8(0x17e)]()};}}const sessionTracker=new SessionTracker();class FileLogger{constructor(){const _0x1a425e=_0x33b216,_0x5ed32f={};_0x5ed32f[_0x1a425e(0xd7)]='../../logs';const _0x1cde9f=_0x5ed32f;this[_0x1a425e(0x101)]=path[_0x1a425e(0x1a6)](__dirname,_0x1cde9f[_0x1a425e(0xd7)]),this[_0x1a425e(0xa7)]=this['initialize']();}async[_0x33b216(0x113)](){const _0x451213=_0x33b216,_0x374413={};_0x374413[_0x451213(0xd9)]=_0x451213(0x106),_0x374413['jYmVW']=_0x451213(0x197);const _0x27cc1d=_0x374413;try{const _0x468d1d={};_0x468d1d[_0x451213(0x183)]=!![],await fs[_0x451213(0xc6)](this[_0x451213(0x101)],_0x468d1d);const _0x1d6d77={};_0x1d6d77[_0x451213(0x183)]=!![],await fs[_0x451213(0xc6)](path['join'](this[_0x451213(0x101)],_0x27cc1d[_0x451213(0xd9)]),_0x1d6d77);const _0x507f22={};_0x507f22['recursive']=!![],await fs[_0x451213(0xc6)](path['join'](this[_0x451213(0x101)],_0x451213(0x133)),_0x507f22);const _0x34bdd2={};_0x34bdd2['recursive']=!![],await fs[_0x451213(0xc6)](path[_0x451213(0x1a6)](this[_0x451213(0x101)],_0x27cc1d[_0x451213(0x1a4)]),_0x34bdd2);}catch(_0x518575){}}async[_0x33b216(0x1b3)](_0x909316,_0x31c2f4,_0x4a0d04,_0x2b0625={}){const _0xe6eeb5=_0x33b216,_0x23bb7e={'lPshF':function(_0x5b4524,_0x3ad983,_0x3e3350){return _0x5b4524(_0x3ad983,_0x3e3350);},'PhKuf':_0xe6eeb5(0x12b),'OurkS':_0xe6eeb5(0xdc),'evxZZ':_0xe6eeb5(0xd4),'CNaIa':'[REDACTED]','DMeup':function(_0x4cfe3a,_0x3e583c){return _0x4cfe3a>=_0x3e583c;},'zwUfh':function(_0x5517d3,_0x5d1a87){return _0x5517d3!==_0x5d1a87;},'Jupcy':'Qwblc','yScYo':_0xe6eeb5(0xfc)};if(CURRENT_LEVEL<LOG_LEVELS['DEVELOPER'])return;await this[_0xe6eeb5(0xa7)];const _0x55f3a3={'timestamp':new Date()[_0xe6eeb5(0xf1)](),'sessionId':sessionTracker[_0xe6eeb5(0x1b7)],'level':_0x31c2f4,'category':_0x909316,'message':_0x4a0d04,'data':_0x23bb7e['DMeup'](CURRENT_LEVEL,LOG_LEVELS[_0xe6eeb5(0xf3)])?_0x2b0625:_0x23bb7e['lPshF'](redactSensitiveData,_0x2b0625,CURRENT_LEVEL)},_0x53f6da=JSON[_0xe6eeb5(0x1b1)](_0x55f3a3)+'\x0a';try{if(_0x23bb7e[_0xe6eeb5(0x137)](_0x23bb7e[_0xe6eeb5(0x105)],_0x23bb7e['yScYo'])){const _0x3aea6b=path[_0xe6eeb5(0x1a6)](this[_0xe6eeb5(0x101)],_0xe6eeb5(0xa8));await fs[_0xe6eeb5(0x13c)](_0x3aea6b,_0x53f6da);if(_0x909316){const _0x26e836=path[_0xe6eeb5(0x1a6)](this[_0xe6eeb5(0x101)],_0x909316+_0xe6eeb5(0xe4));await fs['appendFile'](_0x26e836,_0x53f6da);}}else{const _0x4d332f=_0x23bb7e['lPshF'](_0x398344,_0x5007e3,_0x5eaeb1['PUBLIC']);_0x45c8f0['error'](_0xe6eeb5(0x192)+_0x4d332f,_0x33eedf?.[_0xe6eeb5(0xc2)]||_0x508ec9),_0x18fd3a[_0xe6eeb5(0x1b3)](_0x23bb7e[_0xe6eeb5(0xdf)],_0x23bb7e[_0xe6eeb5(0xf8)],_0x23bb7e[_0xe6eeb5(0x167)],{'message':_0x30e6b1,'error':{'message':_0x20f98e?.['message'],'stack':_0x10b050>=_0x311e56['CREATOR']?_0x1821a6?.[_0xe6eeb5(0xab)]:_0x23bb7e[_0xe6eeb5(0xce)]},'deviceId':_0x368e86>=_0x2eb6c8[_0xe6eeb5(0xf3)]?_0x3e97de:_0x23bb7e[_0xe6eeb5(0xb5)](_0x2aa4aa,_0x2acc8a,_0x40c9bd)});}}catch(_0x55ae3f){}}}function _0x43ef(_0xa4e875,_0x4510fc){_0xa4e875=_0xa4e875-0xa4;const _0x4c5187=_0x4c51();let _0x43efb7=_0x4c5187[_0xa4e875];if(_0x43ef['UTzRFP']===undefined){var _0x50f8e0=function(_0x42c2cb){const _0x47598d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x373bf6='',_0x32ac0e='';for(let _0x49b158=0x0,_0x175478,_0x52a4b4,_0x3e48ac=0x0;_0x52a4b4=_0x42c2cb['charAt'](_0x3e48ac++);~_0x52a4b4&&(_0x175478=_0x49b158%0x4?_0x175478*0x40+_0x52a4b4:_0x52a4b4,_0x49b158++%0x4)?_0x373bf6+=String['fromCharCode'](0xff&_0x175478>>(-0x2*_0x49b158&0x6)):0x0){_0x52a4b4=_0x47598d['indexOf'](_0x52a4b4);}for(let _0x241e6a=0x0,_0x191e9c=_0x373bf6['length'];_0x241e6a<_0x191e9c;_0x241e6a++){_0x32ac0e+='%'+('00'+_0x373bf6['charCodeAt'](_0x241e6a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x32ac0e);};_0x43ef['zuABwl']=_0x50f8e0,_0x43ef['jNvEZy']={},_0x43ef['UTzRFP']=!![];}const _0x57786d=_0x4c5187[0x0],_0x48912e=_0xa4e875+_0x57786d,_0xcb70ec=_0x43ef['jNvEZy'][_0x48912e];return!_0xcb70ec?(_0x43efb7=_0x43ef['zuABwl'](_0x43efb7),_0x43ef['jNvEZy'][_0x48912e]=_0x43efb7):_0x43efb7=_0xcb70ec,_0x43efb7;}const fileLogger=new FileLogger();class DevicelyLogger{constructor(_0xf1b988){const _0x411aec=_0x33b216;this[_0x411aec(0xae)]=_0xf1b988,this['deviceLoggers']=new Map(),this[_0x411aec(0x160)]=new Map();}[_0x33b216(0x164)](_0x291347,..._0x213ced){const _0x23935a=_0x33b216,_0x36266b={'ztarA':function(_0x596b7e,_0x555f14,_0x4e06ef){return _0x596b7e(_0x555f14,_0x4e06ef);}},_0x59bf01=_0x36266b[_0x23935a(0x16c)](redactSensitiveData,_0x291347,LOG_LEVELS[_0x23935a(0x19e)]),_0x1b4a02=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u[_0x23935a(0xc9)](_0x291347);consola[_0x23935a(0x164)](_0x1b4a02?_0x59bf01:'✅\x20'+_0x59bf01);const _0x4cc0f9={};_0x4cc0f9[_0x23935a(0x110)]=_0x213ced,fileLogger[_0x23935a(0x1b3)](this[_0x23935a(0xae)],_0x23935a(0x164),_0x291347,_0x4cc0f9);}[_0x33b216(0x1b0)](_0x517c49,..._0x47fa5e){const _0x468a7b=_0x33b216,_0x4194fe={};_0x4194fe[_0x468a7b(0xff)]=_0x468a7b(0x1b0);const _0x143f17=_0x4194fe,_0x48db11=redactSensitiveData(_0x517c49,LOG_LEVELS[_0x468a7b(0x19e)]),_0x4d4483=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u[_0x468a7b(0xc9)](_0x517c49);consola[_0x468a7b(0x1b0)](_0x4d4483?_0x48db11:_0x468a7b(0x1b4)+_0x48db11);const _0x1cb276={};_0x1cb276[_0x468a7b(0x110)]=_0x47fa5e,fileLogger[_0x468a7b(0x1b3)](this['module'],_0x143f17['hkymX'],_0x517c49,_0x1cb276);}[_0x33b216(0x17c)](_0x23af2b,..._0x3d944b){const _0x3434b1=_0x33b216,_0x29c926={'EJSWw':function(_0x45e2c6,_0x556f82,_0x2d810e){return _0x45e2c6(_0x556f82,_0x2d810e);}},_0x36fd31=_0x29c926['EJSWw'](redactSensitiveData,_0x23af2b,LOG_LEVELS['PUBLIC']),_0x4a851b=_0x3d944b['map'](_0x3448cf=>redactSensitiveData(_0x3448cf,LOG_LEVELS[_0x3434b1(0x19e)])),_0x4f2ee9=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u[_0x3434b1(0xc9)](_0x23af2b);consola[_0x3434b1(0x17c)](_0x4f2ee9?''+_0x36fd31:_0x3434b1(0x17b)+_0x36fd31,..._0x4a851b);const _0x33228f={};_0x33228f[_0x3434b1(0x110)]=_0x3d944b,fileLogger['log'](this[_0x3434b1(0xae)],_0x3434b1(0x17c),_0x23af2b,_0x33228f);}[_0x33b216(0xdc)](_0x50d1ae,_0x23f195,..._0xccf642){const _0x3b37a9=_0x33b216,_0x42d4c5={'gHwGd':function(_0x6afdc,_0x46233f,_0x426dcb){return _0x6afdc(_0x46233f,_0x426dcb);},'hBiam':_0x3b37a9(0xdc),'sVsoR':function(_0x277731,_0x255232){return _0x277731>=_0x255232;},'TYHAF':_0x3b37a9(0x195)},_0x3b350c=_0x42d4c5[_0x3b37a9(0x123)](redactSensitiveData,_0x50d1ae,LOG_LEVELS[_0x3b37a9(0x19e)]),_0x15ffe5=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u[_0x3b37a9(0xc9)](_0x50d1ae);consola['error'](_0x15ffe5?_0x3b350c:'❌\x20'+_0x3b350c,_0x23f195?.['message']||_0x23f195),fileLogger[_0x3b37a9(0x1b3)](this[_0x3b37a9(0xae)],_0x42d4c5[_0x3b37a9(0xe6)],_0x50d1ae,{'error':{'message':_0x23f195?.[_0x3b37a9(0xc2)],'stack':_0x42d4c5[_0x3b37a9(0x1ac)](CURRENT_LEVEL,LOG_LEVELS[_0x3b37a9(0xf3)])?_0x23f195?.['stack']:_0x42d4c5[_0x3b37a9(0x175)],'name':_0x23f195?.[_0x3b37a9(0x1be)]},'args':_0xccf642});}[_0x33b216(0x11d)](_0x49f32d,_0x5bae22={}){const _0x148c1b=_0x33b216,_0x2540df={'DmYUR':function(_0x2dc265,_0x59f5a3){return _0x2dc265<_0x59f5a3;},'gMJXL':function(_0x1c3acc,_0x1c72c0,_0x24264d){return _0x1c3acc(_0x1c72c0,_0x24264d);},'WSjBt':_0x148c1b(0x11d)};if(_0x2540df[_0x148c1b(0x156)](CURRENT_LEVEL,LOG_LEVELS[_0x148c1b(0xef)]))return;const _0x1c0245=_0x2540df[_0x148c1b(0xd6)](redactSensitiveData,_0x49f32d,LOG_LEVELS[_0x148c1b(0xef)]),_0x2e6eff=redactSensitiveData(_0x5bae22,LOG_LEVELS['DEVELOPER']);consola[_0x148c1b(0x11d)]('🔍\x20['+this[_0x148c1b(0xae)]+']\x20'+_0x1c0245,_0x2e6eff);const _0x508815={};_0x508815['data']=_0x5bae22,fileLogger[_0x148c1b(0x1b3)](this[_0x148c1b(0xae)],_0x2540df['WSjBt'],_0x49f32d,_0x508815);}['command'](_0x51f22d,_0x22ba0b,_0x3c0ed2={},_0x46576e=null){const _0x4ed799=_0x33b216,_0x101833={'EYIWc':function(_0x24d0e7,_0x202d24){return _0x24d0e7===_0x202d24;},'vepBC':function(_0x58e17c,_0x147a5b,_0x402f4b){return _0x58e17c(_0x147a5b,_0x402f4b);},'QRoKy':function(_0x50dec4,_0x588f84,_0x5b42cc){return _0x50dec4(_0x588f84,_0x5b42cc);},'HEtti':_0x4ed799(0x12b),'fFhpZ':_0x4ed799(0xe3)};_0x46576e&&sessionTracker['addCommand'](_0x51f22d,_0x22ba0b,_0x46576e);const _0x16cf71=_0x4ed799(0x19b)+_0x22ba0b;if(_0x101833['EYIWc'](CURRENT_LEVEL,LOG_LEVELS['PUBLIC']))consola[_0x4ed799(0x1b0)](_0x4ed799(0x11e)+_0x22ba0b);else{if(_0x101833[_0x4ed799(0x138)](CURRENT_LEVEL,LOG_LEVELS['DEVELOPER'])){const _0x102846=_0x101833['vepBC'](redactSensitiveData,_0x3c0ed2,LOG_LEVELS[_0x4ed799(0xef)]),_0x5f5691=_0x101833[_0x4ed799(0xf6)](redactSensitiveData,_0x51f22d,LOG_LEVELS[_0x4ed799(0xef)]);consola[_0x4ed799(0x1b0)]('📱\x20['+_0x5f5691+']\x20'+_0x22ba0b+(_0x46576e?'\x20('+_0x46576e+_0x4ed799(0x18c):''),_0x102846);}else consola['info'](_0x4ed799(0x1b9)+_0x51f22d+']\x20'+_0x22ba0b+(_0x46576e?'\x20('+_0x46576e+_0x4ed799(0x18c):''),_0x3c0ed2);}fileLogger['log'](_0x101833[_0x4ed799(0x180)],_0x101833[_0x4ed799(0x14d)],_0x16cf71,{'command':_0x22ba0b,'data':_0x3c0ed2,'duration':_0x46576e,'deviceId':CURRENT_LEVEL>=LOG_LEVELS[_0x4ed799(0xf3)]?_0x51f22d:_0x101833['vepBC'](redactSensitiveData,_0x51f22d,CURRENT_LEVEL)});}['network'](_0x147cc9,_0x3ba90e,_0x415f2d,_0x305fab={},_0x22d9cd=null){const _0x5619a0=_0x33b216,_0x103f1d={'dThSH':function(_0x3bdd64,_0xf19111,_0xb2b7e7){return _0x3bdd64(_0xf19111,_0xb2b7e7);},'Dvucr':function(_0x317488,_0x1e1fd3){return _0x317488>=_0x1e1fd3;},'NrpJj':'network','rlWOM':_0x5619a0(0x1b2),'Cwdcf':_0x5619a0(0x14a)};if(CURRENT_LEVEL<LOG_LEVELS[_0x5619a0(0xef)])return;const _0x1de18e=_0x103f1d[_0x5619a0(0x165)](redactSensitiveData,_0x3ba90e,CURRENT_LEVEL),_0x39bb92=_0x147cc9+'\x20'+_0x1de18e+_0x5619a0(0xb1)+_0x415f2d;_0x103f1d[_0x5619a0(0x16a)](_0x415f2d,0x190)?consola[_0x5619a0(0xdc)](_0x5619a0(0x128)+_0x39bb92+(_0x22d9cd?'\x20('+_0x22d9cd+_0x5619a0(0x18c):'')):consola[_0x5619a0(0x11d)](_0x5619a0(0x128)+_0x39bb92+(_0x22d9cd?'\x20('+_0x22d9cd+_0x5619a0(0x18c):'')),fileLogger[_0x5619a0(0x1b3)](_0x103f1d[_0x5619a0(0xc0)],_0x103f1d[_0x5619a0(0x176)],_0x103f1d[_0x5619a0(0xa9)],{'method':_0x147cc9,'url':CURRENT_LEVEL>=LOG_LEVELS['CREATOR']?_0x3ba90e:_0x1de18e,'statusCode':_0x415f2d,'duration':_0x22d9cd,'data':CURRENT_LEVEL>=LOG_LEVELS[_0x5619a0(0xf3)]?_0x305fab:redactSensitiveData(_0x305fab,CURRENT_LEVEL)});}['trace'](_0x178e90,_0x3accdc={}){const _0x214885=_0x33b216,_0x20ab09={};_0x20ab09[_0x214885(0x190)]=function(_0x14948e,_0x2013b9){return _0x14948e<_0x2013b9;},_0x20ab09[_0x214885(0x15a)]=_0x214885(0xb8);const _0x5b5db7=_0x20ab09;if(_0x5b5db7[_0x214885(0x190)](CURRENT_LEVEL,LOG_LEVELS[_0x214885(0xf3)]))return;consola[_0x214885(0x11d)](_0x214885(0xe9)+this[_0x214885(0xae)]+']\x20'+_0x178e90,_0x3accdc);const _0x431c83={};_0x431c83[_0x214885(0x141)]=_0x3accdc,fileLogger[_0x214885(0x1b3)](this['module'],_0x5b5db7[_0x214885(0x15a)],_0x178e90,_0x431c83);}['security'](_0x1ef3eb,_0x180afa={}){const _0x440ff6=_0x33b216,_0x4dc54b={};_0x4dc54b['KvbZV']=_0x440ff6(0x1ab);const _0x2e60fb=_0x4dc54b;if(CURRENT_LEVEL<LOG_LEVELS[_0x440ff6(0xf3)])return;consola[_0x440ff6(0x17c)](_0x440ff6(0xcc)+this[_0x440ff6(0xae)]+']\x20'+_0x1ef3eb,_0x180afa);const _0x433bd7={};_0x433bd7[_0x440ff6(0x1b5)]=_0x180afa,fileLogger[_0x440ff6(0x1b3)](_0x440ff6(0x1ab),_0x2e60fb[_0x440ff6(0x18d)],_0x1ef3eb,_0x433bd7);}[_0x33b216(0x197)](_0x3f2555,_0x3d18fd,_0x15c516='ms'){const _0x5a8903=_0x33b216,_0x5a145a={};_0x5a145a['BjuOw']=function(_0x471a56,_0x75741d){return _0x471a56>=_0x75741d;},_0x5a145a[_0x5a8903(0xe8)]=function(_0x3d988b,_0x4ab816){return _0x3d988b===_0x4ab816;},_0x5a145a[_0x5a8903(0x15b)]=_0x5a8903(0xd8),_0x5a145a[_0x5a8903(0xfd)]=_0x5a8903(0x197),_0x5a145a[_0x5a8903(0x170)]=_0x5a8903(0x145);const _0x2048cd=_0x5a145a;if(_0x2048cd['BjuOw'](CURRENT_LEVEL,LOG_LEVELS[_0x5a8903(0xef)])){if(_0x2048cd[_0x5a8903(0xe8)](_0x2048cd['vkVzk'],_0x2048cd['vkVzk']))consola[_0x5a8903(0x11d)](_0x5a8903(0x19f)+_0x3f2555+':\x20'+_0x3d18fd+_0x15c516);else return _0x535139[_0x5a8903(0xb4)]();}fileLogger[_0x5a8903(0x1b3)](_0x2048cd[_0x5a8903(0xfd)],_0x2048cd[_0x5a8903(0x170)],_0x5a8903(0x17a)+_0x3f2555,{'metric':_0x3f2555,'value':_0x3d18fd,'unit':_0x15c516,'timestamp':Date['now'](),'sessionId':sessionTracker[_0x5a8903(0x1b7)]});}[_0x33b216(0x149)](){const _0x17f656=_0x33b216,_0x43bade={};_0x43bade[_0x17f656(0xda)]=function(_0x334f37,_0x13d1bb){return _0x334f37<_0x13d1bb;},_0x43bade[_0x17f656(0x1aa)]=_0x17f656(0xfa),_0x43bade['yPQbz']=_0x17f656(0xb0);const _0xe7987b=_0x43bade;if(_0xe7987b['uboCY'](CURRENT_LEVEL,LOG_LEVELS[_0x17f656(0xf3)]))return;const _0x4d3826=sessionTracker[_0x17f656(0x17e)]();consola[_0x17f656(0x11d)](_0x17f656(0x18e)+_0x4d3826[_0x17f656(0xfb)]+_0x17f656(0xd5)+_0x4d3826[_0x17f656(0xb2)]+_0x17f656(0x1bd)+_0x4d3826[_0x17f656(0x129)]+_0x17f656(0xea)),this['performance'](_0xe7987b[_0x17f656(0x1aa)],_0x4d3826['heapUsed'],'MB'),this[_0x17f656(0x197)](_0xe7987b[_0x17f656(0x1a2)],_0x4d3826[_0x17f656(0x129)],'MB');}['device'](_0x47bc40,_0x346ee7=null){const _0x2186fd=_0x33b216,_0x4c6c58={'uDJqy':function(_0xfaea2,_0x659639){return _0xfaea2-_0x659639;},'psxjQ':function(_0x2a64ad,_0x34e829){return _0x2a64ad>=_0x34e829;},'yDKIc':_0x2186fd(0x127),'BreTe':'OFF','PNWFF':function(_0x194366,_0x1b27af){return _0x194366===_0x1b27af;},'JZLHX':function(_0x2741e5,_0x5ec258){return _0x2741e5>=_0x5ec258;},'fkWvT':function(_0x3a9a41,_0x1813c0){return _0x3a9a41===_0x1813c0;},'YRxAb':_0x2186fd(0xc1),'ROKbN':_0x2186fd(0xc3),'Pvqmg':_0x2186fd(0xe0),'ThXxj':_0x2186fd(0xfe),'bvKJe':_0x2186fd(0xaa),'bgjvT':'[USER-PATH]','PEcjd':_0x2186fd(0x112),'stCeK':_0x2186fd(0x191),'syLTY':_0x2186fd(0x12b),'vXnZV':function(_0x4b96ca,_0x27f988,_0x246d89){return _0x4b96ca(_0x27f988,_0x246d89);},'eRqVM':function(_0x3e6302,_0x214471){return _0x3e6302!==_0x214471;},'OqBiZ':'connect','jsiHg':_0x2186fd(0xa5),'WOYiQ':function(_0x5ac13d,_0x52444b){return _0x5ac13d>=_0x52444b;},'efQjW':'info','SIxDw':'kYTKv','pZenk':function(_0x3358f3,_0x4594bf){return _0x3358f3===_0x4594bf;},'ZPRdH':function(_0x210968,_0x3d06a3){return _0x210968!==_0x3d06a3;},'OUkva':_0x2186fd(0x102),'ZwrkZ':'disconnect','TfTBX':function(_0x3f5c29,_0x268051){return _0x3f5c29>=_0x268051;},'DLiBv':function(_0x3ef3ae,_0x632595,_0x498e73){return _0x3ef3ae(_0x632595,_0x498e73);},'YmoBc':function(_0x2fdf94,_0xf6e12b,_0x4ca886){return _0x2fdf94(_0xf6e12b,_0x4ca886);},'QdoVa':_0x2186fd(0xdc),'TRezY':_0x2186fd(0xd4),'SkTjz':_0x2186fd(0x195),'ZaCmn':function(_0x21bd32,_0x2291fd){return _0x21bd32===_0x2291fd;},'ywxRn':_0x2186fd(0xe7)};if(_0x346ee7){if(_0x4c6c58[_0x2186fd(0x169)](_0x2186fd(0xbb),_0x4c6c58[_0x2186fd(0xc8)])){const _0x3f2efd=_0x4c6c58['uDJqy'](_0x5aa830['now'](),_0xe879a2);return this[_0x2186fd(0x160)][_0x2186fd(0x189)](_0x5ef35f),_0x3fd650&&_0x4c6c58[_0x2186fd(0xca)](_0x3e0157,_0xe60f2a[_0x2186fd(0xef)])&&this['performance'](_0x2b0703,_0x3f2efd),_0x3f2efd;}else sessionTracker['addDevice'](_0x47bc40,_0x346ee7);}return{'connect':_0x23cbc2=>{const _0x42fa43=_0x2186fd,_0x343a7f={'exANx':_0x4c6c58[_0x42fa43(0x144)],'VNNuC':_0x4c6c58[_0x42fa43(0x114)],'FHQGv':function(_0x559e0c,_0x1d8e00){return _0x4c6c58['PNWFF'](_0x559e0c,_0x1d8e00);},'WszES':_0x42fa43(0x19d),'qayQX':function(_0x171728,_0x350d5d){const _0x25dcd3=_0x42fa43;return _0x4c6c58[_0x25dcd3(0x1b8)](_0x171728,_0x350d5d);},'Dmxcd':_0x42fa43(0x1a1),'gWyTR':function(_0x4bf884,_0x1ca98b){const _0x2c6fa9=_0x42fa43;return _0x4c6c58[_0x2c6fa9(0x109)](_0x4bf884,_0x1ca98b);},'qquWY':function(_0x5424fa,_0x229911){const _0x20563a=_0x42fa43;return _0x4c6c58[_0x20563a(0x117)](_0x5424fa,_0x229911);},'adAWj':_0x4c6c58[_0x42fa43(0xb9)],'CSGWF':_0x4c6c58[_0x42fa43(0xdd)],'lBGao':_0x4c6c58[_0x42fa43(0x14f)],'ONsbs':_0x4c6c58[_0x42fa43(0x130)],'axkXU':_0x4c6c58['bvKJe'],'dnxug':_0x4c6c58['bgjvT'],'PGHqV':'[IP-ADDRESS]','YdIQF':_0x4c6c58[_0x42fa43(0x134)],'ZpZbu':function(_0x4ee52d,_0x573364){const _0x1d806d=_0x42fa43;return _0x4c6c58[_0x1d806d(0x1b8)](_0x4ee52d,_0x573364);},'njCpq':'~/[...]'};if(_0x4c6c58[_0x42fa43(0x117)](CURRENT_LEVEL,LOG_LEVELS[_0x42fa43(0x19e)]))_0x4c6c58[_0x42fa43(0x122)]===_0x4c6c58[_0x42fa43(0x122)]?consola[_0x42fa43(0x164)](_0x42fa43(0xb3)+(_0x23cbc2[_0x42fa43(0xb7)]||_0x4c6c58[_0x42fa43(0xcf)])+'-'+_0x47bc40[_0x42fa43(0xe5)](-0x5)):_0x2d791e[_0x42fa43(0x14e)]({'title':_0x343a7f['exANx'],'message':[_0x42fa43(0x10e)+_0x2dac4f,'🔧\x20Session:\x20'+_0x2e4cad[_0x42fa43(0x1b7)],'💾\x20Memory\x20tracking:\x20'+(_0x259e0e>=_0x3e55b7[_0x42fa43(0xf3)]?'ON':_0x343a7f[_0x42fa43(0x177)]),'🔒\x20Data\x20redaction:\x20'+(_0x343a7f[_0x42fa43(0x185)](_0x3950b4,_0x4864ca[_0x42fa43(0x19e)])?_0x343a7f[_0x42fa43(0x193)]:_0x343a7f[_0x42fa43(0x16f)](_0x5250cd,_0x3aae20[_0x42fa43(0xef)])?_0x343a7f['Dmxcd']:_0x343a7f[_0x42fa43(0x177)]),_0x42fa43(0x15c)+(_0x343a7f[_0x42fa43(0x17d)](_0x948280,_0x45aa0b[_0x42fa43(0xef)])?'ON':_0x42fa43(0x163)),'',_0x343a7f[_0x42fa43(0xcd)](_0x28e634,_0x121f1e[_0x42fa43(0xef)])?_0x42fa43(0x173):_0x343a7f[_0x42fa43(0x1bc)]][_0x42fa43(0x1a6)]('\x0a')});else{if(CURRENT_LEVEL===LOG_LEVELS['DEVELOPER']){const _0x1bbeab=_0x4c6c58['vXnZV'](redactSensitiveData,_0x47bc40,CURRENT_LEVEL);consola['success'](_0x42fa43(0xb3)+_0x1bbeab,redactSensitiveData(_0x23cbc2,CURRENT_LEVEL));}else{if(_0x4c6c58[_0x42fa43(0xa4)]('qHUHr',_0x42fa43(0x118))){if(iFMhtu[_0x42fa43(0x16f)](_0xb01cbc,_0x541d5b[_0x42fa43(0xf3)]))return _0x1a3a5f;let _0x34f2b8=typeof _0x3a5bb0===iFMhtu[_0x42fa43(0xac)]?_0x57c0fd[_0x42fa43(0x1b1)](_0xed32e7,null,0x2):_0x46abe2(_0x5a556e);if(_0x3c37f3===_0x42ed1a[_0x42fa43(0x19e)]){const _0x167fb0=iFMhtu[_0x42fa43(0x146)][_0x42fa43(0x1a8)]('|');let _0x4fc8be=0x0;while(!![]){switch(_0x167fb0[_0x4fc8be++]){case'0':_0x34f2b8=_0x34f2b8['replace'](_0x3ffcf6[_0x42fa43(0xad)],iFMhtu['ONsbs']);continue;case'1':_0x34f2b8=_0x34f2b8[_0x42fa43(0xd0)](_0x17063f[_0x42fa43(0x187)],iFMhtu[_0x42fa43(0x13a)]);continue;case'2':_0x34f2b8=_0x34f2b8[_0x42fa43(0xd0)](_0x403e50['homePath'],iFMhtu['dnxug']);continue;case'3':_0x34f2b8=_0x34f2b8['replace'](_0x1a50b0['ip'],iFMhtu[_0x42fa43(0x17f)]);continue;case'4':_0x34f2b8=_0x34f2b8[_0x42fa43(0xd0)](_0x2458af[_0x42fa43(0x158)],iFMhtu[_0x42fa43(0x143)]);continue;}break;}}else iFMhtu[_0x42fa43(0xf5)](_0x45d80e,_0x417d4b[_0x42fa43(0xef)])&&(_0x34f2b8=_0x34f2b8[_0x42fa43(0xd0)](_0x540f57[_0x42fa43(0x158)],_0x850f4f=>_0x850f4f[_0x42fa43(0xe5)](0x0,0x8)+_0x42fa43(0x166)+_0x850f4f[_0x42fa43(0xe5)](-0x4)),_0x34f2b8=_0x34f2b8[_0x42fa43(0xd0)](_0x4ac9f9[_0x42fa43(0x13d)],iFMhtu[_0x42fa43(0x111)]));return _0x34f2b8;}else consola[_0x42fa43(0x164)](_0x42fa43(0xb3)+_0x47bc40,_0x23cbc2);}}fileLogger[_0x42fa43(0x1b3)](_0x4c6c58['syLTY'],_0x4c6c58[_0x42fa43(0xcb)],_0x4c6c58['jsiHg'],{'deviceId':_0x4c6c58[_0x42fa43(0x155)](CURRENT_LEVEL,LOG_LEVELS[_0x42fa43(0xf3)])?_0x47bc40:_0x4c6c58[_0x42fa43(0x13f)](redactSensitiveData,_0x47bc40,CURRENT_LEVEL),'info':_0x23cbc2});},'disconnect':()=>{const _0x1380d1=_0x2186fd,_0x34dc44={};_0x34dc44[_0x1380d1(0x1b6)]=_0x4c6c58[_0x1380d1(0x168)];const _0x4dce24=_0x34dc44;if(_0x4c6c58[_0x1380d1(0xa4)](_0x1380d1(0xeb),_0x4c6c58['SIxDw'])){if(_0x4c6c58[_0x1380d1(0x151)](CURRENT_LEVEL,LOG_LEVELS[_0x1380d1(0x19e)]))_0x4c6c58[_0x1380d1(0xe1)](_0x1380d1(0x102),_0x4c6c58['OUkva'])?_0x36a933['success'](_0x1380d1(0xb3)+_0x1ef466,_0x4d0a32):consola[_0x1380d1(0x1b0)](_0x1380d1(0x18f));else{const _0x43eff6=_0x4c6c58[_0x1380d1(0x13f)](redactSensitiveData,_0x47bc40,CURRENT_LEVEL);consola[_0x1380d1(0x1b0)](_0x1380d1(0x1b4)+_0x43eff6+_0x1380d1(0x116));}fileLogger['log'](_0x4c6c58[_0x1380d1(0xcf)],_0x4c6c58[_0x1380d1(0xa6)],_0x1380d1(0x13b),{'deviceId':_0x4c6c58['TfTBX'](CURRENT_LEVEL,LOG_LEVELS[_0x1380d1(0xf3)])?_0x47bc40:_0x4c6c58['DLiBv'](redactSensitiveData,_0x47bc40,CURRENT_LEVEL)});}else{const _0x620800=_0x5b37ef(_0x3d3cdc,_0x4bd465[_0x1380d1(0x19e)]),_0x33eb9e=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u[_0x1380d1(0xc9)](_0x4c1187);_0xb3f598[_0x1380d1(0x1b0)](_0x33eb9e?_0x620800:_0x1380d1(0x1b4)+_0x620800);const _0x524a54={};_0x524a54[_0x1380d1(0x110)]=_0x47f497,_0x194fbd[_0x1380d1(0x1b3)](this[_0x1380d1(0xae)],DIDQnf[_0x1380d1(0x1b6)],_0x44946e,_0x524a54);}},'error':(_0x211781,_0xbf86bc)=>{const _0xd34006=_0x2186fd,_0x2ad038=_0x4c6c58[_0xd34006(0x108)](redactSensitiveData,_0x211781,LOG_LEVELS[_0xd34006(0x19e)]);consola['error']('❌\x20Device\x20error:\x20'+_0x2ad038,_0xbf86bc?.['message']||_0xbf86bc),fileLogger[_0xd34006(0x1b3)](_0x4c6c58[_0xd34006(0xcf)],_0x4c6c58[_0xd34006(0x115)],_0x4c6c58[_0xd34006(0x104)],{'message':_0x211781,'error':{'message':_0xbf86bc?.[_0xd34006(0xc2)],'stack':_0x4c6c58[_0xd34006(0x155)](CURRENT_LEVEL,LOG_LEVELS[_0xd34006(0xf3)])?_0xbf86bc?.[_0xd34006(0xab)]:_0x4c6c58[_0xd34006(0x171)]},'deviceId':_0x4c6c58[_0xd34006(0xbf)](CURRENT_LEVEL,LOG_LEVELS['CREATOR'])?_0x47bc40:_0x4c6c58['DLiBv'](redactSensitiveData,_0x47bc40,CURRENT_LEVEL)});}};}[_0x33b216(0xbd)](_0x3613f8){const _0x3d637e=_0x33b216,_0x4c2bee={};_0x4c2bee[_0x3d637e(0x12d)]=function(_0x1edf81,_0x7149da){return _0x1edf81>=_0x7149da;};const _0x1d0dc9=_0x4c2bee;this[_0x3d637e(0x160)][_0x3d637e(0x107)](_0x3613f8,Date[_0x3d637e(0x11c)]()),sessionTracker[_0x3d637e(0xbd)](_0x3613f8),_0x1d0dc9[_0x3d637e(0x12d)](CURRENT_LEVEL,LOG_LEVELS['CREATOR'])&&this[_0x3d637e(0xb8)]('Timer\x20started:\x20'+_0x3613f8);}[_0x33b216(0xf9)](_0x551697,_0x42800f=!![]){const _0x710903=_0x33b216,_0x26bed6={};_0x26bed6[_0x710903(0x11f)]=function(_0x5a4eb3,_0x3108cb){return _0x5a4eb3-_0x3108cb;},_0x26bed6['QXskh']=function(_0x540072,_0x3d1f06){return _0x540072>=_0x3d1f06;},_0x26bed6['DaBaz']=function(_0x3b191c,_0x3cc3aa){return _0x3b191c===_0x3cc3aa;},_0x26bed6[_0x710903(0x15f)]=_0x710903(0x10d);const _0x1d13a0=_0x26bed6,_0x3175bc=this['timers'][_0x710903(0x1ba)](_0x551697),_0x3ada82=sessionTracker[_0x710903(0xf9)](_0x551697);if(_0x3175bc){const _0xb5ad63=_0x1d13a0[_0x710903(0x11f)](Date[_0x710903(0x11c)](),_0x3175bc);this['timers'][_0x710903(0x189)](_0x551697);if(_0x42800f&&_0x1d13a0['QXskh'](CURRENT_LEVEL,LOG_LEVELS[_0x710903(0xef)])){if(_0x1d13a0[_0x710903(0x120)](_0x710903(0x194),_0x1d13a0[_0x710903(0x15f)])){const _0x4135ab=this['performance'][_0x710903(0x174)][_0x710903(0x1ba)](_0x37fc15);if(_0x4135ab){const _0xd83f4b=_0x15847f[_0x710903(0x11c)]()-_0x4135ab;return this['performance'][_0x710903(0x174)][_0x710903(0x189)](_0x213706),_0xd83f4b;}return 0x0;}else this[_0x710903(0x197)](_0x551697,_0xb5ad63);}return _0xb5ad63;}return _0x3ada82;}[_0x33b216(0x16b)](){return sessionTracker['getStats']();}static[_0x33b216(0x159)](){const _0x1dbb52=_0x33b216,_0x1d2483={};_0x1d2483[_0x1dbb52(0x10a)]=_0x1dbb52(0x19e),_0x1d2483[_0x1dbb52(0x188)]='DEVELOPER',_0x1d2483[_0x1dbb52(0x18a)]=_0x1dbb52(0xf3),_0x1d2483['xBbnC']=function(_0x310c4a,_0xe2daa9){return _0x310c4a===_0xe2daa9;},_0x1d2483['GNpkk']='🚀\x20Devicely\x20starting...',_0x1d2483[_0x1dbb52(0x14b)]=_0x1dbb52(0x163),_0x1d2483[_0x1dbb52(0xe2)]=function(_0x10a713,_0x222ec0){return _0x10a713===_0x222ec0;},_0x1d2483[_0x1dbb52(0xc5)]=_0x1dbb52(0x19d),_0x1d2483[_0x1dbb52(0x124)]='PARTIAL',_0x1d2483[_0x1dbb52(0x10b)]=_0x1dbb52(0x173);const _0x3d33fc=_0x1d2483,_0x274ba5=[_0x3d33fc['rWMwA'],_0x3d33fc['fNDuu'],_0x3d33fc['zUlGi']],_0x590257=_0x274ba5[CURRENT_LEVEL];_0x3d33fc[_0x1dbb52(0x140)](CURRENT_LEVEL,LOG_LEVELS['PUBLIC'])?consola[_0x1dbb52(0x1b0)](_0x3d33fc[_0x1dbb52(0xde)]):consola['box']({'title':_0x1dbb52(0x127),'message':[_0x1dbb52(0x10e)+_0x590257,_0x1dbb52(0x100)+sessionTracker[_0x1dbb52(0x1b7)],_0x1dbb52(0xc4)+(CURRENT_LEVEL>=LOG_LEVELS[_0x1dbb52(0xf3)]?'ON':_0x3d33fc[_0x1dbb52(0x14b)]),_0x1dbb52(0x18b)+(_0x3d33fc['aMCPv'](CURRENT_LEVEL,LOG_LEVELS[_0x1dbb52(0x19e)])?_0x3d33fc['kwfCZ']:_0x3d33fc[_0x1dbb52(0xe2)](CURRENT_LEVEL,LOG_LEVELS['DEVELOPER'])?_0x3d33fc['RHXxr']:_0x1dbb52(0x163)),_0x1dbb52(0x15c)+(CURRENT_LEVEL>=LOG_LEVELS[_0x1dbb52(0xef)]?'ON':_0x3d33fc[_0x1dbb52(0x14b)]),'',CURRENT_LEVEL===LOG_LEVELS['DEVELOPER']?_0x3d33fc[_0x1dbb52(0x10b)]:_0x1dbb52(0xc1)][_0x1dbb52(0x1a6)]('\x0a')});}}DevicelyLogger[_0x33b216(0x159)]();const _0x6ef8e0={};_0x6ef8e0[_0x33b216(0x15d)]=DevicelyLogger,_0x6ef8e0[_0x33b216(0x19c)]=LOG_LEVELS,_0x6ef8e0[_0x33b216(0x10f)]=CURRENT_LEVEL,_0x6ef8e0[_0x33b216(0x121)]=sessionTracker,_0x6ef8e0[_0x33b216(0x147)]=DevicelyLogger,module[_0x33b216(0x125)]=_0x6ef8e0;
|