@fluid-app/widget-runtime 0.1.0

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 (46) hide show
  1. package/README.md +77 -0
  2. package/dist/Thread-0eUyc0Hw.cjs +591 -0
  3. package/dist/Thread-0eUyc0Hw.cjs.map +1 -0
  4. package/dist/Thread-BiW7rXts.mjs +574 -0
  5. package/dist/Thread-BiW7rXts.mjs.map +1 -0
  6. package/dist/index.cjs +6 -0
  7. package/dist/index.d.cts +3 -0
  8. package/dist/index.d.mts +3 -0
  9. package/dist/index.mjs +3 -0
  10. package/dist/remote-dom-renderer-BU-73KvK.d.mts +90 -0
  11. package/dist/remote-dom-renderer-BU-73KvK.d.mts.map +1 -0
  12. package/dist/remote-dom-renderer-DSHFetvm.d.cts +90 -0
  13. package/dist/remote-dom-renderer-DSHFetvm.d.cts.map +1 -0
  14. package/dist/remote-dom-renderer-DUQf80Nu.cjs +2116 -0
  15. package/dist/remote-dom-renderer-DUQf80Nu.cjs.map +1 -0
  16. package/dist/remote-dom-renderer-DcwcNPsu.mjs +2081 -0
  17. package/dist/remote-dom-renderer-DcwcNPsu.mjs.map +1 -0
  18. package/dist/remote-dom-values-BSAxrOE7.mjs +238 -0
  19. package/dist/remote-dom-values-BSAxrOE7.mjs.map +1 -0
  20. package/dist/remote-dom-values-D4AgBNWr.d.cts +32 -0
  21. package/dist/remote-dom-values-D4AgBNWr.d.cts.map +1 -0
  22. package/dist/remote-dom-values-DbgIedSg.cjs +297 -0
  23. package/dist/remote-dom-values-DbgIedSg.cjs.map +1 -0
  24. package/dist/remote-dom-values-EwoLXnSn.d.mts +32 -0
  25. package/dist/remote-dom-values-EwoLXnSn.d.mts.map +1 -0
  26. package/dist/remote-dom.cjs +6 -0
  27. package/dist/remote-dom.d.cts +3 -0
  28. package/dist/remote-dom.d.mts +3 -0
  29. package/dist/remote-dom.mjs +3 -0
  30. package/dist/worker-react-bootstrap-C7tCMYGA.mjs +13 -0
  31. package/dist/worker-react-bootstrap-C7tCMYGA.mjs.map +1 -0
  32. package/dist/worker-react-bootstrap-N8jcWZ3L.cjs +13 -0
  33. package/dist/worker-react-bootstrap-N8jcWZ3L.cjs.map +1 -0
  34. package/dist/worker-react-renderer-BKzig_Vy.mjs +185 -0
  35. package/dist/worker-react-renderer-BKzig_Vy.mjs.map +1 -0
  36. package/dist/worker-react-renderer-BSFxMMf7.cjs +186 -0
  37. package/dist/worker-react-renderer-BSFxMMf7.cjs.map +1 -0
  38. package/dist/worker.cjs +325 -0
  39. package/dist/worker.cjs.map +1 -0
  40. package/dist/worker.d.cts +46 -0
  41. package/dist/worker.d.cts.map +1 -0
  42. package/dist/worker.d.mts +46 -0
  43. package/dist/worker.d.mts.map +1 -0
  44. package/dist/worker.mjs +319 -0
  45. package/dist/worker.mjs.map +1 -0
  46. package/package.json +68 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Thread-BiW7rXts.mjs","names":["isBasicObject","#idsToFunction","#functionsToId","#idsToProxy","#finalizationRegistry","#finalization","#customSerializer","#customDeserializer","#serializeInternal","#deserializeInternal","#abort","#handlerForCall","#idsToResolver","#resolveCall","#callLocal","#waitForResult"],"sources":["../../../../node_modules/.pnpm/@quilted+threads@4.1.0_@preact+signals-core@1.14.3/node_modules/@quilted/threads/build/esm/constants.mjs","../../../../node_modules/.pnpm/@quilted+threads@4.1.0_@preact+signals-core@1.14.3/node_modules/@quilted/threads/build/esm/memory.mjs","../../../../node_modules/.pnpm/@quilted+events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs","../../../../node_modules/.pnpm/@quilted+threads@4.1.0_@preact+signals-core@1.14.3/node_modules/@quilted/threads/build/esm/errors.mjs","../../../../node_modules/.pnpm/@quilted+threads@4.1.0_@preact+signals-core@1.14.3/node_modules/@quilted/threads/build/esm/nanoid.mjs","../../../../node_modules/.pnpm/@quilted+threads@4.1.0_@preact+signals-core@1.14.3/node_modules/@quilted/threads/build/esm/functions/ThreadFunctionsAutomatic.mjs","../../../../node_modules/.pnpm/@quilted+threads@4.1.0_@preact+signals-core@1.14.3/node_modules/@quilted/threads/build/esm/serialization/shared.mjs","../../../../node_modules/.pnpm/@quilted+threads@4.1.0_@preact+signals-core@1.14.3/node_modules/@quilted/threads/build/esm/serialization/ThreadSerializationStructuredClone.mjs","../../../../node_modules/.pnpm/@quilted+threads@4.1.0_@preact+signals-core@1.14.3/node_modules/@quilted/threads/build/esm/Thread.mjs"],"sourcesContent":["const MESSAGE_CALL = 1;\nconst MESSAGE_CALL_RESULT = 2;\nconst MESSAGE_FUNCTION_CALL = 3;\nconst MESSAGE_FUNCTION_RESULT = 4;\nconst MESSAGE_FUNCTION_RELEASE = 5;\nconst SERIALIZE_METHOD = Symbol.for('quilt.threads.serialize');\nconst TRANSFERABLE = Symbol.for('quilt.threads.transferable');\n\nexport { MESSAGE_CALL, MESSAGE_CALL_RESULT, MESSAGE_FUNCTION_CALL, MESSAGE_FUNCTION_RELEASE, MESSAGE_FUNCTION_RESULT, SERIALIZE_METHOD, TRANSFERABLE };\n","const RETAIN_METHOD = Symbol.for('quilt.threads.retain');\nconst RELEASE_METHOD = Symbol.for('quilt.threads.release');\nconst RETAINED_BY = Symbol.for('quilt.threads.retained-by');\n\n/**\n * A mapped object type that takes an object with methods, and converts it into the\n * an object with the same methods that can be called over a thread.\n */\n\n/**\n * An object that can retain a reference to a `MemoryManageable` object.\n */\n\n/**\n * An object transferred between threads that must have its memory manually managed,\n * in order to release the reference to a corresponding object on the original thread.\n */\n\n/**\n * A simple representation of a called function. This object allows this library to\n * release references to functions immediately when the function call that transferred\n * them into this thread is completed.\n */\nclass StackFrame {\n memoryManaged = (() => new Set())();\n add(memoryManageable) {\n this.memoryManaged.add(memoryManageable);\n memoryManageable[RETAINED_BY].add(this);\n memoryManageable[RETAIN_METHOD]();\n }\n release() {\n for (const memoryManaged of this.memoryManaged) {\n memoryManaged[RETAINED_BY].delete(this);\n memoryManaged[RELEASE_METHOD]();\n }\n this.memoryManaged.clear();\n }\n}\n\n/**\n * Indicates that a value is being manually memory-managed across threads by this library.\n */\nfunction isMemoryManageable(value) {\n return Boolean(value && value[RETAIN_METHOD] && value[RELEASE_METHOD]);\n}\n\n/**\n * Marks a value as being used so it will not be automatically released. Calling `retain` will,\n * by default, deeply retain the value — that is, it will traverse into nested array elements\n * and object properties, and retain every `retain`-able thing it finds.\n *\n * You will typically use this alongside also storing that value in a variable that lives outside\n * the context of the function where that value was received.\n *\n * @example\n * import {retain} from '@quilted/threads';\n *\n * const allUsers = new Set<User>();\n *\n * async function sayHello(user: User) {\n * allUsers.add(user);\n * retain(user);\n * return `Hey, ${await user.fullName()}!`;\n * }\n */\nfunction retain(value, {\n deep = true\n} = {}) {\n return retainInternal(value, deep, new Map());\n}\nfunction retainInternal(value, deep, seen) {\n const seenValue = seen.get(value);\n if (seenValue) return seenValue;\n const canRetain = isMemoryManageable(value);\n if (canRetain) {\n value[RETAIN_METHOD]();\n }\n seen.set(value, canRetain);\n if (deep) {\n if (Array.isArray(value)) {\n const nestedCanRetain = value.reduce((canRetain, item) => retainInternal(item, deep, seen) || canRetain, canRetain);\n seen.set(value, nestedCanRetain);\n return nestedCanRetain;\n }\n if (isBasicObject(value)) {\n const nestedCanRetain = Object.keys(value).reduce((canRetain, key) => retainInternal(value[key], deep, seen) || canRetain, canRetain);\n seen.set(value, nestedCanRetain);\n return nestedCanRetain;\n }\n }\n return canRetain;\n}\n\n/**\n * Once you are no longer using the a `retain`-ed value, you can use this function to mark it as\n * being unused. Like `retain()`, this function will apply to all nested array elements and object\n * properties.\n *\n * @example\n * import {retain} from '@quilted/threads';\n *\n * const allUsers = new Set<User>();\n *\n * function removeUser(user: User) {\n * allUsers.delete(user);\n * release(user);\n * }\n */\nfunction release(value, {\n deep = true\n} = {}) {\n return releaseInternal(value, deep, new Map());\n}\nfunction releaseInternal(value, deep, seen) {\n const seenValue = seen.get(value);\n if (seenValue) return seenValue;\n const canRelease = isMemoryManageable(value);\n if (canRelease) {\n value[RELEASE_METHOD]();\n }\n seen.set(value, canRelease);\n if (deep) {\n if (Array.isArray(value)) {\n const nestedCanRelease = value.reduce((canRelease, item) => releaseInternal(item, deep, seen) || canRelease, canRelease);\n seen.set(value, nestedCanRelease);\n return nestedCanRelease;\n }\n if (isBasicObject(value)) {\n const nestedCanRelease = Object.keys(value).reduce((canRelease, key) => releaseInternal(value[key], deep, seen) || canRelease, canRelease);\n seen.set(value, nestedCanRelease);\n return nestedCanRelease;\n }\n }\n return canRelease;\n}\nfunction isBasicObject(value) {\n if (value == null || typeof value !== 'object') return false;\n const prototype = Object.getPrototypeOf(value);\n return prototype == null || prototype === Object.prototype;\n}\n\nexport { RELEASE_METHOD, RETAINED_BY, RETAIN_METHOD, StackFrame, isBasicObject, isMemoryManageable, release, retain };\n","/**\n * An `AbortController` that will automatically abort when any of\n * its \"parent\" `AbortController`s abort. This is useful for when\n * you have nested asynchronous operations that may abort independently.\n * The `AbortController` can also be independently aborted.\n *\n * To associate the parent `AbortController`s, pass their signals\n * as arguments to the constructor.\n *\n * @example\n * import {NestedAbortController} from '@shopify/events';\n *\n * const parent = new AbortController();\n * const nested = new NestedAbortController(parent.signal);\n *\n * parent.abort();\n * nested.signal.aborted; // true\n */\nclass NestedAbortController extends AbortController {\n constructor(...parents) {\n super();\n const abortedSignal = parents.find(signal => signal.aborted);\n if (abortedSignal) {\n this.abort(abortedSignal.reason);\n } else {\n const abort = event => this.abort(event.target.reason);\n const options = {\n signal: this.signal\n };\n for (const signal of parents) {\n signal.addEventListener('abort', abort, options);\n }\n }\n }\n}\n\nexport { NestedAbortController };\n","class ThreadClosedError extends Error {\n constructor() {\n super('You attempted to call a function on a closed thread.');\n }\n}\n\nexport { ThreadClosedError };\n","// Copied from https://github.com/ai/nanoid/blob/main/nanoid.js\nlet a = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';\nfunction nanoid(e = 21) {\n let t = '',\n r = crypto.getRandomValues(new Uint8Array(e));\n for (let n = 0; n < e; n++) t += a[63 & r[n]];\n return t;\n}\n\nexport { nanoid };\n","import { MESSAGE_FUNCTION_CALL, MESSAGE_FUNCTION_RELEASE } from '../constants.mjs';\nimport { nanoid } from '../nanoid.mjs';\n\n/**\n * A strategy for managing functions across threads that automatically releases\n * functions when they are no longer needed. This is done by deserializing functions\n * into a proxy that can be called, and wrapping that proxy in a `FinalizationRegistry`,\n * which allows us to send a message to the parent thread when the function is no\n * longer used.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n */\nclass ThreadFunctionsAutomatic {\n #functionsToId = (() => new Map())();\n #idsToFunction = (() => new Map())();\n #idsToProxy = (() => new Map())();\n #finalization = (() => new WeakMap())();\n get(id) {\n return this.#idsToFunction.get(id);\n }\n release(id) {\n const func = this.#idsToFunction.get(id);\n if (func) {\n this.#idsToFunction.delete(id);\n this.#functionsToId.delete(func);\n }\n return Boolean(func);\n }\n serialize(func) {\n let id = this.#functionsToId.get(func);\n if (id == null) {\n id = nanoid();\n this.#functionsToId.set(func, id);\n this.#idsToFunction.set(id, func);\n }\n return id;\n }\n deserialize(id, thread) {\n let proxy = this.#idsToProxy.get(id)?.deref();\n if (proxy) return proxy;\n proxy = (...args) => {\n if (!this.#idsToProxy.has(id)) {\n throw new Error('You attempted to call a function that was already revoked.');\n }\n return thread.call((callID, args, transferable) => {\n thread.messages.send([MESSAGE_FUNCTION_CALL, callID, id, args], transferable);\n }, args);\n };\n this.#finalizationRegistry(thread)?.register(proxy, id);\n this.#idsToProxy.set(id, new WeakRef(proxy));\n return proxy;\n }\n #finalizationRegistry(thread) {\n let finalization = this.#finalization.get(thread);\n if (typeof FinalizationRegistry === 'undefined') {\n return undefined;\n }\n if (!finalization) {\n finalization = new FinalizationRegistry(id => {\n thread.messages.send([MESSAGE_FUNCTION_RELEASE, id]);\n });\n this.#finalization.set(thread, finalization);\n }\n return finalization;\n }\n}\n\nexport { ThreadFunctionsAutomatic };\n","function isIterator(value) {\n return value != null && (Symbol.asyncIterator in value || Symbol.iterator in value) && typeof value.next === 'function';\n}\nfunction isBasicObject(value) {\n if (value == null || typeof value !== 'object') return false;\n const prototype = Object.getPrototypeOf(value);\n return prototype == null || prototype === Object.prototype;\n}\n\nexport { isBasicObject, isIterator };\n","import { TRANSFERABLE, SERIALIZE_METHOD } from '../constants.mjs';\nimport { isIterator, isBasicObject } from './shared.mjs';\n\nconst FUNCTION = '_@f';\nconst ASYNC_ITERATOR = '_@i';\n\n/**\n * A thread encoder that can transfer supports a wide variety of JavaScript types by\n * converting them to a format that the [`structuredClone`](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm)\n * algorithm can process. This\n *\n * Additionally, this encoder will convert functions into a JSON-friendly representation.\n * These functions will use a manual memory management technique to ensure they can be\n * garbage collected by default, but can be configured to use a `WeakRef`-based automatic\n * memory management system by setting the `garbageCollection: 'weak-ref'` option.\n */\nclass ThreadSerializationStructuredClone {\n #customSerializer;\n #customDeserializer;\n constructor(options) {\n this.#customSerializer = options?.serialize;\n this.#customDeserializer = options?.deserialize;\n }\n\n /**\n * Serializes a value into a structured cloning-compatible format that can be transferred between threads.\n */\n serialize(value, thread, transferable) {\n return this.#serializeInternal(value, thread, transferable);\n }\n #serializeInternal(value, thread, transferable, seen = new Map(), isApplyingDefault = false) {\n if (value == null) return value;\n if (seen.has(value)) return seen.get(value);\n\n // Prevent circular references\n seen.set(value, undefined);\n if (typeof value === 'object') {\n if (this.#customSerializer && !isApplyingDefault) {\n const customValue = this.#customSerializer(value, value => this.#serializeInternal(value, thread, transferable, seen, true), thread, transferable);\n if (customValue !== undefined) {\n seen.set(value, customValue);\n return customValue;\n }\n }\n if (value[TRANSFERABLE]) {\n transferable?.push(value);\n seen.set(value, value);\n return value;\n }\n const serializeValue = value => {\n return this.#serializeInternal(value, thread, transferable, seen);\n };\n if (typeof value[SERIALIZE_METHOD] === 'function') {\n const result = value[SERIALIZE_METHOD]({\n serialize: serializeValue\n });\n seen.set(value, result);\n return result;\n }\n if (Array.isArray(value)) {\n const result = value.map(item => serializeValue(item));\n seen.set(value, result);\n return result;\n }\n if (value instanceof Map) {\n const entries = [...value.entries()].map(([key, value]) => {\n return [serializeValue(key), serializeValue(value)];\n });\n const result = new Map(entries);\n seen.set(value, result);\n return result;\n }\n if (value instanceof Set) {\n const entries = [...value].map(entry => serializeValue(entry));\n const result = new Set(entries);\n seen.set(value, result);\n return result;\n }\n const valueIsIterator = isIterator(value);\n if (isBasicObject(value) || valueIsIterator) {\n const result = {};\n for (const key of Object.keys(value)) {\n result[key] = serializeValue(value[key]);\n }\n if (valueIsIterator) {\n result.next ??= serializeValue(value.next.bind(value));\n result.return ??= serializeValue(value.return.bind(value));\n result.throw ??= serializeValue(value.throw.bind(value));\n result[ASYNC_ITERATOR] = true;\n }\n seen.set(value, result);\n return result;\n }\n }\n if (typeof value === 'function') {\n const serialized = thread.functions.serialize(value, thread, transferable);\n const result = {\n [FUNCTION]: serialized\n };\n seen.set(value, result);\n return result;\n }\n seen.set(value, value);\n return value;\n }\n\n /**\n * Deserializes a structured cloning-compatible value from another thread.\n */\n deserialize(value, thread) {\n return this.#deserializeInternal(value, thread);\n }\n #deserializeInternal(value, thread, isApplyingDefault = false) {\n if (value == null) return value;\n if (typeof value === 'object') {\n if (this.#customDeserializer && !isApplyingDefault) {\n const customValue = this.#customDeserializer(value, value => this.#deserializeInternal(value, thread, true), thread);\n if (customValue !== undefined) {\n return customValue;\n }\n }\n if (value == null) {\n return value;\n }\n if (Array.isArray(value)) {\n return value.map(value => this.#deserializeInternal(value, thread));\n }\n if (value instanceof Map) {\n return new Map([...value].map(([key, value]) => [this.#deserializeInternal(key, thread), this.#deserializeInternal(value, thread)]));\n }\n if (value instanceof Set) {\n return new Set([...value].map(entry => this.#deserializeInternal(entry, thread)));\n }\n if (FUNCTION in value) {\n const func = thread.functions.deserialize(value[FUNCTION], thread);\n return func;\n }\n if (!isBasicObject(value)) {\n return value;\n }\n const result = {};\n for (const key of Object.keys(value)) {\n if (key === ASYNC_ITERATOR) {\n result[Symbol.asyncIterator] = () => result;\n } else {\n result[key] = this.#deserializeInternal(value[key], thread);\n }\n }\n return result;\n }\n return value;\n }\n}\n\nexport { ThreadSerializationStructuredClone };\n","import { NestedAbortController } from '@quilted/events';\nimport { ThreadClosedError } from './errors.mjs';\nimport { nanoid } from './nanoid.mjs';\nimport { MESSAGE_FUNCTION_RELEASE, MESSAGE_FUNCTION_RESULT, MESSAGE_CALL_RESULT, MESSAGE_FUNCTION_CALL, MESSAGE_CALL } from './constants.mjs';\nimport { ThreadFunctionsAutomatic } from './functions/ThreadFunctionsAutomatic.mjs';\nimport { ThreadSerializationStructuredClone } from './serialization/ThreadSerializationStructuredClone.mjs';\n\n/**\n * An object that can serialize and deserialize values communicated between two threads.\n */\n\n/**\n * An object that can serialize and deserialize values communicated between two threads.\n */\n\n/**\n * Options to customize the creation of a `ThreadSerialization` instance.\n */\n\n/**\n * Options to customize the creation of a `Thread` instance.\n */\n\n/**\n * An object backing a `Thread` that provides the message-passing interface\n * that allows communication to flow between environments. This message-passing\n * interface is based on the [`postMessage` interface](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage),\n * which is easily adaptable to many JavaScript objects and environments.\n */\n\n/**\n * A map of messages that can be sent between threads.\n */\n\n/**\n * The possible data payloads that can be transferred between threads.\n */\n\n/**\n * A helper type that extracts all callable methods that can be safely proxied\n * between threads; that is, ones which return a promise or async iterator.\n */\n\n/**\n * A thread represents a target JavaScript environment that exposes a set\n * of callable, asynchronous methods. The thread takes care of automatically\n * encoding and decoding its arguments and return values, so you can interact\n * with it as if its methods were implemented in the same environment as your\n * own code.\n */\nclass Thread {\n /**\n * An object that exposes the methods that can be called on the paired thread.\n * This object will automatically encode and decode arguments and return values\n * as necessary.\n */\n\n /**\n * An object that exposes the methods that can be called on this thread by the\n * paired thread. To set these methods, pass the `exports` option when creating\n * a new `Thread`.\n */\n\n /**\n * An object that provides the message-passing interface that allows communication\n * to flow between environments.\n */\n\n /**\n * An object that manages how functions are proxied between threads.\n */\n\n /**\n * An object that manages how values are serialized and deserialized between threads.\n */\n\n /**\n * An `AbortSignal` that indicates whether the communication channel is still open.\n */\n get signal() {\n return this.#abort.signal;\n }\n\n /**\n * A boolean indicating whether the communication channel is still open.\n */\n get closed() {\n return this.#abort.signal.aborted;\n }\n #abort;\n #idsToResolver = (() => new Map())();\n constructor(messages, {\n imports,\n exports,\n functions = new ThreadFunctionsAutomatic(),\n serialization = new ThreadSerializationStructuredClone(),\n signal\n } = {}) {\n this.messages = messages;\n this.#abort = signal ? new NestedAbortController(signal) : new AbortController();\n this.exports = exports ?? {};\n this.imports = createThreadImports(this.#handlerForCall.bind(this), imports);\n this.functions = functions;\n this.serialization = serialization;\n this.functions.start?.(this);\n this.serialization.start?.(this);\n this.signal.addEventListener('abort', () => {\n for (const id of this.#idsToResolver.keys()) {\n this.#resolveCall(id, undefined, new ThreadClosedError());\n }\n this.#idsToResolver.clear();\n }, {\n once: true\n });\n messages.listen(async rawData => {\n const isThreadMessageData = Array.isArray(rawData) && typeof rawData[0] === 'number';\n if (!isThreadMessageData) {\n return;\n }\n const data = rawData;\n switch (data[0]) {\n case MESSAGE_CALL:\n {\n const [, id, property, args] = data;\n const func = this.exports[property] ?? (() => {\n throw new Error(`No '${property}' method is exported from this thread`);\n });\n await this.#callLocal(func, args, (value, error, transferable) => {\n this.messages.send([MESSAGE_CALL_RESULT, id, value, error], transferable);\n });\n break;\n }\n case MESSAGE_FUNCTION_CALL:\n {\n const [, callID, funcID, args] = data;\n const func = this.functions.get(funcID, this) ?? missingThreadFunction;\n await this.#callLocal(func, args, (value, error, transferable) => {\n this.messages.send([MESSAGE_FUNCTION_RESULT, callID, value, error], transferable);\n });\n break;\n }\n case MESSAGE_CALL_RESULT:\n case MESSAGE_FUNCTION_RESULT:\n {\n this.#resolveCall(...data.slice(1));\n break;\n }\n case MESSAGE_FUNCTION_RELEASE:\n {\n const id = data[1];\n this.functions.release(id, this);\n break;\n }\n }\n }, {\n signal: this.signal\n });\n }\n\n /**\n * Closes the communication channel between the two threads. This will prevent\n * any further communication between the threads, and will clean up any memory\n * associated with in-progress communication. It will also reject any inflight\n * function calls between threads with a `ThreadClosedError`.\n */\n close() {\n this.#abort.abort();\n }\n\n /**\n * Requests that the thread provide the context needed to make a function\n * call between threads. You provide this method a function to call and the\n * unserialized arguments you wish to call it with, and the thread will call\n * the function you provided with a serialized call ID, the serialized arguments,\n * and any transferable objects that need to be passed between threads.\n */\n call(func, args) {\n if (this.closed) {\n return Promise.reject(new ThreadClosedError());\n }\n const transferable = [];\n const serialized = this.serialization.serialize(args, this, transferable);\n const id = nanoid();\n const done = this.#waitForResult(id);\n func(id, serialized, transferable);\n return done;\n }\n async #callLocal(func, args, withResult) {\n try {\n const result = this.functions.call ? await this.functions.call(func, args, this) : await func(...this.serialization.deserialize(args, this));\n const transferable = [];\n const serialized = this.serialization.serialize(result, this, transferable);\n withResult(serialized, undefined, transferable);\n } catch (error) {\n withResult(undefined, this.serialization.serialize(error, this));\n }\n }\n #handlerForCall(property) {\n return (...args) => {\n try {\n if (typeof property !== 'string' && typeof property !== 'number') {\n throw new Error(`Can’t call a symbol method on a thread: ${property.toString()}`);\n }\n return this.call((id, serializedArgs, transferable) => {\n this.messages.send([MESSAGE_CALL, id, property, serializedArgs], transferable);\n }, args);\n } catch (error) {\n return Promise.reject(error);\n }\n };\n }\n #resolveCall(...args) {\n const callID = args[0];\n const resolver = this.#idsToResolver.get(callID);\n if (resolver) {\n resolver(...args);\n this.#idsToResolver.delete(callID);\n }\n }\n #waitForResult(id) {\n const promise = new Promise((resolve, reject) => {\n this.#idsToResolver.set(id, (_, value, error) => {\n if (error == null) {\n resolve(this.serialization.deserialize(value, this));\n } else {\n reject(this.serialization.deserialize(error, this));\n }\n });\n });\n Object.defineProperty(promise, Symbol.asyncIterator, {\n async *value() {\n const result = await promise;\n Object.defineProperty(result, Symbol.asyncIterator, {\n value: () => result\n });\n yield* result;\n }\n });\n return promise;\n }\n}\nfunction createThreadImports(handlerForImport, imported) {\n let call;\n if (imported == null) {\n if (typeof Proxy !== 'function') {\n throw new Error(`You must pass an array of callable methods in environments without Proxies.`);\n }\n const cache = new Map();\n call = new Proxy({}, {\n get(_target, property) {\n if (cache.has(property)) {\n return cache.get(property);\n }\n const handler = handlerForImport(property);\n cache.set(property, handler);\n return handler;\n }\n });\n } else {\n call = {};\n for (const method of imported) {\n Object.defineProperty(call, method, {\n value: handlerForImport(method),\n writable: false,\n configurable: true,\n enumerable: true\n });\n }\n }\n return call;\n}\nfunction missingThreadFunction() {\n throw new Error(`You attempted to call a function that is not stored. It may have already been released.`);\n}\n\nexport { Thread };\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8],"mappings":";AAKA,MAAM,mBAAmB,OAAO,IAAI,0BAA0B;AAC9D,MAAM,eAAe,OAAO,IAAI,6BAA6B;;;ACN7D,MAAM,gBAAgB,OAAO,IAAI,uBAAuB;AACxD,MAAM,iBAAiB,OAAO,IAAI,wBAAwB;;;;AAyC1D,SAAS,mBAAmB,OAAO;AACjC,QAAO,QAAQ,SAAS,MAAM,kBAAkB,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;AAsBxE,SAAS,OAAO,OAAO,EACrB,OAAO,SACL,EAAE,EAAE;AACN,QAAO,eAAe,OAAO,sBAAM,IAAI,KAAK,CAAC;;AAE/C,SAAS,eAAe,OAAO,MAAM,MAAM;CACzC,MAAM,YAAY,KAAK,IAAI,MAAM;AACjC,KAAI,UAAW,QAAO;CACtB,MAAM,YAAY,mBAAmB,MAAM;AAC3C,KAAI,UACF,OAAM,gBAAgB;AAExB,MAAK,IAAI,OAAO,UAAU;AAC1B,KAAI,MAAM;AACR,MAAI,MAAM,QAAQ,MAAM,EAAE;GACxB,MAAM,kBAAkB,MAAM,QAAQ,WAAW,SAAS,eAAe,MAAM,MAAM,KAAK,IAAI,WAAW,UAAU;AACnH,QA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B,UAAU;CACvD,IAAI;AACJ,KAAI,YAAY,MAAM;AACpB,MAAI,OAAO,UAAU,WACnB,OAAM,IAAI,MAAM,8EAA8E;EAEhG,MAAM,wBAAQ,IAAI,KAAK;AACvB,SAAO,IAAI,MAAM,EAAE,EAAE,EACnB,IAAI,SAAS,UAAU;AACrB,OAAI,MAAM,IAAI,SAAS,CACrB,QAAO,MAAM,IAAI,SAAS;GAE5B,MAAM,UAAU,iBAAiB,SAAS;AAC1C,SAAM,IAAI,UAAU,QAAQ;AAC5B,UAAO;KAEV,CAAC;QACG;AACL,SAAO,EAAE;AACT,OAAK,MAAM,UAAU,SACnB,QAAO,eAAe,MAAM,QAAQ;GAClC,OAAO,iBAAiB,OAAO;GAC/B,UAAU;GACV,cAAc;GACd,YAAY;GACb,CAAC;;AAGN,QAAO;;AAET,SAAS,wBAAwB;AAC/B,OAAM,IAAI,MAAM,0FAA0F"}
