@multiplatform.one/logger 7.83.0 → 7.83.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 (43) hide show
  1. package/dist/cjs/base.cjs +118 -0
  2. package/dist/cjs/base.native.js +194 -0
  3. package/dist/cjs/base.native.js.map +1 -0
  4. package/dist/cjs/index.cjs +48 -0
  5. package/dist/cjs/index.native.js +117 -0
  6. package/dist/cjs/index.native.js.map +1 -0
  7. package/dist/cjs/index.tauri.cjs +52 -0
  8. package/dist/cjs/index.tauri.native.js +138 -0
  9. package/dist/cjs/index.tauri.native.js.map +1 -0
  10. package/dist/cjs/transport/tauri.cjs +57 -0
  11. package/dist/cjs/transport/tauri.native.js +89 -0
  12. package/dist/cjs/transport/tauri.native.js.map +1 -0
  13. package/dist/cjs/transport/types.cjs +18 -0
  14. package/dist/cjs/transport/types.native.js +21 -0
  15. package/dist/cjs/transport/types.native.js.map +1 -0
  16. package/dist/cjs/types.cjs +43 -0
  17. package/dist/cjs/types.native.js +46 -0
  18. package/dist/cjs/types.native.js.map +1 -0
  19. package/dist/esm/base.mjs +81 -0
  20. package/dist/esm/base.mjs.map +1 -0
  21. package/dist/esm/base.native.js +154 -0
  22. package/dist/esm/base.native.js.map +1 -0
  23. package/dist/esm/index.mjs +21 -0
  24. package/dist/esm/index.mjs.map +1 -0
  25. package/dist/esm/index.native.js +87 -0
  26. package/dist/esm/index.native.js.map +1 -0
  27. package/dist/esm/index.tauri.mjs +25 -0
  28. package/dist/esm/index.tauri.mjs.map +1 -0
  29. package/dist/esm/index.tauri.native.js +108 -0
  30. package/dist/esm/index.tauri.native.js.map +1 -0
  31. package/dist/esm/transport/tauri.mjs +32 -0
  32. package/dist/esm/transport/tauri.mjs.map +1 -0
  33. package/dist/esm/transport/tauri.native.js +61 -0
  34. package/dist/esm/transport/tauri.native.js.map +1 -0
  35. package/dist/esm/transport/types.mjs +2 -0
  36. package/dist/esm/transport/types.mjs.map +1 -0
  37. package/dist/esm/transport/types.native.js +2 -0
  38. package/dist/esm/transport/types.native.js.map +1 -0
  39. package/dist/esm/types.mjs +17 -0
  40. package/dist/esm/types.mjs.map +1 -0
  41. package/dist/esm/types.native.js +17 -0
  42. package/dist/esm/types.native.js.map +1 -0
  43. package/package.json +13 -4
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
24
+ value: true
25
+ }), mod);
26
+ var index_tauri_exports = {};
27
+ __export(index_tauri_exports, {
28
+ Logger: () => Logger,
29
+ logger: () => logger
30
+ });
31
+ module.exports = __toCommonJS(index_tauri_exports);
32
+ var import_platform = require("@multiplatform.one/platform");
33
+ var import_base = require("./base.native.js");
34
+ var import_tauri = require("./transport/tauri.native.js");
35
+ __reExport(index_tauri_exports, require("./types.native.js"), module.exports);
36
+ __reExport(index_tauri_exports, require("./base.native.js"), module.exports);
37
+ function _assert_this_initialized(self) {
38
+ if (self === void 0) {
39
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
40
+ }
41
+ return self;
42
+ }
43
+ function _call_super(_this, derived, args) {
44
+ derived = _get_prototype_of(derived);
45
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
46
+ }
47
+ function _class_call_check(instance, Constructor) {
48
+ if (!(instance instanceof Constructor)) {
49
+ throw new TypeError("Cannot call a class as a function");
50
+ }
51
+ }
52
+ function _defineProperties(target, props) {
53
+ for (var i = 0; i < props.length; i++) {
54
+ var descriptor = props[i];
55
+ descriptor.enumerable = descriptor.enumerable || false;
56
+ descriptor.configurable = true;
57
+ if ("value" in descriptor) descriptor.writable = true;
58
+ Object.defineProperty(target, descriptor.key, descriptor);
59
+ }
60
+ }
61
+ function _create_class(Constructor, protoProps, staticProps) {
62
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
63
+ if (staticProps) _defineProperties(Constructor, staticProps);
64
+ return Constructor;
65
+ }
66
+ function _get_prototype_of(o) {
67
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {
68
+ return o2.__proto__ || Object.getPrototypeOf(o2);
69
+ };
70
+ return _get_prototype_of(o);
71
+ }
72
+ function _inherits(subClass, superClass) {
73
+ if (typeof superClass !== "function" && superClass !== null) {
74
+ throw new TypeError("Super expression must either be null or a function");
75
+ }
76
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
77
+ constructor: {
78
+ value: subClass,
79
+ writable: true,
80
+ configurable: true
81
+ }
82
+ });
83
+ if (superClass) _set_prototype_of(subClass, superClass);
84
+ }
85
+ function _possible_constructor_return(self, call) {
86
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
87
+ return call;
88
+ }
89
+ return _assert_this_initialized(self);
90
+ }
91
+ function _set_prototype_of(o, p) {
92
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {
93
+ o2.__proto__ = p2;
94
+ return o2;
95
+ };
96
+ return _set_prototype_of(o, p);
97
+ }
98
+ function _type_of(obj) {
99
+ "@swc/helpers - typeof";
100
+
101
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
102
+ }
103
+ function _is_native_reflect_construct() {
104
+ try {
105
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
106
+ } catch (_) {}
107
+ return (_is_native_reflect_construct = function () {
108
+ return !!result;
109
+ })();
110
+ }
111
+ var Logger = /* @__PURE__ */function (BaseLogger2) {
112
+ "use strict";
113
+
114
+ _inherits(Logger2, BaseLogger2);
115
+ function Logger2() {
116
+ var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
117
+ _class_call_check(this, Logger2);
118
+ var metadata = {
119
+ platform: import_platform.platform.preciseName
120
+ };
121
+ return _call_super(this, Logger2, [{
122
+ name: metadata.platform,
123
+ ...(typeof config === "string" ? {
124
+ name: config
125
+ } : config),
126
+ metadata
127
+ }]);
128
+ }
129
+ _create_class(Logger2, [{
130
+ key: "createTransport",
131
+ value: function createTransport() {
132
+ if (import_platform.platform.isTauri) return new import_tauri.TauriTransport();
133
+ }
134
+ }]);
135
+ return Logger2;
136
+ }(import_base.BaseLogger);
137
+ var logger = new Logger();
138
+ //# sourceMappingURL=index.tauri.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__reExport","mod","secondTarget","__toCommonJS","value","index_tauri_exports","Logger","logger","module","exports","import_platform","require","import_base","import_tauri","_assert_this_initialized","self","ReferenceError","_call_super","_this","derived","args","_get_prototype_of","_possible_constructor_return","_is_native_reflect_construct","Reflect","construct","constructor","apply","_class_call_check","instance","Constructor","TypeError","_defineProperties","props","i","length","descriptor","configurable","writable","_create_class","protoProps","staticProps","o","setPrototypeOf","getPrototypeOf","o2","__proto__","_inherits","subClass","superClass","create","_set_prototype_of","_type_of","p","p2","obj","Symbol","result","Boolean","valueOf","_","BaseLogger2","Logger2","config","arguments","metadata","platform","preciseName","createTransport","isTauri","TauriTransport","BaseLogger"],"sources":["index.tauri.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_tauri_exports = {};\n__export(index_tauri_exports, {\n Logger: () => Logger,\n logger: () => logger\n});\nmodule.exports = __toCommonJS(index_tauri_exports);\nvar import_platform = require(\"@multiplatform.one/platform\");\nvar import_base = require(\"./base\");\nvar import_tauri = require(\"./transport/tauri\");\n__reExport(index_tauri_exports, require(\"./types\"), module.exports);\n__reExport(index_tauri_exports, require(\"./base\"), module.exports);\nfunction _assert_this_initialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nfunction _call_super(_this, derived, args) {\n derived = _get_prototype_of(derived);\n return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));\n}\nfunction _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\nfunction _get_prototype_of(o) {\n _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n };\n return _get_prototype_of(o);\n}\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _set_prototype_of(subClass, superClass);\n}\nfunction _possible_constructor_return(self, call) {\n if (call && (_type_of(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n return _assert_this_initialized(self);\n}\nfunction _set_prototype_of(o, p) {\n _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {\n o2.__proto__ = p2;\n return o2;\n };\n return _set_prototype_of(o, p);\n}\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nfunction _is_native_reflect_construct() {\n try {\n var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {\n }));\n } catch (_) {\n }\n return (_is_native_reflect_construct = function() {\n return !!result;\n })();\n}\nvar Logger = /* @__PURE__ */ (function(BaseLogger2) {\n \"use strict\";\n _inherits(Logger2, BaseLogger2);\n function Logger2() {\n var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n _class_call_check(this, Logger2);\n var metadata = {\n platform: import_platform.platform.preciseName\n };\n return _call_super(this, Logger2, [\n {\n name: metadata.platform,\n ...typeof config === \"string\" ? {\n name: config\n } : config,\n metadata\n }\n ]);\n }\n _create_class(Logger2, [\n {\n key: \"createTransport\",\n value: function createTransport() {\n if (import_platform.platform.isTauri) return new import_tauri.TauriTransport();\n }\n }\n ]);\n return Logger2;\n})(import_base.BaseLogger);\nvar logger = new Logger();\n//# sourceMappingURL=index.tauri.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IAAI,EAAE;IAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;IAAEE,UAAU,EAAE;EAAK,CAAC,CAAC;AACjE,CAAC;AACD,IAAIC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;EAC5C,IAAIF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,UAAU,EAAE;IAClE,KAAK,IAAIG,GAAG,IAAIhB,iBAAiB,CAACa,IAAI,CAAC,EACrC,IAAI,CAACX,YAAY,CAACe,IAAI,CAACL,EAAE,EAAEI,GAAG,CAAC,IAAIA,GAAG,KAAKF,MAAM,EAC/CnB,SAAS,CAACiB,EAAE,EAAEI,GAAG,EAAE;MAAEP,GAAG,EAAEA,CAAA,KAAMI,IAAI,CAACG,GAAG,CAAC;MAAEN,UAAU,EAAE,EAAEK,IAAI,GAAGjB,gBAAgB,CAACe,IAAI,EAAEG,GAAG,CAAC,CAAC,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K,EAAE,SAASgE,eAAeA,CAAA,EAAG;MAChC,IAAI1D,eAAe,CAACwD,QAAQ,CAACG,OAAO,EAAE,OAAO,IAAIxD,YAAY,CAACyD,cAAc,CAAC,CAAC;IAChF;EACF,CAAC,CACF,CAAC;EACF,OAAOR,OAAO;AAChB,CAAC,CAAElD,WAAW,CAAC2D,UAAU,CAAC;AAC1B,IAAIhE,MAAM,GAAG,IAAID,MAAM,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,57 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: true
22
+ }), mod);
23
+ var tauri_exports = {};
24
+ __export(tauri_exports, {
25
+ TauriTransport: () => TauriTransport
26
+ });
27
+ module.exports = __toCommonJS(tauri_exports);
28
+ var import_core = require("@tauri-apps/api/core");
29
+ var import_types = require("../types.cjs");
30
+ const logger = console;
31
+ const LogLevelNames = {
32
+ [import_types.LogLevel.Trace]: "trace",
33
+ [import_types.LogLevel.Debug]: "debug",
34
+ [import_types.LogLevel.Info]: "info",
35
+ [import_types.LogLevel.Warn]: "warn",
36
+ [import_types.LogLevel.Error]: "error",
37
+ [import_types.LogLevel.Silent]: "silent"
38
+ };
39
+ class TauriTransport {
40
+ send(payload) {
41
+ try {
42
+ const levelName = LogLevelNames[payload.level] ?? "info";
43
+ (0, import_core.invoke)("log_message", {
44
+ payload: {
45
+ level: levelName,
46
+ message: String(payload.message),
47
+ platform: payload.platform,
48
+ args: payload.args ?? []
49
+ }
50
+ }).catch(err => {
51
+ logger.error("Failed to send log to Tauri:", err);
52
+ });
53
+ } catch (err) {
54
+ logger.error(err);
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
+ value: true
24
+ }), mod);
25
+ var tauri_exports = {};
26
+ __export(tauri_exports, {
27
+ TauriTransport: () => TauriTransport
28
+ });
29
+ module.exports = __toCommonJS(tauri_exports);
30
+ var import_core = require("@tauri-apps/api/core");
31
+ var import_types = require("../types.native.js");
32
+ function _class_call_check(instance, Constructor) {
33
+ if (!(instance instanceof Constructor)) {
34
+ throw new TypeError("Cannot call a class as a function");
35
+ }
36
+ }
37
+ function _defineProperties(target, props) {
38
+ for (var i = 0; i < props.length; i++) {
39
+ var descriptor = props[i];
40
+ descriptor.enumerable = descriptor.enumerable || false;
41
+ descriptor.configurable = true;
42
+ if ("value" in descriptor) descriptor.writable = true;
43
+ Object.defineProperty(target, descriptor.key, descriptor);
44
+ }
45
+ }
46
+ function _create_class(Constructor, protoProps, staticProps) {
47
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
48
+ if (staticProps) _defineProperties(Constructor, staticProps);
49
+ return Constructor;
50
+ }
51
+ var logger = console;
52
+ var LogLevelNames = {
53
+ [import_types.LogLevel.Trace]: "trace",
54
+ [import_types.LogLevel.Debug]: "debug",
55
+ [import_types.LogLevel.Info]: "info",
56
+ [import_types.LogLevel.Warn]: "warn",
57
+ [import_types.LogLevel.Error]: "error",
58
+ [import_types.LogLevel.Silent]: "silent"
59
+ };
60
+ var TauriTransport = /* @__PURE__ */function () {
61
+ "use strict";
62
+
63
+ function TauriTransport2() {
64
+ _class_call_check(this, TauriTransport2);
65
+ }
66
+ _create_class(TauriTransport2, [{
67
+ key: "send",
68
+ value: function send(payload) {
69
+ try {
70
+ var _LogLevelNames_payload_level, _payload_args;
71
+ var levelName = (_LogLevelNames_payload_level = LogLevelNames[payload.level]) !== null && _LogLevelNames_payload_level !== void 0 ? _LogLevelNames_payload_level : "info";
72
+ (0, import_core.invoke)("log_message", {
73
+ payload: {
74
+ level: levelName,
75
+ message: String(payload.message),
76
+ platform: payload.platform,
77
+ args: (_payload_args = payload.args) !== null && _payload_args !== void 0 ? _payload_args : []
78
+ }
79
+ }).catch(function (err) {
80
+ logger.error("Failed to send log to Tauri:", err);
81
+ });
82
+ } catch (err) {
83
+ logger.error(err);
84
+ }
85
+ }
86
+ }]);
87
+ return TauriTransport2;
88
+ }();
89
+ //# sourceMappingURL=tauri.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","tauri_exports","TauriTransport","module","exports","import_core","require","import_types","_class_call_check","instance","Constructor","TypeError","_defineProperties","props","i","length","descriptor","configurable","writable","_create_class","protoProps","staticProps","logger","console","LogLevelNames","LogLevel","Trace","Debug","Info","Warn","Error","Silent","TauriTransport2","send","payload","_LogLevelNames_payload_level","_payload_args","levelName","level","invoke","message","String","platform","args","catch","err","error"],"sources":["tauri.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar tauri_exports = {};\n__export(tauri_exports, {\n TauriTransport: () => TauriTransport\n});\nmodule.exports = __toCommonJS(tauri_exports);\nvar import_core = require(\"@tauri-apps/api/core\");\nvar import_types = require(\"../types\");\nfunction _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\nvar logger = console;\nvar LogLevelNames = {\n [import_types.LogLevel.Trace]: \"trace\",\n [import_types.LogLevel.Debug]: \"debug\",\n [import_types.LogLevel.Info]: \"info\",\n [import_types.LogLevel.Warn]: \"warn\",\n [import_types.LogLevel.Error]: \"error\",\n [import_types.LogLevel.Silent]: \"silent\"\n};\nvar TauriTransport = /* @__PURE__ */ (function() {\n \"use strict\";\n function TauriTransport2() {\n _class_call_check(this, TauriTransport2);\n }\n _create_class(TauriTransport2, [\n {\n key: \"send\",\n value: function send(payload) {\n try {\n var _LogLevelNames_payload_level, _payload_args;\n var levelName = (_LogLevelNames_payload_level = LogLevelNames[payload.level]) !== null && _LogLevelNames_payload_level !== void 0 ? _LogLevelNames_payload_level : \"info\";\n (0, import_core.invoke)(\"log_message\", {\n payload: {\n level: levelName,\n message: String(payload.message),\n platform: payload.platform,\n args: (_payload_args = payload.args) !== null && _payload_args !== void 0 ? _payload_args : []\n }\n }).catch(function(err) {\n logger.error(\"Failed to send log to Tauri:\", err);\n });\n } catch (err) {\n logger.error(err);\n }\n }\n }\n ]);\n return TauriTransport2;\n})();\n//# sourceMappingURL=tauri.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IAAI,EAAE;IAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;IAAEE,UAAU,EAAE;EAAK,CAAC,CAAC;AACjE,CAAC;AACD,IAAIC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;EAC5C,IAAIF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,UAAU,EAAE;IAClE,KAAK,I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BAA4B,GAAGX,aAAa,CAACU,OAAO,CAACI,KAAK,CAAC,MAAM,IAAI,IAAIH,4BAA4B,KAAK,KAAK,CAAC,GAAGA,4BAA4B,GAAG,MAAM;QACzK,CAAC,CAAC,EAAE9B,WAAW,CAACkC,MAAM,EAAE,aAAa,EAAE;UACrCL,OAAO,EAAE;YACPI,KAAK,EAAED,SAAS;YAChBG,OAAO,EAAEC,MAAM,CAACP,OAAO,CAACM,OAAO,CAAC;YAChCE,QAAQ,EAAER,OAAO,CAACQ,QAAQ;YAC1BC,IAAI,EAAE,CAACP,aAAa,GAAGF,OAAO,CAACS,IAAI,MAAM,IAAI,IAAIP,aAAa,KAAK,KAAK,CAAC,GAAGA,aAAa,GAAG;UAC9F;QACF,CAAC,CAAC,CAACQ,KAAK,CAAC,UAASC,GAAG,EAAE;UACrBvB,MAAM,CAACwB,KAAK,CAAC,8BAA8B,EAAED,GAAG,CAAC;QACnD,CAAC,CAAC;MACJ,CAAC,CAAC,OAAOA,GAAG,EAAE;QACZvB,MAAM,CAACwB,KAAK,CAACD,GAAG,CAAC;MACnB;IACF;EACF,CAAC,CACF,CAAC;EACF,OAAOb,eAAe;AACxB,CAAC,CAAE,CAAC","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
+ get: () => from[key],
9
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
+ });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
15
+ value: true
16
+ }), mod);
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
14
+ return to;
15
+ };
16
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
17
+ value: true
18
+ }), mod);
19
+ var types_exports = {};
20
+ module.exports = __toCommonJS(types_exports);
21
+ //# sourceMappingURL=types.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable","__toCommonJS","mod","value","types_exports","module","exports"],"sources":["types.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar types_exports = {};\nmodule.exports = __toCommonJS(types_exports);\n//# sourceMappingURL=types.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;EAC5C,IAAIF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,UAAU,EAAE;IAClE,KAAK,IAAIG,GAAG,IAAIV,iBAAiB,CAACO,IAAI,CAAC,EACrC,IAAI,CAACL,YAAY,CAACS,IAAI,CAACL,EAAE,EAAEI,GAAG,CAAC,IAAIA,GAAG,KAAKF,MAAM,EAC/Cb,SAAS,CAACW,EAAE,EAAEI,GAAG,EAAE;MAAEE,GAAG,EAAEA,CAAA,KAAML,IAAI,CAACG,GAAG,CAAC;MAAEG,UAAU,EAAE,EAAEJ,IAAI,GAAGX,gBAAgB,CAACS,IAAI,EAAEG,GAAG,CAAC,CAAC,IAAID,IAAI,CAACI;IAAW,CAAC,CAAC;EACxH;EACA,OAAOP,EAAE;AACX,CAAC;AACD,IAAIQ,YAAY,GAAIC,GAAG,IAAKV,WAAW,CAACV,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE;EAAEqB,KAAK,EAAE;AAAK,CAAC,CAAC,EAAED,GAAG,CAAC;AAC1F,IAAIE,aAAa,GAAG,CAAC,CAAC;AACtBC,MAAM,CAACC,OAAO,GAAGL,YAAY,CAACG,aAAa,CAAC","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: true
22
+ }), mod);
23
+ var types_exports = {};
24
+ __export(types_exports, {
25
+ LogLevel: () => LogLevel,
26
+ LogSource: () => LogSource
27
+ });
28
+ module.exports = __toCommonJS(types_exports);
29
+ var LogLevel = /* @__PURE__ */(LogLevel2 => {
30
+ LogLevel2[LogLevel2["Trace"] = 0] = "Trace";
31
+ LogLevel2[LogLevel2["Debug"] = 1] = "Debug";
32
+ LogLevel2[LogLevel2["Info"] = 2] = "Info";
33
+ LogLevel2[LogLevel2["Warn"] = 3] = "Warn";
34
+ LogLevel2[LogLevel2["Error"] = 4] = "Error";
35
+ LogLevel2[LogLevel2["Silent"] = 5] = "Silent";
36
+ return LogLevel2;
37
+ })(LogLevel || {});
38
+ var LogSource = /* @__PURE__ */(LogSource2 => {
39
+ LogSource2["Main"] = "main";
40
+ LogSource2["Renderer"] = "renderer";
41
+ LogSource2["Default"] = "default";
42
+ return LogSource2;
43
+ })(LogSource || {});
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
+ value: true
24
+ }), mod);
25
+ var types_exports = {};
26
+ __export(types_exports, {
27
+ LogLevel: () => LogLevel,
28
+ LogSource: () => LogSource
29
+ });
30
+ module.exports = __toCommonJS(types_exports);
31
+ var LogLevel = /* @__PURE__ */function (LogLevel2) {
32
+ LogLevel2[LogLevel2["Trace"] = 0] = "Trace";
33
+ LogLevel2[LogLevel2["Debug"] = 1] = "Debug";
34
+ LogLevel2[LogLevel2["Info"] = 2] = "Info";
35
+ LogLevel2[LogLevel2["Warn"] = 3] = "Warn";
36
+ LogLevel2[LogLevel2["Error"] = 4] = "Error";
37
+ LogLevel2[LogLevel2["Silent"] = 5] = "Silent";
38
+ return LogLevel2;
39
+ }({});
40
+ var LogSource = /* @__PURE__ */function (LogSource2) {
41
+ LogSource2["Main"] = "main";
42
+ LogSource2["Renderer"] = "renderer";
43
+ LogSource2["Default"] = "default";
44
+ return LogSource2;
45
+ }({});
46
+ //# sourceMappingURL=types.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","types_exports","LogLevel","LogSource","module","exports","LogLevel2","LogSource2"],"sources":["types.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar types_exports = {};\n__export(types_exports, {\n LogLevel: () => LogLevel,\n LogSource: () => LogSource\n});\nmodule.exports = __toCommonJS(types_exports);\nvar LogLevel = /* @__PURE__ */ (function(LogLevel2) {\n LogLevel2[LogLevel2[\"Trace\"] = 0] = \"Trace\";\n LogLevel2[LogLevel2[\"Debug\"] = 1] = \"Debug\";\n LogLevel2[LogLevel2[\"Info\"] = 2] = \"Info\";\n LogLevel2[LogLevel2[\"Warn\"] = 3] = \"Warn\";\n LogLevel2[LogLevel2[\"Error\"] = 4] = \"Error\";\n LogLevel2[LogLevel2[\"Silent\"] = 5] = \"Silent\";\n return LogLevel2;\n})({});\nvar LogSource = /* @__PURE__ */ (function(LogSource2) {\n LogSource2[\"Main\"] = \"main\";\n LogSource2[\"Renderer\"] = \"renderer\";\n LogSource2[\"Default\"] = \"default\";\n return LogSource2;\n})({});\n//# sourceMappingURL=types.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IAAI,EAAE;IAAEC,GAAG,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,GAAG,OAAO;EAC3CA,SAAS,CAACA,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;EACzCA,SAAS,CAACA,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;EACzCA,SAAS,CAACA,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO;EAC3CA,SAAS,CAACA,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;EAC7C,OAAOA,SAAS;AAClB,CAAC,CAAE,CAAC,CAAC,CAAC;AACN,IAAIH,SAAS,GAAG,eAAiB,UAASI,UAAU,EAAE;EACpDA,UAAU,CAAC,MAAM,CAAC,GAAG,MAAM;EAC3BA,UAAU,CAAC,UAAU,CAAC,GAAG,UAAU;EACnCA,UAAU,CAAC,SAAS,CAAC,GAAG,SAAS;EACjC,OAAOA,UAAU;AACnB,CAAC,CAAE,CAAC,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,81 @@
1
+ import log from "loglevel";
2
+ import { platform } from "@multiplatform.one/platform";
3
+ import { LogLevel } from "./types.mjs";
4
+ const defaultLoggerConfig = {
5
+ name: "default",
6
+ type: "pretty",
7
+ level: process.env.NODE_ENV === "development" ? LogLevel.Debug : LogLevel.Info
8
+ };
9
+ class BaseLogger {
10
+ transport;
11
+ metadata;
12
+ logger;
13
+ name;
14
+ constructor(config = {}) {
15
+ const {
16
+ metadata,
17
+ name,
18
+ level
19
+ } = typeof config === "string" ? {
20
+ metadata: void 0,
21
+ name: config,
22
+ level: void 0
23
+ } : config;
24
+ this.metadata = metadata || {};
25
+ this.name = name || "default";
26
+ this.logger = name ? log.getLogger(name) : log;
27
+ if (level !== void 0) this.logger.setLevel(level);
28
+ this.transport = this.createTransport?.();
29
+ }
30
+ trace(...args) {
31
+ this.logger.trace(...args);
32
+ this.sendToTransport(LogLevel.Trace, args);
33
+ }
34
+ debug(...args) {
35
+ this.logger.debug(...args);
36
+ this.sendToTransport(LogLevel.Debug, args);
37
+ }
38
+ info(...args) {
39
+ this.logger.info(...args);
40
+ this.sendToTransport(LogLevel.Info, args);
41
+ }
42
+ warn(...args) {
43
+ this.logger.warn(...args);
44
+ this.sendToTransport(LogLevel.Warn, args);
45
+ }
46
+ error(...args) {
47
+ this.logger.error(...args);
48
+ this.sendToTransport(LogLevel.Error, args);
49
+ }
50
+ log(...args) {
51
+ this.logger.debug(...args);
52
+ this.sendToTransport(LogLevel.Debug, args);
53
+ }
54
+ sendToTransport(level, args) {
55
+ if (this.transport) {
56
+ this.transport.send({
57
+ level,
58
+ message: args[0],
59
+ args: args.slice(1),
60
+ platform: platform.preciseName,
61
+ timestamp: (/* @__PURE__ */new Date()).toISOString()
62
+ });
63
+ }
64
+ }
65
+ getSubLogger(input) {
66
+ const subConfig = typeof input === "string" ? {
67
+ name: input,
68
+ metadata: this.metadata,
69
+ level: this.logger.getLevel()
70
+ } : {
71
+ ...input,
72
+ metadata: {
73
+ ...this.metadata,
74
+ ...input.metadata
75
+ }
76
+ };
77
+ return new this.constructor(subConfig);
78
+ }
79
+ }
80
+ export { BaseLogger, defaultLoggerConfig };
81
+ //# sourceMappingURL=base.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["log","platform","LogLevel","defaultLoggerConfig","name","type","level","process","env","NODE_ENV","Debug","Info","BaseLogger","transport","metadata","logger","constructor","config","getLogger","setLevel","createTransport","trace","args","sendToTransport","Trace","debug","info","warn","Warn","error","Error","send","message","slice","preciseName","timestamp","Date","toISOString","getSubLogger","input","subConfig","getLevel"],"sources":["../../src/base.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,GAAA,MAAS;AAChB,SAASC,QAAA,QAAgB;AAGzB,SAASC,QAAA,QAAgB;AAElB,MAAMC,mBAAA,GAAuD;EAClEC,IAAA,EAAM;EACNC,IAAA,EAAM;EACNC,KAAA,EAAOC,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,gBAAgBP,QAAA,CAAS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