cradova 3.5.1 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
class U{static compId=0;afterMount=[];beforeMountActive=[];afterDeactivate=[];dispatchEvent(H){const L=this[H];if(H.includes("Active")){for(let T=0;T<L.length;T++)L[T]();return}while(L.length!==0)L.shift()()}}var J=new U;class G{id;component;effects=[];effectuate=null;rendered=!1;published=!1;preRendered=null;reference=null;subData=null;_state=[];_state_index=0;constructor(H){this.component=H.bind(this),U.compId+=1,this.id=U.compId}preRender(){this.preRendered=this.render()}render(){if(this.effects=[],this.rendered=!1,!this.preRendered){this._state_index=0,this._state=[];const H=this.component();if(H instanceof HTMLElement)this.reference=H,this.effector.apply(this),this.rendered=!0,this.published=!0;else console.error(" \u2718 Cradova err : Invalid html content, got - "+H);return H}else return this.preRendered}_effect(H){if(!this.rendered)this.effects.push(H.bind(this))}async effector(){for(let H=0;H<this.effects.length;H++){const L=await this.effects[H].apply(this);if(typeof L==="function")J.afterDeactivate.push(L)}if(this.effects=[],this.effectuate)this.effectuate(),this.effectuate=null}recall(){if(!this.rendered)this.effectuate=()=>{if(this.published)this.activate()};else if(this.published)setTimeout(()=>{this.activate()})}async activate(){if(this.published=!1,!this.rendered)return;this._state_index=0;const H=this.reference;if(document.contains(H)){const L=this.component();if(L instanceof HTMLElement)H.insertAdjacentElement("beforebegin",L),H.remove(),this.published=!0,this.reference=L,J.dispatchEvent("afterMount");else console.error(" \u2718 Cradova err : Invalid html, got - "+L)}else this.reference=null,this.rendered=!1}}class Z{pn;subs;pipe;constructor(H,L){if(this.pipe=H,this.subs={},L&&L.persistName){this.pn=L.persistName;const T=localStorage.getItem(L.persistName);if(T&&T!=="undefined")this.pipe=JSON.parse(T);if(typeof H==="object"){for(let M in H)if(!Object.prototype.hasOwnProperty.call(this.pipe,M))this.pipe[M]=H[M]}}}publish(H,L){this.pipe[H]=L;const T=this.subs[H]||[];for(let M=0;M<T.length;M++){const E=T[M];E.subData=L,E.recall()}if(this.pn)localStorage.setItem(this.pn,JSON.stringify(this.pipe))}subscribe(H,L){if(L instanceof G){if(this.subs[H]?.find((T)=>T.id===L.id))return;if(!this.subs[H])this.subs[H]=[L];else this.subs[H].push(L);if(this.pipe[H])L.subData=this.pipe[H]}}clearPersist(){if(this.pn)localStorage.removeItem(this.pn)}}class q{_name;_html;_template=document.createElement("div");_dropped=!1;_snapshot;_snapshot_html;_deCB;constructor(H){const{template:L,name:T}=H;this._html=L,this._name=T||"Document",this._template.setAttribute("id","page"),this._snapshot=H.snapshotIsolation||!1}async _takeSnapShot(){if(A.doc.dataset.snapshot==="true")return;try{const H=await fetch(location.href);if(!H.ok)throw new Error("Failed to fetch the page");const L=await H.text(),M=new DOMParser().parseFromString(L,"text/html");M.title=this._name;const E=M.querySelector('[data-wrapper="app"]');if(E)E.setAttribute("data-snapshot","true"),E.innerHTML=this._snapshot_html;else{console.error("Wrapper or template is not found");return}const I=M.documentElement.outerHTML;await fetch(`${location.origin}`,{body:I,method:"POST",headers:{"Content-Type":"text/html","cradova-snapshot":location.href}})}catch(H){console.error("Snapshot error:",H)}this._snapshot_html=void 0}set onDeactivate(H){this._deCB=H}drop(H){if(typeof H==="boolean"){this._dropped=H;return}else return this._dropped}async _activate(){if(this._dropped){history.go(-1);return}let H=this._html.apply(this);if(H instanceof HTMLElement)this._template.innerHTML="",this._template.appendChild(H);else throw new Error(` \u2718 Cradova err: template function for the page returned ${H} instead of html`);if(document.title=this._name,A.doc.innerHTML="",J.dispatchEvent("beforeMountActive"),this._snapshot)this._snapshot_html=this._template.outerHTML;if(A.doc.appendChild(this._template),J.dispatchEvent("afterMount"),window.scrollTo({top:0,left:0,behavior:"instant"}),J.dispatchEvent("afterDeactivate"),this._snapshot)this._takeSnapShot()}}class Q{doc=null;lastNavigatedRouteController;nextRouteController;lastNavigatedRoute;pageShow=null;pageHide=null;errorHandler;loadingPage=null;pageData={params:{}};routes={};paused=!1;route(H,L){if(!L)console.error(" \u2718 Cradova err: not a valid page ",L);return this.routes[H]=L}async router(H,L){const T=window.location.href;let M,E;if(this.paused){window.location.hash="paused";return}if(this.nextRouteController)M=this.nextRouteController,this.nextRouteController=void 0;else[M,E]=this.checker(T);if(typeof M!=="undefined")try{if(typeof M==="function"){if(this.loadingPage instanceof q)await this.loadingPage._activate();if(M=await M(),!M){if(this.lastNavigatedRoute)history.pushState({},T,this.lastNavigatedRoute);return}}if(E)this.pageData.params=E;await M._activate(),this.lastNavigatedRouteController&&this.lastNavigatedRouteController._deCB?.(),this.lastNavigatedRoute=T,this.lastNavigatedRouteController=M}catch(I){if(typeof this.errorHandler==="function")this.errorHandler(I,T);else console.error(I)}else if(this.routes["*"])await this.routes["*"]._activate()}checker(H){if(H[0]!=="/")H=H.slice(H.indexOf("/",8));if(this.routes[H])return[this.routes[H],{path:H}];if(H.includes("?")){let L;const T={};if([H,L]=H.split("?"),new URLSearchParams(L).forEach((M,E)=>{T[E]=M}),this.routes[H])return[this.routes[H],T]}for(let L in this.routes){if(L.includes(":")){const T=H.split("/"),M=L.split("/");if(H.endsWith("/"))T.pop();let E=0,I=0;if(M.length===T.length){for(let D=0;D<M.length;D++){if(M[D].includes(":")){I++;continue}if(T[D]===M[D])E++}if(E+I===M.length){const D={};for(let O=0;O<M.length;O++)if(M[O].includes(":"))D[M[O].split(":")[1]]=T[O];return[this.routes[L],D]}}}if(L.includes("*")){const T=L.slice(0,-1);if(H.startsWith(T))return[this.routes[L],{extraPath:H.slice(T.length)}]}}return[]}}var A=new Q;class Y{static BrowserRoutes(H){for(let L in H){const T=H[L];if(typeof T==="object"&&typeof T.then==="function"||typeof T==="function")A.routes[L]=async()=>{const M=typeof T==="function"?await T():await T;return A.route(L,M)};else A.route(L,T)}Y._mount()}static pauseNavigation(){A.paused=!0,window.location.hash="paused"}static resumeNavigation(){A.paused=!1,window.location.replace(window.location.pathname+window.location.search),history.go(-1)}static navigate(H,L){if(typeof H!=="string")console.error(" \u2718 Cradova err: href must be a defined path but got "+H+" instead");let T=null,M;if(H.includes("."))window.location.href=H;else{if([T,M]=A.checker(H),T)A.nextRouteController=T,window.history.pushState({},"",H);A.pageData.params=M,A.pageData.data=L,A.router(null)}}static setLoadingPage(H){if(H instanceof q)A.loadingPage=H;else throw new Error(" \u2718 Cradova err: Loading Page should be a cradova page class")}static get PageData(){return A.pageData}static addErrorHandler(H){if(typeof H==="function")A.errorHandler=H;else throw new Error(" \u2718 Cradova err: callback for error event is not a function")}static _mount(){let H=document.querySelector("[data-wrapper=app]");if(H)A.doc=H;else throw new Error(`\u2718 Cradova err: please add '<div data-wrapper="app"></div>' to the body of your index.html file `);window.addEventListener("pageshow",()=>A.router()),window.addEventListener("popstate",(L)=>{L.preventDefault(),A.router()})}}function S(H){const L=new DocumentFragment;for(let T of H)if(Array.isArray(T))L.appendChild(S(T));else{if(T instanceof G)T=T.render();if(typeof T==="function"){if(T=T(),typeof T==="function")T=T()}if(T instanceof HTMLElement||T instanceof DocumentFragment){L.appendChild(T);continue}if(typeof T==="string")L.appendChild(document.createTextNode(T))}return L}function x(H,...L){if(H)return L}function j(H,L,T){if(H)return L;return T}function y(H,...L){return(T)=>{if(T===H)return L;return}}function g(H,...L){let T;if(L.length){for(let M=0;M<L.length;M++)if(T=L[M](H),T)break}return T}function b(H,L){return Array.isArray(H)?H.map(L):void 0}function w(H,L){L._state_index+=1;const T=L._state_index;if(T>=L._state.length)L._state[T]=H;function M(E){if(typeof E==="function")E=E(L._state[T]);L._state[T]=E,L.recall()}return[L._state[T],M]}function _(H,L){L._effect(H)}function P(){return new z}class z{tree={};bindAs(H){return[this,H]}elem(H){const L=this.tree[H];if(document.contains(L))return L;this.tree[H]=void 0}swap(H,L){[this.tree[H],this.tree[L]]=[this.tree[L],this.tree[H]]}_append(H,L){this.tree[H]=L}}var K=(H,L)=>{const T={};let M=void 0;if(L.length!==0)for(let E=0;E<L.length;E++){let I=L[E];if(typeof I==="function")I=I();if(I instanceof G)I=I.render();if(I instanceof HTMLElement||I instanceof DocumentFragment){H.appendChild(I);continue}if(Array.isArray(I)){H.appendChild(S(I));continue}if(typeof I==="string"){M=I;continue}if(typeof I==="object"){Object.assign(T,I);continue}}else return H;if(typeof T==="object"&&H)for(let[E,I]of Object.entries(T)){if(E==="style"&&typeof I==="object"){Object.assign(H.style,I);continue}if(E==="href"){const D=I||"";if(!D.includes("://"))H.addEventListener("click",(O)=>{if(O.preventDefault(),Y.navigate(H.href),D.includes("#")){const W=D.split("#").at(-1);document.getElementById("#"+W)?.scrollIntoView()}});H.setAttribute(E,I);continue}if(E==="onmount"){J.afterMount.push(()=>{typeof T.onmount==="function"&&T.onmount.apply(H)});continue}if(E.includes("data-")||E.includes("aria-")){H.setAttribute(E,I);continue}if(Array.isArray(I)){if(E=="ref"&&I[0]instanceof z){I[0]._append(I[1],H);continue}}H[E]=I}if(M!==void 0)H.appendChild(document.createTextNode(M));return H},V=(H)=>{return(...L)=>K(document.createElement(H),L)},F=function(H){const L=document.createDocumentFragment();for(let T=0;T<H.length;T++){let M=H[T];if(typeof M==="function")M=M();if(M instanceof HTMLElement||M instanceof DocumentFragment){L.appendChild(M);continue}if(M instanceof String){L.appendChild(document.createTextNode(M));continue}console.error(" \u2718 Cradova err: wrong element type"+M)}return L};var N=V("a"),B=V("audio"),c=V("button"),f=V("canvas"),R=V("div"),s=V("footer"),C=V("form"),o=V("h1"),v=V("h2"),d=V("h3"),i=V("h4"),h=V("h5"),p=V("h6"),u=V("header"),m=V("i"),t=V("iframe"),l=V("img"),r=V("input"),a=V("label"),e=V("li"),HH=V("main"),LH=V("nav"),TH=V("ol"),MH=V("optgroup"),EH=V("option"),IH=V("p"),VH=V("section"),AH=V("select"),DH=V("source"),OH=V("span"),JH=V("textarea"),GH=V("ul"),UH=V("video"),YH=(H,L)=>{const T=document.createElement("span");return T.innerHTML=H,K(T,L||[])},qH=(H)=>{const L=document.createElement("div");if(Array.isArray(H))L.innerHTML=H[0];else if(typeof H==="string")L.innerHTML=H;const T=new DocumentFragment;return T.append(...Array.from(L.children)),T};export{UH as video,w as useState,P as useRef,_ as useEffect,GH as ul,JH as textarea,YH as svg,OH as span,DH as source,AH as select,VH as section,qH as raw,IH as p,EH as option,MH as optgroup,TH as ol,LH as nav,K as makeElement,HH as main,b as loop,e as li,a as label,r as input,l as img,t as iframe,m as i,u as header,p as h6,h as h5,i as h4,d as h3,v as h2,o as h1,F as frag,C as form,s as footer,R as div,V as cra,f as canvas,c as button,B as audio,N as a,Z as Signal,Y as Router,S as Rhoda,q as Page,J as CradovaEvent,G as Comp,g as $switch,j as $ifelse,x as $if,y as $case};
|
|
1
|
+
class U{static compId=0;afterMount=[];beforeMountActive=[];afterDeactivate=[];dispatchEvent(H){const L=this[H];if(H.includes("Active")){for(let T=0;T<L.length;T++)L[T]();return}while(L.length!==0)L.shift()()}}var J=new U;class G{id;component;effects=[];effectuate=null;rendered=!1;published=!1;preRendered=null;reference=null;subData=null;_state=[];_state_index=0;constructor(H){this.component=H.bind(this),U.compId+=1,this.id=U.compId}preRender(){this.preRendered=this.render()}render(){if(this.effects=[],this.rendered=!1,!this.preRendered){this._state_index=0,this._state=[];const H=this.component();if(H instanceof HTMLElement)this.reference=H,this.effector.apply(this),this.rendered=!0,this.published=!0;else console.error(" \u2718 Cradova err : Invalid html content, got - "+H);return H}else return this.preRendered}_effect(H){if(!this.rendered)this.effects.push(H.bind(this))}async effector(){for(let H=0;H<this.effects.length;H++){const L=await this.effects[H].apply(this);if(typeof L==="function")J.afterDeactivate.push(L)}if(this.effects=[],this.effectuate)this.effectuate(),this.effectuate=null}recall(){if(!this.rendered)this.effectuate=()=>{if(this.published)this.activate()};else if(this.published)setTimeout(()=>{this.activate()})}async activate(){if(this.published=!1,!this.rendered)return;this._state_index=0;const H=this.reference;if(document.contains(H)){const L=this.component();if(L instanceof HTMLElement)H.insertAdjacentElement("beforebegin",L),H.remove(),this.published=!0,this.reference=L,J.dispatchEvent("afterMount");else console.error(" \u2718 Cradova err : Invalid html, got - "+L)}else this.reference=null,this.rendered=!1}}class Z{pn;subs;pipe;constructor(H,L){if(this.pipe=H,this.subs={},L&&L.persistName){this.pn=L.persistName;const T=localStorage.getItem(L.persistName);if(T&&T!=="undefined")this.pipe=JSON.parse(T);if(typeof H==="object"){for(let M in H)if(!Object.prototype.hasOwnProperty.call(this.pipe,M))this.pipe[M]=H[M]}}}publish(H,L){this.pipe[H]=L;const T=this.subs[H]||[];for(let M=0;M<T.length;M++){const E=T[M];E.subData=L,E.recall()}if(this.pn)localStorage.setItem(this.pn,JSON.stringify(this.pipe))}subscribe(H,L){if(L instanceof G){if(this.subs[H]?.find((T)=>T.id===L.id))return;if(!this.subs[H])this.subs[H]=[L];else this.subs[H].push(L);if(this.pipe[H])L.subData=this.pipe[H]}}clearPersist(){if(this.pn)localStorage.removeItem(this.pn)}}class q{_name;_html;_template=document.createElement("div");_dropped=!1;_snapshot;_snapshot_html;_deCB;constructor(H){const{template:L,name:T}=H;this._html=L,this._name=T||document.title,this._template.setAttribute("id","page"),this._snapshot=H.snapshotIsolation||!1}async _takeSnapShot(){if(A.doc.dataset.snapshot==="true")return;try{const H=await fetch(location.href);if(!H.ok)throw new Error("Failed to fetch the page");const L=await H.text(),M=new DOMParser().parseFromString(L,"text/html");M.title=this._name;const E=M.querySelector('[data-wrapper="app"]');if(E)E.setAttribute("data-snapshot","true"),E.innerHTML=this._snapshot_html;else{console.error("Wrapper or template is not found");return}const I=M.documentElement.outerHTML;await fetch(`${location.origin}`,{body:I,method:"POST",headers:{"Content-Type":"text/html","cradova-snapshot":location.href.slice(location.origin.length)}})}catch(H){console.error("Snapshot error:",H)}this._snapshot_html=void 0}set onDeactivate(H){this._deCB=H}drop(H){if(typeof H==="boolean"){this._dropped=H;return}else return this._dropped}async _activate(){if(this._dropped){history.go(-1);return}let H=this._html.apply(this);if(H instanceof HTMLElement)this._template.innerHTML="",this._template.appendChild(H);else throw new Error(` \u2718 Cradova err: template function for the page returned ${H} instead of html`);if(document.title=this._name,A.doc.innerHTML="",J.dispatchEvent("beforeMountActive"),this._snapshot)this._snapshot_html=this._template.outerHTML;if(A.doc.appendChild(this._template),J.dispatchEvent("afterMount"),window.scrollTo({top:0,left:0,behavior:"instant"}),J.dispatchEvent("afterDeactivate"),this._snapshot)this._takeSnapShot()}}class Q{doc=null;lastNavigatedRouteController;nextRouteController;lastNavigatedRoute;pageShow=null;pageHide=null;errorHandler;loadingPage=null;pageData={params:{}};routes={};paused=!1;route(H,L){if(!L)console.error(" \u2718 Cradova err: not a valid page ",L);return this.routes[H]=L}async router(H,L){const T=window.location.href;let M,E;if(this.paused){window.location.hash="paused";return}if(this.nextRouteController)M=this.nextRouteController,this.nextRouteController=void 0;else[M,E]=this.checker(T);if(typeof M!=="undefined")try{if(typeof M==="function"){if(this.loadingPage instanceof q)await this.loadingPage._activate();if(M=await M(),!M){if(this.lastNavigatedRoute)history.pushState({},T,this.lastNavigatedRoute);return}}if(E)this.pageData.params=E;await M._activate(),this.lastNavigatedRouteController&&this.lastNavigatedRouteController._deCB?.(),this.lastNavigatedRoute=T,this.lastNavigatedRouteController=M}catch(I){if(typeof this.errorHandler==="function")this.errorHandler(I,T);else console.error(I)}else if(this.routes["*"])await this.routes["*"]._activate()}checker(H){if(H[0]!=="/")H=H.slice(H.indexOf("/",8));if(this.routes[H])return[this.routes[H],{path:H}];if(H.includes("?")){let L;const T={};if([H,L]=H.split("?"),new URLSearchParams(L).forEach((M,E)=>{T[E]=M}),this.routes[H])return[this.routes[H],T]}for(let L in this.routes){if(L.includes(":")){const T=H.split("/"),M=L.split("/");if(H.endsWith("/"))T.pop();let E=0,I=0;if(M.length===T.length){for(let D=0;D<M.length;D++){if(M[D].includes(":")){I++;continue}if(T[D]===M[D])E++}if(E+I===M.length){const D={};for(let O=0;O<M.length;O++)if(M[O].includes(":"))D[M[O].split(":")[1]]=T[O];return[this.routes[L],D]}}}if(L.includes("*")){const T=L.slice(0,-1);if(H.startsWith(T))return[this.routes[L],{extraPath:H.slice(T.length)}]}}return[]}}var A=new Q;class Y{static BrowserRoutes(H){for(let L in H){const T=H[L];if(typeof T==="object"&&typeof T.then==="function"||typeof T==="function")A.routes[L]=async()=>{const M=typeof T==="function"?await T():await T;return A.route(L,M)};else A.route(L,T)}Y._mount()}static pauseNavigation(){A.paused=!0,window.location.hash="paused"}static resumeNavigation(){A.paused=!1,window.location.replace(window.location.pathname+window.location.search),history.go(-1)}static navigate(H,L){if(typeof H!=="string")console.error(" \u2718 Cradova err: href must be a defined path but got "+H+" instead");let T=null,M;if(H.includes("."))window.location.href=H;else{if([T,M]=A.checker(H),T)A.nextRouteController=T,window.history.pushState({},"",H);A.pageData.params=M,A.pageData.data=L,A.router(null)}}static setLoadingPage(H){if(H instanceof q)A.loadingPage=H;else throw new Error(" \u2718 Cradova err: Loading Page should be a cradova page class")}static get PageData(){return A.pageData}static addErrorHandler(H){if(typeof H==="function")A.errorHandler=H;else throw new Error(" \u2718 Cradova err: callback for error event is not a function")}static _mount(){let H=document.querySelector("[data-wrapper=app]");if(H)A.doc=H;else throw new Error(`\u2718 Cradova err: please add '<div data-wrapper="app"></div>' to the body of your index.html file `);window.addEventListener("pageshow",()=>A.router()),window.addEventListener("popstate",(L)=>{L.preventDefault(),A.router()})}}function S(H){const L=new DocumentFragment;for(let T of H)if(Array.isArray(T))L.appendChild(S(T));else{if(T instanceof G)T=T.render();if(typeof T==="function"){if(T=T(),typeof T==="function")T=T()}if(T instanceof HTMLElement||T instanceof DocumentFragment){L.appendChild(T);continue}if(typeof T==="string")L.appendChild(document.createTextNode(T))}return L}function x(H,...L){if(H)return L}function j(H,L,T){if(H)return L;return T}function y(H,...L){return(T)=>{if(T===H)return L;return}}function g(H,...L){let T;if(L.length){for(let M=0;M<L.length;M++)if(T=L[M](H),T)break}return T}function b(H,L){return Array.isArray(H)?H.map(L):void 0}function w(H,L){L._state_index+=1;const T=L._state_index;if(T>=L._state.length)L._state[T]=H;function M(E){if(typeof E==="function")E=E(L._state[T]);L._state[T]=E,L.recall()}return[L._state[T],M]}function _(H,L){L._effect(H)}function P(){return new z}class z{tree={};bindAs(H){return[this,H]}elem(H){const L=this.tree[H];if(document.contains(L))return L;this.tree[H]=void 0}swap(H,L){[this.tree[H],this.tree[L]]=[this.tree[L],this.tree[H]]}_append(H,L){this.tree[H]=L}}var K=(H,L)=>{const T={};let M=void 0;if(L.length!==0)for(let E=0;E<L.length;E++){let I=L[E];if(typeof I==="function")I=I();if(I instanceof G)I=I.render();if(I instanceof HTMLElement||I instanceof DocumentFragment){H.appendChild(I);continue}if(Array.isArray(I)){H.appendChild(S(I));continue}if(typeof I==="string"){M=I;continue}if(typeof I==="object"){Object.assign(T,I);continue}}else return H;if(typeof T==="object"&&H)for(let[E,I]of Object.entries(T)){if(E==="style"&&typeof I==="object"){Object.assign(H.style,I);continue}if(E==="href"){const D=I||"";if(!D.includes("://"))H.addEventListener("click",(O)=>{if(O.preventDefault(),Y.navigate(H.href),D.includes("#")){const W=D.split("#").at(-1);document.getElementById("#"+W)?.scrollIntoView()}});H.setAttribute(E,I);continue}if(E==="onmount"){J.afterMount.push(()=>{typeof T.onmount==="function"&&T.onmount.apply(H)});continue}if(E.includes("data-")||E.includes("aria-")){H.setAttribute(E,I);continue}if(Array.isArray(I)){if(E=="ref"&&I[0]instanceof z){I[0]._append(I[1],H);continue}}H[E]=I}if(M!==void 0)H.appendChild(document.createTextNode(M));return H},V=(H)=>{return(...L)=>K(document.createElement(H),L)},F=function(H){const L=document.createDocumentFragment();for(let T=0;T<H.length;T++){let M=H[T];if(typeof M==="function")M=M();if(M instanceof HTMLElement||M instanceof DocumentFragment){L.appendChild(M);continue}if(M instanceof String){L.appendChild(document.createTextNode(M));continue}console.error(" \u2718 Cradova err: wrong element type"+M)}return L};var N=V("a"),B=V("audio"),c=V("button"),f=V("canvas"),R=V("div"),s=V("footer"),C=V("form"),o=V("h1"),v=V("h2"),d=V("h3"),i=V("h4"),h=V("h5"),p=V("h6"),u=V("header"),m=V("i"),t=V("iframe"),l=V("img"),r=V("input"),a=V("label"),e=V("li"),HH=V("main"),LH=V("nav"),TH=V("ol"),MH=V("optgroup"),EH=V("option"),IH=V("p"),VH=V("section"),AH=V("select"),DH=V("source"),OH=V("span"),JH=V("textarea"),GH=V("ul"),UH=V("video"),YH=(H,L)=>{const T=document.createElement("span");return T.innerHTML=H,K(T,L||[])},qH=(H)=>{const L=document.createElement("div");if(Array.isArray(H))L.innerHTML=H[0];else if(typeof H==="string")L.innerHTML=H;const T=new DocumentFragment;return T.append(...Array.from(L.children)),T};export{UH as video,w as useState,P as useRef,_ as useEffect,GH as ul,JH as textarea,YH as svg,OH as span,DH as source,AH as select,VH as section,qH as raw,IH as p,EH as option,MH as optgroup,TH as ol,LH as nav,K as makeElement,HH as main,b as loop,e as li,a as label,r as input,l as img,t as iframe,m as i,u as header,p as h6,h as h5,i as h4,d as h3,v as h2,o as h1,F as frag,C as form,s as footer,R as div,V as cra,f as canvas,c as button,B as audio,N as a,Z as Signal,Y as Router,S as Rhoda,q as Page,J as CradovaEvent,G as Comp,g as $switch,j as $ifelse,x as $if,y as $case};
|