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iB,IACrB,EAAW,OAAO,EAAK,EAkB3B,EAAQ,gBAAkB,CAE7B","file":"/npm/ejs-component@0.0.30/dist/index.umd.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/ejs-component@0.0.30/dist/index.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n    typeof define === 'function' && define.amd ? define(['exports'], factory) :\n    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ejsComponent = {}));\n})(this, (function (exports) { 'use strict';\n\n    const isString = (v) => typeof v === 'string';\n    const isNumber = (v) => typeof v === 'number';\n    const isFunction = (v) => typeof v === 'function';\n    const isPlainObject = (v) => {\n        if (!v || typeof v !== 'object') return false\n        const proto = Object.getPrototypeOf(v);\n        const hasObjectPrototype =\n            proto === null ||\n            proto === Object.prototype ||\n            Object.getPrototypeOf(proto) === null;\n        if (!hasObjectPrototype) {\n            return false\n        }\n        return Object.prototype.toString.call(v) === '[object Object]'\n    };\n\n    const merge = (target, ...list) => {\n        for (const index of Object.keys(list)) {\n            for (const key of Object.keys(list[index])) {\n                const value = list[index][key];\n                if (isPlainObject(value)) {\n                    target[key] = merge(target[key] || {}, value);\n                    continue\n                }\n                if (Array.isArray(value)) {\n                    target[key] = merge(target[key] || [], value);\n                    continue\n                }\n                target[key] = value;\n            }\n        }\n        return target\n    };\n\n    const attrRe = /[\\w-]+/;\n    const attrCamelRe = /^(data|aria)/;\n    const upperRe = /[A-Z]/g;\n\n    const attrName = (name) => {\n        name = String(name);\n        if (name.match(attrRe)) {\n            if (name.match(attrCamelRe)) {\n                name = name.replace(upperRe, '-$&').toLowerCase();\n            }\n            return name\n        }\n    };\n\n    const options = {\n        logErrors() {},\n        componentCreated(name, component) {},\n        isSafeString() {\n            return false\n        },\n        escapeValue(value) {\n            return value\n        },\n        tagNodeToString(node) {\n            return JSON.stringify(node)\n        }\n    };\n\n    const configureComponent = (params = {}) => {\n        if (isFunction(params.logErrors)) {\n            options.logErrors = params.logErrors;\n        }\n        if (isFunction(params.escapeValue)) {\n            options.escapeValue = params.escapeValue;\n        }\n        if (isFunction(params.componentCreated)) {\n            options.componentCreated = params.componentCreated;\n        }\n        if (isFunction(params.tagNodeToString)) {\n            options.tagNodeToString = params.tagNodeToString;\n        }\n        if (isFunction(params.isSafeString)) {\n            options.isSafeString = params.isSafeString;\n        }\n    };\n\n    class ComponentNode {\n        parentNode = null\n        toParent(parent) {\n            if (parent instanceof ComponentNode) {\n                this.parentNode = parent;\n            }\n            if (parent === null) {\n                this.parentNode = null;\n            }\n            return this\n        }\n        isSafeString(node) {\n            return options.isSafeString(node)\n        }\n        hasChildNodes(node) {\n            return node instanceof ComponentListNode\n        }\n        getNode(value) {\n            if (value instanceof ComponentNode) {\n                return value\n            }\n            if (this.isSafeString(value)) {\n                return new ComponentSafeNode(value)\n            }\n            if (isString(value) || isNumber(value)) {\n                return new ComponentTextNode(value)\n            }\n            if (isPlainObject(value)) {\n                if (isString(value.tag) && isPlainObject(value.attrs)) {\n                    return new ComponentTagNode(\n                        value.tag,\n                        value.attrs,\n                        value.content || []\n                    )\n                }\n            }\n        }\n        prependTo(node) {\n            if (this.hasChildNodes(node)) {\n                node.prepend(this);\n            }\n        }\n        appendTo(node) {\n            if (this.hasChildNodes(node)) {\n                node.append(this);\n            }\n            return this\n        }\n        remove() {\n            if (this.hasChildNodes(this.parentNode)) {\n                const content = this.parentNode.content;\n                content.splice(content.indexOf(this.toParent(null)), 1);\n            }\n            return this\n        }\n        toString() {\n            return ''\n        }\n        toJSON() {\n            return {}\n        }\n    }\n\n    class ComponentSafeNode extends ComponentNode {\n        constructor(html) {\n            super();\n            this.html = String(html);\n        }\n        toString() {\n            return this.html\n        }\n        toJSON() {\n            return {\n                html: this.html\n            }\n        }\n    }\n\n    class ComponentTextNode extends ComponentNode {\n        constructor(text) {\n            super();\n            this.text = String(options.escapeValue(text));\n        }\n        toString() {\n            return this.text\n        }\n        toJSON() {\n            return {\n                text: this.text\n            }\n        }\n    }\n\n    class ComponentListNode extends ComponentNode {\n        constructor(content) {\n            super();\n            this.content = [];\n            if (Array.isArray(content)) {\n                content.forEach(this.append.bind(this));\n            } else {\n                this.append(content);\n            }\n        }\n        toJSON() {\n            return {\n                content: this.content\n            }\n        }\n        toString() {\n            return String(this.content.join(''))\n        }\n        append(node) {\n            node = this.getNode(node);\n            if (node instanceof ComponentNode) {\n                this.content.push(node.toParent(this));\n            }\n            return this\n        }\n        prepend(node) {\n            node = this.getNode(node);\n            if (node instanceof ComponentNode) {\n                this.content.unshift(node.toParent(this));\n            }\n            return this\n        }\n        empty() {\n            this.content.forEach((item) => {\n                item.toParent(null);\n            });\n            this.content.splice(0, this.content.length);\n            return this\n        }\n    }\n\n    class ComponentTagNode extends ComponentListNode {\n        constructor(tag, attrs, content) {\n            super(content);\n            this.tag = tag;\n            this.attrs = {};\n            this.attr(attrs);\n        }\n        toString() {\n            return options.tagNodeToString(this.toJSON())\n        }\n        toJSON() {\n            return {\n                tag: this.tag,\n                attrs: this.attrs,\n                content: this.content\n            }\n        }\n        getAttribute(name) {\n            name = attrName(name);\n            if (name) {\n                return this.attrs[attrName(name)]\n            }\n        }\n        removeAttribute(name) {\n            name = attrName(name);\n            if (name) {\n                delete this.attrs[attrName(name)];\n            }\n        }\n        setAttribute(name, value) {\n            name = attrName(name);\n            if (name) {\n                if (value === null || value === undefined) {\n                    delete this.attrs[name];\n                } else {\n                    this.attrs[name] = value;\n                }\n            }\n        }\n        toggleAttribute(name, state) {\n            name = attrName(name);\n            if (state === true) {\n                this.attrs[name] = '';\n            } else {\n                delete this.attrs[name];\n            }\n        }\n        hasAttribute(name) {\n            return this.attrs.hasOwnProperty(attrName(name))\n        }\n        classList() {\n            return String(this.attrs.class || '')\n                .trim()\n                .split(/\\s+/)\n        }\n        addClass(...tokens) {\n            const classList = this.classList();\n            tokens.forEach((token) => {\n                if (token && !~classList.indexOf(token)) {\n                    classList.push(token);\n                }\n            });\n            this.attrs.class = classList.join(' ').trim();\n            return this\n        }\n        removeClass(...tokens) {\n            const classList = this.classList();\n            tokens.forEach((token) => {\n                if (!token) return\n                const index = classList.indexOf(token);\n                if (!!~index) {\n                    classList.splice(index, 1);\n                }\n            });\n            this.attrs.class = classList.join(' ').trim();\n            return this\n        }\n        attr(name, value) {\n            if (isPlainObject(name)) {\n                Object.entries(name).forEach(([key, value]) => {\n                    this.setAttribute(key, value);\n                });\n            } else {\n                this.setAttribute(name, value);\n            }\n        }\n    }\n\n    class ComponentTreeNode extends ComponentNode {\n        constructor(data) {\n            super();\n            this.root = this.render(data);\n        }\n        render(data) {\n            if (Array.isArray(data)) {\n                const [name, props, content] = data;\n                if (isString(name) && isPlainObject(props)) {\n                    const component = getComponent(name);\n                    if (component === undefined) return\n                    const { $key, ...componentProps } = props;\n                    const result = component(componentProps, this.render(content));\n                    if (isString($key)) {\n                        this[$key] = result;\n                    }\n                    return result\n                }\n                return new ComponentListNode(\n                    data\n                        .filter((child) => child !== undefined)\n                        .map((child) => this.render(child))\n                )\n            }\n            return this.getNode(data)\n        }\n        toString() {\n            return String(this.root)\n        }\n        toJSON() {\n            return this.root\n        }\n    }\n\n    class Component {\n        static extend(object, options = {}) {\n            Object.entries(object).forEach(([name, value]) => {\n                Component.defineProperty(name, value, options);\n            });\n            return Component\n        }\n        static defineProperty(\n            name,\n            value,\n            { writable, configurable, enumerable } = {}\n        ) {\n            return Object.defineProperty(Component.prototype, name, {\n                value,\n                writable,\n                configurable,\n                enumerable\n            })\n        }\n        empty() {\n            return new ComponentNode()\n        }\n        create(tag, attrs, content) {\n            return new ComponentTagNode(tag, attrs, content)\n        }\n        tree(content) {\n            return new ComponentTreeNode(content)\n        }\n        list(content) {\n            return new ComponentListNode(content)\n        }\n        safe(value) {\n            return new ComponentSafeNode(value)\n        }\n        call(name, props, content) {\n            const instance = components.get(name);\n            if (instance) {\n                return instance(props || {}, content)\n            }\n        }\n        pick(params, props, extra) {\n            return Object.assign(\n                Object.fromEntries(\n                    Object.entries(this.clean(params)).filter(\n                        ([name]) => !!~props.indexOf(name)\n                    )\n                ),\n                this.clean(extra)\n            )\n        }\n        omit(params, props, extra) {\n            return Object.assign(\n                Object.fromEntries(\n                    Object.entries(this.clean(params)).filter(\n                        ([name]) => !~props.indexOf(name)\n                    )\n                ),\n                this.clean(extra)\n            )\n        }\n        clean(params) {\n            if (!params) return {}\n            return Object.fromEntries(\n                Object.entries(params).filter(([_, v]) => v !== undefined)\n            )\n        }\n        join(array, delimiter) {\n            if (array) {\n                return Array.from(array).join(delimiter).trim()\n            }\n        }\n        hasProp(object, prop) {\n            return Object.prototype.hasOwnProperty.call(object, prop)\n        }\n        getNodeItem(item) {\n            if (item instanceof ComponentNode) return item\n            if (!Array.isArray(item)) return\n            if (item.length > 1 && item.length < 4) {\n                const [name, props, content] = item;\n                return this.call(name, props, content)\n            }\n        }\n        prependList(list, node) {\n            if (Array.isArray(list)) {\n                list.reverse().forEach((item) => {\n                    const child = this.getNodeItem(item);\n                    if (child) child.prependTo(node);\n                });\n            }\n        }\n        appendList(list, node) {\n            if (Array.isArray(list)) {\n                list.forEach((item) => {\n                    const child = this.getNodeItem(item);\n                    if (child) child.appendTo(node);\n                });\n            }\n        }\n    }\n\n    const renderComponent = (props, render) => {\n        let node,\n            replace,\n            self = new Component();\n        if (isString(props.tag)) {\n            node = new ComponentTagNode(props.tag, props.attrs, props.content);\n        } else {\n            node = new ComponentListNode(props.content);\n        }\n        if (isFunction(render)) {\n            replace = render(node, props, self);\n        }\n        return replace ? replace : node\n    };\n\n    const components = new Map();\n\n    const createComponent = (name, config) => {\n        const defaults = config.props || {};\n        const render = config.render;\n        /**\n         * @param [props]\n         * @param [content]\n         */\n        const component = (props, content) => {\n            const config = merge({}, defaults, props || {});\n            if (content) {\n                config.content = content;\n            }\n            try {\n                return renderComponent(config, render)\n            } catch (e) {\n                options.logErrors(e);\n            }\n        };\n        components.set(name, component);\n        options.componentCreated(name, component);\n        return component\n    };\n\n    const removeComponent = (name) => {\n        components.delete(name);\n    };\n\n    const getComponent = (name) => {\n        return components.get(name)\n    };\n\n    exports.Component = Component;\n    exports.ComponentListNode = ComponentListNode;\n    exports.ComponentNode = ComponentNode;\n    exports.ComponentSafeNode = ComponentSafeNode;\n    exports.ComponentTagNode = ComponentTagNode;\n    exports.ComponentTextNode = ComponentTextNode;\n    exports.ComponentTreeNode = ComponentTreeNode;\n    exports.configureComponent = configureComponent;\n    exports.createComponent = createComponent;\n    exports.getComponent = getComponent;\n    exports.removeComponent = removeComponent;\n    exports.renderComponent = renderComponent;\n\n}));\n"]}