@routier/core 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assertions/index.d.ts +30 -0
- package/dist/assertions/index.js +88 -4
- package/dist/assertions/index.js.map +1 -1
- package/dist/capabilities/index.js +25 -16
- package/dist/capabilities/index.js.map +1 -1
- package/dist/codegen/blocks.test.d.ts +1 -0
- package/dist/codegen/handlers/SetHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/index.d.ts +1 -0
- package/dist/codegen/handlers/serialize/SerializeComputedHandler.d.ts +6 -0
- package/dist/codegen/handlers/set/SetComplexHandler.d.ts +6 -0
- package/dist/codegen/index.js +1 -0
- package/dist/codegen/index.js.map +1 -1
- package/dist/codegen/utils.test.d.ts +1 -0
- package/dist/collections/Changes.d.ts +2 -2
- package/dist/collections/IdSet.test.d.ts +1 -0
- package/dist/collections/TagCollection.contract.test.d.ts +1 -0
- package/dist/collections/TagCollection.d.ts +7 -7
- package/dist/collections/index.js +1 -1
- package/dist/collections/index.js.map +1 -1
- package/dist/expressions/constants.d.ts +2 -0
- package/dist/expressions/index.d.ts +2 -0
- package/dist/expressions/index.js +401 -34
- package/dist/expressions/index.js.map +1 -1
- package/dist/expressions/sql.d.ts +28 -0
- package/dist/expressions/sql.test.d.ts +1 -0
- package/dist/expressions/utils.d.ts +1 -2
- package/dist/index.js +1669 -610
- package/dist/index.js.map +1 -1
- package/dist/performance/index.js +18 -7
- package/dist/performance/index.js.map +1 -1
- package/dist/pipeline/index.js +18 -7
- package/dist/pipeline/index.js.map +1 -1
- package/dist/plugins/index.d.ts +0 -1
- package/dist/plugins/index.js +126 -694
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/query/Query.test.d.ts +1 -0
- package/dist/plugins/query/QueryOptionsCollection.d.ts +1 -0
- package/dist/plugins/translators/SqlTranslator.test.d.ts +1 -0
- package/dist/plugins/translators/TranslatedArrayValue.d.ts +3 -1
- package/dist/plugins/translators/TranslatedGroupValue.d.ts +3 -1
- package/dist/plugins/translators/TranslatedSingleValue.d.ts +3 -1
- package/dist/plugins/translators/TranslatedValues.test.d.ts +1 -0
- package/dist/plugins/translators/types.d.ts +8 -1
- package/dist/plugins/types.d.ts +6 -10
- package/dist/results/Result.d.ts +2 -2
- package/dist/results/Result.test.d.ts +1 -0
- package/dist/results/index.js.map +1 -1
- package/dist/results/utils.test.d.ts +1 -0
- package/dist/schema/PropertyInfo.d.ts +5 -1
- package/dist/schema/SchemaDefinition.d.ts +29 -1
- package/dist/schema/communication/broadcast.test.d.ts +1 -0
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/index.js +1151 -132
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/property/base/SchemaBase.d.ts +3 -1
- package/dist/schema/property/modifiers/SchemaDeserialize.d.ts +5 -1
- package/dist/schema/property/modifiers/SchemaForeignKey.d.ts +15 -0
- package/dist/schema/property/modifiers/SchemaKey.d.ts +2 -0
- package/dist/schema/property/modifiers/SchemaNullable.d.ts +5 -1
- package/dist/schema/property/modifiers/SchemaOptional.d.ts +3 -1
- package/dist/schema/property/modifiers/SchemaTag.d.ts +27 -0
- package/dist/schema/property/modifiers/SchemaTracked.d.ts +5 -1
- package/dist/schema/property/modifiers/index.d.ts +2 -0
- package/dist/schema/property/types/SchemaArray.d.ts +2 -0
- package/dist/schema/property/types/SchemaBoolean.d.ts +2 -0
- package/dist/schema/property/types/SchemaDate.d.ts +2 -0
- package/dist/schema/property/types/SchemaNumber.d.ts +5 -1
- package/dist/schema/property/types/SchemaObject.d.ts +2 -0
- package/dist/schema/property/types/SchemaString.d.ts +5 -1
- package/dist/schema/types.d.ts +37 -27
- package/dist/schema/utils/standardJsonSchema.d.ts +90 -0
- package/dist/schema/utils/standardJsonSchema.test.d.ts +1 -0
- package/dist/utilities/functions.d.ts +1 -1
- package/dist/utilities/index.js +153 -15
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/runtime.test.d.ts +1 -0
- package/dist/utilities/uuid.test.d.ts +1 -0
- package/package.json +2 -2
- package/readme.md +1 -1
- package/dist/plugins/replication/OptimisticReplicationDbPlugin.d.ts +0 -23
- package/dist/plugins/replication/ReplicationDbPlugin.d.ts +0 -22
- package/dist/plugins/replication/index.d.ts +0 -3
- package/dist/plugins/replication/types.d.ts +0 -5
- package/dist/schema/testSchemas.test.d.ts +0 -314
- /package/dist/{pipeline/WorkPipeline.test.d.ts → codegen/SlotPath.test.d.ts} +0 -0
|
@@ -4,16 +4,27 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4
4
|
__webpack_require__.d(__webpack_exports__, {
|
|
5
5
|
logger: () => (logger)
|
|
6
6
|
});
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Enable logging by setting `globalThis.__ROUTIER_DEBUG__ = true` before any routier code runs.
|
|
9
|
+
*/
|
|
10
|
+
const shouldLog = () => {
|
|
11
|
+
if (typeof globalThis !== 'undefined') {
|
|
12
|
+
const g = globalThis;
|
|
13
|
+
if (g.__ROUTIER_DEBUG__ === true)
|
|
14
|
+
return true;
|
|
10
15
|
}
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
if (typeof process !== 'undefined' && process.env != null) {
|
|
17
|
+
const debug = process.env.DEBUG;
|
|
18
|
+
if (debug === 'routier' || debug === '*')
|
|
19
|
+
return true;
|
|
20
|
+
const env = "development"?.toLowerCase();
|
|
21
|
+
if (env === 'dev' || env === 'development' || env === 'test')
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
13
25
|
};
|
|
14
|
-
const shouldLog = isDevelopment();
|
|
15
26
|
const tryLog = (type, ...args) => {
|
|
16
|
-
if (shouldLog) {
|
|
27
|
+
if (shouldLog()) {
|
|
17
28
|
console[type](...args);
|
|
18
29
|
}
|
|
19
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performance/index.js","sources":["webpack://@routier/core/./src/utilities/logger.ts","webpack://@routier/core/webpack/runtime/define_property_getters","webpack://@routier/core/webpack/runtime/has_own_property","webpack://@routier/core/webpack/runtime/make_namespace_object","webpack://@routier/core/./src/performance/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"performance/index.js","sources":["webpack://@routier/core/./src/utilities/logger.ts","webpack://@routier/core/webpack/runtime/define_property_getters","webpack://@routier/core/webpack/runtime/has_own_property","webpack://@routier/core/webpack/runtime/make_namespace_object","webpack://@routier/core/./src/performance/index.ts"],"sourcesContent":["/**\n * Enable logging by setting `globalThis.__ROUTIER_DEBUG__ = true` before any routier code runs.\n */\nconst shouldLog = (): boolean => {\n if (typeof globalThis !== 'undefined') {\n const g = globalThis as { __ROUTIER_DEBUG__?: boolean };\n if (g.__ROUTIER_DEBUG__ === true) return true;\n }\n\n if (typeof process !== 'undefined' && process.env != null) {\n const debug = process.env.DEBUG;\n if (debug === 'routier' || debug === '*') return true;\n const env = process.env.NODE_ENV?.toLowerCase();\n if (env === 'dev' || env === 'development' || env === 'test') return true;\n }\n\n return false;\n};\n\ntype LogMethods = \"log\" | \"info\" | \"warn\" | \"error\" | \"debug\" | \"table\";\nconst tryLog = (type: LogMethods, ...args: unknown[]) => {\n if (shouldLog()) {\n (console[type] as (...args: unknown[]) => void)(...args);\n }\n};\n\nexport const logger = {\n log: (...args: unknown[]): void => {\n tryLog(\"log\", ...args);\n },\n info: (...args: unknown[]): void => {\n tryLog(\"info\", ...args);\n },\n warn: (...args: unknown[]): void => {\n tryLog(\"warn\", ...args);\n },\n error: (...args: unknown[]): void => {\n tryLog(\"error\", ...args);\n },\n debug: (...args: unknown[]): void => {\n tryLog(\"debug\", ...args);\n },\n table: (...args: unknown[]): void => {\n tryLog(\"table\", ...args);\n },\n};\n\n","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { logger } from \"../utilities\";\n\nconst measurements: Record<string, number> = {}\n\nexport const now = (): number => {\n if (typeof performance !== 'undefined' && performance.now) {\n // Browser or modern Node.js\n return performance.now();\n }\n\n // Fallback for older environments\n return Date.now();\n}\n\nexport const measure = {\n start: (name: string): void => {\n measurements[name] = now();\n },\n end: (name: string): void => {\n const start = measurements[name];\n\n delete measurements[name];\n\n const delta = now() - start;\n\n logger.log(`[ROUTIER] - Performance: ${name} took ${delta}`);\n }\n}"],"names":[],"mappings":";;;;;;AAAA;;GAEG;AACH,MAAM,SAAS,GAAG,GAAY,EAAE;IAC5B,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,CAAC;QACpC,MAAM,CAAC,GAAG,UAA6C,CAAC;QACxD,IAAI,CAAC,CAAC,iBAAiB,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;IAClD,CAAC;IAED,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QACxD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;QAChC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QACtD,MAAM,GAAG,GAAG,aAAoB,EAAE,WAAW,EAAE,CAAC;QAChD,IAAI,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,aAAa,IAAI,GAAG,KAAK,MAAM;YAAE,OAAO,IAAI,CAAC;IAC9E,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAGF,MAAM,MAAM,GAAG,CAAC,IAAgB,EAAE,GAAG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AA4B;QAC5B,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC;IAC7B,CAAC;IAED,kCAAkC;IAClC,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;AACtB,CAAC;AAEM,MAAM,OAAO,GAAG;IACnB,KAAK,EAAE,CAAC,IAAY,EAAQ,EAAE;QAC1B,YAAY,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;IAC/B,CAAC;IACD,GAAG,EAAE,CAAC,IAAY,EAAQ,EAAE;QACxB,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QAEjC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QAE1B,MAAM,KAAK,GAAG,GAAG,EAAE,GAAG,KAAK,CAAC;QAE5B,sCAAU,CAAC,4BAA4B,IAAI,SAAS,KAAK,EAAE,CAAC,CAAC;IACjE,CAAC;CACJ"}
|
package/dist/pipeline/index.js
CHANGED
|
@@ -382,16 +382,27 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
382
382
|
__webpack_require__.d(__webpack_exports__, {
|
|
383
383
|
logger: () => (logger)
|
|
384
384
|
});
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
385
|
+
/**
|
|
386
|
+
* Enable logging by setting `globalThis.__ROUTIER_DEBUG__ = true` before any routier code runs.
|
|
387
|
+
*/
|
|
388
|
+
const shouldLog = () => {
|
|
389
|
+
if (typeof globalThis !== 'undefined') {
|
|
390
|
+
const g = globalThis;
|
|
391
|
+
if (g.__ROUTIER_DEBUG__ === true)
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
if (typeof process !== 'undefined' && process.env != null) {
|
|
395
|
+
const debug = process.env.DEBUG;
|
|
396
|
+
if (debug === 'routier' || debug === '*')
|
|
397
|
+
return true;
|
|
398
|
+
const env = "development"?.toLowerCase();
|
|
399
|
+
if (env === 'dev' || env === 'development' || env === 'test')
|
|
400
|
+
return true;
|
|
388
401
|
}
|
|
389
|
-
|
|
390
|
-
return env === 'dev' || env === 'development' || env === 'test';
|
|
402
|
+
return false;
|
|
391
403
|
};
|
|
392
|
-
const shouldLog = isDevelopment();
|
|
393
404
|
const tryLog = (type, ...args) => {
|
|
394
|
-
if (shouldLog) {
|
|
405
|
+
if (shouldLog()) {
|
|
395
406
|
console[type](...args);
|
|
396
407
|
}
|
|
397
408
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/index.js","sources":["webpack://@routier/core/./src/pipeline/SyncronousQueue.ts","webpack://@routier/core/./src/pipeline/TrampolinePipeline.ts","webpack://@routier/core/./src/results/Result.ts","webpack://@routier/core/./src/utilities/logger.ts","webpack://@routier/core/webpack/runtime/define_property_getters","webpack://@routier/core/webpack/runtime/has_own_property","webpack://@routier/core/webpack/runtime/make_namespace_object","webpack://@routier/core/./src/pipeline/index.ts"],"sourcesContent":["export type SyncronousUnitOfWork = (done: () => void) => void\n\nexport class SyncronousQueue {\n\n private readonly _queue: SyncronousUnitOfWork[] = [];\n private _current: SyncronousUnitOfWork | null = null;\n\n enqueue(unitOfWork: SyncronousUnitOfWork) {\n this._queue.push(unitOfWork);\n this._next();\n }\n\n private _next() {\n if (this._current != null || this._queue.length === 0) {\n return;\n }\n\n // Take first item\n this._current = this._queue.shift() ?? null;\n\n if (this._current == null) {\n return;\n }\n\n this._current(() => {\n this._current = null;\n this._next();\n })\n }\n}","import { logger } from \"../utilities\";\nimport { CallbackResult, Result, ResultType } from \"../results\";\n\n/**\n * Type definition for an asynchronous function that takes data and a callback.\n * TIn: The input data type.\n * TOut: The output data type (passed to the callback).\n */\nexport type Processor<TIn, TOut> = (data: TIn, callback: (result: TOut, error?: any) => void) => void;\n\n// Return type for a step execution: Either the next step function or null if waiting/done.\ntype StepResult<TData> = TrampolineStep<TData> | null;\ntype TrampolineStep<TData> = () => StepResult<TData>;\n\nexport class TrampolinePipeline<TInitial, TCurrent = TInitial> {\n private _list: Processor<any, any>[] = [];\n private _hasErrored: boolean = false; // Flag to prevent calling done on error\n\n filter<TFinal>(initialData: TInitial, done: (data: TFinal, error?: any) => void) {\n\n this._hasErrored = false; // Reset error flag on new execution\n\n if (this._list.length === 0) {\n done(initialData as unknown as TFinal);\n return;\n }\n\n let index = 0;\n let currentData: any = initialData;\n let isRunning = false; // Guard against overlapping trampoline calls\n\n try {\n // --- Revised Completion Logic --- (Moved up for clarity)\n const finalStepSentinel = (): StepResult<any> => { // A special step function for the very end\n // Only call done if no error has occurred\n if (!this._hasErrored) {\n done(currentData as TFinal);\n }\n return null; // Stop the trampoline\n };\n\n const createStepRevised = (idx: number): TrampolineStep<any> => {\n return () => {\n if (this._hasErrored) return null; // Stop if an error occurred elsewhere\n\n if (idx >= this._list.length) {\n return finalStepSentinel(); // Execute the dedicated final step\n }\n\n const processor = this._list[idx];\n // Initialize syncCallbackResult to null to satisfy StepResult type\n let syncCallbackResult: StepResult<any> = null;\n let calledSync = false;\n\n try {\n processor(currentData, (result, error) => {\n // --- Error Handling ---\n if (error) {\n logger.error(`Error reported by processor at index ${idx}:`, error);\n this._hasErrored = true; // Set flag\n // Throw the error to be caught by outer try...catch blocks\n throw error;\n }\n // --- /Error Handling ---\n\n // If no error, proceed as before\n currentData = result;\n index = idx + 1; // Update index for the next step\n const nextStep = createStepRevised(index); // Use updated index\n\n if (isRunning) {\n // Callback was synchronous\n syncCallbackResult = nextStep; // Store next step function\n calledSync = true;\n } else {\n // Callback was asynchronous, restart trampoline\n trampoline(nextStep);\n }\n });\n } catch (error) {\n if (!this._hasErrored) { // Check flag to avoid double logging if error was from callback\n logger.error(`Error thrown by processor at index ${idx} or its callback:`, error);\n this._hasErrored = true;\n }\n // Rethrow to be caught by the trampoline's catch block\n throw error;\n }\n\n if (calledSync) {\n // Return the next step function for the sync loop\n return syncCallbackResult;\n } else {\n // Pause trampoline for async, loop will stop as step returns null\n return null;\n }\n };\n };\n\n // The trampoline loop\n const trampoline = (step: TrampolineStep<any> | null) => {\n\n if (isRunning) {\n return;\n }\n\n isRunning = true;\n let currentStep = step;\n\n while (currentStep !== null) {\n try {\n // Stop immediately if an error was flagged elsewhere\n if (this._hasErrored) {\n currentStep = null;\n break;\n }\n currentStep = currentStep(); // Execute step, get next step or null\n } catch (trampolineError) {\n // Catch errors propagated from step execution (processor or callback errors)\n if (!this._hasErrored) { // Avoid double logging\n logger.error(\"Error during trampoline step execution:\", trampolineError);\n this._hasErrored = true;\n }\n currentStep = null; // Stop the loop\n // We don't call `done` here because an error occurred.\n // The application should handle the uncaught exception if desired.\n break; // Explicitly break loop on error\n }\n }\n // Loop ends when currentStep is null or loop is broken by error\n isRunning = false;\n\n // Completion check is now handled by finalStepSentinel ensuring `done` isn't called on error.\n };\n\n // --- Start the process ---\n index = 0; // Reset index\n currentData = initialData; // Reset data\n trampoline(createStepRevised(0)); // Start with the revised step creator\n } catch (error: any) {\n done(currentData, error);\n }\n }\n\n pipe<TNext>(processor: Processor<TCurrent, TNext>) {\n this._list.push(processor);\n return this as unknown as TrampolinePipeline<TInitial, TNext>;\n }\n\n pipeEach(items: TCurrent[], fn: (payload: ResultType<TCurrent>, done: CallbackResult<TCurrent>) => void, map: (previous: ResultType<TCurrent>, current: ResultType<TCurrent>) => ResultType<TCurrent>) {\n for (let i = 0, length = items.length; i < length; i++) {\n\n this.pipe<ResultType<TCurrent>>((previous, done) => {\n\n fn(map(previous as ResultType<TCurrent>, Result.success(items[i])), done);\n });\n }\n }\n}\n\nexport type UnitOfWork = (done: CallbackResult<never>) => void;\n\n/**\n * Processes functions with callbacks asynchronously.\n * \n * This pipeline handles work items that contain callback functions,\n * executing them in an asynchronous manner while maintaining proper\n * flow control and error handling.\n */\nexport class WorkPipeline {\n private unitsOfWork: UnitOfWork[] = [];\n private _hasErrored: boolean = false; // Flag to prevent calling done on error\n\n filter(done: CallbackResult<never>) {\n\n this._hasErrored = false; // Reset error flag on new execution\n\n if (this.unitsOfWork.length === 0) {\n done(Result.success());\n return;\n }\n\n let index = 0;\n let isRunning = false; // Guard against overlapping trampoline calls\n\n try {\n // --- Revised Completion Logic --- (Moved up for clarity)\n const finalStepSentinel = (): StepResult<never> => { // A special step function for the very end\n // Only call done if no error has occurred\n if (!this._hasErrored) {\n done(Result.success());\n }\n return null; // Stop the trampoline\n };\n\n const createStepRevised = (idx: number): TrampolineStep<any> => {\n return () => {\n if (this._hasErrored) return null; // Stop if an error occurred elsewhere\n\n if (idx >= this.unitsOfWork.length) {\n return finalStepSentinel(); // Execute the dedicated final step\n }\n\n const processor = this.unitsOfWork[idx];\n // Initialize syncCallbackResult to null to satisfy StepResult type\n let syncCallbackResult: StepResult<any> = null;\n let calledSync = false;\n\n try {\n processor((result) => {\n // --- Error Handling ---\n if (result.ok === Result.ERROR) {\n logger.error(`Error reported by AsyncPipeline at index ${idx}:`, result.error);\n this._hasErrored = true; // Set flag\n // Throw the error to be caught by outer try...catch blocks\n throw result.error;\n }\n // --- /Error Handling ---\n\n // If no error, proceed as before\n index = idx + 1; // Update index for the next step\n const nextStep = createStepRevised(index); // Use updated index\n\n if (isRunning) {\n // Callback was synchronous\n syncCallbackResult = nextStep; // Store next step function\n calledSync = true;\n } else {\n // Callback was asynchronous, restart trampoline\n trampoline(nextStep);\n }\n });\n } catch (error) {\n if (!this._hasErrored) { // Check flag to avoid double logging if error was from callback\n logger.error(`Error thrown by processor at index ${idx} or its callback:`, error);\n this._hasErrored = true;\n }\n // Rethrow to be caught by the trampoline's catch block\n throw error;\n }\n\n if (calledSync) {\n // Return the next step function for the sync loop\n return syncCallbackResult;\n } else {\n // Pause trampoline for async, loop will stop as step returns null\n return null;\n }\n };\n };\n\n // The trampoline loop\n const trampoline = (step: TrampolineStep<any> | null) => {\n\n if (isRunning) {\n return;\n }\n\n isRunning = true;\n let currentStep = step;\n\n while (currentStep !== null) {\n try {\n // Stop immediately if an error was flagged elsewhere\n if (this._hasErrored) {\n currentStep = null;\n break;\n }\n currentStep = currentStep(); // Execute step, get next step or null\n } catch (trampolineError) {\n // Catch errors propagated from step execution (processor or callback errors)\n if (!this._hasErrored) { // Avoid double logging\n logger.error(\"Error during trampoline step execution:\", trampolineError);\n this._hasErrored = true;\n }\n currentStep = null; // Stop the loop\n // We don't call `done` here because an error occurred.\n // The application should handle the uncaught exception if desired.\n break; // Explicitly break loop on error\n }\n }\n // Loop ends when currentStep is null or loop is broken by error\n isRunning = false;\n\n // Completion check is now handled by finalStepSentinel ensuring `done` isn't called on error.\n };\n\n // --- Start the process ---\n index = 0; // Reset index\n trampoline(createStepRevised(0)); // Start with the revised step creator\n } catch (error: any) {\n done(Result.error(error));\n }\n }\n\n pipe(work: UnitOfWork) {\n this.unitsOfWork.push(work);\n }\n}","import { PartialResultType, PluginEventPartialResultType, PluginEventResultType, ResultType } from \"./types\";\n\nabstract class BaseResult {\n static ERROR = \"error\" as const;\n static SUCCESS = \"success\" as const;\n static PARTIAL = \"partial\" as const;\n\n static resolve<T>(result: ResultType<T> | PartialResultType<T>, resolve: (data: T) => void, reject: (error?: any) => void) {\n if (result.ok === BaseResult.SUCCESS) {\n resolve(result.data);\n return;\n }\n\n if (result.ok === BaseResult.PARTIAL) {\n reject({\n partial: result.data,\n error: result.error\n });\n return;\n }\n\n reject(result.error);\n }\n\n static assertSuccess<T>(result: any): asserts result is { ok: \"success\"; data: T } {\n if (result.ok !== BaseResult.SUCCESS) {\n throw new Error(`Expected success result, but got ${result.ok}: ${result.error}`);\n }\n }\n}\n\nexport class Result extends BaseResult {\n static success<T>(data: T): ResultType<T>;\n static success<T>(): ResultType<never>;\n static success<T>(data?: T): ResultType<T> {\n return {\n ok: Result.SUCCESS,\n data\n }\n }\n\n static error<T>(error: any): ResultType<T> {\n return {\n ok: Result.ERROR,\n error\n }\n }\n\n static partial<T>(data: T, error: any): PartialResultType<T> {\n return {\n ok: Result.PARTIAL,\n data,\n error\n }\n }\n}\n\nexport class PluginEventResult extends BaseResult {\n static success<T>(id: string, data: T): PluginEventResultType<T>;\n static success<T>(id: string): PluginEventResultType<never>;\n static success<T>(id: string, data?: T): PluginEventResultType<T> {\n return {\n id,\n ok: Result.SUCCESS,\n data\n }\n }\n\n static error<T>(id: string, error: any): PluginEventResultType<T> {\n return {\n id,\n ok: Result.ERROR,\n error\n }\n }\n\n static partial<T>(id: string, data: T, error: any): PluginEventPartialResultType<T> {\n return {\n id,\n ok: Result.PARTIAL,\n data,\n error\n }\n }\n\n static assertSuccess<T>(result: PluginEventResultType<T>): asserts result is { ok: \"success\"; data: T; id: string } {\n if (result.ok !== Result.SUCCESS) {\n throw new Error(`Expected success result, but got ${result.ok}: ${result.error}`);\n }\n }\n}\n","const isDevelopment = (): boolean => {\n if (typeof process === 'undefined' || process.env == null) {\n return false;\n }\n const env = process.env.NODE_ENV?.toLowerCase();\n return env === 'dev' || env === 'development' || env === 'test';\n};\n\ntype LogMethods = \"log\" | \"info\" | \"warn\" | \"error\" | \"debug\" | \"table\";\nconst shouldLog = isDevelopment();\nconst tryLog = (type: LogMethods, ...args: unknown[]) => {\n if (shouldLog) {\n (console[type] as (...args: unknown[]) => void)(...args);\n }\n};\n\nexport const logger = {\n log: (...args: unknown[]): void => {\n tryLog(\"log\", ...args);\n },\n info: (...args: unknown[]): void => {\n tryLog(\"info\", ...args);\n },\n warn: (...args: unknown[]): void => {\n tryLog(\"warn\", ...args);\n },\n error: (...args: unknown[]): void => {\n tryLog(\"error\", ...args);\n },\n debug: (...args: unknown[]): void => {\n tryLog(\"debug\", ...args);\n },\n table: (...args: unknown[]): void => {\n tryLog(\"table\", ...args);\n },\n};\n\n","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from './SyncronousQueue';\nexport * from './TrampolinePipeline';"],"names":[],"mappings":";;;;;;AAEO,MAAM,eAAe;IAEP,MAAM,GAA2B,EAAE,CAAC;IAC7C,QAAQ,GAAgC,IAAI,CAAC;IAErD,OAAO,CAAC,UAAgC;QACpC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAEO,KAAK;QACT,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpD,OAAO;QACX,CAAC;QAED,kBAAkB;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,IAAI,CAAC;QAE5C,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;YACxB,OAAO;QACX,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;YACf,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,IAAI,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC,CAAC;IACN,CAAC;CACJ;;;;;;;;;;;;AC7BqC;AAC0B;AAazD,MAAM,kBAAkB;IACnB,KAAK,GAA0B,EAAE,CAAC;IAClC,WAAW,GAAY,KAAK,CAAC,CAAC,wCAAwC;IAE9E,MAAM,CAAS,WAAqB,EAAE,IAAyC;QAE3E,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC,oCAAoC;QAE9D,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,WAAgC,CAAC,CAAC;YACvC,OAAO;QACX,CAAC;QAED,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAI,WAAW,GAAQ,WAAW,CAAC;QACnC,IAAI,SAAS,GAAG,KAAK,CA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CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;IAC5B,CAAC;IACD,IAAI,EAAE,CAAC,GAAG,IAAe,EAAQ,EAAE;QAC/B,MAAM,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;IAC5B,CAAC;IACD,KAAK,EAAE,CAAC,GAAG,IAAe,EAAQ,EAAE;QAChC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,KAAK,EAAE,CAAC,GAAG,IAAe,EAAQ,EAAE;QAChC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,KAAK,EAAE,CAAC,GAAG,IAAe,EAAQ,EAAE;QAChC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IAC7B,CAAC;CACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnCF;AACA;AACA;AACA,kDAAkD,wCAAwC;AAC1F;AACA;AACA,E;;;;ACNA,wF;;;;ACAA;AACA;AACA;AACA,uDAAuD,iBAAiB;AACxE;AACA,gDAAgD,aAAa;AAC7D,E;;;;;;;;;;;;;ACNkC;AACG"}
|
|
1
|
+
{"version":3,"file":"pipeline/index.js","sources":["webpack://@routier/core/./src/pipeline/SyncronousQueue.ts","webpack://@routier/core/./src/pipeline/TrampolinePipeline.ts","webpack://@routier/core/./src/results/Result.ts","webpack://@routier/core/./src/utilities/logger.ts","webpack://@routier/core/webpack/runtime/define_property_getters","webpack://@routier/core/webpack/runtime/has_own_property","webpack://@routier/core/webpack/runtime/make_namespace_object","webpack://@routier/core/./src/pipeline/index.ts"],"sourcesContent":["export type SyncronousUnitOfWork = (done: () => void) => void\n\nexport class SyncronousQueue {\n\n private readonly _queue: SyncronousUnitOfWork[] = [];\n private _current: SyncronousUnitOfWork | null = null;\n\n enqueue(unitOfWork: SyncronousUnitOfWork) {\n this._queue.push(unitOfWork);\n this._next();\n }\n\n private _next() {\n if (this._current != null || this._queue.length === 0) {\n return;\n }\n\n // Take first item\n this._current = this._queue.shift() ?? null;\n\n if (this._current == null) {\n return;\n }\n\n this._current(() => {\n this._current = null;\n this._next();\n })\n }\n}","import { logger } from \"../utilities\";\nimport { CallbackResult, Result, ResultType } from \"../results\";\n\n/**\n * Type definition for an asynchronous function that takes data and a callback.\n * TIn: The input data type.\n * TOut: The output data type (passed to the callback).\n */\nexport type Processor<TIn, TOut> = (data: TIn, callback: (result: TOut, error?: any) => void) => void;\n\n// Return type for a step execution: Either the next step function or null if waiting/done.\ntype StepResult<TData> = TrampolineStep<TData> | null;\ntype TrampolineStep<TData> = () => StepResult<TData>;\n\nexport class TrampolinePipeline<TInitial, TCurrent = TInitial> {\n private _list: Processor<any, any>[] = [];\n private _hasErrored: boolean = false; // Flag to prevent calling done on error\n\n filter<TFinal>(initialData: TInitial, done: (data: TFinal, error?: any) => void) {\n\n this._hasErrored = false; // Reset error flag on new execution\n\n if (this._list.length === 0) {\n done(initialData as unknown as TFinal);\n return;\n }\n\n let index = 0;\n let currentData: any = initialData;\n let isRunning = false; // Guard against overlapping trampoline calls\n\n try {\n // --- Revised Completion Logic --- (Moved up for clarity)\n const finalStepSentinel = (): StepResult<any> => { // A special step function for the very end\n // Only call done if no error has occurred\n if (!this._hasErrored) {\n done(currentData as TFinal);\n }\n return null; // Stop the trampoline\n };\n\n const createStepRevised = (idx: number): TrampolineStep<any> => {\n return () => {\n if (this._hasErrored) return null; // Stop if an error occurred elsewhere\n\n if (idx >= this._list.length) {\n return finalStepSentinel(); // Execute the dedicated final step\n }\n\n const processor = this._list[idx];\n // Initialize syncCallbackResult to null to satisfy StepResult type\n let syncCallbackResult: StepResult<any> = null;\n let calledSync = false;\n\n try {\n processor(currentData, (result, error) => {\n // --- Error Handling ---\n if (error) {\n logger.error(`Error reported by processor at index ${idx}:`, error);\n this._hasErrored = true; // Set flag\n // Throw the error to be caught by outer try...catch blocks\n throw error;\n }\n // --- /Error Handling ---\n\n // If no error, proceed as before\n currentData = result;\n index = idx + 1; // Update index for the next step\n const nextStep = createStepRevised(index); // Use updated index\n\n if (isRunning) {\n // Callback was synchronous\n syncCallbackResult = nextStep; // Store next step function\n calledSync = true;\n } else {\n // Callback was asynchronous, restart trampoline\n trampoline(nextStep);\n }\n });\n } catch (error) {\n if (!this._hasErrored) { // Check flag to avoid double logging if error was from callback\n logger.error(`Error thrown by processor at index ${idx} or its callback:`, error);\n this._hasErrored = true;\n }\n // Rethrow to be caught by the trampoline's catch block\n throw error;\n }\n\n if (calledSync) {\n // Return the next step function for the sync loop\n return syncCallbackResult;\n } else {\n // Pause trampoline for async, loop will stop as step returns null\n return null;\n }\n };\n };\n\n // The trampoline loop\n const trampoline = (step: TrampolineStep<any> | null) => {\n\n if (isRunning) {\n return;\n }\n\n isRunning = true;\n let currentStep = step;\n\n while (currentStep !== null) {\n try {\n // Stop immediately if an error was flagged elsewhere\n if (this._hasErrored) {\n currentStep = null;\n break;\n }\n currentStep = currentStep(); // Execute step, get next step or null\n } catch (trampolineError) {\n // Catch errors propagated from step execution (processor or callback errors)\n if (!this._hasErrored) { // Avoid double logging\n logger.error(\"Error during trampoline step execution:\", trampolineError);\n this._hasErrored = true;\n }\n currentStep = null; // Stop the loop\n // We don't call `done` here because an error occurred.\n // The application should handle the uncaught exception if desired.\n break; // Explicitly break loop on error\n }\n }\n // Loop ends when currentStep is null or loop is broken by error\n isRunning = false;\n\n // Completion check is now handled by finalStepSentinel ensuring `done` isn't called on error.\n };\n\n // --- Start the process ---\n index = 0; // Reset index\n currentData = initialData; // Reset data\n trampoline(createStepRevised(0)); // Start with the revised step creator\n } catch (error: any) {\n done(currentData, error);\n }\n }\n\n pipe<TNext>(processor: Processor<TCurrent, TNext>) {\n this._list.push(processor);\n return this as unknown as TrampolinePipeline<TInitial, TNext>;\n }\n\n pipeEach(items: TCurrent[], fn: (payload: ResultType<TCurrent>, done: CallbackResult<TCurrent>) => void, map: (previous: ResultType<TCurrent>, current: ResultType<TCurrent>) => ResultType<TCurrent>) {\n for (let i = 0, length = items.length; i < length; i++) {\n\n this.pipe<ResultType<TCurrent>>((previous, done) => {\n\n fn(map(previous as ResultType<TCurrent>, Result.success(items[i])), done);\n });\n }\n }\n}\n\nexport type UnitOfWork = (done: CallbackResult<never>) => void;\n\n/**\n * Processes functions with callbacks asynchronously.\n * \n * This pipeline handles work items that contain callback functions,\n * executing them in an asynchronous manner while maintaining proper\n * flow control and error handling.\n */\nexport class WorkPipeline {\n private unitsOfWork: UnitOfWork[] = [];\n private _hasErrored: boolean = false; // Flag to prevent calling done on error\n\n filter(done: CallbackResult<never>) {\n\n this._hasErrored = false; // Reset error flag on new execution\n\n if (this.unitsOfWork.length === 0) {\n done(Result.success());\n return;\n }\n\n let index = 0;\n let isRunning = false; // Guard against overlapping trampoline calls\n\n try {\n // --- Revised Completion Logic --- (Moved up for clarity)\n const finalStepSentinel = (): StepResult<never> => { // A special step function for the very end\n // Only call done if no error has occurred\n if (!this._hasErrored) {\n done(Result.success());\n }\n return null; // Stop the trampoline\n };\n\n const createStepRevised = (idx: number): TrampolineStep<any> => {\n return () => {\n if (this._hasErrored) return null; // Stop if an error occurred elsewhere\n\n if (idx >= this.unitsOfWork.length) {\n return finalStepSentinel(); // Execute the dedicated final step\n }\n\n const processor = this.unitsOfWork[idx];\n // Initialize syncCallbackResult to null to satisfy StepResult type\n let syncCallbackResult: StepResult<any> = null;\n let calledSync = false;\n\n try {\n processor((result) => {\n // --- Error Handling ---\n if (result.ok === Result.ERROR) {\n logger.error(`Error reported by AsyncPipeline at index ${idx}:`, result.error);\n this._hasErrored = true; // Set flag\n // Throw the error to be caught by outer try...catch blocks\n throw result.error;\n }\n // --- /Error Handling ---\n\n // If no error, proceed as before\n index = idx + 1; // Update index for the next step\n const nextStep = createStepRevised(index); // Use updated index\n\n if (isRunning) {\n // Callback was synchronous\n syncCallbackResult = nextStep; // Store next step function\n calledSync = true;\n } else {\n // Callback was asynchronous, restart trampoline\n trampoline(nextStep);\n }\n });\n } catch (error) {\n if (!this._hasErrored) { // Check flag to avoid double logging if error was from callback\n logger.error(`Error thrown by processor at index ${idx} or its callback:`, error);\n this._hasErrored = true;\n }\n // Rethrow to be caught by the trampoline's catch block\n throw error;\n }\n\n if (calledSync) {\n // Return the next step function for the sync loop\n return syncCallbackResult;\n } else {\n // Pause trampoline for async, loop will stop as step returns null\n return null;\n }\n };\n };\n\n // The trampoline loop\n const trampoline = (step: TrampolineStep<any> | null) => {\n\n if (isRunning) {\n return;\n }\n\n isRunning = true;\n let currentStep = step;\n\n while (currentStep !== null) {\n try {\n // Stop immediately if an error was flagged elsewhere\n if (this._hasErrored) {\n currentStep = null;\n break;\n }\n currentStep = currentStep(); // Execute step, get next step or null\n } catch (trampolineError) {\n // Catch errors propagated from step execution (processor or callback errors)\n if (!this._hasErrored) { // Avoid double logging\n logger.error(\"Error during trampoline step execution:\", trampolineError);\n this._hasErrored = true;\n }\n currentStep = null; // Stop the loop\n // We don't call `done` here because an error occurred.\n // The application should handle the uncaught exception if desired.\n break; // Explicitly break loop on error\n }\n }\n // Loop ends when currentStep is null or loop is broken by error\n isRunning = false;\n\n // Completion check is now handled by finalStepSentinel ensuring `done` isn't called on error.\n };\n\n // --- Start the process ---\n index = 0; // Reset index\n trampoline(createStepRevised(0)); // Start with the revised step creator\n } catch (error: any) {\n done(Result.error(error));\n }\n }\n\n pipe(work: UnitOfWork) {\n this.unitsOfWork.push(work);\n }\n}","import { PartialResultType, PluginEventPartialResultType, PluginEventResultType, ResultType } from \"./types\";\n\nabstract class BaseResult {\n static ERROR = \"error\" as const;\n static SUCCESS = \"success\" as const;\n static PARTIAL = \"partial\" as const;\n\n static resolve<T>(result: ResultType<T> | PartialResultType<T>, resolve: (data: T) => void, reject: (error?: any) => void) {\n if (result.ok === BaseResult.SUCCESS) {\n resolve(result.data);\n return;\n }\n\n if (result.ok === BaseResult.PARTIAL) {\n reject({\n partial: result.data,\n error: result.error\n });\n return;\n }\n\n reject(result.error);\n }\n\n static assertSuccess<T>(result: any): asserts result is { ok: \"success\"; data: T } {\n if (result.ok !== BaseResult.SUCCESS) {\n throw new Error(`Expected success result, but got ${result.ok}: ${result.error}`);\n }\n }\n}\n\nexport class Result extends BaseResult {\n static success<T>(data: T): ResultType<T>;\n static success(): ResultType<never>;\n static success<T>(data?: T): ResultType<T> {\n return {\n ok: Result.SUCCESS,\n data\n }\n }\n\n static error<T>(error: any): ResultType<T> {\n return {\n ok: Result.ERROR,\n error\n }\n }\n\n static partial<T>(data: T, error: any): PartialResultType<T> {\n return {\n ok: Result.PARTIAL,\n data,\n error\n }\n }\n}\n\nexport class PluginEventResult extends BaseResult {\n static success<T>(id: string, data: T): PluginEventResultType<T>;\n static success(id: string): PluginEventResultType<never>;\n static success<T>(id: string, data?: T): PluginEventResultType<T> {\n return {\n id,\n ok: Result.SUCCESS,\n data\n }\n }\n\n static error<T>(id: string, error: any): PluginEventResultType<T> {\n return {\n id,\n ok: Result.ERROR,\n error\n }\n }\n\n static partial<T>(id: string, data: T, error: any): PluginEventPartialResultType<T> {\n return {\n id,\n ok: Result.PARTIAL,\n data,\n error\n }\n }\n\n static assertSuccess<T>(result: PluginEventResultType<T>): asserts result is { ok: \"success\"; data: T; id: string } {\n if (result.ok !== Result.SUCCESS) {\n throw new Error(`Expected success result, but got ${result.ok}: ${result.error}`);\n }\n }\n}\n","/**\n * Enable logging by setting `globalThis.__ROUTIER_DEBUG__ = true` before any routier code runs.\n */\nconst shouldLog = (): boolean => {\n if (typeof globalThis !== 'undefined') {\n const g = globalThis as { __ROUTIER_DEBUG__?: boolean };\n if (g.__ROUTIER_DEBUG__ === true) return true;\n }\n\n if (typeof process !== 'undefined' && process.env != null) {\n const debug = process.env.DEBUG;\n if (debug === 'routier' || debug === '*') return true;\n const env = process.env.NODE_ENV?.toLowerCase();\n if (env === 'dev' || env === 'development' || env === 'test') return true;\n }\n\n return false;\n};\n\ntype LogMethods = \"log\" | \"info\" | \"warn\" | \"error\" | \"debug\" | \"table\";\nconst tryLog = (type: LogMethods, ...args: unknown[]) => {\n if (shouldLog()) {\n (console[type] as (...args: unknown[]) => void)(...args);\n }\n};\n\nexport const logger = {\n log: (...args: unknown[]): void => {\n tryLog(\"log\", ...args);\n },\n info: (...args: unknown[]): void => {\n tryLog(\"info\", ...args);\n },\n warn: (...args: unknown[]): void => {\n tryLog(\"warn\", ...args);\n },\n error: (...args: unknown[]): void => {\n tryLog(\"error\", ...args);\n },\n debug: (...args: unknown[]): void => {\n tryLog(\"debug\", ...args);\n },\n table: (...args: unknown[]): void => {\n tryLog(\"table\", ...args);\n },\n};\n\n","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from './SyncronousQueue';\nexport * from './TrampolinePipeline';"],"names":[],"mappings":";;;;;;AAEO,MAAM,eAAe;IAEP,MAAM,GAA2B,EAAE,CAAC;IAC7C,QAAQ,GAAgC,IAAI,CAAC;IAErD,OAAO,CAAC,UAAgC;QACpC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAEO,KAAK;QACT,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpD,OAAO;QACX,CAAC;QAED,kBAAkB;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,IAAI,CAA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