text: var nanoJSX;(()=>{"use strict";var e={999:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const s=n(382),r=n(776),o=n(367);t.Component=class{constructor(e){this._elements=[],this._skipUnmount=!1,this._hasUnmounted=!1,this.props=e||{},this.id=this._getHash()}static isClass(){return!0}setState(e,t=!1){"object"==typeof e&&null!==e&&void 0!==this.state?this.state=Object.assign(Object.assign({},this.state),e):this.state=e,t&&this.update()}set state(e){o._state.set(this.id,e)}get state(){return o._state.get(this.id)}set initState(e){void 0===this.state&&(this.state=e)}get elements(){return this._elements||[]}set elements(e){Array.isArray(e)||(e=[e]),e.forEach((e=>{this._elements.push(e)}))}_addNodeRemoveListener(){/^[^{]+{\s+}$/gm.test(this.didUnmount.toString())||(0,s.onNodeRemove)(this.elements[0],(()=>{this._skipUnmount||this._didUnmount()}))}_didMount(){this._addNodeRemoveListener(),this.didMount()}_didUnmount(){this._hasUnmounted||(this.didUnmount(),this._hasUnmounted=!0)}willMount(){}didMount(){}didUnmount(){}render(e){}update(e){this._skipUnmount=!0;const t=[...this.elements];this._elements=[];let n=this.render(e);n=(0,r._render)(n),this.elements=n;const s=t[0].parentElement;s||console.warn("Component needs a parent element to get updated!"),this.elements.forEach((e=>{s&&s.insertBefore(e,t[0])})),t.forEach((e=>{e.remove(),e=null})),this._addNodeRemoveListener(),(0,r.tick)((()=>{this._skipUnmount=!1,this.elements[0].isConnected||this._didUnmount()}))}_getHash(){}}},523:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createContext=void 0,t.createContext=e=>{let t=e;return{Provider:e=>(e.value&&(t=e.value),e.children),Consumer:e=>({component:e.children[0](t),props:Object.assign(Object.assign({},e),{context:t})}),get:()=>t,set:e=>t=e}}},776:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.h=t.renderComponent=t._render=t.render=t.hydrate=t.appendChildren=t.strToHash=t.removeAllChildNodes=t.tick=void 0,t.tick="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,t.removeAllChildNodes=e=>{for(;e.firstChild;)e.removeChild(e.firstChild)},t.strToHash=e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t).toString(32)},t.appendChildren=(e,n)=>{Array.isArray(n)?("object"==typeof n&&(n=Array.prototype.slice.call(n)),n.forEach((n=>{if(Array.isArray(n))(0,t.appendChildren)(e,n);else{const s=(0,t._render)(n);void 0!==s&&(Array.isArray(s)?(0,t.appendChildren)(e,s):e.appendChild(null==s.nodeType?document.createTextNode(s.toString()):s))}}))):(0,t.appendChildren)(e,[n])},t.hydrate=(e,n=null,s=!0)=>(0,t.render)(e,n,s),t.render=(e,n=null,s=!0)=>{let r=(0,t._render)(e);return Array.isArray(r)&&(r=r.map((e=>(0,t._render)(e))),1===r.length&&(r=r[0])),n?(s&&(0,t.removeAllChildNodes)(n),r&&n.id&&n.id===r.id&&n.parentElement?n.parentElement.replaceChild(r,n):Array.isArray(r)?r.forEach((e=>{(0,t.appendChildren)(n,(0,t._render)(e))})):(0,t.appendChildren)(n,(0,t._render)(r)),n.ssr?n.ssr:n):"boolean"!=typeof isSSR||!0!==isSSR||Array.isArray(r)?r:[r]},t._render=e=>void 0===e||null==e?[]:"string"==typeof e?e:"number"==typeof e?e.toString():e.tagName&&"svg"===e.tagName.toLowerCase()?(e=>{const t=e.children[0],n=t.attributes,s=r("svg");for(let e=n.length-1;e>=0;e--)s.setAttribute(n[e].name,n[e].value);return s.innerHTML=t.innerHTML,s})({children:[e]}):e.tagName?e:e&&e.component&&e.component.isClass&&e.component.isClass()?s(e):e.component&&"function"==typeof e.component?n(e):Array.isArray(e)?e.map((e=>(0,t._render)(e))).flat():"function"==typeof e?(0,t._render)(e()):e.component&&e.component.tagName&&"string"==typeof e.component.tagName||Array.isArray(e.component)||e.component?(0,t._render)(e.component):"object"==typeof e?[]:void console.warn("Something unexpected happened with:",e);const n=e=>{const{component:n,props:s}=e;return(0,t._render)(n(s))},s=e=>{const{component:n,props:s}=e,r=(0,t.strToHash)(n.toString());n.prototype._getHash=()=>r;const o=new n(s);o.willMount();let i=o.render();return i=(0,t._render)(i),o.elements=i,s&&s.ref&&s.ref(o),"undefined"==typeof isSSR&&(0,t.tick)((()=>{o._didMount()})),i};t.renderComponent=e=>{console.warn("DEPRECATED: renderComponent() is deprecated, use _render() instead!")};const r=e=>document.createElementNS("http://www.w3.org/2000/svg",e);t.h=(e,n,...s)=>{if("string"!=typeof e)return{component:e,props:Object.assign(Object.assign({},n),{children:s})};let o;const i="svg"===e?r("svg"):document.createElement(e),a=(e,t)=>0===t.indexOf("on")&&(!!e.ssr||"object"==typeof e[t]||"function"==typeof e[t]);for(const e in n){if("style"===e&&"object"==typeof n[e]){const t=Object.keys(n[e]).map((t=>`${t}:${n[e][t]}`)).join(";").replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`));n[e]=`${t};`}"ref"===e?o=n[e]:a(i,e.toLowerCase())?i.addEventListener(e.toLowerCase().substring(2),(t=>n[e](t))):/className/i.test(e)?console.warn('You can use "class" instead of "className".'):void 0!==n[e]&&i.setAttribute(e,n[e])}return(0,t.appendChildren)(i,s),o&&o(i),i.ssr?i.ssr:i}},847:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Fragment=void 0,t.Fragment=e=>e.children},382:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.printVersion=t.escapeHtml=t.onNodeRemove=t.nodeToString=t.task=void 0;const s=n(412);function r(e,t){return!!e&&(e===t||r(e.parentNode,t))}t.task=e=>setTimeout(e,0),t.nodeToString=e=>{const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML},t.onNodeRemove=(e,t)=>{let n=new MutationObserver((s=>{s.forEach((s=>{s.removedNodes.forEach((s=>{r(e,s)&&(t(),n&&(n.disconnect(),n=void 0))}))}))}));return n.observe(document,{childList:!0,subtree:!0}),n},t.escapeHtml=e=>e&&"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):e,t.printVersion=()=>{const e=`Powered by nano JSX v${s.VERSION}`;console.log(`%c %c %c %c %c ${e} %c http://nanojsx.io`,"background: #ff0000","background: #ffff00","background: #00ff00","background: #00ffff","color: #fff; background: #000000;","background: none")}},178:function(e,t,n){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=s(n(8));t.default=r.default},989:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.build=t.evaluate=t.treeify=void 0;const s=n(760);t.treeify=(e,t)=>{const n=e=>{let s="",r=null;const o=[],i=[];for(let a=1;a<e.length;a++){const d=e[a++],l=e[a]?t[e[a++]-1]:e[++a];3===d?s=l:4===d?(o.push(l),r=null):5===d?(r||(r=Object.create(null),o.push(r)),r[e[++a]]=[l]):6===d?r[e[++a]].push(l):2===d?i.push(n(l)):0===d&&i.push(l)}return{tag:s,props:o,children:i}},{children:s}=n(e);return s.length>1?s:s[0]},t.evaluate=(e,n,s,r)=>{let o;n[0]=0;for(let i=1;i<n.length;i++){const a=n[i++],d=n[i]?(n[0]|=a?1:2,s[n[i++]]):n[++i];3===a?r[0]=d:4===a?r[1]=Object.assign(r[1]||{},d):5===a?(r[1]=r[1]||{})[n[++i]]=d:6===a?r[1][n[++i]]+=`${d}`:a?(o=e.apply(d,(0,t.evaluate)(e,d,s,["",null])),r.push(o),d[0]?n[0]|=2:(n[i-2]=0,n[i]=o)):r.push(d)}return r},t.build=function(e,...t){const n=[e,...t],r=this;let o,i,a=1,d="",l="",c=[0];const u=e=>{1===a&&(e||(d=d.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.MINI?c.push(e?n[e]:d):c.push(0,e,d):3===a&&(e||d)?(s.MINI?c[1]=e?n[e]:d:c.push(3,e,d),a=2):2===a&&"..."===d&&e?s.MINI?c[2]=Object.assign(c[2]||{},n[e]):c.push(4,e,0):2===a&&d&&!e?s.MINI?(c[2]=c[2]||{})[d]=!0:c.push(5,0,!0,d):a>=5&&(s.MINI?5===a?((c[2]=c[2]||{})[i]=e?d?d+n[e]:n[e]:d,a=6):(e||d)&&(c[2][i]+=e?d+n[e]:d):((d||!e&&5===a)&&(c.push(a,0,d,i),a=6),e&&(c.push(a,e,0,i),a=6))),d=""};for(let t=0;t<e.length;t++){t&&(1===a&&u(),u(t));for(let n=0;n<e[t].length;n++)o=e[t][n],1===a?"<"===o?(u(),c=s.MINI?[c,"",null]:[c],a=3):d+=o:4===a?"--"===d&&">"===o?(a=1,d=""):d=o+d[0]:l?o===l?l="":d+=o:'"'===o||"'"===o?l=o:">"===o?(u(),a=1):a&&("="===o?(a=5,i=d,d=""):"/"===o&&(a<5||">"===e[t][n+1])?(u(),3===a&&(c=c[0]),a=c,s.MINI?(c=c[0]).push(r(...a.slice(1))):(c=c[0]).push(2,0,a),a=0):" "===o||"\t"===o||"\n"===o||"\r"===o?(u(),a=2):d+=o),3===a&&"!--"===d&&(a=4,c=c[0])}return u(),s.MINI?c.length>2?c.slice(1):c[1]:c}},760:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MINI=void 0,t.MINI=!1},8:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const s=n(760),r=n(989),o=new Map;t.default=s.MINI?r.build:function(e){let t=o.get(this);return t||(t=new Map,o.set(this,t)),t=(0,r.evaluate)(this,t.get(e)||(t.set(e,t=(0,r.build)(e)),t),arguments,[]),t.length>1?t:t[0]}},417:function(e,t,n){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.jsx=void 0;const r=n(776),o=s(n(178)).default.bind(r.h);t.jsx=o},367:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._clearState=t._state=void 0,t._state=new Map,t._clearState=()=>{t._state.clear()}},923:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Store=void 0,t.Store=class{constructor(e,t="",n="memory"){if(this._listeners=new Map,"undefined"!=typeof isSSR&&(n="memory"),this._id=t,this._storage=n,this._state=this._prevState=e,"memory"===n||!n)return;const s="local"===n?localStorage:sessionStorage,r=s.getItem(this._id);r?this._state=this._prevState=JSON.parse(r):s.setItem(this._id,JSON.stringify(e))}persist(e){"memory"!==this._storage&&("local"===this._storage?localStorage:sessionStorage).setItem(this._id,JSON.stringify(e))}clear(){this._state=this._prevState=void 0,"local"===this._storage?localStorage.removeItem(this._id):"session"===this._storage&&sessionStorage.removeItem(this._id)}setState(e){this.state=e}set state(e){this._prevState=this._state,this._state=e,this.persist(e),this._listeners.forEach((e=>{e(this._state,this._prevState)}))}get state(){return this._state}use(){const e=Math.random().toString(36).substr(2,9),t=this;return{get state(){return t.state},setState:e=>{this.state=e},subscribe:t=>{this._listeners.set(e,t)},cancel:()=>{this._listeners.delete(e)}}}}},412:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="0.0.21"}},t={};function n(s){var r=t[s];if(void 0!==r)return r.exports;var o=t[s]={exports:{}};return e[s].call(o.exports,o,o.exports,n),o.exports}var s={};(()=>{var e=s;const t=n(776),r=n(382),o=n(999),i=n(847),a=n(923),d=n(523),l=n(417);e.default={createContext:d.createContext,h:t.h,jsx:l.jsx,render:t.render,tick:t.tick,task:r.task,Component:o.Component,Fragment:i.Fragment,Store:a.Store};n(382),n(412)})(),nanoJSX=s.default})();