@reactive-web-components/rwc 2.58.1 → 2.60.0

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.
@@ -0,0 +1,2 @@
1
+ (function(r,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(r=typeof globalThis<"u"?globalThis:r||self,S(r.ReactiveComponent={}))})(this,function(r){"use strict";var Qe=Object.defineProperty;var Ye=(r,S,j)=>S in r?Qe(r,S,{enumerable:!0,configurable:!0,writable:!0,value:j}):r[S]=j;var h=(r,S,j)=>Ye(r,typeof S!="symbol"?S+"":S,j);const S=n=>n&&typeof n=="object"&&("classList"in n||"attributes"in n||"customAttributes"in n||"reactiveClassList"in n||"listeners"in n||"customListeners"in n||"children"in n||"effects"in n||"style"in n||Object.keys(n).some(t=>t.startsWith(".")||t.startsWith("@")||t.startsWith("$")))&&!("hostElement"in n),j=n=>n&&typeof n=="object"&&"hostElement"in n&&"append"in n&&"set"in n&&"addStyle"in n&&"setAttribute"in n&&"addClass"in n&&"addEffect"in n&&"addReactiveContent"in n&&"setReactiveContent"in n&&"clear"in n,P=(n,t,...e)=>{t&&t.apply(n,e)};let _=!0;const p=(...n)=>{_&&console.debug(["[rwc]",...n].join(" | "),...Array.from(n.join("").matchAll(/%c/gm)).map((t,e)=>e%2===0?"color:red":"color:inherit"))},k=n=>n.replace(/([A-Z])/gm,t=>`-${t.toLowerCase()}`),U=n=>n.replace(/-(\w)/gm,(t,e)=>e.toUpperCase()),$=(n,...t)=>{if(!_)return;const e={r:"color: #ff0000",g:"color: #00ff00",b:"color: #0000ff",y:"color: #ffff00",p:"color: #800080",c:"color: #00ffff",o:"color: #ffa500",w:"color: #808080"},s=n.match(/@[rgbpycow]/g)||[],o=s.map(c=>{const l=c.slice(1);return e[l]||"color: inherit"});let i=n;s.forEach(c=>{const l=new RegExp(`\\${c}([^\\s,]+)`,"g");i=i.replace(l,"%c$1")}),console.log(i,...o,...t)},bt=()=>{_=!0},X=()=>{_=!1};X();const St=(n,t)=>{n.every(Boolean)&&t(n)},A=[],F=n=>{var t,e,s,o;(t=n.children)==null||t.forEach(i=>{var c;return(c=i.destroy)==null?void 0:c.call(i)}),(e=n.children)==null||e.clear(),(s=n.cleanupSet)==null||s.forEach(i=>i()),(o=n.cleanupSet)==null||o.clear()};function R(n,t){let e=(t==null?void 0:t.signalCompareFn)||(()=>!0);const s=new Set;function o(){var c;const i=A[A.length-1];return i&&!i.fake&&!s.has(i)&&i.status==="active"&&(s.add(i),(c=i.cleanupSet)==null||c.add(()=>s.delete(i))),!(t!=null&&t.name)&&(i!=null&&i.effectId)&&o.setName(i.effectId),n}return o.signalId=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`,o.setName=function(i){return o.signalId=`${i}_${Math.random().toString(36).substring(2,15)}`,o},o.setCompareFn=function(i){return e=i,o},o.clearSubscribers=function(){s.clear()},o.getSubscribers=function(){return s},o.peek=function(){return Object.freeze(n)},o.initValue=Object.freeze(n),o.forceSet=function(i){n=i,s.forEach(c=>{F(c),Promise.resolve().then(()=>{A.push(c),c(),A.pop()})})},o.set=function(i,c=e){n!==i&&c(n,i)&&o.forceSet(i)},o.update=function(i){o.set(i(n))},o.pipe=(i,c)=>{c!=null&&c.name&&o.setName(c.name);const l=R(null);return b(()=>{const u=o();b(()=>{const d=i(u);d instanceof Promise?d.then(v=>l.set(v)):w(d)?b(()=>l.set(d()),{name:"pipe_effect_inner"}):l.set(d)},{name:"pipe_effect"})},{name:(c==null?void 0:c.name)||`pipe_${o.signalId}`}),l},o}function b(n,t){var i;const e=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`;p("current effect",`%c${e}%c`);const s=n;s.status="active",s.children=new Set,s.effectId=e;const o=A[A.length-1];o&&((i=o.children)==null||i.add(s),s.parent=new WeakRef(o),s.destroy=()=>{var c;F(s),(c=o.children)==null||c.delete(s),s.destroy=void 0,s.status="inactive"}),s.cleanupSet=new Set,A.push(s),s(),A.pop()}const w=n=>!!n&&["object","function"].includes(typeof n)&&"set"in n&&"update"in n&&"forceSet"in n&&"signalId"in n;function yt(n,...t){const e=R("");return b(()=>{const s=t.map(i=>w(i)?String(i()):String(i)),o=[n[0]];s.forEach((i,c)=>{o.push(i,n[c+1])}),e.set(o.join(""))}),e}function vt(n,t){const e=R(t??null),s=o=>e.set(o);return n instanceof Promise?n.then(s):typeof n=="function"&&b(()=>{const o=n();o instanceof Promise?o.then(s):w(o)?b(()=>s(o())):s(o)}),e}function wt(n,t){let e=n(),s=t();b(()=>{const o=n(),i=t();o!==i&&(o!==e?t.set(o):i!==s&&n.set(i)),e=o,s=i})}function At(...n){let t=n.map(s=>s());const e=R(t);return n.forEach((s,o)=>{b(()=>{const i=()=>t.filter(c=>c!==void 0).length;i()===n.length&&(t=Array.from(t).fill(void 0)),t[o]=s(),i()===n.length&&e.set([...t])})}),e}const Rt=(...n)=>{const t=R([]);return b(()=>{t.set(n.map(e=>e()))}),t},B="eventProps",V="EVENT_CONFIG",W="observedAttributes",Lt=()=>(n,t)=>{Reflect.get(n,W)||Reflect.defineProperty(n,W,{value:[]}),Reflect.get(n,W).push(k(t))},gt=n=>(t,e)=>{Reflect.get(t,B)||Reflect.defineProperty(t,B,{value:[]}),Reflect.get(t,V)||Reflect.defineProperty(t,V,{value:{}}),Reflect.get(t,V)[e]={bubbles:(n==null?void 0:n.bubbles)??!1,composed:(n==null?void 0:n.composed)??!1},Reflect.get(t,B).push(e)},N=(n,t=!1)=>e=>{p(n,"start register static attr",e.prototype[W]);const s=[];if(e.styles){const i=e.styles,c=[];Array.isArray(i)?c.push(...i):c.push(i),c.forEach(l=>{const u=new CSSStyleSheet;u.replaceSync(l),s.push(u);const y=new CSSStyleSheet;y.replaceSync(l.slice(l.indexOf("@property"))),document.adoptedStyleSheets.push(y)})}class o extends e{constructor(...c){p("constructor",`%c${n}%c`),super(t,...c),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){return p("rwc: render from new class"),e.prototype.render.call(this)}attributeChangedCallback(c,l,u){p("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${l}, newValue: ${u}`,`%c${n}%c`);try{u=JSON.parse(u)}catch{}const y=U(c);if(y in this&&w(this[y])){const d=this[y];d.setName(c),u===null?(d.set(d.initValue),this.removeAttribute(c)):d.set(u)}P(this,e.prototype.attributeChangedCallback,c,l,u)}connectedCallback(){const c=()=>{var u,y;p("rwc: connectedCallback"),p("connectedCallback",`%c${n}%c`,this),(u=this.init)==null||u.call(this),this.providers&&Object.keys(this.providers).length>0&&(p("WRAPPER for providers",n),Object.entries(this.providers).forEach(([d,m])=>{p("register provider",d,m()),this.addEventListener(d,v=>{var f;p("send provider",d,m());const C=v;((f=C.detail)==null?void 0:f.context)===d&&(C.stopPropagation(),C.detail.callback(m))})})),this.checkInjects(),(y=e.prototype[B])==null||y.forEach(d=>{this[d]=m=>{const v=e.prototype[V][d],{bubbles:C,composed:f}=v;w(m)?b(()=>{$("@oemit reactive value",m()),this.dispatchEvent(new CustomEvent(d,{detail:m(),bubbles:C,composed:f}))}):($("@oemit value",m),this.dispatchEvent(new CustomEvent(d,{detail:m,bubbles:C,composed:f})))}}),p("start render",`%c${n}%c`,n);const l=()=>{p("rwc: insertRenderTemplate");const m=this.render().hostElement;m&&this.shadow.appendChild(m),P(this,e.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!e.styles){const d=C=>C instanceof Promise||Array.isArray(C)&&C.every(f=>f instanceof Promise),m=this.rootStyle,v=C=>{const f=new CSSStyleSheet;f.replaceSync(C),this.shadow.adoptedStyleSheets.push(f);const E=new CSSStyleSheet;E.replaceSync(C.slice(C.indexOf("@property"))),document.adoptedStyleSheets.push(E)};if(d(m)){const C=[];Array.isArray(m)?C.push(...m):C.push(m),Promise.all(C).then(f=>f.forEach(E=>v(E.default))).then(()=>l())}else{const C=[];Array.isArray(m)?C.push(...m):C.push(m),C.forEach(f=>v(f)),l()}}else l();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(d=>{p(this.slotContext,this.slotContext&&this.slotContext[d.name]),$("@bslot element",d,`name:${d.name};`,d.assignedElements()),d.assignedElements().forEach(m=>{const v=this.slotContext[d.name];this.slotContext&&w(v)&&($("@oslot element",d,`name:${d.name};`,d.assignedElements()),b(()=>{m.dispatchEvent(new CustomEvent("handleSlotContext",{detail:v()}))}))})})};c.fake=!0,c.component=new WeakRef(this),this.effectSet.add(new WeakRef(c)),b(c,{name:"FAKE_wrapperEffect"})}disconnectedCallback(){this.allSlotContent=[],this.slotContent={},this.htmlSlotContent={},this.effectSet.forEach(c=>{var l,u;return(u=(l=c.deref())==null?void 0:l.destroy)==null?void 0:u.call(l)}),this.effectSet.clear(),this.shadow.replaceChildren(),this.replaceChildren(),P(this,e.prototype.disconnectedCallback)}}return h(o,"observedAttributes",e.prototype[W]??[]),h(o,"renderTagName",n),o.toString=()=>n,customElements.get(n)?console.error(`название тега ${n} повторяется, компонент ${e.name} не зарегистрирован`):customElements.define(n,o),e.renderTagName=n,e};class O extends HTMLElement{constructor(e=!1){super();h(this,"init");h(this,"isSlotLazyLoading",!1);h(this,"slotTemplate");h(this,"slotContext");h(this,"rootStyle");h(this,"modelValue");h(this,"providers");h(this,"effectSet",new Set);h(this,"appendAllSlotContent");h(this,"allSlotContent",[]);h(this,"slotContent",{});h(this,"htmlSlotContent",{});h(this,"shadow");h(this,"injects",{});this.shadow=this.attachShadow({mode:e?"closed":"open"})}appendChild(e,s=!0){var o;if(this.isSlotLazyLoading&&s){if(e instanceof HTMLElement){const i=e.slot||"default";this.htmlSlotContent[i]||(this.htmlSlotContent[i]=[]),(o=this.htmlSlotContent[i])==null||o.push(e)}}else return super.appendChild(e)}appendSlotContent(){var e;(e=this.appendAllSlotContent)==null||e.call(this)}inject(e){return p("%cinject%c",e),this.injects[e]||(this.injects[e]=R(null)),this.injects[e]}checkInjects(){Object.entries(this.injects).forEach(([e,s])=>{p("%cinject%c",`%c${e}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(e,{detail:{context:e,callback:o=>b(()=>{s.set(o())},{name:e})},bubbles:!0,composed:!0}))})}setReactiveValue(e){this.modelValue=e}}h(O,"observedAttributes",[]),h(O,"renderTagName",""),h(O,"styles");const jt=n=>"render"in n&&"setReactiveValue"in n,Ot="handleSlotContext",Z="onConnected",Q=n=>typeof n=="string"?n:JSON.stringify(n),Tt=n=>{const t=document.createElement("span");return t.textContent=Q(n),t},Y=(n,t)=>(n.appendChild(Tt(t)),n),It=(n,t)=>(n.replaceChildren(),Y(n,t)),K=n=>{const t=document.createElement("span");return b(()=>{const e=n();t.textContent=Q(e)}),t};class x{constructor(t){h(this,"wrapper");h(this,"keyedEffects",new Map);h(this,"append",(...t)=>(t.forEach(e=>{var o;const s=e.hostElement;s&&((o=this.hostElement)==null||o.appendChild(s),Z in s&&setTimeout(()=>{var i;(i=s.onConnected)==null||i.call(s,e,s)}))}),this));h(this,"set",(...t)=>{var s;this.clear();const e=document.createDocumentFragment();return t.forEach(o=>{const i=o.hostElement;i&&e.appendChild(i)}),(s=this.hostElement)==null||s.appendChild(e),this});h(this,"removeChild",(...t)=>(t.forEach(e=>{var s,o;if(Array.from(((s=this.hostElement)==null?void 0:s.childNodes.values())||[]).some(i=>i===e.hostElement)){const i=e.hostElement;i&&((o=this.hostElement)==null||o.removeChild(i))}}),this));h(this,"addHtmlContent",t=>{const e=this.hostElement;return e?(Y(e,t),this):this});h(this,"setHtmlContent",t=>{const e=this.hostElement;return e?(It(e,t),this):this});h(this,"setAttribute",(t,e)=>{var i;const s=this.hostElement;if(!s)return this;let o;if(typeof e=="boolean"&&!(s instanceof O))if(e)o="";else{this.removeAttribute(t);const c=t.toLowerCase();return c in s&&(s[c]=null),this}else typeof e!="string"?o=JSON.stringify(e):o=e;if((i=this.hostElement)==null||i.setAttribute(k(t),o),!(s instanceof O)){const c=t.toLowerCase();c in s&&(s[c]=e)}return this});h(this,"setCustomAttribute",(t,e)=>{var o;let s;return typeof e!="string"?s=JSON.stringify(e):s=e,(o=this.hostElement)==null||o.setAttribute(k(t),s),this});h(this,"setReactiveAttribute",(t,e)=>(this.addEffect(s=>{s.setAttribute(t,e())},t),this));h(this,"setReactiveCustomAttribute",(t,e)=>(this.addEffect(s=>{s.setCustomAttribute(t,e())}),this));h(this,"removeAttribute",t=>{var e;return(e=this.hostElement)==null||e.removeAttribute(k(t)),this});h(this,"addStyle",t=>{const e=this.hostElement;return e?(Object.entries(t).forEach(([s,o])=>{const i=s.startsWith("--");typeof o=="function"?this.addEffect(()=>{if(i){const c=String(o()||"");e.style.setProperty(s,c)}else e.style[s]=o()}):typeof o=="string"&&(i?e.style.setProperty(s,o):e.style[s]=o)}),this):this});h(this,"onConnected",t=>this.hostElement?(Reflect.defineProperty(this.hostElement,Z,{get(){return t}}),this):this);h(this,"addClass",(...t)=>(t.forEach(e=>{var s;typeof e=="string"?(s=this.hostElement)==null||s.classList.add(...e.split(" ").flatMap(o=>o.split(`
2
+ `)).map(o=>o.trim()).filter(Boolean)):(()=>{let o=null;this.addEffect(()=>{const i=e();i.length>0&&(o?this.replaceClass(o,i):this.addClass(i),o=i)})})()}),this));h(this,"setClass",(...t)=>{var e,s,o;return(s=this.hostElement)==null||s.classList.remove(...((e=this.hostElement)==null?void 0:e.classList)||[]),(o=this.hostElement)==null||o.classList.add(...t),this});h(this,"addReactiveClass",t=>(Object.keys(t).forEach(e=>{this.addEffect(s=>{t[e]()?s.addClass(e):s.removeClass(e)})}),this));h(this,"removeClass",(...t)=>{var e;return(e=this.hostElement)==null||e.classList.remove(...t),this});h(this,"replaceClass",(t,e)=>{var s;return(s=this.hostElement)==null||s.classList.replace(t,e),this});h(this,"addEffect",(t,e)=>{var i,c;const s=this.hostElement;if(!s)return this;const o=()=>t(this,s);if(e){const l=(i=this.keyedEffects.get(e))==null?void 0:i.deref();l&&F(l)}return(c=s.effectSet)==null||c.add(new WeakRef(o)),o.component=this.wrapper,b(o,{name:(e==null?void 0:e.toString())||s.tagName}),this});h(this,"addReactiveContent",t=>{var e;return(e=this.hostElement)==null||e.appendChild(K(t)),this});h(this,"setReactiveContent",t=>{var e;return this.clear(),(e=this.hostElement)==null||e.appendChild(K(t)),this});h(this,"clear",()=>{var t;return(t=this.hostElement)==null||t.replaceChildren(),this});this.wrapper=t;const e=t.deref();e&&(e.effectSet=new Set)}get hostElement(){return this.wrapper.deref()}addEventlistener(t,e,s=!1){var o;return(o=this.hostElement)==null||o.addEventListener(t,i=>e(i,this,this.hostElement),s),this}}class kt extends x{constructor(){super(...arguments);h(this,"setReactiveValue",e=>(this.hostElement instanceof O&&this.hostElement.setReactiveValue(e),this));h(this,"setSlotTemplate",e=>{var o;const s=(o=this.hostElement)==null?void 0:o.slotTemplate;return s&&Object.entries(e).forEach(([i,c])=>{s[i]=c}),this})}}const $t=()=>()=>{},tt=n=>new kt(new WeakRef(n)),et=n=>new x(new WeakRef(n)),nt=(n,...t)=>({classList:[...n.map(e=>e.trim()).filter(Boolean),...t]}),Wt=(n,...t)=>nt(n,...t),q=(n,t)=>{if(!t||!n.deref())return;const e=Object.keys(t||{}).filter(o=>o.startsWith(".")||o.startsWith("@")||o.startsWith("$"));e.filter(o=>o.startsWith(".")).forEach(o=>{t!=null&&t.attributes||(t.attributes={}),t.attributes[o.slice(1)]=t[o]}),e.filter(o=>o.startsWith("@")).forEach(o=>{t!=null&&t.listeners||(t.listeners={});const i=o.slice(1);t.listeners[i]=t[o]}),e.filter(o=>o.startsWith("$")).forEach(o=>{t!=null&&t.effects||(t.effects=[]),t.effects.push(t[o])});const s=n.deref();if(s)return it(s,t.classList),at(s,t.style),lt(s,t.attributes),ct(s,t.reactiveClassList),rt(s,t.customAttributes),ot(s,t.children),st(s,t.effects),z(s,t.listeners),z(s,t.customListeners),s},z=(n,t)=>{t&&Object.entries(t).forEach(([e,s])=>{typeof s=="function"&&n.addEventlistener(e,s)})},st=(n,t)=>t==null?void 0:t.forEach(e=>n.addEffect(e)),ot=(n,t)=>H(new WeakRef(n),...t||[])??n,rt=(n,t)=>{const e=t;e&&Object.keys(e).forEach(s=>{w(e[s])?n.setReactiveCustomAttribute(s,e[s]):typeof e[s]=="function"?n.addEffect(()=>{n.setCustomAttribute(s,e[s]())}):n.setCustomAttribute(s,e[s])})},it=(n,t)=>n.addClass(...t||[]),ct=(n,t)=>n.addReactiveClass(t||{}),at=(n,t)=>n.addStyle(t||{}),lt=(n,t)=>{const e=t,s=(o,i)=>{i&&(w(i)?n.setReactiveAttribute(o,i):typeof i=="function"?n.addEffect(()=>{n.setAttribute(o,i())}):n.setAttribute(o,i))};e&&Object.keys(e).forEach(o=>{s(o,e[o])})},H=(n,...t)=>{const e=n.deref();if(e)return t.forEach(s=>{typeof s=="string"?s.trim().length>0&&e.addHtmlContent(s):w(s)?e.addReactiveContent(s):e.append(s)}),e},T=(n,t)=>{const e=document.createElement(n),s=et(e);return q(new WeakRef(s),t)??s},J=(n,t)=>{const[e,...s]=n.split(" ").map(i=>i.trim()),o=T(e,t);return s.length>0&&o.addClass(...s),(...i)=>H(new WeakRef(o),...i.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!w(c)?L(()=>c(o)):c))??o},L=n=>{const t=`getSignalContent_${Math.random().toString(36).substring(2,15)}`;return T("div").addStyle({display:"contents"}).addEffect(e=>{e.clear(),H(new WeakRef(e),...[n()].flat())},t)},Ht=(n,t,e)=>{const s=T("div").addStyle({display:"contents"}),o=new Map,i=new Map;let c=[];const l=new Set;let u=n.peek();const y=d=>{l.delete(d),o.delete(d),i.delete(d)};return b(()=>{var C;const d=n();c=d.map(t).map(f=>typeof f=="string"?f:f.toString());const m=Array.from(((C=s.hostElement)==null?void 0:C.children)||[]);p("containerChildren",m,c),m.forEach(f=>{const E=f.dataset.key;c.includes(E)||(p("remove element",E,f),f.remove(),y(E))}),c.forEach(f=>{var M,I,g;const E=d[c.indexOf(f)];o.has(f)?JSON.stringify(E)!==JSON.stringify(u[c.indexOf(f)])&&((I=(M=s.hostElement)==null?void 0:M.querySelector(`[data-key="${f}"]`))==null||I.remove(),(g=o.get(f))==null||g.set(Math.random().toString(36).substring(2,15)),i.set(f,()=>e(E,c.indexOf(f),d).setCustomAttribute("data-key",f))):(p("create new element",f,E),o.set(f,R(Math.random().toString(36).substring(2,15))),i.set(f,()=>e(E,c.indexOf(f),d).setCustomAttribute("data-key",f)))}),u=[...d.map(f=>({...f}))];const v=()=>{o.forEach((f,E)=>{p("key from setTimeout foreach currItemSignalMap",E),l.has(E)||(l.add(E),b(()=>{var pt,Ct;f();const M=c.indexOf(E),I=(pt=i.get(E))==null?void 0:pt();if(!I)return;p("call effect from setTimeout",E,I.hostElement);const g=s.hostElement;if(g&&M<=g.children.length-1)g.insertBefore(g,g.children[M]);else{const Et=I.hostElement;Et&&((Ct=s.hostElement)==null||Ct.append(Et))}}))})};Promise.resolve().then(()=>v())}),s},Mt=n=>{let t=[T("div")],e=!1;return b(()=>{var i,c;const s=n();e=Array.isArray(s);const o=[];o.push(...[s].flat()),o.length===0&&o.push(T("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{p("newReactiveComponent.map",o.map(l=>{var u;return p("newReactiveComponent hostElement",l.hostElement),(u=l.hostElement)==null?void 0:u.id})),p("currComponent[0].hostElement?.id",(i=t[0].hostElement)==null?void 0:i.id,t),(c=t[0].hostElement)==null||c.replaceWith(...o.map(l=>l.hostElement).filter(Boolean)),t.slice(1).forEach(l=>{var u;return(u=l.hostElement)==null?void 0:u.remove()}),t=o}catch(l){console.error(l)}}),e?t:t[0]},Pt=n=>Ot in n,_t=n=>{const t=J("div")().addStyle({display:"contents"}),e=s=>{const o=t.hostElement;return o&&(o.innerHTML=s),t};return typeof n=="string"?e(n):t.addEffect(()=>{e(n())}),t},G=(n,t,e)=>n?L(t):e?L(e):J("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),dt=(n,t,e)=>L(()=>G(!!n(),t,e)),Ft=(n,t,e)=>typeof n=="boolean"?G(n,t,e):dt(n,t,e),D=(n,t)=>L(t).addEffect((e,s)=>{if(typeof n=="boolean")s.style.display=n?"block":"none";else{const o=n()?"block":"none";s.style.display=o}}),Bt=(n,t,e)=>{const s=[D(n,t)].flat();return e&&s.push(...[D(()=>typeof n=="boolean"?!n:!n(),e)].flat()),L(()=>s)},ht=(n,t)=>{p("createCustomElement",n);const e=document.createElement(n),s=tt(e);return e.init=()=>{q(new WeakRef(s),t)},s},ft=(n,t)=>{const e=n.split(" ").slice(1).map(o=>o.trim()),s=ht(n.split(" ")[0],t);return Array.isArray(e)&&e.length>0&&s.addClass(...e),(...o)=>{const i=o.filter(Boolean).flat().flatMap(l=>typeof l=="function"&&!w(l)?L(()=>l(s)):l),c=s.hostElement;return c&&(c.allSlotContent=i,c.slotContent=i.filter(j).reduce((l,u)=>{var d;const y=((d=u.hostElement)==null?void 0:d.getAttribute("slot"))||"default";return l[y]||(l[y]=[]),l[y].push(u),l},{}),c.appendAllSlotContent=()=>{H(new WeakRef(s),...i)}),s}},ut=(n,t,e)=>ft(`${n.renderTagName}${t&&typeof t=="string"?" "+t:""}`,S(t)?t:t&&typeof t=="string"?e:void 0),Vt=()=>{const n=()=>{};return n.oldValue=null,n},Jt=()=>({}),mt=(n,t,e)=>{const s=t?N(t,e)(n):n;return(o,...i)=>{const c=[...i];return o&&!S(o)&&c.unshift(o),ut(s,S(o)?o:{})(...c)}},Nt=n=>[mt(n),(t,e)=>{N(t,e)(n)}],a={};["div","span","section","input","button","table","tr","td","th","ul","li","ol","form","label","select","option","textarea","img","a","p","h1","h2","h3","h4","h5","h6","br","hr","pre","code","nav","header","footer","main","aside","article","figure","figcaption","blockquote","cite","small","strong","em","b","i","u","s","sub","sup","mark","del","ins","details","summary","progress","meter","audio","video","canvas","slot"].forEach(n=>{a[n]=(t,...e)=>{let s=[...e];return t&&!S(t)&&(s=[t].concat(s)),J(n,S(t)?t:{})(...s)}});const qt=a.div,zt=a.span,Gt=a.section,Dt=a.input,Ut=a.button,Xt=a.table,Zt=a.tr,Qt=a.td,Yt=a.th,Kt=a.ul,xt=a.li,te=a.ol,ee=a.form,ne=a.label,se=a.select,oe=a.option,re=a.textarea,ie=a.img,ce=a.a,ae=a.p,le=a.h1,de=a.h2,he=a.h3,fe=a.h4,ue=a.h5,me=a.h6,pe=a.br,Ce=a.hr,Ee=a.pre,be=a.code,Se=a.nav,ye=a.header,ve=a.footer,we=a.main,Ae=a.aside,Re=a.article,Le=a.figure,ge=a.figcaption,je=a.blockquote,Oe=a.cite,Te=a.small,Ie=a.strong,ke=a.em,$e=a.b,We=a.i,He=a.u,Me=a.s,Pe=a.sub,_e=a.sup,Fe=a.mark,Be=a.del,Ve=a.ins,Je=a.details,Ne=a.summary,qe=a.progress,ze=a.meter,Ge=a.audio,De=a.video,Ue=a.canvas,Xe=a.slot,Ze=n=>t=>n(t).addClass(...t.classList??[]).addReactiveClass(t.reactiveClassList??{});r.BaseElement=O,r.a=ce,r.addAttributeList=lt,r.addClassList=it,r.addCustomAttributes=rt,r.addReactiveClassList=ct,r.addStyleList=at,r.appendContentItem=H,r.article=Re,r.aside=Ae,r.audio=Ge,r.b=$e,r.bindReactiveSignals=wt,r.blockquote=je,r.br=pe,r.button=Ut,r.camelToKebab=k,r.canvas=Ue,r.checkCall=P,r.checkRef=St,r.cite=Oe,r.classList=nt,r.cls=Wt,r.code=be,r.colorLog=$,r.combineLatest=Rt,r.component=N,r.configCustomComponent=Nt,r.createComponent=Ze,r.createCustom=ut,r.createCustomEl=ft,r.createCustomElement=ht,r.createEl=J,r.createElement=T,r.createSignal=vt,r.customElementHelpers=tt,r.defineSlotTemplate=Jt,r.del=Be,r.details=Je,r.disableLogs=X,r.div=qt,r.effect=b,r.elementHelpers=et,r.em=ke,r.enableLogs=bt,r.event=gt,r.eventEmitter=$t,r.figcaption=ge,r.figure=Le,r.footer=ve,r.forkJoin=At,r.form=ee,r.getList=Ht,r.getSignalContent=L,r.h1=le,r.h2=de,r.h3=he,r.h4=fe,r.h5=ue,r.h6=me,r.header=ye,r.hr=Ce,r.i=We,r.img=ie,r.initComponent=q,r.input=Dt,r.ins=Ve,r.isBaseElement=jt,r.isComponentConfig=j,r.isComponentInitConfig=S,r.isReactiveSignal=w,r.isSlotTemplate=Pt,r.kebabToCamel=U,r.label=ne,r.li=xt,r.main=we,r.mark=Fe,r.meter=ze,r.nav=Se,r.newEventEmitter=Vt,r.ol=te,r.option=oe,r.p=ae,r.pre=Ee,r.progress=qe,r.projectLog=p,r.property=Lt,r.removeEffect=F,r.renderIf=G,r.rs=yt,r.rxRenderIf=dt,r.s=Me,r.section=Gt,r.select=se,r.setChildren=ot,r.setEffects=st,r.setListeners=z,r.show=Bt,r.showIf=D,r.signal=R,r.signalComponent=Mt,r.slot=Xe,r.small=Te,r.span=zt,r.strong=Ie,r.sub=Pe,r.summary=Ne,r.sup=_e,r.table=Xt,r.td=Qt,r.textarea=re,r.th=Yt,r.tr=Zt,r.u=He,r.ul=Kt,r.unsafeHtml=_t,r.useCustomComponent=mt,r.video=De,r.when=Ft,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
@@ -1,9 +1,10 @@
1
- import { ReactiveSignal } from '../utils/signal';
1
+ import { EffectCb, ReactiveSignal } from '../utils/signal';
2
2
  export type Split<S extends string, D extends string> = string extends S ? string[] : S extends "" ? [] : S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] : [S];
3
3
  export type Join<T extends unknown[], D extends string> = T extends [] ? "" : T extends [string | number | boolean | bigint] ? `${T[0]}` : T extends [string | number | boolean | bigint, ...infer U] ? `${T[0]}${D}${Join<U, D>}` : string;
4
4
  export type HtmlTagName = keyof HTMLElementTagNameMap;
5
5
  export type ExtraHTMLElement = HTMLElement & {
6
- render?: () => ComponentConfig<any>;
6
+ render?: () => ComponentConfig<ExtraHTMLElement>;
7
+ effectSet?: Set<WeakRef<EffectCb>>;
7
8
  onConnected?: (self: ComponentConfig<ExtraHTMLElement>, host: ExtraHTMLElement) => void;
8
9
  slotTemplate?: SlotTemplate;
9
10
  };
@@ -16,12 +17,12 @@ export type CustomEventListener<DetailValue, T extends ExtraHTMLElement> = (e: C
16
17
  export type CustomEventValue<T> = T extends EventEmitter<infer V> ? V : T;
17
18
  export type ComponentCallback<T extends ExtraHTMLElement> = (self: ComponentConfig<T>, host: T) => void;
18
19
  export type AttrSignal<T extends HTMLElement & {
19
- render?: () => ComponentConfig<any>;
20
- }> = T["render"] extends () => ComponentConfig<any> ? {
20
+ render?: () => ComponentConfig<ExtraHTMLElement>;
21
+ }> = T["render"] extends () => ComponentConfig<ExtraHTMLElement> ? {
21
22
  [k in keyof T]: T[k] extends ReactiveSignal<any> ? k : never;
22
23
  }[keyof T & string] : keyof T & string;
23
24
  export type EffectCallback<T extends HTMLElement> = (self: ComponentConfig<T>, host: T) => void;
24
- export type ComponentContent = ComponentConfig<any> | string | ReactiveSignal<any>;
25
+ export type ComponentContent = ComponentConfig<ExtraHTMLElement> | string | ReactiveSignal<any>;
25
26
  export type CompFuncContent = () => ComponentContent | ComponentContent[];
26
27
  export type ContextCompFuncContent<T extends ExtraHTMLElement> = (self: ComponentConfig<T>) => ComponentContent | ComponentContent[];
27
28
  export type ChildrenContent<T extends ExtraHTMLElement> = ComponentContent | ContextCompFuncContent<T> | (ComponentContent | ContextCompFuncContent<T>)[];
@@ -29,15 +30,15 @@ export interface ComponentConfig<T extends ExtraHTMLElement> {
29
30
  /**
30
31
  * append child components
31
32
  */
32
- append(...args: ComponentConfig<any>[]): ComponentConfig<T>;
33
+ append(...args: ComponentConfig<ExtraHTMLElement>[]): ComponentConfig<T>;
33
34
  /**
34
35
  * clear and append child components
35
36
  */
36
- set(...args: ComponentConfig<any>[]): ComponentConfig<T>;
37
+ set(...args: ComponentConfig<ExtraHTMLElement>[]): ComponentConfig<T>;
37
38
  /**
38
39
  * remove child components
39
40
  */
40
- removeChild(...args: ComponentConfig<any>[]): ComponentConfig<T>;
41
+ removeChild(...args: ComponentConfig<ExtraHTMLElement>[]): ComponentConfig<T>;
41
42
  /**
42
43
  * add html (string) content to host element
43
44
  */
@@ -53,7 +54,7 @@ export interface ComponentConfig<T extends ExtraHTMLElement> {
53
54
  /**
54
55
  * add event listener to component
55
56
  */
56
- addEventlistener<K extends T["render"] extends () => ComponentConfig<any> ? never : keyof HTMLElementEventMap>(eventName: K, cb: ComponentEventListener<T, HTMLElementEventMap[K]>, options?: boolean | AddEventListenerOptions): ComponentConfig<T>;
57
+ addEventlistener<K extends T["render"] extends () => ComponentConfig<ExtraHTMLElement> ? never : keyof HTMLElementEventMap>(eventName: K, cb: ComponentEventListener<T, HTMLElementEventMap[K]>, options?: boolean | AddEventListenerOptions): ComponentConfig<T>;
57
58
  addEventlistener<K extends EventKeys<T>>(eventName: K, cb: CustomEventListener<CustomEventValue<T[K]>, T>, options?: boolean | AddEventListenerOptions): ComponentConfig<T>;
58
59
  /**
59
60
  * set attribute value to component
@@ -101,7 +102,7 @@ export interface ComponentConfig<T extends ExtraHTMLElement> {
101
102
  /**
102
103
  * add reactive effect for component instance
103
104
  */
104
- addEffect(cb: EffectCallback<T>): ComponentConfig<T>;
105
+ addEffect(cb: EffectCallback<T>, key?: string | symbol): ComponentConfig<T>;
105
106
  /**
106
107
  * bind reactive signal with component innerHtml
107
108
  */
@@ -117,9 +118,9 @@ export interface ComponentConfig<T extends ExtraHTMLElement> {
117
118
  /**
118
119
  * host element
119
120
  */
120
- hostElement: T;
121
+ get hostElement(): T | undefined;
121
122
  }
122
- export type SlotTemplate = Record<string, (slotCtx: any) => ComponentConfig<any> | null>;
123
+ export type SlotTemplate = Record<string, (slotCtx: any) => ComponentConfig<ExtraHTMLElement> | null>;
123
124
  export type CustomComponentConfig<T extends ExtraHTMLElement> = {
124
125
  setReactiveValue<ModelType = unknown>(value: ReactiveSignal<ModelType>): CustomComponentConfig<T>;
125
126
  /**
@@ -5,3 +5,4 @@ export declare const kebabToCamel: (v: string) => string;
5
5
  export declare const colorLog: (message: string, ...args: any[]) => void;
6
6
  export declare const enableLogs: () => void;
7
7
  export declare const disableLogs: () => void;
8
+ export declare const checkRef: <W extends HTMLElement | undefined>(refs: W[], cb: (item: (W extends undefined ? never : W)[]) => void) => void;
@@ -1,5 +1,5 @@
1
1
  import { BaseElementConstructor } from '../html-elements';
2
- type EventConfig = Pick<CustomEventInit, 'bubbles' | 'composed'>;
2
+ type EventConfig = Pick<CustomEventInit, "bubbles" | "composed">;
3
3
  export declare const property: () => (<T extends HTMLElement, K extends keyof T>(target: T, propName: K) => void);
4
4
  export declare const event: (config?: EventConfig) => (<T extends HTMLElement, K extends keyof T>(target: T, propName: K) => void);
5
5
  export declare const component: (selector: `${string}-${string}`, isClosed?: boolean) => (<T extends BaseElementConstructor>(target: T) => T);
@@ -1,18 +1,18 @@
1
1
  import { ComponentConfig, ComponentContent, RootStyle, SlotContext, SlotTemplate } from '../../types';
2
- import { ReactiveSignal } from '../signal';
2
+ import { EffectCb, ReactiveSignal } from '../signal';
3
3
  export declare abstract class BaseElement extends HTMLElement {
4
4
  static observedAttributes: string[];
5
5
  static renderTagName: string;
6
6
  static styles?: string | string[];
7
+ init?: () => void;
7
8
  isSlotLazyLoading: boolean;
8
9
  slotTemplate?: SlotTemplate;
9
10
  slotContext?: SlotContext;
10
11
  rootStyle?: RootStyle;
11
12
  modelValue?: ReactiveSignal<unknown>;
12
13
  providers?: Record<string, ReactiveSignal<any>>;
13
- destroyDependenciesEffects: (() => void)[];
14
- init?: () => void;
15
- appendAllSlotContent?: () => ComponentConfig<any>;
14
+ effectSet: Set<WeakRef<EffectCb>>;
15
+ appendAllSlotContent?: () => void;
16
16
  allSlotContent?: ComponentContent[];
17
17
  slotContent: Record<string, ComponentConfig<any>[]>;
18
18
  htmlSlotContent: Record<string, HTMLElement[]>;
@@ -6,33 +6,34 @@ export declare const addHtmlContent: <T extends HTMLElement = HTMLElement>(htmlE
6
6
  export declare const setHtmlContent: <T extends HTMLElement = HTMLElement>(htmlElement: T, content: string | unknown) => T;
7
7
  export declare const htmlEffectWrapper: (content: ReactiveSignal<unknown>) => HTMLSpanElement;
8
8
  export declare class HtmlComponentConfig<T extends ExtraHTMLElement> implements ComponentConfig<T> {
9
- protected wrapper: T;
10
- hostElement: T;
11
- constructor(wrapper: T);
12
- append: ComponentConfig<T>['append'];
13
- set: ComponentConfig<T>['set'];
14
- removeChild: ComponentConfig<T>['removeChild'];
15
- addHtmlContent: ComponentConfig<T>['addHtmlContent'];
16
- setHtmlContent: ComponentConfig<T>['setHtmlContent'];
9
+ protected wrapper: WeakRef<T>;
10
+ get hostElement(): T | undefined;
11
+ private keyedEffects;
12
+ constructor(wrapper: WeakRef<T>);
13
+ append: ComponentConfig<T>["append"];
14
+ set: ComponentConfig<T>["set"];
15
+ removeChild: ComponentConfig<T>["removeChild"];
16
+ addHtmlContent: ComponentConfig<T>["addHtmlContent"];
17
+ setHtmlContent: ComponentConfig<T>["setHtmlContent"];
17
18
  addEventlistener(eventName: string, cb: any, options?: boolean | AddEventListenerOptions): this;
18
- setAttribute: ComponentConfig<T>['setAttribute'];
19
- setCustomAttribute: ComponentConfig<T>['setCustomAttribute'];
20
- setReactiveAttribute: ComponentConfig<T>['setReactiveAttribute'];
21
- setReactiveCustomAttribute: ComponentConfig<T>['setReactiveCustomAttribute'];
22
- removeAttribute: ComponentConfig<T>['removeAttribute'];
23
- addStyle: ComponentConfig<T>['addStyle'];
24
- onConnected: ComponentConfig<T>['onConnected'];
25
- addClass: ComponentConfig<T>['addClass'];
26
- setClass: ComponentConfig<T>['setClass'];
27
- addReactiveClass: ComponentConfig<T>['addReactiveClass'];
28
- removeClass: ComponentConfig<T>['removeClass'];
29
- replaceClass: ComponentConfig<T>['replaceClass'];
30
- addEffect: ComponentConfig<T>['addEffect'];
31
- addReactiveContent: ComponentConfig<T>['addReactiveContent'];
32
- setReactiveContent: ComponentConfig<T>['setReactiveContent'];
33
- clear: ComponentConfig<T>['clear'];
19
+ setAttribute: ComponentConfig<T>["setAttribute"];
20
+ setCustomAttribute: ComponentConfig<T>["setCustomAttribute"];
21
+ setReactiveAttribute: ComponentConfig<T>["setReactiveAttribute"];
22
+ setReactiveCustomAttribute: ComponentConfig<T>["setReactiveCustomAttribute"];
23
+ removeAttribute: ComponentConfig<T>["removeAttribute"];
24
+ addStyle: ComponentConfig<T>["addStyle"];
25
+ onConnected: ComponentConfig<T>["onConnected"];
26
+ addClass: ComponentConfig<T>["addClass"];
27
+ setClass: ComponentConfig<T>["setClass"];
28
+ addReactiveClass: ComponentConfig<T>["addReactiveClass"];
29
+ removeClass: ComponentConfig<T>["removeClass"];
30
+ replaceClass: ComponentConfig<T>["replaceClass"];
31
+ addEffect: ComponentConfig<T>["addEffect"];
32
+ addReactiveContent: ComponentConfig<T>["addReactiveContent"];
33
+ setReactiveContent: ComponentConfig<T>["setReactiveContent"];
34
+ clear: ComponentConfig<T>["clear"];
34
35
  }
35
36
  export declare class CustomHtmlComponentConfig<T extends ExtraHTMLElement> extends HtmlComponentConfig<T> implements CustomComponentConfig<T> {
36
- setReactiveValue: CustomComponentConfig<T>['setReactiveValue'];
37
- setSlotTemplate: CustomComponentConfig<T>['setSlotTemplate'];
37
+ setReactiveValue: CustomComponentConfig<T>["setReactiveValue"];
38
+ setSlotTemplate: CustomComponentConfig<T>["setSlotTemplate"];
38
39
  }
@@ -6,7 +6,7 @@ export declare const classList: (strings: TemplateStringsArray, ...args: (string
6
6
  classList: (string | (() => string))[];
7
7
  };
8
8
  export declare const cls: (strings: TemplateStringsArray, ...values: (string | (() => string))[]) => ReturnType<typeof classList>;
9
- export declare const initComponent: <T extends ExtraHTMLElement, K extends ComponentConfig<T> | CustomComponentConfig<T>>(component: K, config?: ComponentInitConfig<T>) => K;
9
+ export declare const initComponent: <T extends ExtraHTMLElement, K extends ComponentConfig<T> | CustomComponentConfig<T>>(currComponent: WeakRef<K>, config?: ComponentInitConfig<T>) => K | undefined;
10
10
  export declare const setListeners: <T extends ExtraHTMLElement>(comp: ComponentConfig<T>, listeners?: ConfigListeners<T>) => void;
11
11
  export declare const setEffects: <T extends ExtraHTMLElement>(comp: ComponentConfig<T>, effects?: ConfigEffect<T>) => void | undefined;
12
12
  export declare const setChildren: <T extends ExtraHTMLElement>(comp: ComponentConfig<T>, children?: ConfigChildren) => ComponentConfig<T>;
@@ -15,4 +15,4 @@ export declare const addClassList: <T extends ExtraHTMLElement>(comp: ComponentC
15
15
  export declare const addReactiveClassList: <T extends ExtraHTMLElement>(comp: ComponentConfig<T>, classList?: ConfigReactiveClassList) => ComponentConfig<T>;
16
16
  export declare const addStyleList: <T extends ExtraHTMLElement>(comp: ComponentConfig<T>, styleList?: ConfigStyle) => ComponentConfig<T>;
17
17
  export declare const addAttributeList: <T extends ExtraHTMLElement>(comp: ComponentConfig<T>, attributeList?: ConfigAttribute<T>) => void;
18
- export declare const appendContentItem: <T extends ExtraHTMLElement, Component extends ComponentConfig<T> | CustomComponentConfig<T>>(comp: Component, ...items: ComponentContent[]) => Component;
18
+ export declare const appendContentItem: <T extends ExtraHTMLElement, Component extends ComponentConfig<T> | CustomComponentConfig<T>>(component: WeakRef<Component>, ...items: ComponentContent[]) => Component | undefined;
@@ -1,10 +1,10 @@
1
- import { ComponentConfig } from '../../types';
1
+ import { ComponentConfig, ExtraHTMLElement } from '../../types';
2
2
  type RouterConfig = {
3
3
  path: string;
4
4
  comp: () => ComponentConfig<any>;
5
5
  }[];
6
6
  export declare const routes: RouterConfig;
7
- export declare const linkTo: (path: string, comp: ComponentConfig<any>) => void;
7
+ export declare const linkTo: (path: string, comp: ComponentConfig<ExtraHTMLElement>) => void;
8
8
  export declare const comparePaths: (path1: string, path2: string) => boolean;
9
9
  export declare const routerOutlet: (routes: RouterConfig) => ComponentConfig<HTMLDivElement>;
10
10
  export {};
@@ -1,3 +1,4 @@
1
1
  export type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
2
2
  export type IsPromise<T> = T extends Promise<any> ? true : false;
3
3
  export type IsPromiseFunction<T> = T extends () => Promise<any> ? true : false;
4
+ export type GetRef<T extends WeakRef<any>> = T extends WeakRef<infer U> ? U : T;
@@ -1,20 +1,23 @@
1
1
  import { IsPromise, IsPromiseFunction, UnwrapPromise } from './helpers.types';
2
2
  import { CompareFn, ReactiveSignal, UnwrapSignal } from './signal.type';
3
- export interface Effect {
4
- (): void;
5
- cleanupFns: Set<() => void>;
6
- children: Set<Effect>;
7
- effectId: string;
3
+ export type EffectCb = (() => void) & {
4
+ fake?: boolean;
5
+ effectId?: string;
6
+ children?: Set<EffectCb>;
7
+ parent?: WeakRef<EffectCb>;
8
+ cleanupSet?: Set<() => void>;
9
+ component?: WeakRef<HTMLElement>;
8
10
  status: 'active' | 'inactive';
9
- destroy: () => void;
10
- }
11
- export declare function signal<T = unknown>(initValue: T, config?: {
11
+ destroy?: () => void;
12
+ };
13
+ export declare const removeEffect: (effectCb: EffectCb) => void;
14
+ export declare function signal<T = unknown>(initValue: T, signalConfig?: {
12
15
  signalCompareFn?: CompareFn<T>;
13
16
  name?: string;
14
17
  }): ReactiveSignal<T>;
15
18
  export declare function effect(cb: () => void, config?: {
16
19
  name?: string;
17
- }): Effect;
20
+ }): void;
18
21
  export declare const isReactiveSignal: <R extends ReactiveSignal<any>>(v: R | any) => v is R;
19
22
  /**
20
23
  * Reactive String (rs). Создаёт зависимый string сигнал от источника.
@@ -1,2 +0,0 @@
1
- (function(r,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(r=typeof globalThis<"u"?globalThis:r||self,S(r.ReactiveComponent={}))})(this,function(r){"use strict";var Ge=Object.defineProperty;var Ue=(r,S,j)=>S in r?Ge(r,S,{enumerable:!0,configurable:!0,writable:!0,value:j}):r[S]=j;var l=(r,S,j)=>Ue(r,typeof S!="symbol"?S+"":S,j);const S=e=>e&&typeof e=="object"&&("classList"in e||"attributes"in e||"customAttributes"in e||"reactiveClassList"in e||"listeners"in e||"customListeners"in e||"children"in e||"effects"in e||"style"in e||Object.keys(e).some(t=>t.startsWith(".")||t.startsWith("@")||t.startsWith("$")))&&!("hostElement"in e),j=e=>e&&typeof e=="object"&&"hostElement"in e&&"append"in e&&"set"in e&&"addStyle"in e&&"setAttribute"in e&&"addClass"in e&&"addEffect"in e&&"addReactiveContent"in e&&"setReactiveContent"in e&&"clear"in e,k=(e,t,...s)=>{t&&t.apply(e,s)};let H=!0;const m=(...e)=>{H&&console.debug(["[rwc]",...e].join(" | "),...Array.from(e.join("").matchAll(/%c/gm)).map((t,s)=>s%2===0?"color:red":"color:inherit"))},$=e=>e.replace(/([A-Z])/gm,t=>`-${t.toLowerCase()}`),q=e=>e.replace(/-(\w)/gm,(t,s)=>s.toUpperCase()),T=(e,...t)=>{if(!H)return;const s={r:"color: #ff0000",g:"color: #00ff00",b:"color: #0000ff",y:"color: #ffff00",p:"color: #800080",c:"color: #00ffff",o:"color: #ffa500",w:"color: #808080"},n=e.match(/@[rgbpycow]/g)||[],o=n.map(i=>{const h=i.slice(1);return s[h]||"color: inherit"});let a=e;n.forEach(i=>{const h=new RegExp(`\\${i}([^\\s,]+)`,"g");a=a.replace(h,"%c$1")}),console.log(a,...o,...t)},pt=()=>{H=!0},z=()=>{H=!1};z();const mt=(e,t)=>{const s=e.parentNode;if(!s)return null;const n=new MutationObserver(o=>{for(const a of o)if(a.type==="childList"){for(const i of a.removedNodes)if(i===e){n.disconnect(),t(e);return}}});return n.observe(s,{childList:!0}),n},L=[],G=e=>{e.cleanupFns.forEach(t=>t()),e.children.forEach(t=>{t.destroy()}),e.children.clear(),e.cleanupFns.clear()};function R(e,t){let s=(t==null?void 0:t.signalCompareFn)||(()=>!0);const n=new Set;function o(){const i=L[L.length-1];return i&&!n.has(i)&&!("fake"in i&&i.fake)&&(n.add(i),i.cleanupFns.add(()=>{n.delete(i)})),e}let a="";return Object.defineProperty(o,"signalId",{get:()=>a,set:i=>{a=i}}),o.signalId=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`,o.setName=function(i){return o.signalId=`${i}_${Math.random().toString(36).substring(2,15)}`,o},o.setCompareFn=function(i){return s=i,o},o.clearSubscribers=function(){n.clear()},o.getSubscribers=function(){return n},o.peek=function(){return Object.freeze(e)},o.initValue=Object.freeze(e),o.forceSet=function(i){e=i,n.forEach(h=>{G(h),Promise.resolve().then(()=>{L.push(h),h(),L.pop()})})},o.set=function(i,h=s){e!==i&&h(e,i)&&o.forceSet(i)},o.update=function(i){o.set(i(e))},o.pipe=(i,h)=>{const f=R(null);return C(()=>{const w=o();C(()=>{const b=i(w);b instanceof Promise?b.then(p=>f.set(p)):v(b)?C(()=>f.set(b())):f.set(b)},h)}),f},o}function C(e,t){const s=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`;m("current effect",`%c${s}%c`);const n=L[L.length-1],o=e;return o.cleanupFns=new Set,o.children=new Set,o.status="active",o.effectId=s,o.destroy=()=>{o.status="inactive",G(o),n==null||n.children.delete(o)},n==null||n.children.add(o),L.push(o),o(),L.pop(),o}const v=e=>!!e&&["object","function"].includes(typeof e)&&"set"in e&&"update"in e&&"forceSet"in e;function Ct(e,...t){const s=R("");return C(()=>{const n=t.map(a=>v(a)?String(a()):String(a)),o=[e[0]];n.forEach((a,i)=>{o.push(a,e[i+1])}),s.set(o.join(""))}),s}function bt(e,t){const s=R(t??null),n=o=>s.set(o);return e instanceof Promise?e.then(n):typeof e=="function"&&C(()=>{const o=e();o instanceof Promise?o.then(n):v(o)?C(()=>n(o())):n(o)}),s}function Et(e,t){let s=e(),n=t();C(()=>{const o=e(),a=t();o!==a&&(o!==s?t.set(o):a!==n&&e.set(a)),s=o,n=a})}function yt(...e){let t=e.map(n=>n());const s=R(t);return e.forEach((n,o)=>{C(()=>{const a=()=>t.filter(i=>i!==void 0).length;a()===e.length&&(t=Array.from(t).fill(void 0)),t[o]=n(),a()===e.length&&s.set([...t])})}),s}const St=(...e)=>{const t=R([]);return C(()=>{t.set(e.map(s=>s()))}),t},F="eventProps",_="EVENT_CONFIG",M="observedAttributes",wt=()=>(e,t)=>{Reflect.get(e,M)||Reflect.defineProperty(e,M,{value:[]}),Reflect.get(e,M).push($(t))},vt=e=>(t,s)=>{Reflect.get(t,F)||Reflect.defineProperty(t,F,{value:[]}),Reflect.get(t,_)||Reflect.defineProperty(t,_,{value:{}}),Reflect.get(t,_)[s]={bubbles:(e==null?void 0:e.bubbles)??!1,composed:(e==null?void 0:e.composed)??!1},Reflect.get(t,F).push(s)},D=(e,t=!1)=>s=>{m(e,"start register static attr",s.prototype[M]);const n=[];if(s.styles){const a=s.styles,i=[];Array.isArray(a)?i.push(...a):i.push(a),i.forEach(h=>{const f=new CSSStyleSheet;f.replaceSync(h),n.push(f);const w=new CSSStyleSheet;w.replaceSync(h.slice(h.indexOf("@property"))),document.adoptedStyleSheets.push(w)})}class o extends s{constructor(...i){m("constructor",`%c${e}%c`),super(t,...i),T("@osheet",n),n.length>0&&this.shadow.adoptedStyleSheets.push(...n)}render(){return m("rwc: render from new class"),s.prototype.render.call(this)}attributeChangedCallback(i,h,f){m("%cAttribute has changed.%c",`%c${i}%c`,`oldValue: ${h}, newValue: ${f}`,`%c${e}%c`);try{f=JSON.parse(f)}catch{}const w=q(i);if(w in this&&v(this[w])){const b=this[w];f===null?(b.set(b.initValue),this.removeAttribute(i)):b.set(f)}k(this,s.prototype.attributeChangedCallback,i,h,f)}connectedCallback(){const i=()=>{var w,b;m("rwc: connectedCallback"),m("connectedCallback",`%c${e}%c`,this),(w=this.init)==null||w.call(this),this.providers&&Object.keys(this.providers).length>0&&(m("WRAPPER for providers",e),Object.entries(this.providers).forEach(([p,E])=>{m("register provider",p,E()),this.addEventListener(p,u=>{var y;m("send provider",p,E());const d=u;((y=d.detail)==null?void 0:y.context)===p&&(d.stopPropagation(),d.detail.callback(E))})})),this.checkInjects(),(b=s.prototype[F])==null||b.forEach(p=>{this[p]=E=>{const u=s.prototype[_][p],{bubbles:d,composed:y}=u;v(E)?C(()=>{T("@oemit reactive value",E()),this.dispatchEvent(new CustomEvent(p,{detail:E(),bubbles:d,composed:y}))}):(T("@oemit value",E),this.dispatchEvent(new CustomEvent(p,{detail:E,bubbles:d,composed:y})))}}),m("start render",`%c${e}%c`,e);const f=()=>{m("rwc: insertRenderTemplate");const p=this.render();this.shadow.appendChild(p.hostElement),k(this,s.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!s.styles){const p=d=>d instanceof Promise||Array.isArray(d)&&d.every(y=>y instanceof Promise),E=this.rootStyle,u=d=>{const y=new CSSStyleSheet;y.replaceSync(d),this.shadow.adoptedStyleSheets.push(y);const A=new CSSStyleSheet;A.replaceSync(d.slice(d.indexOf("@property"))),document.adoptedStyleSheets.push(A)};if(p(E)){const d=[];Array.isArray(E)?d.push(...E):d.push(E),Promise.all(d).then(y=>y.forEach(A=>u(A.default))).then(()=>f())}else{const d=[];Array.isArray(E)?d.push(...E):d.push(E),d.forEach(y=>u(y)),f()}}else f();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(p=>{m(this.slotContext,this.slotContext&&this.slotContext[p.name]),T("@bslot element",p,`name:${p.name};`,p.assignedElements()),p.assignedElements().forEach(E=>{const u=this.slotContext[p.name];this.slotContext&&v(u)&&(T("@oslot element",p,`name:${p.name};`,p.assignedElements()),C(()=>{E.dispatchEvent(new CustomEvent("handleSlotContext",{detail:u()}))}))})})};i.fake=!0;const h=C(i);this.destroyDependenciesEffects.push(h.destroy)}disconnectedCallback(){this.destroyDependenciesEffects.forEach(i=>i()),this.destroyDependenciesEffects=[],this.shadow.replaceChildren(),this.replaceChildren(),k(this,s.prototype.disconnectedCallback)}}return l(o,"observedAttributes",s.prototype[M]??[]),l(o,"renderTagName",e),o.toString=()=>e,customElements.get(e)?console.error(`название тега ${e} повторяется, компонент ${s.name} не зарегистрирован`):customElements.define(e,o),s.renderTagName=e,s};class g extends HTMLElement{constructor(s=!1){super();l(this,"isSlotLazyLoading",!1);l(this,"slotTemplate");l(this,"slotContext");l(this,"rootStyle");l(this,"modelValue");l(this,"providers");l(this,"destroyDependenciesEffects",[]);l(this,"init");l(this,"appendAllSlotContent");l(this,"allSlotContent",[]);l(this,"slotContent",{});l(this,"htmlSlotContent",{});l(this,"shadow");l(this,"injects",{});this.shadow=this.attachShadow({mode:s?"closed":"open"})}appendChild(s,n=!0){var o;if(this.isSlotLazyLoading&&n){if(s instanceof HTMLElement){const a=s.slot||"default";this.htmlSlotContent[a]||(this.htmlSlotContent[a]=[]),(o=this.htmlSlotContent[a])==null||o.push(s)}}else return super.appendChild(s)}appendSlotContent(){var s;(s=this.appendAllSlotContent)==null||s.call(this)}inject(s){return m("%cinject%c",s),this.injects[s]||(this.injects[s]=R(null)),this.injects[s]}checkInjects(){Object.entries(this.injects).forEach(([s,n])=>{m("%cinject%c",`%c${s}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(s,{detail:{context:s,callback:o=>C(()=>{n.set(o())})},bubbles:!0,composed:!0}))})}setReactiveValue(s){this.modelValue=s}}l(g,"observedAttributes",[]),l(g,"renderTagName",""),l(g,"styles");const At=e=>"render"in e&&"setReactiveValue"in e,gt="handleSlotContext",U="onConnected",X=e=>typeof e=="string"?e:JSON.stringify(e),Lt=e=>{const t=document.createElement("span");return t.textContent=X(e),t},Z=(e,t)=>(e.appendChild(Lt(t)),e),Rt=(e,t)=>(e.replaceChildren(),Z(e,t)),Q=e=>{const t=document.createElement("span");return C(()=>{const s=e();t.textContent=X(s)}),t};class Y{constructor(t){l(this,"wrapper");l(this,"hostElement");l(this,"append",(...t)=>(t.forEach(s=>{this.wrapper.appendChild(s.hostElement),U in s.hostElement&&setTimeout(()=>{var n,o;(o=(n=s.hostElement).onConnected)==null||o.call(n,s,s.hostElement)})}),this));l(this,"set",(...t)=>{this.clear();const s=document.createDocumentFragment();return t.forEach(n=>{s.appendChild(n.hostElement)}),this.wrapper.appendChild(s),this});l(this,"removeChild",(...t)=>(t.forEach(s=>{Array.from(this.wrapper.childNodes.values()).some(n=>n===s.hostElement)&&this.wrapper.removeChild(s.hostElement)}),this));l(this,"addHtmlContent",t=>(Z(this.wrapper,t),this));l(this,"setHtmlContent",t=>(Rt(this.wrapper,t),this));l(this,"setAttribute",(t,s)=>{let n;if(typeof s=="boolean"&&!(this.wrapper instanceof g))if(s)n="";else{this.removeAttribute(t);const o=t.toLowerCase();return o in this.wrapper&&(this.wrapper[o]=null),this}else typeof s!="string"?n=JSON.stringify(s):n=s;if(this.wrapper.setAttribute($(t),n),!(this.wrapper instanceof g)){const o=t.toLowerCase();o in this.wrapper&&(this.wrapper[o]=s)}return this});l(this,"setCustomAttribute",(t,s)=>{let n;return typeof s!="string"?n=JSON.stringify(s):n=s,this.wrapper.setAttribute($(t),n),this});l(this,"setReactiveAttribute",(t,s)=>{const n=C(()=>this.setAttribute(t,s()));return this.wrapper instanceof g&&this.wrapper.destroyDependenciesEffects.push(n.destroy),this});l(this,"setReactiveCustomAttribute",(t,s)=>{const n=C(()=>this.setCustomAttribute(t,s()));return this.wrapper instanceof g&&this.wrapper.destroyDependenciesEffects.push(n.destroy),this});l(this,"removeAttribute",t=>(this.wrapper.removeAttribute($(t)),this));l(this,"addStyle",t=>(Object.entries(t).forEach(([s,n])=>{const o=s.startsWith("--");typeof n=="function"?this.addEffect(()=>{if(o){const a=String(n()||"");this.wrapper.style.setProperty(s,a)}else this.wrapper.style[s]=n()}):typeof n=="string"&&(o?this.wrapper.style.setProperty(s,n):this.wrapper.style[s]=n)}),this));l(this,"onConnected",t=>(Reflect.defineProperty(this.wrapper,U,{get(){return t}}),this));l(this,"addClass",(...t)=>(t.forEach(s=>{typeof s=="string"?this.wrapper.classList.add(...s.split(" ").flatMap(n=>n.split(`
2
- `)).map(n=>n.trim()).filter(Boolean)):(()=>{let n=null;this.addEffect(()=>{const o=s();o.length>0&&(n?this.replaceClass(n,o):this.addClass(o),n=o)})})()}),this));l(this,"setClass",(...t)=>(this.wrapper.classList.remove(...this.wrapper.classList),this.wrapper.classList.add(...t),this));l(this,"addReactiveClass",t=>(Object.keys(t).forEach(s=>{const n=C(()=>{t[s]()?this.addClass(s):this.removeClass(s)});this.wrapper instanceof g&&this.wrapper.destroyDependenciesEffects.push(n.destroy)}),this));l(this,"removeClass",(...t)=>(this.wrapper.classList.remove(...t),this));l(this,"replaceClass",(t,s)=>(this.wrapper.classList.replace(t,s),this));l(this,"addEffect",t=>{const s=C(()=>t(this,this.hostElement));return this.wrapper instanceof g&&this.wrapper.destroyDependenciesEffects.push(s.destroy),this});l(this,"addReactiveContent",t=>(this.wrapper.appendChild(Q(t)),this));l(this,"setReactiveContent",t=>(this.clear(),this.wrapper.appendChild(Q(t)),this));l(this,"clear",()=>(this.wrapper.replaceChildren(),this));this.wrapper=t,this.hostElement=t}addEventlistener(t,s,n=!1){return this.wrapper.addEventListener(t,o=>s(o,this,this.wrapper),n),this}}class Ot extends Y{constructor(){super(...arguments);l(this,"setReactiveValue",s=>(this.wrapper instanceof g&&this.wrapper.setReactiveValue(s),this));l(this,"setSlotTemplate",s=>{const n=this.wrapper.slotTemplate;return n&&Object.entries(s).forEach(([o,a])=>{n[o]=a}),this})}}const jt=()=>()=>{},K=e=>new Ot(e),x=e=>new Y(e),tt=(e,...t)=>({classList:[...e.map(s=>s.trim()).filter(Boolean),...t]}),Tt=(e,...t)=>tt(e,...t),B=(e,t)=>{if(!t)return e;const s=Object.keys(t||{}).filter(a=>a.startsWith(".")||a.startsWith("@")||a.startsWith("$"));s.filter(a=>a.startsWith(".")).forEach(a=>{t!=null&&t.attributes||(t.attributes={}),t.attributes[a.slice(1)]=t[a]}),s.filter(a=>a.startsWith("@")).forEach(a=>{t!=null&&t.listeners||(t.listeners={});const i=a.slice(1);t.listeners[i]=t[a]}),s.filter(a=>a.startsWith("$")).forEach(a=>{t!=null&&t.effects||(t.effects=[]),t.effects.push(t[a])});const o=C(()=>{rt(e,t.classList),it(e,t.style),at(e,t.attributes),ot(e,t.reactiveClassList),nt(e,t.customAttributes),st(e,t.children),et(e,t.effects),V(e,t.listeners),V(e,t.customListeners)});return mt(e.hostElement,()=>{o.destroy()}),e},V=(e,t)=>{t&&Object.entries(t).forEach(([s,n])=>{typeof n=="function"&&e.addEventlistener(s,n)})},et=(e,t)=>t==null?void 0:t.forEach(s=>e.addEffect(s)),st=(e,t)=>P(e,...t||[]),nt=(e,t)=>{const s=t;s&&Object.keys(s).forEach(n=>{v(s[n])?e.setReactiveCustomAttribute(n,s[n]):typeof s[n]=="function"?e.addEffect(()=>{e.setCustomAttribute(n,s[n]())}):e.setCustomAttribute(n,s[n])})},rt=(e,t)=>e.addClass(...t||[]),ot=(e,t)=>e.addReactiveClass(t||{}),it=(e,t)=>e.addStyle(t||{}),at=(e,t)=>{const s=t,n=(o,a)=>{a&&(v(a)?e.setReactiveAttribute(o,a):typeof a=="function"?e.addEffect(()=>{e.setAttribute(o,a())}):e.setAttribute(o,a))};s&&Object.keys(s).forEach(o=>{n(o,s[o])})},P=(e,...t)=>(t.forEach(s=>{typeof s=="string"?s.trim().length>0&&e.addHtmlContent(s):v(s)?e.addReactiveContent(s):e.append(s)}),e),I=(e,t)=>{const s=document.createElement(e),n=x(s);return B(n,t)},W=(e,t)=>{const[s,...n]=e.split(" ").map(a=>a.trim()),o=I(s,t);return n.length>0&&o.addClass(...n),(...a)=>P(o,...a.filter(Boolean).flat().flatMap(i=>typeof i=="function"&&!v(i)?O(()=>i(o)):i))},O=e=>I("div").addStyle({display:"contents"}).addEffect(t=>{t.clear(),P(t,...[e()].flat())}),It=(e,t,s)=>{const n=I("div").addStyle({display:"contents"}),o=new Map,a=new Map;let i=[];const h=new Set;let f=e.peek();const w=b=>{h.delete(b),o.delete(b),a.delete(b)};return C(()=>{const b=e();i=b.map(t).map(u=>typeof u=="string"?u:u.toString());const p=Array.from(n.hostElement.children);m("containerChildren",p,i),p.forEach(u=>{const d=u.dataset.key;i.includes(d)||(m("remove element",d,u),u.remove(),w(d))}),i.forEach(u=>{var y,A;const d=b[i.indexOf(u)];o.has(u)?JSON.stringify(d)!==JSON.stringify(f[i.indexOf(u)])&&((y=n.hostElement.querySelector(`[data-key="${u}"]`))==null||y.remove(),(A=o.get(u))==null||A.set(Math.random().toString(36).substring(2,15)),a.set(u,()=>s(d,i.indexOf(u),b).setCustomAttribute("data-key",u))):(m("create new element",u,d),o.set(u,R(Math.random().toString(36).substring(2,15))),a.set(u,()=>s(d,i.indexOf(u),b).setCustomAttribute("data-key",u)))}),f=[...b.map(u=>({...u}))];const E=()=>{o.forEach((u,d)=>{m("key from setTimeout foreach currItemSignalMap",d),h.has(d)||(h.add(d),C(()=>{var ft;u();const y=i.indexOf(d),A=(ft=a.get(d))==null?void 0:ft();A&&(m("call effect from setTimeout",d,A.hostElement),y<=n.hostElement.children.length-1?n.hostElement.insertBefore(A.hostElement,n.hostElement.children[y]):n.hostElement.append(A.hostElement))}))})};Promise.resolve().then(()=>E())}),n},$t=e=>{let t=[I("div")],s=!1;return C(()=>{var a,i;const n=e();s=Array.isArray(n);const o=[];o.push(...[n].flat()),o.length===0&&o.push(I("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{m("newReactiveComponent.map",o.map(h=>{var f;return m("newReactiveComponent hostElement",h.hostElement),(f=h.hostElement)==null?void 0:f.id})),m("currComponent[0].hostElement?.id",(a=t[0].hostElement)==null?void 0:a.id,t),(i=t[0].hostElement)==null||i.replaceWith(...o.map(h=>h.hostElement)),t.slice(1).forEach(h=>{var f;return(f=h.hostElement)==null?void 0:f.remove()}),t=o}catch(h){console.error(h)}}),s?t:t[0]},Mt=e=>gt in e,Pt=e=>{const t=W("div")().addStyle({display:"contents"}),s=n=>(t.hostElement.innerHTML=n,t);return typeof e=="string"?s(e):t.addEffect(()=>{s(e())}),t},J=(e,t,s)=>e?O(t):s?O(s):W("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),ct=(e,t,s)=>O(()=>J(!!e(),t,s)),kt=(e,t,s)=>typeof e=="boolean"?J(e,t,s):ct(e,t,s),N=(e,t)=>{const s=O(t);return typeof e=="boolean"?[s].flat().forEach(n=>n.hostElement.style.display=e?"block":"none"):C(()=>{const n=e()?"block":"none";[s].flat().forEach(o=>o.hostElement.style.display=n)}),s},Ht=(e,t,s)=>{const n=[N(e,t)].flat();return s&&n.push(...[N(()=>typeof e=="boolean"?!e:!e(),s)].flat()),O(()=>n)},lt=(e,t)=>{m("createCustomElement",e);const s=document.createElement(e),n=K(s);return s.init=()=>{B(n,t)},n},dt=(e,t)=>{const s=e.split(" ").slice(1).map(o=>o.trim()),n=lt(e.split(" ")[0],t);return Array.isArray(s)&&s.length>0&&n.addClass(...s),(...o)=>{T("@rcreateCustomEl content",e,o);const a=o.filter(Boolean).flat().flatMap(i=>typeof i=="function"&&!v(i)?O(()=>i(n)):i);return n.hostElement.allSlotContent=a,n.hostElement.slotContent=a.filter(j).reduce((i,h)=>{const f=h.hostElement.getAttribute("slot")||"default";return i[f]||(i[f]=[]),i[f].push(h),i},{}),n.hostElement.appendAllSlotContent=()=>P(n,...a),n}},ht=(e,t,s)=>dt(`${e.renderTagName}${t&&typeof t=="string"?" "+t:""}`,S(t)?t:t&&typeof t=="string"?s:void 0),Ft=()=>{const e=()=>{};return e.oldValue=null,e},_t=()=>({}),ut=(e,t,s)=>{const n=t?D(t,s)(e):e;return(o,...a)=>{const i=[...a];return o&&!S(o)&&i.unshift(o),ht(n,S(o)?o:{})(...i)}},Wt=e=>[ut(e),(t,s)=>{D(t,s)(e)}],c={};["div","span","section","input","button","table","tr","td","th","ul","li","ol","form","label","select","option","textarea","img","a","p","h1","h2","h3","h4","h5","h6","br","hr","pre","code","nav","header","footer","main","aside","article","figure","figcaption","blockquote","cite","small","strong","em","b","i","u","s","sub","sup","mark","del","ins","details","summary","progress","meter","audio","video","canvas","slot"].forEach(e=>{c[e]=(t,...s)=>{let n=[...s];return t&&!S(t)&&(n=[t].concat(n)),W(e,S(t)?t:{})(...n)}});const Dt=c.div,Bt=c.span,Vt=c.section,Jt=c.input,Nt=c.button,qt=c.table,zt=c.tr,Gt=c.td,Ut=c.th,Xt=c.ul,Zt=c.li,Qt=c.ol,Yt=c.form,Kt=c.label,xt=c.select,te=c.option,ee=c.textarea,se=c.img,ne=c.a,re=c.p,oe=c.h1,ie=c.h2,ae=c.h3,ce=c.h4,le=c.h5,de=c.h6,he=c.br,ue=c.hr,fe=c.pre,pe=c.code,me=c.nav,Ce=c.header,be=c.footer,Ee=c.main,ye=c.aside,Se=c.article,we=c.figure,ve=c.figcaption,Ae=c.blockquote,ge=c.cite,Le=c.small,Re=c.strong,Oe=c.em,je=c.b,Te=c.i,Ie=c.u,$e=c.s,Me=c.sub,Pe=c.sup,ke=c.mark,He=c.del,Fe=c.ins,_e=c.details,We=c.summary,De=c.progress,Be=c.meter,Ve=c.audio,Je=c.video,Ne=c.canvas,qe=c.slot,ze=e=>t=>e(t).addClass(...t.classList??[]).addReactiveClass(t.reactiveClassList??{});r.BaseElement=g,r.a=ne,r.addAttributeList=at,r.addClassList=rt,r.addCustomAttributes=nt,r.addReactiveClassList=ot,r.addStyleList=it,r.appendContentItem=P,r.article=Se,r.aside=ye,r.audio=Ve,r.b=je,r.bindReactiveSignals=Et,r.blockquote=Ae,r.br=he,r.button=Nt,r.camelToKebab=$,r.canvas=Ne,r.checkCall=k,r.cite=ge,r.classList=tt,r.cls=Tt,r.code=pe,r.colorLog=T,r.combineLatest=St,r.component=D,r.configCustomComponent=Wt,r.createComponent=ze,r.createCustom=ht,r.createCustomEl=dt,r.createCustomElement=lt,r.createEl=W,r.createElement=I,r.createSignal=bt,r.customElementHelpers=K,r.defineSlotTemplate=_t,r.del=He,r.details=_e,r.disableLogs=z,r.div=Dt,r.effect=C,r.elementHelpers=x,r.em=Oe,r.enableLogs=pt,r.event=vt,r.eventEmitter=jt,r.figcaption=ve,r.figure=we,r.footer=be,r.forkJoin=yt,r.form=Yt,r.getList=It,r.getSignalContent=O,r.h1=oe,r.h2=ie,r.h3=ae,r.h4=ce,r.h5=le,r.h6=de,r.header=Ce,r.hr=ue,r.i=Te,r.img=se,r.initComponent=B,r.input=Jt,r.ins=Fe,r.isBaseElement=At,r.isComponentConfig=j,r.isComponentInitConfig=S,r.isReactiveSignal=v,r.isSlotTemplate=Mt,r.kebabToCamel=q,r.label=Kt,r.li=Zt,r.main=Ee,r.mark=ke,r.meter=Be,r.nav=me,r.newEventEmitter=Ft,r.ol=Qt,r.option=te,r.p=re,r.pre=fe,r.progress=De,r.projectLog=m,r.property=wt,r.renderIf=J,r.rs=Ct,r.rxRenderIf=ct,r.s=$e,r.section=Vt,r.select=xt,r.setChildren=st,r.setEffects=et,r.setListeners=V,r.show=Ht,r.showIf=N,r.signal=R,r.signalComponent=$t,r.slot=qe,r.small=Le,r.span=Bt,r.strong=Re,r.sub=Me,r.summary=We,r.sup=Pe,r.table=qt,r.td=Gt,r.textarea=ee,r.th=Ut,r.tr=zt,r.u=Ie,r.ul=Xt,r.unsafeHtml=Pt,r.useCustomComponent=ut,r.video=Je,r.when=kt,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});