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AAA,IACL;AAAA,EACJ;AACJ;AA1qBa,OAAA,GAAN,eAAA,CAAA;AAAA,EAJN,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,OAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,OAAA,CAAA","file":"AreNode.entity.mjs","sourcesContent":["import { A_CommonHelper, A_Context, A_Entity, A_Error, A_FormatterHelper, A_Scope, A_TYPES__Ctor, A_TypeGuards, ASEID } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\nimport { AreEvent } from \"@adaas/are/event/AreEvent.context\";\nimport { AreScene } from \"@adaas/are/scene/AreScene.context\";\nimport { AreAttribute } from \"@adaas/are/attribute/AreAttribute.entity\";\nimport { Are } from \"@adaas/are/component/Are.component\";\nimport { AreNodeFeatures, AreNodeStatuses } from \"./AreNode.constants\";\nimport { AreNodeNewProps, AreNodeStatusNames, AreNode_Serialized } from \"./AreNode.types\";\nimport { AreSyntaxTokenPayload } from \"@adaas/are/syntax/AreSyntax.types\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\n\n\n@A_Frame.Define({\n    namespace: 'A-ARE',\n    description: 'An AreNode entity represents a node within the A-Concept Rendering Engine (ARE) framework. It encapsulates content, markup, and styles, and manages its own scope for nested fragments and entities. AreNodes are responsible for handling events, compiling, rendering, updating, and lifecycle management within the ARE context.'\n})\nexport class AreNode extends A_Entity<AreNodeNewProps, AreNode_Serialized> {\n\n    static get concept(): string {\n        return 'are';\n    }\n\n\n    /**\n     * The current status of the node, which can be used to track the lifecycle and rendering state of the node within the scene. \n     */\n    status!: AreNodeStatusNames;\n\n    /**\n     * The opening string that defines the start of a node in the source. This is typically used for parsing and tokenizing the source to identify the structure and content of the node. The opening string can include the tag name, attributes, and other syntax that indicates the beginning of a node.\n     */\n    protected _opening!: string;\n    /**\n     * The closing string that defines the end of a node in the source. This is typically used for parsing and tokenizing the source to identify the structure and content of the node. The closing string can include the tag name, attributes, and other syntax that indicates the end of a node.\n     */\n    protected _closing!: string;\n    /**\n     * The position of the node in the source string, which can be used for error reporting, debugging, and other purposes related to tracking the location of the node within the original source. The position is a character index identifying where the node is defined.\n     */\n    protected _position!: number;\n    /**\n     * The payload associated with the node, which can include any additional data or metadata that is extracted during the tokenization process. The payload can be used to store custom information related to the node, such as directive arguments, binding expressions, or any other relevant data that may be needed for processing and rendering the node within the scene.\n     */\n    protected _payload?: AreSyntaxTokenPayload\n    /**\n     * Content string defined for the node — the inner content between delimiters.\n     * Example: `{{name}}`\n     */\n    protected _content!: string\n    /**\n     * Markup string defined for the node\n     * Example: `<custom-component :prop=\"value\"> <div>Inner Content</div> </custom-component>`\n     */\n    protected _markup!: string\n    /**\n     * The scope associated with this node\n     * uses to store all nested fragments and entities like other AreNodes and Scene\n     */\n    protected _scope!: A_Scope\n\n    /**\n     * Actual node identifier. \n     */\n    get id(): string {\n        return this.aseid.id;\n    }\n    /**\n     * Actual node type. \n     * By default it's a tag name\n     */\n    get type(): string {\n        return this.aseid.entity;\n    }\n    /**\n     * Content string defined for the node — the inner content between delimiters.\n     * Example: `{{name}}`\n     */\n    get content(): string {\n        return this._content;\n    }\n    /**\n     * Markup string defined for the node\n     * Example: `<custom-component :prop=\"value\"> <div>Inner Content</div> </custom-component>`\n     */\n    get markup(): string {\n        return this._markup;\n    }\n    /**\n     * The scope associated with this node\n     * uses to store all nested fragments and entities like other AreNodes and Scene\n     */\n    get scope(): A_Scope {\n        if (!this._scope) {\n            this._scope = A_Context.allocate(this, new A_Scope({ name: `${this.aseid.id}-scope` }));\n        }\n\n        return this._scope;\n    }\n    /**\n     * The attributes defined for the node, which can include static attributes, binding attributes, directive attributes, and event attributes. These attributes are extracted during tokenization and processed during the compilation phase to generate the corresponding SceneInstructions for rendering and updating the node in the scene.\n     */\n    get attributes(): AreAttribute[] {\n        return this.scope.resolveFlatAll<AreAttribute>(AreAttribute);\n    }\n    /**\n     * A custom component associated with this node, which can be used to provide custom logic and behavior for the node. This component is typically defined in the context and can be resolved based on the node's type or other identifying information. The component can include its own content, markup, styles, and features that are specific to the functionality it provides.\n     * \n     * Example: If the node type is \"custom-component\", the corresponding component would be resolved from the context and can be used to provide custom rendering and behavior for nodes of that type.\n     * \n     * [!] Note: The component is optional and may not be defined for all nodes. If no component is associated with the node, it will be treated as a standard HTML element or a basic node without custom logic.\n     */\n    get component(): Are | undefined {\n        return this.scope.resolve<Are>(A_FormatterHelper.toPascalCase(this.aseid.entity)) as Are | undefined;\n    }\n    /**\n     * The parent node of this node, which is the node that registered the current node in its scope. This is typically the node that is responsible for rendering the current node and managing its lifecycle within the scene. The parent node can be used to access shared context, propagate events, and manage interactions between nodes in a hierarchical structure.\n     * \n     * Example: For a node defined as `<div><span>Child Node</span></div>`, the parent node of the `<span>` element would be the `<div>` element, which is responsible for rendering the `<span>` and managing its lifecycle within the scene.\n     */\n    get parent(): AreNode | undefined {\n        const parentIssuer = this.scope.parent?.issuer();\n\n        if (!parentIssuer || !(parentIssuer instanceof AreNode)) return undefined;\n\n        return parentIssuer as AreNode | undefined;\n    }\n    /**\n     * The child nodes of this node, which are typically defined in the markup and registered in the scope as child entities. These child nodes can represent nested elements or components within the node and can have their own content, markup, styles, and features. The child nodes are managed within the scope of the parent node and can be accessed and manipulated as needed for rendering, updating, and lifecycle management.\n     * \n     * Example: For a node defined as `<div><span>Child Node</span></div>`, the child node would be the `<span>` element, which is registered as a child entity in the scope of the parent `<div>` node.\n     */\n    get children(): (AreNode)[] {\n        return this.scope.resolveFlatAll<AreNode>(AreNode) || [];\n    }\n    /**\n     * It returns the scene where the node exists, so it should be the scene of the rootNode, \n     * primary parent of this node.\n     */\n    get scene(): AreScene {\n        if (!this._scene)\n            this._scene = this.scope.resolve<AreScene>(AreScene)!;\n        return this._scene;\n    }\n\n\n    protected _scene!: AreScene;\n\n\n    fromNew(newEntity: AreNodeNewProps): void {\n        this.aseid = this.generateASEID({\n            id: newEntity.payload?.id,\n            entity: newEntity.payload?.entity || 'node',\n            scope: newEntity.payload?.scope,\n        });\n\n        this.status = AreNodeStatuses.Pending;\n        this._content = newEntity.content || '';\n        this._markup = newEntity.raw || '';\n        this._opening = newEntity.opening || '';\n        this._closing = newEntity.closing || '';\n        this._position = newEntity.position || 0;\n        this._payload = newEntity.payload;\n    }\n\n\n    fromASEID(aseid: string | ASEID): void {\n        super.fromASEID(aseid);\n\n        this._content = '';\n        this._markup = '';\n        this.status = AreNodeStatuses.Pending;\n    }\n    /**\n     * Sets the content string for the node — the inner text/markup between the node's\n     * opening and closing delimiters. Content is processed by the rendering engine to\n     * generate the corresponding SceneInstructions for rendering the node.\n     * \n     * @param content \n     */\n    setContent(content: string): void {\n        this._content = content;\n    }\n    /**\n     * Sets the markup string for the node, which is the full raw matched string including delimiters. The markup can include HTML-like syntax, custom components, directives, and other features that are processed by the rendering engine to generate the corresponding SceneInstructions for rendering the node.\n     * \n     * @param markup \n     */\n    setMarkup(markup: string): void {\n        this._markup = markup;\n    }\n    /**\n     * Adds a child node to the current node's scope and ensures the child inherits from this node's scope.\n     * \n     * @param child - The node to add as a child\n     */\n    addChild(child: AreNode): void {\n        this.scope.register(child);\n\n        if (!child.scope.isInheritedFrom(this.scope))\n            child.scope.inherit(this.scope);\n    }\n    /**\n     * Removes a child node from the current node's scope. This is typically used when a child node is no longer needed or should be detached from the parent node. The method ensures that the child node is properly deregistered from the scope and any associated resources are cleaned up as necessary.\n     * \n     * @param node  - The child node to be removed from the current node's scope\n     */\n    removeChild(node: AreNode): void {\n        this.scope.deregister(node);\n    }\n\n    // ============================================================================================\n    //                                Node Lifecycle Methods\n    // ============================================================================================\n    /**\n     * Executes initialization logic for the node, which typically involves setting up the node's scope, registering any necessary entities, and preparing the node for rendering and interaction within the scene. This method is called during the initial phase of the node's lifecycle and is responsible for ensuring that the node is properly initialized before it is compiled and rendered in the scene.\n     */\n    init(): void {\n\n        // const context = this.scope.resolve(AreContext);\n\n        // context?.startPerformance('Node Init');\n        this.call(AreNodeFeatures.onBeforeInit, this.scope);\n        this.call(AreNodeFeatures.onInit, this.scope);\n        this.call(AreNodeFeatures.onAfterInit, this.scope);\n        // context?.endPerformance('Node Init');\n    }\n\n\n    /**\n     * Loads the node, which typically involves executing any necessary setup or initialization logic to prepare the node for rendering and interaction within the scene. This may include processing the node's content, markup, styles, and features to generate the corresponding SceneInstructions, as well as setting up any event listeners or reactive properties as needed.\n     */\n    async load(): Promise<any> {\n        this.checkScopeInheritance();\n        try {\n            const context = this.scope.resolve(AreContext);\n\n            context?.startPerformance('Node Load');\n\n            const res = super.load(this.scope);\n\n            context?.endPerformance('Node Load');\n\n            return res;\n        } catch (error) {\n            throw error;\n        }\n    }\n    /**\n     * Tokenizes the node content, which typically involves parsing the raw content string to identify the structure, child nodes, attributes, directives, and other features. This process is essential for breaking down the content into its constituent parts and preparing it for further processing during the compilation phase. The tokenization process can involve creating child nodes, extracting attributes and their values, and identifying any directives or bindings that need to be processed during rendering.\n     */\n    tokenize(): void {\n        this.checkScopeInheritance();\n        try {\n            const context = this.scope.resolve(AreContext);\n\n            context?.startPerformance('Node Tokenize');\n            this.call(AreNodeFeatures.onTokenize, this.scope);\n            context?.endPerformance('Node Tokenize');\n\n        } catch (error) {\n            throw error;\n        }\n    }\n    /**\n     * Transforms the node, which typically involves executing any necessary logic to reshape the node's structure or content before it is compiled and rendered in the scene. This may include applying any transformations defined by directives, processing any dynamic content or expressions, and performing any other necessary tasks to ensure that the node is properly prepared for compilation and rendering based on its content, markup, styles, and features.\n     */\n    transform(): void {\n        this.checkScopeInheritance();\n        try {\n            const context = this.scope.resolve(AreContext);\n\n            context?.startPerformance('Node Transform');\n\n            this.call(AreNodeFeatures.onTransform, this.scope);\n\n            context?.endPerformance('Node Transform');\n        } catch (error) {\n            throw error;\n        }\n    }\n\n    /**\n     * Compile the node. This method should transform the node's content, markup, and styles into a set of SceneInstructions that can be executed to render the node in the scene. The compile method is responsible for processing the node's features, attributes, directives, and other properties to generate the necessary instructions for rendering and updating the node in response to changes in state or context.\n     * \n     * [!] Note: The compile method should ensure that the node's scope is properly inherited from the context scope before processing, and it should handle any errors that may occur during compilation to ensure that the node can be rendered correctly in the scene.\n     */\n    compile(): void {\n        this.checkScopeInheritance();\n\n        try {\n            const context = this.scope.resolve(AreContext);\n\n            context?.startPerformance('Node Compile');\n\n            this.call(AreNodeFeatures.onCompile, this.scope);\n\n            context?.endPerformance('Node Compile');\n        } catch (error) {\n            throw error;\n        }\n    }\n    /**\n     * Mounts the node, which typically involves executing any necessary logic to render the node in the scene and to set up any interactions or behaviors associated with the node. This may include applying the generated SceneInstructions from the compile phase, attaching event listeners, and performing any other necessary tasks to ensure that the node is properly rendered and functional within the scene.\n     * \n     * [!] Note: The mount method should ensure that the node's scope is properly inherited from the context scope before performing any mounting logic, and it should handle any errors that may occur during mounting to ensure that the node can be rendered correctly in the scene.\n     */\n    mount(): void | Promise<void> {\n\n        this.checkScopeInheritance();\n\n        const context = this.scope.resolve(AreContext);\n\n        context?.startPerformance('Node Mount');\n\n        this.call(AreNodeFeatures.onBeforeMount, this.scope);\n\n        const onMount = this.call(AreNodeFeatures.onMount, this.scope);\n\n        /**\n         * The HTML engine time-slices large initial mounts and returns a Promise\n         * from onMount. When that happens we must defer onAfterMount (and the perf\n         * marker) until the whole subtree has finished mounting, so the\n         * \"mounted\" contract still fires post-order. Small/synchronous mounts\n         * return void here and keep the fully synchronous fast-path.\n         */\n        if (onMount && typeof (onMount as Promise<void>).then === 'function') {\n            return (onMount as Promise<void>).then(() => {\n                this.call(AreNodeFeatures.onAfterMount, this.scope);\n                context?.endPerformance('Node Mount');\n            });\n        }\n\n        this.call(AreNodeFeatures.onAfterMount, this.scope);\n\n        context?.endPerformance('Node Mount');\n    }\n    /**\n     * Interprets the node, which typically involves executing any necessary logic to process the node's features, attributes, directives, and other properties to generate the corresponding SceneInstructions for rendering and updating the node in response to changes in state or context. This method is responsible for ensuring that the node is properly interpreted based on its content, markup, styles, and features to enable dynamic behavior and responsiveness within the scene.\n     * \n     * [!] Note: The interpret method should NOT go though own child, since it may be used by both mount and update operations!\n     */\n    interpret(): void {\n        this.checkScopeInheritance();\n\n        try {\n            const context = this.scope.resolve(AreContext);\n\n            context?.startPerformance('Node Interpret');\n\n            this.call(AreNodeFeatures.onInterpret, this.scope);\n\n            context?.endPerformance('Node Interpret');\n\n        } catch (error) {\n            throw error;\n        }\n    }\n    /**\n     * Updates the node, which typically involves executing any necessary logic to update the node's rendering and behavior in response to changes in state, context, or other factors. This may include reapplying SceneInstructions, updating event listeners, and performing any other necessary tasks to ensure that the node remains functional and correctly rendered within the scene as changes occur.\n     * \n     * [!] Note: The update method should ensure that the node's scope is properly inherited from the context scope before performing any update logic, and it should handle any errors that may occur during updating to ensure that the node can be updated correctly in the scene.\n     */\n    update(): void {\n\n        this.checkScopeInheritance();\n\n        try {\n            const context = this.scope.resolve(AreContext);\n\n            context?.startPerformance('Node Update');\n            this.call(AreNodeFeatures.onBeforeUpdate, this.scope);\n            this.call(AreNodeFeatures.onUpdate, this.scope);\n            this.call(AreNodeFeatures.onAfterUpdate, this.scope);\n\n            context?.endPerformance('Node Update');\n\n        } catch (error) {\n            throw error;\n        }\n    }\n    /**\n     * Unmounts the node, which typically involves executing any necessary logic to remove the node from the scene and to clean up any resources associated with the node. This may include reverting any applied SceneInstructions, detaching event listeners, and performing any other necessary tasks to ensure that the node is properly removed from the scene and that resources are released as needed.\n     * \n     * [!] Note: The unmount method should ensure that the node's scope is properly inherited from the context scope before performing any unmounting logic, and it should handle any errors that may occur during unmounting to ensure that the node can be removed correctly from the scene.\n     */\n    unmount(): void {\n\n        this.checkScopeInheritance();\n\n        try {\n            const context = this.scope.resolve(AreContext);\n\n            context?.startPerformance('Node Unmount');\n\n            this.call(AreNodeFeatures.onBeforeUnmount, this.scope);\n            this.call(AreNodeFeatures.onUnmount, this.scope);\n            this.call(AreNodeFeatures.onAfterUnmount, this.scope);\n\n            context?.endPerformance('Node Unmount');\n\n        } catch (error) {\n            throw error;\n        }\n    }\n\n    cloneWithScope<T extends AreNode = AreNode>(this: T): T {\n        const currentScope = this.scope;\n\n        A_Context.deallocate(currentScope);\n\n        const newNode = new (this.constructor as new (props: AreNodeNewProps) => T)({\n            opening: this._opening,\n            closing: this._closing,\n            position: this._position,\n            payload: this._payload || {},\n            content: this._content,\n            raw: this._markup,\n        });\n\n        if (newNode._scope)\n            A_Context.deallocate(newNode._scope);\n\n        newNode._scope = currentScope;\n\n        A_Context.allocate(newNode, currentScope);\n\n        this._scope = A_Context.allocate(this);\n\n        return newNode as T;\n    }\n\n    reset(): void {\n        for (const child of this.children) {\n            this.scope.deregister(child);\n        }\n\n        for (const attribute of this.attributes) {\n            this.scope.deregister(attribute);\n        }\n    }\n\n    /**\n     * Registers a component class at runtime — the documented entry point for\n     * injecting a component that was NOT present at bootstrap (e.g. a class\n     * fetched from a backend / lazily imported).\n     *\n     * The class is registered into the ROOT scope (the topmost scope in the\n     * inheritance chain), NOT this node's local scope, so it becomes globally\n     * resolvable for every node in the tree — exactly as if it had been\n     * registered at bootstrap. Registering in the local scope would only make\n     * the tag resolvable for this single node's subtree.\n     *\n     * `scope.register` bumps the resolution version; because version\n     * aggregation walks up the parent chain, registering at the root\n     * invalidates the resolve caches of all descendant scopes, so the new\n     * component is picked up immediately on the next {@link render} / load.\n     *\n     * @param component - the component constructor to register.\n     */\n    registerComponent(component: A_TYPES__Ctor<Are>): void {\n        let scope = this.scope;\n\n        while (scope.parent) {\n            scope = scope.parent;\n        }\n\n        scope.register(component);\n    }\n\n    /**\n     * Builds and mounts this node's children from its CURRENT content in a\n     * single pass — the canonical \"(re)render my content\" primitive.\n     *\n     * Call {@link setContent} first, then `render()`. It tokenizes the content\n     * into child nodes and runs the full per-child pipeline\n     * (`init → load → transform → compile → mount`) in document order — the\n     * exact sequence the engine's build + execute applies to a fresh subtree,\n     * so a runtime-injected component is rendered identically to a bootstrap\n     * one.\n     *\n     * `load()` (async data) and `mount()` (time-sliced mount) may be\n     * asynchronous, so `render()` awaits them and resolves only once the whole\n     * subtree has finished mounting.\n     *\n     * [!] IDEMPOTENT: `render()` first {@link clear}s any previously built\n     * children (unmount + deregister) so calling it again rebuilds the subtree\n     * from scratch instead of appending a duplicate. This is essential because\n     * `@Are.onAfterMount` — where imperative \"dynamic component\" hosts call\n     * `setContent()` + `render()` — re-runs on EVERY (re)mount, including when\n     * an `AreRoot` outlet restores a stashed subtree from `AreRootCache` on a\n     * tab switch. Without the clear, `tokenize()` (which appends child nodes)\n     * would accumulate a duplicate subtree per re-mount and re-init the stale,\n     * already-live children — cascading scope-inheritance errors / a UI freeze.\n     * A first render has no children, so the clear is a cheap no-op there.\n     *\n     * [!] This is the single source of truth for runtime subtree construction.\n     * Consumers (e.g. routing outlets) MUST use it instead of re-implementing\n     * the loop, so the proven order lives in one place.\n     */\n    async render(): Promise<void> {\n        await this.clear();\n\n        this.tokenize();\n\n        for (const child of this.children) {\n            child.init();\n\n            const loaded = child.load();\n            if (loaded instanceof Promise) await loaded;\n\n            child.transform();\n            child.compile();\n\n            const mounted = child.mount();\n            if (mounted instanceof Promise) await mounted;\n        }\n    }\n\n    /**\n     * Unmounts and detaches every child subtree of this node — the safe\n     * counterpart to {@link render}, used when swapping out content.\n     *\n     * Each child is unmounted (removed from the rendered output) and then\n     * deregistered from this node's scope. The children list is snapshotted up\n     * front because `removeChild` mutates it.\n     *\n     * [!] A child can still appear in this node's children list while its OWN\n     * sub-scope has already been deallocated (e.g. by `cloneWithScope` during\n     * mount). `unmount()` asserts scope inheritance and would throw\n     * \"not bound to any context scope\" for such a node, so it is guarded by a\n     * cheap `A_Context.has` check — an unbound node has nothing to unmount and\n     * is simply deregistered.\n     *\n     * It intentionally does NOT call `child.destroy()`: `destroy()` recurses\n     * into the subtree where an internal node may likewise have no scope,\n     * reintroducing the same throw. This is the hazard `AreRoot.stashChild`\n     * sidesteps (its post-removeChild `void child.destroy()` rejection is\n     * silently swallowed). Unmounting + deregistering is the empirically-safe\n     * teardown: the detached subtree is unreferenced and collected.\n     */\n    async clear(): Promise<void> {\n        for (const child of [...this.children]) {\n            if (A_Context.has(child)) {\n                child.unmount();\n            }\n\n            this.removeChild(child);\n        }\n    }\n\n    clone<T extends AreNode = AreNode>(this: T): T {\n        const newNode = new (this.constructor as new (props: AreNodeNewProps) => T)({\n            opening: this._opening,\n            closing: this._closing,\n            position: this._position,\n            payload: this._payload || {},\n            content: this._content,\n            raw: this._markup,\n        });\n\n        /**\n         * Clone all content\n         */\n        for (const child of this.children) {\n            newNode.addChild(child.clone());\n        }\n        /**\n         * Clone all attributes\n         */\n        for (const attribute of this.attributes) {\n            newNode.scope.register(attribute.clone());\n        }\n\n        return newNode as T;\n    }\n\n    /**\n     * Emits an event or a scope to the node, which can be used to trigger event handlers or to provide additional context for processing within the node. The method can accept either an AreEvent instance or an A_Scope instance, and it will handle the emission accordingly. This allows for flexible communication and interaction within the node's context, enabling dynamic behavior and responsiveness based on events or changes in scope.\n     * \n     * @param scope - The scope or event to be emitted to the node\n     */\n    async emit(\n        scope: A_Scope,\n    )\n    async emit(\n        event: AreEvent,\n    )\n    async emit(\n        eventOrScope: AreEvent | A_Scope,\n    ) {\n        this.checkScopeInheritance();\n\n        /**\n         * isolated event scope to avoid polluting the node scope\n         */\n        const eventScope = A_TypeGuards.isScopeInstance(eventOrScope)\n            ? eventOrScope\n                .inherit(this.scope)\n            : new A_Scope({\n                name: `${eventOrScope.name}-scope`,\n                fragments: [eventOrScope]\n            })\n                .inherit(this.scope)\n\n        try {\n            await this.call(AreNodeFeatures.onEmit, eventScope)\n\n            eventScope.destroy()\n\n        } catch (error) {\n            eventScope.destroy();\n\n            throw error;\n        }\n\n    }\n\n\n    /**\n     * Destroys the node, which typically involves executing any necessary cleanup logic to remove the node from the scene and to free up any resources associated with the node. This may include deregistering the node from its scope, removing any event listeners or reactive properties, and performing any other necessary cleanup tasks to ensure that the node is properly removed from the scene and that resources are released as needed.\n     * \n     * [!] Note: The destroy method should ensure that the node's scope is properly inherited from the context scope before performing any cleanup, and it should handle any errors that may occur during destruction to ensure that resources are released correctly.\n     */\n    async destroy(): Promise<any> {\n        this.checkScopeInheritance();\n        try {\n\n            await super.destroy(this.scope);\n\n            this.scope.destroy();\n\n        } catch (error) {\n\n            this._scope.destroy();\n\n            throw error;\n        }\n    }\n\n\n    //============================================================================================\n    //                                Helpers Methods\n    //============================================================================================\n    /**\n     * Serializes the node into its structural (runtime-free) form, recursively including attributes, child nodes and — for nodes that own a scene (root nodes) — the compiled instruction plan.\n     *\n     * Kept (static / structural): `aseid`, the class `type` discriminator, `entity`, `opening`, `closing`, `position`, `content`, `markup`, `payload`, nested `attributes`, `children` and the owned `scene` plan.\n     * Dropped (runtime-only): the live scope, resolved component, the node `status` and any evaluated attribute values — these must be re-established when the tree is reconstructed and re-interpreted.\n     *\n     * [!] Note, the scene is embedded only by the node that owns it (its `id` matches the scene `id`), so the plan is not duplicated across the inheriting child nodes.\n     *\n     * @returns the serialized, runtime-free representation of the node and its subtree.\n     */\n    toJSON(): AreNode_Serialized {\n        const scene = this._scope\n            ? this._scope.resolve<AreScene>(AreScene)\n            : undefined;\n\n        return {\n            aseid: this.aseid.toString(),\n            type: A_CommonHelper.getComponentName(this.constructor),\n            entity: this.aseid.entity,\n            opening: this._opening,\n            closing: this._closing,\n            position: this._position,\n            content: this._content,\n            markup: this._markup,\n            payload: this._payload,\n            attributes: this._scope\n                ? this.attributes.map(attribute => attribute.toJSON())\n                : [],\n            children: this._scope\n                ? this.children.map(child => child.toJSON())\n                : [],\n            scene: scene && scene.id === this.id\n                ? scene.toJSON()\n                : undefined,\n        };\n    }\n\n    /**\n     * Method to ensure that the current scope is inherited from the context scope\n     * \n     * @throws A_Error if the scope is not inherited from the context scope\n     */\n    protected checkScopeInheritance(): void {\n        let attachedScope: A_Scope;\n\n        try {\n            attachedScope = A_Context.scope(this);\n        } catch (error) {\n            throw new A_Error({\n                title: `A_UI_Node Scope Inheritance Error`,\n                description: `The A_UI_Node entity with ASEID '${this.aseid.toString()}' is not bound to any context scope. Please ensure that the entity is created within a valid context.`,\n                originalError: error\n            });\n        }\n    }\n}"]}