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AEnB,CAjRA","file":"/npm/iuai@0.9.5/iuai.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/iuai@0.9.5/iuai.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(){\n\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n    __assign = Object.assign || function(t) {\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\n            s = arguments[i];\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n                t[p] = s[p];\n        }\n        return t;\n    };\n    return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n    var t = {};\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n        t[p] = s[p];\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n                t[p[i]] = s[p[i]];\n        }\n    return t;\n};\nfunction setInlineStyle(element, style) {\n    try {\n        for (var prop in style) {\n            try {\n                var value = typeof style[prop] === \"string\"\n                    ? style[prop].replace(\"!important\", \"\")\n                    : style[prop];\n                var important = value === style[prop] ? \"\" : \"important\";\n                if (prop in element.style && !important)\n                    element.style[prop] = value;\n                else\n                    element.style.setProperty(prop in element.style ? kebab(prop) : prop, value, important);\n            }\n            catch (e) {\n                console.error(e);\n            }\n        }\n    }\n    catch (e) {\n        throw e;\n    }\n}\nfunction setAttribute(element, name, value) {\n    try {\n        if (name === \"style\")\n            setInlineStyle(element, value);\n        else if (name in element)\n            element[name] = value;\n        else\n            element.setAttribute(name, value);\n    }\n    catch (e) {\n        throw e;\n    }\n}\nfunction createElem(tag, attributes) {\n    if (tag === String(\"\")) {\n        return document.createDocumentFragment();\n    }\n    else {\n        var el = document.createElement(tag);\n        for (var attr in attributes)\n            setAttribute(el, attr, attributes[attr]);\n        return el;\n    }\n}\nfunction appendChildren(parent, children) {\n    for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {\n        var child = children_1[_i];\n        if (typeof child === \"boolean\" || typeof child === \"function\")\n            continue;\n        if (child === null || child === undefined)\n            continue;\n        if (Array.isArray(child)) {\n            appendChildren(parent, child);\n            continue;\n        }\n        try {\n            child !== \"\" &&\n                parent.appendChild(typeof child === \"object\"\n                    ? child\n                    : document.createTextNode(String(child)));\n        }\n        catch (err) {\n            console.error(err);\n        }\n    }\n}\nfunction elemArgs(args) {\n    var _a = typeof args[0] === \"string\" ? [args[0], \"\"] : [args[0].tag, args[0].id], tag = _a[0], id = _a[1];\n    var attributes = {};\n    var children = [];\n    if (args[1]) {\n        if (typeof args[1] === \"string\" || typeof args[1] === \"number\")\n            children = [args[1]];\n        else if (Array.isArray(args[1]))\n            children = args[1];\n        else if (args[1])\n            attributes = args[1];\n    }\n    if (args.length >= 3) {\n        children = args.slice(2);\n    }\n    else {\n        if (Array.isArray(attributes.children))\n            children = attributes.children;\n    }\n    if (\"children\" in attributes) {\n        var _ = attributes.children, rest = __rest(attributes, [\"children\"]);\n        attributes = rest;\n    }\n    if (id)\n        attributes = __assign(__assign({}, attributes), { id: id });\n    return [tag, attributes, children];\n}\nfunction elem() {\n    var args = [];\n    for (var _i = 0; _i < arguments.length; _i++) {\n        args[_i] = arguments[_i];\n    }\n    try {\n        if (isComponent(args[0]))\n            return getComponent(args);\n        var _a = elemArgs(args), tag = _a[0], attributes = _a[1], children = _a[2];\n        var el = createElem(tag, attributes);\n        appendChildren(el, children);\n        return el;\n    }\n    catch (e) {\n        console.error(e);\n        return \"\";\n    }\n}\nvar getStyleSheet = (function () {\n    var styleElement;\n    return function getStyleSheet() {\n        if (!styleElement) {\n            styleElement = document.createElement(\"style\");\n            document.head.appendChild(styleElement);\n        }\n        if (!styleElement.sheet)\n            throw new Error(\"Unable to add style rule.\");\n        return styleElement.sheet;\n    };\n})();\nfunction initRule(sheet, selector, content) {\n    var index = sheet.cssRules.length;\n    sheet.insertRule(selector + (content ? \" { content: \".concat(content, \"; }\") : \" {}\"), index);\n    var rule = sheet.cssRules.item(index);\n    return rule;\n}\nfunction style(selector, properties) {\n    try {\n        var rule = initRule(getStyleSheet(), selector, properties.content);\n        setInlineStyle(rule, properties);\n        return rule;\n    }\n    catch (e) {\n        console.error(e);\n        return null;\n    }\n}\nfunction media(condition, styleRules) {\n    try {\n        var mediaRule = initRule(getStyleSheet(), \"@media \".concat(condition));\n        try {\n            for (var selector in styleRules) {\n                var properties = styleRules[selector];\n                var rule = initRule(mediaRule, selector, properties.content);\n                setInlineStyle(rule, properties);\n            }\n        }\n        catch (e) {\n            console.error(e);\n        }\n        return mediaRule;\n    }\n    catch (e) {\n        console.error(e);\n        return null;\n    }\n}\nfunction assertElement(el, tag) {\n    if (!el)\n        throw new ReferenceError(\"Element not found.\");\n    if (tag && el.tagName.toLowerCase() !== tag)\n        throw new TypeError(\"tag parameter and element's tag do not match.\");\n    return el;\n}\nfunction queryElem(selector, tag) {\n    var el = document.querySelector(selector);\n    return assertElement(el, tag);\n}\nfunction getElem(id, tag) {\n    var el = document.getElementById(id);\n    return assertElement(el, tag);\n}\nfunction getChild(id, tag) {\n    var _a;\n    var el = (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.firstElementChild;\n    return assertElement(el, tag);\n}\nfunction getParent(id, tag) {\n    var _a;\n    var el = (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.parentElement;\n    return assertElement(el, tag);\n}\nvar refElem = (function () {\n    var refCount = 0;\n    return function refElem(tag) {\n        var id = \"e\" + (refCount++).toString(36);\n        var ref = function () {\n            return getElem(id, tag);\n        };\n        ref.id = id;\n        ref.tag = tag;\n        ref.selector = tag + \"#\" + id;\n        ref.toString = function () {\n            return this.selector;\n        };\n        return Object.freeze(ref);\n    };\n})();\nfunction isRef(value) {\n    return (Object.isFrozen(value) &&\n        \"selector\" in value &&\n        value.selector === String(value));\n}\nfunction isComponent(value) {\n    return typeof value === \"function\" && !isRef(value);\n}\nfunction getComponent(args) {\n    try {\n        // this is for jsx compatibility\n        return args[0](__assign({ children: args.slice(2) }, args[1]));\n    }\n    catch (err) {\n        console.error(err);\n        return;\n    }\n}\nfunction kebab(name) {\n    if (name.indexOf(\"-\") !== -1)\n        return name;\n    return name.replace(/([A-Z])/g, function (a) {\n        return \"-\" + a.toLowerCase();\n    });\n}\nvar thisModule = Object.freeze({\n    elem: elem,\n    style: style,\n    media: media,\n    getElem: getElem,\n    queryElem: queryElem,\n    getChild: getChild,\n    getParent: getParent,\n    refElem: refElem,\n    version: \"0.9.5\",\n});\nObject.defineProperty(window, \"iuai\", {\n    value: thisModule,\n    enumerable: true,\n});\n// this is for jsx compatibility\n\"React\" in window ||\n    Object.defineProperty(window, \"React\", {\n        value: { createElement: elem, Fragment: \"\" },\n        enumerable: true,\n    });\n})()\n"]}