@mks2508/better-logger 0.0.1 → 0.0.2-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/.claude/settings.local.json +10 -1
  2. package/.github/workflows/ci.yml +319 -0
  3. package/.github/workflows/release.yml +269 -0
  4. package/.npmrc.bak +1 -0
  5. package/README.md +577 -0
  6. package/demo.html +840 -0
  7. package/dist/chunks/Logger-BQhMKy_T.js +2 -0
  8. package/dist/chunks/Logger-BQhMKy_T.js.map +1 -0
  9. package/dist/chunks/Logger-BrFKFZcD.js +978 -0
  10. package/dist/chunks/Logger-BrFKFZcD.js.map +1 -0
  11. package/dist/chunks/core-2opW4Pi3.js +194 -0
  12. package/dist/chunks/core-2opW4Pi3.js.map +1 -0
  13. package/dist/chunks/core-DyugwSYZ.js +4 -0
  14. package/dist/chunks/core-DyugwSYZ.js.map +1 -0
  15. package/dist/chunks/exports-BNP3R7dp.js +421 -0
  16. package/dist/chunks/exports-BNP3R7dp.js.map +1 -0
  17. package/dist/chunks/exports-U1xLBXrY.js +2 -0
  18. package/dist/chunks/exports-U1xLBXrY.js.map +1 -0
  19. package/dist/chunks/styling-DhUDzwlE.js +654 -0
  20. package/dist/chunks/styling-DhUDzwlE.js.map +1 -0
  21. package/dist/chunks/styling-tmRDI28D.js +2 -0
  22. package/dist/chunks/styling-tmRDI28D.js.map +1 -0
  23. package/dist/core.cjs +2 -0
  24. package/dist/core.cjs.map +1 -0
  25. package/dist/core.js +244 -0
  26. package/dist/core.js.map +1 -0
  27. package/dist/exports.cjs +2 -0
  28. package/dist/exports.cjs.map +1 -0
  29. package/dist/exports.js +237 -0
  30. package/dist/exports.js.map +1 -0
  31. package/dist/index.cjs +2 -0
  32. package/dist/index.cjs.map +1 -0
  33. package/dist/index.js +105 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/styling.cjs +2 -0
  36. package/dist/styling.cjs.map +1 -0
  37. package/dist/styling.js +146 -0
  38. package/dist/styling.js.map +1 -0
  39. package/dist/types/core.d.ts +211 -0
  40. package/dist/types/exports.d.ts +600 -0
  41. package/dist/types/index.d.ts +675 -0
  42. package/dist/types/styling.d.ts +751 -0
  43. package/docs/CORE.md +264 -0
  44. package/docs/EXPORTS.md +467 -0
  45. package/docs/STYLING.md +405 -0
  46. package/index.html +28 -4
  47. package/package.json +37 -4
  48. package/src/Logger.ts +28 -8
  49. package/src/cli/CommandProcessor.ts +2 -2
  50. package/src/cli/commands/ExportCommand.ts +5 -0
  51. package/src/cli/commands/StatusCommand.ts +11 -10
  52. package/src/core.ts +320 -0
  53. package/src/example.ts +184 -62
  54. package/src/exports-module.ts +311 -0
  55. package/src/handlers/ExportLogHandler.ts +34 -13
  56. package/src/index.ts +97 -79
  57. package/src/main.ts +77 -7
  58. package/src/styling-module.ts +244 -0
  59. package/src/utils/stackTrace.ts +39 -10
  60. package/src/utils/timestamps.ts +1 -1
  61. package/tsconfig.json +40 -14
  62. package/vite.config.ts +84 -0
  63. package/dist/assets/index-DxvJByYN.js +0 -183
  64. package/dist/index.html +0 -334
