compelem 0.2.6-beta → 0.3.1-b1
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/CompElem.d.ts +3 -2
- package/constants.d.ts +11 -0
- package/decorators/computed.d.ts +1 -2
- package/decorators/watch.d.ts +1 -8
- package/events/event.d.ts +2 -1
- package/events/extends.d.ts +2 -1
- package/index.js +2 -2
- package/package.json +8 -8
- package/reactive.d.ts +22 -11
- package/types.d.ts +6 -0
package/CompElem.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Directive } from "./directive/Directive";
|
|
|
2
2
|
import { IComponent } from "./IComponent";
|
|
3
3
|
import { IView } from "./render/RenderContext";
|
|
4
4
|
import { Template } from "./render/Template";
|
|
5
|
-
import { TmplFn } from "./types";
|
|
5
|
+
import { DefaultProps, TmplFn } from "./types";
|
|
6
6
|
declare const CompElem_base: {
|
|
7
7
|
new (...args: any[]): {
|
|
8
8
|
[x: string]: any;
|
|
@@ -24,6 +24,7 @@ declare const CompElem_base: {
|
|
|
24
24
|
export declare class CompElem extends CompElem_base implements IComponent {
|
|
25
25
|
#private;
|
|
26
26
|
static __l_globalRule: HTMLStyleElement;
|
|
27
|
+
static defaults(options: DefaultProps): void;
|
|
27
28
|
__events: Record<string, Array<Node | ((e: Event) => void)>[]>;
|
|
28
29
|
get [Symbol.toStringTag](): string;
|
|
29
30
|
get reactiveData(): Record<string, any>;
|
|
@@ -101,7 +102,7 @@ export declare class CompElem extends CompElem_base implements IComponent {
|
|
|
101
102
|
* @param rootStateKey 如果是对象内部属性变更,会返回根属性名
|
|
102
103
|
* @returns
|
|
103
104
|
*/
|
|
104
|
-
_notify(ov: any, chain: string[]):
|
|
105
|
+
_notify(ov: any, chain: string[]): any;
|
|
105
106
|
/**
|
|
106
107
|
* @deprecated
|
|
107
108
|
*/
|
package/constants.d.ts
CHANGED
|
@@ -3,3 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const ChangedMap: WeakMap<WeakKey, any>;
|
|
5
5
|
export declare const EXP_KEY: RegExp;
|
|
6
|
+
export declare enum CollectorType {
|
|
7
|
+
CSS = 1,
|
|
8
|
+
COMPUTED = 2
|
|
9
|
+
}
|
|
10
|
+
export declare enum DecoratorKey {
|
|
11
|
+
PROPS = "__deco_props",
|
|
12
|
+
STATES = "__deco_states",
|
|
13
|
+
COMPUTED = "__deco_computed",
|
|
14
|
+
WATCH = "__deco_watch",
|
|
15
|
+
EVENTS = "__deco_events"
|
|
16
|
+
}
|
package/decorators/computed.d.ts
CHANGED
package/decorators/watch.d.ts
CHANGED
|
@@ -15,12 +15,5 @@ export type WatchOptions = {
|
|
|
15
15
|
*/
|
|
16
16
|
once?: boolean;
|
|
17
17
|
};
|
|
18
|
+
export declare function watch(source: string | string[], options?: WatchOptions): (target: any, name: any) => void;
|
|
18
19
|
export type WatchHandler = (newValue: any, oldValue: any, source: string) => any;
|
|
19
|
-
/**
|
|
20
|
-
* 装饰器
|
|
21
|
-
*/
|
|
22
|
-
export type DecoratorWatch = {
|
|
23
|
-
handler: WatchHandler;
|
|
24
|
-
options: WatchOptions;
|
|
25
|
-
};
|
|
26
|
-
export declare const watch: (source: string | string[], options?: WatchOptions | undefined, handler?: WatchHandler | undefined) => (...metadata: any[]) => any;
|
package/events/event.d.ts
CHANGED
|
@@ -10,4 +10,5 @@ import { CompElem } from "../CompElem";
|
|
|
10
10
|
*
|
|
11
11
|
* 部分修饰符支持参数,使用冒号传参如:throttle:100 / debounce:100
|
|
12
12
|
*************************************************************/
|
|
13
|
-
export
|
|
13
|
+
export type EvHadler = (ev: Event, node: Element) => any;
|
|
14
|
+
export declare function addEvent(fullName: string, cbk: EvHadler, node: Element, component: CompElem): EvHadler;
|
package/events/extends.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { EvHadler } from "./event";
|
|
1
2
|
export declare function isExtEvent(evName: string): boolean;
|
|
2
|
-
export declare function addExtEvent(evName: string, node: Element, cbk:
|
|
3
|
+
export declare function addExtEvent(evName: string, node: Element, cbk: EvHadler, parts: string[]): void;
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* compelem v0.
|
|
2
|
+
* compelem v0.3.1-b1.1739106920
|
|
3
3
|
* A modern, reactive, fast, lightweight and flexible lib for building web components
|
|
4
4
|
* @holyhigh2
|
|
5
5
|
* https://github.com/holyhigh2/compelem
|
|
6
6
|
*/
|
|
7
|
-
import{toPath as e,get as t,isObject as s,isDefined as r,isUndefined as n,isEmpty as i,has as o,concat as a,defaults as l,merge as d,cloneDeep as c,each as h,kebabCase as u,toArray as p,last as f,startsWith as g,isFunction as m,isArray as _,initial as v,isBlank as b,join as C,split as y,set as E,camelCase as N,isEqual as P,replace as T,isPlainObject as S,size as x,assign as w,first as k,isString as A,debounce as M,closest as L,bind as O,isNil as R,trim as D,some as V,isNull as I,fval as $,test as H,omit as j,flatMap as B,groupBy as F,reject as z,filter as U,slice as Q,compact as W,remove as K,includes as X,find as G,throttle as q,once as Y,map as J,replaceAll as Z,snakeCase as ee,toString as te,reduce as se,isMatch as re,clone as ne,findIndex as ie,call as oe}from"myfx";const ae=new WeakMap,le=/\s+\.?key\s*=/;function de(e){console.error("[CompElem]",e)}function ce(e,t){console.error(`[CompElem <${e}>]`,t)}function he(t){return e(t).join("-")}function ue(e){return Object.getPrototypeOf(e)}var pe;!function(e){e.CLASS="class",e.FIELD="field",e.METHOD="method"}(pe||(pe={}));class fe{static get priority(){return 0}}const ge="getKey",me="__decorators",_e=new WeakMap;class ve{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(e,s,r){this.args=e,this.metadata=s,this.decoratorClass=r,this.priority=t(r,"priority",0),this.instanceMap=new WeakMap}create(e){let o,a=new this.decoratorClass(...this.args),l=a.targets,d=this.metadata[2];s(d)&&r(t(d,"configurable"))?o=pe.METHOD:n(this.metadata[2])&&(o=pe.FIELD),!i(l)&&o&&l.includes(o)?(a.created(e,...this.metadata),this.instanceMap.set(e,a)):de(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${l.join(",")}' bug got '${o}'`)}beforeMount(e,t){this.instanceMap.get(e).beforeMount(e,t,...this.metadata)}mounted(e,t){this.instanceMap.get(e).mounted(e,t,...this.metadata)}updated(e,t){this.instanceMap.get(e).updated(e,t)}}const be=new WeakMap;function Ce(e){let s=(...s)=>(...r)=>{let n=r[0].constructor,i=t(n,me);if(!o(n,me)){let e=t(Object.getPrototypeOf(n),me);i=e?a(e):[],Reflect.defineProperty(n,me,{configurable:!1,enumerable:!1,value:i})}let l,d={},c=t(e,ge);if(c){let t=be.get(e);if(t||(t=new WeakMap,be.set(e,t)),d=t.get(n),d||(d={},t.set(n,d)),l=c(...s),d[l])return d[l]}let h=new ve(s,r,e);return d[l]=h,i?.push(h),h};return _e.set(s,!0),s}const ye=new WeakMap;function Ee(e){if(1===arguments.length)return(t,s,r)=>{e.required=e.required||!1,e.attribute=!1!==e.attribute,Ne(t,s,e,r)};let t=arguments[0],s=arguments[1],r=arguments[2];e={type:void 0,required:!1,attribute:!0},r&&"function"==typeof r.type&&(e=l(r,e),r=void 0),Ne(t,s,e,r)}function Ne(e,t,s,r){let n;if(/[a-z]/.test(t[0])||de(`Prop '${t}' must be in CamelCase`),!o(e.constructor,"__deco_props")){const t={};let s=e.constructor;for(;(s=ue(s))!==Ve;)d(t,s.__deco_props?c(s.__deco_props):{});Reflect.defineProperty(e.constructor,"__deco_props",{configurable:!1,enumerable:!1,value:t}),n=new Set,h(t,((e,t)=>{if(e.attribute){let e=u(t);n?.add(e)}})),ye.set(e.constructor,n)}if(r&&(r.get&&(s.getter=r.get),r.set&&(s.setter=r.set)),s.attribute){n||(n=ye.get(e.constructor));let s=u(t);n?.add(s)}o(e.constructor,"observedAttributes")||(e.constructor.observedAttributes=[]),e.constructor.observedAttributes=p(n),e.constructor.__deco_props[t]=s}const Pe=new Set;function Te(e){return ye.get(e)??Pe}const Se={startCss(e){this.__cssCollecting=e},endCss(){this.__cssCollecting=null},setCssUpdater(e){this.__cssUpdater=e},startCompute(e){this.__computeCollecting=e},endCompute(){this.__computeCollecting=null},setComputedProp(e){this.__computeUpdater=e},__computeCollecting:null,__computeUpdater:null,__cssCollecting:null,__cssUpdater:null,__directiveQ:[],setDirectiveQ(e){let t=f(this.__directiveQ);const s=e?e.join(","):"",r=t?t.join(","):"";t&&s===r||(t&&t.length<e.length&&g(s,r)?this.__directiveQ[this.__directiveQ.length-1]=e:this.__directiveQ.push(e))},popDirectiveQ(){let e=a(this.__directiveQ);return this.__directiveQ=[],e},startRender(e){this.__renderCollecting=!0,this.__renderContext=e},endRender(e){this.__renderCollection.forEach((t=>{e._regDeps(t,this.__renderContext)})),this.__renderCollection.clear(),this.__renderCollecting=!1,this.__renderContext=null},collect(e){this.__renderCollection.add(e)},clear(){this.__directiveQ=[]},__renderCollection:new Set,__renderContext:null,__renderCollecting:!1,__skipCheck:!1},xe=new WeakMap,we=new WeakMap,ke=new WeakMap,Ae=new WeakMap;function Me(e,r){if(!s(e))return e;const n=e.__proxy?e:new Proxy(e,{get(e,t,s){if(!t)return;const r=Reflect.get(e,t,s);if((Se.__renderCollecting||Se.__computeCollecting||Se.__cssCollecting)&&e.hasOwnProperty(t)){let e=we.get(s)??[],r=a(e,[t]),n=r.join("-");if(Se.__renderCollecting)Se.collect(he(r)),Se.setDirectiveQ(r);else if(Se.__computeCollecting){let e=ke.get(Se.__computeCollecting);e||(e={},ke.set(Se.__computeCollecting,e));let t=e[n];t||(t=e[n]=[]),t.push(Se.__computeUpdater)}else if(Se.__cssCollecting){let e=Ae.get(Se.__cssCollecting);e||(e={},Ae.set(Se.__cssCollecting,e));let t=e[n];t||(t=e[n]=[]),t.push(Se.__cssUpdater)}}return r},set(e,r,n,o){if(!r)return!1;let l=e[r];if(!s(l)&&l===n)return!0;if(Number.isNaN(n)&&Number.isNaN(l))return!0;let d=we.get(o)??[],c=a(d,[r]),h=xe.get(o).from,u=t(h.constructor,"__deco_props"),p=t(h.constructor,"__deco_states"),f=t(u,[c[0],"hasChanged"])||t(p,[c[0],"hasChanged"]);if(f){if(!f.call(h,n,l))return!0}else if(l===n&&!ae.has(l))return!0;u&&u[r]&&e.__isData&&u[r].sync&&h.emit("update:"+r,{value:n});let g=xe.get(o)?.contextSet,v=n;!s(n)||m(n)||n instanceof Node||Object.isFrozen(n)||g.forEach((e=>{let t=xe.get(o)?.pathMap,s=t?.get(e);s&&(c=a(s,[r]),we.set(v,c),v=Me(v,e),we.set(v,c))}));let b=Reflect.set(e,r,v),C=xe.get(o).pathMap;return g.forEach((e=>{let t=C.get(e);if(!t)return;e===h&&d.length>1&&t.length>1&&d[0]===t[0]&&(t=d),c=a(t,"length"==r&&_(o)?[]:[r]),e._notify(l,c);let s=ke.get(e),n=Ae.get(e);if(s||n){let t=c.length;for(;t;){let r=c.slice(0,t).join("-");if(s){let t=s[r];if(!i(t))for(let s=0;s<t.length;s++){t[s].call(e)}}if(n){let t=n[r];if(!i(t))for(let s=0;s<t.length;s++){t[s].call(e)}}t--}}})),b}});e.__proxy||Reflect.defineProperty(e,"__proxy",{enumerable:!1,writable:!1,configurable:!1,value:!0});let o=we.get(e)??[];if(Object.isExtensible(e)&&!xe.get(n)){let e=new Set;e.add(r);let t=new WeakMap;t.set(r,o),xe.set(n,{from:r,contextSet:e,pathMap:t})}else{xe.get(n).contextSet.add(r);let e=xe.get(n).pathMap,s=e.get(r),i=a(o);if(s&&s.join("")!==i.join("")){let e=t(r,v(s));_(e)||function(...e){console.warn("[CompElem]",...e)}(`The object is referenced by more than one @state '${i.join(".")},${s.join(".")}'`),s=i}else e.set(r,i)}for(let t in e){const n=e[t];!s(n)||n.__proxy||m(n)||n instanceof Node||Object.isFrozen(n)||(we.set(n,a(o,[t])),e[t]=Me(n,r),we.set(e[t],a(o,[t])))}return n}function Le(e){return class extends e{__updatePoints;renderComponent;buildView(e){let t=this instanceof Ve?this:this.renderComponent,[s,r]=Nt(t,e),n=[],i=Mt(n,s,r,t,this);return this.__updatePoints=n,i}updateView(e){if(b(C(e.strings)))return;if(!this.__updatePoints)return;let{vars:r}=e,n=this instanceof Ve?this:this.renderComponent;for(let e=0;e<this.__updatePoints.length;e++){const i=this.__updatePoints[e];let o=i.varIndex,a=i.value,l=r,d=i.node,c=y(o,"-");for(let s=0;s<c.length;s++){const r=c[s];l=t(l,r),l&&l.vars&&e<c.length-1&&(l=l.vars)}if(!s(a)&&a===l)continue;let h=d;if(i.isDirective){if(!a.di)continue;l.di=a.di,l.di.renderParams=l.varChain,l.di._renderArgs=l.args,l.point=a.point,l.varPath=a.varPath,a.update(a.point,l.args,a.args)}else if(i.isToggleProp){if(!!l===a)continue;h.toggleAttribute(i.attrName,!!l),E(h,i.attrName,!!l)}else if(i.isProp){if(!s(l)&&l===a)continue;let e=N(i.attrName),r=t(i.node.constructor,"__deco_props");if(r){let t=r[e];if(t&&t.hasChanged&&!t.hasChanged.call(this,l,a))continue}d instanceof Ve?d._updateProps({[i.attrName]:l}):d instanceof HTMLSlotElement&&n._updateSlot(d.getAttribute("name")||"default",i.attrName,l)}else if(i.attrName&&!i.isEvent){if(!P(a,l))switch(i.attrName){case"value":if(d instanceof HTMLInputElement){d.value=l;break}default:d.setAttribute(i.attrName,T(i.attrTmpl,At,l+""))}}else if(i.isTmpl)(l.strings.join()!==a.tmpl.strings.join()||l.vars.some((e=>s(e)&&!S(e)))||a.tmpl.vars.some((e=>s(e)&&!S(e)))||!P(l.vars,a.tmpl.vars))&&i.value.updateView(l),a.tmpl=l,l=a;else if(i.isText){let e=i.textNode.nextSibling;e&&e===i.node.previousSibling?e.textContent=l:(Lt.remove(i.textNode,i.node),Lt.insertBefore(i.node,[l]))}i.value=l}}}}class Oe extends(Le(Object)){tmpl;constructor(e){super(),this._renderVars=t(e,"_renderVars"),this.tmpl=e}}const Re={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,bigint:BigInt,symbol:Symbol,undefined:Object},De=new WeakMap;class Ve extends(Le(HTMLElement)){static __l_globalRule=document.createElement("style");static{document.head.appendChild(Ve.__l_globalRule)}#e={};#t={"#slots":{}};#s={};#r;#n={};#i;#o;#a={};__events={};get[Symbol.toStringTag](){return this.constructor.name}get reactiveData(){return this.#s}get attrs(){return this.#l}get props(){return this.#d}get renderRoot(){return this.#c}get renderRoots(){return this.#h}get parentComponent(){return this.#u}get slotHooks(){return this.#p}get css(){return De.get(this.constructor)}get isMounted(){return this.#f}get slots(){return this.#t["#slots"]}#l;#d;#c;#h;#u;#g={};#p={};#m={};#f=!1;#_;static get autoSlot(){return!0}static get styles(){return[]}static get globalStyles(){return[]}get styles(){return[]}#v=!1;constructor(...e){super(),1===x(e)&&(this.#d={},w(this.#d,k(e)));let s=this.render.bind(this);this.render=function(){let e;return Se.startRender(this),e=s(),Se.endRender(this),e};const r=Promise.resolve(),n=this.#b.bind(this);this.#_=()=>{r.then(n)};let o=t(this.constructor,"globalStyles"),a=t(this.constructor,"_global_style_attached");if(!i(o)&&"1"!==a){let e="";o.forEach((t=>{A(t)&&(e+=t+"\n")})),Ve.__l_globalRule.textContent+=e,E(this.constructor,"_global_style_attached","1")}let l=De.get(this.constructor),d=l??[];l||(h(t(this.constructor,"styles"),(e=>{if(A(e)){let t=new CSSStyleSheet;t.replaceSync(e),d.push(t)}else d.push(e)})),De.set(this.constructor,d)),this.#i=this.attachShadow({mode:"open",slotAssignment:t(this.constructor,"autoSlot",!0)?"named":"manual"}),this.#i.adoptedStyleSheets=d;let c=this.attributes.getNamedItem("css-link")?.value;if(c){const e=document.createElement("style");e.textContent=`@import "${c}"`,this.#i.appendChild(e)}let u=M(this.#C,20);this.#o=new MutationObserver((e=>{for(let t=0;t<e.length;t++){"childList"===e[t].type&&u.call(this)}})),this._slotsPropMap={default:[]};let p=t(this.constructor,me);p&&p.sort(((e,t)=>t.priority-e.priority)).forEach((e=>e.create(this))),this.#y=M(this.#E,50)}#y;connectedCallback(){let e=L(this.parentNode,(e=>e instanceof Ve||e.host instanceof Ve),"parentNode");this.#u=e?e instanceof Ve?e:e.host:null,this.__init()}disconnectedCallback(){this.#o.disconnect()}__init(){if(this.#v)return;this.#N();const e=this.#P();this.propsReady(e);for(const t in e){const s=e[t];this.#t[t]=s}this.#T(),h(this.#t,((e,t)=>{let s=Reflect.getOwnPropertyDescriptor(this.#t,t);Reflect.defineProperty(this,t,{get(){let e=Reflect.get(this.#s,t);return s?.get?s?.get():e},set(e){s?.set?s?.set(e):Reflect.set(this.#s,t,e)}})})),Reflect.defineProperty(this.#t,"__isData",{enumerable:!1,value:!0}),this.#s=Me(this.#t,this);let s=this.render(),r=this.buildView(s);if(r){let e=p(r);e.forEach((e=>{this.#i.appendChild(e)})),this.#h=e,this.#c=e[0]}this.#C(),this.beforeMount();const n=this;let i=t(this.constructor,me);i&&i.sort(((e,t)=>t.priority-e.priority)).forEach((e=>{e.beforeMount(this,((e,t)=>(n.#s[e]=t,n.#s[e])))}));let o=t(this.constructor,"__deco_computed");h(o,(({key:e,getter:t},s)=>{Se.startCompute(this),Se.setComputedProp((()=>{this.#s[s]=t.call(this)})),this.#t[s]=t.call(this),Se.endCompute()})),h(o,((e,t)=>{Reflect.defineProperty(this,t,{get(){return Reflect.get(this.#s,t)},set(e){ce(this.tagName,"Cannot set a computed property '"+t+"'")}})})),this.#o.observe(this,{childList:!0});let a=t(this.constructor,"__deco_events");a&&a.forEach((e=>{let t=e.name,s=w({target:document,once:!1,passive:!1,capture:!1},e.options),r=O(e.fn,this),n=s.target;m(n)&&(n=n.call(this,this)),n?n.addEventListener(t,r,s):ce(this.tagName,"The target of @event('"+t+"',...) is invalid")})),h(this.#p,((e,t)=>{this.#S(t)})),Se.startCss(this);let l=[];this.styles.forEach((e=>{if(!m(e))return;let t=new CSSStyleSheet;l.push(t),Se.setCssUpdater((()=>{let s=e()??"";t.replaceSync(s)}));let s=e();b(s)||t.replaceSync(s)})),Se.endCss(),this.#i.adoptedStyleSheets=[...this.#i.adoptedStyleSheets,...l],setTimeout((()=>{this.#f=!0,this.mounted(),i&&i.forEach((e=>{e.mounted(this,((e,t)=>(n.#s[e]=t,n.#s[e])))}))}),0),this.#v=!0}propsReady(e){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}#x(e,s){this.#N();let r=t(this.#e[s],"props");r&&h(this.slots,((e,s)=>{e.filter((e=>e.nodeType===Node.ELEMENT_NODE)).forEach((e=>{e instanceof Ve?e._updateProps(r):h(r,((s,r)=>{if(e instanceof HTMLSlotElement){let n=t(e,"__l_comp");if(n){let t=e.name||"default",i=n.#e[t];i||(i=n.#e[t]={props:{}}),i.props||(i.props={}),i.props[r]=s,n.#x(e,t)}}else e.setAttribute(r,s)}))}))})),this.slotChange(e,s)}slotChange(e,t){}attributeChangedCallback(e,t,s){this.#w(e,t,s)}shouldUpdate(e){return!0}updated(e){}emit(e,s={},r){r&&r.event&&(s.event=r.event),s.target=this,this.dispatchEvent(new CustomEvent(e,{bubbles:t(r,"bubbles",!1),composed:t(r,"composed",!1),cancelable:!0,detail:s}))}#k={};on(e,t){this.#k[e]||(this.#k[e]=[]);let s=t.bind(this);this.#k[e].push(s),this.addEventListener(e,s)}#A=[];#M=!1;#b(){this.#M=!1,this.#A.forEach((e=>e())),this.#A=[]}nextTick(e){this.#A.push(e),this.#M||(this.#M=!0,this.#_())}forceUpdate(){h(this.#s,((e,t)=>{this.#n[t]={value:void 0,chain:void 0}})),this.#E()}_notify(e,r){let n=[];for(let i=0;i<r.length;i++){const o=r[i];n.push(o);let a=t(this,n),l=he(n);this.#n[l]={value:a,chain:"slots"===l?["slots"]:n,oldValue:e,end:n.length===r.length},s(a)&&"#"!=l[0]&&ae.set(a,l)}this.#y()}#E(){if(x(this.#n)<1)return;const e=this.#n;this.#n={};let r=t(this.constructor,me);if(r&&r.sort(((e,t)=>t.priority-e.priority)).forEach((t=>{t.updated(this,e)})),!this.shouldUpdate(e))return;let n=new Set;h(e,(({value:e,chain:t,oldValue:s},r)=>{this.#a[r]&&this.#a[r].forEach((e=>{n.add(e)}))})),n.forEach((e=>{if(e===this)this.updateView(this.render());else{let t=e.render(...e._renderArgs?e._renderArgs:[]);t&&e.updateView(t)}})),this.#L.forEach((e=>{this.#S(e)})),this.updated(e),h(e,(({value:e,chain:t,oldValue:r},n)=>{s(e)&&ae.has(e)&&ae.delete(e)}))}#P(){let e=t(this.constructor,"__deco_props"),i=this.attributes,a=this.tagName,l=this.#d,d={};h(i,(({name:t,value:s})=>{if(t[0]===ft||t[0]===gt||t[0]===mt||t===bt||"slot"===t)return;let r=N(t);e&&!e[r]&&(d[t]=s)})),this.#l=this.#l?w(this.#l,d):d;let c={};return h(e,((d,h)=>{let p,f=e[h],g=o(l,h),m=t(this,h);if(!("_defaultValue"in f)&&(f._defaultValue=m,!f.type)){n(m)&&ce(a,"Prop '"+h+"' has neither propType nor defaultValue be used for type inference");let e=typeof m;_(m)&&(e="array");let t=Re[e];f.type=t}if(g)p=R(l[h])?m:l[h];else{p=m;let e=i.getNamedItem(u(h))||i.getNamedItem(gt+u(h));e&&(g=!0,p=e.value)}if(f.required&&!g)return ce(a,"Prop '"+h+"' is required"),!1;p=this.#O(e,h,p);let v=t(e,[h,"getter"]);v&&(v=O(v,this));let b=t(e,[h,"setter"]);b&&(b=O(b,this)),(v||b)&&Reflect.defineProperty(this.#t,h,{set:b||function(e){},get:v}),f.attribute&&r(p)&&!s(p)&&this.setAttribute(u(h),D(p)),this.#t[h]=p,c[h]=p})),Object.seal(c)}#O(e,t,s){let i=e[t];if(!i)return s;let o=i.isValid,a=i.type,l=_(a)?a:[a],d=i.converter,c=s;if(!V(l,(e=>e===String))&&A(c)&&!I(c))try{c=d?d(c):$(c,{html:Ot})}catch(e){ce(this.tagName,`Convert attribute '${t}' error with `+c)}for(let e=0;e<l.length;e++){"Boolean"===l[e].name&&(A(c)&&/(?:^true$)|(?:^false$)/.test(c)?c=$(c):(n(c)||b(c))&&(c=!0))}let h=typeof c,u=!r(c);for(let e=0;e<l.length;e++){const t=l[e];if(H(h,t.name,"i")||c instanceof t||Object.prototype.toString.call(c)===Object.prototype.toString.call(t.prototype)){u=!0;break}}return u||ce(this.tagName,`Invalid prop '${t}'. expected '${l.map((e=>e.name||e))}' but got '${h}'`),o&&(o.call(this,c,this.#t)||ce(this.tagName,`Invalid prop '${t}'. IsValid() check failed`)),c}#T(){let e=t(this.constructor,"__deco_states");h(e,((s,r)=>{let n=e[r],i=t(this,r);if(n){let e=n.prop;i=e?c(this.#t[e]):t(this,r)}this.#t[r]=i}))}#R=M(this.propsReady,100);_setParentProps(e,s){if(this.#v){let r=t(this.constructor,"__deco_props");h(e,((e,t)=>{let s=N(t),n=r[s];if(!n)return;let i=this.#t[s];e=this.#O(r,s,e),n.hasChanged&&!n.hasChanged.call(this,e,i)||(this.#t[s]=e,this._notify(i,[s]))})),w(this.#d,e),w(this.#l,s),this.#R(this.#d)}}_updateProps(e){let s=t(this.constructor,"__deco_props");h(e,((e,t)=>{let r=N(t),n=s[r];if(!n)return;let i=this.#t[r];e=this.#O(s,r,e),n.hasChanged&&!n.hasChanged.call(this,e,i)||(Se.__skipCheck=!0,E(this,r,e),Se.__skipCheck=!1)})),w(this.#d,e),this.#R(this.#d)}_initProps(e,t){this.#d=d(this.#d||{},e),this.#l=d({},t)}_bindSlot(e,t,s){if(this.#g[t]||(this.#g[t]=e,Reflect.defineProperty(e,"__l_comp",{value:this})),e.addEventListener("slotchange",(s=>{this.#v&&this.#x(e,"default"===t?"":t)})),!i(s)){let e=this.#e[t];e||(e=this.#e[t]={}),s.nodeFilter&&(e.filter=s.nodeFilter),e.props=j(s,"nodeFilter")}}_bindSlotHook(e,t){this.#p[e]=t}#L=new Set;_updateSlot(e,t,s){let r=this.#g[e],n=this.#p[e];if(!n&&!r)return;let i=this.#e[e];if(t&&(i.props||(i.props={}),i.props[t]=s),n)this.#L.add(e);else{let e=r.assignedElements({flatten:!0});for(let r=0;r<e.length;r++){e[r].setAttribute(t,s+"")}}}#N(){const e=B(this.childNodes,(e=>e.nodeType===Node.COMMENT_NODE?[]:e instanceof HTMLSlotElement?e.assignedNodes({flatten:!0}):e));let t=F(e,(e=>e.nodeType===Node.TEXT_NODE?"default":e instanceof Element?e.getAttribute("slot")||"default":void 0));if(i(t))return void(i(this.#t["#slots"])||(this.#v?this.#s["#slots"]={}:this.#t["#slots"]={}));h(t,((e,t)=>{if(t){for(;e.length>0;){let t=e[0];if(!(t.nodeType===Node.TEXT_NODE&&b(t.textContent)||t instanceof HTMLSlotElement&&i(t.assignedNodes({flatten:!0}))))break;e.shift()}for(;e.length>0;){let t=f(e);if(!(t.nodeType===Node.TEXT_NODE&&b(t.textContent)||t instanceof HTMLSlotElement&&i(t.assignedNodes({flatten:!0}))))break;e.pop()}}}));let s={};h(t,((e,t)=>{i(e)||(s[t]=e)})),this.#v?this.#s["#slots"]=s:this.#t["#slots"]=s}#S(e){let s=this.#p[e];if(!s)return;let r=this.#e[e];if(!this.#t["#slots"][e])return;this.renderAsync(s,t(r,"props"));const n=this._asyncDirectives.get(s);let o=n?.buildView(s(t(r,"props"))),a=z(p(o),(e=>e.nodeType===Node.COMMENT_NODE));if(a){let t=this.#m[e];if(!i(t))for(let e=0;e<t.length;e++){const s=t[e];s.parentNode?.removeChild(s)}this.#m[e]=a,this.append(...a),this.#L.clear()}}_asyncDirectives=new WeakMap;renderAsync(e,...t){}#C(){i(this.#e)||h(this.slots,((e,t)=>{if(i(e))return;let r=this.#e[t],n=e;if(r){let t=r.filter;if(m(t))n=t(e);else if(s(t)){let s=t.type,r=t.maxCount;if(s){let t=_(s)?s:[s];n=U(e,(e=>V(t,(t=>e instanceof t))))}r>0&&(n=Q(e,0,r))}}if("named"===this.#i.slotAssignment){let t=[];for(let s=0;s<e.length;s++){const r=e[s];n.includes(r)||t.push(r)}for(;t.length>0;){let e=t.pop();e.parentNode?.removeChild(e)}}else this.#g[t].assign(...n);this.#v&&this.#x(this.#g[t],"default"===t?"":t)}))}#w(e,s,r){if(!this.isMounted)return;if(Te(this.constructor).has(e)){let s=N(e);if(I(r)){r=t(this.constructor,"__deco_props")[s]._defaultValue}this._updateProps({[s]:r})}}_regDeps(e,t){let s=this.#a[e];s||(s=this.#a[e]=new Set),s.add(t);let r=e.split("-");if(r.pop(),r.length<1)return;let n=r.join("-");s=this.#a[n],s||(s=this.#a[n]=new Set),s.add(t)}}var Ie,$e,He;!function(e){e.NONE="NONE",e.REMOVE="REMOVE",e.REPLACE="REPLACE",e.UPDATE="UPDATE",e.APPEND="APPEND"}(Ie||(Ie={}));class je{key;varIndex;value;isText=!1;isTmpl=!1;isDirective=!1;node;textNode;isComponent=!1;attrName;attrTmpl;isProp=!1;isToggleProp=!1;isEvent;constructor(e,t,s,r){this.varIndex=e,this.node=t,s&&(this.attrName=s),r&&(this.attrTmpl=r)}}!function(e){e.ATTR="attr",e.PROP="prop",e.TEXT="text",e.CLASS="class",e.STYLE="style",e.SLOT="slot",e.TAG="tag"}($e||($e={}));class Be{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(e,t,s){this.startNode=e,this.attrName=t,this.type=s}setVarIndex(e){this.varIndex=e}getNodes(){let e=this.startNode.nextSibling;if(!this.endNode)return[e];let t=[];for(;e&&e!==this.endNode;)t.push(e),e=e?.nextSibling;return t}}!function(e){e.AFTER_BEGIN="afterbegin"}(He||(He={}));class Fe extends Function{diClass;args;di;varPath;point;slotComponent;varChain;constructor(e,...t){super(),this.diClass=e,this.args=t,this.varChain=Se.popDirectiveQ(),this.di=new this.diClass,this.di.renderParams=this.varChain}checkScope(e){let s=t(this.diClass,"scopes");i(s)||H(s.join(","),e)||de(`Directive '${this.diClass.name}' is out of scopes, expect '${s.join(",")}' bug got '${e}'`)}render(e){let t=this.di;return this.args,t.renderComponent||(t.renderComponent=e),this.di=t,t._renderArgs=this.args,this.di.render(...this.args)}update(e,t,s){let r=this.di.update(e,t,s);if(r===Ie.NONE)return;let n=e.getNodes();if(r===Ie.REMOVE)for(let e=0;e<n.length;e++){const t=n[e];t.parentNode?.removeChild(t)}else if(r===Ie.REPLACE){let s=[];for(let e=0;e<n.length;e++){const t=n[e];t.parentNode?.removeChild(t)}let r=this.di.render(...t),i=this.di.buildView(r);s=p(i);let o=document.createDocumentFragment();o.append(...s),e.endNode.parentNode.insertBefore(o,e.endNode)}else if(r===Ie.UPDATE){let s,r={},o=[],a=[],l=this.di.render(...t);if(l||(l=new Vt([],[])),i(n)){let t=this.di.buildView(l);return void e.startNode.after(...t)}let d={};l instanceof Vt&&l.vars.forEach((e=>{if(e instanceof Vt){const t=e.getKey();d[t]=e,r[t]=!0,a.push(t)}})),n=U(W(n),(e=>e.nodeType===Node.ELEMENT_NODE)),s=U(W(p(s)),(e=>e.nodeType===Node.ELEMENT_NODE));let c={},u="",g={};for(let e=0;e<n.length;e++){let t=n[e],s=t.getAttribute("key");if(s){if(c[s]){u=s;break}c[s]=t,o.push(s),g[s]=!0}}if(u)return void de(`${N(this.diClass.name)} - duplicate key '${u}'`);let m=r;const _=e.startNode.parentNode;let b=[],C=[];if(h(g,((e,t)=>{m[t]||(C.push(t),delete g[t],K(o,t))})),!i(a)){let t="",s=-1,r=[],n=new Map;for(let i=0;i<a.length;i++){const l=a[i];let d=o.findIndex((e=>e===l));if(d>-1&&d!==i){if(s<0||s-d==1){let e=f(r);r.push({nodeId:l,targetId:0===i?He.AFTER_BEGIN:e?e.nodeId:a[i-1]})}else n.set(r.length,{group:r,targetId:""}),r=[],r.push({nodeId:l,targetId:o[d]});s=d}else if(d<0){let s=t?c[t]||e.endNode:e.startNode;b.push({prevNode:s,newkey:l})}t=l}i(n)&&r.length>0&&n.set(r.length,{group:r,targetId:""});let l=n.keys().toArray(),d=l.sort(((e,t)=>e-t));if(l.length>0&&l.length<2){let{group:t}=n.get(d[0]);v(t).forEach((({targetId:t,nodeId:s})=>{let r,n=c[s];t===He.AFTER_BEGIN?(r=e.startNode,r.after(n)):(r=c[t],r.after(n))}))}}b.length>0&&this.#D(b,d,a),b.forEach((t=>{let s=t.newkey,r=this.newNodeMap[s],n=t.prevNode;n===e.endNode?n.before(r):(e.startNode,n.after(r))})),C.forEach((e=>{let t=o.findIndex((t=>t==e));this.#V(t);let s=c[e];s&&s.parentNode&&_.removeChild(s)})),this.di.__updatePoints.forEach((e=>{e.key||(e.key=e.value.tmpl.getKey());const t=a.findIndex((t=>t==e.key));e.varIndex=t})),this.di.updateView(l)}}getDirective(){return this.di}newNodeMap={};#D(e,t,s){const r=[],n=[];e.forEach((e=>{let s=e.newkey;r.push(""),n.push(t[s])})),r.push("");let i=new Vt(r,n),o=this.di.__updatePoints,a=this.di.buildView(i);this.di.__updatePoints.forEach(((e,t)=>{const s=e.value.tmpl.getKey();e.key=s})),this.di.__updatePoints.push(...o),a.forEach((e=>{e instanceof HTMLElement&&(this.newNodeMap[e.getAttribute("key")]=e)}))}#V(e){K(this.di.__updatePoints,((t,s)=>{if(t.varIndex==e)return Lt.remove(t.node,t.textNode),!0}))}}function ze(e){return(...t)=>{let s=null;return t.forEach(((e,r)=>{if(m(e)){let n=e;t[r]=function(...e){let t=s.di;Se.startRender(t);let r=n.call(t.renderComponent,...e);return Se.endRender(t.renderComponent),r}}})),s=new Fe(e,...t),s}}const Ue=["resize","outside","mutate"],Qe=new WeakMap,We=[],Ke=new ResizeObserver((e=>{for(const t of e){const e=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize,s=Array.isArray(t.borderBoxSize)?t.borderBoxSize[0]:t.borderBoxSize;let r=Qe.get(t.target);if(r){r(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:s.inlineSize,h:s.blockSize},contentBox:{w:e.inlineSize,h:e.blockSize}}}))}}}));var Xe;!function(e){e.Child="child",e.Tree="tree",e.Attr="attr",e.Char="char"}(Xe||(Xe={}));const Ge=new WeakMap,qe=new MutationObserver((e=>{for(let t=0;t<e.length;t++){const s=e[t];let r=Ge.get(s.target);if(!r)return;let n={target:s.target},i=null;switch(s.type){case"subtree":n.type=Xe.Tree,i=r[Xe.Tree];break;case"childList":n.type=Xe.Child,n.addedNodes=s.addedNodes,n.removedNodes=s.removedNodes,i=r[Xe.Child];break;case"attributes":n.type=Xe.Attr,n.attributeName=s.attributeName,n.oldValue=s.oldValue,i=r[Xe.Attr];break;case"characterData":n.type=Xe.Char,n.oldValue=s.oldValue,i=r[Xe.Char]}if(i){i(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:n}))}}}));function Ye(e,t,s,r){if("resize"===e)!function(e,t){Qe.has(e)||(Qe.set(e,t),Ke.observe(e))}(t,s);else if("outside"===e){if("mousedown"===r[0])!function(e,t){We.push([e,t])}(t,s)}else"mutate"===e&&function(e,t,s){let r=X(s,"child"),n=X(s,"attr"),i=X(s,"char"),o=X(s,"tree"),a=Ge.get(e);a||(a={},Ge.set(e,a),r&&(a[Xe.Child]=t),n&&(a[Xe.Attr]=t),i&&(a[Xe.Char]=t),o&&(a[Xe.Tree]=t),qe.observe(e,{childList:r,attributes:n,characterData:i,subtree:o}))}(t,s,r)}document.addEventListener("mousedown",(e=>{let t=e.target;We.forEach((([s,r])=>{if(!s.contains(t)){r(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:s,event:e}}))}}))}),!1);const Je=/,|^(debounce:.+)|(debounce$)/,Ze=/,|^(throttle:.+)|(throttle$)/,et="self",tt="stop",st="prevent",rt="once",nt="left",it="right",ot="middle",at="ctrl",lt="alt",dt="shift",ct="meta",ht={esc:"escape"},ut=":";function pt(e,t,s,r){let n,i=e.split("."),o=i.shift(),a=i.includes(rt),l=t;if(n=G(i,(e=>Je.test(e)))){let e=n.split(ut);l=M(l,parseInt(e[1])||100)}if(n=G(i,(e=>Ze.test(e)))){let e=n.split(ut);l=q(l,parseInt(e[1])||100)}if(a&&(l=Y(l)),function(e){return Ue.includes(e)}(o))return Ye(o,s,l,i),l;let d=e=>{if(i.includes(st)&&e.preventDefault(),i.includes(tt)&&e.stopPropagation(),!i.includes(et)||e.target===e.currentTarget){if(e instanceof MouseEvent){if(i.includes(nt)&&0!=e.button)return;if(i.includes(it)&&2!=e.button)return;if(i.includes(ot)&&1!=e.button)return}else if(e instanceof KeyboardEvent){if(K(i,(e=>e==at))[0]&&!e.ctrlKey)return;if(K(i,(e=>e==lt))[0]&&!e.altKey)return;if(K(i,(e=>e==dt))[0]&&!e.shiftKey)return;if(K(i,(e=>e==ct))[0]&&!e.metaKey)return;if(!J(i,(e=>ht[e]||e)).includes(e.key.toLowerCase()))return}l(e)}};s.addEventListener(o,d);let c=r.__events[o];return c||(c=r.__events[o]=[]),c.push([s,d]),d}const ft="@",gt=".",mt="?",_t="*",vt=":",bt="ref",Ct=/[.?-a-z]+\s*=\s*(['"])\s*([^='"]*<\!--c_ui-pl_df-->){2,}.*?\1/ims,yt=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,Et="slot-props";function Nt(e,s){let r="",n=a(s.vars),i=s.strings.length-1,o=s.vars.length-1;for(let n=0;n<=i;n++){const i=s.strings[n];let a=t(s.vars,n,"");if(a&&a.di){let t=a.render(e);if(t instanceof Vt){let[s,r]=Nt(e,t);Reflect.defineProperty(a,"_renderVars",{value:r}),a=Pt+s+Tt}else a=t??wt}else if(a instanceof Vt){let[t,s]=Nt(e,a);Reflect.defineProperty(a,"_renderVars",{value:s}),a=St+t+xt}else a=n>o?"":wt;r+=i+a}let l=r.match(Ct);if(l){return de(`Parse error: attribute value can be set only one interpolation —— \n ${Z(l[0],wt,"${...}")}`),["",n]}let d=0;return r=r.replace(yt,((e,t)=>Z(e,wt,(()=>wt.replace("--\x3e","")+d++)))),r=r.replace(Rt,"$1><").trim(),[r,n]}const Pt="\x3c!--c_ui-pl_di-start--\x3e",Tt="\x3c!--c_ui-pl_di-end--\x3e",St="\x3c!--c_ui-pl_tmpl-start--\x3e",xt="\x3c!--c_ui-pl_tmpl-end--\x3e",wt="\x3c!--c_ui-pl_df--\x3e",kt="\x3c!--c_ui-pl_df",At=/<!--c_ui-pl_df\d*(-->)?/;function Mt(e,s,r,i,a){const l=document.createElement("div");l.innerHTML=s;const d=document.createNodeIterator(l,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let c,h,_=0,v=null,b=[],C=[],y=[],E=[e],P=[],S=[];for(;c=d.nextNode();)if(c instanceof HTMLElement||c instanceof SVGElement){c instanceof Ve?v=c:v?.contains(c)||(v=null);let t={},s=p(c.attributes);for(let n=0;n<s.length;n++){const a=s[n];let{name:l,value:d}=a;if(l===Et){let e=c.getAttribute("name")||"default";if(v){let t=v._slotsPropMap[e];t||(t=v._slotsPropMap[e]=[]),t.push(c)}}if(g(l,kt)){let t=r[_];if(t instanceof Fe){t.checkScope($e.TAG);let s=new Be(c,l.substring(1),$e.TAG);t.point=s,t.di.slotComponent=v,t.di.renderComponent=i;let r=new je(_,c);r.isDirective=!0,r.value=t,r.isComponent=!!v,e.push(r),_++,t.di.created(s,...t.args)}c.removeAttribute(l)}else if(l[0]!==ft)if(l!==bt)if(l[0]!==gt||At.test(d)){if(At.test(d)){let s=r[_],n=new je(_,c,l.replace(/\.|\?|@/,""),d);if(e.push(n),n.isComponent=!!v,l[0]===gt||l[0]===mt||l[0]===_t){if(s instanceof Fe){s.checkScope($e.PROP);let e=new Be(c,l.substring(1),$e.PROP);s.point=e,s.slotComponent=v,n.value=s,n.isDirective=!0,s&&s.di.created(s.point,...s.args)}else if(l[0]===mt)n.isToggleProp=!0,n.value=!!s,n.value&&c.setAttribute(l.substring(1),"");else if(l[0]===_t){n.value=s;let e=l.substring(1);const[t,r]=e.split(vt);let i=t;switch(r){case"camel":i=N(i);break;case"kebab":i=u(i);break;case"snake":i=ee(i)}n.attrName=i,c.setAttribute(i,s)}else if(c instanceof Ve||"SLOT"===c.tagName){let e=N(l.substring(1));e in c||"SLOT"===c.tagName||ce(c.tagName,`Prop '${l}' is not defined in ${c.tagName}`),n.value=s,n.isProp=!0,t[e]=s}else ce(c.tagName,`Prop '${l}' can only be set on a CompElem or a slot`);c.removeAttribute(l),s=""}else{let e;if(n.value=s,s instanceof Fe){let t=$e.ATTR;"class"===l?t=$e.CLASS:"style"===l&&(t=$e.STYLE),s.checkScope(t),n.isDirective=!0;let r=new Be(c,l,t);s.point=r,s.di.slotComponent=v,s.di.renderComponent=i,e=s,s=""}d=T(d,At,s),a.value=d,e&&e.di.created(e.point,...e.args)}_++}}else ce(c.tagName,`Prop '${l}' must be an interpolation`);else{if(At.test(d)){let e=r[_];if(!o(e,"current")){ce(c.tagName,"Ref must be a RefObject");continue}_++,e.current=c}c.removeAttribute(l)}else{let t=e=>{};if(At.test(d)){let s=r[_];if(!m(s)){ce(c.tagName,`Event '${l}' must be a function`);continue}t=s.bind(i);let n=new je(_,c,l.replace(/\.|\?|@/,""),d);n.isComponent=!!v,n.isEvent=!0,e.push(n),_++}t=pt(l.substring(1),t,c,i),c.removeAttribute(l)}}c instanceof Ve?c._initProps(t):c instanceof HTMLSlotElement&&i._bindSlot(c,c.name||"default",t)}else{let s=c,o=`\x3c!--${s.nodeValue}--\x3e`;if(o===Pt){h&&b.push(h),h=s;let t=r[_],n=new je(_,c);n.isComponent=!!v,n.isDirective=!0,n.value=t;let o=v?$e.SLOT:$e.TEXT,a=new Be(h,"",o);t.point=a,t.di.slotComponent=v,t.di.renderComponent=i,C.push(t),e.push(n),y.push(n),e=[],E.push(e),_++,S.push(_),P.push(r),r=t._renderVars,_=0;continue}if(o===Tt){y.pop().textNode=s;let t=C.pop();t.point.endNode=s,t.di.created(t.point,...t.args),h=b.pop(),t.di.__updatePoints=e,E.pop(),e=f(E),r=P.pop(),_=S.pop()}else{if(o===St){h&&b.push(h),h=s;let n=r[_],o=new je(_,c);o.isComponent=!!v,o.isTmpl=!0;let l=f(C);(l&&"ForEach"===t(l,"diClass.name")||"ForEach"==a.constructor.name)&&(o.key=n.getKey()),n=o.value=new Oe(n);let d=v?$e.SLOT:$e.TEXT,u=new Be(h,"",d);n.point=u,n.slotComponent=v,n.renderComponent=i,C.push(n),e.push(o),y.push(o),e=[],E.push(e),_++,S.push(_),P.push(r),r=n._renderVars,_=0;continue}if(o===xt){y.pop().textNode=s;let t=C.pop();t.point.endNode=s,h=b.pop(),t.__updatePoints=e,E.pop(),e=f(E),r=P.pop(),_=S.pop()}}if(o!==wt)continue;let l=new je(_,c);e.push(l),l.isComponent=!!v,l.isText=!0;let d,u=r[_];if(d=document.createComment(`compelem-ui-${_}-child-start`),s.parentNode.insertBefore(d,s),s.nodeValue=`compelem-ui-${_}-child-end`,l.textNode=d,u instanceof Fe){l.isDirective=!0,l.value=u;let e=v?$e.SLOT:$e.TEXT,t=new Be(d,"",e);t.endNode=s,u.point=t,u.di.slotComponent=v,u.di.renderComponent=i,u.di.created(t,...u.args),u=""}else if(u instanceof Vt){l.isTmpl=!0,l.value=u;let[t,s]=Nt(i,u);u=Mt(e,t,s,i,a)}else l.value=u;if(_++,n(u))continue;if(u instanceof NodeList){let e=document.createDocumentFragment();e.append(...u),s.parentNode.insertBefore(e,s)}else if(u instanceof Element)s.parentNode.insertBefore(u,s);else if(D(u)){let e=document.createTextNode(u);s.parentNode.insertBefore(e,s)}}return l.childNodes}const Lt={insertBefore:function(e,t){if(!e.parentNode)return;let s=document.createDocumentFragment();s.append(...t),e.parentNode.insertBefore(s,e)},remove:function(e,t){if(e===t)return void e?.parentNode?.removeChild(e);let s=e.nextSibling;for(;s&&s!==t;)s?.parentNode?.removeChild(s),s=e.nextSibling}};function Ot(e,...t){return new Vt(A(e)?[e]:e,t)}const Rt=/([a-z0-9"'])\s*>\s*</gim;function Dt(e){return{current:e}}class Vt{strings;vars;constructor(e,t){this.strings=a(e),this.vars=t}getKey(){let e=this.vars,t="";return h(this.strings,((s,r)=>{if(le.test(s))return t=te(e[r]),!1})),t}getKeys(){let e=this.vars,t=[];for(let s=0;s<this.strings.length;s++){const r=this.strings[s];if(le.test(r)){let r=te(e[s]);t.push(r)}}return i(t)&&e.forEach((e=>{if(e instanceof Vt){let s=e.getKey();t.push(s)}})),t}append(e){let t=f(this.strings);return e.strings.forEach(((e,s)=>{0!=s?this.strings.push(e):this.strings[this.strings.length-1]=t+e})),this.vars=a(this.vars,e.vars),this}insert(e,t){let s=t.strings.shift();return this.strings[e]+=s,this.strings.splice(e+1,0,...t.strings),this.vars.splice(e,0,...t.vars),this}getHTML(e){let[t,s]=Nt(e,this),r=Mt([],t,s,e,e);return se(r,((e,t)=>e+t.outerHTML),"")}}function It(e,t,s){s.get||de(`Prop '${t}' must be a getter`),o(e.constructor,"__deco_computed")||(e.constructor.__deco_computed=i(e.constructor.__deco_computed)?{}:c(e.constructor.__deco_computed)),e.constructor.__deco_computed[t]={key:t,getter:s.get}}function $t(e,t){return(s,r,n)=>{o(s.constructor,"__deco_events")||(s.constructor.__deco_events=i(s.constructor.__deco_events)?[]:c(s.constructor.__deco_events)),s.constructor.__deco_events.push({name:e,options:t,fn:s[r]})}}var Ht;!function(e){e.ONCE="once",e.UPDATABLE="updatable"}(Ht||(Ht={}));class jt extends fe{static get priority(){return Number.MAX_VALUE}created(e,t,s,...r){}mounted(e,t,...s){}get targets(){return[pe.FIELD]}selector;cache;result;constructor(e,t){super(),this.selector=e,this.cache=t}static getKey(e){return e}getter(e){this.result=e.shadowRoot?.querySelector(this.selector)}beforeMount(e,t,s,r,...n){const i=this;Reflect.defineProperty(e,r,{get:()=>(i.result&&i.cache||i.getter(e),i.result)})}updated(e,t){this.cache===Ht.UPDATABLE&&this.getter(e)}}const Bt=Ce(jt),Ft=Ce(class extends jt{getter(e){this.result=e.shadowRoot?.querySelectorAll(this.selector)}});function zt(e){if(1===arguments.length)return(t,s)=>{Ut(t,s,e)};Ut(arguments[0],arguments[1],{prop:""})}function Ut(e,t,s){if(!o(e.constructor,"__deco_states")){const t={};let s=e.constructor;for(;(s=ue(s))!==Ve;)d(t,s.__deco_states?c(s.__deco_states):{});Reflect.defineProperty(e.constructor,"__deco_states",{configurable:!1,enumerable:!1,value:t})}e.constructor.__deco_states[t]=s}function Qt(e,t,s){Ut(e.prototype,t,s||{prop:""})}function Wt(e){return t=>{if(t){if(t.prototype.hasOwnProperty("attributeChangedCallback")){let e=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,s,r){Ve.prototype.attributeChangedCallback.call(this,t,s,r),e.call(this,t,s,r)}}if(t.prototype.hasOwnProperty("connectedCallback")){let e=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){Ve.prototype.connectedCallback.call(this),e.call(this)}}if(t.prototype.hasOwnProperty("disconnectedCallback")){let e=t.prototype.connectedCallback;t.prototype.disconnectedCallback=function(){Ve.prototype.disconnectedCallback.call(this),e.call(this)}}customElements.define(e,t)}}}const Kt=Ce(class extends fe{created(e,s,r,...n){this.handler||(this.handler=m(r)?r:e[r]),t(this.options,"once",!1)&&(this.handler=Y(this.handler.bind(e)))}beforeMount(e,s,r,n,...i){let o=this.handler,a=t(this.options,"immediate",!1);this.sources.forEach((s=>{let r=t(e,s.replaceAll("-","."));a&&o.call(e,t(e,s),r,s)}))}get targets(){return[pe.METHOD]}sources;options;handler;constructor(e,t,s){super(),this.sources=_(e)?e:[e],this.options=t,this.handler=s}static getKey(e){return _(e)?e.sort().join(""):e}mounted(e,s,r,n,...i){let o=this.handler,a=t(this.options,"immediate",!1);this.sources.forEach((s=>{let r=t(e,s.replaceAll("-","."));a||o.call(e,t(e,s),r,s)}))}updated(e,s){this.sources.forEach((r=>{h(s,(({value:s,chain:n,oldValue:i,end:o},a)=>{let l=r.replaceAll(".","-");if(!g(a,l))return;a===l&&o&&this.handler&&this.handler.call(e,s,i,a);let d=n.length-1;for(;d;){let s=n.slice(0,d);if(o&&s.join("-")===l&&t(this.options,"deep")){let r=t(e,s);this.handler.call(e,r,r,s.join("-"))}d--}}))}))}});class Xt extends(Le(Object)){_renderArgs;static get scopes(){return[]}renderParams}const Gt=["key"];const qt=ze(class extends Xt{created(e,t){let s=e.startNode;if(s instanceof Ve){let e={},r={};h(t,((t,n)=>{Gt.includes(n)||(n in s?e[n]=t:r[n]=t+"")})),s._initProps(e,r)}else h(t,((e,t)=>{s.setAttribute(t,e)}))}update(e,t,s){return Ie.NONE}static get scopes(){return[$e.TAG]}render(e){}});const Yt=ze(class extends Xt{created(e,t){let r=[];_(t)?r=W(t):s(t)?r=B(t,((e,t)=>e?t:[])):A(t)&&(r=t.split(" "));let n=e.startNode;h(this.lastCls,(e=>{n.classList.remove(e)})),h(r,(e=>{n.classList.add(e)})),this.lastCls=a(r)}update(e,t,s){return this.created(e,t[0]),Ie.NONE}static get scopes(){return[$e.CLASS]}lastCls;render(e){}});const Jt=ze(class extends Xt{created(e,...t){}update(e,t,s){if(i(e.getNodes())&&(!t||i(t[0])))return Ie.NONE;if(re(this.lastAry,t[0])&&this.lastAry.length===t[0].length)return Ie.NONE;if(!i(this.renderParams)){let e=f(this.renderParams);_(e)||(e=[e]),this.renderParams=e}return this.lastAry=ne(t[0]),Ie.UPDATE}constructor(e){super(),i(this.renderParams)||(this.renderParams=p(f(this.renderParams)))}static get scopes(){return[$e.TEXT,$e.SLOT]}lastAry;lastRenderTmpl;render(e,t){let s=J(e,((e,s)=>t(e,s)));if(s.length<1)return this.lastRenderTmpl=new Vt([],[]),this.lastRenderTmpl;let r=[],n=[];const i=[],o=[];for(let e=0;e<s.length;e++){const t=s[e];let a=f(n),l=t.vars,d=!0,c=t.strings;for(let e=0;e<c.length;e++){const t=c[e];if(le.test(t)){let t=l[e]+"";if(r.includes(t))return void de(`forEach - duplicate key '${t}'`);r.push(t),d=!1}0==e&&a?n[n.length-1]=a+t:n.push(t)}if(d)return void de("forEach - missing 'key' prop");let h=f(i);h&&c.length>0&&(i[i.length-1]=D(h)+c.shift()),i.push(""),o.push(t)}return this.lastAry=ne(e),i.push(""),this.lastRenderTmpl=new Vt(i,o),this.lastRenderTmpl}});const Zt=ze(class extends Xt{created(e,...t){}ifNodes;elseNodes;static get scopes(){return[$e.TEXT,$e.SLOT]}update(e,t,s){return!!t[0]==!!s[0]?Ie.NONE:(t[0],Ie.REPLACE)}render(e,t,s){return e?t(e):s(e)}});const es=ze(class extends Xt{created(e,...t){}static get scopes(){return[$e.TEXT,$e.SLOT]}update(e,t,s){return t[0]===s[0]?Ie.NONE:t[0]?Ie.REPLACE:Ie.REMOVE}render(e,t){return e?t():Ot``}});var ts;!function(e){e.CHANGE="change",e.INPUT="input"}(ts||(ts={}));const ss=ze(class extends Xt{created(r,n,i){this.modelPath||(this.modelPath=f(this.renderParams)),i&&(this.modelPath=e(i));const o=r.startNode;if("binded"!==t(o,"_model"))if(s(n)||D(n)||(n=""),o instanceof Ve)o._initProps({value:n}),o.addEventListener("update:value",(e=>{E(this.renderComponent,this.modelPath,e.detail.value)})),E(o,"_model","binded");else if(o instanceof HTMLTextAreaElement)o.setAttribute("value",n+""),o.addEventListener("input",(e=>{let t=e.target;E(this.renderComponent,this.modelPath,t.value)})),E(o,"_model","binded");else if(o instanceof HTMLInputElement){let e="",t="";switch(o.type){case"checkbox":case"radio":e="checked",t="change";break;default:e="value",t="input"}o.setAttribute(e,n+""),o.addEventListener(t,(e=>{let t=e.target;E(this.renderComponent,this.modelPath,t.value)})),E(o,"_model","binded")}else o instanceof HTMLSelectElement&&(o.setAttribute("value",n+""),o.addEventListener("change",(e=>{let t=e.target;E(this.renderComponent,this.modelPath,t.value)})),E(o,"_model","binded"))}update(e,t,s){if(this.modelPath||(this.modelPath=f(this.renderParams)),!P(t,s)){const s=e.startNode;if(s instanceof Ve)s._updateProps({value:t[0]});else if(s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement)s.setAttribute("value",t[0]+"");else if(s instanceof HTMLInputElement)switch(s.type){case"checkbox":case"radio":t[0]?s.setAttribute("checked",""):s.removeAttribute("checked");break;default:s.setAttribute("value",t[0]+"")}}return Ie.NONE}static get scopes(){return[$e.TAG]}modelPath;render(e,t){}});const rs=ze(class extends Xt{created(e,t){let s=e.startNode;n(this.display)&&(this.display=s.style.display),this.renderComponent.nextTick((()=>{s.style.display=t?this.display:"none"}))}update(e,t,s){return this.created(e,t[0]),Ie.NONE}display=void 0;static get scopes(){return[$e.TAG]}constructor(e){super(),this.point=e}render(e){}});const ns=ze(class extends Xt{created(e,t,s){t=t.bind(this.renderComponent),this.slotComponent._bindSlotHook(s||"default",t)}update(e,t,s){return Ie.NONE}static get scopes(){return[$e.SLOT]}render(e,t){}});class is{static getCssText(e){return A(e)?e:C(J(e,((e,t)=>u(t)+":"+e)),";")}static setStyle(e,t){if(A(e)&&!D(e))return{};let s=is.getCssText(e),r={};return h(s.split(";"),(e=>{let s=e.split(":"),n=D(s[0]),i=D(s[1]);r[n]=t.style.getPropertyValue(n),t.style.setProperty(n,i)})),r}}const os=ze(class extends Xt{created(e,t){is.setStyle(t,e.startNode)}update(e,t,s){return this.created(e,t[0]),Ie.NONE}constructor(e){super(),this.point=e}static get scopes(){return[$e.STYLE]}render(e){}});const as=ze(class extends Xt{created(e,t){this.modelPath||(this.modelPath=f(this.renderParams));const s=e.startNode;let r=e.attrName;s._initProps({[r]:t}),s.addEventListener("update:"+r,(e=>{E(this.renderComponent,this.modelPath,e.detail.value)}))}update(e,t,s){if(!P(t,s)){const s=e.startNode;let r=e.attrName;s._updateProps({[r]:t[0]})}return Ie.NONE}static get scopes(){return[$e.PROP]}modelPath;constructor(e){super()}render(e){}});const ls=ze(class extends Xt{created(e,...t){}static get scopes(){return[$e.TEXT,$e.SLOT]}update(e,t,s){return P(t,s)?Ie.NONE:Ie.REPLACE}render(e,t){let s=()=>Ot``,r=[],n=[];h(t,((e,t)=>{if(m(e))r.push(t),n.push(e);else{let t=e[0],s=e[1];r.push(t),n.push(s)}"default"===t&&(s=e)}));let i=ie(r,(t=>m(t)?t(e):t==e));return oe(n[i]??s)}});export{Ve as CompElem,is as CssHelper,fe as Decorator,pe as DecoratorType,ve as DecoratorWrapper,Xt as Directive,Ie as DirectiveUpdateTag,Fe as DirectiveWrapper,Be as EnterPoint,$e as EnterPointType,ge as GetKeyFnName,ts as ModelTriggerType,Ht as QueryCache,Vt as Template,je as UpdatePoint,_e as _DecoratorMap,me as _DecoratorsKey,Te as _getObservedAttrs,qt as bind,Nt as buildHTML,Yt as classes,It as computed,Dt as createRef,Ce as decorator,ze as directive,$t as event,Jt as forEach,Ot as html,Zt as ifElse,es as ifTrue,Qt as makeState,ss as model,Ee as prop,Bt as query,Ft as queryAll,rs as show,ns as slot,zt as state,os as styles,as as sync,Wt as tag,Kt as watch,ls as when};
|
|
7
|
+
import{toPath as t,get as e,isObject as s,isDefined as r,isUndefined as n,isEmpty as i,has as o,concat as a,defaults as l,merge as c,cloneDeep as d,each as h,kebabCase as u,toArray as p,last as f,startsWith as g,isFunction as m,isArray as _,initial as E,isBlank as b,join as v,split as C,set as y,camelCase as S,isEqual as N,replace as T,isPlainObject as P,flatMap as x,isString as w,test as A,size as M,assign as O,first as k,debounce as R,closest as L,once as D,bind as V,isNil as H,trim as I,some as $,isNull as W,fval as j,omit as U,groupBy as B,reject as z,filter as F,slice as K,compact as Q,remove as X,includes as G,find as q,throttle as Y,map as Z,replaceAll as J,snakeCase as tt,toString as et,reduce as st,isMatch as rt,clone as nt,findIndex as it,call as ot}from"myfx";const at=new WeakMap,lt=/\s+\.?key\s*=/;var ct,dt,ht;function ut(t){console.error("[CompElem]",t)}function pt(t,e){console.error(`[CompElem <${t}>]`,e)}function ft(e){return t(e).join("-")}function gt(t){return Object.getPrototypeOf(t)}!function(t){t[t.CSS=1]="CSS",t[t.COMPUTED=2]="COMPUTED"}(ct||(ct={})),function(t){t.PROPS="__deco_props",t.STATES="__deco_states",t.COMPUTED="__deco_computed",t.WATCH="__deco_watch",t.EVENTS="__deco_events"}(dt||(dt={})),function(t){t.CLASS="class",t.FIELD="field",t.METHOD="method"}(ht||(ht={}));class mt{static get priority(){return 0}}const _t="getKey",Et="__decorators",bt=new WeakMap;class vt{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(t,s,r){this.args=t,this.metadata=s,this.decoratorClass=r,this.priority=e(r,"priority",0),this.instanceMap=new WeakMap}create(t){let o,a=new this.decoratorClass(...this.args),l=a.targets,c=this.metadata[2];s(c)&&r(e(c,"configurable"))?o=ht.METHOD:n(this.metadata[2])&&(o=ht.FIELD),!i(l)&&o&&l.includes(o)?(a.created(t,...this.metadata),this.instanceMap.set(t,a)):ut(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${l.join(",")}' bug got '${o}'`)}beforeMount(t,e){this.instanceMap.get(t).beforeMount(t,e,...this.metadata)}mounted(t,e){this.instanceMap.get(t).mounted(t,e,...this.metadata)}updated(t,e){this.instanceMap.get(t).updated(t,e)}}const Ct=new WeakMap;function yt(t){let s=(...s)=>(...r)=>{let n=r[0].constructor,i=e(n,Et);if(!o(n,Et)){let t=e(Object.getPrototypeOf(n),Et);i=t?a(t):[],Reflect.defineProperty(n,Et,{configurable:!1,enumerable:!1,value:i})}let l,c={},d=e(t,_t);if(d){let e=Ct.get(t);if(e||(e=new WeakMap,Ct.set(t,e)),c=e.get(n),c||(c={},e.set(n,c)),l=d(...s),c[l])return c[l]}let h=new vt(s,r,t);return c[l]=h,i?.push(h),h};return bt.set(s,!0),s}const St=new WeakMap;function Nt(t){if(1===arguments.length)return(e,s,r)=>{t.required=t.required||!1,t.attribute=!1!==t.attribute,Tt(e,s,t,r)};let e=arguments[0],s=arguments[1],r=arguments[2];t={type:void 0,required:!1,attribute:!0},r&&"function"==typeof r.type&&(t=l(r,t),r=void 0),Tt(e,s,t,r)}function Tt(t,e,s,r){let n;if(/[a-z]/.test(e[0])||ut(`Prop '${e}' must be in CamelCase`),!o(t.constructor,dt.PROPS)){const e={};let s=t.constructor;for(;(s=gt(s))!==jt;)c(e,s[dt.PROPS]?d(s[dt.PROPS]):{});Reflect.defineProperty(t.constructor,dt.PROPS,{configurable:!1,enumerable:!1,value:e}),n=new Set,h(e,((t,e)=>{if(t.attribute){let t=u(e);n?.add(t)}})),St.set(t.constructor,n)}if(r&&(r.get&&(s.getter=r.get),r.set&&(s.setter=r.set)),s.attribute){n||(n=St.get(t.constructor));let s=u(e);n?.add(s)}o(t.constructor,"observedAttributes")||(t.constructor.observedAttributes=[]),t.constructor.observedAttributes=p(n),t.constructor[dt.PROPS][e]=s}const Pt=new Set;function xt(t){return St.get(t)??Pt}const wt={collectWatch(t,e,s){let r=Rt.get(t);r||(r={},Rt.set(t,r));let n=r[s];n||(n=r[s]=[]),n.push(e)},startCollect(t,e){this.__collectType=e,this.__collecting=t},setUpdater(t){this.__updater=t},endCollect(){this.__collecting=null},__directiveQ:[],setDirectiveQ(t){let e=f(this.__directiveQ);const s=t?t.join(","):"",r=e?e.join(","):"";e&&s===r||(e&&e.length<t.length&&g(s,r)?this.__directiveQ[this.__directiveQ.length-1]=t:this.__directiveQ.push(t))},popDirectiveQ(){let t=a(this.__directiveQ);return this.__directiveQ=[],t},startRender(t){this.__renderCollecting=!0,this.__renderContext=t},endRender(t){this.__renderCollection.forEach((e=>{t._regDeps(e,this.__renderContext)})),this.__renderCollection.clear(),this.__renderCollecting=!1,this.__renderContext=null},collect(t){this.__renderCollection.add(t)},clear(){this.__directiveQ=[]},__updater:null,__collecting:null,__collectType:-1,__renderCollection:new Set,__renderContext:null,__renderCollecting:!1,__skipCheck:!1},At=new WeakMap,Mt=new WeakMap,Ot=new WeakMap,kt=new WeakMap,Rt=new WeakMap;function Lt(t,r){if(!s(t))return t;const n=t.__proxy?t:new Proxy(t,{get(t,e,s){if(!e)return;const r=Reflect.get(t,e,s);if("string"!=typeof e&&"number"!=typeof e)return r;let n=e in t;if((wt.__renderCollecting||wt.__collecting)&&(n&&t.hasOwnProperty(e)||!n)){let t=Mt.get(s)??[],r=a(t,[e]),n=r.join("-");if(wt.__renderCollecting)wt.collect(ft(r)),wt.setDirectiveQ(r);else if(wt.__collecting){let t;switch(wt.__collectType){case ct.COMPUTED:t=Ot.get(wt.__collecting),t||(t={},Ot.set(wt.__collecting,t));break;case ct.CSS:t=kt.get(wt.__collecting),t||(t={},kt.set(wt.__collecting,t))}let e=t[n];e||(e=t[n]=[]),e.push(wt.__updater)}}return r},set(t,r,n,o){if(!r)return!1;let l=t[r];if(!s(l)&&l===n)return!0;if(Number.isNaN(n)&&Number.isNaN(l))return!0;let c=Mt.get(o)??[],d=a(c,[r]),h=At.get(o).from,u=e(h.constructor,dt.PROPS),p=e(h.constructor,dt.STATES),f=e(u,[d[0],"hasChanged"])||e(p,[d[0],"hasChanged"]);if(f){if(!f.call(h,n,l))return!0}else if(l===n&&!at.has(l))return!0;u&&u[r]&&t.__isData&&u[r].sync&&h.emit("update:"+r,{value:n});let g=At.get(o)?.contextSet,E=n;!s(n)||m(n)||n instanceof Node||Object.isFrozen(n)||g.forEach((t=>{let e=At.get(o)?.pathMap,s=e?.get(t);s&&(d=a(s,[r]),Mt.set(E,d),E=Lt(E,t),Mt.set(E,d))}));let b=Reflect.set(t,r,E),v=At.get(o).pathMap;return g.forEach((t=>{let s=v.get(t);if(!s)return;t===h&&c.length>1&&s.length>1&&c[0]===s[0]&&(s=c),d=a(s,"length"==r&&_(o)?[]:[r]);let n=Ot.get(t),u=kt.get(t),p=Rt.get(t);if(n||u||p){let t=d.length;for(;t;){let s=d.slice(0,t).join("-");if(p){const r=p[s];t===d.length?r?.forEach((t=>{let e=t();e.ov=l,Dt.pushWatch(e)})):r?.forEach((t=>{let s=t();e(s,"deep")&&(s.ov=l,Dt.pushWatch(s))}))}if(n){let t=n[s];if(!i(t))for(let e=0;e<t.length;e++){const s=t[e];Dt.pushComputed(s)}}if(u){let t=u[s];if(!i(t))for(let e=0;e<t.length;e++){const s=t[e];Dt.pushCss(s)}}t--}}let f=t._notify(l,d);Dt.pushNext(f)})),b}});t.__proxy||Reflect.defineProperty(t,"__proxy",{enumerable:!1,writable:!1,configurable:!1,value:!0});let o=Mt.get(t)??[];if(Object.isExtensible(t)&&!At.get(n)){let t=new Set;t.add(r);let e=new WeakMap;e.set(r,o),At.set(n,{from:r,contextSet:t,pathMap:e})}else{At.get(n).contextSet.add(r);let t=At.get(n).pathMap,s=t.get(r),i=a(o);if(s&&s.join("")!==i.join("")){let t=e(r,E(s));_(t)||function(...t){console.warn("[CompElem]",...t)}(`The object is referenced by more than one @state '${i.join(".")},${s.join(".")}'`),s=i}else t.set(r,i)}for(let e in t){const n=t[e];!s(n)||n.__proxy||m(n)||n instanceof Node||Object.isFrozen(n)||(Mt.set(n,a(o,[e])),t[e]=Lt(n,r),Mt.set(t[e],a(o,[e])))}return n}class Dt{static watchSet=new Set;static computedSet=new Set;static cssSet=new Set;static nextSet=new Set;static nextPending=!1;static next;static{const t=Promise.resolve(),e=Dt.flush;Dt.next=()=>{t.then(e)}}static flush(){Dt.nextPending=!1;let t=Array.from(Dt.watchSet);Dt.watchSet.clear();let s=Array.from(Dt.computedSet);Dt.computedSet.clear();let r=Array.from(Dt.cssSet);Dt.cssSet.clear();let n=Array.from(Dt.nextSet);Dt.nextSet.clear(),t.forEach((t=>t(e(t,"ov")))),s.forEach((t=>t())),r.forEach((t=>t())),n.forEach((t=>t()))}static pushWatch(t){Dt.watchSet.add(t)}static pushComputed(t){Dt.computedSet.add(t)}static pushCss(t){Dt.cssSet.add(t)}static pushNext(t){Dt.nextSet.add(t),Dt.nextPending||(Dt.nextPending=!0,Dt.next())}}function Vt(t){return class extends t{__updatePoints;renderComponent;buildView(t){let e=this instanceof jt?this:this.renderComponent,[s,r]=we(e,t),n=[],i=Ve(n,s,r,e,this);return this.__updatePoints=n,i}updateView(t){if(b(v(t.strings)))return;if(!this.__updatePoints)return;let{vars:r}=t,n=this instanceof jt?this:this.renderComponent;for(let t=0;t<this.__updatePoints.length;t++){const i=this.__updatePoints[t];let o=i.varIndex,a=i.value,l=r,c=i.node,d=C(o,"-");for(let s=0;s<d.length;s++){const r=d[s];l=e(l,r),l&&l.vars&&t<d.length-1&&(l=l.vars)}if(!s(a)&&a===l)continue;let h=c;if(i.isDirective){if(!a.di)continue;l.di=a.di,l.di.renderParams=l.varChain,l.di._renderArgs=l.args,l.point=a.point,l.varPath=a.varPath,a.update(a.point,l.args,a.args)}else if(i.isToggleProp){if(!!l===a)continue;h.toggleAttribute(i.attrName,!!l),y(h,i.attrName,!!l)}else if(i.isProp){if(!s(l)&&l===a)continue;let t=S(i.attrName),r=e(i.node.constructor,dt.PROPS);if(r){let e=r[t];if(e&&e.hasChanged&&!e.hasChanged.call(this,l,a))continue}c instanceof jt?c._updateProps({[i.attrName]:l}):c instanceof HTMLSlotElement&&n._updateSlot(c.getAttribute("name")||"default",i.attrName,l)}else if(i.attrName&&!i.isEvent){if(!N(a,l))switch(i.attrName){case"value":if(c instanceof HTMLInputElement){c.value=l;break}default:c.setAttribute(i.attrName,T(i.attrTmpl,De,l+""))}}else if(i.isTmpl)(l.strings.join()!==a.tmpl.strings.join()||l.vars.some((t=>s(t)&&!P(t)))||a.tmpl.vars.some((t=>s(t)&&!P(t)))||!N(l.vars,a.tmpl.vars))&&i.value.updateView(l),a.tmpl=l,l=a;else if(i.isText){let t=i.textNode.nextSibling;t&&t===i.node.previousSibling?t.textContent=l:(He.remove(i.textNode,i.node),He.insertBefore(i.node,[l]))}i.value=l}}}}class Ht extends(Vt(Object)){tmpl;constructor(t){super(),this._renderVars=e(t,"_renderVars"),this.tmpl=t}}const It={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,bigint:BigInt,symbol:Symbol,undefined:Object},$t=new WeakMap;let Wt=[];class jt extends(Vt(HTMLElement)){static __l_globalRule=document.createElement("style");static{document.head.appendChild(jt.__l_globalRule)}static defaults(t){Wt=x(t.css,(t=>{if(w(t)){let e=new CSSStyleSheet;return e.replaceSync(t),e}return t instanceof CSSStyleSheet?t:[]})),t.global,h(t,((t,e)=>{A(e[0],/[A-Z]/)}))}#t={};#e={"#slots":{}};#s={};#r={};#n;#i;#o={};__events={};get[Symbol.toStringTag](){return this.constructor.name}get reactiveData(){return this.#s}get attrs(){return this.#a}get props(){return this.#l}get renderRoot(){return this.#c}get renderRoots(){return this.#d}get parentComponent(){return this.#h}get slotHooks(){return this.#u}get css(){return $t.get(this.constructor)}get isMounted(){return this.#p}get slots(){return this.#e["#slots"]}#a;#l;#c;#d;#h;#f={};#u={};#g={};#p=!1;static get autoSlot(){return!0}static get styles(){return[]}static get globalStyles(){return[]}get styles(){return[]}#m=!1;constructor(...t){super(),1===M(t)&&(this.#l={},O(this.#l,k(t)));let s=this.render.bind(this);this.render=function(){let t;return wt.startRender(this),t=s(),wt.endRender(this),t};let r=e(this.constructor,"globalStyles"),n=e(this.constructor,"_global_style_attached");if(!i(r)&&"1"!==n){let t="";r.forEach((e=>{w(e)&&(t+=e+"\n")})),jt.__l_globalRule.textContent+=t,y(this.constructor,"_global_style_attached","1")}let o=$t.get(this.constructor),a=o??[];o||(h(e(this.constructor,"styles"),(t=>{if(w(t)){let e=new CSSStyleSheet;e.replaceSync(t),a.push(e)}else a.push(t)})),$t.set(this.constructor,a)),this.#n=this.attachShadow({mode:"open",slotAssignment:e(this.constructor,"autoSlot",!0)?"named":"manual"}),this.#n.adoptedStyleSheets=[...Wt,...a];let l=this.attributes.getNamedItem("css-link")?.value;if(l){const t=document.createElement("style");t.textContent=`@import "${l}"`,this.#n.appendChild(t)}let c=R(this.#_,20);this.#i=new MutationObserver((t=>{for(let e=0;e<t.length;e++){"childList"===t[e].type&&c.call(this)}})),this._slotsPropMap={default:[]};let d=e(this.constructor,Et);d&&d.sort(((t,e)=>e.priority-t.priority)).forEach((t=>t.create(this))),this.#E=this.#b.bind(this)}#E;connectedCallback(){let t=L(this.parentNode,(t=>t instanceof jt||t.host instanceof jt),"parentNode");this.#h=t?t instanceof jt?t:t.host:null,this.__init()}disconnectedCallback(){this.#i.disconnect()}__init(){if(this.#m)return;this.#v();const t=this.#C();this.propsReady(t);for(const e in t){const s=t[e];this.#e[e]=s}this.#y(),h(this.#e,((t,e)=>{let s=Reflect.getOwnPropertyDescriptor(this.#e,e);Reflect.defineProperty(this,e,{get(){let t=Reflect.get(this.#s,e);return s?.get?s?.get():t},set(t){s?.set?s?.set(t):Reflect.set(this.#s,e,t)}})})),Reflect.defineProperty(this.#e,"__isData",{enumerable:!1,value:!0}),this.#s=Lt(this.#e,this);let s=this.render(),r=this.buildView(s);if(r){let t=p(r);t.forEach((t=>{this.#n.appendChild(t)})),this.#d=t,this.#c=t[0]}this.#_(),this.beforeMount(),this.#i.observe(this,{childList:!0});const n=this;let i=e(this.constructor,Et);i&&i.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.beforeMount(this,((t,e)=>(n.#s[t]=e,n.#s[t])))}));let o=e(this.constructor,dt.WATCH);h(o,((t,s)=>{t.forEach((t=>{let{source:r,options:n,handler:i}=t,o=i.bind(this);e(n,"once",!1)&&(o=D(o));const a=function(t){let s=e(this,r.replaceAll("-","."));o(s,t,r)}.bind(this);let l=e(n,"deep",!1);if(a.deep=l,wt.collectWatch(this,(()=>a),s),!e(n,"immediate",!1))return;let c=e(this,r.replaceAll("-","."));o(c,c,r)}))}));let a=e(this.constructor,dt.COMPUTED);h(a,((t,e)=>{wt.startCollect(this,ct.COMPUTED),wt.setUpdater((()=>{this.#s[e]=t.call(this)})),this.#e[e]=t.call(this),wt.endCollect(),Reflect.defineProperty(this,e,{get(){return Reflect.get(this.#s,e)},set(t){pt(this.tagName,"Cannot set a computed property '"+e+"'")}})}));let l=e(this.constructor,dt.EVENTS);l&&l.forEach((t=>{let e=t.name,s=O({target:document,once:!1,passive:!1,capture:!1},t.options),r=V(t.fn,this),n=s.target;m(n)&&(n=n.call(this,this)),n?n.addEventListener(e,r,s):pt(this.tagName,"The target of @event('"+e+"',...) is invalid")})),h(this.#u,((t,e)=>{this.#S(e)})),wt.startCollect(this,ct.CSS);let c=[];this.styles.forEach((t=>{if(!m(t))return;let e=new CSSStyleSheet;c.push(e),wt.setUpdater((()=>{let s=t()??"";e.replaceSync(s)}));let s=t();b(s)||e.replaceSync(s)})),wt.endCollect(),this.#n.adoptedStyleSheets=[...this.#n.adoptedStyleSheets,...c],setTimeout((()=>{this.#p=!0,this.mounted(),i&&i.forEach((t=>{t.mounted(this,((t,e)=>(n.#s[t]=e,n.#s[t])))}))}),0),this.#m=!0}propsReady(t){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}#N(t,s){this.#v();let r=e(this.#t[s],"props");r&&h(this.slots,((t,s)=>{t.filter((t=>t.nodeType===Node.ELEMENT_NODE)).forEach((t=>{t instanceof jt?t._updateProps(r):h(r,((s,r)=>{if(t instanceof HTMLSlotElement){let n=e(t,"__l_comp");if(n){let e=t.name||"default",i=n.#t[e];i||(i=n.#t[e]={props:{}}),i.props||(i.props={}),i.props[r]=s,n.#N(t,e)}}else t.setAttribute(r,s)}))}))})),this.slotChange(t,s)}slotChange(t,e){}attributeChangedCallback(t,e,s){this.#T(t,e,s)}shouldUpdate(t){return!0}updated(t){}emit(t,s={},r){r&&r.event&&(s.event=r.event),s.target=this,this.dispatchEvent(new CustomEvent(t,{bubbles:e(r,"bubbles",!1),composed:e(r,"composed",!1),cancelable:!0,detail:s}))}#P={};on(t,e){this.#P[t]||(this.#P[t]=[]);let s=e.bind(this);this.#P[t].push(s),this.addEventListener(t,s)}nextTick(t){Dt.pushNext(t)}forceUpdate(){h(this.#s,((t,e)=>{this.#r[e]={value:void 0,chain:void 0}})),this.#b()}_notify(t,r){let n=[];for(let i=0;i<r.length;i++){const o=r[i];n.push(o);let a=e(this,n),l=ft(n);this.#r[l]={value:a,chain:"slots"===l?["slots"]:n,oldValue:t,end:n.length===r.length},s(a)&&"#"!=l[0]&&at.set(a,l)}return this.#E}#b(){if(M(this.#r)<1)return;const t=this.#r;this.#r={};let r=e(this.constructor,Et);if(r&&r.sort(((t,e)=>e.priority-t.priority)).forEach((e=>{e.updated(this,t)})),!this.shouldUpdate(t))return;let n=new Set;h(t,(({value:t,chain:e,oldValue:s},r)=>{this.#o[r]&&this.#o[r].forEach((t=>{n.add(t)}))})),n.forEach((t=>{if(t===this)this.updateView(this.render());else{let e=t.render(...t._renderArgs?t._renderArgs:[]);e&&t.updateView(e)}})),this.#x.forEach((t=>{this.#S(t)})),this.updated(t),h(t,(({value:t,chain:e,oldValue:r},n)=>{s(t)&&at.has(t)&&at.delete(t)}))}#C(){let t=e(this.constructor,dt.PROPS),i=this.attributes,a=this.tagName,l=this.#l,c={};h(i,(({name:e,value:s})=>{if(e[0]===be||e[0]===ve||e[0]===Ce||e===Ne||"slot"===e)return;let r=S(e);t&&!t[r]&&(c[e]=s)})),this.#a=this.#a?O(this.#a,c):c;let d={};return h(t,((c,h)=>{let p,f=t[h],g=o(l,h),m=e(this,h);if(!("_defaultValue"in f)&&(f._defaultValue=m,!f.type)){n(m)&&pt(a,"Prop '"+h+"' has neither propType nor defaultValue be used for type inference");let t=typeof m;_(m)&&(t="array");let e=It[t];f.type=e}if(g)p=H(l[h])?m:l[h];else{p=m;let t=i.getNamedItem(u(h))||i.getNamedItem(ve+u(h));t&&(g=!0,p=t.value)}if(f.required&&!g)return pt(a,"Prop '"+h+"' is required"),!1;p=this.#w(t,h,p);let E=e(t,[h,"getter"]);E&&(E=V(E,this));let b=e(t,[h,"setter"]);b&&(b=V(b,this)),(E||b)&&Reflect.defineProperty(this.#e,h,{set:b||function(t){},get:E}),f.attribute&&r(p)&&!s(p)&&this.setAttribute(u(h),I(p)),this.#e[h]=p,d[h]=p})),Object.seal(d)}#w(t,e,s){let i=t[e];if(!i)return s;let o=i.isValid,a=i.type,l=_(a)?a:[a],c=i.converter,d=s;if(!$(l,(t=>t===String))&&w(d)&&!W(d))try{d=c?c(d):j(d,{html:Ie})}catch(t){pt(this.tagName,`Convert attribute '${e}' error with `+d)}for(let t=0;t<l.length;t++){"Boolean"===l[t].name&&(w(d)&&/(?:^true$)|(?:^false$)/.test(d)?d=j(d):(n(d)||b(d))&&(d=!0))}let h=typeof d,u=!r(d);for(let t=0;t<l.length;t++){const e=l[t];if(A(h,e.name,"i")||d instanceof e||Object.prototype.toString.call(d)===Object.prototype.toString.call(e.prototype)){u=!0;break}}return u||pt(this.tagName,`Invalid prop '${e}'. expected '${l.map((t=>t.name||t))}' but got '${h}'`),o&&(o.call(this,d,this.#e)||pt(this.tagName,`Invalid prop '${e}'. IsValid() check failed`)),d}#y(){let t=e(this.constructor,dt.STATES);h(t,((s,r)=>{let n=t[r],i=e(this,r);if(n){let t=n.prop;i=t?d(this.#e[t]):e(this,r)}this.#e[r]=i}))}#A=R(this.propsReady,100);_setParentProps(t,s){if(this.#m){let r=e(this.constructor,dt.PROPS);h(t,((t,e)=>{let s=S(e),n=r[s];if(!n)return;let i=this.#e[s];t=this.#w(r,s,t),n.hasChanged&&!n.hasChanged.call(this,t,i)||(this.#e[s]=t,this._notify(i,[s]))})),O(this.#l,t),O(this.#a,s),this.#A(this.#l)}}_updateProps(t){let s=e(this.constructor,dt.PROPS);h(t,((t,e)=>{let r=S(e),n=s[r];if(!n)return;let i=this.#e[r];t=this.#w(s,r,t),n.hasChanged&&!n.hasChanged.call(this,t,i)||(wt.__skipCheck=!0,y(this,r,t),wt.__skipCheck=!1)})),O(this.#l,t),this.#A(this.#l)}_initProps(t,e){this.#l=c(this.#l||{},t),this.#a=c({},e)}_bindSlot(t,e,s){if(this.#f[e]||(this.#f[e]=t,Reflect.defineProperty(t,"__l_comp",{value:this})),t.addEventListener("slotchange",(s=>{this.#m&&this.#N(t,"default"===e?"":e)})),!i(s)){let t=this.#t[e];t||(t=this.#t[e]={}),s.nodeFilter&&(t.filter=s.nodeFilter),t.props=U(s,"nodeFilter")}}_bindSlotHook(t,e){this.#u[t]=e}#x=new Set;_updateSlot(t,e,s){let r=this.#f[t],n=this.#u[t];if(!n&&!r)return;let i=this.#t[t];if(e&&(i.props||(i.props={}),i.props[e]=s),n)this.#x.add(t);else{let t=r.assignedElements({flatten:!0});for(let r=0;r<t.length;r++){t[r].setAttribute(e,s+"")}}}#v(){const t=x(this.childNodes,(t=>t.nodeType===Node.COMMENT_NODE?[]:t instanceof HTMLSlotElement?t.assignedNodes({flatten:!0}):t));let e=B(t,(t=>t.nodeType===Node.TEXT_NODE?"default":t instanceof Element?t.getAttribute("slot")||"default":void 0));if(i(e))return void(i(this.#e["#slots"])||(this.#m?this.#s["#slots"]={}:this.#e["#slots"]={}));h(e,((t,e)=>{if(e){for(;t.length>0;){let e=t[0];if(!(e.nodeType===Node.TEXT_NODE&&b(e.textContent)||e instanceof HTMLSlotElement&&i(e.assignedNodes({flatten:!0}))))break;t.shift()}for(;t.length>0;){let e=f(t);if(!(e.nodeType===Node.TEXT_NODE&&b(e.textContent)||e instanceof HTMLSlotElement&&i(e.assignedNodes({flatten:!0}))))break;t.pop()}}}));let s={};h(e,((t,e)=>{i(t)||(s[e]=t)})),this.#m?this.#s["#slots"]=s:this.#e["#slots"]=s}#S(t){let s=this.#u[t];if(!s)return;let r=this.#t[t];if(!this.#e["#slots"][t])return;this.renderAsync(s,e(r,"props"));const n=this._asyncDirectives.get(s);let o=n?.buildView(s(e(r,"props"))),a=z(p(o),(t=>t.nodeType===Node.COMMENT_NODE));if(a){let e=this.#g[t];if(!i(e))for(let t=0;t<e.length;t++){const s=e[t];s.parentNode?.removeChild(s)}this.#g[t]=a,this.append(...a),this.#x.clear()}}_asyncDirectives=new WeakMap;renderAsync(t,...e){}#_(){i(this.#t)||h(this.slots,((t,e)=>{if(i(t))return;let r=this.#t[e],n=t;if(r){let e=r.filter;if(m(e))n=e(t);else if(s(e)){let s=e.type,r=e.maxCount;if(s){let e=_(s)?s:[s];n=F(t,(t=>$(e,(e=>t instanceof e))))}r>0&&(n=K(t,0,r))}}if("named"===this.#n.slotAssignment){let e=[];for(let s=0;s<t.length;s++){const r=t[s];n.includes(r)||e.push(r)}for(;e.length>0;){let t=e.pop();t.parentNode?.removeChild(t)}}else this.#f[e].assign(...n);this.#m&&this.#N(this.#f[e],"default"===e?"":e)}))}#T(t,s,r){if(!this.isMounted)return;if(xt(this.constructor).has(t)){let s=S(t);if(W(r)){r=e(this.constructor,dt.PROPS)[s]._defaultValue}this._updateProps({[s]:r})}}_regDeps(t,e){let s=this.#o[t];s||(s=this.#o[t]=new Set),s.add(e);let r=t.split("-");if(r.pop(),r.length<1)return;let n=r.join("-");s=this.#o[n],s||(s=this.#o[n]=new Set),s.add(e)}}var Ut,Bt,zt;!function(t){t.NONE="NONE",t.REMOVE="REMOVE",t.REPLACE="REPLACE",t.UPDATE="UPDATE",t.APPEND="APPEND"}(Ut||(Ut={}));class Ft{key;varIndex;value;isText=!1;isTmpl=!1;isDirective=!1;node;textNode;isComponent=!1;attrName;attrTmpl;isProp=!1;isToggleProp=!1;isEvent;constructor(t,e,s,r){this.varIndex=t,this.node=e,s&&(this.attrName=s),r&&(this.attrTmpl=r)}}!function(t){t.ATTR="attr",t.PROP="prop",t.TEXT="text",t.CLASS="class",t.STYLE="style",t.SLOT="slot",t.TAG="tag"}(Bt||(Bt={}));class Kt{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(t,e,s){this.startNode=t,this.attrName=e,this.type=s}setVarIndex(t){this.varIndex=t}getNodes(){let t=this.startNode.nextSibling;if(!this.endNode)return[t];let e=[];for(;t&&t!==this.endNode;)e.push(t),t=t?.nextSibling;return e}}!function(t){t.AFTER_BEGIN="afterbegin"}(zt||(zt={}));class Qt extends Function{diClass;args;di;varPath;point;slotComponent;varChain;constructor(t,...e){super(),this.diClass=t,this.args=e,this.varChain=wt.popDirectiveQ(),this.di=new this.diClass,this.di.renderParams=this.varChain}checkScope(t){let s=e(this.diClass,"scopes");i(s)||A(s.join(","),t)||ut(`Directive '${this.diClass.name}' is out of scopes, expect '${s.join(",")}' bug got '${t}'`)}render(t){let e=this.di;return this.args,e.renderComponent||(e.renderComponent=t),this.di=e,e._renderArgs=this.args,this.di.render(...this.args)}update(t,e,s){let r=this.di.update(t,e,s);if(r===Ut.NONE)return;let n=t.getNodes();if(r===Ut.REMOVE)for(let t=0;t<n.length;t++){const e=n[t];e.parentNode?.removeChild(e)}else if(r===Ut.REPLACE){let s=[];for(let t=0;t<n.length;t++){const e=n[t];e.parentNode?.removeChild(e)}let r=this.di.render(...e),i=this.di.buildView(r);s=p(i);let o=document.createDocumentFragment();o.append(...s),t.endNode.parentNode.insertBefore(o,t.endNode)}else if(r===Ut.UPDATE){let s,r={},o=[],a=[],l=this.di.render(...e);if(l||(l=new je([],[])),i(n)){let e=this.di.buildView(l);return void t.startNode.after(...e)}let c={};l instanceof je&&l.vars.forEach((t=>{if(t instanceof je){const e=t.getKey();c[e]=t,r[e]=!0,a.push(e)}})),n=F(Q(n),(t=>t.nodeType===Node.ELEMENT_NODE)),s=F(Q(p(s)),(t=>t.nodeType===Node.ELEMENT_NODE));let d={},u="",g={};for(let t=0;t<n.length;t++){let e=n[t],s=e.getAttribute("key");if(s){if(d[s]){u=s;break}d[s]=e,o.push(s),g[s]=!0}}if(u)return void ut(`${S(this.diClass.name)} - duplicate key '${u}'`);let m=r;const _=t.startNode.parentNode;let b=[],v=[];if(h(g,((t,e)=>{m[e]||(v.push(e),delete g[e],X(o,e))})),!i(a)){let e="",s=-1,r=[],n=new Map;for(let i=0;i<a.length;i++){const l=a[i];let c=o.findIndex((t=>t===l));if(c>-1&&c!==i){if(s<0||s-c==1){let t=f(r);r.push({nodeId:l,targetId:0===i?zt.AFTER_BEGIN:t?t.nodeId:a[i-1]})}else n.set(r.length,{group:r,targetId:""}),r=[],r.push({nodeId:l,targetId:o[c]});s=c}else if(c<0){let s=e?d[e]||t.endNode:t.startNode;b.push({prevNode:s,newkey:l})}e=l}i(n)&&r.length>0&&n.set(r.length,{group:r,targetId:""});let l=n.keys().toArray(),c=l.sort(((t,e)=>t-e));if(l.length>0&&l.length<2){let{group:e}=n.get(c[0]);E(e).forEach((({targetId:e,nodeId:s})=>{let r,n=d[s];e===zt.AFTER_BEGIN?(r=t.startNode,r.after(n)):(r=d[e],r.after(n))}))}}b.length>0&&this.#M(b,c,a),b.forEach((e=>{let s=e.newkey,r=this.newNodeMap[s],n=e.prevNode;n===t.endNode?n.before(r):(t.startNode,n.after(r))})),v.forEach((t=>{let e=o.findIndex((e=>e==t));this.#O(e);let s=d[t];s&&s.parentNode&&_.removeChild(s)})),this.di.__updatePoints.forEach((t=>{t.key||(t.key=t.value.tmpl.getKey());const e=a.findIndex((e=>e==t.key));t.varIndex=e})),this.di.updateView(l)}}getDirective(){return this.di}newNodeMap={};#M(t,e,s){const r=[],n=[];t.forEach((t=>{let s=t.newkey;r.push(""),n.push(e[s])})),r.push("");let i=new je(r,n),o=this.di.__updatePoints,a=this.di.buildView(i);this.di.__updatePoints.forEach(((t,e)=>{const s=t.value.tmpl.getKey();t.key=s})),this.di.__updatePoints.push(...o),a.forEach((t=>{t instanceof HTMLElement&&(this.newNodeMap[t.getAttribute("key")]=t)}))}#O(t){X(this.di.__updatePoints,((e,s)=>{if(e.varIndex==t)return He.remove(e.node,e.textNode),!0}))}}function Xt(t){return(...e)=>{let s=null;return e.forEach(((t,r)=>{if(m(t)){let n=t;e[r]=function(...t){let e=s.di;wt.startRender(e);let r=n.call(e.renderComponent,...t);return wt.endRender(e.renderComponent),r}}})),s=new Qt(t,...e),s}}const Gt=["resize","outside","mutate"],qt=new WeakMap,Yt=[],Zt=new ResizeObserver((t=>{for(const e of t){const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize,s=Array.isArray(e.borderBoxSize)?e.borderBoxSize[0]:e.borderBoxSize;let r=qt.get(e.target);if(r){r(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:s.inlineSize,h:s.blockSize},contentBox:{w:t.inlineSize,h:t.blockSize}}}),e.target)}}}));var Jt;!function(t){t.Child="child",t.Tree="tree",t.Attr="attr",t.Char="char"}(Jt||(Jt={}));const te=new WeakMap,ee=new MutationObserver((t=>{for(let e=0;e<t.length;e++){const s=t[e];let r=te.get(s.target);if(!r)return;let n={target:s.target},i=null;switch(s.type){case"subtree":n.type=Jt.Tree,i=r[Jt.Tree];break;case"childList":n.type=Jt.Child,n.addedNodes=s.addedNodes,n.removedNodes=s.removedNodes,i=r[Jt.Child];break;case"attributes":n.type=Jt.Attr,n.attributeName=s.attributeName,n.oldValue=s.oldValue,i=r[Jt.Attr];break;case"characterData":n.type=Jt.Char,n.oldValue=s.oldValue,i=r[Jt.Char]}if(i){i(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:n}),s.target)}}}));function se(t,e,s,r){if("resize"===t)!function(t,e){qt.has(t)||(qt.set(t,e),Zt.observe(t))}(e,s);else if("outside"===t){if("mousedown"===r[0])!function(t,e){Yt.push([t,e])}(e,s)}else"mutate"===t&&function(t,e,s){let r=G(s,"child"),n=G(s,"attr"),i=G(s,"char"),o=G(s,"tree"),a=te.get(t);a||(a={},te.set(t,a),r&&(a[Jt.Child]=e),n&&(a[Jt.Attr]=e),i&&(a[Jt.Char]=e),o&&(a[Jt.Tree]=e),ee.observe(t,{childList:r,attributes:n,characterData:i,subtree:o}))}(e,s,r)}document.addEventListener("mousedown",(t=>{let e=t.target;Yt.forEach((([s,r])=>{if(!s.contains(e)){r(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:s,event:t}}),s)}}))}),!1);const re=/,|^(debounce:.+)|(debounce$)/,ne=/,|^(throttle:.+)|(throttle$)/,ie="self",oe="stop",ae="prevent",le="once",ce="left",de="right",he="middle",ue="ctrl",pe="alt",fe="shift",ge="meta",me={esc:"escape"},_e=":";function Ee(t,e,s,r){let n,i=t.split("."),o=i.shift(),a=i.includes(le),l=e;if(n=q(i,(t=>re.test(t)))){let t=n.split(_e);l=R(l,parseInt(t[1])||100)}if(n=q(i,(t=>ne.test(t)))){let t=n.split(_e);l=Y(l,parseInt(t[1])||100)}if(a&&(l=D(l)),function(t){return Gt.includes(t)}(o))return se(o,s,l,i),l;let c=t=>{if(i.includes(ae)&&t.preventDefault(),i.includes(oe)&&t.stopPropagation(),!i.includes(ie)||t.target===t.currentTarget){if(t instanceof MouseEvent){if(i.includes(ce)&&0!=t.button)return;if(i.includes(de)&&2!=t.button)return;if(i.includes(he)&&1!=t.button)return}else if(t instanceof KeyboardEvent){if(X(i,(t=>t==ue))[0]&&!t.ctrlKey)return;if(X(i,(t=>t==pe))[0]&&!t.altKey)return;if(X(i,(t=>t==fe))[0]&&!t.shiftKey)return;if(X(i,(t=>t==ge))[0]&&!t.metaKey)return;if(!Z(i,(t=>me[t]||t)).includes(t.key.toLowerCase()))return}l(t,s)}};s.addEventListener(o,c);let d=r.__events[o];return d||(d=r.__events[o]=[]),d.push([s,c]),c}const be="@",ve=".",Ce="?",ye="*",Se=":",Ne="ref",Te=/[.?-a-z]+\s*=\s*(['"])\s*([^='"]*<\!--c_ui-pl_df-->){2,}.*?\1/ims,Pe=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,xe="slot-props";function we(t,s){let r="",n=a(s.vars),i=s.strings.length-1,o=s.vars.length-1;for(let n=0;n<=i;n++){const i=s.strings[n];let a=e(s.vars,n,"");if(a&&a.di){let e=a.render(t);if(e instanceof je){let[s,r]=we(t,e);Reflect.defineProperty(a,"_renderVars",{value:r}),a=Ae+s+Me}else a=e??Re}else if(a instanceof je){let[e,s]=we(t,a);Reflect.defineProperty(a,"_renderVars",{value:s}),a=Oe+e+ke}else a=n>o?"":Re;r+=i+a}let l=r.match(Te);if(l){return ut(`Parse error: attribute value can be set only one interpolation —— \n ${J(l[0],Re,"${...}")}`),["",n]}let c=0;return r=r.replace(Pe,((t,e)=>J(t,Re,(()=>Re.replace("--\x3e","")+c++)))),r=r.replace($e,"$1><").trim(),[r,n]}const Ae="\x3c!--c_ui-pl_di-start--\x3e",Me="\x3c!--c_ui-pl_di-end--\x3e",Oe="\x3c!--c_ui-pl_tmpl-start--\x3e",ke="\x3c!--c_ui-pl_tmpl-end--\x3e",Re="\x3c!--c_ui-pl_df--\x3e",Le="\x3c!--c_ui-pl_df",De=/<!--c_ui-pl_df\d*(-->)?/;function Ve(t,s,r,i,a){const l=document.createElement("div");l.innerHTML=s;const c=document.createNodeIterator(l,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let d,h,_=0,E=null,b=[],v=[],C=[],y=[t],N=[],P=[];for(;d=c.nextNode();)if(d instanceof HTMLElement||d instanceof SVGElement){d instanceof jt?E=d:E?.contains(d)||(E=null);let e={},s=p(d.attributes);for(let n=0;n<s.length;n++){const a=s[n];let{name:l,value:c}=a;if(l===xe){let t=d.getAttribute("name")||"default";if(E){let e=E._slotsPropMap[t];e||(e=E._slotsPropMap[t]=[]),e.push(d)}}if(g(l,Le)){let e=r[_];if(e instanceof Qt){e.checkScope(Bt.TAG);let s=new Kt(d,l.substring(1),Bt.TAG);e.point=s,e.di.slotComponent=E,e.di.renderComponent=i;let r=new Ft(_,d);r.isDirective=!0,r.value=e,r.isComponent=!!E,t.push(r),_++,e.di.created(s,...e.args)}d.removeAttribute(l)}else if(l[0]!==be)if(l!==Ne)if(l[0]!==ve||De.test(c)){if(De.test(c)){let s=r[_],n=new Ft(_,d,l.replace(/\.|\?|@/,""),c);if(t.push(n),n.isComponent=!!E,l[0]===ve||l[0]===Ce||l[0]===ye){if(s instanceof Qt){s.checkScope(Bt.PROP);let t=new Kt(d,l.substring(1),Bt.PROP);s.point=t,s.slotComponent=E,n.value=s,n.isDirective=!0,s&&s.di.created(s.point,...s.args)}else if(l[0]===Ce)n.isToggleProp=!0,n.value=!!s,n.value&&d.setAttribute(l.substring(1),"");else if(l[0]===ye){n.value=s;let t=l.substring(1);const[e,r]=t.split(Se);let i=e;switch(r){case"camel":i=S(i);break;case"kebab":i=u(i);break;case"snake":i=tt(i)}n.attrName=i,d.setAttribute(i,s)}else if(d instanceof jt||"SLOT"===d.tagName){let t=S(l.substring(1));t in d||"SLOT"===d.tagName||pt(d.tagName,`Prop '${l}' is not defined in ${d.tagName}`),n.value=s,n.isProp=!0,e[t]=s}else pt(d.tagName,`Prop '${l}' can only be set on a CompElem or a slot`);d.removeAttribute(l),s=""}else{let t;if(n.value=s,s instanceof Qt){let e=Bt.ATTR;"class"===l?e=Bt.CLASS:"style"===l&&(e=Bt.STYLE),s.checkScope(e),n.isDirective=!0;let r=new Kt(d,l,e);s.point=r,s.di.slotComponent=E,s.di.renderComponent=i,t=s,s=""}c=T(c,De,s),a.value=c,t&&t.di.created(t.point,...t.args)}_++}}else pt(d.tagName,`Prop '${l}' must be an interpolation`);else{if(De.test(c)){let t=r[_];if(!o(t,"current")){pt(d.tagName,"Ref must be a RefObject");continue}_++,t.current=d}d.removeAttribute(l)}else{let e=t=>{};if(De.test(c)){let s=r[_];if(!m(s)){pt(d.tagName,`Event '${l}' must be a function`);continue}e=s.bind(i);let n=new Ft(_,d,l.replace(/\.|\?|@/,""),c);n.isComponent=!!E,n.isEvent=!0,t.push(n),_++}Ee(l.substring(1),e,d,i),d.removeAttribute(l)}}d instanceof jt?d._initProps(e):d instanceof HTMLSlotElement&&i._bindSlot(d,d.name||"default",e)}else{let s=d,o=`\x3c!--${s.nodeValue}--\x3e`;if(o===Ae){h&&b.push(h),h=s;let e=r[_],n=new Ft(_,d);n.isComponent=!!E,n.isDirective=!0,n.value=e;let o=E?Bt.SLOT:Bt.TEXT,a=new Kt(h,"",o);e.point=a,e.di.slotComponent=E,e.di.renderComponent=i,v.push(e),t.push(n),C.push(n),t=[],y.push(t),_++,P.push(_),N.push(r),r=e._renderVars,_=0;continue}if(o===Me){C.pop().textNode=s;let e=v.pop();e.point.endNode=s,e.di.created(e.point,...e.args),h=b.pop(),e.di.__updatePoints=t,y.pop(),t=f(y),r=N.pop(),_=P.pop()}else{if(o===Oe){h&&b.push(h),h=s;let n=r[_],o=new Ft(_,d);o.isComponent=!!E,o.isTmpl=!0;let l=f(v);(l&&"ForEach"===e(l,"diClass.name")||"ForEach"==a.constructor.name)&&(o.key=n.getKey()),n=o.value=new Ht(n);let c=E?Bt.SLOT:Bt.TEXT,u=new Kt(h,"",c);n.point=u,n.slotComponent=E,n.renderComponent=i,v.push(n),t.push(o),C.push(o),t=[],y.push(t),_++,P.push(_),N.push(r),r=n._renderVars,_=0;continue}if(o===ke){C.pop().textNode=s;let e=v.pop();e.point.endNode=s,h=b.pop(),e.__updatePoints=t,y.pop(),t=f(y),r=N.pop(),_=P.pop()}}if(o!==Re)continue;let l=new Ft(_,d);t.push(l),l.isComponent=!!E,l.isText=!0;let c,u=r[_];if(c=document.createComment(`compelem-ui-${_}-child-start`),s.parentNode.insertBefore(c,s),s.nodeValue=`compelem-ui-${_}-child-end`,l.textNode=c,u instanceof Qt){l.isDirective=!0,l.value=u;let t=E?Bt.SLOT:Bt.TEXT,e=new Kt(c,"",t);e.endNode=s,u.point=e,u.di.slotComponent=E,u.di.renderComponent=i,u.di.created(e,...u.args),u=""}else if(u instanceof je){l.isTmpl=!0,l.value=u;let[e,s]=we(i,u);u=Ve(t,e,s,i,a)}else l.value=u;if(_++,n(u))continue;if(u instanceof NodeList){let t=document.createDocumentFragment();t.append(...u),s.parentNode.insertBefore(t,s)}else if(u instanceof Element)s.parentNode.insertBefore(u,s);else if(I(u)){let t=document.createTextNode(u);s.parentNode.insertBefore(t,s)}}return l.childNodes}const He={insertBefore:function(t,e){if(!t.parentNode)return;let s=document.createDocumentFragment();s.append(...e),t.parentNode.insertBefore(s,t)},remove:function(t,e){if(t===e)return void t?.parentNode?.removeChild(t);let s=t.nextSibling;for(;s&&s!==e;)s?.parentNode?.removeChild(s),s=t.nextSibling}};function Ie(t,...e){return new je(w(t)?[t]:t,e)}const $e=/([a-z0-9"'])\s*>\s*</gim;function We(t){return{current:t}}class je{strings;vars;constructor(t,e){this.strings=a(t),this.vars=e}getKey(){let t=this.vars,e="";return h(this.strings,((s,r)=>{if(lt.test(s))return e=et(t[r]),!1})),e}getKeys(){let t=this.vars,e=[];for(let s=0;s<this.strings.length;s++){const r=this.strings[s];if(lt.test(r)){let r=et(t[s]);e.push(r)}}return i(e)&&t.forEach((t=>{if(t instanceof je){let s=t.getKey();e.push(s)}})),e}append(t){let e=f(this.strings);return t.strings.forEach(((t,s)=>{0!=s?this.strings.push(t):this.strings[this.strings.length-1]=e+t})),this.vars=a(this.vars,t.vars),this}insert(t,e){let s=e.strings.shift();return this.strings[t]+=s,this.strings.splice(t+1,0,...e.strings),this.vars.splice(t,0,...e.vars),this}getHTML(t){let[e,s]=we(t,this),r=Ve([],e,s,t,t);return st(r,((t,e)=>t+e.outerHTML),"")}}function Ue(t,e,s){s.get||ut(`Computed '${e}' must be a getter`),o(t.constructor,dt.COMPUTED)||(t.constructor[dt.COMPUTED]=i(t.constructor[dt.COMPUTED])?{}:d(t.constructor[dt.COMPUTED])),t.constructor[dt.COMPUTED][e]=s.get}function Be(t,e){return(s,r,n)=>{o(s.constructor,dt.EVENTS)||(s.constructor[dt.EVENTS]=i(s.constructor[dt.EVENTS])?[]:d(s.constructor[dt.EVENTS])),s.constructor[dt.EVENTS].push({name:t,options:e,fn:s[r]})}}var ze;!function(t){t.ONCE="once",t.UPDATABLE="updatable"}(ze||(ze={}));class Fe extends mt{static get priority(){return Number.MAX_VALUE}created(t,e,s,...r){}mounted(t,e,...s){}get targets(){return[ht.FIELD]}selector;cache;result;constructor(t,e){super(),this.selector=t,this.cache=e}static getKey(t){return t}getter(t){this.result=t.shadowRoot?.querySelector(this.selector)}beforeMount(t,e,s,r,...n){const i=this;Reflect.defineProperty(t,r,{get:()=>(i.result&&i.cache||i.getter(t),i.result)})}updated(t,e){this.cache===ze.UPDATABLE&&this.getter(t)}}const Ke=yt(Fe),Qe=yt(class extends Fe{getter(t){this.result=t.shadowRoot?.querySelectorAll(this.selector)}});function Xe(t){if(1===arguments.length)return(e,s)=>{Ge(e,s,t)};Ge(arguments[0],arguments[1],{prop:""})}function Ge(t,e,s){if(!o(t.constructor,dt.STATES)){const e={};let s=t.constructor;for(;(s=gt(s))!==jt;)c(e,s[dt.STATES]?d(s[dt.STATES]):{});Reflect.defineProperty(t.constructor,dt.STATES,{configurable:!1,enumerable:!1,value:e})}t.constructor[dt.STATES][e]=s}function qe(t,e,s){Ge(t.prototype,e,s||{prop:""})}function Ye(t){return e=>{if(e){if(e.prototype.hasOwnProperty("attributeChangedCallback")){let t=e.prototype.attributeChangedCallback;e.prototype.attributeChangedCallback=function(e,s,r){jt.prototype.attributeChangedCallback.call(this,e,s,r),t.call(this,e,s,r)}}if(e.prototype.hasOwnProperty("connectedCallback")){let t=e.prototype.connectedCallback;e.prototype.connectedCallback=function(){jt.prototype.connectedCallback.call(this),t.call(this)}}if(e.prototype.hasOwnProperty("disconnectedCallback")){let t=e.prototype.connectedCallback;e.prototype.disconnectedCallback=function(){jt.prototype.disconnectedCallback.call(this),t.call(this)}}customElements.define(t,e)}}}function Ze(t,e){return(s,r)=>{o(s.constructor,dt.WATCH)||(s.constructor[dt.WATCH]=i(s.constructor[dt.WATCH])?{}:d(s.constructor[dt.WATCH]));(_(t)?t:[t]).forEach((t=>{let n=t.replaceAll(".","-"),i=s.constructor[dt.WATCH][n];_(i)||(i=s.constructor[dt.WATCH][n]=[]),i.push({source:t,options:e,handler:s[r]})}))}}class Je extends(Vt(Object)){_renderArgs;static get scopes(){return[]}renderParams}const ts=["key"];const es=Xt(class extends Je{created(t,e){let s=t.startNode;if(s instanceof jt){let t={},r={};h(e,((e,n)=>{ts.includes(n)||(n in s?t[n]=e:r[n]=e+"")})),s._initProps(t,r)}else h(e,((t,e)=>{s.setAttribute(e,t)}))}update(t,e,s){return Ut.NONE}static get scopes(){return[Bt.TAG]}render(t){}});const ss=Xt(class extends Je{created(t,e){let r=[];_(e)?r=Q(e):s(e)?r=x(e,((t,e)=>t?e:[])):w(e)&&(r=e.split(" "));let n=t.startNode;h(this.lastCls,(t=>{n.classList.remove(t)})),h(r,(t=>{n.classList.add(t)})),this.lastCls=a(r)}update(t,e,s){return this.created(t,e[0]),Ut.NONE}static get scopes(){return[Bt.CLASS]}lastCls;render(t){}});const rs=Xt(class extends Je{created(t,...e){}update(t,e,s){if(i(t.getNodes())&&(!e||i(e[0])))return Ut.NONE;if(rt(this.lastAry,e[0])&&this.lastAry.length===e[0].length)return Ut.NONE;if(!i(this.renderParams)){let t=f(this.renderParams);_(t)||(t=[t]),this.renderParams=t}return this.lastAry=nt(e[0]),Ut.UPDATE}constructor(t){super(),i(this.renderParams)||(this.renderParams=p(f(this.renderParams)))}static get scopes(){return[Bt.TEXT,Bt.SLOT]}lastAry;lastRenderTmpl;render(t,e){let s=Z(t,((t,s)=>e(t,s)));if(s.length<1)return this.lastRenderTmpl=new je([],[]),this.lastRenderTmpl;let r=[],n=[];const i=[],o=[];for(let t=0;t<s.length;t++){const e=s[t];let a=f(n),l=e.vars,c=!0,d=e.strings;for(let t=0;t<d.length;t++){const e=d[t];if(lt.test(e)){let e=l[t]+"";if(r.includes(e))return void ut(`forEach - duplicate key '${e}'`);r.push(e),c=!1}0==t&&a?n[n.length-1]=a+e:n.push(e)}if(c)return void ut("forEach - missing 'key' prop");let h=f(i);h&&d.length>0&&(i[i.length-1]=I(h)+d.shift()),i.push(""),o.push(e)}return this.lastAry=nt(t),i.push(""),this.lastRenderTmpl=new je(i,o),this.lastRenderTmpl}});const ns=Xt(class extends Je{created(t,...e){}ifNodes;elseNodes;static get scopes(){return[Bt.TEXT,Bt.SLOT]}update(t,e,s){return!!e[0]==!!s[0]?Ut.NONE:(e[0],Ut.REPLACE)}render(t,e,s){return t?e(t):s(t)}});const is=Xt(class extends Je{created(t,...e){}static get scopes(){return[Bt.TEXT,Bt.SLOT]}update(t,e,s){return e[0]===s[0]?Ut.NONE:e[0]?Ut.REPLACE:Ut.REMOVE}render(t,e){return t?e():Ie``}});var os;!function(t){t.CHANGE="change",t.INPUT="input"}(os||(os={}));const as=Xt(class extends Je{created(r,n,i){this.modelPath||(this.modelPath=f(this.renderParams)),i&&(this.modelPath=t(i));const o=r.startNode;if("binded"!==e(o,"_model"))if(s(n)||I(n)||(n=""),o instanceof jt)o._initProps({value:n}),o.addEventListener("update:value",(t=>{y(this.renderComponent,this.modelPath,t.detail.value)})),y(o,"_model","binded");else if(o instanceof HTMLTextAreaElement)o.setAttribute("value",n+""),o.addEventListener("input",(t=>{let e=t.target;y(this.renderComponent,this.modelPath,e.value)})),y(o,"_model","binded");else if(o instanceof HTMLInputElement){let t="",e="";switch(o.type){case"checkbox":case"radio":t="checked",e="change";break;default:t="value",e="input"}o.setAttribute(t,n+""),o.addEventListener(e,(t=>{let e=t.target;y(this.renderComponent,this.modelPath,e.value)})),y(o,"_model","binded")}else o instanceof HTMLSelectElement&&(o.setAttribute("value",n+""),o.addEventListener("change",(t=>{let e=t.target;y(this.renderComponent,this.modelPath,e.value)})),y(o,"_model","binded"))}update(t,e,s){if(this.modelPath||(this.modelPath=f(this.renderParams)),!N(e,s)){const s=t.startNode;if(s instanceof jt)s._updateProps({value:e[0]});else if(s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement)s.setAttribute("value",e[0]+"");else if(s instanceof HTMLInputElement)switch(s.type){case"checkbox":case"radio":e[0]?s.setAttribute("checked",""):s.removeAttribute("checked");break;default:s.setAttribute("value",e[0]+"")}}return Ut.NONE}static get scopes(){return[Bt.TAG]}modelPath;render(t,e){}});const ls=Xt(class extends Je{created(t,e){let s=t.startNode;n(this.display)&&(this.display=s.style.display),this.renderComponent.nextTick((()=>{s.style.display=e?this.display:"none"}))}update(t,e,s){return this.created(t,e[0]),Ut.NONE}display=void 0;static get scopes(){return[Bt.TAG]}constructor(t){super(),this.point=t}render(t){}});const cs=Xt(class extends Je{created(t,e,s){e=e.bind(this.renderComponent),this.slotComponent._bindSlotHook(s||"default",e)}update(t,e,s){return Ut.NONE}static get scopes(){return[Bt.SLOT]}render(t,e){}});class ds{static getCssText(t){return w(t)?t:v(Z(t,((t,e)=>u(e)+":"+t)),";")}static setStyle(t,e){if(w(t)&&!I(t))return{};let s=ds.getCssText(t),r={};return h(s.split(";"),(t=>{let s=t.split(":"),n=I(s[0]),i=I(s[1]);r[n]=e.style.getPropertyValue(n),e.style.setProperty(n,i)})),r}}const hs=Xt(class extends Je{created(t,e){ds.setStyle(e,t.startNode)}update(t,e,s){return this.created(t,e[0]),Ut.NONE}constructor(t){super(),this.point=t}static get scopes(){return[Bt.STYLE]}render(t){}});const us=Xt(class extends Je{created(t,e){this.modelPath||(this.modelPath=f(this.renderParams));const s=t.startNode;let r=t.attrName;s._initProps({[r]:e}),s.addEventListener("update:"+r,(t=>{y(this.renderComponent,this.modelPath,t.detail.value)}))}update(t,e,s){if(!N(e,s)){const s=t.startNode;let r=t.attrName;s._updateProps({[r]:e[0]})}return Ut.NONE}static get scopes(){return[Bt.PROP]}modelPath;constructor(t){super()}render(t){}});const ps=Xt(class extends Je{created(t,...e){}static get scopes(){return[Bt.TEXT,Bt.SLOT]}update(t,e,s){return N(e,s)?Ut.NONE:Ut.REPLACE}render(t,e){let s=()=>Ie``,r=[],n=[];h(e,((t,e)=>{if(m(t))r.push(e),n.push(t);else{let e=t[0],s=t[1];r.push(e),n.push(s)}"default"===e&&(s=t)}));let i=it(r,(e=>m(e)?e(t):e==t));return ot(n[i]??s)}});export{jt as CompElem,ds as CssHelper,mt as Decorator,ht as DecoratorType,vt as DecoratorWrapper,Je as Directive,Ut as DirectiveUpdateTag,Qt as DirectiveWrapper,Kt as EnterPoint,Bt as EnterPointType,_t as GetKeyFnName,os as ModelTriggerType,ze as QueryCache,je as Template,Ft as UpdatePoint,bt as _DecoratorMap,Et as _DecoratorsKey,xt as _getObservedAttrs,es as bind,we as buildHTML,ss as classes,Ue as computed,We as createRef,yt as decorator,Xt as directive,Be as event,rs as forEach,Ie as html,ns as ifElse,is as ifTrue,qe as makeState,as as model,Nt as prop,Ke as query,Qe as queryAll,ls as show,cs as slot,Xe as state,hs as styles,us as sync,Ye as tag,Ze as watch,ps as when};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "compelem",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1-b1",
|
|
4
4
|
"description": "A modern, reactive, fast, lightweight and flexible lib for building web components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"test": "rollup --config rollup.config.test.js --watch"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@babel/preset-typescript": "^7.
|
|
27
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
28
28
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
29
29
|
"@rollup/plugin-json": "4.1.0",
|
|
30
30
|
"@rollup/plugin-node-resolve": "14.1.0",
|
|
31
31
|
"@rollup/plugin-terser": "0.4.1",
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "
|
|
33
|
-
"@typescript-eslint/parser": "^
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "8.23.0",
|
|
33
|
+
"@typescript-eslint/parser": "^8.23.0",
|
|
34
34
|
"autoprefixer": "^10.4.19",
|
|
35
35
|
"bootstrap-icons": "^1.11.3",
|
|
36
|
-
"eslint": "
|
|
37
|
-
"eslint-config-prettier": "^
|
|
36
|
+
"eslint": "9.19.0",
|
|
37
|
+
"eslint-config-prettier": "^10.0.1",
|
|
38
38
|
"myfx": "^1.7.0",
|
|
39
39
|
"postcss": "^8.4.38",
|
|
40
40
|
"prettier": "^2.8.3",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"rollup-plugin-serve": "^2.0.1",
|
|
47
47
|
"rollup-plugin-typescript2": "0.33.0",
|
|
48
48
|
"sass": "^1.72.0",
|
|
49
|
-
"tslib": "^2.
|
|
50
|
-
"typescript": "^5.
|
|
49
|
+
"tslib": "^2.8.1",
|
|
50
|
+
"typescript": "^5.7.3"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/reactive.d.ts
CHANGED
|
@@ -3,19 +3,14 @@
|
|
|
3
3
|
* @author holyhigh2
|
|
4
4
|
*/
|
|
5
5
|
import { CompElem } from "./CompElem";
|
|
6
|
+
import { CollectorType } from "./constants";
|
|
6
7
|
import { IView } from "./render/RenderContext";
|
|
7
|
-
import { Getter } from "./types";
|
|
8
|
+
import { Getter, Updater } from "./types";
|
|
8
9
|
export declare const Collector: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
endCompute(): void;
|
|
14
|
-
setComputedProp(updater: Getter): void;
|
|
15
|
-
__computeCollecting: null;
|
|
16
|
-
__computeUpdater: null;
|
|
17
|
-
__cssCollecting: null;
|
|
18
|
-
__cssUpdater: null;
|
|
10
|
+
collectWatch(comp: CompElem, updater: Getter, subPath: string): void;
|
|
11
|
+
startCollect(comp: CompElem, type: CollectorType): void;
|
|
12
|
+
setUpdater(updater: Getter): void;
|
|
13
|
+
endCollect(): void;
|
|
19
14
|
__directiveQ: any[][];
|
|
20
15
|
setDirectiveQ(val: any[]): void;
|
|
21
16
|
popDirectiveQ(): any[];
|
|
@@ -23,6 +18,9 @@ export declare const Collector: {
|
|
|
23
18
|
endRender(component: CompElem): void;
|
|
24
19
|
collect(prop: string): void;
|
|
25
20
|
clear(): void;
|
|
21
|
+
__updater: null;
|
|
22
|
+
__collecting: null;
|
|
23
|
+
__collectType: number;
|
|
26
24
|
__renderCollection: Set<string>;
|
|
27
25
|
__renderContext: null;
|
|
28
26
|
__renderCollecting: boolean;
|
|
@@ -37,3 +35,16 @@ export declare const Collector: {
|
|
|
37
35
|
* @returns
|
|
38
36
|
*/
|
|
39
37
|
export declare function reactive(obj: Record<string, any>, context: any): any;
|
|
38
|
+
export declare class Queue {
|
|
39
|
+
static watchSet: Set<Updater>;
|
|
40
|
+
static computedSet: Set<Updater>;
|
|
41
|
+
static cssSet: Set<Updater>;
|
|
42
|
+
static nextSet: Set<Updater>;
|
|
43
|
+
static nextPending: boolean;
|
|
44
|
+
static next: () => void;
|
|
45
|
+
static flush(): void;
|
|
46
|
+
static pushWatch(updater: Getter): void;
|
|
47
|
+
static pushComputed(updater: Getter): void;
|
|
48
|
+
static pushCss(updater: Getter): void;
|
|
49
|
+
static pushNext(updater: () => void): void;
|
|
50
|
+
}
|
package/types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { Template } from "./render/Template";
|
|
5
5
|
export type Constructor<T> = new (...args: any[]) => T;
|
|
6
6
|
export type Getter = () => any;
|
|
7
|
+
export type Updater = (...args: any[]) => any;
|
|
7
8
|
/**
|
|
8
9
|
* 插槽配置对象
|
|
9
10
|
*/
|
|
@@ -20,6 +21,11 @@ export declare enum DirectiveUpdateTag {
|
|
|
20
21
|
UPDATE = "UPDATE",//对比更新
|
|
21
22
|
APPEND = "APPEND"
|
|
22
23
|
}
|
|
24
|
+
export type DefaultProps = Partial<{
|
|
25
|
+
css: Array<string | CSSStyleSheet>;
|
|
26
|
+
global: Record<string, any>;
|
|
27
|
+
[key: string]: Record<string, any>;
|
|
28
|
+
}>;
|
|
23
29
|
/**
|
|
24
30
|
* 视图更新点
|
|
25
31
|
*/
|