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