{"version":3,"file":"noreact-main.js","mappings":";;;;;;;;;;AAAa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe;AACf,gBAAgB,mBAAO,CAAC,uCAAW;AACnC,sBAAsB,mBAAO,CAAC,mDAAiB;AAC/C,mBAAmB,mBAAO,CAAC,6CAAc;AACzC,eAAe,mBAAO,CAAC,qCAAU;AACjC,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf,mC;;;;;;;;;;;ACda;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe;AACf,gBAAgB,mBAAO,CAAC,uCAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,oCAAoC,oCAAoC;AAC7H;AACA;AACA,iDAAiD,+CAA+C;AAChG,iDAAiD,wGAAwG,6BAA6B;AACtL;AACA;AACA,SAAS;AACT;AACA,eAAe;AACf,mC;;;;;;;;;;;AC3Ba;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,OAAO;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,sBAAsB;AACtB,mBAAmB,mBAAO,CAAC,6CAAc;AACzC,eAAe,mBAAO,CAAC,qCAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,cAAc;AACzB,WAAW,oBAAoB;AAC/B;AACA;AACA;AACA;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,oBAAoB;AAC/B;AACA;AACA;AACA;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,QAAQ;AACnB,WAAW,kEAAkE;AAC7E;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,mDAAmD,uEAAuE;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,kEAAkE;AAC7E;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yC;;;;;;;;;;;AC3Ra;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,gBAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,gBAAgB;AAChB;AACA;AACA;AACA,mBAAmB;AACnB,sC;;;;;;;;;;;AC5Ba;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,yBAAyB;AACzB,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sC;;;;;;;;;;;ACvBa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc,GAAG,WAAW;AAC5B;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,WAAW;AACX;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;UCdA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;;ACtBA;;AAEA;AACA,4BAA4B,yFAAyC;;AAErE;AACA;AACA;AACA;AACA,qBAAqB,sEAA4B;;AAEjD","sources":["webpack://noreact/./src/cjs/NoReact.js","webpack://noreact/./src/cjs/TestApp.js","webpack://noreact/./src/cjs/createElement.js","webpack://noreact/./src/cjs/createRoot.js","webpack://noreact/./src/cjs/interfaces.js","webpack://noreact/./src/cjs/useRef.js","webpack://noreact/webpack/bootstrap","webpack://noreact/./src/cjs/entry.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoReact = void 0;\nvar TestApp_1 = require(\"./TestApp\");\nvar createElement_1 = require(\"./createElement\");\nvar createRoot_1 = require(\"./createRoot\");\nvar useRef_1 = require(\"./useRef\");\nexports.NoReact = {\n    createRoot: createRoot_1._createRoot,\n    createElement: createElement_1._createElement,\n    useRef: useRef_1.useRef,\n    TestApp: TestApp_1.TestApp\n};\nexports.default = exports.NoReact;\n//# sourceMappingURL=NoReact.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TestApp = void 0;\nvar NoReact_1 = require(\"./NoReact\");\nvar TestApp = function (name) {\n    var click1 = function () {\n        console.log(\"First clicked\");\n    };\n    var click2 = function () {\n        console.log(\"Second clicked\");\n    };\n    var mouseEnter = function (event) {\n        event.target.style[\"background-color\"] = \"grey\";\n    };\n    var mouseOut = function (event) {\n        event.target.style[\"background-color\"] = \"DeepSkyBlue\";\n    };\n    return (NoReact_1.default.createElement(\"div\", { className: \"NoReact-main\", style: { padding: \"3em\", mx: \"2em\", my: 0 } },\n        \"Hello \",\n        name,\n        NoReact_1.default.createElement(\"div\", { className: \"NoReact-child-1\", onClick: click1 }, \"Hello Nested\"),\n        NoReact_1.default.createElement(\"div\", { className: \"NoReact-child-2\", onClick: click2, onMouseEnter: mouseEnter, onMouseOut: mouseOut, style: { backgroundColor: \"yellow\" } }, \"Hello Nested 2\"),\n        NoReact_1.default.createElement(\"div\", null, [\"A\", \"B\", \"C\"].map(function (text) {\n            return NoReact_1.default.createElement(\"div\", null, text);\n        }))));\n};\nexports.TestApp = TestApp;\n//# sourceMappingURL=TestApp.js.map","\"use strict\";\n/**\n * A function to create the root element of a NoReact app.\n *\n * @author  Ikaros Kappler\n * @version 1.0.0\n * @date    2025-06-25\n */\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n        if (ar || !(i in from)) {\n            if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n            ar[i] = from[i];\n        }\n    }\n    return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._createElement = void 0;\nvar interfaces_1 = require(\"./interfaces\");\nvar useRef_1 = require(\"./useRef\");\nvar PADDING_LEFT = \"padding-left\";\nvar PADDING_RIGHT = \"padding-right\";\nvar PADDING_TOP = \"padding-top\";\nvar PADDING_BOTTOM = \"padding-bottom\";\nvar MARGIN_LEFT = \"margin-left\";\nvar MARGIN_RIGHT = \"margin-right\";\nvar MARGIN_TOP = \"margin-top\";\nvar MARGIN_BOTTOM = \"margin-bottom\";\n/**\n * The main function to create new elements from their JSX defintion.\n *\n * @param {string} name - The node name, like 'div' or 'button' or 'p'.\n * @param {ElementProps} props - The attribte mapping to apply to the new node, like 'className', 'style', 'id'.\n * @param {IElementContent...} content - The node's content.\n * @returns\n */\nvar _createElement = function (name, props) {\n    var content = [];\n    for (var _i = 2; _i < arguments.length; _i++) {\n        content[_i - 2] = arguments[_i];\n    }\n    props = props || {};\n    var newNode = document.createElement(name);\n    _addAttributes(newNode, props);\n    _addContent(newNode, content);\n    return newNode;\n};\nexports._createElement = _createElement;\n/**\n * A private helper function to add content to a newly created node.\n *\n * @param {HTMLElement} node - The node to add content to.\n * @param {IElementContent...} content - The content to add.\n * @returns\n */\nvar _addContent = function (node) {\n    var content = [];\n    for (var _i = 1; _i < arguments.length; _i++) {\n        content[_i - 1] = arguments[_i];\n    }\n    if (!content || !Array.isArray(content)) {\n        return;\n    }\n    content.forEach(function (child) {\n        if (typeof child === \"undefined\") {\n            return;\n        }\n        if (Array.isArray(child)) {\n            _addContent.apply(void 0, __spreadArray([node], child, false));\n        }\n        else if (typeof child === \"string\") {\n            node.append(child);\n        }\n        else {\n            // console.log(\"HTMLElement child\", typeof child, child);\n            node.appendChild(child);\n        }\n    });\n};\n/**\n * Apply node attribute (properties) to a newly created node.\n *\n * @param {HTMLElement} node - The node to apply the properties/attributes to.\n * @param {ElementProps} props - The attribute set.\n */\nvar _addAttributes = function (node, props) {\n    Object.keys(props).forEach(function (key) {\n        // console.log(\"key\", key, \"value\", props[key]);\n        if (!key) {\n            return; // Ignore empty keys\n        }\n        else {\n            var value = props[key];\n            _addAttribute(node, key, value);\n        }\n    });\n};\n/**\n * Adds a single attribute to the newly created node.\n *\n * @param {HTMLElement} node - The node to add the attribute to.\n * @param {string} key - The attribute name, like 'className', 'style', 'id'.\n * @param {string | Function | CSSStyleSheet | Ref<HTMLElement | undefined>} value - The attribute's value.\n */\nvar _addAttribute = function (node, key, value) {\n    if (!key) {\n        return;\n    }\n    var keyLow = key.toLocaleLowerCase();\n    if (keyLow === \"classname\") {\n        node.setAttribute(\"class\", \"\".concat(value));\n    }\n    else if (key === \"style\" || key === \"sx\") {\n        _applyStyles(node, value);\n    }\n    else if (key === \"ref\") {\n        if (!(value instanceof useRef_1.Ref)) {\n            console.warn(\"Warning, passed object is not a ref.\");\n        }\n        if (!value.current) {\n            value.current = node;\n        }\n        // No real attribute\n    }\n    else if (keyLow.length > 5 && keyLow.startsWith(\"data-\")) {\n        var dataKey = key.substring(5);\n        var dataKeyCamelCased = camelize(dataKey);\n        // console.log(\"Handling data attribute\", dataKey);\n        // console.log(\"Applying data set key\", \"dataKey\", dataKey, \"dataKeyCamelCased\", dataKeyCamelCased, value);\n        if (typeof value !== \"string\") {\n            console.warn(\"Warning, passed object is not a string. Cannot set data attribute '\".concat(dataKey, \"'.\"));\n        }\n        else if (value.length === 0) {\n            console.warn(\"Warning, passed value is empty. Cannot set data attribute '\".concat(dataKey, \"'.\"));\n        }\n        else {\n            node.dataset[dataKeyCamelCased] = value;\n            // console.log(\"Node data set\", node.dataset);\n        }\n    }\n    else if (keyLow.length > 2 && keyLow.startsWith(\"on\") && interfaces_1.ClickHandlerNames.includes(keyLow)) {\n        // This is probably a function\n        // Remove the 'on' part\n        var eventName = keyLow.substring(2);\n        node.addEventListener(eventName, value);\n    }\n    else {\n        node.setAttribute(\"\".concat(key), \"\".concat(value));\n    }\n};\n/**\n * Kebab-case to camelCase.\n *\n * See\n *    https://stackoverflow.com/questions/57556471/convert-kebab-case-to-camelcase-with-javascript\n */\nvar camelize = function (str) {\n    var arr = str.split(\"-\");\n    var capital = arr.map(function (item, index) { return (index ? item.charAt(0).toUpperCase() + item.slice(1) : item); });\n    // ^-- change here.\n    var capitalString = capital.join(\"\");\n    // console.log(capitalString);\n    return capitalString;\n};\n/**\n * Apply styles and respect mini-styles.\n *\n * @param {HTMLElement} node - The node to add the attribute to.\n * @param {string | Function | CSSStyleSheet | Ref<HTMLElement | undefined>} value - The attribute's stylesheet value.\n */\nvar _applyStyles = function (node, value) {\n    if (typeof value === \"object\") {\n        // Unwind mini-styles\n        var finalStyles_1 = new CSSStyleSheet();\n        var keys = Object.keys(value);\n        keys.forEach(function (key) {\n            switch (key) {\n                // Paddings\n                case \"p\":\n                    finalStyles_1[PADDING_LEFT] = value[key];\n                    finalStyles_1[PADDING_RIGHT] = value[key];\n                    finalStyles_1[PADDING_TOP] = value[key];\n                    finalStyles_1[PADDING_BOTTOM] = value[key];\n                    break;\n                case \"px\":\n                    finalStyles_1[PADDING_LEFT] = value[key];\n                    finalStyles_1[PADDING_RIGHT] = value[key];\n                    break;\n                case \"py\":\n                    finalStyles_1[PADDING_TOP] = value[key];\n                    finalStyles_1[PADDING_BOTTOM] = value[key];\n                    break;\n                case \"pt\":\n                    finalStyles_1[PADDING_TOP] = value[key];\n                    break;\n                case \"pb\":\n                    finalStyles_1[PADDING_BOTTOM] = value[key];\n                    break;\n                case \"pl\":\n                    finalStyles_1[PADDING_LEFT] = value[key];\n                    break;\n                case \"pr\":\n                    finalStyles_1[PADDING_RIGHT] = value[key];\n                    break;\n                // Margins\n                case \"m\":\n                    finalStyles_1[MARGIN_LEFT] = value[key];\n                    finalStyles_1[MARGIN_RIGHT] = value[key];\n                    finalStyles_1[MARGIN_TOP] = value[key];\n                    finalStyles_1[MARGIN_BOTTOM] = value[key];\n                    break;\n                case \"mx\":\n                    finalStyles_1[MARGIN_LEFT] = value[key];\n                    finalStyles_1[MARGIN_RIGHT] = value[key];\n                    break;\n                case \"my\":\n                    finalStyles_1[MARGIN_TOP] = value[key];\n                    finalStyles_1[MARGIN_BOTTOM] = value[key];\n                    break;\n                case \"mt\":\n                    finalStyles_1[MARGIN_TOP] = value[key];\n                    break;\n                case \"mb\":\n                    finalStyles_1[MARGIN_BOTTOM] = value[key];\n                    break;\n                case \"ml\":\n                    finalStyles_1[MARGIN_LEFT] = value[key];\n                    break;\n                case \"mr\":\n                    finalStyles_1[MARGIN_RIGHT] = value[key];\n                    break;\n                // Display\n                case \"d\":\n                    finalStyles_1[\"display\"] = value[key];\n                    break;\n                // Flex-Direction\n                case \"fd\":\n                    finalStyles_1[\"flex-direction\"] = value[key];\n                    break;\n                // Visibility\n                case \"v\":\n                    finalStyles_1[\"visibility\"] = value[key];\n                    break;\n                // Position\n                case \"pos\":\n                    finalStyles_1[\"position\"] = value[key];\n                    break;\n                // Left\n                case \"l\":\n                    finalStyles_1[\"left\"] = value[key];\n                    break;\n                // Right\n                case \"l\":\n                    finalStyles_1[\"right\"] = value[key];\n                    break;\n                // Top\n                case \"t\":\n                    finalStyles_1[\"top\"] = value[key];\n                    break;\n                // Tottom\n                case \"b\":\n                    finalStyles_1[\"bottom\"] = value[key];\n                    break;\n                // Width\n                case \"w\":\n                    finalStyles_1[\"width\"] = value[key];\n                    break;\n                // Height\n                case \"h\":\n                    finalStyles_1[\"height\"] = value[key];\n                    break;\n                default:\n                    finalStyles_1[key] = value[key];\n            }\n        });\n        // Object.assign(node.style, value);\n        Object.assign(node.style, finalStyles_1);\n    }\n    else {\n        console.warn(\"Cannot assign CSS properties of type \".concat(typeof value, \". Please use an object with CSS mappings.\"));\n    }\n};\n//# sourceMappingURL=createElement.js.map","\"use strict\";\n/**\n * A function to create the root element of a NoReact app.\n *\n * @author  Ikaros Kappler\n * @version 1.0.0\n * @date    2025-06-25\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._createRoot = exports.RootNode = void 0;\nvar RootNode = /** @class */ (function () {\n    function RootNode(rootHtmlElement) {\n        this.rootHtmlNode = rootHtmlElement;\n    }\n    /**\n     * In this implementation rendering just means to append the built JSX result to the DOM node.\n     * @param {HTMLElement} content\n     */\n    RootNode.prototype.render = function (content) {\n        this.rootHtmlNode.appendChild(content);\n    };\n    return RootNode;\n}());\nexports.RootNode = RootNode;\nvar _createRoot = function (rootHtmlElement) {\n    return new RootNode(rootHtmlElement);\n};\nexports._createRoot = _createRoot;\n//# sourceMappingURL=createRoot.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ClickHandlerNames = void 0;\nexports.ClickHandlerNames = [\n    \"onchange\",\n    \"onclick\",\n    \"oninput\",\n    \"onkeydown\",\n    \"onkeyup\",\n    \"onkeypress\",\n    \"onload\",\n    \"onmouseover\",\n    \"onmouseout\",\n    \"onmouseenter\",\n    \"onmouseover\",\n    \"onmouseout\",\n    \"ontouchcancel\",\n    \"ontouchend\",\n    \"ontouchmove\",\n    \"ontouchstart\",\n    \"onmousedown\",\n    \"onmouseup\"\n];\n//# sourceMappingURL=interfaces.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useRef = exports.Ref = void 0;\nvar Ref = /** @class */ (function () {\n    function Ref(value) {\n        this.current = value;\n    }\n    return Ref;\n}());\nexports.Ref = Ref;\nvar useRef = function () {\n    return new Ref(undefined);\n};\nexports.useRef = useRef;\n//# sourceMappingURL=useRef.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// Expose all your components to the global scope here.\n\n// First variant:\nglobalThis._createElement = require(\"./createElement\")._createElement;\n\n// Alternative variant:\n// you might wrap your components into a library.\n// This is usually used to keep the gloal scope clean and avoid naming collisions\n// with other libraries.\nglobalThis.NoReact = require(\"./NoReact\").NoReact;\n\n// globalThis.TestApp = require(\"./TestApp\").TestApp;\n"],"names":[],"sourceRoot":""}