@reactive-web-components/rwc 2.56.2 → 2.57.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.
- package/main.d.ts +0 -5
- package/package.json +5 -5
- package/reactive-web-component.BPkqbr7j.umd.cjs +2 -0
- package/reactive-web-component.CRH3V4Nf.js +881 -0
- package/shared/utils/clean/component-stack.d.ts +1 -2
- package/shared/utils/signal/signal.d.ts +0 -4
- package/reactive-web-component.B6AmGBMe.js +0 -893
- package/reactive-web-component.D6uktwEQ.umd.cjs +0 -2
package/main.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactive-web-components/rwc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.57.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./shared/index.d.ts",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./shared/index.d.ts",
|
|
9
|
-
"import": "./reactive-web-component.
|
|
10
|
-
"require": "./reactive-web-component.
|
|
9
|
+
"import": "./reactive-web-component.CRH3V4Nf.js",
|
|
10
|
+
"require": "./reactive-web-component.BPkqbr7j.umd.cjs"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"author": "tamazyanarsen",
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"ui",
|
|
35
35
|
"frontend"
|
|
36
36
|
],
|
|
37
|
-
"module": "./reactive-web-component.
|
|
38
|
-
"main": "./reactive-web-component.
|
|
37
|
+
"module": "./reactive-web-component.CRH3V4Nf.js",
|
|
38
|
+
"main": "./reactive-web-component.BPkqbr7j.umd.cjs"
|
|
39
39
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(o,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(o=typeof globalThis<"u"?globalThis:o||self,S(o.ReactiveComponent={}))})(this,function(o){"use strict";var xe=Object.defineProperty;var ts=(o,S,T)=>S in o?xe(o,S,{enumerable:!0,configurable:!0,writable:!0,value:T}):o[S]=T;var f=(o,S,T)=>ts(o,typeof S!="symbol"?S+"":S,T);const S=t=>t&&typeof t=="object"&&("classList"in t||"attributes"in t||"customAttributes"in t||"reactiveClassList"in t||"listeners"in t||"customListeners"in t||"children"in t||"effects"in t||"style"in t||Object.keys(t).some(e=>e.startsWith(".")||e.startsWith("@")||e.startsWith("$")))&&!("hostElement"in t),T=t=>t&&typeof t=="object"&&"hostElement"in t&&"append"in t&&"set"in t&&"addStyle"in t&&"setAttribute"in t&&"addClass"in t&&"addEffect"in t&&"addReactiveContent"in t&&"setReactiveContent"in t&&"clear"in t,_=(t,e,...s)=>{e&&e.apply(t,s)};let F=!0;const b=(...t)=>{F&&console.debug(["[rwc]",...t].join(" | "),...Array.from(t.join("").matchAll(/%c/gm)).map((e,s)=>s%2===0?"color:red":"color:inherit"))},P=t=>t.replace(/([A-Z])/gm,e=>`-${e.toLowerCase()}`),K=t=>t.replace(/-(\w)/gm,(e,s)=>s.toUpperCase()),j=(t,...e)=>{if(!F)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=t.match(/@[rgbpycow]/g)||[],r=n.map(l=>{const c=l.slice(1);return s[c]||"color: inherit"});let i=t;n.forEach(l=>{const c=new RegExp(`\\${l}([^\\s,]+)`,"g");i=i.replace(c,"%c$1")}),console.log(i,...r,...e)},wt=()=>{F=!0},x=()=>{F=!1};x();const I=[];let G=!1;const vt=t=>{G=t},V=new Map,k=[],B=[],g=new WeakMap,A=new WeakMap,J=new WeakMap,q="selfCleanupSet";function L(t,e){let s=(e==null?void 0:e.signalCompareFn)||(()=>!0);function n(){var l,c,u;const i=B[B.length-1];return i&&!("fake"in i&&i.fake)&&(q in i||(i[q]=new Set),i[q].add(()=>{var m;(m=A.get(n))==null||m.delete(i)}),A.has(n)||A.set(n,new Set),(l=A.get(n))==null||l.add(i),J.has(i)||J.set(i,new Set),(c=J.get(i))==null||c.add(n),G&&((u=V.get(i.effectId))==null||u.signals.push(n))),t}let r="";return Object.defineProperty(n,"signalId",{get:()=>r,set:i=>{r=i}}),n.signalId=`${(e==null?void 0:e.name)||""}_${Math.random().toString(36).substring(2,15)}`,n.setName=function(i){return n.signalId=`${i}_${Math.random().toString(36).substring(2,15)}`,n},n.setCompareFn=function(i){return s=i,n},n.clearSubscribers=function(){var i;(i=A.get(n))==null||i.clear()},n.getSubscribers=function(){return A.get(n)},n.peek=function(){return Object.freeze(t)},n.initValue=Object.freeze(t),n.forceSet=function(i){var l;t=i,(l=A.get(n))==null||l.forEach(c=>{var u,m;(u=g.get(c))==null||u.forEach(h=>{h()}),(m=g.get(c))==null||m.clear(),Promise.resolve(c).then(h=>{k.push(h),h(),k.pop()})})},n.set=function(i,l=s){t!==i&&l(t,i)&&n.forceSet(i)},n.update=function(i){n.set(i(t))},n.pipe=(i,l)=>{const c=L(null);return E(()=>{const u=n();E(()=>{const m=i(u);m instanceof Promise?m.then(h=>c.set(h)):y(m)?E(()=>c.set(m())):c.set(m)},l)}),c},n}function E(t,e){var i,l;const s="fake"in t&&t.fake,n=`${(e==null?void 0:e.name)||""}_${Math.random().toString(36).substring(2,15)}`;b("current effect",`%c${n}%c`),t.effectId=n;const r=k[k.length-1];G&&V.set(n,{signals:[],parent:null}),s||k.push(t),B.push(t),t(),s||(i=I[I.length-1])==null||i.call(I,t[q]||new Set),B.pop(),s||k.pop(),r&&(g.has(r)||g.set(r,new Set),(l=g.get(r))==null||l.add(()=>{var u,m;const c=J.get(t);c==null||c.forEach(h=>{var C;(C=A.get(h))==null||C.delete(t)}),(u=g.get(t))==null||u.forEach(h=>h()),(m=g.get(t))==null||m.clear(),g.delete(t)}))}const y=t=>!!t&&["object","function"].includes(typeof t)&&"set"in t&&"update"in t&&"forceSet"in t;function gt(t,...e){const s=L("");return E(()=>{const n=e.map(i=>y(i)?String(i()):String(i)),r=[t[0]];n.forEach((i,l)=>{r.push(i,t[l+1])}),s.set(r.join(""))}),s}function At(t,e){const s=L(e??null),n=r=>s.set(r);return t instanceof Promise?t.then(n):typeof t=="function"&&E(()=>{const r=t();r instanceof Promise?r.then(n):y(r)?E(()=>n(r())):n(r)}),s}function Lt(t,e){let s=t(),n=e();E(()=>{const r=t(),i=e();r!==i&&(r!==s?e.set(r):i!==n&&t.set(i)),s=r,n=i})}function Rt(...t){let e=t.map(n=>n());const s=L(e);return t.forEach((n,r)=>{E(()=>{const i=()=>e.filter(l=>l!==void 0).length;i()===t.length&&(e=Array.from(e).fill(void 0)),e[r]=n(),i()===t.length&&s.set([...e])})}),s}const Tt=(...t)=>{const e=L([]);return E(()=>{e.set(t.map(s=>s()))}),e},D="eventProps",N="EVENT_CONFIG",H="observedAttributes",jt=()=>(t,e)=>{Reflect.get(t,H)||Reflect.defineProperty(t,H,{value:[]}),Reflect.get(t,H).push(P(e))},Ot=t=>(e,s)=>{Reflect.get(e,D)||Reflect.defineProperty(e,D,{value:[]}),Reflect.get(e,N)||Reflect.defineProperty(e,N,{value:{}}),Reflect.get(e,N)[s]={bubbles:(t==null?void 0:t.bubbles)??!1,composed:(t==null?void 0:t.composed)??!1},Reflect.get(e,D).push(s)},U=(t,e=!1)=>s=>{b(t,"start register static attr",s.prototype[H]);const n=[];if(s.styles){const i=s.styles,l=[];Array.isArray(i)?l.push(...i):l.push(i),l.forEach(c=>{const u=new CSSStyleSheet;u.replaceSync(c),n.push(u);const m=new CSSStyleSheet;m.replaceSync(c.slice(c.indexOf("@property"))),document.adoptedStyleSheets.push(m)})}class r extends s{constructor(...c){b("constructor",`%c${t}%c`);super(e,...c);f(this,"effectCleanupHandleEvent",c=>{this.effects.add(c)});f(this,"effects",new Set);j("@osheet",n),n.length>0&&this.shadow.adoptedStyleSheets.push(...n)}render(){return b("rwc: render from new class"),s.prototype.render.call(this)}attributeChangedCallback(c,u,m){b("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${u}, newValue: ${m}`,`%c${t}%c`);try{m=JSON.parse(m)}catch{}const h=K(c);if(h in this&&y(this[h])){const C=this[h];m===null?(C.set(C.initValue),this.removeAttribute(c)):C.set(m)}_(this,s.prototype.attributeChangedCallback,c,u,m)}connectedCallback(){I.push(this.effectCleanupHandleEvent);const c=()=>{var m;b("rwc: connectedCallback"),b("connectedCallback",`%c${t}%c`,this),this.providers&&Object.keys(this.providers).length>0&&(b("WRAPPER for providers",t),Object.entries(this.providers).forEach(([h,C])=>{b("register provider",h,C()),this.addEventListener(h,w=>{var p;b("send provider",h,C());const d=w;((p=d.detail)==null?void 0:p.context)===h&&(d.stopPropagation(),d.detail.callback(C))})})),this.checkInjects(),(m=s.prototype[D])==null||m.forEach(h=>{this[h]=C=>{const w=s.prototype[N][h],{bubbles:d,composed:p}=w;y(C)?E(()=>{j("@oemit reactive value",C()),this.dispatchEvent(new CustomEvent(h,{detail:C(),bubbles:d,composed:p}))}):(j("@oemit value",C),this.dispatchEvent(new CustomEvent(h,{detail:C,bubbles:d,composed:p})))}}),b("start render",`%c${t}%c`,t);const u=()=>{b("rwc: insertRenderTemplate");const h=this.render();this.shadow.appendChild(h.hostElement),_(this,s.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!s.styles){const h=d=>d instanceof Promise||Array.isArray(d)&&d.every(p=>p instanceof Promise),C=this.rootStyle,w=d=>{const p=new CSSStyleSheet;p.replaceSync(d),this.shadow.adoptedStyleSheets.push(p);const v=new CSSStyleSheet;v.replaceSync(d.slice(d.indexOf("@property"))),document.adoptedStyleSheets.push(v)};if(h(C)){const d=[];Array.isArray(C)?d.push(...C):d.push(C),Promise.all(d).then(p=>p.forEach(v=>w(v.default))).then(()=>u())}else{const d=[];Array.isArray(C)?d.push(...C):d.push(C),d.forEach(p=>w(p)),u()}}else u();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(h=>{b(this.slotContext,this.slotContext&&this.slotContext[h.name]),j("@bslot element",h,`name:${h.name};`,h.assignedElements()),h.assignedElements().forEach(C=>{const w=this.slotContext[h.name];this.slotContext&&y(w)&&(j("@oslot element",h,`name:${h.name};`,h.assignedElements()),E(()=>{C.dispatchEvent(new CustomEvent("handleSlotContext",{detail:w()}))}))})})};c.fake=!0,E(c),I.pop()}disconnectedCallback(){this.shadow.replaceChildren(),this.replaceChildren(),_(this,s.prototype.disconnectedCallback),this.effects.forEach(c=>{c.forEach(u=>u())}),this.effects.clear()}}return f(r,"observedAttributes",s.prototype[H]??[]),f(r,"renderTagName",t),r.toString=()=>t,customElements.get(t)?console.error(`название тега ${t} повторяется, компонент ${s.name} не зарегистрирован`):customElements.define(t,r),s.renderTagName=t,s};class O extends HTMLElement{constructor(s=!1){super();f(this,"isSlotLazyLoading",!1);f(this,"slotTemplate");f(this,"slotContext");f(this,"rootStyle");f(this,"modelValue");f(this,"providers");f(this,"appendAllSlotContent");f(this,"allSlotContent",[]);f(this,"slotContent",{});f(this,"htmlSlotContent",{});f(this,"shadow");f(this,"injects",{});this.shadow=this.attachShadow({mode:s?"closed":"open"})}appendChild(s,n=!0){var r;if(this.isSlotLazyLoading&&n){if(s instanceof HTMLElement){const i=s.slot||"default";this.htmlSlotContent[i]||(this.htmlSlotContent[i]=[]),(r=this.htmlSlotContent[i])==null||r.push(s)}}else return super.appendChild(s)}appendSlotContent(){var s;(s=this.appendAllSlotContent)==null||s.call(this)}inject(s){return b("%cinject%c",s),this.injects[s]||(this.injects[s]=L(null)),this.injects[s]}checkInjects(){Object.entries(this.injects).forEach(([s,n])=>{b("%cinject%c",`%c${s}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(s,{detail:{context:s,callback:r=>E(()=>{n.set(r())})},bubbles:!0,composed:!0}))})}setReactiveValue(s){this.modelValue=s}}f(O,"observedAttributes",[]),f(O,"renderTagName",""),f(O,"styles");const Mt=t=>"render"in t&&"setReactiveValue"in t,It="handleSlotContext",tt="onConnected",et=t=>typeof t=="string"?t:JSON.stringify(t),kt=t=>{const e=document.createElement("span");return e.textContent=et(t),e},st=(t,e)=>(t.appendChild(kt(e)),t),$t=(t,e)=>(t.innerHTML="",st(t,e)),nt=t=>{const e=document.createElement("span");return E(()=>{const s=t();e.textContent=et(s)}),e};class ot{constructor(e){f(this,"wrapper");f(this,"hostElement");f(this,"append",(...e)=>(e.forEach(s=>{this.wrapper.appendChild(s.hostElement),tt in s.hostElement&&setTimeout(()=>{var n,r;(r=(n=s.hostElement).onConnected)==null||r.call(n,s,s.hostElement)})}),this));f(this,"set",(...e)=>{this.clear();const s=document.createDocumentFragment();return e.forEach(n=>{s.appendChild(n.hostElement)}),this.wrapper.appendChild(s),this});f(this,"removeChild",(...e)=>(e.forEach(s=>{Array.from(this.wrapper.childNodes.values()).some(n=>n===s.hostElement)&&this.wrapper.removeChild(s.hostElement)}),this));f(this,"addHtmlContent",e=>(st(this.wrapper,e),this));f(this,"setHtmlContent",e=>($t(this.wrapper,e),this));f(this,"setAttribute",(e,s)=>{let n;if(typeof s=="boolean"&&!(this.wrapper instanceof O))if(s)n="";else{this.removeAttribute(e);const r=e.toLowerCase();return r in this.wrapper&&(this.wrapper[r]=null),this}else typeof s!="string"?n=JSON.stringify(s):n=s;if(this.wrapper.setAttribute(P(e),n),!(this.wrapper instanceof O)){const r=e.toLowerCase();r in this.wrapper&&(this.wrapper[r]=s)}return this});f(this,"setCustomAttribute",(e,s)=>{let n;return typeof s!="string"?n=JSON.stringify(s):n=s,this.wrapper.setAttribute(P(e),n),this});f(this,"setReactiveAttribute",(e,s)=>(E(()=>this.setAttribute(e,s())),this));f(this,"setReactiveCustomAttribute",(e,s)=>(E(()=>this.setCustomAttribute(e,s())),this));f(this,"removeAttribute",e=>(this.wrapper.removeAttribute(P(e)),this));f(this,"addStyle",e=>(Object.entries(e).forEach(([s,n])=>{const r=s.startsWith("--");typeof n=="function"?this.addEffect(()=>{if(r){const i=String(n()||"");this.wrapper.style.setProperty(s,i)}else this.wrapper.style[s]=n()}):typeof n=="string"&&(r?this.wrapper.style.setProperty(s,n):this.wrapper.style[s]=n)}),this));f(this,"onConnected",e=>(Reflect.defineProperty(this.wrapper,tt,{get(){return e}}),this));f(this,"addClass",(...e)=>(e.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 r=s();r.length>0&&(n?this.replaceClass(n,r):this.addClass(r),n=r)})})()}),this));f(this,"setClass",(...e)=>(this.wrapper.classList.remove(...this.wrapper.classList),this.wrapper.classList.add(...e),this));f(this,"addReactiveClass",e=>(Object.keys(e).forEach(s=>{E(()=>{e[s]()?this.addClass(s):this.removeClass(s)})}),this));f(this,"removeClass",(...e)=>(this.wrapper.classList.remove(...e),this));f(this,"replaceClass",(e,s)=>(this.wrapper.classList.replace(e,s),this));f(this,"addEffect",e=>(E(()=>e(this,this.hostElement)),this));f(this,"addReactiveContent",e=>(this.wrapper.appendChild(nt(e)),this));f(this,"setReactiveContent",e=>(this.clear(),this.wrapper.appendChild(nt(e)),this));f(this,"clear",()=>(this.wrapper.innerHTML="",this));this.wrapper=e,this.hostElement=e}addEventlistener(e,s,n=!1){return this.wrapper.addEventListener(e,r=>s(r,this,this.wrapper),n),this}}class Pt extends ot{constructor(){super(...arguments);f(this,"setReactiveValue",s=>(this.wrapper instanceof O&&this.wrapper.setReactiveValue(s),this));f(this,"setSlotTemplate",s=>{const n=this.wrapper.slotTemplate;return n&&Object.entries(s).forEach(([r,i])=>{n[r]=i}),this})}}const Ht=()=>()=>{},rt=t=>new Pt(t),it=t=>new ot(t),at=(t,...e)=>({classList:[...t.map(s=>s.trim()).filter(Boolean),...e]}),Wt=(t,...e)=>at(t,...e),X=(t,e)=>{if(!e)return t;const s=Object.keys(e||{}).filter(n=>n.startsWith(".")||n.startsWith("@")||n.startsWith("$"));return s.filter(n=>n.startsWith(".")).forEach(n=>{e!=null&&e.attributes||(e.attributes={}),e.attributes[n.slice(1)]=e[n]}),s.filter(n=>n.startsWith("@")).forEach(n=>{e!=null&&e.listeners||(e.listeners={});const r=n.slice(1);e.listeners[r]=e[n]}),s.filter(n=>n.startsWith("$")).forEach(n=>{e!=null&&e.effects||(e.effects=[]),e.effects.push(e[n])}),dt(t,e.classList),ut(t,e.style),pt(t,e.attributes),ft(t,e.reactiveClassList),ht(t,e.customAttributes),ct(t,e.children),lt(t,e.effects),Z(t,e.listeners),Z(t,e.customListeners),t},Z=(t,e)=>{e&&Object.entries(e).forEach(([s,n])=>{typeof n=="function"&&t.addEventlistener(s,n)})},lt=(t,e)=>e==null?void 0:e.forEach(s=>t.addEffect(s)),ct=(t,e)=>W(t,...e||[]),ht=(t,e)=>{const s=e;s&&Object.keys(s).forEach(n=>{y(s[n])?t.setReactiveCustomAttribute(n,s[n]):typeof s[n]=="function"?t.addEffect(()=>{t.setCustomAttribute(n,s[n]())}):t.setCustomAttribute(n,s[n])})},dt=(t,e)=>t.addClass(...e||[]),ft=(t,e)=>t.addReactiveClass(e||{}),ut=(t,e)=>t.addStyle(e||{}),pt=(t,e)=>{const s=e,n=(r,i)=>{i&&(y(i)?t.setReactiveAttribute(r,i):typeof i=="function"?t.addEffect(()=>{t.setAttribute(r,i())}):t.setAttribute(r,i))};s&&Object.keys(s).forEach(r=>{n(r,s[r])})},W=(t,...e)=>(e.forEach(s=>{typeof s=="string"?s.trim().length>0&&t.addHtmlContent(s):y(s)?t.addReactiveContent(s):t.append(s)}),t),$=(t,e)=>{const s=document.createElement(t),n=it(s);return X(n,e)},z=(t,e)=>{const[s,...n]=t.split(" ").map(i=>i.trim()),r=$(s,e);return n.length>0&&r.addClass(...n),(...i)=>W(r,...i.filter(Boolean).flat().flatMap(l=>typeof l=="function"&&!y(l)?R(()=>l(r)):l))},R=t=>$("div").addStyle({display:"contents"}).addEffect(e=>{const s=t(),n=[];Array.isArray(s)?n.push(...s):n.push(s),e.clear(),W(e,...n)}),_t=(t,e,s)=>{const n=$("div").addStyle({display:"contents"}),r=new Map,i=new Map;let l=[];const c=new Set;let u=t.peek();const m=h=>{c.delete(h),r.delete(h),i.delete(h)};return E(()=>{const h=t();l=h.map(e).map(d=>typeof d=="string"?d:d.toString());const C=Array.from(n.hostElement.children);b("containerChildren",C,l),C.forEach(d=>{const p=d.dataset.key;l.includes(p)||(b("remove element",p,d),d.remove(),m(p))}),l.forEach(d=>{var v,M;const p=h[l.indexOf(d)];r.has(d)?JSON.stringify(p)!==JSON.stringify(u[l.indexOf(d)])&&((v=n.hostElement.querySelector(`[data-key="${d}"]`))==null||v.remove(),(M=r.get(d))==null||M.set(Math.random().toString(36).substring(2,15)),i.set(d,()=>s(p,l.indexOf(d),h).setCustomAttribute("data-key",d))):(b("create new element",d,p),r.set(d,L(Math.random().toString(36).substring(2,15))),i.set(d,()=>s(p,l.indexOf(d),h).setCustomAttribute("data-key",d)))}),u=[...h.map(d=>({...d}))];const w=()=>{r.forEach((d,p)=>{b("key from setTimeout foreach currItemSignalMap",p),c.has(p)||(c.add(p),E(()=>{var yt;d();const v=l.indexOf(p),M=(yt=i.get(p))==null?void 0:yt();M&&(b("call effect from setTimeout",p,M.hostElement),v<=n.hostElement.children.length-1?n.hostElement.insertBefore(M.hostElement,n.hostElement.children[v]):n.hostElement.append(M.hostElement))}))})};Promise.resolve().then(()=>w())}),n},Ft=t=>{let e=[$("div")],s=!1;return E(()=>{var i,l;const n=t();s=Array.isArray(n);const r=[];r.push(...[n].flat()),r.length===0&&r.push($("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{b("newReactiveComponent.map",r.map(c=>{var u;return b("newReactiveComponent hostElement",c.hostElement),(u=c.hostElement)==null?void 0:u.id})),b("currComponent[0].hostElement?.id",(i=e[0].hostElement)==null?void 0:i.id,e),(l=e[0].hostElement)==null||l.replaceWith(...r.map(c=>c.hostElement)),e.slice(1).forEach(c=>{var u;return(u=c.hostElement)==null?void 0:u.remove()}),e=r}catch(c){console.error(c)}}),s?e:e[0]},Bt=t=>It in t,Jt=t=>{const e=z("div")().addStyle({display:"contents"}),s=n=>(e.hostElement.innerHTML=n,e);return typeof t=="string"?s(t):e.addEffect(()=>{s(t())}),e},Q=(t,e,s)=>t?R(e):s?R(s):z("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),mt=(t,e,s)=>R(()=>Q(!!t(),e,s)),qt=(t,e,s)=>typeof t=="boolean"?Q(t,e,s):mt(t,e,s),Y=(t,e)=>{const s=R(e);return typeof t=="boolean"?[s].flat().forEach(n=>n.hostElement.style.display=t?"block":"none"):E(()=>{const n=t()?"block":"none";[s].flat().forEach(r=>r.hostElement.style.display=n)}),s},Dt=(t,e,s)=>{const n=[Y(t,e)].flat();return s&&n.push(...[Y(()=>typeof t=="boolean"?!t:!t(),s)].flat()),R(()=>n)},Ct=(t,e)=>{b("createCustomElement",t);const s=document.createElement(t),n=rt(s);return X(n,e)},bt=(t,e)=>{const s=t.split(" ").slice(1).map(r=>r.trim()),n=Ct(t.split(" ")[0],e);return Array.isArray(s)&&s.length>0&&n.addClass(...s),(...r)=>{j("@rcreateCustomEl content",t,r);const i=r.filter(Boolean).flat().flatMap(l=>typeof l=="function"&&!y(l)?R(()=>l(n)):l);return n.hostElement.allSlotContent=i,n.hostElement.slotContent=i.filter(T).reduce((l,c)=>{const u=c.hostElement.getAttribute("slot")||"default";return l[u]||(l[u]=[]),l[u].push(c),l},{}),n.hostElement.appendAllSlotContent=()=>W(n,...i),n}},Et=(t,e,s)=>bt(`${t.renderTagName}${e&&typeof e=="string"?" "+e:""}`,S(e)?e:e&&typeof e=="string"?s:void 0),Nt=()=>{const t=()=>{};return t.oldValue=null,t},zt=()=>({}),St=(t,e,s)=>{const n=e?U(e,s)(t):t;return(r,...i)=>{const l=[...i];return r&&!S(r)&&l.unshift(r),Et(n,S(r)?r:{})(...l)}},Gt=t=>[St(t),(e,s)=>{U(e,s)(t)}],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(t=>{a[t]=(e,...s)=>{let n=[...s];return e&&!S(e)&&(n=[e].concat(n)),z(t,S(e)?e:{})(...n)}});const Vt=a.div,Ut=a.span,Xt=a.section,Zt=a.input,Qt=a.button,Yt=a.table,Kt=a.tr,xt=a.td,te=a.th,ee=a.ul,se=a.li,ne=a.ol,oe=a.form,re=a.label,ie=a.select,ae=a.option,le=a.textarea,ce=a.img,he=a.a,de=a.p,fe=a.h1,ue=a.h2,pe=a.h3,me=a.h4,Ce=a.h5,be=a.h6,Ee=a.br,Se=a.hr,ye=a.pre,we=a.code,ve=a.nav,ge=a.header,Ae=a.footer,Le=a.main,Re=a.aside,Te=a.article,je=a.figure,Oe=a.figcaption,Me=a.blockquote,Ie=a.cite,ke=a.small,$e=a.strong,Pe=a.em,He=a.b,We=a.i,_e=a.u,Fe=a.s,Be=a.sub,Je=a.sup,qe=a.mark,De=a.del,Ne=a.ins,ze=a.details,Ge=a.summary,Ve=a.progress,Ue=a.meter,Xe=a.audio,Ze=a.video,Qe=a.canvas,Ye=a.slot,Ke=t=>e=>t(e).addClass(...e.classList??[]).addReactiveClass(e.reactiveClassList??{});o.BaseElement=O,o.a=he,o.addAttributeList=pt,o.addClassList=dt,o.addCustomAttributes=ht,o.addReactiveClassList=ft,o.addStyleList=ut,o.appendContentItem=W,o.article=Te,o.aside=Re,o.audio=Xe,o.b=He,o.bindReactiveSignals=Lt,o.blockquote=Me,o.br=Ee,o.button=Qt,o.camelToKebab=P,o.canvas=Qe,o.checkCall=_,o.cite=Ie,o.classList=at,o.cls=Wt,o.code=we,o.colorLog=j,o.combineLatest=Tt,o.component=U,o.configCustomComponent=Gt,o.createComponent=Ke,o.createCustom=Et,o.createCustomEl=bt,o.createCustomElement=Ct,o.createEl=z,o.createElement=$,o.createSignal=At,o.customElementHelpers=rt,o.defineSlotTemplate=zt,o.del=De,o.details=ze,o.disableLogs=x,o.div=Vt,o.effect=E,o.effectMap=V,o.elementHelpers=it,o.em=Pe,o.enableLogs=wt,o.event=Ot,o.eventEmitter=Ht,o.figcaption=Oe,o.figure=je,o.footer=Ae,o.forkJoin=Rt,o.form=oe,o.getList=_t,o.getSignalContent=R,o.h1=fe,o.h2=ue,o.h3=pe,o.h4=me,o.h5=Ce,o.h6=be,o.header=ge,o.hr=Se,o.i=We,o.img=ce,o.initComponent=X,o.input=Zt,o.ins=Ne,o.isBaseElement=Mt,o.isComponentConfig=T,o.isComponentInitConfig=S,o.isReactiveSignal=y,o.isSlotTemplate=Bt,o.kebabToCamel=K,o.label=re,o.li=se,o.main=Le,o.mark=qe,o.meter=Ue,o.nav=ve,o.newEventEmitter=Nt,o.ol=ne,o.option=ae,o.p=de,o.pre=ye,o.progress=Ve,o.projectLog=b,o.property=jt,o.renderIf=Q,o.rs=gt,o.rxRenderIf=mt,o.s=Fe,o.section=Xt,o.select=ie,o.setChildren=ct,o.setEffectDebugEnabled=vt,o.setEffects=lt,o.setListeners=Z,o.show=Dt,o.showIf=Y,o.signal=L,o.signalComponent=Ft,o.slot=Ye,o.small=ke,o.span=Ut,o.strong=$e,o.sub=Be,o.summary=Ge,o.sup=Je,o.table=Yt,o.td=xt,o.textarea=le,o.th=te,o.tr=Kt,o.u=_e,o.ul=ee,o.unsafeHtml=Jt,o.useCustomComponent=St,o.video=Ze,o.when=qt,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|