{"version":3,"file":"Component.cjs","sources":["../src/Component.js"],"sourcesContent":["import View from './View.js';\nimport Model from './Model.js';\nimport SafeHTML from './core/SafeHTML.js';\nimport Partial from './core/Partial.js';\nimport EventsManager from './core/EventsManager.js';\nimport Element from './core/Element.js';\nimport Interpolation from './core/Interpolation.js';\nimport validateListener from './utils/validateListener.js';\nimport getResult from './utils/getResult.js';\nimport deepFlat  from './utils/deepFlat.js';\nimport parseHTML from './utils/parseHTML.js';\nimport findComment from './utils/findComment.js';\nimport getAttributesHTML from './utils/getAttributesHTML.js';\nimport replaceNode from './utils/replaceNode.js';\nimport createDevelopmentErrorMessage from './utils/createDevelopmentErrorMessage.js';\nimport createProductionErrorMessage from './utils/createProductionErrorMessage.js';\nimport formatTemplateSource from './utils/formatTemplateSource.js';\nimport __DEV__ from './utils/dev.js';\n\n/**\n * Same as getResult, but pass context as argument to the expression.\n * Used to evaluate expressions in the context of a component.\n * @param {any} expression The expression to be evaluated.\n * @param {any} context The context to call the expression with.\n * @param {string} [meta] Optional metadata about the expression type for error messages.\n * @return {any} The result of the evaluated expression.\n * @private\n */\nconst getExpressionResult = (expression, context, meta) => {\n    try {\n        if (typeof expression !== 'function') return expression;\n        // In development, detect uninstantiated Component classes and provide a helpful error.\n        // This typically happens when a component tag is malformed and not properly expanded.\n        if (__DEV__ && expression.prototype instanceof Component) {\n            throw new Error(\n                `Received uninstantiated Component class \"${expression.name || 'Anonymous'}\". ` +\n                'This usually happens when a component tag is malformed (e.g., missing closing tag or typo). ' +\n                'If that\\'s not the case, make sure to instantiate child components using a component tag, mount(), or new.'\n            );\n        }\n\n        return expression.call(context, context);\n    } catch (error) {\n        if (meta && !error._rasti) {\n            let message;\n\n            if (__DEV__) {\n                const formattedSource = formatTemplateSource(context.source, expression);\n                message = createDevelopmentErrorMessage(\n                    `Error in ${context.constructor.name}#${context.uid} (${meta})\\n${error.message}\\n\\nTemplate source:\\n\\n${formattedSource}`\n                );\n            } else {\n                message = createProductionErrorMessage(`Error in ${context.constructor.name}#${context.uid} expression`);\n            }\n\n            const enhancedError = new Error(message, { cause : error });\n            enhancedError._rasti = true;\n\n            throw enhancedError;\n        }\n\n        throw error;\n    }\n};\n\n/**\n * Check if an element is a component root element.\n * Component root elements have the data attribute ending with '-1'.\n * @param {Element} el The element to check.\n * @return {boolean} True if the element is a component root element.\n * @private\n */\nconst isComponent = (el) => !!(el && el.dataset && el.dataset[Component.DATASET_ELEMENT] && el.dataset[Component.DATASET_ELEMENT].endsWith('-1'));\n\n/**\n * Check if an element contains (or is) a dynamic element.\n * @param {Element} el The element to check.\n * @return {boolean} True if the element contains (or is) a dynamic element.\n * @private\n */\nconst containsElement = (el) => !!(el && ((el.dataset && el.dataset[Component.DATASET_ELEMENT]) || (el.querySelector && el.querySelector(`[${Component.ATTRIBUTE_ELEMENT}]`))));\n\n/**\n * Generate string with placeholders for interpolated expressions.\n * @param {Array<string>} strings Array of strings.\n * @param {Array<any>} expressions Array of expressions.\n * @return {string} String with placeholders.\n * @private\n */\nconst addPlaceholders = (strings, expressions) =>\n    strings.reduce((out, string, i) => {\n        // Add string part.\n        out.push(string);\n        // Add expression placeholders.\n        if (typeof expressions[i] !== 'undefined') {\n            out.push(Component.PLACEHOLDER(i));\n        }\n        return out;\n    }, []).join('');\n\n/**\n * Generate one dimensional array with strings and expressions.\n * @param main {string} The main template containing placeholders.\n * @param {Array<any>} expressions Array of expressions to replace placeholders.\n * @return {array} Array containing strings and expressions.\n * @private\n */\nconst splitPlaceholders = (main, expressions) => {\n    const PH = Component.PLACEHOLDER('(\\\\d+)');\n    const matchSinglePlaceholder = main.match(new RegExp(`^${PH}$`));\n    if (matchSinglePlaceholder) return [expressions[parseInt(matchSinglePlaceholder[1], 10)]];\n\n    const regExp = new RegExp(`${PH}`, 'g');\n    const out = [];\n    let lastIndex = 0;\n    let match;\n    // Generate one dimensional array with strings and expressions, \n    // so all the components are added as children by the parent component.\n    while ((match = regExp.exec(main)) !== null) {\n        const before = main.slice(lastIndex, match.index);\n        out.push(Component.markAsSafeHTML(before), expressions[parseInt(match[1], 10)]);\n        lastIndex = match.index + match[0].length;\n    }\n    out.push(Component.markAsSafeHTML(main.slice(lastIndex)));\n\n    return out;\n};\n\n/**\n * Expand attributes.\n * @param {Array<Array<any>>} attributes Array of attributes as key, value pairs.\n * @param {Function} getExpressionResult Function to render expressions.\n * @return {object}\n * @property {object} all All attributes.\n * @property {object} events Event listeners.\n * @property {object} attributes Attributes.\n * @private\n */\nconst expandAttributes = (attributes, getExpressionResult) => attributes.reduce((out, pair) => {\n    const attribute = getExpressionResult(pair[0]);\n    // Attribute without value. \n    if (pair.length === 1) {\n        if (typeof attribute === 'object') {\n            // Expand objects as attributes.\n            out = Object.assign(out, attribute);\n        } else if (typeof attribute === 'string') {\n            // Treat as boolean.\n            out[attribute] = true;\n        }\n    } else {\n        // Attribute with value.\n        const value = pair[2] ? getExpressionResult(pair[1]) : pair[1];\n        out[attribute] = value;\n    }\n\n    return out;\n}, {});\n\n/**\n * Expand events.\n * @param {object} attributes Attributes object.\n * @param {EventsManager} eventsManager Events manager.\n * @param {Function} getDataAttribute Function to get data attribute name with uid.\n * @return {object} Attributes object.\n * @private\n */\nconst expandEvents = (attributes, eventsManager, getDataAttribute) => {\n    const out = {};\n    Object.keys(attributes).forEach(key => {\n        // Check if key is an event listener.\n        const match = key.match(/on(([A-Z]{1}[a-z]+)+)/);\n\n        if (match && match[1]) {\n            const type = match[1].toLowerCase();\n            const listener = attributes[key];\n            if (listener) {\n                const index = eventsManager.addListener(listener, type);\n                // Add event listener index.\n                out[getDataAttribute(type)] = index;\n            }\n        } else {\n            // Add attribute.\n            out[key] = attributes[key];\n        }\n    });\n    return out;\n};\n\n/**\n * Replace component tags with expressions.\n * `<${Component} />` or `<${Component}></${Component}>` will be replaced \n * by a function that mounts the component.\n * Returns the template with component tags replaced by expressions placeholders \n * modifies the expressions array adding the mount functions.\n * @param main {string} The main template.\n * @param {Array<any>} expressions Array of expressions.\n * @param {boolean} skipNormalization Skip placeholder normalization (for recursive calls).\n * @return {string} The template with components tags replaced by expressions\n * placeholders.\n * @private\n */\nconst expandComponents = (main, expressions, skipNormalization = false) => {\n    const PH = Component.PLACEHOLDER('(\\\\d+)');\n    const componentRefMap = new Map();\n    // Normalize component references to use first placeholder index.\n    // Only on first call, not on recursive calls.\n    if (!skipNormalization) {\n        main = main.replace(\n            new RegExp(PH, 'g'),\n            (match, idx) => {\n                const expression = expressions[idx];\n                if (expression && expression.prototype instanceof Component) {\n                    if (componentRefMap.has(expression)) {\n                        return componentRefMap.get(expression);\n                    }\n                    componentRefMap.set(expression, match);\n                }\n                return match;\n            }\n        );\n    }\n    // Match component tags with backreference to ensure correct pairing.\n    return main.replace(\n        new RegExp(`<(${PH})([^>]*)/>|<(${PH})([^>]*)>([\\\\s\\\\S]*?)</\\\\4>`,'g'),\n        (match, selfClosingTag, selfClosingIdx, selfClosingAttrs, openTag, openIdx, nonVoidAttrs, inner) => {\n            let tag, attributesStr, innerList;\n\n            if (openTag) {\n                tag = expressions[openIdx];\n                attributesStr = nonVoidAttrs;\n            } else {\n                tag = typeof selfClosingIdx !== 'undefined' ? expressions[selfClosingIdx] : selfClosingTag;\n                attributesStr = selfClosingAttrs;\n            }\n            // No component found.\n            if (!(tag.prototype instanceof Component)) return match;\n            // Non void component.\n            if (openTag) {\n                // Process inner content same way as partial().\n                // Recursively expand inner components.\n                const innerTemplate = expandComponents(inner, expressions, true);\n                // Parse partial elements to handle dynamic attributes and events.\n                const parsedInner = parsePartialElements(innerTemplate, expressions);\n                // Split into items.\n                innerList = splitPlaceholders(parsedInner, expressions);\n            }\n            // Parse attributes.\n            const attributes = parseAttributes(attributesStr, expressions);\n            // Create mount function.\n            const mount = function() {\n                const options = expandAttributes(attributes, value => getExpressionResult(value, this, 'children options'));\n                // Add `renderChildren` function to options.\n                if (innerList) {\n                    // Evaluate items in parent context and create Partial.\n                    options.renderChildren = () => new Partial(innerList.map(item => getExpressionResult(item, this, 'children')));\n                }\n                // Mount component.\n                return tag.mount(options);\n            };\n            // Add mount function to expression.\n            expressions.push(mount);\n            // Replace whole string with expression placeholder.\n            return Component.PLACEHOLDER(expressions.length - 1);\n        }\n    );\n};\n\n/**\n * Replace elements in template.\n * @param {string} template Template string.\n * @param {Function} replacer Replacer function.\n * @return {string} Template string with replaced elements.\n * @private\n */\nconst replaceElements = (template, replacer) => {\n    const PH = Component.PLACEHOLDER('(?:\\\\d+)');\n    return template.replace(\n        new RegExp(`<(${PH}|[a-z]+[1-6]?)(?:\\\\s*)((?:\"[^\"]*\"|'[^']*'|[^>])*)(/?>)`, 'gi'),\n        replacer\n    );\n};\n\n/**\n * Parse all HTML elements in template and extract their attributes.\n * @param {string} template Template string with placeholders.\n * @param {Array} expressions Array of expressions.\n * @param {Array} elements Array to store element references.\n * @return {string} Template with parsed attributes.\n * @throws {SyntaxError} If the template does not have a single root element or is a container component.\n * @private\n */\nconst parseElements = (template, expressions, elements) => {\n    const PH = Component.PLACEHOLDER('(?:\\\\d+)');\n    // Check if template is a container (single placeholder, no tag).\n    const containerMatch = template.match(new RegExp(`^\\\\s*${PH}\\\\s*$`));\n    if (containerMatch) return template;\n\n    // Validate that template has a root element.\n    const rootElementMatch = template.match(new RegExp(`^\\\\s*<([a-z]+[1-6]?|${PH})([^>]*)>([\\\\s\\\\S]*?)</(\\\\1|${PH})>\\\\s*$|^\\\\s*<([a-z]+[1-6]?|${PH})([^>]*)/>\\\\s*$`));\n\n    if (!rootElementMatch) {\n        const message = __DEV__ ?\n            createDevelopmentErrorMessage(\n                'Invalid component template structure.\\n' +\n                'The template must have a single root element or render a single component.\\n\\n' +\n                'Valid examples:\\n' +\n                '- `<div>content</div>`\\n' +\n                '- `<${MyComponent} />`\\n\\n' +\n                'Invalid examples:\\n' +\n                '- `<div></div><div></div>`  (multiple root elements)\\n' +\n                '- `text <div></div>`  (text outside root element)'\n            ) :\n            createProductionErrorMessage('Invalid component template');\n        throw new Error(message);\n    }\n\n    let elementUid = 0;\n    // Match all HTML elements including placeholders and self-closed elements.\n    return replaceElements(rootElementMatch[0], (match, tag, attributesStr, ending) => {\n        const isRoot = elementUid === 0;\n        const currentElementUid = ++elementUid;\n        // If there are no dynamic attributes, return original match.\n        if (!isRoot && !attributesStr.match(new RegExp(PH))) {\n            return match;\n        }\n        // Parse attributes.\n        const parsedAttributes = parseAttributes(attributesStr, expressions);\n        // Create element reference.\n        const generateElementUid = componentUid => `${componentUid}-${currentElementUid}`;\n        // Create function that returns attributes object.\n        const getAttributes = function() {\n            // Expand attributes and events.\n            const attributes = expandEvents(\n                expandAttributes(parsedAttributes, value => getExpressionResult(value, this, 'element attribute')),\n                this.eventsManager,\n                type => Component.ATTRIBUTE_EVENT(type, this.uid)\n            );\n            // Extend template attributes with `options.attributes`.\n            if (isRoot && this.attributes) {\n                Object.assign(attributes, getResult(this.attributes, this));\n            }\n            // Add data attribute for element identification.\n            // First element gets the component uid, others get element uid.\n            attributes[Component.ATTRIBUTE_ELEMENT] = generateElementUid(this.uid);\n\n            return attributes;\n        };\n\n        const getSelector = function() {\n            return `[${Component.ATTRIBUTE_ELEMENT}=\"${generateElementUid(this.uid)}\"]`;\n        };\n        const elementIndex = elements.length;\n        // Add element reference to elements array.\n        elements.push({\n            getSelector,\n            getAttributes,\n        });\n        // Add new expression to expressions array.\n        expressions.push(function() {\n            const element = this.template.elements[elementIndex];\n            const attributes = element.getAttributes.call(this);\n            element.previousAttributes = attributes;\n            return Component.markAsSafeHTML(getAttributesHTML(attributes));\n        });\n        // Replace attributes with placeholder.\n        const placeholder = Component.PLACEHOLDER(expressions.length - 1);\n        // Preserve original tag ending (> or />)\n        return `<${tag} ${placeholder}${ending}`;\n    });\n};\n\n/**\n * Parse elements in partial template.\n * @param {string} template Template string with placeholders.\n * @param {Array} expressions Array of expressions.\n * @return {string} Template with parsed attributes.\n * @private\n */\nconst parsePartialElements = (template, expressions) => {\n    const PH = Component.PLACEHOLDER('(?:\\\\d+)');\n    // Match all HTML elements including placeholders and self-closed elements.\n    return replaceElements(template, (match, tag, attributesStr, ending) => {\n        // If there are no dynamic attributes, return original match.\n        if (!attributesStr.match(new RegExp(PH))) {\n            return match;\n        }\n        // Parse attributes.\n        const parsedAttributes = parseAttributes(attributesStr, expressions);\n        // Create function that returns attributes object.\n        const getAttributes = function() {\n            const attributes = expandEvents(\n                expandAttributes(parsedAttributes, value => getExpressionResult(value, this, 'partial element attribute')),\n                this.eventsManager,\n                type => Component.ATTRIBUTE_EVENT(type, this.uid)\n            );\n\n            return attributes;\n        };\n        // Add new expression to expressions array.\n        expressions.push(function() {\n            const attributes = getAttributes.call(this);\n            return Component.markAsSafeHTML(getAttributesHTML(attributes));\n        });\n        // Replace attributes with placeholder.\n        const placeholder = Component.PLACEHOLDER(expressions.length - 1);\n        // Preserve original tag ending (> or />)\n        return `<${tag} ${placeholder}${ending}`;\n    });\n};\n\n/**\n * Parse all interpolations in template text content.\n * @param {string} template Template string with placeholders.\n * @param {Array} expressions Array of expressions.\n * @param {Array} interpolations Array to store interpolation references.\n * @return {string} Template with interpolation markers.\n * @private\n */\nconst parseInterpolations = (template, expressions, interpolations) => {\n    const PH = Component.PLACEHOLDER('(\\\\d+)');\n    let interpolationUid = 0;\n    // Match all expression placeholders.\n    return template.replace(\n        new RegExp(PH, 'g'),\n        function(match, expressionIndex, offset) {\n            // Check if this placeholder is inside an element tag (attribute).\n            // `offset` is the index of the match in the original string.\n            const beforeMatch = template.substring(0, offset);\n            const lastOpenTag = beforeMatch.lastIndexOf('<');\n            const lastCloseTag = beforeMatch.lastIndexOf('>');\n            // If we're inside an element tag, don't process as interpolation.\n            if (lastOpenTag > lastCloseTag) {\n                return match;\n            }\n\n            const currentInterpolationUid = ++interpolationUid;\n\n            function getStart() {\n                return Component.MARKER_START(`${this.uid}-${currentInterpolationUid}`);\n            }\n            function getEnd() {\n                return Component.MARKER_END(`${this.uid}-${currentInterpolationUid}`);\n            }\n            const interpolationIndex = interpolations.length;\n            // Add interpolation reference to interpolations array.\n            interpolations.push({\n                getStart,\n                getEnd,\n                expression : expressions[expressionIndex]\n            });\n            // Add new expression to expressions array.\n            expressions.push(function() {\n                return this.template.interpolations[interpolationIndex];\n            });\n            // Replace with new placeholder.\n            return Component.PLACEHOLDER(expressions.length - 1);\n        }\n    );\n};\n\n/**\n * Parse attributes string to extract dynamic attributes.\n * @param {string} attributesStr Attributes string from HTML element.\n * @param {Array} expressions Array of expressions.\n * @return {Array} Array of attribute pairs [key, value] or [key, value, hasQuotes].\n * @private\n */\nconst parseAttributes = (attributesStr, expressions) => {\n    const PH = Component.PLACEHOLDER('(\\\\d+)');\n    const attributes = [];\n    // Parse attributes string with support for placeholders in both names and values.\n    const regExp = new RegExp(`(?:${PH}|([\\\\w-]+))(?:=([\"']?)(?:${PH}|((?:.?(?![\"']?\\\\s+(?:\\\\S+)=|\\\\s*/>|\\\\s*[>\"']))+.))?\\\\3)?`, 'g');\n\n    let attributeMatch;\n    while ((attributeMatch = regExp.exec(attributesStr)) !== null) {\n        const [, attributeIdx, attribute, quotes, valueIdx, value] = attributeMatch;\n\n        const hasQuotes = !!quotes;\n\n        let attr = typeof attributeIdx !== 'undefined' ? expressions[parseInt(attributeIdx, 10)] : attribute;\n        let val = typeof valueIdx !== 'undefined' ? expressions[parseInt(valueIdx, 10)] : value;\n\n        if (hasQuotes && typeof val === 'undefined') {\n            val = '';\n        }\n\n        if (typeof val !== 'undefined') {\n            attributes.push([attr, val, hasQuotes]);\n        } else {\n            attributes.push([attr]);\n        }\n    }\n\n    return attributes;\n};\n\n/*\n * These option keys will be extended on the component instance.\n */\nconst componentOptions = ['key', 'state', 'onCreate', 'onChange', 'onHydrate', 'onBeforeRecycle', 'onRecycle', 'onBeforeUpdate', 'onUpdate'];\n\n/**\n * @lends module:Component\n */\nclass Component extends View {\n    constructor(options = {}) {\n        super(...arguments);\n        this.componentOptions = [];\n        // Extend \"this\" with options.\n        componentOptions.forEach(key => {\n            if (key in options) {\n                this[key] = options[key];\n                this.componentOptions.push(key);\n            }\n        });\n        // Extract props from options that aren't component or view options.\n        const props = {};\n        Object.keys(options).forEach(key => {\n            if (this.viewOptions.indexOf(key) === -1 && this.componentOptions.indexOf(key) === -1) {\n                props[key] = options[key];\n            }\n        });\n        // Store props as Model for reactive updates.\n        this.props = new Model(props);\n        // Store options by default.\n        this.options = options;\n        // Bind `partial` method to `this`.\n        this.partial = this.partial.bind(this);\n        // Bind `onChange` method to `this`.\n        this.onChange = this.onChange.bind(this);\n        // Call lifecycle method.\n        this.onCreate.apply(this, arguments);\n    }\n\n    /**\n     * Get events object for automatic event delegation, based on data attributes.\n     * @return {object} The events object.\n     * @private\n     */\n    events() {\n        const events = {};\n        // Create events object.\n        this.eventsManager.types.forEach(type => {\n            const dataAttribute = Component.ATTRIBUTE_EVENT(type, this.uid);\n            // Create a listener function that gets the listener index from the data attribute and calls the listener.\n            const listener = function(event, component, matched) {\n                // Get the listener index from the data attribute.\n                const index = matched.getAttribute(dataAttribute);\n                // Root element listener may not have a data attribute.\n                if (index) {\n                    let currentListener = this.eventsManager.listeners[parseInt(index, 10)];\n                    if (typeof currentListener === 'string') currentListener = this[currentListener];\n                    validateListener(currentListener);\n                    // Call the listener.\n                    currentListener.call(this, event, component, matched);\n                }\n            };\n            // Add an event listener to the events object for each event type, using the data attribute\n            // as both a CSS selector and to store the listener's index.\n            events[`${type} [${dataAttribute}]`] = listener;\n            // Add an event listener to the events object for each event type that matches the root element.\n            events[type] = listener;\n        });\n\n        return events;\n    }\n\n    /**\n     * Override super method. We don't want to ensure an element on instantiation.\n     * We will provide it later.\n     * @private\n     */\n    ensureElement() {\n        // Store data event listeners.\n        this.eventsManager = new EventsManager();\n        // Call template function.\n        this.template = getResult(this.template, this);\n        // If el is provided, delegate events.\n        if (this.el) {\n            // If \"this.el\" is a function, call it to get the element.\n            this.el = getResult(this.el, this);\n            // Check if the element has a parent node.\n            if (!this.el.parentNode) {\n                const message = __DEV__ ?\n                    createDevelopmentErrorMessage(\n                        `Hydration failed in ${this.constructor.name}#${this.uid}\\n` +\n                        'The element must have a parent node for hydration to work.\\n' +\n                        'Make sure the element is mounted in the DOM before hydrating.'\n                    ) :\n                    createProductionErrorMessage(`Hydration failed in ${this.constructor.name}#${this.uid}`);\n                throw new Error(message);\n            }\n            // Render the component as a string to generate children components.\n            this.toString();\n            // Hydrate the component.\n            this.hydrate(this.el.parentNode);\n        }\n    }\n\n    /**\n     * Tell if `Component` is a container.\n     * In which case, it will not have an element by itself.\n     * It will render a single expression which is expected to return a single component as child.\n     * `this.el` will be a reference to that child component's element.\n     * @return {boolean}\n     * @private\n     */\n    isContainer() {\n        return this.template.elements.length === 0 && this.template.interpolations.length === 1;\n    }\n\n    /**\n     * Subscribes to a `change` event on a model or emitter object and invokes the `onChange` lifecycle method.\n     * The subscription is automatically cleaned up when the component is destroyed.\n     * By default, the component subscribes to changes on `this.model`, `this.state`, and `this.props`.\n     * \n     * @param {Object} model - The model or emitter object to listen to.\n     * @param {string} [type='change'] - The event type to listen for.\n     * @param {Function} [listener=this.onChange] - The callback to invoke when the event is emitted.\n     * @returns {Component} The current component instance for chaining.\n     */\n    subscribe(model, type = 'change', listener = this.onChange) {\n        // Check if model has `on` method.\n        if (model.on) this.listenTo(model, type, listener);\n        return this;\n    }\n\n    /**\n     * Used internally on the render process.\n     * Attach the `Component` to the dom element providing `this.el`, delegate events, \n     * subscribe to model changes and call `onHydrate` lifecycle method.\n     * @param parent {node} The parent node.\n     * @return {Component} The component instance.\n     * @private\n     */\n    hydrate(parent) {\n        ['model', 'state', 'props'].forEach(key => {\n            if (this[key]) this.subscribe(this[key]);\n        });\n\n        if (this.isContainer()) {\n            // Don't hydrate interpolation markers for container components as we know they will have only one child.\n            // Call hydrate on children.\n            this.children[0].hydrate(parent);\n            // Set the first element as the component's element.\n            this.el = this.children[0].el;\n        } else {\n            // Search for every element in template using getSelector\n            this.template.elements.forEach((element, index) => {\n                if (index === 0) {\n                    element.hydrate(parent);\n                    this.el = element.ref;\n                }\n                else {\n                    element.hydrate(this.el);\n                }\n            });\n            // Get references for interpolation marker comments\n            this.template.interpolations.forEach(interpolation => interpolation.hydrate(this.el));\n            this.children.forEach(child => child.hydrate(this.el));\n        }\n        // Delegate events.\n        this.delegateEvents();\n        // Call `onHydrate` lifecycle method.\n        this.onHydrate.call(this);\n        // Return `this` for chaining.\n        return this;\n    }\n\n    /**\n     * Used internally on the render process.\n     * Reuse a `Component` by replacing the placeholder comment with the real nodes.\n     * Calls `onBeforeRecycle` lifecycle method at the beginning, before any recycling operations occur.\n     * @param parent {node} The parent node. If not provided, the node is already in the correct position and won't be moved.\n     * @return {Component} The component instance.\n     * @private\n     */\n    recycle(parent) {\n        // Call `onBeforeRecycle` lifecycle method.\n        this.onBeforeRecycle.call(this);\n        // No parent means the node is already in the correct position. So we don't need to replace it.\n        if (parent) {\n            // Locate the placeholder comment and replace it with the real nodes\n            const placeholder = findComment(parent, Component.MARKER_RECYCLED(this.uid), isComponent);\n            replaceNode(placeholder, this.el);\n        }\n        // Return `this` for chaining.\n        return this;\n    }\n\n    /**\n     * Update the component's props.\n     * Sets the props and calls the `onRecycle` lifecycle method.\n     * @param props {object} The props to set on the component.\n     * @return {Component} The component instance.\n     * @private\n     */\n    updateProps(props) {\n        // Set the props.\n        this.props.set(props);\n        // Call `onRecycle` lifecycle method.\n        this.onRecycle.call(this);\n        // Return `this` for chaining.\n        return this;\n    }\n\n    /**\n     * Get a `comment` marker with same data attribute as this component.\n     * Used to replace the component when it is recycled.\n     * @return {string} The recycle placeholder.\n     * @private\n     */\n    getRecycledMarker() {\n        return `<!--${Component.MARKER_RECYCLED(this.uid)}-->`;\n    }\n\n    /**\n     * Tagged template helper method.\n     * Used to create a partial template.  \n     * It will return a Partial object that preserves structure for position-based recycling.\n     * Components will be added as children by the parent component. Template strings literals \n     * will be marked as safe HTML to be rendered.\n     * This method is bound to the component instance by default.\n     * @param {TemplateStringsArray} strings - Template strings.\n     * @param  {...any} expressions - Template expressions.\n     * @return {Partial} Partial object containing strings and expressions.\n     * @example\n     * import { Component } from 'rasti';\n     * // Create a Title component.\n     * const Title = Component.create`\n     *     <h1>${({ props }) => props.renderChildren()}</h1>\n     * `;\n     * // Create Main component.\n     * const Main = Component.create`\n     *     <main>\n     *         ${self => self.renderHeader()}\n     *     </main>\n     * `.extend({\n     *     // Render header method.\n     *     // Use `partial` to render an HTML template adding children components.\n     *     renderHeader() {\n     *         return this.partial`\n     *             <header>\n     *                 <${Title}>${({ model }) => model.title}</${Title}>\n     *             </header>\n     *         `;\n     *     }\n     * });\n     */\n    partial(strings, ...expressions) {\n        const items = splitPlaceholders(\n            parsePartialElements(\n                expandComponents(\n                    addPlaceholders(\n                        strings,\n                        expressions\n                    ).trim(),\n                    expressions\n                ),\n                expressions\n            ),\n            expressions\n        ).map(item => getExpressionResult(item, this, 'partial'));\n\n        return new Partial(items);\n    }\n\n    /**\n     * Render a template part.\n     * @param {any} part - The template part.\n     * @param {function} addChild - The addChild function. It should handle children and return a HTML string.\n     * @param {Array} items - The items array. It is used to store the items that are parsed.\n     * @return {string} The rendered template part.\n     * @private\n     */\n    renderTemplatePart(part, addChild, tracker) {\n        const item = getExpressionResult(part, this, 'template part');\n\n        if (typeof item === 'undefined' || item === null || item === false || item === true) {\n            return '';\n        }\n\n        if (item instanceof SafeHTML) {\n            return `${item}`;\n        }\n\n        if (item instanceof Component) {\n            return `${addChild(item, tracker)}`;\n        }\n\n        if (item instanceof Partial) {\n            // Single item.\n            if (item.items.length === 1) return this.renderTemplatePart(item.items[0], addChild, tracker);\n            // Several items.\n            tracker.push();\n            const out = item.items.map(subItem => {\n                tracker.increment();\n                return this.renderTemplatePart(subItem, addChild, tracker);\n            }).join('');\n            tracker.pop();\n            return out;\n        }\n        // Handle arrays (user loops) - disable tracking.\n        if (Array.isArray(item)) {\n            tracker.pause();\n            const out = deepFlat(item).map(subItem => this.renderTemplatePart(subItem, addChild, tracker)).join('');\n            tracker.resume();\n            return out;\n        }\n        // Interpolation: add markers and process maintaining tracking.\n        if (item instanceof Interpolation) {\n            // Reset the tracker.\n            const tracker = item.tracker;\n            tracker.reset();\n            // Add Interpolation markers.\n            const startMarker = this.isContainer() ? '' : `<!--${item.getStart()}-->`;\n            const endMarker = this.isContainer() ? '' : `<!--${item.getEnd()}-->`;\n            return `${startMarker}${this.renderTemplatePart(item.expression, addChild, tracker)}${endMarker}`;\n        }\n\n        return `${Component.sanitize(item)}`;\n    }\n\n    /**\n     * Render the component as a string.\n     * Used internally on the render process.  \n     * Use it for server-side rendering or static site generation.\n     * @return {string} The rendered component.\n     * @example\n     * import { Component } from 'rasti';\n     * const Button = Component.create`\n     *     <button class=\"button\">Click me</button>\n     * `;\n     * const App = Component.create`\n     *     <div>\n     *         <${Button}>Click me</${Button}>\n     *     </div>\n     * `;\n     * \n     * const app = new App();\n     * \n     * console.log(app.toString());\n     * // <div data-rst-el=\"r1-1\"><!--rst-s-r1-1--><button class=\"button\" data-rst-el=\"r2-1\">Click me</button><!--rst-e-r1-1--></div>\n     * \n     * console.log(`${app}`);\n     * // <div data-rst-el=\"r1-1\"><!--rst-s-r1-1--><button class=\"button\" data-rst-el=\"r2-1\">Click me</button><!--rst-e-r1-1--></div>\n     */\n    toString() {\n        // Normally there won't be any children, but if there are, destroy them.\n        this.destroyChildren();\n        // Normally there won't be any data event listeners, but if there are, clear them.\n        this.eventsManager.reset();\n        // Bind addChild method.\n        const addChild = (component, tracker) => {\n            tracker.track(component);\n            return this.addChild(component);\n        };\n        // Render the template parts.\n        return this.template.parts\n            .map(part => this.renderTemplatePart(part, addChild))\n            .join('');\n    }\n\n    /**\n     * Render the `Component`.\n     * \n     * **First render (when `this.el` is not present):**\n     * This is the initial render call. The component will be rendered as a string inside a `DocumentFragment` and hydrated, \n     * making `this.el` available. `this.el` is the root DOM element of the component that can be applied to the DOM. \n     * The `onHydrate` lifecycle method will be called. \n     * \n     * **Note:** Typically, you don't need to call `render()` directly for the first render. The static method `Component.mount()` \n     * handles this process automatically, creating the component instance, rendering it, and appending it to the DOM.\n     * \n     * **Update render (when `this.el` is present):**\n     * This indicates the component is being updated. The method will:\n     * - Update only the attributes of the root element and child elements\n     * - Update only the content of interpolations (the dynamic parts of the template)\n     * - For container components (components that render a single child component), update the single interpolation\n     * \n     * The `onBeforeUpdate` lifecycle method will be called at the beginning, followed by the `onUpdate` lifecycle method at the end.\n     * \n     * **Child component handling:**\n     * When rendering child components, they can be either recreated or recycled:\n     * \n     * - **Recreation:** A new component instance is created, running the constructor again. This happens when no matching component \n     *   is found for recycling.\n     * \n     * - **Recycling:** The same component instance is reused. Recycling happens in two ways:\n     *   - Components with a `key` are recycled if a previous child with the same key exists\n     *   - Unkeyed components are recycled if they have the same type and position in the template or partial\n     * \n     *   When a component is recycled:\n     *   - The `onBeforeRecycle` lifecycle method is called when recycling starts\n     *   - The component's `this.props` is updated with the new props from the parent\n     *   - The `onRecycle` lifecycle method is called after props are updated\n     * \n     *   A recycled component may not use props at all and remain unchanged, or it may be subscribed to a different model \n     *   (or even the same model as the parent) and update independently in subsequent render cycles.\n     * \n     * @return {Component} The component instance.\n     */\n    render() {\n        // Prevent a last re render if view is already destroyed.\n        if (this.destroyed) return this;\n        // If `this.el` is not present, render the view as a string and hydrate it.\n        if (!this.el) {\n            const fragment = parseHTML(this);\n            this.hydrate(fragment);\n            return this;\n        }\n        // Call `onBeforeUpdate` lifecycle method.\n        this.onBeforeUpdate.call(this);\n        // Clear event listeners.\n        this.eventsManager.reset();\n        // Store previous children.\n        const previousChildren = this.children;\n        // Clear current children.\n        this.children = [];\n        // Store props to update.\n        const propsQueue = [];\n        // Update interpolations.\n        this.template.interpolations.forEach(interpolation => {\n            // Reset the tracker.\n            const tracker = interpolation.tracker;\n            tracker.reset();\n\n            const nextChildren = [];\n            const recycledChildren = [];\n\n            // `addChild` handler is called from `renderTemplatePart` for every component.\n            // It should handle children and return a HTML string.\n            // In this case, where the component updates, it handles children recycling.\n            const addChild = (component) => {\n                let out = component;\n                let found = null;\n                // Check if child already exists by key.\n                if (component.key) {\n                    found = previousChildren.find(prev => prev.key === component.key);\n                } else {\n                    // Find by position and type using tracker.\n                    found = tracker.findRecyclable(component);\n                }\n\n                if (found) {\n                    // If child already exists, replace it html by its root element.\n                    out = found.getRecycledMarker();\n                    // Add child to recycled children.\n                    recycledChildren.push([found, component]);\n                    // Track the component.\n                    tracker.track(found);\n                } else {\n                    // Add new component.\n                    nextChildren.push(component);\n                    // Track the component.\n                    tracker.track(component);\n                }\n                // Return the component or placeholder.\n                return out;\n            };\n            // Render the interpolation content.\n            const rendered = this.renderTemplatePart(interpolation.expression, addChild, tracker);\n\n            const recycle = ([recycled, discarded], fragment) => {\n                // Store props to update.\n                propsQueue.push([recycled, discarded.props.toJSON()]);\n                // Add child and recycle (move to new position if needed).\n                this.addChild(recycled).recycle(fragment);\n                // Destroy discarded component.\n                discarded.destroy();\n            };\n            // Same single component in the same position. Don't move it.\n            if (tracker.hasSingleComponent()) {\n                recycle(recycledChildren[0], null);\n                return;\n            }\n            // Parse the rendered content and get the fragment.\n            const fragment = parseHTML(rendered);\n\n            const handleComponents = (parent) => () => {\n                // Add recycled components to children and move them to the new template in the fragment.\n                recycledChildren.forEach(recycled => recycle(recycled, parent));\n                // Add new children. Hydrate them and update the interpolation.\n                nextChildren.forEach(child => this.addChild(child).hydrate(parent));\n            };\n\n            if (this.isContainer()) {\n                interpolation.updateElement(this.el, fragment, handleComponents(this.el.parentNode));\n            } else {\n                interpolation.update(fragment, handleComponents(this.el));\n            }\n        });\n        // Destroy unused children.\n        previousChildren.forEach(prev => {\n            if (this.children.indexOf(prev) < 0) prev.destroy();\n        });\n        // Update recycled children props.\n        propsQueue.forEach(([recycled, props]) => {\n            recycled.updateProps(props);\n        });\n        // If this component is a container, set el to the child element.\n        // Otherwise, update elements attributes and delegate events.\n        if (this.isContainer()) {\n            this.el = this.children[0].el;\n        } else {\n            // Update elements attributes.\n            this.template.elements.forEach(element => element.update());\n        }\n        // If there are pending event types, delegate events again.\n        if (this.eventsManager.hasPendingTypes()) {\n            this.delegateEvents();\n        }\n        // Call onUpdate lifecycle method.\n        this.onUpdate.call(this);\n        // Return this for chaining.\n        return this;\n    }\n\n    /**\n     * Lifecycle method. Called when the component is created, at the end of the constructor.\n     * This method receives the same arguments passed to the constructor (options and any additional parameters).\n     * It executes both on client and server.\n     * Use this method to define models or state that will be used later in `onHydrate`.\n     * @param {...*} args The constructor arguments (options and any additional parameters).\n     */\n    onCreate() {}\n\n    /**\n     * Lifecycle method. Called when model emits `change` event.\n     * By default calls `render` method.\n     * This method can be extended with custom logic.\n     * Maybe comparing new attributes with previous ones and calling\n     * render when needed.\n     * @param model {Model} The model that emitted the event.\n     * @param changed {object} Object containing keys and values that has changed.\n     * @param [...args] {any} Any extra arguments passed to set method.\n     */\n    onChange() {\n        this.render();\n    }\n\n    /**\n     * Lifecycle method. Called when the component is rendered for the first time and hydrated in a DocumentFragment.\n     * This method only executes on the client and only during the first render.\n     * Use this method for client-only operations like making API requests or setting up browser-specific functionality.\n     */\n    onHydrate() {}\n\n    /**\n     * Lifecycle method. Called before the component is recycled and reused between renders.\n     * This method is called at the beginning of the `recycle` method, before any recycling operations occur.\n     * \n     * A component is recycled when:\n     * - It has a `key` and a previous child with the same key exists\n     * - It doesn't have a `key` but has the same type and position in the template or partial\n     * \n     * Use this method to perform operations that need to happen before the component is recycled,\n     * such as storing previous state or preparing for the recycling.\n     */\n    onBeforeRecycle() {}\n\n    /**\n     * Lifecycle method. Called when the component is recycled and reused between renders.\n     * \n     * A component is recycled when:\n     * - It has a `key` and a previous child with the same key exists\n     * - It doesn't have a `key` but has the same type and position in the template or partial\n     * \n     * During recycling, the component instance is reused and its props are updated with new values.\n     * The component's element may be moved in the DOM if the new template structure differs from the previous one.\n     */\n    onRecycle() {}\n\n    /**\n     * Lifecycle method. Called before the component is updated or re-rendered.\n     * This method is called at the beginning of the `render` method when the component's state, model, or props change and trigger a re-render.\n     * Use this method to perform operations that need to happen before the component is updated,\n     * such as saving previous state or preparing for the update.\n     */\n    onBeforeUpdate() {}\n\n    /**\n     * Lifecycle method. Called when the component is updated or re-rendered.\n     * This method is called when the component's state, model, or props change and trigger a re-render.\n     * Use this method to perform operations that need to happen on every update.\n     */\n    onUpdate() {}\n\n    /**\n     * Lifecycle method. Called when the component is destroyed.\n     * Use this method to clean up resources, cancel timers, remove event listeners, etc.\n     * @param {...*} args Options object or any arguments passed to `destroy` method.\n     */\n    onDestroy() {}\n\n    /**\n     * Mark a string as safe HTML to be rendered.  \n     * Normally you don't need to use this method, as Rasti will automatically mark string literals \n     * as safe HTML when the component is {@link #module_component_create created} and when \n     * using the {@link #module_component__partial Component.partial} method.  \n     * Be sure that the string is safe to be rendered, as it will be inserted into the DOM without any sanitization.\n     * @static\n     * @param {string} value \n     * @return {SafeHTML} A safe HTML object.\n     */\n    static markAsSafeHTML(value) {\n        return new SafeHTML(value);\n    }\n\n    /**\n     * Helper method used to extend a `Component`, creating a subclass.\n     * @static\n     * @param {object|Function} object Object containing methods to be added to the new `Component` subclass. Also can be a function that receives the parent prototype and returns an object.\n     */\n    static extend(object) {\n        const Current = this;\n\n        class Component extends Current {}\n\n        Object.assign(\n            Component.prototype,\n            typeof object === 'function' ? object(Current.prototype) : object\n        );\n\n        return Component;\n    }\n\n    /**\n     * Mount the component into the DOM.\n     * Creates a new component instance with the provided options and optionally mounts it into the DOM.\n     * \n     * **Mounting modes:**\n     * - **Normal mount** (default): Renders the component as HTML and appends it to the provided element. Use this for client-side rendering.\n     * - **Hydration mode**: Assumes the DOM already contains the component's HTML (from server-side rendering). \n     * \n     * If `el` is not provided, the component is instantiated but not mounted (the same as using `new Component(options)`). You can mount it later by calling `render()` and appending the element (`this.el`) to the DOM.\n     * \n     * @static\n     * @param {object} [options={}] The component options. These will be passed to the constructor and can include \n     *                              `model`, `state`, `props`, lifecycle methods, and any other component-specific options.\n     * @param {node} [el] The DOM element where the component will be mounted. If provided, the component will be \n     *                    rendered and appended to this element. If not provided, the component is created but not mounted.\n     * @param {boolean} [hydrate=false] If `true`, enables hydration mode for server-side rendering. The component will \n     *                                  assume the DOM already contains its HTML structure and will only hydrate it.\n     *                                  If `false` (default), the component will be rendered from scratch and appended to `el`.\n     * @return {Component} The component instance.\n     * @example\n     * import { Component, Model } from 'rasti';\n     * \n     * const Button = Component.create`\n     *     <button class=\"${({ props }) => props.className}\">\n     *         ${({ props }) => props.label}\n     *     </button>\n     * `;\n     * \n     * // Normal mount: render and append to DOM.\n     * const button = Button.mount({\n     *     label: 'Click me'\n     * }, document.body);\n     * \n     * // Create without mounting (mount later).\n     * const button2 = Button.mount({ className : 'secondary', label : 'Save' });\n     * // Later, render and append it to the DOM.\n     * document.body.appendChild(button2.render().el);\n     * \n     * // Hydration mode: hydrate existing server-rendered HTML\n     * // Assuming document.body already contains the HTML structure of the button.\n     * const hydratedButton = Button.mount({\n     *     className : 'primary',\n     *     label : 'Click me'\n     * }, document.body, true);\n     */\n    static mount(options, el, hydrate) {\n        // Instantiate component.\n        const component = new this(options);\n        // If `el` is passed, mount component.\n        if (el) {\n            if (hydrate) {\n                // Hydrate existing DOM, only generate subcomponents calling `toString`.\n                component.toString();\n            } else {\n                // Render the component and append it to the provided element.\n                el.append(parseHTML(component));\n            }\n            // Hydrate in both cases.\n            component.hydrate(el);\n        }\n        // Return component instance.\n        return component;\n    }\n\n    /**\n     * Takes a tagged template string or a function that returns another component, and returns a new `Component` class.\n     * - The template outer tag and attributes will be used to create the view's root element.\n     * - The template inner HTML will be used as the view's template.\n     *   ```javascript\n     *   const Button = Component.create`<button class=\"button\">Click me</button>`;\n     *   ```\n     * - Template interpolations that are functions will be evaluated during the render process, receiving the view instance as an argument and being bound to it. If the function returns `null`, `undefined`, `false`, or an empty string, the interpolation won't render any content.\n     *   ```javascript\n     *   const Button = Component.create`\n     *       <button class=\"${({ props }) => props.className}\">\n     *           ${({ props }) => props.renderChildren()}\n     *       </button>\n     *   `;\n     *   ```\n     * - Attach DOM event handlers per element using camel-cased attributes.\n     *   Event handlers are automatically bound to the component instance (`this`).\n     *   Internally, Rasti uses event delegation to the component's root element for performance.\n     *   \n     *   **Attribute Quoting:**\n     *   - **Quoted attributes** (`onClick=\"${handler}\"`) evaluate the expression first, useful for dynamic values\n     *   - **Unquoted attributes** (`onClick=${handler}`) pass the function reference directly\n     *   \n     *   **Listener Signature:** `(event, component, matched)`\n     *   - `event`: The native DOM event object\n     *   - `component`: The component instance (same as `this`)\n     *   - `matched`: The element that matched the event (useful for delegation)\n     *   \n     *   ```javascript\n     *   const Button = Component.create`\n     *       <button \n     *           onClick=${function(event, component, matched) {\n     *               // this === component\n     *               console.log('Button clicked:', matched);\n     *           }}\n     *           onMouseOver=\"${({ model }) => () => model.isHovered = true}\"\n     *           onMouseOut=\"${({ model }) => () => model.isHovered = false}\"\n     *       >\n     *           Click me\n     *       </button>\n     *   `;\n     *   ```\n     *   \n     *   If you need custom delegation (e.g., `{'click .selector': 'handler'}`), \n     *   you may override the `events` property as described in {@link #module_view__delegateevents View.delegateEvents}.\n     * - Boolean attributes should be passed in the format `attribute=\"${() => true}\"`. `false` attributes won't be rendered. `true` attributes will be rendered without a value.\n     *   ```javascript\n     *   const Input = Component.create`\n     *       <input type=\"text\" disabled=${({ props }) => props.disabled} />\n     *   `;\n     *   ```\n     * - If the interpolated function returns a component instance, it will be added as a child component.\n     * - If the interpolated function returns an array, each item will be evaluated as above.\n     *   ```javascript\n     *   // Create a button component.\n     *   const Button = Component.create`\n     *       <button class=\"button\">\n     *           ${({ props }) => props.renderChildren()}\n     *       </button>\n     *   `;\n     *   // Create a navigation component. Add buttons as children. Iterate over items.\n     *   const Navigation = Component.create`\n     *       <nav>\n     *           ${({ props }) => props.items.map(\n     *               item => Button.mount({ renderChildren : () => item.label })\n     *           )}\n     *       </nav>\n     *   `;\n     *   // Create a header component. Add navigation as a child.\n     *   const Header = Component.create`\n     *       <header>\n     *           ${({ props }) => Navigation.mount({ items : props.items})}\n     *       </header>\n     *   `;\n     *   ```\n     * - Child components can be added using a component tag.\n     *   ```javascript\n     *   // Create a button component.\n     *   const Button = Component.create`\n     *       <button class=\"button\">\n     *            ${({ props }) => props.renderChildren()}\n     *       </button>\n     *   `;\n     *   // Create a navigation component. Add buttons as children. Iterate over items.\n     *   const Navigation = Component.create`\n     *       <nav>\n     *           ${({ props, partial }) => props.items.map(\n     *               item => partial`<${Button}>${item.label}</${Button}>`\n     *           )}\n     *       </nav>\n     *   `;\n     *   // Create a header component. Add navigation as a child.\n     *   const Header = Component.create`\n     *       <header>\n     *           <${Navigation} items=\"${({ props }) => props.items}\" />\n     *       </header>\n     *   `;\n     *   ```\n     * - If the tagged template contains only one expression that mounts a component, or the tags are references to a component, the component will be considered a <b>container</b>. It will render a single component as a child. `this.el` will be a reference to that child component's element.\n     *   ```javascript\n     *   // Create a button component.\n     *   const Button = Component.create`\n     *       <button class=\"${({ props }) => props.className}\">\n     *           ${({ props }) => props.renderChildren()}\n     *       </button>\n     *   `;\n     *   // Create a container that renders a Button component.\n     *   const ButtonOk = Component.create`\n     *       <${Button} className=\"ok\">Ok</${Button}>\n     *   `;\n     *   // Create a container that renders a Button component, using a function.\n     *   const ButtonCancel = Component.create(() => Button.mount({\n     *       className : 'cancel',\n     *       renderChildren : () => 'Cancel'\n     *   }));\n     *   ```\n     * @static\n     * @param {string|Function} strings - HTML template for the component or a function that mounts a sub component.\n     * @param {...*} expressions - The expressions to be interpolated within the template.\n     * @return {Component} The newly created component class.\n     */\n    static create(strings, ...expressions) {\n        // Containers can be created using create as a functions instead of a tagged template.\n        if (typeof strings === 'function') {\n            expressions = [strings];\n            strings = ['', ''];\n        }\n        // Store original template source for debugging (only in dev mode).\n        const source = __DEV__ ? { strings, expressions : [...expressions] } : null;\n        // Create elements, interpolations and parts arrays.\n        const elements = [], interpolations = [];\n        const parts = splitPlaceholders(\n            parseInterpolations(\n                parseElements(\n                    expandComponents(\n                        addPlaceholders(\n                            strings,\n                            expressions\n                        ).trim(),\n                        expressions\n                    ),\n                    expressions,\n                    elements\n                ),\n                expressions,\n                interpolations\n            ),\n            expressions\n        );\n        // Create subclass for this component.\n        return this.extend({\n            source,\n            template() {\n                return {\n                    elements : elements.map(element => new Element({\n                        getSelector : element.getSelector.bind(this),\n                        getAttributes : element.getAttributes.bind(this)\n                    })),\n                    interpolations : interpolations.map(interpolation => new Interpolation({\n                        getStart : interpolation.getStart.bind(this),\n                        getEnd : interpolation.getEnd.bind(this),\n                        expression : interpolation.expression,\n                        shouldSkipFind : isComponent,\n                        shouldSkipSync : containsElement\n                    })),\n                    parts,\n                };\n            }\n        });\n    }\n}\n\n/*\n * Attributes used to identify elements and events.\n */\nComponent.ATTRIBUTE_ELEMENT = 'data-rst-el';\nComponent.ATTRIBUTE_EVENT = (type, uid) => `data-rst-on-${type}-${uid}`;\n\n/*\n * Dataset attribute used to identify elements.\n */\nComponent.DATASET_ELEMENT = 'rstEl';\n\n/*\n * Placeholders used to temporarily replace expressions in the template.\n */\nComponent.PLACEHOLDER = (idx) => `__RASTI_PLACEHOLDER_${idx}__`;\n\n/*\n * Markers used to identify interpolation and recycled components.\n */\nComponent.MARKER_RECYCLED = (uid) => `rst-r-${uid}`;\nComponent.MARKER_START = (uid) => `rst-s-${uid}`;\nComponent.MARKER_END = (uid) => `rst-e-${uid}`;\n\n/**\n * Components are a special kind of `View` that is designed to be easily composable, \n * making it simple to add child views and build complex user interfaces.  \n * Unlike views, which are render-agnostic, components have a specific set of rendering \n * guidelines that allow for a more declarative development style.  \n * Components are defined with the {@link #module_component_create Component.create} static method, which takes a tagged template string or a function that returns another component.\n * @module\n * @extends View\n * @param {object} options Object containing options. The following keys will be merged to `this`: model, state, key, onDestroy, onHydrate, onBeforeRecycle, onRecycle, onBeforeUpdate, onUpdate, onCreate, onChange. Any additional options not in the component or view options list will be automatically extracted as props and stored as `this.props`.\n * @property {string} [key] A unique key to identify the component. Components with keys are recycled when the same key is found in the previous render. Unkeyed components are recycled based on type and position.\n * @property {Model} [model] A `Model` or any emitter object containing data and business logic. The component will listen to `change` events and call `onChange` lifecycle method.\n * @property {Model} [state] A `Model` or any emitter object containing data and business logic, to be used as internal state. The component will listen to `change` events and call `onChange` lifecycle method.\n * @property {Model} [props] Automatically created from any options not merged to the component instance. Contains props passed from parent component as a `Model`. The component will listen to `change` events on props and call `onChange` lifecycle method. When a component with a `key` is recycled during parent re-render, new props are automatically updated and any changes trigger a re-render.\n * @see {@link #module_component_create Component.create}\n * @example\n * import { Component, Model } from 'rasti';\n * // Create Timer component.\n * const Timer = Component.create`\n *     <div>\n *         Seconds: <span>${({ model }) => model.seconds}</span>\n *     </div>\n * `;\n * // Create model to store seconds.\n * const model = new Model({ seconds : 0 });\n * // Mount timer on body.\n * Timer.mount({ model }, document.body);\n * // Increment `model.seconds` every second.\n * setInterval(() => model.seconds++, 1000);\n */\nexport default Component.create`<div></div>`;\n"],"names":["__DEV__","formatTemplateSource","createDevelopmentErrorMessage","createProductionErrorMessage","Partial","getResult","getAttributesHTML","validateListener","EventsManager","findComment","replaceNode","SafeHTML","deepFlat","Interpolation","parseHTML","Element"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,KAAK;AAC3D,IAAI,IAAI;AACR,QAAQ,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE,OAAO,UAAU;AAC/D;AACA;AACA,QAAQ,IAAIA,SAAO,IAAI,UAAU,CAAC,SAAS,YAAY,SAAS,EAAE;AAClE,YAAY,MAAM,IAAI,KAAK;AAC3B,gBAAgB,CAAC,yCAAyC,EAAE,UAAU,CAAC,IAAI,IAAI,WAAW,CAAC,GAAG,CAAC;AAC/F,gBAAgB,8FAA8F;AAC9G,gBAAgB;AAChB,aAAa;AACb,QAAQ;;AAER,QAAQ,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;AAChD,IAAI,CAAC,CAAC,OAAO,KAAK,EAAE;AACpB,QAAQ,IAAI,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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE;AACvC;AACA,QAAQ,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC;AAC3C;AACA,QAAQ,IAAI,EAAE,EAAE;AAChB,YAAY,IAAI,OAAO,EAAE;AACzB;AACA,gBAAgB,SAAS,CAAC,QAAQ,EAAE;AACpC,YAAY,CAAC,MAAM;AACnB;AACA,gBAAgB,EAAE,CAAC,MAAM,CAACG,eAAS,CAAC,SAAS,CAAC,CAAC;AAC/C,YAAY;AACZ;AACA,YAAY,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;AACjC,QAAQ;AACR;AACA,QAAQ,OAAO,SAAS;AACxB,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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