package/dist/index.cjs ADDED
@@ -0,0 +1,6 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_remote_dom_renderer = require("./remote-dom-renderer-DUQf80Nu.cjs");
3
+ const require_remote_dom_values = require("./remote-dom-values-DbgIedSg.cjs");
4
+ exports.isRemoteDomSerializableValue = require_remote_dom_values.isRemoteDomSerializableValue;
5
+ exports.mountRemoteDomWidget = require_remote_dom_renderer.mountRemoteDomWidget;
6
+ exports.toRemoteDomSerializableValue = require_remote_dom_values.toRemoteDomSerializableValue;
@@ -0,0 +1,3 @@
1
+ import { a as isRemoteDomSerializableValue, i as RemoteDomUrlOriginPolicyInput, n as RemoteDomSerializableValue, o as toRemoteDomSerializableValue, r as RemoteDomUrlOriginPolicy, t as RemoteDomNavigationIntent } from "./remote-dom-values-D4AgBNWr.cjs";
2
+ import { a as RemoteDomWidgetHandle, c as mountRemoteDomWidget, d as RemoteDomStyleAttachment, f as RemoteDomThemeBridgeOptions, i as RemoteDomWidgetArtifact, l as RemoteDomCssFetcher, n as RemoteDomCapabilityDeclaration, o as RemoteDomWorkerFactory, r as RemoteDomFullscreenRequest, s as RemoteDomWorkerLike, t as MountRemoteDomWidgetOptions, u as RemoteDomCssUrlInput } from "./remote-dom-renderer-DSHFetvm.cjs";
3
+ export { type MountRemoteDomWidgetOptions, type RemoteDomCapabilityDeclaration, type RemoteDomCssFetcher, type RemoteDomCssUrlInput, type RemoteDomFullscreenRequest, type RemoteDomNavigationIntent, type RemoteDomSerializableValue, type RemoteDomStyleAttachment, type RemoteDomThemeBridgeOptions, type RemoteDomUrlOriginPolicy, type RemoteDomUrlOriginPolicyInput, type RemoteDomWidgetArtifact, type RemoteDomWidgetHandle, type RemoteDomWorkerFactory, type RemoteDomWorkerLike, isRemoteDomSerializableValue, mountRemoteDomWidget, toRemoteDomSerializableValue };
@@ -0,0 +1,3 @@
1
+ import { a as isRemoteDomSerializableValue, i as RemoteDomUrlOriginPolicyInput, n as RemoteDomSerializableValue, o as toRemoteDomSerializableValue, r as RemoteDomUrlOriginPolicy, t as RemoteDomNavigationIntent } from "./remote-dom-values-EwoLXnSn.mjs";
2
+ import { a as RemoteDomWidgetHandle, c as mountRemoteDomWidget, d as RemoteDomStyleAttachment, f as RemoteDomThemeBridgeOptions, i as RemoteDomWidgetArtifact, l as RemoteDomCssFetcher, n as RemoteDomCapabilityDeclaration, o as RemoteDomWorkerFactory, r as RemoteDomFullscreenRequest, s as RemoteDomWorkerLike, t as MountRemoteDomWidgetOptions, u as RemoteDomCssUrlInput } from "./remote-dom-renderer-BU-73KvK.mjs";
3
+ export { type MountRemoteDomWidgetOptions, type RemoteDomCapabilityDeclaration, type RemoteDomCssFetcher, type RemoteDomCssUrlInput, type RemoteDomFullscreenRequest, type RemoteDomNavigationIntent, type RemoteDomSerializableValue, type RemoteDomStyleAttachment, type RemoteDomThemeBridgeOptions, type RemoteDomUrlOriginPolicy, type RemoteDomUrlOriginPolicyInput, type RemoteDomWidgetArtifact, type RemoteDomWidgetHandle, type RemoteDomWorkerFactory, type RemoteDomWorkerLike, isRemoteDomSerializableValue, mountRemoteDomWidget, toRemoteDomSerializableValue };
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { c as isRemoteDomSerializableValue, u as toRemoteDomSerializableValue } from "./remote-dom-values-BSAxrOE7.mjs";
2
+ import { t as mountRemoteDomWidget } from "./remote-dom-renderer-DcwcNPsu.mjs";
3
+ export { isRemoteDomSerializableValue, mountRemoteDomWidget, toRemoteDomSerializableValue };
@@ -0,0 +1,90 @@
1
+ import { n as RemoteDomSerializableValue, t as RemoteDomNavigationIntent } from "./remote-dom-values-EwoLXnSn.mjs";
2
+
3
+ //#region src/remote-dom-styles.d.ts
4
+ interface RemoteDomStyleAttachment {
5
+ readonly ready: Promise<void>;
6
+ readonly dispose: () => void;
7
+ }
8
+ interface RemoteDomStyleArtifact {
9
+ readonly packageId: string;
10
+ readonly version: string;
11
+ readonly workerEntryUrl: string;
12
+ readonly cssUrls: readonly string[];
13
+ readonly assetUrls: readonly string[];
14
+ }
15
+ interface RemoteDomCssUrlSource {
16
+ readonly url: string;
17
+ readonly version?: string;
18
+ }
19
+ type RemoteDomCssUrlInput = string | RemoteDomCssUrlSource;
20
+ type RemoteDomCssFetcher = (url: string) => Promise<string>;
21
+ interface RemoteDomThemeBridgeOptions {
22
+ readonly root: ShadowRoot;
23
+ readonly sourceElement?: Element | undefined;
24
+ readonly observeTarget?: Node | undefined;
25
+ readonly observe?: boolean | undefined;
26
+ readonly cssVariableNames?: readonly string[] | undefined;
27
+ readonly dataAttributes?: readonly string[] | undefined;
28
+ readonly classNames?: readonly string[] | "all" | undefined;
29
+ readonly copyAllDataAttributes?: boolean | undefined;
30
+ }
31
+ //#endregion
32
+ //#region src/remote-dom-renderer.d.ts
33
+ interface RemoteDomCapabilityDeclaration {
34
+ readonly name: string;
35
+ readonly version: string;
36
+ }
37
+ interface RemoteDomWidgetArtifact extends RemoteDomStyleArtifact {
38
+ readonly widgetType: string;
39
+ readonly capabilities: readonly RemoteDomCapabilityDeclaration[];
40
+ }
41
+ interface RemoteDomFullscreenRequest {
42
+ readonly method: string;
43
+ readonly payload?: RemoteDomSerializableValue | undefined;
44
+ readonly host: HTMLElement;
45
+ readonly shadowRoot: ShadowRoot;
46
+ }
47
+ interface MountRemoteDomWidgetOptions {
48
+ readonly host: HTMLElement;
49
+ readonly artifact: RemoteDomWidgetArtifact;
50
+ readonly props?: RemoteDomSerializableValue | undefined;
51
+ readonly callCapability?: ((capability: string, method: string, payload?: RemoteDomSerializableValue) => RemoteDomSerializableValue | Promise<RemoteDomSerializableValue>) | undefined;
52
+ readonly onNavigate?: ((intent: RemoteDomNavigationIntent) => void | Promise<void>) | undefined;
53
+ readonly onFullscreen?: ((request: RemoteDomFullscreenRequest) => RemoteDomSerializableValue | Promise<RemoteDomSerializableValue>) | undefined;
54
+ readonly onError?: ((error: Error) => void) | undefined;
55
+ readonly workerFactory?: RemoteDomWorkerFactory | undefined;
56
+ readonly hostOrigin?: string | undefined;
57
+ readonly mediaOrigins?: readonly string[] | undefined;
58
+ readonly maxMutationBatchSize?: number | undefined;
59
+ readonly maxDomNodeCount?: number | undefined;
60
+ readonly cssText?: string | undefined;
61
+ readonly widgetCssText?: string | undefined;
62
+ readonly cssUrls?: readonly RemoteDomCssUrlInput[] | undefined;
63
+ readonly fluidComponentCssText?: string | undefined;
64
+ readonly fluidComponentCssUrls?: readonly RemoteDomCssUrlInput[] | undefined;
65
+ readonly themeBridgeCssText?: string | undefined;
66
+ readonly themeBridge?: Omit<RemoteDomThemeBridgeOptions, "root"> | false | undefined;
67
+ readonly fetchCss?: RemoteDomCssFetcher | undefined;
68
+ readonly useConstructableStylesheets?: boolean | undefined;
69
+ }
70
+ interface RemoteDomWidgetHandle {
71
+ readonly shadowRoot: ShadowRoot;
72
+ readonly styles: RemoteDomStyleAttachment;
73
+ readonly ready: Promise<void>;
74
+ updateProps(props: RemoteDomSerializableValue): void;
75
+ dispose(): void;
76
+ }
77
+ interface RemoteDomWorkerLike {
78
+ onmessage: ((event: MessageEvent<unknown>) => void) | null;
79
+ onerror: ((event: ErrorEvent) => void) | null;
80
+ postMessage(message: unknown, transfer?: Transferable[]): void;
81
+ terminate(): void;
82
+ addEventListener?: (type: "message", listener: (event: MessageEvent<unknown>) => void, options?: {
83
+ signal?: AbortSignal;
84
+ }) => void;
85
+ }
86
+ type RemoteDomWorkerFactory = (workerEntryUrl: string, options: WorkerOptions) => RemoteDomWorkerLike;
87
+ declare function mountRemoteDomWidget(options: MountRemoteDomWidgetOptions): RemoteDomWidgetHandle;
88
+ //#endregion
89
+ export { RemoteDomWidgetHandle as a, mountRemoteDomWidget as c, RemoteDomStyleAttachment as d, RemoteDomThemeBridgeOptions as f, RemoteDomWidgetArtifact as i, RemoteDomCssFetcher as l, RemoteDomCapabilityDeclaration as n, RemoteDomWorkerFactory as o, RemoteDomFullscreenRequest as r, RemoteDomWorkerLike as s, MountRemoteDomWidgetOptions as t, RemoteDomCssUrlInput as u };
90
+ //# sourceMappingURL=remote-dom-renderer-BU-73KvK.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-dom-renderer-BU-73KvK.d.mts","names":[],"sources":["../src/remote-dom-styles.ts","../src/remote-dom-renderer.ts"],"mappings":";;;UASiB,wBAAA;EAAA,SACN,KAAA,EAAO,OAAA;EAAA,SACP,OAAA;AAAA;AAAA,UAGM,sBAAA;EAAA,SACN,SAAA;EAAA,SACA,OAAA;EAAA,SACA,cAAA;EAAA,SACA,OAAA;EAAA,SACA,SAAA;AAAA;AAAA,UAGM,qBAAA;EAAA,SACN,GAAA;EAAA,SACA,OAAA;AAAA;AAAA,KAGC,oBAAA,YAAgC,qBAAA;AAAA,KAEhC,mBAAA,IAAuB,GAAA,aAAgB,OAAA;AAAA,UAOlC,2BAAA;EAAA,SACN,IAAA,EAAM,UAAA;EAAA,SACN,aAAA,GAAgB,OAAA;EAAA,SAChB,aAAA,GAAgB,IAAA;EAAA,SAChB,OAAA;EAAA,SACA,gBAAA;EAAA,SACA,cAAA;EAA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SAAA,IAAa,KAAA,EAAO,YAAA;EACpB,OAAA,IAAW,KAAA,EAAO,UAAA;EAClB,WAAA,CAAY,OAAA,WAAkB,QAAA,GAAW,YAAA;EACzC,SAAA;EACA,gBAAA,IACE,IAAA,aACA,QAAA,GAAW,KAAA,EAAO,YAAA,oBAClB,OAAA;IAAY,MAAA,GAAS,WAAA;EAAA;AAAA;AAAA,KAIb,sBAAA,IACV,cAAA,UACA,OAAA,EAAS,aAAA,KACN,mBAAA;AAAA,iBAqCW,oBAAA,CACd,OAAA,EAAS,2BAAA,GACR,qBAAA"}
@@ -0,0 +1,90 @@
1
+ import { n as RemoteDomSerializableValue, t as RemoteDomNavigationIntent } from "./remote-dom-values-D4AgBNWr.cjs";
2
+
3
+ //#region src/remote-dom-styles.d.ts
4
+ interface RemoteDomStyleAttachment {
5
+ readonly ready: Promise<void>;
6
+ readonly dispose: () => void;
7
+ }
8
+ interface RemoteDomStyleArtifact {
9
+ readonly packageId: string;
10
+ readonly version: string;
11
+ readonly workerEntryUrl: string;
12
+ readonly cssUrls: readonly string[];
13
+ readonly assetUrls: readonly string[];
14
+ }
15
+ interface RemoteDomCssUrlSource {
16
+ readonly url: string;
17
+ readonly version?: string;
18
+ }
19
+ type RemoteDomCssUrlInput = string | RemoteDomCssUrlSource;
20
+ type RemoteDomCssFetcher = (url: string) => Promise<string>;
21
+ interface RemoteDomThemeBridgeOptions {
22
+ readonly root: ShadowRoot;
23
+ readonly sourceElement?: Element | undefined;
24
+ readonly observeTarget?: Node | undefined;
25
+ readonly observe?: boolean | undefined;
26
+ readonly cssVariableNames?: readonly string[] | undefined;
27
+ readonly dataAttributes?: readonly string[] | undefined;
28
+ readonly classNames?: readonly string[] | "all" | undefined;
29
+ readonly copyAllDataAttributes?: boolean | undefined;
30
+ }
31
+ //#endregion
32
+ //#region src/remote-dom-renderer.d.ts
33
+ interface RemoteDomCapabilityDeclaration {
34
+ readonly name: string;
35
+ readonly version: string;
36
+ }
37
+ interface RemoteDomWidgetArtifact extends RemoteDomStyleArtifact {
38
+ readonly widgetType: string;
39
+ readonly capabilities: readonly RemoteDomCapabilityDeclaration[];
40
+ }
41
+ interface RemoteDomFullscreenRequest {
42
+ readonly method: string;
43
+ readonly payload?: RemoteDomSerializableValue | undefined;
44
+ readonly host: HTMLElement;
45
+ readonly shadowRoot: ShadowRoot;
46
+ }
47
+ interface MountRemoteDomWidgetOptions {
48
+ readonly host: HTMLElement;
49
+ readonly artifact: RemoteDomWidgetArtifact;
50
+ readonly props?: RemoteDomSerializableValue | undefined;
51
+ readonly callCapability?: ((capability: string, method: string, payload?: RemoteDomSerializableValue) => RemoteDomSerializableValue | Promise<RemoteDomSerializableValue>) | undefined;
52
+ readonly onNavigate?: ((intent: RemoteDomNavigationIntent) => void | Promise<void>) | undefined;
53
+ readonly onFullscreen?: ((request: RemoteDomFullscreenRequest) => RemoteDomSerializableValue | Promise<RemoteDomSerializableValue>) | undefined;
54
+ readonly onError?: ((error: Error) => void) | undefined;
55
+ readonly workerFactory?: RemoteDomWorkerFactory | undefined;
56
+ readonly hostOrigin?: string | undefined;
57
+ readonly mediaOrigins?: readonly string[] | undefined;
58
+ readonly maxMutationBatchSize?: number | undefined;
59
+ readonly maxDomNodeCount?: number | undefined;
60
+ readonly cssText?: string | undefined;
61
+ readonly widgetCssText?: string | undefined;
62
+ readonly cssUrls?: readonly RemoteDomCssUrlInput[] | undefined;
63
+ readonly fluidComponentCssText?: string | undefined;
64
+ readonly fluidComponentCssUrls?: readonly RemoteDomCssUrlInput[] | undefined;
65
+ readonly themeBridgeCssText?: string | undefined;
66
+ readonly themeBridge?: Omit<RemoteDomThemeBridgeOptions, "root"> | false | undefined;
67
+ readonly fetchCss?: RemoteDomCssFetcher | undefined;
68
+ readonly useConstructableStylesheets?: boolean | undefined;
69
+ }
70
+ interface RemoteDomWidgetHandle {
71
+ readonly shadowRoot: ShadowRoot;
72
+ readonly styles: RemoteDomStyleAttachment;
73
+ readonly ready: Promise<void>;
74
+ updateProps(props: RemoteDomSerializableValue): void;
75
+ dispose(): void;
76
+ }
77
+ interface RemoteDomWorkerLike {
78
+ onmessage: ((event: MessageEvent<unknown>) => void) | null;
79
+ onerror: ((event: ErrorEvent) => void) | null;
80
+ postMessage(message: unknown, transfer?: Transferable[]): void;
81
+ terminate(): void;
82
+ addEventListener?: (type: "message", listener: (event: MessageEvent<unknown>) => void, options?: {
83
+ signal?: AbortSignal;
84
+ }) => void;
85
+ }
86
+ type RemoteDomWorkerFactory = (workerEntryUrl: string, options: WorkerOptions) => RemoteDomWorkerLike;
87
+ declare function mountRemoteDomWidget(options: MountRemoteDomWidgetOptions): RemoteDomWidgetHandle;
88
+ //#endregion
89
+ export { RemoteDomWidgetHandle as a, mountRemoteDomWidget as c, RemoteDomStyleAttachment as d, RemoteDomThemeBridgeOptions as f, RemoteDomWidgetArtifact as i, RemoteDomCssFetcher as l, RemoteDomCapabilityDeclaration as n, RemoteDomWorkerFactory as o, RemoteDomFullscreenRequest as r, RemoteDomWorkerLike as s, MountRemoteDomWidgetOptions as t, RemoteDomCssUrlInput as u };
90
+ //# sourceMappingURL=remote-dom-renderer-DSHFetvm.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-dom-renderer-DSHFetvm.d.cts","names":[],"sources":["../src/remote-dom-styles.ts","../src/remote-dom-renderer.ts"],"mappings":";;;UASiB,wBAAA;EAAA,SACN,KAAA,EAAO,OAAA;EAAA,SACP,OAAA;AAAA;AAAA,UAGM,sBAAA;EAAA,SACN,SAAA;EAAA,SACA,OAAA;EAAA,SACA,cAAA;EAAA,SACA,OAAA;EAAA,SACA,SAAA;AAAA;AAAA,UAGM,qBAAA;EAAA,SACN,GAAA;EAAA,SACA,OAAA;AAAA;AAAA,KAGC,oBAAA,YAAgC,qBAAA;AAAA,KAEhC,mBAAA,IAAuB,GAAA,aAAgB,OAAA;AAAA,UAOlC,2BAAA;EAAA,SACN,IAAA,EAAM,UAAA;EAAA,SACN,aAAA,GAAgB,OAAA;EAA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