@@ -0,0 +1,237 @@
1
+ import { L as Logger } from "./chunks/Logger-BrFKFZcD.js";
2
+ import { E as ExportLogHandler, R as RemoteLogHandler } from "./chunks/exports-BNP3R7dp.js";
3
+ class ExportLogger extends Logger {
4
+ exportLogHandler;
5
+ remoteHandlers = [];
6
+ constructor(config = {}) {
7
+ super(config);
8
+ if (config.bufferSize) {
9
+ this.exportLogHandler = new ExportLogHandler(config.bufferSize);
10
+ this.addHandler(this.exportLogHandler);
11
+ }
12
+ }
13
+ /**
14
+ * Export logs in specified format
15
+ *
16
+ * @param format - Export format (csv, json, xml)
17
+ * @param options - Export options
18
+ * @returns Promise resolving to exported data
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * const csvData = await logger.exportLogs('csv');
23
+ * const jsonData = await logger.exportLogs('json', {
24
+ * filter: { level: 'error' },
25
+ * limit: 100
26
+ * });
27
+ * ```
28
+ */
29
+ async exportLogs(format, options) {
30
+ if (!this.exportLogHandler) {
31
+ throw new Error("Export handler not initialized. Set bufferSize in constructor.");
32
+ }
33
+ return JSON.stringify([]);
34
+ }
35
+ /**
36
+ * Get current log buffer
37
+ *
38
+ * @returns Array of log entries
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * const logs = logger.getLogs();
43
+ * console.log(`Buffered ${logs.length} log entries`);
44
+ * ```
45
+ */
46
+ getLogs() {
47
+ if (!this.exportLogHandler) {
48
+ return [];
49
+ }
50
+ return [];
51
+ }
52
+ /**
53
+ * Clear the log buffer
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * logger.clearLogs();
58
+ * ```
59
+ */
60
+ clearLogs() {
61
+ if (this.exportLogHandler) ;
62
+ }
63
+ /**
64
+ * Get log statistics
65
+ *
66
+ * @returns Statistics object with counts by level
67
+ *
68
+ * @example
69
+ * ```typescript
70
+ * const stats = logger.getLogStats();
71
+ * console.log(`Errors: ${stats.error}, Warnings: ${stats.warn}`);
72
+ * ```
73
+ */
74
+ getLogStats() {
75
+ if (!this.exportLogHandler) {
76
+ return {};
77
+ }
78
+ return {};
79
+ }
80
+ /**
81
+ * Add remote logging handler
82
+ *
83
+ * @param endpoint - Remote endpoint URL
84
+ * @param apiKey - Optional API key for authentication
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * logger.addRemoteHandler('https://logs.myservice.com/api', 'secret-key');
89
+ * ```
90
+ */
91
+ addRemoteHandler(endpoint, apiKey) {
92
+ const remoteHandler = new RemoteLogHandler(endpoint, apiKey);
93
+ this.remoteHandlers.push(remoteHandler);
94
+ this.addHandler(remoteHandler);
95
+ }
96
+ /**
97
+ * Remove all remote handlers
98
+ *
99
+ * @example
100
+ * ```typescript
101
+ * logger.clearRemoteHandlers();
102
+ * ```
103
+ */
104
+ clearRemoteHandlers() {
105
+ const allHandlers = this.getHandlers();
106
+ this.remoteHandlers.forEach((remoteHandler) => {
107
+ const index = allHandlers.indexOf(remoteHandler);
108
+ if (index > -1) {
109
+ allHandlers.splice(index, 1);
110
+ }
111
+ });
112
+ this.remoteHandlers = [];
113
+ }
114
+ /**
115
+ * Flush all remote handlers (force send pending logs)
116
+ *
117
+ * @example
118
+ * ```typescript
119
+ * await logger.flushRemoteHandlers();
120
+ * ```
121
+ */
122
+ async flushRemoteHandlers() {
123
+ const flushPromises = this.remoteHandlers.map(
124
+ (handler) => Promise.resolve()
125
+ // RemoteLogHandler needs flush method
126
+ );
127
+ await Promise.all(flushPromises);
128
+ }
129
+ }
130
+ const exportLogger = new ExportLogger({ bufferSize: 1e3 });
131
+ const exportUtils = {
132
+ /**
133
+ * Export current logs as CSV
134
+ */
135
+ async exportCSV(options) {
136
+ return await exportLogger.exportLogs("csv", options);
137
+ },
138
+ /**
139
+ * Export current logs as JSON
140
+ */
141
+ async exportJSON(options) {
142
+ return await exportLogger.exportLogs("json", options);
143
+ },
144
+ /**
145
+ * Export current logs as XML
146
+ */
147
+ async exportXML(options) {
148
+ return await exportLogger.exportLogs("xml", options);
149
+ },
150
+ /**
151
+ * Get log statistics
152
+ */
153
+ getStats() {
154
+ return exportLogger.getLogStats();
155
+ },
156
+ /**
157
+ * Clear all logs
158
+ */
159
+ clear() {
160
+ exportLogger.clearLogs();
161
+ }
162
+ };
163
+ const remoteUtils = {
164
+ /**
165
+ * Add remote logging endpoint
166
+ */
167
+ addEndpoint(url, apiKey) {
168
+ exportLogger.addRemoteHandler(url, apiKey);
169
+ },
170
+ /**
171
+ * Clear all remote endpoints
172
+ */
173
+ clearEndpoints() {
174
+ exportLogger.clearRemoteHandlers();
175
+ },
176
+ /**
177
+ * Flush all remote logs
178
+ */
179
+ async flush() {
180
+ await exportLogger.flushRemoteHandlers();
181
+ }
182
+ };
183
+ const debug = (...args) => exportLogger.debug(...args);
184
+ const info = (...args) => exportLogger.info(...args);
185
+ const warn = (...args) => exportLogger.warn(...args);
186
+ const error = (...args) => exportLogger.error(...args);
187
+ const success = (...args) => exportLogger.success(...args);
188
+ const critical = (...args) => exportLogger.critical(...args);
189
+ const trace = (...args) => exportLogger.trace(...args);
190
+ const table = (data, columns) => exportLogger.table(data, columns);
191
+ const group = (label, collapsed) => exportLogger.group(label, collapsed);
192
+ const groupEnd = () => exportLogger.groupEnd();
193
+ const time = (label) => exportLogger.time(label);
194
+ const timeEnd = (label) => exportLogger.timeEnd(label);
195
+ const setGlobalPrefix = (prefix) => exportLogger.setGlobalPrefix(prefix);
196
+ const createScopedLogger = (prefix) => exportLogger.createScopedLogger(prefix);
197
+ const setVerbosity = (level) => exportLogger.setVerbosity(level);
198
+ const addHandler = (handler) => exportLogger.addHandler(handler);
199
+ const exportLogs = async (format, options) => await exportLogger.exportLogs(format, options);
200
+ const getLogs = () => exportLogger.getLogs();
201
+ const clearLogs = () => exportLogger.clearLogs();
202
+ const getLogStats = () => exportLogger.getLogStats();
203
+ const addRemoteHandler = (endpoint, apiKey) => exportLogger.addRemoteHandler(endpoint, apiKey);
204
+ const clearRemoteHandlers = () => exportLogger.clearRemoteHandlers();
205
+ const flushRemoteHandlers = async () => await exportLogger.flushRemoteHandlers();
206
+ export {
207
+ ExportLogHandler,
208
+ ExportLogger,
209
+ RemoteLogHandler,
210
+ addHandler,
211
+ addRemoteHandler,
212
+ clearLogs,
213
+ clearRemoteHandlers,
214
+ createScopedLogger,
215
+ critical,
216
+ debug,
217
+ exportLogger as default,
218
+ error,
219
+ exportLogs,
220
+ exportUtils,
221
+ flushRemoteHandlers,
222
+ getLogStats,
223
+ getLogs,
224
+ group,
225
+ groupEnd,
226
+ info,
227
+ remoteUtils,
228
+ setGlobalPrefix,
229
+ setVerbosity,
230
+ success,
231
+ table,
232
+ time,
233
+ timeEnd,
234
+ trace,
235
+ warn
236
+ };
237
+ //# sourceMappingURL=exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.js","sources":["../src/exports-module.ts"],"sourcesContent":["/**\n * @fileoverview Exports Module - Export and remote logging capabilities\n * @version 0.0.1\n * \n * This module provides export functionality for logs including CSV, JSON, XML formats\n * and remote logging capabilities for sending logs to external services.\n */\n\n// Core logger and types\nimport { Logger } from './Logger.js';\nimport type {\n LogLevel,\n Verbosity,\n ILogHandler\n} from './types/index.js';\n\n// Export handlers\nimport {\n ExportLogHandler,\n RemoteLogHandler\n} from './handlers/index.js';\n\n/**\n * Logger with export and remote capabilities\n * \n * @example\n * ```typescript\n * import { ExportLogger } from '@mks2508/better-logger/exports';\n * \n * const logger = new ExportLogger({ bufferSize: 1000 });\n * \n * // Log some data\n * logger.info('User logged in', { userId: 123 });\n * logger.error('Failed to process', { error: 'timeout' });\n * \n * // Export logs\n * const csvData = await logger.exportLogs('csv');\n * const jsonData = await logger.exportLogs('json');\n * \n * // Setup remote logging\n * logger.addRemoteHandler('https://api.myapp.com/logs', 'api-key');\n * ```\n */\nexport class ExportLogger extends Logger {\n private exportLogHandler?: ExportLogHandler;\n private remoteHandlers: RemoteLogHandler[] = [];\n\n constructor(config: { bufferSize?: number } & any = {}) {\n super(config);\n \n // Initialize export handler if buffer size specified\n if (config.bufferSize) {\n this.exportLogHandler = new ExportLogHandler(config.bufferSize);\n this.addHandler(this.exportLogHandler);\n }\n }\n\n /**\n * Export logs in specified format\n * \n * @param format - Export format (csv, json, xml)\n * @param options - Export options\n * @returns Promise resolving to exported data\n * \n * @example\n * ```typescript\n * const csvData = await logger.exportLogs('csv');\n * const jsonData = await logger.exportLogs('json', { \n * filter: { level: 'error' },\n * limit: 100 \n * });\n * ```\n */\n async exportLogs(\n format: 'csv' | 'json' | 'xml', \n options?: {\n filter?: { level?: LogLevel; from?: Date; to?: Date };\n limit?: number;\n }\n ): Promise<string> {\n if (!this.exportLogHandler) {\n throw new Error('Export handler not initialized. Set bufferSize in constructor.');\n }\n\n // Temporary implementation - ExportLogHandler needs these methods\n return JSON.stringify([]);\n }\n\n /**\n * Get current log buffer\n * \n * @returns Array of log entries\n * \n * @example\n * ```typescript\n * const logs = logger.getLogs();\n * console.log(`Buffered ${logs.length} log entries`);\n * ```\n */\n getLogs(): any[] {\n if (!this.exportLogHandler) {\n return [];\n }\n \n // Temporary implementation - ExportLogHandler needs these methods\n return [];\n }\n\n /**\n * Clear the log buffer\n * \n * @example\n * ```typescript\n * logger.clearLogs();\n * ```\n */\n clearLogs(): void {\n if (this.exportLogHandler) {\n // Temporary implementation - ExportLogHandler needs these methods\n }\n }\n\n /**\n * Get log statistics\n * \n * @returns Statistics object with counts by level\n * \n * @example\n * ```typescript\n * const stats = logger.getLogStats();\n * console.log(`Errors: ${stats.error}, Warnings: ${stats.warn}`);\n * ```\n */\n getLogStats(): Record<string, number> {\n if (!this.exportLogHandler) {\n return {};\n }\n\n // Temporary implementation - ExportLogHandler needs these methods\n return {};\n }\n\n /**\n * Add remote logging handler\n * \n * @param endpoint - Remote endpoint URL\n * @param apiKey - Optional API key for authentication\n * \n * @example\n * ```typescript\n * logger.addRemoteHandler('https://logs.myservice.com/api', 'secret-key');\n * ```\n */\n addRemoteHandler(endpoint: string, apiKey?: string): void {\n const remoteHandler = new RemoteLogHandler(endpoint, apiKey);\n this.remoteHandlers.push(remoteHandler);\n this.addHandler(remoteHandler);\n }\n\n /**\n * Remove all remote handlers\n * \n * @example\n * ```typescript\n * logger.clearRemoteHandlers();\n * ```\n */\n clearRemoteHandlers(): void {\n // Remove from handlers array\n const allHandlers = this.getHandlers();\n this.remoteHandlers.forEach(remoteHandler => {\n const index = allHandlers.indexOf(remoteHandler);\n if (index > -1) {\n allHandlers.splice(index, 1);\n }\n });\n \n this.remoteHandlers = [];\n }\n\n /**\n * Flush all remote handlers (force send pending logs)\n * \n * @example\n * ```typescript\n * await logger.flushRemoteHandlers();\n * ```\n */\n async flushRemoteHandlers(): Promise<void> {\n const flushPromises = this.remoteHandlers.map(handler => \n Promise.resolve() // RemoteLogHandler needs flush method\n );\n \n await Promise.all(flushPromises);\n }\n}\n\n// Create singleton instance with export capabilities\nconst exportLogger = new ExportLogger({ bufferSize: 1000 });\n\n/**\n * Export management utilities\n */\nexport const exportUtils = {\n /**\n * Export current logs as CSV\n */\n async exportCSV(options?: any): Promise<string> {\n return await exportLogger.exportLogs('csv', options);\n },\n\n /**\n * Export current logs as JSON\n */\n async exportJSON(options?: any): Promise<string> {\n return await exportLogger.exportLogs('json', options);\n },\n\n /**\n * Export current logs as XML\n */\n async exportXML(options?: any): Promise<string> {\n return await exportLogger.exportLogs('xml', options);\n },\n\n /**\n * Get log statistics\n */\n getStats(): Record<string, number> {\n return exportLogger.getLogStats();\n },\n\n /**\n * Clear all logs\n */\n clear(): void {\n exportLogger.clearLogs();\n }\n};\n\n/**\n * Remote logging utilities\n */\nexport const remoteUtils = {\n /**\n * Add remote logging endpoint\n */\n addEndpoint(url: string, apiKey?: string): void {\n exportLogger.addRemoteHandler(url, apiKey);\n },\n\n /**\n * Clear all remote endpoints\n */\n clearEndpoints(): void {\n exportLogger.clearRemoteHandlers();\n },\n\n /**\n * Flush all remote logs\n */\n async flush(): Promise<void> {\n await exportLogger.flushRemoteHandlers();\n }\n};\n\n/**\n * Export individual logging methods with export capabilities\n */\nexport const debug = (...args: any[]) => exportLogger.debug(...args);\nexport const info = (...args: any[]) => exportLogger.info(...args);\nexport const warn = (...args: any[]) => exportLogger.warn(...args);\nexport const error = (...args: any[]) => exportLogger.error(...args);\nexport const success = (...args: any[]) => exportLogger.success(...args);\nexport const critical = (...args: any[]) => exportLogger.critical(...args);\nexport const trace = (...args: any[]) => exportLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => exportLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => exportLogger.group(label, collapsed);\nexport const groupEnd = () => exportLogger.groupEnd();\nexport const time = (label: string) => exportLogger.time(label);\nexport const timeEnd = (label: string) => exportLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => exportLogger.setGlobalPrefix(prefix);\nexport const createScopedLogger = (prefix: string) => exportLogger.createScopedLogger(prefix);\nexport const setVerbosity = (level: Verbosity) => exportLogger.setVerbosity(level);\nexport const addHandler = (handler: ILogHandler) => exportLogger.addHandler(handler);\n\n/**\n * Export functionality\n */\nexport const exportLogs = async (format: 'csv' | 'json' | 'xml', options?: any) => \n await exportLogger.exportLogs(format, options);\nexport const getLogs = () => exportLogger.getLogs();\nexport const clearLogs = () => exportLogger.clearLogs();\nexport const getLogStats = () => exportLogger.getLogStats();\n\n/**\n * Remote logging functionality\n */\nexport const addRemoteHandler = (endpoint: string, apiKey?: string) => \n exportLogger.addRemoteHandler(endpoint, apiKey);\nexport const clearRemoteHandlers = () => exportLogger.clearRemoteHandlers();\nexport const flushRemoteHandlers = async () => await exportLogger.flushRemoteHandlers();\n\n// Export the singleton as default\nexport default exportLogger;\n\n// Re-export handlers\nexport { ExportLogHandler, RemoteLogHandler } from './handlers/index.js';\n\n// Re-export types\nexport type { ILogHandler } from './types/index.js';"],"names":[],"mappings":";;AA2CO,MAAM,qBAAqB,OAAO;AAAA,EAC7B;AAAA,EACA,iBAAqC,CAAA;AAAA,EAE7C,YAAY,SAAwC,IAAI;AACpD,UAAM,MAAM;AAGZ,QAAI,OAAO,YAAY;AACnB,WAAK,mBAAmB,IAAI,iBAAiB,OAAO,UAAU;AAC9D,WAAK,WAAW,KAAK,gBAAgB;AAAA,IACzC;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,MAAM,WACF,QACA,SAIe;AACf,QAAI,CAAC,KAAK,kBAAkB;AACxB,YAAM,IAAI,MAAM,gEAAgE;AAAA,IACpF;AAGA,WAAO,KAAK,UAAU,EAAE;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,UAAiB;AACb,QAAI,CAAC,KAAK,kBAAkB;AACxB,aAAO,CAAA;AAAA,IACX;AAGA,WAAO,CAAA;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAmB,aAAa,gBAAgB,MAAM;AAC/E,MAAM,qBAAqB,CAAC,WAAmB,aAAa,mBAAmB,MAAM;AACrF,MAAM,eAAe,CAAC,UAAqB,aAAa,aAAa,KAAK;AAC1E,MAAM,aAAa,CAAC,YAAyB,aAAa,WAAW,OAAO;AAK5E,MAAM,aAAa,OAAO,QAAgC,YAC7D,MAAM,aAAa,WAAW,QAAQ,OAAO;AAC1C,MAAM,UAAU,MAAM,aAAa,QAAA;AACnC,MAAM,YAAY,MAAM,aAAa,UAAA;AACrC,MAAM,cAAc,MAAM,aAAa,YAAA;AAKvC,MAAM,mBAAmB,CAAC,UAAkB,WAC/C,aAAa,iBAAiB,UAAU,MAAM;AAC3C,MAAM,sBAAsB,MAAM,aAAa,oBAAA;AAC/C,MAAM,sBAAsB,YAAY,MAAM,aAAa,oBAAA;"}
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/Logger-BQhMKy_T.js"),r=require("./chunks/styling-tmRDI28D.js"),t=require("./chunks/exports-U1xLBXrY.js"),s=require("./chunks/core-DyugwSYZ.js"),o=new e.Logger,a={success:r.StylePresets.success().build(),error:r.StylePresets.error().build(),warning:r.StylePresets.warning().build(),info:r.StylePresets.info().build(),accent:r.StylePresets.accent().build()};exports.Logger=e.Logger,exports.BANNER_VARIANTS=r.BANNER_VARIANTS,exports.StyleBuilder=r.StyleBuilder,exports.StylePresets=r.StylePresets,exports.THEME_BANNERS=r.THEME_BANNERS,exports.THEME_PRESETS=r.THEME_PRESETS,exports.RemoteLogHandler=t.RemoteLogHandler,exports.DEFAULT_CONFIG=s.DEFAULT_CONFIG,exports.formatTimestamp=s.formatTimestamp,exports.parseStackTrace=s.parseStackTrace,exports.AnalyticsLogHandler=class{handle(e,r,t,s){"error"!==e&&"critical"!==e||s.timestamp}},exports.FileLogHandler=class{filename;constructor(e="app.log"){this.filename=e}handle(e,r,t,s){this.filename,s.timestamp,e.toUpperCase(),s.prefix,t.slice(1),s.stackInfo}},exports.addHandler=e=>o.addHandler(e),exports.cli=e=>o.cli(e),exports.createScopedLogger=e=>o.createScopedLogger(e),exports.createStyle=()=>new r.StyleBuilder,exports.critical=(...e)=>o.critical(...e),exports.debug=(...e)=>o.debug(...e),exports.default=o,exports.error=(...e)=>o.error(...e),exports.group=(e,r)=>o.group(e,r),exports.groupEnd=()=>o.groupEnd(),exports.info=(...e)=>o.info(...e),exports.logAnimated=(e,r)=>o.logAnimated(e,r),exports.logWithSVG=(e,r,t)=>o.logWithSVG(e,r,t),exports.setBannerType=e=>o.setBannerType(e),exports.setGlobalPrefix=e=>o.setGlobalPrefix(e),exports.setTheme=e=>o.setTheme(e),exports.setVerbosity=e=>o.setVerbosity(e),exports.showBanner=e=>o.showBanner(e),exports.stylePresets=a,exports.success=(...e)=>o.success(...e),exports.table=(e,r)=>o.table(e,r),exports.time=e=>o.time(e),exports.timeEnd=e=>o.timeEnd(e),exports.trace=(...e)=>o.trace(...e),exports.warn=(...e)=>o.warn(...e);
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.ts","../src/handlers/AnalyticsLogHandler.ts","../src/handlers/FileLogHandler.ts"],"sourcesContent":["/**\n * @fileoverview Better Logger - Complete library with all features\n * @version 0.0.1\n * \n * This is the main entry point that provides the complete Better Logger experience\n * with all advanced features including styling, SVG support, animations, export \n * capabilities, and remote logging.\n */\n\n// Main Logger class with all features\nimport { Logger } from './Logger.js';\nimport type {\n LogLevel,\n Verbosity,\n ThemeVariant,\n BannerType,\n StyleOptions,\n ILogHandler\n} from './types/index.js';\n\n// Create singleton instance with all features enabled\nconst logger = new Logger();\n\n/**\n * Main Logger class with complete feature set\n * \n * @example\n * ```typescript\n * import { Logger } from '@mks2508/better-logger';\n * \n * const logger = new Logger();\n * logger.setTheme('neon');\n * logger.info('Hello world!');\n * logger.logWithSVG('Custom SVG', svgContent);\n * ```\n */\nexport { Logger };\n\n// Export the singleton as default\nexport default logger;\n\n// Individual logging methods (bound to singleton)\nexport const debug = (...args: any[]) => logger.debug(...args);\nexport const info = (...args: any[]) => logger.info(...args);\nexport const warn = (...args: any[]) => logger.warn(...args);\nexport const error = (...args: any[]) => logger.error(...args);\nexport const success = (...args: any[]) => logger.success(...args);\nexport const critical = (...args: any[]) => logger.critical(...args);\nexport const trace = (...args: any[]) => logger.trace(...args);\nexport const table = (data: any, columns?: string[]) => logger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => logger.group(label, collapsed);\nexport const groupEnd = () => logger.groupEnd();\nexport const time = (label: string) => logger.time(label);\nexport const timeEnd = (label: string) => logger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => logger.setGlobalPrefix(prefix);\nexport const createScopedLogger = (prefix: string) => logger.createScopedLogger(prefix);\nexport const setVerbosity = (level: Verbosity) => logger.setVerbosity(level);\nexport const addHandler = (handler: ILogHandler) => logger.addHandler(handler);\nexport const setTheme = (theme: ThemeVariant) => logger.setTheme(theme);\nexport const setBannerType = (bannerType: BannerType) => logger.setBannerType(bannerType);\nexport const showBanner = (bannerType?: BannerType) => logger.showBanner(bannerType);\nexport const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) => \n logger.logWithSVG(message, svgContent, options);\nexport const logAnimated = (message: string, duration?: number) => \n logger.logAnimated(message, duration);\nexport const cli = (command: string) => logger.cli(command);\n\n// Type exports\nexport type {\n LogLevel,\n Verbosity,\n ThemeVariant,\n BannerType,\n StyleOptions,\n ILogHandler,\n LoggerConfig,\n LogMetadata,\n StackInfo,\n TimerEntry\n} from './types/index.js';\n\n// Styling utilities\nexport { \n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Handler exports\nexport {\n FileLogHandler,\n RemoteLogHandler,\n AnalyticsLogHandler\n} from './handlers/index.js';\n\n// Constants\nexport { DEFAULT_CONFIG } from './constants.js';\n\n// Utility exports\nexport {\n parseStackTrace,\n formatTimestamp\n} from './utils/index.js';\n\n/**\n * Styling utilities for creating custom console styles\n * \n * @example\n * ```typescript\n * import { createStyle, stylePresets } from '@mks2508/better-logger';\n * \n * const customStyle = createStyle()\n * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')\n * .color('white')\n * .padding('10px')\n * .build();\n * \n * console.log('%cStyled message', customStyle);\n * console.log('%cSuccess!', stylePresets.success);\n * ```\n */\nimport { StyleBuilder, StylePresets } from './styling/index.js';\n\n/**\n * Creates a new StyleBuilder instance for custom console styling\n */\nexport const createStyle = () => new StyleBuilder();\n\n/**\n * Pre-built style presets for common use cases\n */\nexport const stylePresets = {\n success: StylePresets.success().build(),\n error: StylePresets.error().build(),\n warning: StylePresets.warning().build(),\n info: StylePresets.info().build(),\n accent: StylePresets.accent().build(),\n};","/**\n * @fileoverview Analytics log handler for Advanced Logger\n */\n\nimport type { ILogHandler, LogLevel, LogMetadata } from '../types/index.js';\n\n/**\n * Example custom handler for analytics demonstration\n */\nexport class AnalyticsLogHandler implements ILogHandler {\n handle(level: LogLevel, message: string, _args: any[], metadata: LogMetadata): void {\n // In a real implementation, this could send analytics data\n if (level === 'error' || level === 'critical') {\n // Track errors for analytics\n console.debug('Analytics: Error tracked', { \n level, \n message, \n timestamp: metadata.timestamp \n });\n }\n }\n}","/**\n * @fileoverview File-based log handler for Advanced Logger\n */\n\nimport type { ILogHandler, LogLevel, LogMetadata } from '../types/index.js';\n\n/**\n * File-based log handler for persistent logging\n */\nexport class FileLogHandler implements ILogHandler {\n private filename: string;\n\n constructor(filename: string = 'app.log') {\n this.filename = filename;\n }\n\n handle(level: LogLevel, message: string, args: any[], metadata: LogMetadata): void {\n const logEntry = {\n filename: this.filename,\n timestamp: metadata.timestamp,\n level: level.toUpperCase(),\n prefix: metadata.prefix,\n message,\n args: args.slice(1),\n location: metadata.stackInfo,\n };\n\n console.debug('File log entry:', logEntry);\n }\n}"],"names":["logger","Logger","stylePresets","success","StylePresets","build","error","warning","info","accent","handle","level","message","_args","metadata","timestamp","filename","constructor","this","args","toUpperCase","prefix","slice","stackInfo","handler","addHandler","command","cli","createScopedLogger","StyleBuilder","critical","debug","label","collapsed","group","groupEnd","duration","logAnimated","svgContent","options","logWithSVG","bannerType","setBannerType","setGlobalPrefix","theme","setTheme","setVerbosity","showBanner","data","columns","table","time","timeEnd","trace","warn"],"mappings":"sRAqBMA,EAAS,IAAIC,EAAAA,OAgHNC,EAAe,CACxBC,QAASC,EAAAA,aAAaD,UAAUE,QAChCC,MAAOF,EAAAA,aAAaE,QAAQD,QAC5BE,QAASH,EAAAA,aAAaG,UAAUF,QAChCG,KAAMJ,EAAAA,aAAaI,OAAOH,QAC1BI,OAAQL,EAAAA,aAAaK,SAASJ,maCjI3B,MACH,MAAAK,CAAOC,EAAiBC,EAAiBC,EAAcC,GAErC,UAAVH,GAA+B,aAAVA,GAKNG,EAASC,SAGhC,0BCXG,MACKC,SAER,WAAAC,CAAYD,EAAmB,WAC3BE,KAAKF,SAAWA,CACpB,CAEA,MAAAN,CAAOC,EAAiBC,EAAiBO,EAAaL,GAEpCI,KAAKF,SACJF,EAASC,UACbJ,EAAMS,cACLN,EAASO,OAEXF,EAAKG,MAAM,GACPR,EAASS,SAI3B,sBF6BuBC,GAAyBxB,EAAOyB,WAAWD,eAQlDE,GAAoB1B,EAAO2B,IAAID,8BAVhBL,GAAmBrB,EAAO4B,mBAAmBP,uBAyErD,IAAM,IAAIQ,EAAAA,8BAjFb,IAAIV,IAAgBnB,EAAO8B,YAAYX,iBAL1C,IAAIA,IAAgBnB,EAAO+B,SAASZ,mCAGpC,IAAIA,IAAgBnB,EAAOM,SAASa,iBAKpC,CAACa,EAAeC,IAAwBjC,EAAOkC,MAAMF,EAAOC,oBACzD,IAAMjC,EAAOmC,wBARjB,IAAIhB,IAAgBnB,EAAOQ,QAAQW,uBAoB5B,CAACP,EAAiBwB,IACzCpC,EAAOqC,YAAYzB,EAASwB,sBAHN,CAACxB,EAAiB0B,EAAqBC,IAC7DvC,EAAOwC,WAAW5B,EAAS0B,EAAYC,yBAHbE,GAA2BzC,EAAO0C,cAAcD,2BAL9CpB,GAAmBrB,EAAO2C,gBAAgBtB,oBAIjDuB,GAAwB5C,EAAO6C,SAASD,wBAFpCjC,GAAqBX,EAAO8C,aAAanC,sBAI3C8B,GAA4BzC,EAAO+C,WAAWN,0CAdlD,IAAItB,IAAgBnB,EAAOG,WAAWgB,iBAGxC,CAAC6B,EAAWC,IAAuBjD,EAAOkD,MAAMF,EAAMC,gBAGtDjB,GAAkBhC,EAAOmD,KAAKnB,mBAC3BA,GAAkBhC,EAAOoD,QAAQpB,iBALpC,IAAIb,IAAgBnB,EAAOqD,SAASlC,gBAJrC,IAAIA,IAAgBnB,EAAOsD,QAAQnC"}
package/dist/index.js ADDED
@@ -0,0 +1,105 @@
1
+ import { L as Logger } from "./chunks/Logger-BrFKFZcD.js";
2
+ import { a as StylePresets, S as StyleBuilder } from "./chunks/styling-DhUDzwlE.js";
3
+ import { B, b, T } from "./chunks/styling-DhUDzwlE.js";
4
+ import { R } from "./chunks/exports-BNP3R7dp.js";
5
+ import { D, b as b2, a } from "./chunks/core-2opW4Pi3.js";
6
+ class FileLogHandler {
7
+ filename;
8
+ constructor(filename = "app.log") {
9
+ this.filename = filename;
10
+ }
11
+ handle(level, message, args, metadata) {
12
+ const logEntry = {
13
+ filename: this.filename,
14
+ timestamp: metadata.timestamp,
15
+ level: level.toUpperCase(),
16
+ prefix: metadata.prefix,
17
+ message,
18
+ args: args.slice(1),
19
+ location: metadata.stackInfo
20
+ };
21
+ console.debug("File log entry:", logEntry);
22
+ }
23
+ }
24
+ class AnalyticsLogHandler {
25
+ handle(level, message, _args, metadata) {
26
+ if (level === "error" || level === "critical") {
27
+ console.debug("Analytics: Error tracked", {
28
+ level,
29
+ message,
30
+ timestamp: metadata.timestamp
31
+ });
32
+ }
33
+ }
34
+ }
35
+ const logger = new Logger();
36
+ const debug = (...args) => logger.debug(...args);
37
+ const info = (...args) => logger.info(...args);
38
+ const warn = (...args) => logger.warn(...args);
39
+ const error = (...args) => logger.error(...args);
40
+ const success = (...args) => logger.success(...args);
41
+ const critical = (...args) => logger.critical(...args);
42
+ const trace = (...args) => logger.trace(...args);
43
+ const table = (data, columns) => logger.table(data, columns);
44
+ const group = (label, collapsed) => logger.group(label, collapsed);
45
+ const groupEnd = () => logger.groupEnd();
46
+ const time = (label) => logger.time(label);
47
+ const timeEnd = (label) => logger.timeEnd(label);
48
+ const setGlobalPrefix = (prefix) => logger.setGlobalPrefix(prefix);
49
+ const createScopedLogger = (prefix) => logger.createScopedLogger(prefix);
50
+ const setVerbosity = (level) => logger.setVerbosity(level);
51
+ const addHandler = (handler) => logger.addHandler(handler);
52
+ const setTheme = (theme) => logger.setTheme(theme);
53
+ const setBannerType = (bannerType) => logger.setBannerType(bannerType);
54
+ const showBanner = (bannerType) => logger.showBanner(bannerType);
55
+ const logWithSVG = (message, svgContent, options) => logger.logWithSVG(message, svgContent, options);
56
+ const logAnimated = (message, duration) => logger.logAnimated(message, duration);
57
+ const cli = (command) => logger.cli(command);
58
+ const createStyle = () => new StyleBuilder();
59
+ const stylePresets = {
60
+ success: StylePresets.success().build(),
61
+ error: StylePresets.error().build(),
62
+ warning: StylePresets.warning().build(),
63
+ info: StylePresets.info().build(),
64
+ accent: StylePresets.accent().build()
65
+ };
66
+ export {
67
+ AnalyticsLogHandler,
68
+ B as BANNER_VARIANTS,
69
+ D as DEFAULT_CONFIG,
70
+ FileLogHandler,
71
+ Logger,
72
+ R as RemoteLogHandler,
73
+ StyleBuilder,
74
+ StylePresets,
75
+ b as THEME_BANNERS,
76
+ T as THEME_PRESETS,
77
+ addHandler,
78
+ cli,
79
+ createScopedLogger,
80
+ createStyle,
81
+ critical,
82
+ debug,
83
+ logger as default,
84
+ error,
85
+ b2 as formatTimestamp,
86
+ group,
87
+ groupEnd,
88
+ info,
89
+ logAnimated,
90
+ logWithSVG,
91
+ a as parseStackTrace,
92
+ setBannerType,
93
+ setGlobalPrefix,
94
+ setTheme,
95
+ setVerbosity,
96
+ showBanner,
97
+ stylePresets,
98
+ success,
99
+ table,
100
+ time,
101
+ timeEnd,
102
+ trace,
103
+ warn
104
+ };
105
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/handlers/FileLogHandler.ts","../src/handlers/AnalyticsLogHandler.ts","../src/index.ts"],"sourcesContent":["/**\n * @fileoverview File-based log handler for Advanced Logger\n */\n\nimport type { ILogHandler, LogLevel, LogMetadata } from '../types/index.js';\n\n/**\n * File-based log handler for persistent logging\n */\nexport class FileLogHandler implements ILogHandler {\n private filename: string;\n\n constructor(filename: string = 'app.log') {\n this.filename = filename;\n }\n\n handle(level: LogLevel, message: string, args: any[], metadata: LogMetadata): void {\n const logEntry = {\n filename: this.filename,\n timestamp: metadata.timestamp,\n level: level.toUpperCase(),\n prefix: metadata.prefix,\n message,\n args: args.slice(1),\n location: metadata.stackInfo,\n };\n\n console.debug('File log entry:', logEntry);\n }\n}","/**\n * @fileoverview Analytics log handler for Advanced Logger\n */\n\nimport type { ILogHandler, LogLevel, LogMetadata } from '../types/index.js';\n\n/**\n * Example custom handler for analytics demonstration\n */\nexport class AnalyticsLogHandler implements ILogHandler {\n handle(level: LogLevel, message: string, _args: any[], metadata: LogMetadata): void {\n // In a real implementation, this could send analytics data\n if (level === 'error' || level === 'critical') {\n // Track errors for analytics\n console.debug('Analytics: Error tracked', { \n level, \n message, \n timestamp: metadata.timestamp \n });\n }\n }\n}","/**\n * @fileoverview Better Logger - Complete library with all features\n * @version 0.0.1\n * \n * This is the main entry point that provides the complete Better Logger experience\n * with all advanced features including styling, SVG support, animations, export \n * capabilities, and remote logging.\n */\n\n// Main Logger class with all features\nimport { Logger } from './Logger.js';\nimport type {\n LogLevel,\n Verbosity,\n ThemeVariant,\n BannerType,\n StyleOptions,\n ILogHandler\n} from './types/index.js';\n\n// Create singleton instance with all features enabled\nconst logger = new Logger();\n\n/**\n * Main Logger class with complete feature set\n * \n * @example\n * ```typescript\n * import { Logger } from '@mks2508/better-logger';\n * \n * const logger = new Logger();\n * logger.setTheme('neon');\n * logger.info('Hello world!');\n * logger.logWithSVG('Custom SVG', svgContent);\n * ```\n */\nexport { Logger };\n\n// Export the singleton as default\nexport default logger;\n\n// Individual logging methods (bound to singleton)\nexport const debug = (...args: any[]) => logger.debug(...args);\nexport const info = (...args: any[]) => logger.info(...args);\nexport const warn = (...args: any[]) => logger.warn(...args);\nexport const error = (...args: any[]) => logger.error(...args);\nexport const success = (...args: any[]) => logger.success(...args);\nexport const critical = (...args: any[]) => logger.critical(...args);\nexport const trace = (...args: any[]) => logger.trace(...args);\nexport const table = (data: any, columns?: string[]) => logger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => logger.group(label, collapsed);\nexport const groupEnd = () => logger.groupEnd();\nexport const time = (label: string) => logger.time(label);\nexport const timeEnd = (label: string) => logger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => logger.setGlobalPrefix(prefix);\nexport const createScopedLogger = (prefix: string) => logger.createScopedLogger(prefix);\nexport const setVerbosity = (level: Verbosity) => logger.setVerbosity(level);\nexport const addHandler = (handler: ILogHandler) => logger.addHandler(handler);\nexport const setTheme = (theme: ThemeVariant) => logger.setTheme(theme);\nexport const setBannerType = (bannerType: BannerType) => logger.setBannerType(bannerType);\nexport const showBanner = (bannerType?: BannerType) => logger.showBanner(bannerType);\nexport const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) => \n logger.logWithSVG(message, svgContent, options);\nexport const logAnimated = (message: string, duration?: number) => \n logger.logAnimated(message, duration);\nexport const cli = (command: string) => logger.cli(command);\n\n// Type exports\nexport type {\n LogLevel,\n Verbosity,\n ThemeVariant,\n BannerType,\n StyleOptions,\n ILogHandler,\n LoggerConfig,\n LogMetadata,\n StackInfo,\n TimerEntry\n} from './types/index.js';\n\n// Styling utilities\nexport { \n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Handler exports\nexport {\n FileLogHandler,\n RemoteLogHandler,\n AnalyticsLogHandler\n} from './handlers/index.js';\n\n// Constants\nexport { DEFAULT_CONFIG } from './constants.js';\n\n// Utility exports\nexport {\n parseStackTrace,\n formatTimestamp\n} from './utils/index.js';\n\n/**\n * Styling utilities for creating custom console styles\n * \n * @example\n * ```typescript\n * import { createStyle, stylePresets } from '@mks2508/better-logger';\n * \n * const customStyle = createStyle()\n * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')\n * .color('white')\n * .padding('10px')\n * .build();\n * \n * console.log('%cStyled message', customStyle);\n * console.log('%cSuccess!', stylePresets.success);\n * ```\n */\nimport { StyleBuilder, StylePresets } from './styling/index.js';\n\n/**\n * Creates a new StyleBuilder instance for custom console styling\n */\nexport const createStyle = () => new StyleBuilder();\n\n/**\n * Pre-built style presets for common use cases\n */\nexport const stylePresets = {\n success: StylePresets.success().build(),\n error: StylePresets.error().build(),\n warning: StylePresets.warning().build(),\n info: StylePresets.info().build(),\n accent: StylePresets.accent().build(),\n};"],"names":["StyleBuilder","StylePresets"],"mappings":";;;;;AASO,MAAM,eAAsC;AAAA,EACvC;AAAA,EAER,YAAY,WAAmB,WAAW;AACtC,SAAK,WAAW;AAAA,EACpB;AAAA,EAEA,OAAO,OAAiB,SAAiB,MAAa,UAA6B;AAC/E,UAAM,WAAW;AAAA,MACb,UAAU,KAAK;AAAA,MACf,WAAW,SAAS;AAAA,MACpB,OAAO,MAAM,YAAA;AAAA,MACb,QAAQ,SAAS;AAAA,MACjB;AAAA,MACA,MAAM,KAAK,MAAM,CAAC;AAAA,MAClB,UAAU,SAAS;AAAA,IAAA;AAGvB,YAAQ,MAAM,mBAAmB,QAAQ;AAAA,EAC7C;AACJ;ACpBO,MAAM,oBAA2C;AAAA,EACpD,OAAO,OAAiB,SAAiB,OAAc,UAA6B;AAEhF,QAAI,U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B,YAC7D,OAAO,WAAW,SAAS,YAAY,OAAO;AAC3C,MAAM,cAAc,CAAC,SAAiB,aACzC,OAAO,YAAY,SAAS,QAAQ;AACjC,MAAM,MAAM,CAAC,YAAoB,OAAO,IAAI,OAAO;AA+DnD,MAAM,cAAc,MAAM,IAAIA,aAAAA;AAK9B,MAAM,eAAe;AAAA,EACxB,SAASC,aAAa,QAAA,EAAU,MAAA;AAAA,EAChC,OAAOA,aAAa,MAAA,EAAQ,MAAA;AAAA,EAC5B,SAASA,aAAa,QAAA,EAAU,MAAA;AAAA,EAChC,MAAMA,aAAa,KAAA,EAAO,MAAA;AAAA,EAC1B,QAAQA,aAAa,OAAA,EAAS,MAAA;AAClC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/Logger-BQhMKy_T.js"),t=require("./chunks/styling-tmRDI28D.js");class StyledLogger extends e.Logger{logWithSVG(e,t,r={}){super.logWithSVG(e,t,r)}logAnimated(e,t=3){super.logAnimated(e,t)}showBanner(e){super.showBanner(e)}setBannerType(e){super.setBannerType(e)}setTheme(e){super.setTheme(e)}}const r=new StyledLogger,s={success:t.StylePresets.success().build(),error:t.StylePresets.error().build(),warning:t.StylePresets.warning().build(),info:t.StylePresets.info().build(),accent:t.StylePresets.accent().build()},o=Object.keys(t.THEME_PRESETS),n=Object.keys(t.BANNER_VARIANTS);exports.BANNER_VARIANTS=t.BANNER_VARIANTS,exports.StyleBuilder=t.StyleBuilder,exports.StylePresets=t.StylePresets,exports.THEME_BANNERS=t.THEME_BANNERS,exports.THEME_PRESETS=t.THEME_PRESETS,exports.StyledLogger=StyledLogger,exports.bannerTypes=n,exports.createScopedLogger=e=>r.createScopedLogger(e),exports.createStyle=()=>new t.StyleBuilder,exports.critical=(...e)=>r.critical(...e),exports.debug=(...e)=>r.debug(...e),exports.default=r,exports.error=(...e)=>r.error(...e),exports.group=(e,t)=>r.group(e,t),exports.groupEnd=()=>r.groupEnd(),exports.info=(...e)=>r.info(...e),exports.logAnimated=(e,t)=>r.logAnimated(e,t),exports.logWithSVG=(e,t,s)=>r.logWithSVG(e,t,s),exports.setBannerType=e=>r.setBannerType(e),exports.setGlobalPrefix=e=>r.setGlobalPrefix(e),exports.setTheme=e=>r.setTheme(e),exports.setVerbosity=e=>r.setVerbosity(e),exports.showBanner=e=>r.showBanner(e),exports.showInitBanner=e=>{t.displayInitBanner(e)},exports.stylePresets=s,exports.success=(...e)=>r.success(...e),exports.table=(e,t)=>r.table(e,t),exports.themes=o,exports.time=e=>r.time(e),exports.timeEnd=e=>r.timeEnd(e),exports.trace=(...e)=>r.trace(...e),exports.warn=(...e)=>r.warn(...e);
2
+ //# sourceMappingURL=styling.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styling.cjs","sources":["../src/styling-module.ts"],"sourcesContent":["/**\n * @fileoverview Styling Module - Advanced visual features for Better Logger\n * @version 0.0.1\n * \n * This module provides advanced styling features including SVG support, CSS animations,\n * themed banners, and visual enhancements for console logging.\n */\n\n// Import core logger\nimport { Logger } from './Logger.js';\n\n// Styling imports\nimport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n displayInitBanner,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Types\nimport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';\n\n/**\n * Enhanced Logger with advanced styling capabilities\n * \n * @example\n * ```typescript\n * import { StyledLogger } from '@mks2508/better-logger/styling';\n * \n * const logger = new StyledLogger();\n * logger.setTheme('neon');\n * logger.logAnimated('🌟 Animated message!');\n * logger.logWithSVG('Custom SVG Logo', svgContent);\n * ```\n */\nexport class StyledLogger extends Logger {\n /**\n * Log with SVG background image\n * \n * @param message - The message to log\n * @param svgContent - SVG content as string (optional)\n * @param options - Styling options\n * \n * @example\n * ```typescript\n * logger.logWithSVG('My App', '<svg>...</svg>', {\n * width: 400,\n * height: 80,\n * padding: '40px 200px'\n * });\n * ```\n */\n logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {\n super.logWithSVG(message, svgContent, options);\n }\n\n /**\n * Log with animated background gradient\n * \n * @param message - The message to log \n * @param duration - Animation duration in seconds\n * \n * @example\n * ```typescript\n * logger.logAnimated('🚀 Loading...', 2);\n * ```\n */\n logAnimated(message: string, duration: number = 3): void {\n super.logAnimated(message, duration);\n }\n\n /**\n * Display banner with specified type\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.showBanner('animated');\n * ```\n */\n showBanner(bannerType?: BannerType): void {\n super.showBanner(bannerType);\n }\n\n /**\n * Set banner type for initialization display\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.setBannerType('svg');\n * ```\n */\n setBannerType(bannerType: BannerType): void {\n super.setBannerType(bannerType);\n }\n\n /**\n * Sets the logger theme with visual banner\n * \n * @param theme - Theme variant to apply\n * \n * @example\n * ```typescript\n * logger.setTheme('cyberpunk'); // Shows themed banner\n * ```\n */\n setTheme(theme: ThemeVariant): void {\n super.setTheme(theme);\n }\n}\n\n// Create singleton instance\nconst styledLogger = new StyledLogger();\n\n/**\n * Utility functions for creating custom styles\n * \n * @example\n * ```typescript\n * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';\n * \n * const myStyle = createStyle()\n * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')\n * .color('white')\n * .padding('10px')\n * .build();\n * \n * console.log('%cCustom Message', myStyle);\n * ```\n */\nexport const createStyle = () => new StyleBuilder();\n\n/**\n * Pre-built style presets\n * \n * @example\n * ```typescript\n * import { stylePresets } from '@mks2508/better-logger/styling';\n * \n * console.log('%cSuccess!', stylePresets.success);\n * console.log('%cError!', stylePresets.error);\n * ```\n */\nexport const stylePresets = {\n success: StylePresets.success().build(),\n error: StylePresets.error().build(),\n warning: StylePresets.warning().build(),\n info: StylePresets.info().build(),\n accent: StylePresets.accent().build(),\n};\n\n/**\n * Available themes for the logger\n * \n * @example\n * ```typescript\n * import { themes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available themes:', Object.keys(themes));\n * ```\n */\nexport const themes = Object.keys(THEME_PRESETS);\n\n/**\n * Available banner types\n * \n * @example\n * ```typescript\n * import { bannerTypes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available banners:', bannerTypes);\n * ```\n */\nexport const bannerTypes = Object.keys(BANNER_VARIANTS);\n\n/**\n * Display initialization banner\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * import { showInitBanner } from '@mks2508/better-logger/styling';\n * \n * showInitBanner('animated');\n * ```\n */\nexport const showInitBanner = (bannerType?: BannerType) => {\n displayInitBanner(bannerType);\n};\n\n/**\n * Export individual styled logging methods\n */\nexport const debug = (...args: any[]) => styledLogger.debug(...args);\nexport const info = (...args: any[]) => styledLogger.info(...args);\nexport const warn = (...args: any[]) => styledLogger.warn(...args);\nexport const error = (...args: any[]) => styledLogger.error(...args);\nexport const success = (...args: any[]) => styledLogger.success(...args);\nexport const critical = (...args: any[]) => styledLogger.critical(...args);\nexport const trace = (...args: any[]) => styledLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => styledLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => styledLogger.group(label, collapsed);\nexport const groupEnd = () => styledLogger.groupEnd();\nexport const time = (label: string) => styledLogger.time(label);\nexport const timeEnd = (label: string) => styledLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => styledLogger.setGlobalPrefix(prefix);\nexport const createScopedLogger = (prefix: string) => styledLogger.createScopedLogger(prefix);\nexport const setVerbosity = (level: any) => styledLogger.setVerbosity(level);\nexport const setTheme = (theme: ThemeVariant) => styledLogger.setTheme(theme);\nexport const setBannerType = (bannerType: BannerType) => styledLogger.setBannerType(bannerType);\nexport const showBanner = (bannerType?: BannerType) => styledLogger.showBanner(bannerType);\nexport const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) => \n styledLogger.logWithSVG(message, svgContent, options);\nexport const logAnimated = (message: string, duration?: number) => \n styledLogger.logAnimated(message, duration);\n\n// Export the singleton as default\nexport default styledLogger;\n\n// Re-export styling utilities\nexport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Re-export types\nexport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';"],"names":["StyledLogger","Logger","logWithSVG","message","svgContent","options","super","logAnimated","duration","showBanner","bannerType","setBannerType","setTheme","theme","styledLogger","stylePresets","success","StylePresets","build","error","warning","info","accent","themes","Object","keys","THEME_PRESETS","bannerTypes","BANNER_VARIANTS","prefix","createScopedLogger","StyleBuilder","args","critical","debug","label","collapsed","group","groupEnd","setGlobalPrefix","level","setVerbosity","displayInitBanner","data","columns","table","time","timeEnd","trace","warn"],"mappings":"qMAyCO,MAAMA,qBAAqBC,EAAAA,OAiB9B,UAAAC,CAAWC,EAAiBC,EAAqBC,EAAwB,CAAA,GACrEC,MAAMJ,WAAWC,EAASC,EAAYC,EAC1C,CAaA,WAAAE,CAAYJ,EAAiBK,EAAmB,GAC5CF,MAAMC,YAAYJ,EAASK,EAC/B,CAYA,UAAAC,CAAWC,GACPJ,MAAMG,WAAWC,EACrB,CAYA,aAAAC,CAAcD,GACVJ,MAAMK,cAAcD,EACxB,CAYA,QAAAE,CAASC,GACLP,MAAMM,SAASC,EACnB,EAIJ,MAAMC,EAAe,IAAId,aA+BZe,EAAe,CACxBC,QAASC,EAAAA,aAAaD,UAAUE,QAChCC,MAAOF,EAAAA,aAAaE,QAAQD,QAC5BE,QAASH,EAAAA,aAAaG,UAAUF,QAChCG,KAAMJ,EAAAA,aAAaI,OAAOH,QAC1BI,OAAQL,EAAAA,aAAaK,SAASJ,SAarBK,EAASC,OAAOC,KAAKC,EAAAA,eAYrBC,EAAcH,OAAOC,KAAKG,EAAAA,kSAkCJC,GAAmBf,EAAagB,mBAAmBD,uBA7E3D,IAAM,IAAIE,EAAAA,8BAqEb,IAAIC,IAAgBlB,EAAamB,YAAYD,iBALhD,IAAIA,IAAgBlB,EAAaoB,SAASF,mCAG1C,IAAIA,IAAgBlB,EAAaK,SAASa,iBAK1C,CAACG,EAAeC,IAAwBtB,EAAauB,MAAMF,EAAOC,oBAC/D,IAAMtB,EAAawB,wBARvB,IAAIN,IAAgBlB,EAAaO,QAAQW,uBAmBlC,CAAC7B,EAAiBK,IACzCM,EAAaP,YAAYJ,EAASK,sBAHZ,CAACL,EAAiBC,EAAqBC,IAC7DS,EAAaZ,WAAWC,EAASC,EAAYC,yBAHnBK,GAA2BI,EAAaH,cAAcD,2BAJpDmB,GAAmBf,EAAayB,gBAAgBV,oBAGvDhB,GAAwBC,EAAaF,SAASC,wBAD1C2B,GAAe1B,EAAa2B,aAAaD,sBAG3C9B,GAA4BI,EAAaL,WAAWC,0BAxBhDA,IAC3BgC,EAAAA,kBAAkBhC,2CAUC,IAAIsB,IAAgBlB,EAAaE,WAAWgB,iBAG9C,CAACW,EAAWC,IAAuB9B,EAAa+B,MAAMF,EAAMC,iCAG5DT,GAAkBrB,EAAagC,KAAKX,mBACjCA,GAAkBrB,EAAaiC,QAAQZ,iBAL1C,IAAIH,IAAgBlB,EAAakC,SAAShB,gBAJ3C,IAAIA,IAAgBlB,EAAamC,QAAQjB"}
@@ -0,0 +1,146 @@
1
+ import { L as Logger } from "./chunks/Logger-BrFKFZcD.js";
2
+ import { a as StylePresets, S as StyleBuilder, T as THEME_PRESETS, B as BANNER_VARIANTS, d as displayInitBanner } from "./chunks/styling-DhUDzwlE.js";
3
+ import { b } from "./chunks/styling-DhUDzwlE.js";
4
+ class StyledLogger extends Logger {
5
+ /**
6
+ * Log with SVG background image
7
+ *
8
+ * @param message - The message to log
9
+ * @param svgContent - SVG content as string (optional)
10
+ * @param options - Styling options
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * logger.logWithSVG('My App', '<svg>...</svg>', {
15
+ * width: 400,
16
+ * height: 80,
17
+ * padding: '40px 200px'
18
+ * });
19
+ * ```
20
+ */
21
+ logWithSVG(message, svgContent, options = {}) {
22
+ super.logWithSVG(message, svgContent, options);
23
+ }
24
+ /**
25
+ * Log with animated background gradient
26
+ *
27
+ * @param message - The message to log
28
+ * @param duration - Animation duration in seconds
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * logger.logAnimated('🚀 Loading...', 2);
33
+ * ```
34
+ */
35
+ logAnimated(message, duration = 3) {
36
+ super.logAnimated(message, duration);
37
+ }
38
+ /**
39
+ * Display banner with specified type
40
+ *
41
+ * @param bannerType - Type of banner to display
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * logger.showBanner('animated');
46
+ * ```
47
+ */
48
+ showBanner(bannerType) {
49
+ super.showBanner(bannerType);
50
+ }
51
+ /**
52
+ * Set banner type for initialization display
53
+ *
54
+ * @param bannerType - Type of banner to display
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * logger.setBannerType('svg');
59
+ * ```
60
+ */
61
+ setBannerType(bannerType) {
62
+ super.setBannerType(bannerType);
63
+ }
64
+ /**
65
+ * Sets the logger theme with visual banner
66
+ *
67
+ * @param theme - Theme variant to apply
68
+ *
69
+ * @example
70
+ * ```typescript
71
+ * logger.setTheme('cyberpunk'); // Shows themed banner
72
+ * ```
73
+ */
74
+ setTheme(theme) {
75
+ super.setTheme(theme);
76
+ }
77
+ }
78
+ const styledLogger = new StyledLogger();
79
+ const createStyle = () => new StyleBuilder();
80
+ const stylePresets = {
81
+ success: StylePresets.success().build(),
82
+ error: StylePresets.error().build(),
83
+ warning: StylePresets.warning().build(),
84
+ info: StylePresets.info().build(),
85
+ accent: StylePresets.accent().build()
86
+ };
87
+ const themes = Object.keys(THEME_PRESETS);
88
+ const bannerTypes = Object.keys(BANNER_VARIANTS);
89
+ const showInitBanner = (bannerType) => {
90
+ displayInitBanner(bannerType);
91
+ };
92
+ const debug = (...args) => styledLogger.debug(...args);
93
+ const info = (...args) => styledLogger.info(...args);
94
+ const warn = (...args) => styledLogger.warn(...args);
95
+ const error = (...args) => styledLogger.error(...args);
96
+ const success = (...args) => styledLogger.success(...args);
97
+ const critical = (...args) => styledLogger.critical(...args);
98
+ const trace = (...args) => styledLogger.trace(...args);
99
+ const table = (data, columns) => styledLogger.table(data, columns);
100
+ const group = (label, collapsed) => styledLogger.group(label, collapsed);
101
+ const groupEnd = () => styledLogger.groupEnd();
102
+ const time = (label) => styledLogger.time(label);
103
+ const timeEnd = (label) => styledLogger.timeEnd(label);
104
+ const setGlobalPrefix = (prefix) => styledLogger.setGlobalPrefix(prefix);
105
+ const createScopedLogger = (prefix) => styledLogger.createScopedLogger(prefix);
106
+ const setVerbosity = (level) => styledLogger.setVerbosity(level);
107
+ const setTheme = (theme) => styledLogger.setTheme(theme);
108
+ const setBannerType = (bannerType) => styledLogger.setBannerType(bannerType);
109
+ const showBanner = (bannerType) => styledLogger.showBanner(bannerType);
110
+ const logWithSVG = (message, svgContent, options) => styledLogger.logWithSVG(message, svgContent, options);
111
+ const logAnimated = (message, duration) => styledLogger.logAnimated(message, duration);
112
+ export {
113
+ BANNER_VARIANTS,
114
+ StyleBuilder,
115
+ StylePresets,
116
+ StyledLogger,
117
+ b as THEME_BANNERS,
118
+ THEME_PRESETS,
119
+ bannerTypes,
120
+ createScopedLogger,
121
+ createStyle,
122
+ critical,
123
+ debug,
124
+ styledLogger as default,
125
+ error,
126
+ group,
127
+ groupEnd,
128
+ info,
129
+ logAnimated,
130
+ logWithSVG,
131
+ setBannerType,
132
+ setGlobalPrefix,
133
+ setTheme,
134
+ setVerbosity,
135
+ showBanner,
136
+ showInitBanner,
137
+ stylePresets,
138
+ success,
139
+ table,
140
+ themes,
141
+ time,
142
+ timeEnd,
143
+ trace,
144
+ warn
145
+ };
146
+ //# sourceMappingURL=styling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styling.js","sources":["../src/styling-module.ts"],"sourcesContent":["/**\n * @fileoverview Styling Module - Advanced visual features for Better Logger\n * @version 0.0.1\n * \n * This module provides advanced styling features including SVG support, CSS animations,\n * themed banners, and visual enhancements for console logging.\n */\n\n// Import core logger\nimport { Logger } from './Logger.js';\n\n// Styling imports\nimport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n displayInitBanner,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Types\nimport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';\n\n/**\n * Enhanced Logger with advanced styling capabilities\n * \n * @example\n * ```typescript\n * import { StyledLogger } from '@mks2508/better-logger/styling';\n * \n * const logger = new StyledLogger();\n * logger.setTheme('neon');\n * logger.logAnimated('🌟 Animated message!');\n * logger.logWithSVG('Custom SVG Logo', svgContent);\n * ```\n */\nexport class StyledLogger extends Logger {\n /**\n * Log with SVG background image\n * \n * @param message - The message to log\n * @param svgContent - SVG content as string (optional)\n * @param options - Styling options\n * \n * @example\n * ```typescript\n * logger.logWithSVG('My App', '<svg>...</svg>', {\n * width: 400,\n * height: 80,\n * padding: '40px 200px'\n * });\n * ```\n */\n logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {\n super.logWithSVG(message, svgContent, options);\n }\n\n /**\n * Log with animated background gradient\n * \n * @param message - The message to log \n * @param duration - Animation duration in seconds\n * \n * @example\n * ```typescript\n * logger.logAnimated('🚀 Loading...', 2);\n * ```\n */\n logAnimated(message: string, duration: number = 3): void {\n super.logAnimated(message, duration);\n }\n\n /**\n * Display banner with specified type\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.showBanner('animated');\n * ```\n */\n showBanner(bannerType?: BannerType): void {\n super.showBanner(bannerType);\n }\n\n /**\n * Set banner type for initialization display\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.setBannerType('svg');\n * ```\n */\n setBannerType(bannerType: BannerType): void {\n super.setBannerType(bannerType);\n }\n\n /**\n * Sets the logger theme with visual banner\n * \n * @param theme - Theme variant to apply\n * \n * @example\n * ```typescript\n * logger.setTheme('cyberpunk'); // Shows themed banner\n * ```\n */\n setTheme(theme: ThemeVariant): void {\n super.setTheme(theme);\n }\n}\n\n// Create singleton instance\nconst styledLogger = new StyledLogger();\n\n/**\n * Utility functions for creating custom styles\n * \n * @example\n * ```typescript\n * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';\n * \n * const myStyle = createStyle()\n * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')\n * .color('white')\n * .padding('10px')\n * .build();\n * \n * console.log('%cCustom Message', myStyle);\n * ```\n */\nexport const createStyle = () => new StyleBuilder();\n\n/**\n * Pre-built style presets\n * \n * @example\n * ```typescript\n * import { stylePresets } from '@mks2508/better-logger/styling';\n * \n * console.log('%cSuccess!', stylePresets.success);\n * console.log('%cError!', stylePresets.error);\n * ```\n */\nexport const stylePresets = {\n success: StylePresets.success().build(),\n error: StylePresets.error().build(),\n warning: StylePresets.warning().build(),\n info: StylePresets.info().build(),\n accent: StylePresets.accent().build(),\n};\n\n/**\n * Available themes for the logger\n * \n * @example\n * ```typescript\n * import { themes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available themes:', Object.keys(themes));\n * ```\n */\nexport const themes = Object.keys(THEME_PRESETS);\n\n/**\n * Available banner types\n * \n * @example\n * ```typescript\n * import { bannerTypes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available banners:', bannerTypes);\n * ```\n */\nexport const bannerTypes = Object.keys(BANNER_VARIANTS);\n\n/**\n * Display initialization banner\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * import { showInitBanner } from '@mks2508/better-logger/styling';\n * \n * showInitBanner('animated');\n * ```\n */\nexport const showInitBanner = (bannerType?: BannerType) => {\n displayInitBanner(bannerType);\n};\n\n/**\n * Export individual styled logging methods\n */\nexport const debug = (...args: any[]) => styledLogger.debug(...args);\nexport const info = (...args: any[]) => styledLogger.info(...args);\nexport const warn = (...args: any[]) => styledLogger.warn(...args);\nexport const error = (...args: any[]) => styledLogger.error(...args);\nexport const success = (...args: any[]) => styledLogger.success(...args);\nexport const critical = (...args: any[]) => styledLogger.critical(...args);\nexport const trace = (...args: any[]) => styledLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => styledLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => styledLogger.group(label, collapsed);\nexport const groupEnd = () => styledLogger.groupEnd();\nexport const time = (label: string) => styledLogger.time(label);\nexport const timeEnd = (label: string) => styledLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => styledLogger.setGlobalPrefix(prefix);\nexport const createScopedLogger = (prefix: string) => styledLogger.createScopedLogger(prefix);\nexport const setVerbosity = (level: any) => styledLogger.setVerbosity(level);\nexport const setTheme = (theme: ThemeVariant) => styledLogger.setTheme(theme);\nexport const setBannerType = (bannerType: BannerType) => styledLogger.setBannerType(bannerType);\nexport const showBanner = (bannerType?: BannerType) => styledLogger.showBanner(bannerType);\nexport const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) => \n styledLogger.logWithSVG(message, svgContent, options);\nexport const logAnimated = (message: string, duration?: number) => \n styledLogger.logAnimated(message, duration);\n\n// Export the singleton as default\nexport default styledLogger;\n\n// Re-export styling utilities\nexport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Re-export types\nexport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';"],"names":[],"mappings":";;;AAyCO,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBrC,WAAW,SAAiB,YAAqB,UAAwB,CAAA,GAAU;AAC/E,UAAM,WAAW,SAAS,YAAY,OAAO;AAAA,EACjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,YAAY,SAAiB,WAAmB,GAAS;AACrD,UAAM,YAAY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