compelem 0.9.4-b1 → 0.11.0-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/README.md CHANGED
@@ -400,6 +400,7 @@ return html` <l-tooltip>
400
400
  - @watch 监控 state/prop 变更
401
401
  - @computed 计算属性,仅在响应变量变更时更新缓存值
402
402
  - @debounced 定义函数防抖
403
+ - @bindThis 为组件方法绑定this
403
404
 
404
405
  #### 继承
405
406
  部分指令可由子类继承不会覆盖,包括@state/@prop/@watch/@computed
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * compelem v0.9.4-b1.1765098297
2
+ * compelem v0.11.0-b1.1769943285
3
3
  * A modern, reactive, fast, lightweight and flexible lib for building web components
4
4
  * @holyhigh2
5
- * https://github.com/holyhigh2/compelem
5
+ * git+https://github.com/holyhigh2/compelem.git
6
6
  */
7
- import{toPath as t,some as e,isString as r,isUndefined as n,isBlank as s,get as o,isObject as i,isDefined as a,isEmpty as l,has as c,concat as u,defaults as d,isLowerCaseChar as p,merge as h,cloneDeep as f,each as g,kebabCase as m,toArray as v,last as b,startsWith as E,isSymbol as y,isFunction as S,isArray as N,initial as C,flatMap as _,test as T,size as A,assign as w,first as P,closest as M,once as k,join as O,bind as D,camelCase as x,isNull as R,isNil as L,trim as H,isBoolean as V,parseJSON as W,debounce as I,set as $,groupBy as B,reject as U,filter as j,compact as F,remove as G,map as z,includes as K,find as X,throttle as Q,split as q,isEqual as Y,replace as Z,toString as J,replaceAll as tt,snakeCase as et,clone as rt,reduce as nt,isMatch as st,findIndex as ot,call as it}from"myfx";const at=/\s+\.?key\s*=/;var lt,ct,ut;!function(t){t[t.CSS=1]="CSS",t[t.COMPUTED=2]="COMPUTED"}(lt||(lt={})),function(t){t.PROPS="__deco_props",t.STATES="__deco_states",t.COMPUTED="__deco_computed",t.WATCH="__deco_watch",t.EVENTS="__deco_events"}(ct||(ct={})),function(t){t.Prod="prod",t.Dev="dev"}(ut||(ut={}));const dt={};function pt(t){console.error("[CompElem]",t)}function ht(t,e){console.error(`[CompElem <${t}>]`,e)}function ft(e){return t(e).join("-")}function gt(t){return Object.getPrototypeOf(t)}function mt(t){return t===Boolean||e(t,(t=>t===Boolean))}function vt(t){let e=t;return r(t)&&/(?:^true$)|(?:^false$)/.test(e)?e="true"===e:(n(e)||s(e))&&(e=!0),e}var bt;!function(t){t.CLASS="class",t.FIELD="field",t.METHOD="method"}(bt||(bt={}));class Et{static get priority(){return 0}}const yt="getKey",St="__decorators",Nt=new WeakMap;class Ct{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(t,e,r){this.args=t,this.metadata=e,this.decoratorClass=r,this.priority=o(r,"priority",0),this.instanceMap=new WeakMap}create(t){let e,r=new this.decoratorClass(...this.args),s=r.targets,c=this.metadata[2];i(c)&&a(o(c,"configurable"))?e=bt.METHOD:n(this.metadata[2])&&(e=bt.FIELD),!l(s)&&e&&s.includes(e)?(r.created(t,...this.metadata),this.instanceMap.set(t,r)):pt(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${s.join(",")}' bug got '${e}'`)}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 _t=new WeakMap;function Tt(t){let e=(...e)=>(...r)=>{let n=r[0].constructor,s=n[St];if(!c(n,St)){let t=Object.getPrototypeOf(n);s=t?u(t[St]??[]):[],Reflect.defineProperty(n,St,{configurable:!1,enumerable:!1,value:s})}let o,i={},a=t[yt];if(a){let r=_t.get(t);if(r||(r=new WeakMap,_t.set(t,r)),i=r.get(n),i||(i={},r.set(n,i)),o=a(...e),i[o])return i[o]}let l=new Ct(e,r,t);return i[o]=l,s?.push(l),l};return Nt.set(e,!0),e}const At=new WeakMap;function wt(t){if(1===arguments.length)return(e,r,n)=>{t.required=t.required||!1,t.attribute=!1!==t.attribute,Pt(e,r,t,n)};let e=arguments[0],r=arguments[1],n=arguments[2];t={type:void 0,required:!1,attribute:!0},n&&"function"==typeof n.type&&(t=d(n,t),n=void 0),Pt(e,r,t,n)}function Pt(t,e,r,n){let s;if(p(e[0])||pt(`Prop '${e}' must be in CamelCase`),!c(t.constructor,ct.PROPS)){const e={};let r=t.constructor;for(;(r=gt(r))!==Jt;)h(e,r[ct.PROPS]?f(r[ct.PROPS]):{});Reflect.defineProperty(t.constructor,ct.PROPS,{configurable:!1,enumerable:!1,value:e}),s=new Set,g(e,((t,e)=>{if(t.attribute){let t=m(e);s?.add(t)}})),At.set(t.constructor,s)}if(n&&(n.get&&(r.getter=n.get),n.set&&(r.setter=n.set)),r.attribute){s||(s=At.get(t.constructor));let r=m(e);s?.add(r)}c(t.constructor,"observedAttributes")||(t.constructor.observedAttributes=[]),t.constructor.observedAttributes=v(s),t.constructor[ct.PROPS][e]=r}const Mt=new Set;function kt(t){return At.get(t)??Mt}var Ot,Dt;!function(t){t.ATTR="attr",t.PROP="prop",t.TEXT="text",t.CLASS="class",t.STYLE="style",t.SLOT="slot",t.TAG="tag"}(Ot||(Ot={})),function(t){t.NONE="NONE",t.REMOVE="REMOVE",t.REPLACE="REPLACE",t.UPDATE="UPDATE",t.APPEND="APPEND"}(Dt||(Dt={}));class xt{key;varIndex;value;isText=!1;isDirective=!1;node;textNode;isComponent=!1;attrName;attrTmpl;isProp=!1;isToggleProp=!1;notUpdated;constructor(t,e,r,n){this.varIndex=t,this.node=e,r&&(this.attrName=r),n&&(this.attrTmpl=n)}}const Rt="-",Lt={collectWatch(t,e,r){let n=$t.get(t);n||(n={},$t.set(t,n));let s=n[r];s||(s=n[r]=[]),s.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=b(this.__directiveQ);const r=t?t.join(","):"",n=e?e.join(","):"";e&&r===n||(e&&e.length<t.length&&E(r,n)?this.__directiveQ[this.__directiveQ.length-1]=t:this.__directiveQ.push(t))},popDirectiveQ(){let t=u(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},Ht=new WeakMap,Vt=new WeakMap,Wt=new WeakMap,It=new WeakMap,$t=new WeakMap,Bt=new WeakMap;function Ut(t,e){if(!i(t))return t;if(Bt.has(t))return Bt.get(t);if(Ht.has(t))return t;const r=new Proxy(t,{get(t,e,r){if(!e)return;const n=Reflect.get(t,e,r);if(y(e))return n;if(S(n))return n;if("length"===e&&N(t))return n;let s=Vt.get(r)??[],a=u(s,[e]),l=e in t;if((Lt.__renderCollecting||Lt.__collecting)&&(l&&t.hasOwnProperty(e)||!l)){let t=a.join(Rt);if(Lt.__renderCollecting)Lt.collect(ft(a)),Lt.setDirectiveQ(a);else if(Lt.__collecting){let e;switch(Lt.__collectType){case lt.COMPUTED:e=Wt.get(Lt.__collecting),e||(e={},Wt.set(Lt.__collecting,e));break;case lt.CSS:e=It.get(Lt.__collecting),e||(e={},It.set(Lt.__collecting,e))}let r=e[t];r||(r=e[t]=[]),r.push(Lt.__updater)}}const c=Ht.get(r);let d=c.from;if(Bt.has(n))return Bt.get(n);let p=o(d.constructor,ct.STATES),h=o(p,[a[0]]);if(!h){let t=o(d.constructor,ct.PROPS);h=o(t,[a[0]])}if(!h)return n;if(o(h,"shallow")&&a.length>1)return n;let f=n;if(i(n)&&!S(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){let t=c.pathMap;c.contextSet.forEach((e=>{let r=t?.get(e);r&&(f=Ut(n,e),Bt.set(n,f),Vt.has(f)||Vt.set(f,a))}))}return f},set(t,r,n,s){if(!r)return!1;if(!e.isMounted){return Reflect.set(t,r,n)}let i=t[r],a=Vt.get(s)??[],l=u(a,[r]),c=o(e.constructor,ct.PROPS),d=o(e.constructor,ct.STATES),p=o(c,[l[0],"hasChanged"])||o(d,[l[0],"hasChanged"]),h=n,f=i;if(l.length>1&&(f=h=e._getPrivateData()[l[0]]),p){if(!p.call(e,h,f,l,n,i))return!0}else if(Object.is(i,n))return!0;c&&c[r]&&t.__isData&&c[r].sync&&e.emit("update:"+r,{value:n});let g=n,m=Reflect.set(t,r,g);return jt(e,f,l,n,i),m}});let n=Vt.get(t)??[];if(Object.isExtensible(t)&&!Ht.get(r)){let t=new Set;t.add(e);let s=new WeakMap;s.set(e,n),Ht.set(r,{from:e,contextSet:t,pathMap:s})}else{Ht.get(r).contextSet.add(e);let t=Ht.get(r).pathMap,s=t.get(e),i=u(n);if(s&&s.join("")!==i.join("")){let t=o(e,C(s));N(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(e,i)}return Bt.set(t,r),r}function jt(t,e,r,n,s){let i=Wt.get(t),a=It.get(t),c=$t.get(t);if(i||a||c){let t=r.length;for(;t;){let u=r.slice(0,t).join(Rt);if(c){const i=c[u];t===r.length?i?.forEach((t=>{let o=t();o.oldValue=e,o.subNewValue=n,o.subOldValue=s,o.path=r,Gt.pushWatch(o)})):i?.forEach((t=>{let i=t();o(i,"deep")&&(i.oldValue=e,i.subNewValue=n,i.subOldValue=s,i.path=r,Gt.pushWatch(i))}))}if(i){let t=i[u];if(!l(t))for(let e=0;e<t.length;e++){const r=t[e];Gt.pushComputed(r)}}if(a){let t=a[u];if(!l(t))for(let e=0;e<t.length;e++){const r=t[e];Gt.pushCss(r)}}t--}}let u=t._notify(e,r);Gt.pushNext(u,t.cid)}const Ft=new Map;class Gt{static watchSet=new Set;static computedSet=new Set;static cssSet=new Set;static nextSet=new Set;static nextPending=!1;static next;static flush(){Gt.nextPending=!1;let t=Array.from(Gt.watchSet);Gt.watchSet.clear();let e=Array.from(Gt.computedSet);Gt.computedSet.clear();let r=Array.from(Gt.cssSet);Gt.cssSet.clear();let n=Array.from(Gt.nextSet);Gt.nextSet.clear(),Ft.clear(),t.forEach((t=>t(o(t,"path"),o(t,"oldValue"),o(t,"subNewValue"),o(t,"subOldValue")))),e.forEach((t=>t())),r.forEach((t=>t())),n.forEach((t=>t()))}static pushWatch(t){Gt.watchSet.add(t)}static pushComputed(t){Gt.computedSet.add(t)}static pushCss(t){Gt.cssSet.add(t)}static pushNext(t,e){if(e){if(Ft.has(e))return;Ft.set(e,t)}Gt.nextSet.add(t),Gt.nextPending||(Gt.nextPending=!0,Gt.next())}}(()=>{const t=Promise.resolve(),e=Gt.flush;Gt.next=()=>{t.then(e)}})();const zt={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},Kt=new WeakMap;let Xt=[],Qt=0;const qt=new Map,Yt=new WeakMap,Zt=Symbol.for("PROP_OBJECT_KEY_MAP_SYMBOL");class Jt extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(t){Xt=_(t.css,(t=>{if(r(t)){let e=new CSSStyleSheet;return e.replaceSync(t),e}return t instanceof CSSStyleSheet?t:[]})),t.global,g(t,((t,e)=>{T(e[0],/[A-Z]/)}))}#t;#e={};#r={"#slots":{}};#n={};#s={};#o;#i={};__events={};get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#t}get reactiveData(){return this.#n}get attrs(){return this.#a}get props(){return this.#l}get renderRoot(){return this.#c}get renderRoots(){return this.#u}get parentComponent(){return this.#d}get wrapperComponent(){return this.#p}get slotHooks(){return this.#h}get css(){return Kt.get(this.constructor)}get globalStyleSheet(){return qt.get(this.constructor)?.sheet}get isMounted(){return this.#f}get slots(){return this.#r["#slots"]}#a;#l;#c;#u;#d;#p;#g={};#h={};#m={};#f=!1;static get styles(){return[]}static get globalStyles(){return[]}static get hostStyles(){return[]}get styles(){return[]}#v=!1;#b=!1;constructor(...t){super(),this.#t=Qt++,1===A(t)&&(this.#l={},w(this.#l,P(t)));let e=this.render.bind(this);this.render=function(){let t;return Lt.startRender(this),t=e(),Lt.endRender(this),t};let n=o(this.constructor,"globalStyles"),s=qt.has(this.constructor);if(!l(n)&&!s){let t="";n.forEach((e=>{r(e)&&(t+=e+"\n")}));let e=document.createElement("style");e.textContent+=t,qt.set(this.constructor,e),document.head.appendChild(e)}let i=Kt.get(this.constructor),a=i??[];i||(g(o(this.constructor,"styles"),(t=>{if(r(t)){let e=new CSSStyleSheet;e.replaceSync(t),a.push(e)}else a.push(t)})),Kt.set(this.constructor,a)),this.#o=this.attachShadow({mode:"open"}),this.#o.adoptedStyleSheets=[...Xt,...a],this.#E();let c=o(this.constructor,St);c&&c.sort(((t,e)=>e.priority-t.priority)).forEach((t=>t.create(this))),this.#y=this.#S.bind(this)}insertStyleSheet(t){let e;if(r(t)){e=new CSSStyleSheet;try{e.replaceSync(t)}catch(t){}}else{if(this.shadowRoot.adoptedStyleSheets.includes(t))return t;e=t}this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,e];return(Kt.get(this.constructor)??[]).push(e),e}get rootComponent(){let t=this;for(;t.parentComponent;)t=t.parentComponent;return t}#y;connectedCallback(){let t=M(this.parentNode,(t=>t instanceof Jt||t.host instanceof Jt),"parentNode");this.#d=t?t instanceof Jt?t:t.host:null,this.__init()}disconnectedCallback(){}__init(){if(this.#v)return;if(this.#b)return;this.#b=!0,this.#E();const t=this.#N();this.propsReady(t);for(const e in t){const r=t[e];this.#r[e]=r}this.#C(),g(this.#r,((t,e)=>{let r=Reflect.getOwnPropertyDescriptor(this.#r,e);Reflect.defineProperty(this,e,{get(){let t=Reflect.get(this.#n,e);return r?.get?r?.get():t},set(t){r?.set?r?.set(t):Reflect.set(this.#n,e,t)}})})),Reflect.defineProperty(this.#r,"__isData",{enumerable:!1,value:!0}),this.#n=Ut(this.#r,this);let e=o(this.constructor,ct.COMPUTED);g(e,((t,e)=>{Lt.startCollect(this,lt.COMPUTED),Lt.setUpdater((()=>{this.#n[e]=t.call(this)})),this.#r[e]=t.call(this),Lt.endCollect(),Reflect.defineProperty(this,e,{get(){return Reflect.get(this.#n,e)},set(t){ht(this.tagName,"Cannot set a computed property '"+e+"'")}})}));let n=o(this.constructor,ct.WATCH);g(n,((t,e)=>{t.forEach((t=>{let{source:r,options:n,handler:s}=t,i=s.bind(this);o(n,"once",!1)&&(i=k(i));const a=function(t,e,n,s){let a=o(this,r.replaceAll(Rt,"."));i(a,e,O(t,"."),n,s)}.bind(this);let l=o(n,"deep",!1);if(a.deep=l,Lt.collectWatch(this,(()=>a),e),!o(n,"immediate",!1))return;let c=o(this,r.replaceAll(Rt,"."));i(c,void 0,r)}))}));let i=function(t,e){let r,n=[];if(Ge.has(e.constructor)){let s=Ge.get(e.constructor),i=function(t,e){let r=u(e.vars),n=e.strings.length-1;for(let s=0;s<=n;s++){let n=o(e.vars,s,"");if(n instanceof fr){let[e,o]=er(t,n);r.splice(s,1,...o)}}return r}(e,t);r=ze.has(e.constructor)?function(t,e,r){let n=ze.get(r.constructor)?.cloneNode(!0),s=Ke.get(r.constructor);const o=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let i,a,l=0,c=0;for(;i=o.nextNode();){let n;if(c++,a&&!a.contains(i)&&(a=void 0),i instanceof HTMLElement||i instanceof SVGElement){i instanceof Jt&&(a=i);let o={},u=s[c];u&&u.forEach((s=>{let c=e[l++];switch(s.type){case Xe.Event:n=rt(s.up),s.value||l--,s.value&&xe(s.name,c.bind(r),i,r),i.removeAttribute(s.attrName);break;case Xe.AttrSlot:a&&s.name,i.removeAttribute(s.attrName);break;case Xe.Ref:n=rt(s.up),c.current=i,i.removeAttribute(s.attrName);break;case Xe.AttrKey:n=rt(s.up),i.setAttribute($e,c);break;case Xe.AttrBool:n=rt(s.up),n.value=!!c,n.node=i,n.value&&i.setAttribute(s.name,""),i.removeAttribute(s.attrName);break;case Xe.AttrProp:n=rt(s.up),n.value=c,n.node=i,o[s.name]=c,s.attrName&&i.removeAttribute(s.attrName);break;case Xe.AttrRef:case Xe.Attr:n=rt(s.up),n.value=c,n.node=i,i.setAttribute(s.attrName,c),Xe.AttrRef===s.type&&i.removeAttribute(s.name);break;case Xe.DirectiveAttr:case Xe.DirectiveTag:case Xe.DirectiveProp:n=rt(s.up),n.value=c,n.node=i;let t=rt(s.point);t.startNode=i;let[e,u,d,p,h]=c,f=tr.get(i);if(f||(f={},tr.set(i,f)),f[s.attrName??Symbol.keyFor(e)]=[t,r,a],d(t,u,void 0,{renderComponent:r,slotComponent:a,varChain:h}),Xe.DirectiveAttr===s.type){let t=i.getAttribute(s.attrName);t=Z(t,or,""),i.setAttribute(s.attrName,t)}s.name&&i.removeAttribute(s.name)}n&&t.push(n)})),i instanceof Jt?(i._regWrapper(r),A(o)>0&&i._initProps(o)):i instanceof HTMLSlotElement&&r._bindSlot(i,i.name||"default",o)}else{let o=s[c];o&&o.forEach((s=>{let o=e[l++];switch(s.type){case Xe.DirectiveSlot:case Xe.DirectiveText:n=rt(s.up),n.value=o,n.node=i;let[t,e,l,c,u]=o,d=Symbol.keyFor(t),p=document.createComment(`compelem-${r.tagName}-${d}-start`);n.textNode=p,i.parentNode.insertBefore(p,i),i.nodeValue=`compelem-${r.tagName}-${d}-end`;let h=rt(s.point);h.startNode=p,h.endNode=i,Ze.set(i,[h,r,a,e,u]),Ye.set(i,l),Je.set(i,n),Lt.startRender(i);let f=l(h,e,void 0,{renderComponent:r,slotComponent:a,varChain:u});Lt.endRender(r);let g=ar(i,f[1],r);g&&g.length>0&&ur.insertBefore(i,Array.from(g));break;case Xe.Text:n=rt(s.up),n.node=i;let m=J(o??""),v=document.createTextNode(m);i.replaceWith(v),n.textNode=v}n&&t.push(n)}))}}return n.childNodes}(n,i,e):ir(n,s,i,e)}else{let[s,o]=er(e,t);Ge.set(e.constructor,s),r=ir(n,s,o,e)}return Qe.set(e,n),r}(this.render(),this);i&&(this.#o.append(...i),this.#u=j(this.#o.childNodes,(t=>t.nodeType===Node.ELEMENT_NODE)),this.#c=this.#u[0]),g(this.#h,((t,e)=>{this.#_(e)}));const a=this;let l=o(this.constructor,St);l&&l.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.beforeMount(this,((t,e)=>(a.#n[t]=e,a.#n[t])))}));let c=o(this.constructor,"hostStyles"),d=this.#p?.shadowRoot??this.ownerDocument,p=Yt.get(d);if(!p?.includes(this.constructor)&&c.length>0){let t=[];g(c,(e=>{if(r(e)){let r=new CSSStyleSheet;r.replaceSync(e),t.push(r)}else t.push(e)})),d.adoptedStyleSheets=[...d.adoptedStyleSheets,...t],p?.push(this.constructor)}this.beforeMount();let h=o(this.constructor,ct.EVENTS);h&&h.forEach((async t=>{let e=t.name,r=w({target:document,once:!1,passive:!1,capture:!1},t.options),n=D(t.fn,this),s=r.target;S(s)&&(s=await s.call(this,this)),s?s.addEventListener(e,n,r):ht(this.tagName,"The target of @event('"+e+"',...) is invalid")})),setTimeout((()=>{this.#f=!0,Lt.startCollect(this,lt.CSS);let t=[];this.styles.forEach((e=>{if(!S(e))return;let r=new CSSStyleSheet;t.push(r),Lt.setUpdater((()=>{let t=e()??"";r.replaceSync(t)}));let n=e();s(n)||r.replaceSync(n)})),Lt.endCollect(),t.length>0&&(this.#o.adoptedStyleSheets=[...this.#o.adoptedStyleSheets,...t]),this.mounted(),l&&l.forEach((t=>{t.mounted(this,((t,e)=>(a.#n[t]=e,a.#n[t])))}))}),0),this.#v=!0}propsReady(t){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}#T(t,e){this.#E();let r=o(this.#e[e],"props");r&&g(this.slots,((t,e)=>{t.filter((t=>t.nodeType===Node.ELEMENT_NODE)).forEach((t=>{t instanceof Jt?t._updateProps(r):g(r,((e,r)=>{if(t instanceof HTMLSlotElement){let n=o(t,"__l_comp");if(n){let s=t.name||"default",o=n.#e[s];o||(o=n.#e[s]={props:{}}),o.props||(o.props={}),o.props[r]=e,n.#T(t,s)}}else t.setAttribute(r,e)}))}))})),this.slotChange(t,e)}slotChange(t,e){}attributeChangedCallback(t,e,r){if(Object.is(r,e))return;let n=x(t);if(mt(o(this.constructor,[ct.PROPS,n]).type)){let t=!R(r)&&vt(r);if(o(this,n)===t)return}this.#A(t,e,r)}shouldUpdate(t){return!0}updated(t){}#w={};_notify(t,e){let r=[];for(let n=0;n<e.length;n++){const s=e[n];r.push(s);let i=o(this,r),a=ft(r);this.#s[a]={value:i,chain:"slots"===a?["slots"]:r,oldValue:t,end:r.length===e.length}}return this.#y}#S(){if(A(this.#s)<1)return;if(!this.isMounted)return;const t=this.#s;if(this.#s={},!this.shouldUpdate(t))return;const e=Object.keys(t);let r=o(this.constructor,St);r&&r.sort(((t,e)=>e.priority-t.priority)).forEach((e=>{e.updated(this,t)}));let n=new Set;const s=this.#i;g(t,(({value:t,chain:e,oldValue:r,end:o},i)=>{s[i]&&s[i].forEach((t=>{n.add(t)}))})),n.forEach((t=>{t===this?lr(this.render(),this,void 0,e):cr(t,this,void 0,void 0,e)})),this.#P.forEach((t=>{this.#_(t)})),this.updated(t)}#N(){let t=o(this.constructor,ct.PROPS),e=this.attributes,r=this.tagName,s=this.#l,l={};g(e,(({name:e,value:r})=>{if(e[0]===Re||e[0]===Le||e[0]===He||e===Ie||"slot"===e)return;let n=x(e);t&&!t[n]&&(l[e]=r)})),this.#a=this.#a?w(this.#a,l):l;let u={};if(!t)return Object.seal(u);let d=Object.keys(t),p=d.length;for(let l=0;l<p;l++){const p=d[l],h=m(p),f=this.hasAttribute(h);let g,v=t[p],b=c(s,p),E=o(this,p);if(!("_defaultValue"in v)&&(v._defaultValue=E,!v.type)){n(E)&&ht(r,"Prop '"+p+"' has neither propType nor defaultValue be used for type inference");let t=typeof E;N(E)&&(t="array");let e=zt[t];v.type=e}if(b)g=L(s[p])?E:s[p];else{g=E;let t=e.getNamedItem(h)||e.getNamedItem(Le+h);t&&(b=!0,g=t.value)}if(v.required&&!b){ht(r,"Prop '"+p+"' is required");break}g=this.#M(t,p,g,f);let y=o(t,[p,"getter"]);y&&(y=D(y,this));let S=o(t,[p,"setter"]);S&&(S=D(S,this)),(y||S)&&Reflect.defineProperty(this.#r,p,{set:S||function(t){},get:y}),v.attribute&&a(g)&&!i(g)&&this.#k(v,p,g),this.#r[p]=g,u[p]=g}return Object.seal(u)}#k(t,e,r){let n=m(e),s=H(r);mt(t.type)?(s=vt(r),V(s)?s&&!this.hasAttribute(n)?this.toggleAttribute(n,!0):!s&&this.hasAttribute(n)&&this.toggleAttribute(n,!1):this.getAttribute(n)!==s&&this.setAttribute(n,s)):this.getAttribute(n)!==s&&this.setAttribute(n,s)}#O(t,e){let r=t;try{for(let n=0;n<e.length;n++){const s=e[n];r=s===Boolean?vt(t):s===Number?Number(t):s===String?String(t):s===Object||s===Array?W(t):s===Date?new Date(t):new s(t)}}catch(e){ht(this.tagName,"Convert attribute error with "+t)}return r}#M(t,n,s,o){let i=t[n];if(!i)return s;let l=i.isValid,c=i.type,u=N(c)?c:[c],d=i.converter,p=s;if(!e(u,(t=>t===String))&&r(p)&&!R(p))try{p=d?d(p):this.#O(p,u)}catch(t){ht(this.tagName,`Convert attribute '${n}' error with `+p)}for(let t=0;t<u.length;t++){"Boolean"===u[t].name&&o&&(p=vt(p))}if(L(p))return p;let h=typeof p,f=!a(p);for(let t=0;t<u.length;t++){const e=u[t];if(T(h,e.name,"i")||p instanceof e||Object.prototype.toString.call(p)===Object.prototype.toString.call(e.prototype)){f=!0;break}}return f||ht(this.tagName,`Invalid prop '${n}'. expected '${u.map((t=>t.name||t))}' but got '${h}'`),l&&(l.call(this,p,this.#r)||ht(this.tagName,`Invalid prop '${n}'. IsValid() check failed`)),p}#C(){let t=o(this.constructor,ct.STATES);g(t,((e,r)=>{let n=t[r],s=o(this,r);if(n){let t=n.prop;s=t?f(this.#r[t]):o(this,r)}this.#r[r]=s}))}#D=I(this.propsReady,100);_updateProps(t){let e=o(this.constructor,ct.PROPS),r=[];g(t,((t,n)=>{let s=x(n),o=e[s];o&&(t=this.#M(e,s,t),o.attribute&&a(t)&&!i(t)&&r.push([o,s,t]),Lt.__skipCheck=!0,$(this,s,t),Lt.__skipCheck=!1)})),w(this.#l,t),r.forEach((([t,e,r])=>{this.#k(t,e,r)})),this.#l&&this.#D(this.#l)}_wrapperProp={};_initProps(t,e){this.#l=h(this.#l||{},t),this.#a=h(this.#a||{},e),g(t,((t,e)=>{if(i(t)){let r=Vt.get(t);if(r){let t=r.join(Rt);this._wrapperProp[t]=e;let n=o(this.wrapperComponent?.constructor,ct.STATES),s=r[0];if(n&&n[s]){let t=o(this.constructor,ct.PROPS);$(t,[e,"shallow"],n[s].shallow)}}}}))}_bindSlot(t,e,r){if(this.#g[e]||(this.#g[e]=t,Reflect.defineProperty(t,"__l_comp",{value:this})),t.addEventListener("slotchange",(r=>{this.#v&&this.#T(t,"default"===e?"":e)})),!l(r)){let t=this.#e[e];t||(t=this.#e[e]={}),t.props=r}}_bindSlotHook(t,e){this.#h[t]=e}#P=new Set;_updateSlot(t,e,r){let n=this.#g[t],s=this.#h[t];if(!s&&!n)return;let o=this.#e[t];if(e&&(o.props||(o.props={}),o.props[e]=r),s)this.#P.add(t);else{let t=n.assignedElements({flatten:!0});for(let n=0;n<t.length;n++){t[n].setAttribute(e,r+"")}}}#E(){const t=_(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(l(e))return void(l(this.#r["#slots"])||(this.#v?this.#n["#slots"]={}:this.#r["#slots"]={}));g(e,((t,e)=>{if(e){for(;t.length>0;){let e=t[0];if(!(e.nodeType===Node.TEXT_NODE&&s(e.textContent)||e instanceof HTMLSlotElement&&l(e.assignedNodes({flatten:!0}))))break;t.shift()}for(;t.length>0;){let e=b(t);if(!(e.nodeType===Node.TEXT_NODE&&s(e.textContent)||e instanceof HTMLSlotElement&&l(e.assignedNodes({flatten:!0}))))break;t.pop()}}}));let r={};g(e,((t,e)=>{l(t)||(r[e]=t)})),this.#v?this.#n["#slots"]=r:this.#r["#slots"]=r}#_(t){let e=this.#h[t];if(!e)return;let r=this.#e[t];if(!this.#r["#slots"][t])return;this.renderAsync(e,o(r,"props"));const n=this._asyncDirectives.get(e);let s=n?.buildView(e(o(r,"props"))),i=U(v(s),(t=>t.nodeType===Node.COMMENT_NODE));if(i){let e=this.#m[t];if(!l(e))for(let t=0;t<e.length;t++){const r=e[t];r.parentNode?.removeChild(r)}this.#m[t]=i,this.append(...i),this.#P.clear()}}_asyncDirectives=new WeakMap;renderAsync(t,...e){}#A(t,e,r){if(!this.#v)return;if(kt(this.constructor).has(t)){let e=x(t);if(R(r)){r=o(this.constructor,ct.PROPS)[e]._defaultValue}this._updateProps({[e]:r})}}_regDeps(t,e){let r=this.#i[t];r||(r=this.#i[t]=new Set),r.add(e);let n=t.split(Rt);if(n.pop(),n.length<1)return;let s=n.join(Rt);r=this.#i[s],r||(r=this.#i[s]=new Set),r.add(e)}_regWrapper(t){this.#p=t}_getPrivateData(){return this.#r}emit(t,e={},r){r&&r.event&&(e.event=r.event),e.target=this,this.dispatchEvent(new CustomEvent(t,{bubbles:o(r,"bubbles",!1),composed:o(r,"composed",!1),cancelable:!0,detail:e}))}on(t,e){this.#w[t]||(this.#w[t]=[]);let r=e.bind(this);this.#w[t].push(r),this.addEventListener(t,r)}nextTick(t,e){Gt.pushNext(t,e)}forceUpdate(){g(this.#n,((t,e)=>{this.#s[e]={value:void 0,chain:void 0}})),this.#S()}}class te{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(t,e,r){this.startNode=t,this.attrName=e,this.type=r}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}}var ee;!function(t){t.AFTER_BEGIN="afterbegin"}(ee||(ee={}));const re={};function ne(t,e,r,n,s,o,i,a=!1){let c;if(a?(Lt.startRender(t.endNode),c=n(t,e,r,{renderComponent:s,slotComponent:o,varChain:i}),Lt.endRender(s)):c=n(t,e,r,{renderComponent:s,slotComponent:o,varChain:i}),!c)return;let[u,d]=c;if(u===Dt.NONE)return;let p=t.getNodes();if(u===Dt.REMOVE)for(let t=0;t<p.length;t++){const e=p[t];e.parentNode?.removeChild(e)}else if(u===Dt.REPLACE){let e=[];for(let t=0;t<p.length;t++){const e=p[t];e.parentNode?.removeChild(e)}let r=ar(t.endNode,d,s);e=v(r);let n=document.createDocumentFragment();n.append(...e),t.endNode.parentNode.insertBefore(n,t.endNode)}else if(u===Dt.UPDATE){let e,r={},n=[],o=[],i=qe.get(t.endNode);if(d||(d=new fr([],[])),l(p)){let e=ar(t.endNode,d,s);return void t.startNode.after(...e)}let a={};d instanceof fr&&d.vars.forEach((t=>{if(t instanceof fr){const e=t.getKey();a[e]=t,r[e]=!0,o.push(e)}})),p=j(F(p),(t=>t.nodeType===Node.ELEMENT_NODE)),e=j(F(v(e)),(t=>t.nodeType===Node.ELEMENT_NODE));let c={},u="",h={};for(let t=0;t<p.length;t++){let e=p[t],r=e.getAttribute("key");if(r){if(c[r]){u=r;break}c[r]=e,n.push(r),h[r]=!0}}if(u)return void pt(`${x(t.endNode._diName)} - duplicate key '${u}'`);let f=r;const m=t.startNode.parentNode;let E=[],y=[];g(h,((t,e)=>{f[e]||(y.push(e),delete h[e],G(n,(t=>t===e)))}));let S,N=!1;if(!l(o)){let e=-1,r=[],s=[],i=0,a=0;for(;a<o.length;a++){const l=o[a];let u=n.findIndex((t=>t===l));if(u<0){let e=o[a-1],r=e?c[e]||e:t.startNode;E.push({prevNode:r,newkey:l}),i++}else if(u>-1&&u!==a-i){if(e<0||1===Math.abs(e-u)){let t=b(r);r.push({nodeId:l,targetId:0===a?ee.AFTER_BEGIN:t?t.nodeId:o[a-1]})}else s.push({moveGroup:r,moveIndex:a+r.length}),r=[],r.push({nodeId:l,targetId:o[a-1]});e=u}}if(r.length>0&&s.push({moveGroup:r,moveIndex:a+r.length}),s.length>0){N=!0;let e=s.sort(((t,e)=>t.moveGroup.length-e.moveGroup.length));if(e.length<2){let{moveGroup:r}=e[0];if(r.length>1){let t=b(r).targetId;r[r.length-2].nodeId===t&&(r=C(r))}r.forEach((({targetId:e,nodeId:r})=>{let n,s=c[r];e===ee.AFTER_BEGIN?(n=t.startNode,n.after(s)):(n=c[e],n.after(s))}))}else{let r=b(e).moveIndex;1===Math.abs(e[e.length-2].moveIndex-r)&&(e=C(e)),e.forEach((({moveGroup:e})=>{e.forEach((({targetId:e,nodeId:r})=>{let n,s=c[r];e===ee.AFTER_BEGIN?(n=t.startNode,n.after(s)):(n=c[e],n.after(s))}))}))}}}if(E.length>0&&(S=function(t,e,r,n,s,o){const i=[],a=[],l=[];let c,u=[];t.forEach((t=>{let r=b(u);r&&c===t.prevNode?(r.group||(r.group=[c]),r.group.push(t.newkey)):u.push(t),c=t.newkey;let n=t.newkey;l.push(n),i.push(""),a.push(e[n])})),i.push("");let d=new fr(i,a),p=[...s],h=ar(o,d,n),f=qe.get(o);s.length=0,s.push(...f);let g=new Map;return h.forEach((t=>{const e=t.getAttribute("key");l.includes(e)&&(g.set(e,!0),re[e]=t)})),p.forEach(((t,e)=>{const n=t.key+"";!g.get(n)&&r.includes(n)&&s.push(t)})),u}(E,a,o,s,i,t.endNode),S.forEach(((e,r)=>{let n=e.newkey,s=re[n],o=e.prevNode;if(e.group){let t=document.createDocumentFragment();t.append(...z(e.group,(t=>re[t]))),s=t}o===t.endNode?o.before(s):o===t.startNode?o.after(s):"string"==typeof o?re[o].after(s):o.after(s)}))),y.forEach((t=>{let e=c[t];e&&e.parentNode&&m.removeChild(e)})),d.vars[0]instanceof fr){let t=[],e=[];g(d.vars,(r=>{e.push(...r.vars),t.push(...z(r.vars,(t=>"1")))})),t.push("1"),d=new fr(t,e)}if(N||y.length>0||S){const t=B(i,(t=>t.key));let e=[],r=0;o.forEach((n=>{t[n].forEach((t=>{t.varIndex=r++,e.push(t)}))})),i=e}cr(t.endNode,s,d,i)}}let se=0;function oe(t,e){let r=t.name||"Di-"+se++,n=Symbol.for(r);return(...e)=>{let r=t(...e);return[n,e,r,t=>{},Lt.popDirectiveQ()]}}const ie=["resize","outside","mutate"],ae=new WeakMap,le=[],ce=[],ue=[],de=new ResizeObserver((t=>{for(const e of t){const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize,r=Array.isArray(e.borderBoxSize)?e.borderBoxSize[0]:e.borderBoxSize;let n=ae.get(e.target);if(n){n(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:r.inlineSize,h:r.blockSize},contentBox:{w:t.inlineSize,h:t.blockSize}}}),e.target)}}}));var pe;!function(t){t.Child="child",t.Tree="tree",t.Attr="attr",t.Char="char"}(pe||(pe={}));const he=new WeakMap,fe=new MutationObserver((t=>{for(let e=0;e<t.length;e++){const r=t[e];let n=he.get(r.target);if(!n)return;let s={target:r.target},o=null;switch(r.type){case"subtree":s.type=pe.Tree,o=n[pe.Tree];break;case"childList":s.type=pe.Child,s.addedNodes=r.addedNodes,s.removedNodes=r.removedNodes,o=n[pe.Child];break;case"attributes":s.type=pe.Attr,s.attributeName=r.attributeName,s.oldValue=r.oldValue,o=n[pe.Attr];break;case"characterData":s.type=pe.Char,s.oldValue=r.oldValue,o=n[pe.Char]}if(o){o(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:s}))}}}));function ge(t,e,r,n){if("resize"===t)!function(t,e){ae.has(t)||(ae.set(t,e),de.observe(t))}(e,r);else if("outside"===t)switch(n[0]){case"mousedown":!function(t,e){le.push([t,e])}(e,r);break;case"dblclick":!function(t,e){ue.push([t,e])}(e,r);break;default:!function(t,e){ce.push([t,e])}(e,r)}else"mutate"===t&&function(t,e,r){let n=K(r,"child"),s=K(r,"attr"),o=K(r,"char"),i=K(r,"tree"),a=he.get(t);a||(a={},he.set(t,a),n&&(a[pe.Child]=e),s&&(a[pe.Attr]=e),o&&(a[pe.Char]=e),i&&(a[pe.Tree]=e),fe.observe(t,{childList:n,attributes:s,characterData:o,subtree:i}))}(e,r,n)}document.addEventListener("mousedown",(t=>{let e=o(t.composedPath(),0,t.target);le.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(M(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1),document.addEventListener("click",(t=>{let e=o(t.composedPath(),0,t.target);ce.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(M(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1),document.addEventListener("dblclick",(t=>{let e=o(t.composedPath(),0,t.target);ue.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(M(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1);const me=/,|^(debounce:.+)|(debounce$)/,ve=/,|^(throttle:.+)|(throttle$)/,be="self",Ee="stop",ye="prevent",Se="once",Ne="capture",Ce="passive",_e="left",Te="right",Ae="middle",we="ctrl",Pe="alt",Me="shift",ke="meta",Oe={esc:"escape"},De=":";function xe(t,e,r,n){let s,o=t.split("."),i=o.shift(),a=o.includes(Se),l=e;if(s=X(o,(t=>me.test(t)))){let t=s.split(De);l=I(l,parseInt(t[1])||100)}if(s=X(o,(t=>ve.test(t)))){let t=s.split(De);l=Q(l,parseInt(t[1])||100)}if(a&&(l=k(l)),function(t){return ie.includes(t)}(i))return ge(i,r,l,o),l;let c=t=>{if(o.includes(ye)&&t.preventDefault(),o.includes(Ee)&&t.stopPropagation(),!o.includes(be)||t.target===t.currentTarget){if(t instanceof MouseEvent){if(o.includes(_e)&&0!=t.button)return;if(o.includes(Te)&&2!=t.button)return;if(o.includes(Ae)&&1!=t.button)return}else if(t instanceof KeyboardEvent){if(G(o,(t=>t==we))[0]&&!t.ctrlKey)return;if(G(o,(t=>t==Pe))[0]&&!t.altKey)return;if(G(o,(t=>t==Me))[0]&&!t.shiftKey)return;if(G(o,(t=>t==ke))[0]&&!t.metaKey)return;let e=z(o,(t=>Oe[t]||t));if(A(e)>0&&!e.includes(t.key.toLowerCase()))return}l(t)}},u={capture:o.includes(Ne)||!1,passive:o.includes(Ce)||!1};r.addEventListener(i,c,u);let d=n.__events[i];return d||(d=n.__events[i]=[]),d.push([r,c,u]),c}const Re="@",Le=".",He="?",Ve="*",We=":",Ie="ref",$e="key",Be=/(<\/?)\s*([A-Z][A-Za-z0-9]*)([\s>])/gm,Ue=/\s+([\.?@*])?((?:[a-zA-Z]*[A-Z][^\s<>="']+))(?=[\s=>])/gm,je=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,Fe="slot-props",Ge=new Map,ze=new Map,Ke=new Map;var Xe;!function(t){t.Event="event",t.Directive="directive",t.DirectiveTag="directiveTag",t.DirectiveAttr="directiveAttr",t.DirectiveProp="directiveProp",t.DirectiveText="directiveText",t.DirectiveSlot="directiveSlot",t.Attr="attr",t.AttrProp="attrProp",t.AttrBool="attrBool",t.AttrRef="attrRef",t.AttrSlot="attrSlot",t.AttrKey="key",t.Ref="ref",t.Text="text"}(Xe||(Xe={}));const Qe=new WeakMap,qe=new WeakMap,Ye=new WeakMap,Ze=new WeakMap,Je=new WeakMap,tr=new WeakMap;function er(t,e){let r="",n=u(e.vars),s=e.strings.length-1,i=e.vars.length-1,a=0;for(let l=0;l<=s;l++){const s=e.strings[l];let c=o(n,a,"");if(c instanceof fr){let[e,r]=er(t,c);c=e,n.splice(a,1,...r),a+=r.length-1}else c=l>i?"":nr;a++,r=r+s+c}let l=0;return r=r.replace(je,((t,e)=>tt(t,nr,(()=>nr.replace("--\x3e","")+l++)))),r=r.replace(pr,"$1><").trim(),r=rr(r),[r,n]}function rr(t){return r(t)?t=(t=t.replace(Ue,((t,e,r)=>` ${e??""}${m(r)}`))).replace(Be,((t,e,r,n)=>e+dt[r]+n)):t+""}const nr="\x3c!--c_ui-pl_df--\x3e",sr="\x3c!--c_ui-pl_df",or=/<!--c_ui-pl_df\d*(-->)?/;function ir(t,e,r,n,s=!1){const o=document.createElement("div");o.innerHTML=e;const i=Ke.has(n.constructor);s||!i||ze.has(n.constructor)||ze.set(n.constructor,o.cloneNode(!0));let l=0;const c=document.createNodeIterator(o,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let u,d,p=0,h=i?void 0:{},f=null,g="";for(;u=c.nextNode();){l++;let e=i?void 0:[];if(d&&!d.contains(u)&&(d=void 0),u instanceof HTMLElement||u instanceof SVGElement){u instanceof Jt&&(d=u);let s={},o=v(u.attributes);for(let i=0;i<o.length;i++){const l=o[i];let{name:c,value:h}=l;if(c!==Fe)if(E(c,sr)){let s=r[p];if(N(s)&&y(s[0])){let[,r,o,i,a]=s;i(Ot.TAG);let l=new te(u,c.substring(1),Ot.TAG),h=tr.get(u);h||(h={},tr.set(u,h)),h[Symbol.keyFor(s[0])]=[l,n,d];let m=new xt(p,u);m.isDirective=!0,m.value=s,m.isComponent=!!d,t.push(m),f&&f?.contains(u)&&(m.key=g),p++,o(l,r,void 0,{renderComponent:n,slotComponent:d,varChain:a}),e&&e.push({type:Xe.DirectiveTag,point:l,up:m,name:c})}u.removeAttribute(c)}else if(c[0]!==Re)if(c!==Ie)if(c!==$e){if(or.test(h)){let o=r[p],i=new xt(p,u,c.replace(/\.|\?|@/,""),h);if(i.isComponent=!!d,f&&f?.contains(u)&&(i.key=g),c[0]===Le||c[0]===He||c[0]===Ve){if(N(o)&&y(o[0])){let[,t,r,s,a]=o;s(Ot.PROP);let l=c.substring(1),p=new te(u,l,Ot.PROP),h=tr.get(u);h||(h={},tr.set(u,h)),h[l]=[p,n,d],r(p,t,void 0,{renderComponent:n,slotComponent:d,varChain:a}),i.value=o,i.isDirective=!0,e&&e.push({type:Xe.DirectiveProp,up:i,point:p,name:c,attrName:l})}else if(c[0]===He){i.isToggleProp=!0,i.value=!!o;let t=c.substring(1);i.value&&u.setAttribute(t,""),e&&e.push({type:Xe.AttrBool,name:t,up:i,attrName:c})}else if(c[0]===Ve){i.value=o;let t=c.substring(1);const[r,n]=t.split(We);let s=r;switch(n){case"camel":s=x(s);break;case"kebab":s=m(s);break;case"snake":s=et(s)}i.attrName=s,u.setAttribute(s,o),e&&e.push({type:Xe.AttrRef,up:i,name:c,attrName:s})}else{let t=x(c.substring(1));i.value=o,i.isProp=!0,s[t]=o,e&&e.push({type:Xe.AttrProp,up:i,name:t,attrName:c})}u.removeAttribute(c),o=""}else{let t,r;i.value=o;let s={type:Xe.Attr,up:i,attrName:c};if(N(o)&&y(o[0])){let e=Ot.ATTR;"class"===c?e=Ot.CLASS:"style"===c&&(e=Ot.STYLE);let[,a,l,p,h]=o;p(e),i.isDirective=!0,i.attrName=c;let f=new te(u,c,e),g=tr.get(u);g||(g={},tr.set(u,g)),g[c]=[f,n,d],r=a,t=l,o="",s.type=Xe.DirectiveAttr,s.point=f}h=Z(h,or,o),l.value=h,a(h)&&u.setAttribute(c,h),t&&t(s.point,r,void 0,{renderComponent:n,slotComponent:d}),e&&e.push(s)}t.push(i),p++}}else{let n=r[p];u.setAttribute(c,n);let s=new xt(p,u);s.notUpdated=!0,f&&f?.contains(u)&&(s.key=g),t.push(s),p++,f=u,g=n,e&&e.push({up:s,type:Xe.AttrKey}),t.length>0&&t.forEach((t=>{t.key=t.key??n}))}else{if(or.test(h)){let n=r[p],s=new xt(p,u);s.notUpdated=!0,f&&f?.contains(u)&&(s.key=g),t.push(s),p++,n.current=u,e&&e.push({type:Xe.Ref,up:s,attrName:c})}u.removeAttribute(c)}else{let s=t=>{},o=null,i=!1;if(or.test(h)){o=new xt(p,u),o.notUpdated=!0,f&&f?.contains(u)&&(o.key=g),t.push(o),s=r[p].bind(n),p++,i=!0}let a=c.substring(1);xe(a,s,u,n),u.removeAttribute(c),e&&e.push({type:Xe.Event,up:o,name:a,attrName:c,value:i})}else{let t=u.getAttribute("name")||"default";e&&e.push({type:Xe.AttrSlot,name:t,attrName:c})}}u instanceof Jt?(u._regWrapper(n),A(s)>0&&u._initProps(s)):u instanceof HTMLSlotElement&&n._bindSlot(u,u.name||"default",s)}else{let s=u;if(`\x3c!--${s.nodeValue}--\x3e`!==nr)continue;let o=new xt(p,u);f&&f?.contains(u)&&(o.key=g),t.push(o),o.isComponent=!!d,o.isText=!0;let i=r[p];if(N(i)&&y(i[0])){const t=Symbol.keyFor(i[0]);let r;r=document.createComment(`compelem-${n.tagName}-${t}-start`),o.textNode=r,s.parentNode.insertBefore(r,s),s.nodeValue=`compelem-${n.tagName}-${t}-end`,s._diName=t,o.isDirective=!0,o.value=i;let a=d?Ot.SLOT:Ot.TEXT,[,l,c,u,p]=i;u(a);let h=new te(r,"",a);h.endNode=s,Ze.set(s,[h,n,d,l,p]),Ye.set(s,c),Je.set(s,o),Lt.startRender(s);let f=c(h,l,void 0,{renderComponent:n,slotComponent:d,varChain:p});if(Lt.endRender(n),f){let t=ar(s,f[1],n);t&&t.length>0&&ur.insertBefore(s,Array.from(t))}i=void 0,e&&e.push({type:a===Ot.SLOT?Xe.DirectiveSlot:Xe.DirectiveText,up:o,point:h})}else o.value=i,e&&e.push({type:Xe.Text,up:o});p++;let a=J(i??""),l=document.createTextNode(a);s.parentNode.insertBefore(l,s),o.textNode=l}h&&e&&(h[l]=e),f&&!f.contains(u)&&f!==u&&(f=null,g="")}return!s&&h&&Ke.set(n.constructor,h),o.childNodes}function ar(t,e,r){let[n,s]=er(r,e),o=[],i=ir(o,n,s,r,!0);return qe.set(t,o),i}function lr(t,e,r,n){if(s(O(t.strings)))return;if(!Qe.has(e))return;r=r??Qe.get(e);let a=t.flatVars(e);for(let t=0;t<r.length;t++){const s=r[t];let l=s.varIndex;if(l<0)continue;if(s.notUpdated)continue;let c=s.value,d=a,p=s.node,h=q(l,Rt);for(let e=0;e<h.length;e++){const r=h[e];d=o(d,r),d&&d.vars&&t<h.length-1&&(d=d.vars)}if(!i(c)&&c===d)continue;let f=p;if(s.isDirective){let[t,e,r,,n]=s.value,o=Ze.get(p);if(!o){const e=tr.get(p);o=e[s.attrName]||e[Symbol.keyFor(t)]}if(!N(d))continue;let[i,a,l]=o,[,c]=d;const u=Je.get(p);if(u){u.value=d;Ze.get(p)[3]=c}ne(i,c,e,r,a,l,n,i.type==Ot.TEXT||i.type==Ot.SLOT)}else if(s.isToggleProp){if(!!d===c)continue;f.toggleAttribute(s.attrName,!!d),$(f,s.attrName,!!d)}else if(s.isProp){if(!i(d)&&d===c)continue;if(p instanceof Jt)if(i(d)&&Object.is(d,c)){let t,e=x(s.attrName),r=[e],i=d;if(n&&n.length>0){let t="",a=O(Vt.get(s.value),Rt);n.forEach((e=>{e.startsWith(a)&&e.length>t.length&&(t=e)})),r=u(q(t.replace(a,e),Rt)),i=o(p,r)}jt(p,c,r,i,t)}else p._updateProps({[s.attrName]:d});else p instanceof HTMLSlotElement&&e._updateSlot(p.getAttribute("name")||"default",s.attrName,d)}else if(s.attrName){if(!Y(c,d))switch(s.attrName){case"value":if(p instanceof HTMLInputElement){p.value=d;break}default:p.setAttribute(s.attrName,Z(s.attrTmpl,or,d+""))}}else if(s.isText){s.textNode.textContent=J(d??"")}s.value=d}}function cr(t,e,r,n,s){const o=Ye.get(t),[i,a,l,c,u]=Ze.get(t),d=Je.get(t);if(!r){let t=o(i,d.value[1],c,{renderComponent:a,slotComponent:l,varChain:u});if(!t)return;r=t[1]}if(r&&r.vars[0]instanceof fr){let t=[],e=[];g(r.vars,(r=>{e.push(...r.vars),t.push(...z(r.vars,(t=>"1")))})),t.push("1"),r=new fr(t,e)}n&&qe.set(t,n),lr(r,e,n=n??qe.get(t),s)}const ur={insertBefore:function(t,e){if(!t.parentNode)return;let r=document.createDocumentFragment();r.append(...e),t.parentNode.insertBefore(r,t)},remove:function(t,e){if(t===e)return void t?.parentNode?.removeChild(t);let r=t.nextSibling;for(;r&&r!==e;)r?.parentNode?.removeChild(r),r=t.nextSibling}};function dr(t,...e){return new fr(r(t)?[t]:t,e)}const pr=/([a-z0-9"'])\s*>\s*</gim;function hr(t){return{current:t}}class fr{strings;vars;constructor(t,e){this.strings=u(t),this.vars=e}getKey(){let t=this.vars,e="";return g(this.strings,((r,n)=>{if(at.test(r))return e=J(t[n]),!1})),e}getKeys(){let t=this.vars,e=[];for(let r=0;r<this.strings.length;r++){const n=this.strings[r];if(at.test(n)){let n=J(t[r]);e.push(n)}}return l(e)&&t.forEach((t=>{if(t instanceof fr){let r=t.getKey();e.push(r)}})),e}append(t){let e=b(this.strings);return t.strings.forEach(((t,r)=>{0!=r?this.strings.push(t):this.strings[this.strings.length-1]=e+t})),this.vars=u(this.vars,t.vars),this}insert(t,e){let r=e.strings.shift();return this.strings[t]+=r,this.strings.splice(t+1,0,...e.strings),this.vars.splice(t,0,...e.vars),this}getHTML(t){let[e,r]=er(t,this),n=ir([],e,r,t);return nt(n,((t,e)=>t+(e.outerHTML??"")),"")}flatVars(t){let e=u(this.vars),r=this.strings.length-1,n=0;for(let s=0;s<=r;s++){let r=o(e,n,"");if(r instanceof fr&&r.vars.length>0){let[s,o]=er(t,r);r=s,e.splice(n,1,...o),n+=o.length-1}n++}return e}}function gr(t,e,r){r.get||pt(`Computed '${e}' must be a getter`),c(t.constructor,ct.COMPUTED)||(t.constructor[ct.COMPUTED]=l(t.constructor[ct.COMPUTED])?{}:f(t.constructor[ct.COMPUTED])),t.constructor[ct.COMPUTED][e]=r.get}const mr=Tt(class extends Et{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=o(t,r);$(t,r,I(s,this.wait,this.immediate));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&$(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[bt.METHOD]}wait;immediate;result;constructor(t,e=!1){super(),this.wait=t,this.immediate=e}});function vr(t,e){return(r,n,s)=>{c(r.constructor,ct.EVENTS)||(r.constructor[ct.EVENTS]=l(r.constructor[ct.EVENTS])?[]:f(r.constructor[ct.EVENTS])),r.constructor[ct.EVENTS].push({name:t,options:e,fn:r[n]})}}const br=Tt(class extends Et{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=D(o(t,r),t);$(t,r,k(s));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&$(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[bt.METHOD]}wait;result;constructor(){super()}});var Er;!function(t){t.ONCE="once",t.UPDATABLE="updatable"}(Er||(Er={}));class yr extends Et{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){}mounted(t,e,...r){}get targets(){return[bt.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,r,n,...s){const o=this;Reflect.defineProperty(t,n,{get:()=>(o.result&&o.cache||o.getter(t),o.result)})}updated(t,e){this.cache===Er.UPDATABLE&&this.getter(t)}}const Sr=Tt(yr),Nr=Tt(class extends yr{getter(t){this.result=t.shadowRoot?.querySelectorAll(this.selector)}});function Cr(t){if(1===arguments.length)return(e,r)=>{_r(e,r,t)};_r(arguments[0],arguments[1],{prop:""})}function _r(t,e,r){if(!c(t.constructor,ct.STATES)){const e={};let r=t.constructor;for(;(r=gt(r))!==Jt;)h(e,r[ct.STATES]?f(r[ct.STATES]):{});Reflect.defineProperty(t.constructor,ct.STATES,{configurable:!1,enumerable:!1,value:e})}r.shallow=r.shallow||!1,t.constructor[ct.STATES][e]=r}function Tr(t,e,r){_r(t.prototype,e,r||{prop:""})}function Ar(t){return e=>{if(e){if(e.prototype.hasOwnProperty("attributeChangedCallback")){let t=e.prototype.attributeChangedCallback;e.prototype.attributeChangedCallback=function(e,r,n){Jt.prototype.attributeChangedCallback.call(this,e,r,n),t.call(this,e,r,n)}}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.disconnectedCallback;e.prototype.disconnectedCallback=function(){Jt.prototype.disconnectedCallback.call(this),t.call(this)}}dt[e.name]=t,customElements.define(t,e)}}}const wr=Tt(class extends Et{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=o(t,r);$(t,r,Q(s,this.wait));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&$(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[bt.METHOD]}wait;result;constructor(t){super(),this.wait=t}});function Pr(t,e){return(r,n)=>{c(r.constructor,ct.WATCH)||(r.constructor[ct.WATCH]=l(r.constructor[ct.WATCH])?{}:f(r.constructor[ct.WATCH]));(N(t)?t:[t]).forEach((t=>{let s=t.replaceAll(".",Rt),o=r.constructor[ct.WATCH][s];N(o)||(o=r.constructor[ct.WATCH][s]=[]),o.push({source:t,options:e,handler:r[n]})}))}}const Mr=["key"],kr=oe((function(t){return(t,[e],r)=>{let n=t.startNode;if(r)g(e,((t,e)=>{n.setAttribute(e,t)}));else if(n instanceof Jt){let t={},r={},s=o(n.constructor,ct.PROPS);g(e,((e,n)=>{if(Mr.includes(n))return;let o=x(n);s[o]?t[n]=e:r[n]=e+""})),n._initProps(t,r)}else g(e,((t,e)=>{n.setAttribute(e,t)}))}}),Ot.TAG),Or=new Map,Dr=oe((function(t){return(t,[e],n,{renderComponent:s})=>{let o=[];if(N(e)?o=F(e):i(e)?o=_(e,((t,e)=>t?e:[])):r(e)&&(o=e.split(" ")),o.length<1&&!n)return;let a=t.startNode;if(Or.get(a)&&Or.get(a).length===o.length&&st(Or.get(a),o))return;let l=Or.get(a);g(l,(t=>{a.classList.remove(t)})),g(o,(t=>{a.classList.add(t)})),l=u(o),Or.set(a,l)}}),Ot.CLASS),xr=new Map,Rr=new Map,Lr=oe((function(t,e){return(t,r,n,{varChain:s})=>{let o=t.startNode,i=function(t,e,r){let n=z(t,((t,r)=>e(t,r)));if(n.length<1){let t=new fr([],[]);return Rr.set(r,t),t}let s=[],o=[];const i=[],a=[];for(let t=0;t<n.length;t++){const e=n[t];let r=b(o),l=e.vars,c=!0,u=e.strings;for(let t=0;t<u.length;t++){const e=u[t];if(at.test(e)){let e=l[t]+"";if(s.includes(e))return void pt(`forEach - duplicate key '${e}'`);s.push(e),c=!1}0==t&&r?o[o.length-1]=r+e:o.push(e)}if(c)return void pt("forEach - missing 'key' prop");let d=b(i);d&&u.length>0&&(i[i.length-1]=H(d)+u.shift()),i.push(""),a.push(e)}i.push("");let l=new fr(i,a);return Rr.set(r,l),l}(r[0],e,o);if(n&&n[0]){const e=xr.get(o);if(l(t.getNodes())&&(!r||l(r[0])))return[Dt.NONE,i];if(e&&st(e,r[0])&&e.length===r[0].length)return[Dt.NONE,i]}return xr.set(o,rt(r[0])),n?[Dt.UPDATE,i]:[Dt.APPEND,i]}}),(Ot.TEXT,Ot.SLOT));let Hr=document.createElement("div");const Vr=oe((function(t){return(t,e,r,{renderComponent:n,slotComponent:s})=>{r&&e[0]==r[0]||L(e[0])||(Hr.innerHTML=rr(e[0]),t.startNode.after(...Hr.childNodes))}}),(Ot.TEXT,Ot.SLOT)),Wr=oe((function(t){return(t,e,r,{renderComponent:n,slotComponent:s})=>{r&&e[0]==r[0]||L(e[0])||(t.startNode.innerHTML=rr(e[0]))}}),Ot.TAG),Ir=new WeakMap,$r=oe((function(t,e,r){return(n,[s,o],i,{renderComponent:a})=>{let l=n.endNode;if(i){if(!!s==!!i[0]){let t=Ir.get(l);return[Dt.NONE,t.call(a,s)]}let t=s?e:r;return Ir.set(l,t),[Dt.REPLACE,t.call(a,s)]}{let n=s?e:r;return Ir.set(l,n),[Dt.APPEND,n.call(a,t)]}}}),(Ot.TEXT,Ot.SLOT)),Br=oe((function(t,e){return(t,[e,r],n)=>n?e===n[0]?[Dt.NONE,e?r():dr``]:e?[Dt.REPLACE,e?r():dr``]:[Dt.REMOVE]:[Dt.APPEND,e?r():dr``]}),(Ot.TEXT,Ot.SLOT));var Ur;!function(t){t.CHANGE="change",t.INPUT="input"}(Ur||(Ur={}));const jr=oe((function(e,n="value",s){return(a,l,c,{varChain:u,renderComponent:d})=>{const p=a.startNode;if(c){const t=c[0],e=l[0];let r=o(p,n);if(!i(e)&&Object.is(e,t)&&Object.is(r,e))return;if(p instanceof Jt)p._updateProps({[n]:e});else if(p instanceof HTMLTextAreaElement||p instanceof HTMLSelectElement){if(p.setAttribute(n,e+""),p instanceof HTMLSelectElement){let t=X(p.querySelectorAll("option"),(t=>t.value==e));t&&(t.selected=!0)}}else if(p instanceof HTMLInputElement){if(p.value==e)return;switch(p.type){case"checkbox":case"radio":e?p.setAttribute("checked",""):p.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":p.setAttribute(n,e+""),$(p,n,e);break;default:p.setAttribute(n,e+"")}}return}if("binded"===o(p,"_model"))return;let h;h=r(s)?t(s):b(u);const f=h[0];if(f in d||d._wrapperProp[f]||pt(`model - property '${f}' is not defined on the instance of `+d.tagName),i(e)||H(e)||(e=""),p instanceof Jt)p._initProps({[n]:e}),p.addEventListener("update:"+n,(t=>{let e=d,r=d._wrapperProp[f];!(f in d)&&r&&o(d.wrapperComponent,f)===o(d,r)&&(e=d.wrapperComponent||e),$(e,h,t.detail.value)})),$(p,"_model","binded");else if(p instanceof HTMLTextAreaElement)p.setAttribute(n,e+""),p.addEventListener("input",(t=>{let e=t.target;$(d,h,e.value)})),$(p,"_model","binded");else if(p instanceof HTMLInputElement){let t="",r="";switch(p.type){case"checkbox":case"radio":t="checked",r="change";break;default:t="value",r="input"}p.setAttribute(n??t,e+""),p.addEventListener(r,(t=>{let e=t.target;$(d,h,e.value)})),$(p,"_model","binded")}else p instanceof HTMLSelectElement&&(p.setAttribute(n,e+""),p.addEventListener("change",(t=>{let e=t.target,r=d,n=d._wrapperProp[f];!(f in d)&&n&&o(d.wrapperComponent,f)===o(d,n)&&(r=d.wrapperComponent||r),$(r,h,e.value)})),$(p,"_model","binded"))}}),Ot.TAG),Fr=new Map,Gr=oe((function(t,e){return(t,[r],n)=>{if(n&&r===n[0])return;let s=t.startNode;if(!Fr.has(s)){let t=s.style.display;Fr.set(s,"none"==t?"unset":t)}s.style.display=r?Fr.get(s):"none",e&&e(s,r)}}),Ot.TAG),zr=oe((function(t,e){return(r,n,s,{renderComponent:o,slotComponent:i})=>{s||(t=t.bind(o),i._bindSlotHook(e||"default",t))}}),Ot.SLOT);class Kr{static getCssText(t,e=!1){return r(t)?t:O(z(t,((t,r)=>r.startsWith("--")?r+":"+t+(e?" !important":""):m(r)+":"+t+(e?" !important":""))),";")}static setStyle(t,e){if(r(t)&&!H(t))return{};let n=Kr.getCssText(t),s={};return g(n.split(";"),(t=>{let r=t.split(":"),n=H(r[0]),o=H(r[1]);s[n]=e.style.getPropertyValue(n),e.style.setProperty(n,o)})),s}}const Xr=new Map;let Qr=0;const qr=oe((function(t){return(t,e,r,{renderComponent:n})=>{let s=t.startNode,o=Xr.get(s);o||(o="style_d"+Qr++,Xr.set(s,o)),n.isMounted?n.nextTick((()=>{Kr.setStyle(e[0],s)}),o):Kr.setStyle(e[0],s)}}),Ot.STYLE),Yr=oe((function(t){return(e,r,n,{renderComponent:s,varChain:o})=>{const i=e.startNode;if(n){if(!Y(r,n)){let t=e.attrName;i._updateProps({[t]:r[0]})}return}let a=b(o),l=e.attrName;i._initProps({[l]:t}),i.addEventListener("update:"+l,(t=>{$(s,a,t.detail.value)}))}}),Ot.PROP),Zr=oe((function(t,e){return(t,[e,r],n)=>{let s=()=>dr``,o=[],i=[];g(r,((t,e)=>{if(S(t))o.push(e),i.push(t);else{let e=t[0],r=t[1];o.push(e),i.push(r)}"default"===e&&(s=t)}));let a=ot(o,(t=>S(t)?t(e):t==e));return n?[Dt.REPLACE,it(i[a]??s)]:[Dt.APPEND,it(i[a]??s)]}}),(Ot.TEXT,Ot.SLOT));export{Jt as CompElem,Kr as CssHelper,Et as Decorator,bt as DecoratorType,Ct as DecoratorWrapper,Dt as DirectiveUpdateTag,te as EnterPoint,Ot as EnterPointType,yt as GetKeyFnName,Ur as ModelTriggerType,Rt as PATH_SEPARATOR,Zt as PROP_OBJECT_KEY_MAP_SYMBOL,Er as QueryCache,fr as Template,xt as UpdatePoint,Nt as _DecoratorMap,St as _DecoratorsKey,kt as _getObservedAttrs,kr as bind,er as buildHTML,Dr as classes,gr as computed,hr as createRef,mr as debounced,Tt as decorator,oe as directive,vr as event,Lr as forEach,dr as html,Vr as htmlC,Wr as htmlD,$r as ifElse,Br as ifTrue,Tr as makeState,jr as model,br as onced,wt as prop,Sr as query,Nr as queryAll,Gr as show,zr as slot,Cr as state,qr as styles,Yr as sync,Ar as tag,wr as throttled,ne as updateDirective,Pr as watch,Zr as when};
7
+ import{toPath as e,some as t,isString as r,isUndefined as n,isBlank as s,closest as o,get as i,isObject as a,isDefined as l,isEmpty as c,has as u,concat as d,set as p,bind as h,defaults as f,isLowerCaseChar as g,merge as m,cloneDeep as v,each as b,kebabCase as E,toArray as S,last as y,startsWith as N,isSymbol as _,isFunction as T,isArray as C,initial as A,flatMap as w,test as P,size as M,assign as k,first as O,once as D,join as x,camelCase as R,isNull as L,isNil as H,trim as V,isBoolean as W,parseJSON as I,debounce as $,groupBy as j,reject as U,remove as B,filter as F,compact as G,map as z,includes as X,find as K,throttle as Q,replaceAll as q,split as Y,isEqual as Z,replace as J,toString as ee,clone as te,snakeCase as re,reduce as ne,isMatch as se,findIndex as oe,call as ie}from"myfx";const ae=/\s+\.?key\s*=/;var le,ce,ue;!function(e){e[e.CSS=1]="CSS",e[e.COMPUTED=2]="COMPUTED"}(le||(le={})),function(e){e.PROPS="__deco_props",e.STATES="__deco_states",e.COMPUTED="__deco_computed",e.WATCH="__deco_watch",e.EVENTS="__deco_events"}(ce||(ce={})),function(e){e.Prod="prod",e.Dev="dev"}(ue||(ue={}));const de={};function pe(e){console.error("[CompElem]",e)}function he(e,t){console.error(`[CompElem <${e}>]`,t)}function fe(...e){console.warn("[CompElem]",...e)}function ge(e,t){console.warn(`[CompElem <${e}>]`,t)}function me(t){return e(t).join("-")}function ve(e){return Object.getPrototypeOf(e)}function be(e){return e===Boolean||t(e,(e=>e===Boolean))}function Ee(e){let t=e;return r(e)&&/(?:^true$)|(?:^false$)/.test(t)?t="true"===t:(n(t)||s(t))&&(t=!0),t}"function"==typeof SuppressedError&&SuppressedError;const Se={getNodes(e,t){let r=e.nextSibling;if(!t)return[r];let n=[];for(;r&&r!==t;)n.push(r),r=r?.nextSibling;return n},insertBefore:function(e,t){if(!e.parentNode)return;let r=document.createDocumentFragment();r.append(...t),e.parentNode.insertBefore(r,e)},remove:function(e,t){if(e===t)return void e?.parentNode?.removeChild(e);let r=e.nextSibling;for(;r&&r!==t;)r?.parentNode?.removeChild(r),r=e.nextSibling},clear(e,t){}};function ye(e,t){let r=o(e,(e=>e.host&&e.host instanceof it),"parentNode");if(!r||r.host!==t)return r?r.host:void 0}var Ne;!function(e){e.CLASS="class",e.FIELD="field",e.METHOD="method"}(Ne||(Ne={}));class _e{static get priority(){return 0}}const Te="getKey",Ce="__decorators",Ae=new WeakMap;class we{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(e,t,r){this.args=e,this.metadata=t,this.decoratorClass=r,this.priority=i(r,"priority",0),this.instanceMap=new WeakMap}create(e){let t,r=new this.decoratorClass(...this.args),s=r.targets,o=this.metadata[2];a(o)&&l(i(o,"configurable"))?t=Ne.METHOD:n(this.metadata[2])&&(t=Ne.FIELD),!c(s)&&t&&s.includes(t)?(r.created(e,...this.metadata),this.instanceMap.set(e,r)):pe(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${s.join(",")}' bug got '${t}'`)}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 Pe=new WeakMap;function Me(e){let t=(...t)=>(...r)=>{let n=r[0].constructor,s=n[Ce];if(!u(n,Ce)){let e=Object.getPrototypeOf(n);s=e?d(e[Ce]??[]):[],Reflect.defineProperty(n,Ce,{configurable:!1,enumerable:!1,value:s})}let o,i={},a=e[Te];if(a){let r=Pe.get(e);if(r||(r=new WeakMap,Pe.set(e,r)),i=r.get(n),i||(i={},r.set(n,i)),o=a(...t),i[o])return i[o]}let l=new we(t,r,e);return i[o]=l,s?.push(l),l};return Ae.set(t,!0),t}function ke(e){let t=(...t)=>{if(!t||t.length<1)return;let r=t[0].constructor,n=r[Ce];if(!u(r,Ce)){let e=Object.getPrototypeOf(r);n=e?d(e[Ce]??[]):[],Reflect.defineProperty(r,Ce,{configurable:!1,enumerable:!1,value:n})}let s=new we([],t,e);return n?.push(s),s};return Ae.set(t,!0),t}const Oe=ke(class extends _e{static get priority(){return Number.MAX_VALUE}created(e,t,r,...n){let s=i(e,r);p(e,r,h(s,e))}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[Ne.METHOD]}constructor(){super()}}),De=new WeakMap;function xe(e){if(1===arguments.length)return(t,r,n)=>{e.required=e.required||!1,e.attribute=!1!==e.attribute,Re(t,r,e,n)};let t=arguments[0],r=arguments[1],n=arguments[2];e={type:void 0,required:!1,attribute:!0},n&&"function"==typeof n.type&&(e=f(n,e),n=void 0),Re(t,r,e,n)}function Re(e,t,r,n){let s;if(g(t[0])||pe(`Prop '${t}' must be in CamelCase`),!u(e.constructor,ce.PROPS)){const t={};let r=e.constructor;for(;(r=ve(r))!==it;)m(t,r[ce.PROPS]?v(r[ce.PROPS]):{});Reflect.defineProperty(e.constructor,ce.PROPS,{configurable:!1,enumerable:!1,value:t}),s=new Set,b(t,((e,t)=>{if(e.attribute){let e=E(t);s?.add(e)}})),De.set(e.constructor,s)}if(n&&(n.get&&(r.getter=n.get),n.set&&(r.setter=n.set)),r.attribute){s||(s=De.get(e.constructor));let r=E(t);s?.add(r)}u(e.constructor,"observedAttributes")||(e.constructor.observedAttributes=[]),e.constructor.observedAttributes=S(s),e.constructor[ce.PROPS][t]=r}const Le=new Set;function He(e){return De.get(e)??Le}var Ve,We;!function(e){e.ATTR="attr",e.PROP="prop",e.TEXT="text",e.CLASS="class",e.STYLE="style",e.SLOT="slot",e.TAG="tag"}(Ve||(Ve={})),function(e){e.NONE="NONE",e.REMOVE="REMOVE",e.REPLACE="REPLACE",e.UPDATE="UPDATE",e.APPEND="APPEND"}(We||(We={}));class Ie{key;varIndex;value;node;attrName;attrTmpl;isText=!1;isDirective=!1;textNode;isComponent=!1;isProp=!1;isToggleProp=!1;notUpdated;__destroyed=!1;directiveOldValue;children;parent;constructor(e,t,r,n){this.varIndex=e,this.node=t,r&&(this.attrName=r),n&&(this.attrTmpl=n)}static createFrom(e){let t=new Ie(e.varIndex,e.node,e.attrName,e.attrTmpl);return t.key=e.key,t.value=e.value,t.isText=e.isText,t.isDirective=e.isDirective,t.isComponent=e.isComponent,t.isProp=e.isProp,t.isToggleProp=e.isToggleProp,t.notUpdated=e.notUpdated,t}insert(e){e.parent=this,this.children||(this.children=[]),this.children.push(e)}}const $e="-",je={collectWatch(e,t,r){let n=ze.get(e);n||(n={},ze.set(e,n));let s=n[r];s||(s=n[r]=[]),s.push(t)},startCollect(e,t){this.__collectType=t,this.__collecting=e},setUpdater(e){this.__updater=e},endCollect(){this.__collecting=null},__directiveQ:[],setDirectiveQ(e){let t=y(this.__directiveQ);const r=e?e.join(","):"",n=t?t.join(","):"";t&&r===n||(t&&t.length<e.length&&N(r,n)?this.__directiveQ[this.__directiveQ.length-1]=e:this.__directiveQ.push(e))},popDirectiveQ(){let e=d(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=[]},__updater:null,__collecting:null,__collectType:-1,__renderCollection:new Set,__renderContext:null,__renderCollecting:!1,__skipCheck:!1},Ue=new WeakMap,Be=new WeakMap,Fe=new WeakMap,Ge=new WeakMap,ze=new WeakMap,Xe=new WeakMap;function Ke(e,t){if(!a(e))return e;if(Xe.has(e))return Xe.get(e);if(Ue.has(e))return e;const r=new Proxy(e,{get(e,t,r){if(!t)return;const n=Reflect.get(e,t,r);if(_(t))return n;if(T(n))return n;if("length"===t&&C(e))return n;let s=Be.get(r)??[],o=d(s,[t]),l=t in e;if((je.__renderCollecting||je.__collecting)&&(l&&e.hasOwnProperty(t)||!l)){let e=o.join($e);if(je.__renderCollecting)je.collect(me(o)),je.setDirectiveQ(o);else if(je.__collecting){let t;switch(je.__collectType){case le.COMPUTED:t=Fe.get(je.__collecting),t||(t={},Fe.set(je.__collecting,t));break;case le.CSS:t=Ge.get(je.__collecting),t||(t={},Ge.set(je.__collecting,t))}let r=t[e];r||(r=t[e]=[]),r.push(je.__updater)}}const c=Ue.get(r);let u=c.from;if(Xe.has(n))return Xe.get(n);let p=i(u.constructor,ce.STATES),h=i(p,[o[0]]);if(!h){let e=i(u.constructor,ce.PROPS);h=i(e,[o[0]])}if(!h)return n;if(i(h,"shallow")&&o.length>1)return n;let f=n;if(a(n)&&!T(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){let e=c.pathMap;c.contextSet.forEach((t=>{let r=e?.get(t);r&&(f=Ke(n,t),Xe.set(n,f),Be.has(f)||Be.set(f,o))}))}return f},set(e,r,n,s){if(!r)return!1;if(!t.isMounted){return Reflect.set(e,r,n)}let o=e[r],a=Be.get(s)??[],l=d(a,[r]),c=i(t.constructor,ce.PROPS),u=i(t.constructor,ce.STATES),p=i(c,[l[0],"hasChanged"])||i(u,[l[0],"hasChanged"]),h=n,f=o;if(l.length>1&&(f=h=t._getPrivateData()[l[0]]),p){if(!p.call(t,h,f,l,n,o))return!0}else if(Object.is(o,n))return!0;c&&c[r]&&e.__isData&&c[r].sync&&t.emit("update:"+r,{value:n});let g=n,m=Reflect.set(e,r,g);return Qe(t,f,l,n,o),m}});let n=Be.get(e)??[];if(Object.isExtensible(e)&&!Ue.get(r)){let e=new Set;e.add(t);let s=new WeakMap;s.set(t,n),Ue.set(r,{from:t,contextSet:e,pathMap:s})}else{Ue.get(r).contextSet.add(t);let e=Ue.get(r).pathMap,s=e.get(t),o=d(n);if(s&&s.join("")!==o.join("")){let e=i(t,A(s));C(e)||fe(`The object is referenced by more than one @state '${o.join(".")},${s.join(".")}'`),s=o}else e.set(t,o)}return Xe.set(e,r),r}function Qe(e,t,r,n,s){let o=Fe.get(e),a=Ge.get(e),l=ze.get(e);if(o||a||l){let e=r.length;for(;e;){let u=r.slice(0,e).join($e);if(l){const o=l[u];e===r.length?o?.forEach((e=>{let o=e();o.oldValue=t,o.subNewValue=n,o.subOldValue=s,o.path=r,Ye.pushWatch(o)})):o?.forEach((e=>{let o=e();i(o,"deep")&&(o.oldValue=t,o.subNewValue=n,o.subOldValue=s,o.path=r,Ye.pushWatch(o))}))}if(o){let e=o[u];if(!c(e))for(let t=0;t<e.length;t++){const r=e[t];Ye.pushComputed(r)}}if(a){let e=a[u];if(!c(e))for(let t=0;t<e.length;t++){const r=e[t];Ye.pushCss(r)}}e--}}let u=e._notify(t,r);Ye.pushNext(u,e.cid)}const qe=new Map;class Ye{static watchSet=new Set;static computedSet=new Set;static cssSet=new Set;static nextSet=new Set;static nextPending=!1;static next;static flush(){Ye.nextPending=!1;let e=Array.from(Ye.watchSet);Ye.watchSet.clear();let t=Array.from(Ye.computedSet);Ye.computedSet.clear();let r=Array.from(Ye.cssSet);Ye.cssSet.clear();let n=Array.from(Ye.nextSet);Ye.nextSet.clear(),qe.clear(),e.forEach((e=>e(i(e,"path"),i(e,"oldValue"),i(e,"subNewValue"),i(e,"subOldValue")))),t.forEach((e=>e())),r.forEach((e=>e())),n.forEach((e=>e()))}static pushWatch(e){Ye.watchSet.add(e)}static pushComputed(e){Ye.computedSet.add(e)}static pushCss(e){Ye.cssSet.add(e)}static pushNext(e,t){if(t){if(qe.has(t))return;qe.set(t,e)}Ye.nextSet.add(e),Ye.nextPending||(Ye.nextPending=!0,Ye.next())}}(()=>{const e=Promise.resolve(),t=Ye.flush;Ye.next=()=>{e.then(t)}})();const Ze={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},Je=new Map;let et=[],tt=0;const rt=new WeakMap,nt=new Set,st=new WeakMap,ot=Symbol.for("PROP_OBJECT_KEY_MAP_SYMBOL");class it extends HTMLElement{static defaults(e){et=w(e.css,(e=>{if(r(e)){let t=new CSSStyleSheet;return t.replaceSync(e),t}return e instanceof CSSStyleSheet?e:[]})),e.global,b(e,((e,t)=>{P(t[0],/[A-Z]/)}))}#e;#t={};#r={"#slots":{}};#n={};#s={};#o;__events={};__updateMap;get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#e}get reactiveData(){return this.#n}get attrs(){return this.#i}get props(){return this.#a}get renderRoot(){return this.#l}get renderRoots(){return this.#c}get parentComponent(){return this.#u}get wrapperComponent(){return this.#d}get slotHooks(){return this.#p}get styleSheets(){return Je.get(this.tagName)}get isMounted(){return this.#h}get slots(){return this.#r["#slots"]}#i;#a;#l;#c;#u;#d;#f={};#p={};#g={};#h=!1;static get styles(){return[]}static get globalStyle(){return""}static get hostStyles(){return[]}get styles(){return[]}#m=!1;#v=!1;constructor(...e){super(),this.#e=tt++,this.__updateMap={},1===M(e)&&(this.#a={},k(this.#a,O(e)));let t=this.render.bind(this);this.render=function(){let e;return je.startRender(this),e=t(),je.endRender(this),e};let n=i(this.constructor,"globalStyle");if(!c(n)){let e=nt.has(n);if(r(n)&&!e){let e=document.createElement("style");e.textContent+=n,document.head.appendChild(e),nt.add(n)}}let s=Je.get(this.tagName),o=s??[];s||(b(i(this.constructor,"styles"),(e=>{if(r(e)){let t=new CSSStyleSheet;t.replaceSync(e),o.push(t)}else o.push(e)})),Je.set(this.tagName,o)),this.#o=this.attachShadow({mode:"open"}),this.#o.adoptedStyleSheets=[...et,...o],this.#b();let a=i(this.constructor,Ce);a&&a.sort(((e,t)=>t.priority-e.priority)).forEach((e=>e.create(this))),this.#E=this.#S.bind(this)}insertStyleSheet(e){let t;if(r(e)){t=new CSSStyleSheet;try{t.replaceSync(e)}catch(e){}}else{if(this.shadowRoot.adoptedStyleSheets.includes(e))return e;t=e}this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,t];return(Je.get(this.tagName)??[]).push(t),t}get rootComponent(){let e=this;for(;e.parentComponent;)e=e.parentComponent;return e}#E;connectedCallback(){let e=o(this.parentNode,(e=>e instanceof it||e.host instanceof it),"parentNode");this.#u=e?e instanceof it?e:e.host:null,this.__init()}disconnectedCallback(){}__init(){if(this.#m)return;if(this.#v)return;this.#v=!0,this.#b();const e=this.#y();this.propsReady(e);for(const t in e){const r=e[t];this.#r[t]=r}this.#N(),b(this.#r,((e,t)=>{let r=Reflect.getOwnPropertyDescriptor(this.#r,t);Reflect.defineProperty(this,t,{get(){let e=Reflect.get(this.#n,t);return r?.get?r?.get():e},set(e){r?.set?r?.set(e):Reflect.set(this.#n,t,e)}})})),Reflect.defineProperty(this.#r,"__isData",{enumerable:!1,value:!0}),this.#n=Ke(this.#r,this);let t=i(this.constructor,ce.COMPUTED);b(t,((e,t)=>{je.startCollect(this,le.COMPUTED),je.setUpdater((()=>{this.#n[t]=e.call(this)})),this.#r[t]=e.call(this),je.endCollect(),Reflect.defineProperty(this,t,{get(){return Reflect.get(this.#n,t)},set(e){he(this.tagName,"Cannot set a computed property '"+t+"'")}})}));let n=i(this.constructor,ce.WATCH);b(n,((e,t)=>{e.forEach((e=>{let{source:r,options:n,handler:s}=e,o=s.bind(this);i(n,"once",!1)&&(o=D(o));const a=function(e,t,n,s){let a=i(this,r.replaceAll($e,"."));o(a,t,x(e,"."),n,s)}.bind(this);let l=i(n,"deep",!1);if(a.deep=l,je.collectWatch(this,(()=>a),t),!i(n,"immediate",!1))return;let c=i(this,r.replaceAll($e,"."));o(c,void 0,r)}))}));let o=function(e,t){let r,n=[];if(Zt[t.tagName]){let s=Zt[t.tagName],o=function(e,t){let r=d(t.vars),n=t.strings.length-1;for(let s=0;s<=n;s++){let n=i(t.vars,s,"");if(n instanceof yr){let[t,o]=cr(e,n);r.splice(s,1,...o)}}return r}(t,e);r=Jt[t.tagName]?function(e,t,r){let n=Jt[r.tagName]?.cloneNode(!0),s=er[r.tagName];const o=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let i,a,l=0,c=0;for(;i=o.nextNode();){let n;if(c++,a&&!a.contains(i)&&(a=void 0),i instanceof HTMLElement||i instanceof SVGElement){i instanceof it&&(a=i);let o={},u=s[c];u&&u.forEach((s=>{let c=t[l++],u=s.up;switch(s.type){case tr.Event:n=u?Ie.createFrom(u):u,s.value||l--,s.value&&$t(s.name,c.bind(r),i,r),i.removeAttribute(s.attrName);break;case tr.AttrSlot:a&&s.name,i.removeAttribute(s.attrName);break;case tr.Ref:n=Ie.createFrom(u),c.current=i,lr.set(i,c),i.removeAttribute(s.attrName);break;case tr.AttrKey:n=Ie.createFrom(u),i.setAttribute(Xt,c);break;case tr.AttrBool:n=Ie.createFrom(u),n.value=!!c,n.node=i,n.value&&i.setAttribute(s.name,""),i.removeAttribute(s.attrName);break;case tr.AttrProp:n=Ie.createFrom(u),n.value=c,n.node=i,o[s.name]=c,s.attrName&&i.removeAttribute(s.attrName);break;case tr.AttrRef:case tr.Attr:n=Ie.createFrom(u),n.value=c,n.node=i,i.setAttribute(s.attrName,c),tr.AttrRef===s.type&&i.removeAttribute(s.name);break;case tr.DirectiveAttr:case tr.DirectiveTag:case tr.DirectiveProp:n=Ie.createFrom(u),n.value=c,n.node=i;let e=te(s.point);e.startNode=i;let[t,d,p,h,f]=c,g=ar.get(i);if(g||(g={},ar.set(i,g)),g[s.attrName??Symbol.keyFor(t)]=[e,r,a],p(e,d,void 0,{renderComponent:r,slotComponent:a,varChain:f}),tr.DirectiveAttr===s.type){let e=i.getAttribute(s.attrName);e=J(e,hr,""),i.setAttribute(s.attrName,e)}s.name&&i.removeAttribute(s.name)}n&&e.push(n)})),i instanceof it?(i._regWrapper(r),M(o)>0&&i._initProps(o)):i instanceof HTMLSlotElement&&r._bindSlot(i,i.name||"default",o)}else{let o=s[c];o&&o.forEach((s=>{let o=t[l++],c=s.up;switch(s.type){case tr.DirectiveSlot:case tr.DirectiveText:n=Ie.createFrom(c),n.value=o,n.node=i;let[e,t,l,u,d]=o,p=Symbol.keyFor(e),h=document.createComment(`compelem-${r.tagName}-${p}-start`);n.textNode=h,i.parentNode.insertBefore(h,i),i.nodeValue=`compelem-${r.tagName}-${p}-end`,i._diName=p;let f=te(s.point);f.startNode=h,f.endNode=i,or.set(i,[f,r,a,t,d]),ir.set(i,n),je.startRender(i);let g=l(f,t,void 0,{renderComponent:r,slotComponent:a,varChain:d});je.endRender(r);let m=gr(i,g[1],r),v=m.length;m&&v>0&&Se.insertBefore(i,Array.from(m));break;case tr.Text:n=Ie.createFrom(c),n.node=i;let b=ee(o??""),E=document.createTextNode(b);i.replaceWith(E),n.textNode=E}n&&e.push(n)}))}}return n.childNodes}(n,o,t):fr(n,s,o,t)}else{let[s,o]=cr(t,e);Zt[t.tagName]=s,r=fr(n,s,o,t)}return rr.set(t,n),r}(this.render(),this);o&&(this.#o.append(...o),this.#c=F(this.#o.childNodes,(e=>e.nodeType===Node.ELEMENT_NODE)),this.#l=this.#c[0]),b(this.#p,((e,t)=>{this.#_(t)}));const a=this;let l=i(this.constructor,Ce);l&&l.sort(((e,t)=>t.priority-e.priority)).forEach((e=>{e.beforeMount(this,((e,t)=>(a.#n[e]=t,a.#n[e])))}));let c=i(this.constructor,"hostStyles"),u=this.#d?.shadowRoot??this.ownerDocument,p=st.get(u);if(st.get(u)||(p=[],st.set(u,p)),!p?.includes(this.constructor)&&c.length>0){let e=[];b(c,(t=>{if(r(t)){let r=new CSSStyleSheet;r.replaceSync(t),e.push(r)}else e.push(t)})),u.adoptedStyleSheets=[...u.adoptedStyleSheets,...e],p?.push(this.constructor)}this.beforeMount();let f=i(this.constructor,ce.EVENTS);f&&f.forEach((async e=>{let t=e.name,r=k({target:document,once:!1,passive:!1,capture:!1},e.options),n=h(e.fn,this),s=r.target;T(s)&&(s=await s.call(this,this)),s?s.addEventListener(t,n,r):he(this.tagName,"The target of @event('"+t+"',...) is invalid")})),setTimeout((()=>{this.#h=!0,je.startCollect(this,le.CSS);let e=[];this.styles.forEach((t=>{if(!T(t))return;let r=new CSSStyleSheet;e.push(r),je.setUpdater((()=>{let e=t()??"";r.replaceSync(e)}));let n=t();s(n)||r.replaceSync(n)})),je.endCollect(),e.length>0&&(this.#o.adoptedStyleSheets=[...this.#o.adoptedStyleSheets,...e]),this.mounted(),l&&l.forEach((e=>{e.mounted(this,((e,t)=>(a.#n[e]=t,a.#n[e])))}))}),0),this.#m=!0}propsReady(e){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}__onSlotChangeHook(e){let t=e.currentTarget,r="";b(this.#f,((e,n)=>{if(e===t)return r=n,!1})),this.#m&&this.#T(t,"default"===r?"":r)}#T(e,t){this.#b();let r=i(this.#t[t],"props");r&&b(this.slots,((e,t)=>{e.filter((e=>e.nodeType===Node.ELEMENT_NODE)).forEach((e=>{e instanceof it?e._updateProps(r):b(r,((t,r)=>{if(e instanceof HTMLSlotElement){let n=rt.get(e);if(n){let s=e.name||"default",o=n.#t[s];o||(o=n.#t[s]={props:{}}),o.props||(o.props={}),o.props[r]=t,n.#T(e,s)}}else e.setAttribute(r,t)}))}))})),this.slotChange(e,t)}slotChange(e,t){}attributeChangedCallback(e,t,r){if(Object.is(r,t))return;let n=R(e);if(be(i(this.constructor,[ce.PROPS,n]).type)){let e=!L(r)&&Ee(r);if(i(this,n)===e)return}this.#C(e,t,r)}shouldUpdate(e){return!0}updated(e){}#A={};_notify(e,t){let r=[];for(let n=0;n<t.length;n++){const s=t[n];r.push(s);let o=i(this,r),a=me(r);this.#s[a]={value:o,chain:"slots"===a?["slots"]:r,oldValue:e,end:r.length===t.length}}return this.#E}#S(){if(M(this.#s)<1)return;if(!this.isMounted)return;const e=this.#s;if(this.#s={},!this.shouldUpdate(e))return;const t=Object.keys(e);let r=i(this.constructor,Ce);r&&r.sort(((e,t)=>t.priority-e.priority)).forEach((t=>{t.updated(this,e)}));let n=new Set;const s=this.__updateMap;b(e,((e,t)=>{s[t]&&s[t].forEach((e=>{n.add(e)}))})),n.forEach((e=>{null===e?mr(this.render(),this,void 0,t):vr(e,this,void 0,void 0,t)})),this.#w.forEach((e=>{this.#_(e)})),this.updated(e)}#y(){let e=i(this.constructor,ce.PROPS),t=this.attributes,r=this.tagName,s=this.#a,o={};b(t,(({name:t,value:r})=>{if(t[0]===jt||t[0]===Ut||t[0]===Bt||t===zt||"slot"===t)return;let n=R(t);e&&!e[n]&&(o[t]=r)})),this.#i=this.#i?k(this.#i,o):o;let c={};if(!e)return Object.seal(c);let d=Object.keys(e),p=d.length;for(let o=0;o<p;o++){const p=d[o],f=E(p),g=this.hasAttribute(f);let m,v=e[p],b=u(s,p),S=i(this,p);if(!("_defaultValue"in v)&&(v._defaultValue=S,!v.type)){n(S)&&he(r,"Prop '"+p+"' has neither propType nor defaultValue be used for type inference");let e=typeof S;C(S)&&(e="array");let t=Ze[e];v.type=t}if(b)m=H(s[p])?S:s[p];else{m=S;let e=t.getNamedItem(f)||t.getNamedItem(Ut+f);e&&(b=!0,m=e.value)}if(v.required&&!b){he(r,"Prop '"+p+"' is required");break}m=this.#P(e,p,m,g);let y=i(e,[p,"getter"]);y&&(y=h(y,this));let N=i(e,[p,"setter"]);N&&(N=h(N,this)),(y||N)&&Reflect.defineProperty(this.#r,p,{set:N||function(e){},get:y}),v.attribute&&l(m)&&!a(m)&&this.#M(v,p,m),this.#r[p]=m,c[p]=m}return Object.seal(c)}#M(e,t,r){let n=E(t),s=V(r);be(e.type)?(s=Ee(r),W(s)?s&&!this.hasAttribute(n)?this.toggleAttribute(n,!0):!s&&this.hasAttribute(n)&&this.toggleAttribute(n,!1):this.getAttribute(n)!==s&&this.setAttribute(n,s)):this.getAttribute(n)!==s&&this.setAttribute(n,s)}#k(e,t){let r=e;try{for(let n=0;n<t.length;n++){const s=t[n];r=s===Boolean?Ee(e):s===Number?Number(e):s===String?String(e):s===Object||s===Array?I(e):s===Date?new Date(e):new s(e)}}catch(t){he(this.tagName,"Convert attribute error with "+e)}return r}#P(e,n,s,o){let i=e[n];if(!i)return s;let a=i.isValid,c=i.type,u=C(c)?c:[c],d=i.converter,p=s;if(!t(u,(e=>e===String))&&r(p)&&!L(p))try{p=d?d(p):this.#k(p,u)}catch(e){he(this.tagName,`Convert attribute '${n}' error with `+p)}for(let e=0;e<u.length;e++){"Boolean"===u[e].name&&o&&(p=Ee(p))}if(H(p))return p;let h=typeof p,f=!l(p);for(let e=0;e<u.length;e++){const t=u[e];if(P(h,t.name,"i")||p instanceof t||Object.prototype.toString.call(p)===Object.prototype.toString.call(t.prototype)){f=!0;break}}return f||he(this.tagName,`Invalid prop '${n}'. expected '${u.map((e=>e.name||e))}' but got '${h}'`),a&&(a.call(this,p,this.#r)||he(this.tagName,`Invalid prop '${n}'. IsValid() check failed`)),p}#N(){let e=i(this.constructor,ce.STATES);b(e,((t,r)=>{let n=e[r],s=i(this,r);if(n){let e=n.prop;s=e?v(this.#r[e]):i(this,r)}this.#r[r]=s}))}#O=$(this.propsReady,100);_updateProps(e){let t=i(this.constructor,ce.PROPS),r=[];b(e,((e,n)=>{let s=R(n),o=t[s];o&&(e=this.#P(t,s,e),o.attribute&&l(e)&&!a(e)&&r.push([o,s,e]),je.__skipCheck=!0,p(this,s,e),je.__skipCheck=!1)})),k(this.#a,e),r.forEach((([e,t,r])=>{this.#M(e,t,r)})),this.#a&&this.#O(this.#a)}_wrapperProp={};_initProps(e,t){this.#a=m(this.#a||{},e),this.#i=m(this.#i||{},t),b(e,((e,t)=>{if(a(e)){let r=Be.get(e);if(r){let e=r.join($e);this._wrapperProp[e]=t;let n=i(this.wrapperComponent?.constructor,ce.STATES),s=r[0];if(n&&n[s]){let e=i(this.constructor,ce.PROPS);p(e,[t,"shallow"],n[s].shallow)}}}}))}_bindSlot(e,t,r){if(this.#f[t]||(this.#f[t]=e,rt.set(e,this)),e.addEventListener("slotchange",this.__onSlotChangeHook),!c(r)){let e=this.#t[t];e||(e=this.#t[t]={}),e.props=r}}_bindSlotHook(e,t){this.#p[e]=t}#w=new Set;_updateSlot(e,t,r){let n=this.#f[e],s=this.#p[e];if(!s&&!n)return;let o=this.#t[e];if(t&&(o.props||(o.props={}),o.props[t]=r),s)this.#w.add(e);else{let e=n.assignedElements({flatten:!0});for(let n=0;n<e.length;n++){e[n].setAttribute(t,r+"")}}}#b(){const e=w(this.childNodes,(e=>e.nodeType===Node.COMMENT_NODE?[]:e instanceof HTMLSlotElement?e.assignedNodes({flatten:!0}):e));let t=j(e,(e=>e.nodeType===Node.TEXT_NODE?"default":e instanceof Element?e.getAttribute("slot")||"default":void 0));if(c(t))return void(c(this.#r["#slots"])||(this.#m?this.#n["#slots"]={}:this.#r["#slots"]={}));b(t,((e,t)=>{if(t){for(;e.length>0;){let t=e[0];if(!(t.nodeType===Node.TEXT_NODE&&s(t.textContent)||t instanceof HTMLSlotElement&&c(t.assignedNodes({flatten:!0}))))break;e.shift()}for(;e.length>0;){let t=y(e);if(!(t.nodeType===Node.TEXT_NODE&&s(t.textContent)||t instanceof HTMLSlotElement&&c(t.assignedNodes({flatten:!0}))))break;e.pop()}}}));let r={};b(t,((e,t)=>{c(e)||(r[t]=e)})),this.#m?this.#n["#slots"]=r:this.#r["#slots"]=r}#_(e){let t=this.#p[e];if(!t)return;let r=this.#t[e];if(!this.#r["#slots"][e])return;this.renderAsync(t,i(r,"props"));const n=this._asyncDirectives.get(t);let s=n?.buildView(t(i(r,"props"))),o=U(S(s),(e=>e.nodeType===Node.COMMENT_NODE));if(o){let t=this.#g[e];if(!c(t))for(let e=0;e<t.length;e++){const r=t[e];r.parentNode?.removeChild(r)}this.#g[e]=o,this.append(...o),this.#w.clear()}}_asyncDirectives=new WeakMap;renderAsync(e,...t){}#C(e,t,r){if(!this.#m)return;if(He(this.constructor).has(e)){let t=R(e);if(L(r)){r=i(this.constructor,ce.PROPS)[t]._defaultValue}this._updateProps({[t]:r})}}_regDeps(e,t){let r=this.__updateMap[e];r||(r=this.__updateMap[e]=new Set),r.add(this===t?null:t);let n=e.split($e);if(n.pop(),n.length<1)return;let s=n.join($e);r=this.__updateMap[s],r||(r=this.__updateMap[s]=new Set),r.add(this===t?null:t)}_regWrapper(e){this.#d=e}_getPrivateData(){return this.#r}emit(e,t={},r){r&&r.event&&(t.event=r.event),t.target=this,this.dispatchEvent(new CustomEvent(e,{bubbles:i(r,"bubbles",!1),composed:i(r,"composed",!1),cancelable:!0,detail:t}))}on(e,t){this.#A[e]||(this.#A[e]=[]);let r=t.bind(this);return this.#A[e].push(r),this.addEventListener(e,r),r}off(e,t){t?(this.removeEventListener(e,t),B(this.#A[e],(e=>e===t))):(b(this.#A[e],(t=>{this.removeEventListener(e,t)})),this.#A[e]=[])}nextTick(e,t){Ye.pushNext(e,t)}forceUpdate(){b(this.#n,((e,t)=>{this.#s[t]={value:void 0,chain:void 0}})),this.#S()}}!function(e,t,r,n){var s,o=arguments.length,i=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(i=(o<3?s(i):o>3?s(t,r,i):s(t,r))||i);o>3&&i&&Object.defineProperty(t,r,i)}([Oe],it.prototype,"__onSlotChangeHook",null);class at{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(e,t,r){this.startNode=e,this.attrName=t,this.type=r}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}}var lt;!function(e){e.AFTER_BEGIN="afterbegin"}(lt||(lt={}));const ct={};function ut(e,t,r,n,s,o,i,a=!1){let l;if(a?(je.startRender(e.endNode),l=n(e,t,r,{renderComponent:s,slotComponent:o,varChain:i}),je.endRender(s)):l=n(e,t,r,{renderComponent:s,slotComponent:o,varChain:i}),!l)return;let[u,d]=l;if(u===We.NONE)return;let p=e.getNodes();if(u===We.REMOVE)for(let e=0;e<p.length;e++){const t=p[e];t.parentNode?.removeChild(t)}else if(u===We.REPLACE){let t=[];for(let e=0;e<p.length;e++){const t=p[e];t.parentNode?.removeChild(t)}let r=gr(e.endNode,d,s);t=S(r);let n=document.createDocumentFragment();n.append(...t),e.endNode.parentNode.insertBefore(n,e.endNode)}else if(u===We.UPDATE){let t,r={},n=[],o=[],i=nr.get(e.endNode);if(d||(d=new yr([],[])),c(p)){let t=gr(e.endNode,d,s);return void e.startNode.after(...t)}let a={};d instanceof yr&&d.vars.forEach((e=>{if(e instanceof yr){const t=e.getKey();a[t]=e,r[t]=!0,o.push(t)}})),p=F(G(p),(e=>e.nodeType===Node.ELEMENT_NODE)),t=F(G(S(t)),(e=>e.nodeType===Node.ELEMENT_NODE));let l={},u="",h={};for(let e=0;e<p.length;e++){let t=p[e],r=t.getAttribute("key");if(!H(r)){if(l[r]){u=r;break}l[r]=t,n.push(r),h[r]=!0}}if(u)return void pe(`${R(e.endNode._diName)} - duplicate key '${u}'`);let f=r;e.startNode.parentNode;let g=[],m=[];b(h,((e,t)=>{f[t]||(m.push(t),delete h[t],B(n,(e=>e===t)))}));let v,E=!1;if(!c(o)){let t=-1,r=[],s=[],i=0,a=0;for(;a<o.length;a++){const c=o[a];let u=n.findIndex((e=>e===c));if(u<0){let t=o[a-1],r=t?l[t]||t:e.startNode;g.push({prevNode:r,newkey:c}),i++}else if(u>-1&&u!==a-i){if(t<0||1===Math.abs(t-u)){let e=y(r);r.push({nodeId:c,targetId:0===a?lt.AFTER_BEGIN:e?e.nodeId:o[a-1]})}else s.push({moveGroup:r,moveIndex:a+r.length}),r=[],r.push({nodeId:c,targetId:o[a-1]});t=u}}if(r.length>0&&s.push({moveGroup:r,moveIndex:a+r.length}),s.length>0){E=!0;let t=s.sort(((e,t)=>e.moveGroup.length-t.moveGroup.length));if(t.length<2){let{moveGroup:r}=t[0];if(r.length>1){let e=y(r).targetId;r[r.length-2].nodeId===e&&(r=A(r))}r.forEach((({targetId:t,nodeId:r})=>{let n,s=l[r];t===lt.AFTER_BEGIN?(n=e.startNode,n.after(s)):(n=l[t],n.after(s))}))}else{let r=y(t).moveIndex;1===Math.abs(t[t.length-2].moveIndex-r)&&(t=A(t)),t.forEach((({moveGroup:t})=>{t.forEach((({targetId:t,nodeId:r})=>{let n,s=l[r];t===lt.AFTER_BEGIN?(n=e.startNode,n.after(s)):(n=l[t],n.after(s))}))}))}}}if(m.forEach((e=>{let t=l[e];t&&t.parentNode&&t.remove()})),g.length>0&&(v=function(e,t,r,n,s,o){const i=[],a=[],l=[];let c,u=[];e.forEach((e=>{let r=y(u);r&&c===e.prevNode?(r.group||(r.group=[c]),r.group.push(e.newkey)):u.push(e),c=e.newkey;let n=e.newkey;l.push(n),i.push(""),a.push(t[n])})),i.push("");let d=new yr(i,a),p=[...s],h=gr(o,d,n),f=nr.get(o);s.length=0,s.push(...f);let g=new Map;return h.forEach((e=>{const t=e.getAttribute("key");l.includes(t)&&(g.set(t,!0),ct[t]=e)})),p.forEach(((e,t)=>{const n=e.key+"";!g.get(n)&&r.includes(n)&&s.push(e)})),u}(g,a,o,s,i,e.endNode),v.forEach(((t,r)=>{let n=t.newkey,s=ct[n],o=t.prevNode;if(t.group){let e=document.createDocumentFragment();e.append(...z(t.group,(e=>ct[e]))),s=e}o===e.endNode?o.before(s):o===e.startNode?o.after(s):"string"==typeof o?ct[o].after(s):o.after(s)}))),d.vars[0]instanceof yr){let e=[],t=[];b(d.vars,(r=>{t.push(...r.vars),e.push(...z(r.vars,(e=>"1")))})),e.push("1"),d=new yr(e,t)}if(E||m.length>0||v){const e=j(i,(e=>e.key));let t=[],r=0;o.forEach((n=>{e[n]&&e[n].forEach((e=>{e.varIndex=r++,t.push(e)}))})),i=t}vr(e.endNode,s,d,i)}}let dt=0;function pt(e,t){let r=e.name||"Di-"+dt++,n=Symbol.for(r);return(...s)=>{let o=e(...s);return(X(t,Ve.TEXT)||X(t,Ve.SLOT))&&sr.set(r,o),p(o,"__scope",t[0]),[n,s,o,e=>{},je.popDirectiveQ()]}}const ht=["resize","outside","mutate"],ft=new WeakMap,gt=[],mt=[],vt=[],bt=new ResizeObserver((e=>{for(const t of e){const e=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize,r=Array.isArray(t.borderBoxSize)?t.borderBoxSize[0]:t.borderBoxSize;let n=ft.get(t.target);if(n){n(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:r.inlineSize,h:r.blockSize},contentBox:{w:e.inlineSize,h:e.blockSize}}}),t.target)}}}));var Et;!function(e){e.Child="child",e.Tree="tree",e.Attr="attr",e.Char="char"}(Et||(Et={}));const St=new WeakMap,yt=new MutationObserver((e=>{for(let t=0;t<e.length;t++){const r=e[t];let n=St.get(r.target);if(!n)return;let s={target:r.target},o=null;switch(r.type){case"subtree":s.type=Et.Tree,o=n[Et.Tree];break;case"childList":s.type=Et.Child,s.addedNodes=r.addedNodes,s.removedNodes=r.removedNodes,o=n[Et.Child];break;case"attributes":s.type=Et.Attr,s.attributeName=r.attributeName,s.oldValue=r.oldValue,o=n[Et.Attr];break;case"characterData":s.type=Et.Char,s.oldValue=r.oldValue,o=n[Et.Char]}if(o){o(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:s}))}}}));function Nt(e,t,r,n){if("resize"===e)!function(e,t){ft.has(e)||(ft.set(e,t),bt.observe(e))}(t,r);else if("outside"===e)switch(n[0]){case"mousedown":!function(e,t){gt.push([e,t])}(t,r);break;case"dblclick":!function(e,t){vt.push([e,t])}(t,r);break;default:!function(e,t){mt.push([e,t])}(t,r)}else"mutate"===e&&function(e,t,r){let n=X(r,"child"),s=X(r,"attr"),o=X(r,"char"),i=X(r,"tree"),a=St.get(e);a||(a={},St.set(e,a),n&&(a[Et.Child]=t),s&&(a[Et.Attr]=t),o&&(a[Et.Char]=t),i&&(a[Et.Tree]=t),yt.observe(e,{childList:n,attributes:s,characterData:o,subtree:i}))}(t,r,n)}document.addEventListener("mousedown",(e=>{let t=i(e.composedPath(),0,e.target);gt.forEach((([r,n])=>{if(!r.contains(t)&&!r.contains(o(t,(e=>e instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:e}}),r)}}))}),!1),document.addEventListener("click",(e=>{let t=i(e.composedPath(),0,e.target);mt.forEach((([r,n])=>{if(!r.contains(t)&&!r.contains(o(t,(e=>e instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:e}}),r)}}))}),!1),document.addEventListener("dblclick",(e=>{let t=i(e.composedPath(),0,e.target);vt.forEach((([r,n])=>{if(!r.contains(t)&&!r.contains(o(t,(e=>e instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:e}}),r)}}))}),!1);const _t=/,|^(debounce:.+)|(debounce$)/,Tt=/,|^(throttle:.+)|(throttle$)/,Ct="self",At="stop",wt="prevent",Pt="once",Mt="capture",kt="passive",Ot="left",Dt="right",xt="middle",Rt="ctrl",Lt="alt",Ht="shift",Vt="meta",Wt={esc:"escape"},It=":";function $t(e,t,r,n){let s,o=e.split("."),i=o.shift(),a=o.includes(Pt),l=t;if(s=K(o,(e=>_t.test(e)))){let e=s.split(It);l=$(l,parseInt(e[1])||100)}if(s=K(o,(e=>Tt.test(e)))){let e=s.split(It);l=Q(l,parseInt(e[1])||100)}if(a&&(l=D(l)),function(e){return ht.includes(e)}(i))return Nt(i,r,l,o),l;let c=e=>{if(o.includes(wt)&&e.preventDefault(),o.includes(At)&&e.stopPropagation(),!o.includes(Ct)||e.target===e.currentTarget){if(e instanceof MouseEvent){if(o.includes(Ot)&&0!=e.button)return;if(o.includes(Dt)&&2!=e.button)return;if(o.includes(xt)&&1!=e.button)return}else if(e instanceof KeyboardEvent){if(B(o,(e=>e==Rt))[0]&&!e.ctrlKey)return;if(B(o,(e=>e==Lt))[0]&&!e.altKey)return;if(B(o,(e=>e==Ht))[0]&&!e.shiftKey)return;if(B(o,(e=>e==Vt))[0]&&!e.metaKey)return;let t=z(o,(e=>Wt[e]||e));if(M(t)>0&&!t.includes(e.key.toLowerCase()))return}l(e)}},u={capture:o.includes(Mt)||!1,passive:o.includes(kt)||!1};r.addEventListener(i,c,u),n.__events||(n.__events={});let d=n.__events[i];return d||(d=n.__events[i]=[]),d.push([r,c,u]),c}const jt="@",Ut=".",Bt="?",Ft="*",Gt=":",zt="ref",Xt="key",Kt=/(<\/?)\s*([A-Z][A-Za-z0-9]*)([\s>])/gm,Qt=/\s+([\.?@*])?((?:[a-zA-Z]*[A-Z][^\s<>="']+))(?=[\s=>])/gm,qt=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,Yt="slot-props",Zt={},Jt={},er={};var tr;!function(e){e.Event="event",e.Directive="directive",e.DirectiveTag="directiveTag",e.DirectiveAttr="directiveAttr",e.DirectiveProp="directiveProp",e.DirectiveText="directiveText",e.DirectiveSlot="directiveSlot",e.Attr="attr",e.AttrProp="attrProp",e.AttrBool="attrBool",e.AttrRef="attrRef",e.AttrSlot="attrSlot",e.AttrKey="key",e.Ref="ref",e.Text="text"}(tr||(tr={}));const rr=new WeakMap,nr=new WeakMap,sr=new Map,or=new WeakMap,ir=new WeakMap,ar=new WeakMap,lr=new WeakMap;function cr(e,t){let r="",n=d(t.vars),s=t.strings.length-1,o=t.vars.length-1,a=0;for(let l=0;l<=s;l++){const s=t.strings[l];let c=i(n,a,"");if(c instanceof yr){let[t,r]=cr(e,c);c=t,n.splice(a,1,...r),a+=r.length-1}else c=l>o?"":dr;a++,r=r+s+c}let l=0;return r=r.replace(qt,((e,t)=>q(e,dr,(()=>dr.replace("--\x3e","")+l++)))),r=r.replace(Er,"$1><").trim(),r=ur(r),[r,n]}function ur(e){return r(e)?e=(e=e.replace(Qt,((e,t,r)=>` ${t??""}${E(r)}`))).replace(Kt,((e,t,r,n)=>t+de[r]+n)):e+""}const dr="\x3c!--c_ui-pl_df--\x3e",pr="\x3c!--c_ui-pl_df",hr=/<!--c_ui-pl_df\d*(-->)?/;function fr(e,t,r,n,s=!1){const o=document.createElement("div");o.innerHTML=t;const i=er[n.tagName];s||!i||Jt[n.tagName]||(Jt[n.tagName]=o.cloneNode(!0));let a=0;const c=document.createNodeIterator(o,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let u,d,p=0,h=i?void 0:{},f=null,g="";for(;u=c.nextNode();){a++;let t=i?void 0:[];d&&!d.contains(u)&&(d=void 0);let s=null;if(u instanceof HTMLElement||u instanceof SVGElement){u instanceof it&&(d=u);let s={},o=S(u.attributes);for(let i=0;i<o.length;i++){const a=o[i];let{name:c,value:h}=a;if(c!==Yt)if(N(c,pr)){let s=r[p];if(C(s)&&_(s[0])){let[,r,o,i,a]=s;i(Ve.TAG);let l=new at(u,c.substring(1),Ve.TAG),h=ar.get(u);h||(h={},ar.set(u,h)),h[Symbol.keyFor(s[0])]=[l,n,d];let m=new Ie(p,u);m.isDirective=!0,m.value=s,m.isComponent=!!d,e.push(m),f&&f?.contains(u)&&(m.key=g),p++,o(l,r,void 0,{renderComponent:n,slotComponent:d,varChain:a});let v=te(m);v.node=v.value=null,t&&t.push({type:tr.DirectiveTag,point:l,up:v,name:c})}u.removeAttribute(c)}else if(c[0]!==jt)if(c!==zt)if(c!==Xt){if(hr.test(h)){let o=r[p],i=new Ie(p,u,c.replace(/\.|\?|@/,""),h);i.isComponent=!!d,f&&f?.contains(u)&&(i.key=g);let m=null;if(c[0]===Ut||c[0]===Bt||c[0]===Ft){if(C(o)&&_(o[0])){let[,e,r,s,a]=o;s(Ve.PROP);let l=c.substring(1),p=new at(u,l,Ve.PROP),h=ar.get(u);h||(h={},ar.set(u,h)),h[l]=[p,n,d],r(p,e,void 0,{renderComponent:n,slotComponent:d,varChain:a}),i.value=o,i.isDirective=!0,t&&(m={type:tr.DirectiveProp,up:i,point:p,name:c,attrName:l})}else if(c[0]===Bt){i.isToggleProp=!0,i.value=!!o;let e=c.substring(1);i.value&&u.setAttribute(e,""),t&&(m={type:tr.AttrBool,name:e,up:i,attrName:c})}else if(c[0]===Ft){i.value=o;let e=c.substring(1);const[r,n]=e.split(Gt);let s=r;switch(n){case"camel":s=R(s);break;case"kebab":s=E(s);break;case"snake":s=re(s)}i.attrName=s,u.setAttribute(s,o),t&&(m={type:tr.AttrRef,up:i,name:c,attrName:s})}else{let e=R(c.substring(1));i.value=o,i.isProp=!0,s[e]=o,t&&(m={type:tr.AttrProp,up:i,name:e,attrName:c})}u.removeAttribute(c),o=""}else{let e,r,s;if(i.value=o,t&&(m={type:tr.Attr,up:i,attrName:c}),C(o)&&_(o[0])){let t=Ve.ATTR;"class"===c?t=Ve.CLASS:"style"===c&&(t=Ve.STYLE);let[,a,l,p,h]=o;i.isDirective=!0,i.attrName=c,s=new at(u,c,t);let f=ar.get(u);f||(f={},ar.set(u,f)),f[c]=[s,n,d],r=a,e=l,o="",m&&(m.type=tr.DirectiveAttr,m.point=s)}h=J(h,hr,o),a.value=h,l(h)&&u.setAttribute(c,h),e&&e(s,r,void 0,{renderComponent:n,slotComponent:d})}if(t&&m){let e=te(i);e.node=null,m.up=e,t.push(m)}e.push(i),p++}}else{let n=r[p];u.setAttribute(c,n);let s=new Ie(p,u);s.notUpdated=!0,f&&f?.contains(u)&&(s.key=g),e.push(s),p++,f=u,g=n;let o=te(s);o.node=null,t&&t.push({up:o,type:tr.AttrKey}),e.length>0&&e.forEach((e=>{e.key=e.key??n}))}else{if(hr.test(h)){let n=r[p],s=new Ie(p,u);s.notUpdated=!0,f&&f?.contains(u)&&(s.key=g),e.push(s),p++,n.current=u,lr.set(u,n);let o=te(s);o.node=null,t&&t.push({type:tr.Ref,up:o,attrName:c})}u.removeAttribute(c)}else{let s=e=>{},o=null,i=!1;if(hr.test(h)){o=new Ie(p,u),o.notUpdated=!0,f&&f?.contains(u)&&(o.key=g),e.push(o),s=r[p].bind(n),p++,i=!0}let a=c.substring(1);$t(a,s,u,n),u.removeAttribute(c);let l=o?te(o):null;l&&(l.node=null),t&&t.push({type:tr.Event,up:l,name:a,attrName:c,value:i})}}u instanceof it?(u._regWrapper(n),M(s)>0&&u._initProps(s)):u instanceof HTMLSlotElement&&n._bindSlot(u,u.name||"default",s)}else{let o=u;if(`\x3c!--${o.nodeValue}--\x3e`!==dr)continue;let i=new Ie(p,u);f&&f?.contains(u)&&(i.key=g),e.push(i),i.isComponent=!!d,i.isText=!0;let a=r[p],l=null;if(C(a)&&_(a[0])){const e=Symbol.keyFor(a[0]);let r;r=document.createComment(`compelem-${n.tagName}-${e}-start`),i.textNode=r,o.parentNode.insertBefore(r,o),o.nodeValue=`compelem-${n.tagName}-${e}-end`,o._diName=e,i.isDirective=!0,i.value=a;let s=d?Ve.SLOT:Ve.TEXT,[,c,u,p,h]=a;p(s);let f=new at(r,"",s);f.endNode=o,or.set(o,[f,n,d,c,h]),ir.set(o,i),je.startRender(o);let g=u(f,c,void 0,{renderComponent:n,slotComponent:d,varChain:h});if(je.endRender(n),g){let e=gr(o,g[1],n);e&&e.length>0&&Se.insertBefore(o,Array.from(e))}a=void 0,t&&(l={type:s===Ve.SLOT?tr.DirectiveSlot:tr.DirectiveText,up:i,point:f})}else i.value=a,i.node=null,t&&(l={type:tr.Text});if(t&&l){let e=te(i);e.node=e.value=null,l.up=e,t.push(l)}if(p++,!i.isDirective){let e=ee(a??""),t=document.createTextNode(e);o.parentNode.insertBefore(t,o),i.textNode=t,s=o}}h&&t&&M(t)>0&&(h[a]=t),f&&!f.contains(u)&&f!==u&&(f=null,g=""),s&&s.remove()}return!s&&h&&(er[n.tagName]=h),o.childNodes}function gr(e,t,r){let[n,s]=cr(r,t),o=[],i=fr(o,n,s,r,!0);return nr.set(e,o),i}function mr(e,t,r,n){if(s(x(e.strings)))return;if(!rr.has(t))return;r=r??rr.get(t);let o=e.flatVars(t);for(let e=0;e<r.length;e++){const s=r[e];let l=s.varIndex;if(l<0)continue;if(s.notUpdated)continue;if(s.__destroyed)continue;let c=s.value,u=o,h=s.node,f=Y(l,$e);for(let t=0;t<f.length;t++){const r=f[t];u=i(u,r),u&&u.vars&&e<f.length-1&&(u=u.vars)}if(!a(c)&&c===u)continue;let g=h;if(s.isDirective){let[e,t,r,,n]=s.value,o=or.get(h);if(!o){const t=ar.get(h);o=t[s.attrName]||t[Symbol.keyFor(e)]}if(!C(u))continue;let[i,a,l]=o,[,c]=u;const d=ir.get(h);if(d){d.value=u;or.get(h)[3]=c}ut(i,c,t,r,a,l,n,i.type==Ve.TEXT||i.type==Ve.SLOT)}else if(s.isToggleProp){if(!!u===c)continue;g.toggleAttribute(s.attrName,!!u),p(g,s.attrName,!!u)}else if(s.isProp){if(!a(u)&&u===c)continue;if(h instanceof it)if(a(u)&&Object.is(u,c)){let e,t=R(s.attrName),r=[t],o=u;if(n&&n.length>0){let e="",a=x(Be.get(s.value),$e);n.forEach((t=>{t.startsWith(a)&&t.length>e.length&&(e=t)})),r=d(Y(e.replace(a,t),$e)),o=i(h,r)}Qe(h,c,r,o,e)}else h._updateProps({[s.attrName]:u});else h instanceof HTMLSlotElement&&t._updateSlot(h.getAttribute("name")||"default",s.attrName,u)}else if(s.attrName){if(!Z(c,u))switch(s.attrName){case"value":if(h instanceof HTMLInputElement){h.value=u;break}default:h.setAttribute(s.attrName,J(s.attrTmpl,hr,u+""))}}else if(s.isText){s.textNode.textContent=ee(u??"")}s.value=u}}function vr(e,t,r,n,s){const o=sr.get(e._diName),[i,a,l,c,u]=or.get(e),d=ir.get(e);if(!r){let e=o(i,d.value[1],c,{renderComponent:a,slotComponent:l,varChain:u});if(!e)return;r=e[1]}if(r&&r.vars[0]instanceof yr){let e=[],t=[];b(r.vars,(r=>{t.push(...r.vars),e.push(...z(r.vars,(e=>"1")))})),e.push("1"),r=new yr(e,t)}n&&nr.set(e,n),mr(r,t,n=n??nr.get(e),s)}function br(e,...t){return new yr(r(e)?[e]:e,t)}const Er=/([a-z0-9"'])\s*>\s*</gim;function Sr(e){return{current:e}}class yr{strings;vars;constructor(e,t){this.strings=d(e),this.vars=t}getKey(){let e=this.vars,t="";return b(this.strings,((r,n)=>{if(ae.test(r))return t=ee(e[n]),!1})),t}getKeys(){let e=this.vars,t=[];for(let r=0;r<this.strings.length;r++){const n=this.strings[r];if(ae.test(n)){let n=ee(e[r]);t.push(n)}}return c(t)&&e.forEach((e=>{if(e instanceof yr){let r=e.getKey();t.push(r)}})),t}append(e){let t=y(this.strings);return e.strings.forEach(((e,r)=>{0!=r?this.strings.push(e):this.strings[this.strings.length-1]=t+e})),this.vars=d(this.vars,e.vars),this}insert(e,t){let r=t.strings.shift();return this.strings[e]+=r,this.strings.splice(e+1,0,...t.strings),this.vars.splice(e,0,...t.vars),this}getHTML(e){let[t,r]=cr(e,this),n=fr([],t,r,e);return ne(n,((e,t)=>e+(t.outerHTML??"")),"")}flatVars(e){let t=d(this.vars),r=this.strings.length-1,n=0;for(let s=0;s<=r;s++){let r=i(t,n,"");if(r instanceof yr&&r.vars.length>0){let[s,o]=cr(e,r);r=s,t.splice(n,1,...o),n+=o.length-1}n++}return t}destroy(){this.strings=this.vars=null}}function Nr(e,t,r){r.get||pe(`Computed '${t}' must be a getter`),u(e.constructor,ce.COMPUTED)||(e.constructor[ce.COMPUTED]=c(e.constructor[ce.COMPUTED])?{}:v(e.constructor[ce.COMPUTED])),e.constructor[ce.COMPUTED][t]=r.get}const _r=Me(class extends _e{static get priority(){return Number.MAX_VALUE}created(e,t,r,...n){let s=i(e,r);p(e,r,$(s,this.wait,this.immediate));let o=Reflect.getPrototypeOf(e);o&&!i(o,r+"_$__")&&p(o,r+"_$__",s)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[Ne.METHOD]}wait;immediate;result;constructor(e,t=!1){super(),this.wait=e,this.immediate=t}});function Tr(e,t){return(r,n,s)=>{u(r.constructor,ce.EVENTS)||(r.constructor[ce.EVENTS]=c(r.constructor[ce.EVENTS])?[]:v(r.constructor[ce.EVENTS])),r.constructor[ce.EVENTS].push({name:e,options:t,fn:r[n]})}}const Cr=Me(class extends _e{static get priority(){return Number.MAX_VALUE}created(e,t,r,...n){let s=h(i(e,r),e);p(e,r,D(s));let o=Reflect.getPrototypeOf(e);o&&!i(o,r+"_$__")&&p(o,r+"_$__",s)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[Ne.METHOD]}wait;result;constructor(){super()}});var Ar;!function(e){e.ONCE="once",e.UPDATABLE="updatable"}(Ar||(Ar={}));class wr extends _e{static get priority(){return Number.MAX_VALUE}created(e,t,r,...n){}mounted(e,t,...r){}get targets(){return[Ne.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,r,n,...s){const o=this;Reflect.defineProperty(e,n,{get:()=>(o.result&&o.cache||o.getter(e),o.result)})}updated(e,t){this.cache===Ar.UPDATABLE&&this.getter(e)}}const Pr=Me(wr),Mr=Me(class extends wr{getter(e){this.result=e.shadowRoot?.querySelectorAll(this.selector)}});function kr(e){if(1===arguments.length)return(t,r)=>{Or(t,r,e)};Or(arguments[0],arguments[1],{prop:""})}function Or(e,t,r){if(!u(e.constructor,ce.STATES)){const t={};let r=e.constructor;for(;(r=ve(r))!==it;)m(t,r[ce.STATES]?v(r[ce.STATES]):{});Reflect.defineProperty(e.constructor,ce.STATES,{configurable:!1,enumerable:!1,value:t})}r.shallow=r.shallow||!1,e.constructor[ce.STATES][t]=r}function Dr(e,t,r){Or(e.prototype,t,r||{prop:""})}function xr(e){return t=>{t&&(de[t.name]=e,customElements.define(e,t))}}const Rr=Me(class extends _e{static get priority(){return Number.MAX_VALUE}created(e,t,r,...n){let s=i(e,r);p(e,r,Q(s,this.wait));let o=Reflect.getPrototypeOf(e);o&&!i(o,r+"_$__")&&p(o,r+"_$__",s)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[Ne.METHOD]}wait;result;constructor(e){super(),this.wait=e}});function Lr(e,t){return(r,n)=>{u(r.constructor,ce.WATCH)||(r.constructor[ce.WATCH]=c(r.constructor[ce.WATCH])?{}:v(r.constructor[ce.WATCH]));(C(e)?e:[e]).forEach((e=>{let s=e.replaceAll(".",$e),o=r.constructor[ce.WATCH][s];C(o)||(o=r.constructor[ce.WATCH][s]=[]),o.push({source:e,options:t,handler:r[n]})}))}}const Hr=["key"],Vr=pt((function(e){return(e,[t],r)=>{let n=e.startNode;if(r)b(t,((e,t)=>{n.setAttribute(t,e)}));else if(n instanceof it){let e={},r={},s=i(n.constructor,ce.PROPS);b(t,((t,n)=>{if(Hr.includes(n))return;let o=R(n);s[o]?e[n]=t:r[n]=t+""})),n._initProps(e,r)}else b(t,((e,t)=>{n.setAttribute(t,e)}))}}),[Ve.TAG]),Wr=new Map,Ir=pt((function(e){return(e,[t],n,{renderComponent:s})=>{let o=[];if(C(t)?o=G(t):a(t)?o=w(t,((e,t)=>e?t:[])):r(t)&&(o=t.split(" ")),o.length<1&&!n)return;let i=e.startNode;if(Wr.get(i)&&Wr.get(i).length===o.length&&se(Wr.get(i),o))return;let l=Wr.get(i);b(l,(e=>{i.classList.remove(e)})),b(o,(e=>{i.classList.add(e)})),l=d(o),Wr.set(i,l)}}),[Ve.CLASS]),$r=new Map,jr=new Map,Ur=pt((function(e,t){return(e,t,r,{varChain:n})=>{let s=e.startNode,o=function(e,t,r){let n=z(e,((e,r)=>t(e,r)));if(n.length<1){let e=new yr([],[]);return jr.set(r,e),e}let s=[],o=[];const i=[],a=[];for(let e=0;e<n.length;e++){const t=n[e];let r=y(o),l=t.vars,c=!0,u=t.strings;for(let e=0;e<u.length;e++){const t=u[e];if(ae.test(t)){let t=l[e]+"";if(s.includes(t))return void pe(`forEach - duplicate key '${t}'`);s.push(t),c=!1}0==e&&r?o[o.length-1]=r+t:o.push(t)}if(c)return void pe("forEach - missing 'key' prop");let d=y(i);d&&u.length>0&&(i[i.length-1]=V(d)+u.shift()),i.push(""),a.push(t)}i.push("");let l=new yr(i,a);return jr.set(r,l),l}(t[0],t[1],s);if(r&&r[0]){const r=$r.get(s);if(c(e.getNodes())&&(!t||c(t[0])))return[We.NONE,o];if(r&&se(r,t[0])&&r.length===t[0].length)return[We.NONE,o]}return $r.set(s,te(t[0])),r?[We.UPDATE,o]:[We.APPEND,o]}}),[Ve.TEXT,Ve.SLOT]);let Br=document.createElement("div");const Fr=pt((function(e){return(e,t,r,{renderComponent:n,slotComponent:s})=>{r&&t[0]==r[0]||H(t[0])||(Br.innerHTML=ur(t[0]),e.startNode.after(...Br.childNodes))}}),[Ve.TEXT,Ve.SLOT]),Gr=pt((function(e){return(e,t,r,{renderComponent:n,slotComponent:s})=>{r&&t[0]==r[0]||H(t[0])||(e.startNode.innerHTML=ur(t[0]))}}),[Ve.TAG]),zr=new WeakMap,Xr=pt((function(e,t,r){return(n,[s,o],i,{renderComponent:a})=>{let l=n.endNode;if(i){if(!!s==!!i[0]){let e=zr.get(l);return[We.NONE,e.call(a,s)]}let e=s?t:r;return zr.set(l,e),[We.REPLACE,e.call(a,s)]}{let n=s?t:r;return zr.set(l,n),[We.APPEND,n.call(a,e)]}}}),[Ve.TEXT,Ve.SLOT]),Kr=pt((function(e,t){return(e,[t,r],n)=>n?t===n[0]?[We.NONE,t?r():br``]:t?[We.REPLACE,t?r():br``]:[We.REMOVE]:[We.APPEND,t?r():br``]}),[Ve.TEXT,Ve.SLOT]);var Qr;!function(e){e.CHANGE="change",e.INPUT="input"}(Qr||(Qr={}));const qr=pt((function(t,n="value",s){return(o,l,c,{varChain:u,renderComponent:d})=>{const h=o.startNode;if(c){const e=c[0],t=l[0];let r=i(h,n);if(!a(t)&&Object.is(t,e)&&Object.is(r,t))return;if(h instanceof it)h._updateProps({[n]:t});else if(h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement){if(h.setAttribute(n,t+""),h instanceof HTMLSelectElement){let e=K(h.querySelectorAll("option"),(e=>e.value==t));e&&(e.selected=!0)}}else if(h instanceof HTMLInputElement){if(h.value==t)return;switch(h.type){case"checkbox":case"radio":t?h.setAttribute("checked",""):h.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":h.setAttribute(n,t+""),p(h,n,t);break;default:h.setAttribute(n,t+"")}}return}if("binded"===i(h,"_model"))return;let f;f=r(s)?e(s):y(u);const g=f[0];if(g in d||d._wrapperProp[g]||pe(`model - property '${g}' is not defined on the instance of `+d.tagName),a(t)||V(t)||(t=""),h instanceof it)h._initProps({[n]:t}),h.addEventListener("update:"+n,(e=>{let t=d,r=d._wrapperProp[g];!(g in d)&&r&&i(d.wrapperComponent,g)===i(d,r)&&(t=d.wrapperComponent||t),p(t,f,e.detail.value)})),p(h,"_model","binded");else if(h instanceof HTMLTextAreaElement)h.setAttribute(n,t+""),h.addEventListener("input",(e=>{let t=e.target;p(d,f,t.value)})),p(h,"_model","binded");else if(h instanceof HTMLInputElement){let e="",r="";switch(h.type){case"checkbox":case"radio":e="checked",r="change";break;default:e="value",r="input"}h.setAttribute(n??e,t+""),h.addEventListener(r,(e=>{let t=e.target;p(d,f,t.value)})),p(h,"_model","binded")}else h instanceof HTMLSelectElement&&(h.setAttribute(n,t+""),h.addEventListener("change",(e=>{let t=e.target,r=d,n=d._wrapperProp[g];!(g in d)&&n&&i(d.wrapperComponent,g)===i(d,n)&&(r=d.wrapperComponent||r),p(r,f,t.value)})),p(h,"_model","binded"))}}),[Ve.TAG]),Yr=new Map,Zr=pt((function(e,t){return(e,[r],n)=>{if(n&&r===n[0])return;let s=e.startNode;if(!Yr.has(s)){let e=s.style.display;Yr.set(s,"none"==e?"unset":e)}s.style.display=r?Yr.get(s):"none",t&&t(s,r)}}),[Ve.TAG]),Jr=pt((function(e,t){return(r,n,s,{renderComponent:o,slotComponent:i})=>{s||(e=e.bind(o),i._bindSlotHook(t||"default",e))}}),[Ve.SLOT]);class en{static getCssText(e,t=!1){return r(e)?e:x(z(e,((e,r)=>r.startsWith("--")?r+":"+e+(t?" !important":""):E(r)+":"+e+(t?" !important":""))),";")}static setStyle(e,t){if(r(e)&&!V(e))return{};let n=en.getCssText(e),s={};return b(n.split(";"),(e=>{let r=e.split(":"),n=V(r[0]),o=V(r[1]);s[n]=t.style.getPropertyValue(n),t.style.setProperty(n,o)})),s}}const tn=new Map;let rn=0;const nn=pt((function(e){return(e,t,r,{renderComponent:n})=>{let s=e.startNode,o=tn.get(s);o||(o="style_d"+rn++,tn.set(s,o)),n.isMounted?n.nextTick((()=>{en.setStyle(t[0],s)}),o):en.setStyle(t[0],s)}}),[Ve.STYLE]),sn=pt((function(e){return(t,r,n,{renderComponent:s,varChain:o})=>{const i=t.startNode;if(n){if(!Z(r,n)){let e=t.attrName;i._updateProps({[e]:r[0]})}return}let a=y(o),l=t.attrName;i._initProps({[l]:e}),i.addEventListener("update:"+l,(e=>{p(s,a,e.detail.value)}))}}),[Ve.PROP]),on=pt((function(e,t){return(e,[t,r],n)=>{let s=()=>br``,o=[],i=[];b(r,((e,t)=>{if(T(e))o.push(t),i.push(e);else{let t=e[0],r=e[1];o.push(t),i.push(r)}"default"===t&&(s=e)}));let a=oe(o,(e=>T(e)?e(t):e==t));return n?[We.REPLACE,ie(i[a]??s)]:[We.APPEND,ie(i[a]??s)]}}),[Ve.TEXT,Ve.SLOT]);export{it as CompElem,en as CssHelper,_e as Decorator,Ne as DecoratorType,we as DecoratorWrapper,We as DirectiveUpdateTag,Se as DomUtil,at as EnterPoint,Ve as EnterPointType,Te as GetKeyFnName,Qr as ModelTriggerType,$e as PATH_SEPARATOR,ot as PROP_OBJECT_KEY_MAP_SYMBOL,Ar as QueryCache,yr as Template,Ie as UpdatePoint,Ae as _DecoratorMap,Ce as _DecoratorsKey,He as _getObservedAttrs,ve as _getSuper,me as _toUpdatePath,Vr as bind,Oe as bindThis,cr as buildHTML,Ir as classes,Nr as computed,Sr as createRef,_r as debounced,Me as decorator,ke as decoratorWithNoArgs,pt as directive,Tr as event,Ur as forEach,Ee as getBooleanValue,ye as getSlotComponent,br as html,Fr as htmlC,Gr as htmlD,Xr as ifElse,Kr as ifTrue,be as isBooleanProp,Dr as makeState,qr as model,Cr as onced,xe as prop,Pr as query,Mr as queryAll,Zr as show,pe as showError,he as showTagError,ge as showTagWarn,fe as showWarn,Jr as slot,kr as state,nn as styles,sn as sync,xr as tag,Rr as throttled,ut as updateDirective,Lr as watch,on as when};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compelem",
3
- "version": "0.9.4-b1",
3
+ "version": "0.11.0-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",
@@ -9,7 +9,7 @@
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "https://github.com/holyhigh2/compelem"
12
+ "url": "git+https://github.com/holyhigh2/compelem.git"
13
13
  },
14
14
  "bugs": "https://github.com/holyhigh2/compelem/issues",
15
15
  "keywords": [
package/CompElem.d.ts DELETED
@@ -1,116 +0,0 @@
1
- import { IComponent } from "./IComponent";
2
- import { Template } from "./render/Template";
3
- import { DefaultProps, TmplFn } from "./types";
4
- export declare const PROP_OBJECT_KEY_MAP_SYMBOL: unique symbol;
5
- /**
6
- * CompElem基类,意为组件元素。提供了基本内置属性及生命周期等必备接口
7
- * 每个组件都需要继承自该类
8
- *
9
- * @author holyhigh2
10
- */
11
- export declare class CompElem extends HTMLElement implements IComponent {
12
- #private;
13
- static __l_globalRule: HTMLStyleElement;
14
- static defaults(options: DefaultProps): void;
15
- __events: Record<string, Array<Node | ((e: Event) => void) | Record<string, any>>[]>;
16
- get [Symbol.toStringTag](): string;
17
- get cid(): number;
18
- get reactiveData(): Record<string, any>;
19
- get attrs(): Record<string, string>;
20
- get props(): Record<string, any>;
21
- get renderRoot(): HTMLElement;
22
- get renderRoots(): HTMLElement[];
23
- get parentComponent(): CompElem | null;
24
- get wrapperComponent(): CompElem | null;
25
- get slotHooks(): Record<string, (...args: any[]) => Template>;
26
- get css(): CSSStyleSheet[];
27
- get globalStyleSheet(): CSSStyleSheet;
28
- get isMounted(): boolean;
29
- get slots(): Record<string, Array<Node>>;
30
- /**
31
- * 组件样式,CSSStyleSheet可动态变更
32
- */
33
- static get styles(): Array<string | CSSStyleSheet>;
34
- static get globalStyles(): Array<string>;
35
- static get hostStyles(): Array<string>;
36
- get styles(): Array<() => string>;
37
- constructor(...args: any[]);
38
- insertStyleSheet(sheet: string | CSSStyleSheet): CSSStyleSheet;
39
- /**
40
- * Returns the root component in the parent chain, or itself if it's the top-level component.
41
- */
42
- get rootComponent(): CompElem;
43
- connectedCallback(): void;
44
- disconnectedCallback(): void;
45
- __init(): void;
46
- propsReady(props: Record<string, any>): void;
47
- render(): Template;
48
- beforeMount(): void;
49
- mounted(): void;
50
- slotChange(slot: HTMLSlotElement, name: string): void;
51
- attributeChangedCallback(attributeName: string, oldValue: string | null, newValue: string | null): void;
52
- /**
53
- * 是否需要更新,可获取变更属性
54
- * 返回true时更新
55
- */
56
- shouldUpdate(changed: Record<string, any>): boolean;
57
- /**
58
- * 1. 调用render
59
- * 2. 更新@query/all
60
- * 3. 更新ref
61
- * 4. 更新prop到attr的映射
62
- * @param changed
63
- */
64
- updated(changed: Record<string, any>): void;
65
- /**
66
- * 由监控变量调用
67
- * @param stateKey
68
- * @param ov
69
- * @param rootStateKey 如果是对象内部属性变更,会返回根属性名
70
- * @returns
71
- */
72
- _notify(ov: any, chain: string[]): any;
73
- _updateProps(props: Record<string, any>): void;
74
- _wrapperProp: Record<string, string>;
75
- _initProps(props: Record<string, any>, attrs?: Record<string, any>): void;
76
- /**
77
- * 绑定slot标签,render时调用
78
- */
79
- _bindSlot(slot: HTMLSlotElement, name: string, props: Record<string, any>): void;
80
- _bindSlotHook(name: string, hook: (...args: any[]) => Template): void;
81
- _updateSlot(name: string, propName?: string, value?: any): void;
82
- _asyncDirectives: WeakMap<TmplFn, any>;
83
- renderAsync(cbk: TmplFn, ...args: any[]): void;
84
- /**
85
- * todo
86
- * 1. 取消上溯递归路径
87
- */
88
- _regDeps(varPath: string, renderContext: CompElem | Node): void;
89
- _regWrapper(wrapperComponent: CompElem): void;
90
- _getPrivateData(): Record<string, any>;
91
- /**
92
- * 抛出自定义事件
93
- * @param evName 事件名称
94
- * @param args 自定义参数
95
- */
96
- emit(evName: string, arg?: Record<string, any>, options?: {
97
- event?: Event;
98
- bubbles?: boolean;
99
- composed?: boolean;
100
- }): void;
101
- /**
102
- * 在root上绑定事件
103
- * @param evName
104
- * @param hook
105
- */
106
- on(evName: string, hook: (e: Event) => void): void;
107
- /**
108
- * 下一帧执行
109
- * @param cbk
110
- */
111
- nextTick(cbk: () => void, key?: string): void;
112
- /**
113
- * 强制更新一次视图
114
- */
115
- forceUpdate(): void;
116
- }
package/IComponent.d.ts DELETED
@@ -1,62 +0,0 @@
1
- import { Template } from "./render/Template";
2
- /**
3
- * 组件接口
4
- * 定义组件属性、生命周期及方法
5
- * @author holyhigh2
6
- */
7
- export interface IComponent {
8
- get cid(): number;
9
- get attrs(): Record<string, string>;
10
- get props(): Record<string, any>;
11
- get renderRoot(): HTMLElement;
12
- get renderRoots(): HTMLElement[];
13
- get rootComponent(): HTMLElement;
14
- get parentComponent(): HTMLElement | null;
15
- get wrapperComponent(): HTMLElement | null;
16
- get slots(): Record<string, Array<Node>>;
17
- get slotHooks(): Record<string, (...args: any[]) => Template>;
18
- get css(): CSSStyleSheet[];
19
- get globalStyleSheet(): CSSStyleSheet;
20
- get isMounted(): boolean;
21
- get styles(): Array<() => string>;
22
- propsReady(props: Record<string, any>): void;
23
- render(): Template;
24
- beforeMount(): void;
25
- mounted(): void;
26
- connectedCallback(): void;
27
- disconnectedCallback(): void;
28
- shouldUpdate(changed: Record<string, any>): boolean;
29
- updated(changed: Record<string, any>): void;
30
- slotChange(slot: HTMLSlotElement, slotName: string): void;
31
- attributeChangedCallback(attributeName: string, oldValue: string | null, newValue: string | null): void;
32
- /**
33
- * 抛出自定义事件
34
- * @param evName 事件名称
35
- * @param args 自定义参数
36
- */
37
- emit(evName: string, arg: Record<string, any>, options?: {
38
- event?: Event;
39
- bubbles?: boolean;
40
- composed?: boolean;
41
- }): void;
42
- /**
43
- * 在root上绑定事件
44
- * @param evName
45
- * @param hook
46
- */
47
- on(evName: string, hook: (e: Event) => void): void;
48
- /**
49
- * 下一帧执行
50
- * @param cbk
51
- */
52
- nextTick(cbk: () => void): void;
53
- /**
54
- * 强制更新一次视图
55
- */
56
- forceUpdate(): void;
57
- /**
58
- * 向组件插入样式表
59
- * @param sheet
60
- */
61
- insertStyleSheet(sheet: string | CSSStyleSheet): CSSStyleSheet;
62
- }
package/compelem.umd.js DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * compelem v0.9.4-b1.1765098297
3
- * A modern, reactive, fast, lightweight and flexible lib for building web components
4
- * @holyhigh2
5
- * https://github.com/holyhigh2/compelem
6
- */
7
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("myfx")):"function"==typeof define&&define.amd?define(["exports","myfx"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).compelem={},e.myfx)}(this,(function(e,t){"use strict";const r=/\s+\.?key\s*=/;var n,s,o;!function(e){e[e.CSS=1]="CSS",e[e.COMPUTED=2]="COMPUTED"}(n||(n={})),function(e){e.PROPS="__deco_props",e.STATES="__deco_states",e.COMPUTED="__deco_computed",e.WATCH="__deco_watch",e.EVENTS="__deco_events"}(s||(s={})),function(e){e.Prod="prod",e.Dev="dev"}(o||(o={}));const i={};function a(e){console.error("[CompElem]",e)}function l(e,t){console.error(`[CompElem <${e}>]`,t)}function c(e){return t.toPath(e).join("-")}function u(e){return Object.getPrototypeOf(e)}function d(e){return e===Boolean||t.some(e,(e=>e===Boolean))}function p(e){let r=e;return t.isString(e)&&/(?:^true$)|(?:^false$)/.test(r)?r="true"===r:(t.isUndefined(r)||t.isBlank(r))&&(r=!0),r}var h;e.DecoratorType=void 0,(h=e.DecoratorType||(e.DecoratorType={})).CLASS="class",h.FIELD="field",h.METHOD="method";class f{static get priority(){return 0}}const g="getKey",m="__decorators",y=new WeakMap;class v{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(e,r,n){this.args=e,this.metadata=r,this.decoratorClass=n,this.priority=t.get(n,"priority",0),this.instanceMap=new WeakMap}create(r){let n,s=new this.decoratorClass(...this.args),o=s.targets,i=this.metadata[2];t.isObject(i)&&t.isDefined(t.get(i,"configurable"))?n=e.DecoratorType.METHOD:t.isUndefined(this.metadata[2])&&(n=e.DecoratorType.FIELD),!t.isEmpty(o)&&n&&o.includes(n)?(s.created(r,...this.metadata),this.instanceMap.set(r,s)):a(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${o.join(",")}' bug got '${n}'`)}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 b=new WeakMap;function E(e){let r=(...r)=>(...n)=>{let s=n[0].constructor,o=s[m];if(!t.has(s,m)){let e=Object.getPrototypeOf(s);o=e?t.concat(e[m]??[]):[],Reflect.defineProperty(s,m,{configurable:!1,enumerable:!1,value:o})}let i,a={},l=e[g];if(l){let t=b.get(e);if(t||(t=new WeakMap,b.set(e,t)),a=t.get(s),a||(a={},t.set(s,a)),i=l(...r),a[i])return a[i]}let c=new v(r,n,e);return a[i]=c,o?.push(c),c};return y.set(r,!0),r}const S=new WeakMap;function T(e,r,n,o){let i;if(t.isLowerCaseChar(r[0])||a(`Prop '${r}' must be in CamelCase`),!t.has(e.constructor,s.PROPS)){const r={};let n=e.constructor;for(;(n=u(n))!==K;)t.merge(r,n[s.PROPS]?t.cloneDeep(n[s.PROPS]):{});Reflect.defineProperty(e.constructor,s.PROPS,{configurable:!1,enumerable:!1,value:r}),i=new Set,t.each(r,((e,r)=>{if(e.attribute){let e=t.kebabCase(r);i?.add(e)}})),S.set(e.constructor,i)}if(o&&(o.get&&(n.getter=o.get),o.set&&(n.setter=o.set)),n.attribute){i||(i=S.get(e.constructor));let n=t.kebabCase(r);i?.add(n)}t.has(e.constructor,"observedAttributes")||(e.constructor.observedAttributes=[]),e.constructor.observedAttributes=t.toArray(i),e.constructor[s.PROPS][r]=n}const C=new Set;function N(e){return S.get(e)??C}var _,A;e.EnterPointType=void 0,(_=e.EnterPointType||(e.EnterPointType={})).ATTR="attr",_.PROP="prop",_.TEXT="text",_.CLASS="class",_.STYLE="style",_.SLOT="slot",_.TAG="tag",e.DirectiveUpdateTag=void 0,(A=e.DirectiveUpdateTag||(e.DirectiveUpdateTag={})).NONE="NONE",A.REMOVE="REMOVE",A.REPLACE="REPLACE",A.UPDATE="UPDATE",A.APPEND="APPEND";class P{key;varIndex;value;isText=!1;isDirective=!1;node;textNode;isComponent=!1;attrName;attrTmpl;isProp=!1;isToggleProp=!1;notUpdated;constructor(e,t,r,n){this.varIndex=e,this.node=t,r&&(this.attrName=r),n&&(this.attrTmpl=n)}}const w="-",D={collectWatch(e,t,r){let n=R.get(e);n||(n={},R.set(e,n));let s=n[r];s||(s=n[r]=[]),s.push(t)},startCollect(e,t){this.__collectType=t,this.__collecting=e},setUpdater(e){this.__updater=e},endCollect(){this.__collecting=null},__directiveQ:[],setDirectiveQ(e){let r=t.last(this.__directiveQ);const n=e?e.join(","):"",s=r?r.join(","):"";r&&n===s||(r&&r.length<e.length&&t.startsWith(n,s)?this.__directiveQ[this.__directiveQ.length-1]=e:this.__directiveQ.push(e))},popDirectiveQ(){let e=t.concat(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=[]},__updater:null,__collecting:null,__collectType:-1,__renderCollection:new Set,__renderContext:null,__renderCollecting:!1,__skipCheck:!1},M=new WeakMap,k=new WeakMap,O=new WeakMap,x=new WeakMap,R=new WeakMap,L=new WeakMap;function U(e,r){if(!t.isObject(e))return e;if(L.has(e))return L.get(e);if(M.has(e))return e;const o=new Proxy(e,{get(e,r,o){if(!r)return;const i=Reflect.get(e,r,o);if(t.isSymbol(r))return i;if(t.isFunction(i))return i;if("length"===r&&t.isArray(e))return i;let a=k.get(o)??[],l=t.concat(a,[r]),u=r in e;if((D.__renderCollecting||D.__collecting)&&(u&&e.hasOwnProperty(r)||!u)){let e=l.join(w);if(D.__renderCollecting)D.collect(c(l)),D.setDirectiveQ(l);else if(D.__collecting){let t;switch(D.__collectType){case n.COMPUTED:t=O.get(D.__collecting),t||(t={},O.set(D.__collecting,t));break;case n.CSS:t=x.get(D.__collecting),t||(t={},x.set(D.__collecting,t))}let r=t[e];r||(r=t[e]=[]),r.push(D.__updater)}}const d=M.get(o);let p=d.from;if(L.has(i))return L.get(i);let h=t.get(p.constructor,s.STATES),f=t.get(h,[l[0]]);if(!f){let e=t.get(p.constructor,s.PROPS);f=t.get(e,[l[0]])}if(!f)return i;if(t.get(f,"shallow")&&l.length>1)return i;let g=i;if(t.isObject(i)&&!t.isFunction(i)&&!(i instanceof Node)&&!Object.isFrozen(i)){let e=d.pathMap;d.contextSet.forEach((t=>{let r=e?.get(t);r&&(g=U(i,t),L.set(i,g),k.has(g)||k.set(g,l))}))}return g},set(e,n,o,i){if(!n)return!1;if(!r.isMounted){return Reflect.set(e,n,o)}let a=e[n],l=k.get(i)??[],c=t.concat(l,[n]),u=t.get(r.constructor,s.PROPS),d=t.get(r.constructor,s.STATES),p=t.get(u,[c[0],"hasChanged"])||t.get(d,[c[0],"hasChanged"]),h=o,f=a;if(c.length>1&&(f=h=r._getPrivateData()[c[0]]),p){if(!p.call(r,h,f,c,o,a))return!0}else if(Object.is(a,o))return!0;u&&u[n]&&e.__isData&&u[n].sync&&r.emit("update:"+n,{value:o});let g=o,m=Reflect.set(e,n,g);return H(r,f,c,o,a),m}});let i=k.get(e)??[];if(Object.isExtensible(e)&&!M.get(o)){let e=new Set;e.add(r);let t=new WeakMap;t.set(r,i),M.set(o,{from:r,contextSet:e,pathMap:t})}else{M.get(o).contextSet.add(r);let e=M.get(o).pathMap,n=e.get(r),s=t.concat(i);if(n&&n.join("")!==s.join("")){let e=t.get(r,t.initial(n));t.isArray(e)||function(...e){console.warn("[CompElem]",...e)}(`The object is referenced by more than one @state '${s.join(".")},${n.join(".")}'`),n=s}else e.set(r,s)}return L.set(e,o),o}function H(e,r,n,s,o){let i=O.get(e),a=x.get(e),l=R.get(e);if(i||a||l){let e=n.length;for(;e;){let c=n.slice(0,e).join(w);if(l){const i=l[c];e===n.length?i?.forEach((e=>{let t=e();t.oldValue=r,t.subNewValue=s,t.subOldValue=o,t.path=n,W.pushWatch(t)})):i?.forEach((e=>{let i=e();t.get(i,"deep")&&(i.oldValue=r,i.subNewValue=s,i.subOldValue=o,i.path=n,W.pushWatch(i))}))}if(i){let e=i[c];if(!t.isEmpty(e))for(let t=0;t<e.length;t++){const r=e[t];W.pushComputed(r)}}if(a){let e=a[c];if(!t.isEmpty(e))for(let t=0;t<e.length;t++){const r=e[t];W.pushCss(r)}}e--}}let c=e._notify(r,n);W.pushNext(c,e.cid)}const j=new Map;class W{static watchSet=new Set;static computedSet=new Set;static cssSet=new Set;static nextSet=new Set;static nextPending=!1;static next;static flush(){W.nextPending=!1;let e=Array.from(W.watchSet);W.watchSet.clear();let r=Array.from(W.computedSet);W.computedSet.clear();let n=Array.from(W.cssSet);W.cssSet.clear();let s=Array.from(W.nextSet);W.nextSet.clear(),j.clear(),e.forEach((e=>e(t.get(e,"path"),t.get(e,"oldValue"),t.get(e,"subNewValue"),t.get(e,"subOldValue")))),r.forEach((e=>e())),n.forEach((e=>e())),s.forEach((e=>e()))}static pushWatch(e){W.watchSet.add(e)}static pushComputed(e){W.computedSet.add(e)}static pushCss(e){W.cssSet.add(e)}static pushNext(e,t){if(t){if(j.has(t))return;j.set(t,e)}W.nextSet.add(e),W.nextPending||(W.nextPending=!0,W.next())}}(()=>{const e=Promise.resolve(),t=W.flush;W.next=()=>{e.then(t)}})();const V={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},I=new WeakMap;let B=[],$=0;const F=new Map,z=new WeakMap,G=Symbol.for("PROP_OBJECT_KEY_MAP_SYMBOL");class K extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(e){B=t.flatMap(e.css,(e=>{if(t.isString(e)){let t=new CSSStyleSheet;return t.replaceSync(e),t}return e instanceof CSSStyleSheet?e:[]})),e.global,t.each(e,((e,r)=>{t.test(r[0],/[A-Z]/)}))}#e;#t={};#r={"#slots":{}};#n={};#s={};#o;#i={};__events={};get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#e}get reactiveData(){return this.#n}get attrs(){return this.#a}get props(){return this.#l}get renderRoot(){return this.#c}get renderRoots(){return this.#u}get parentComponent(){return this.#d}get wrapperComponent(){return this.#p}get slotHooks(){return this.#h}get css(){return I.get(this.constructor)}get globalStyleSheet(){return F.get(this.constructor)?.sheet}get isMounted(){return this.#f}get slots(){return this.#r["#slots"]}#a;#l;#c;#u;#d;#p;#g={};#h={};#m={};#f=!1;static get styles(){return[]}static get globalStyles(){return[]}static get hostStyles(){return[]}get styles(){return[]}#y=!1;#v=!1;constructor(...e){super(),this.#e=$++,1===t.size(e)&&(this.#l={},t.assign(this.#l,t.first(e)));let r=this.render.bind(this);this.render=function(){let e;return D.startRender(this),e=r(),D.endRender(this),e};let n=t.get(this.constructor,"globalStyles"),s=F.has(this.constructor);if(!t.isEmpty(n)&&!s){let e="";n.forEach((r=>{t.isString(r)&&(e+=r+"\n")}));let r=document.createElement("style");r.textContent+=e,F.set(this.constructor,r),document.head.appendChild(r)}let o=I.get(this.constructor),i=o??[];o||(t.each(t.get(this.constructor,"styles"),(e=>{if(t.isString(e)){let t=new CSSStyleSheet;t.replaceSync(e),i.push(t)}else i.push(e)})),I.set(this.constructor,i)),this.#o=this.attachShadow({mode:"open"}),this.#o.adoptedStyleSheets=[...B,...i],this.#b();let a=t.get(this.constructor,m);a&&a.sort(((e,t)=>t.priority-e.priority)).forEach((e=>e.create(this))),this.#E=this.#S.bind(this)}insertStyleSheet(e){let r;if(t.isString(e)){r=new CSSStyleSheet;try{r.replaceSync(e)}catch(e){}}else{if(this.shadowRoot.adoptedStyleSheets.includes(e))return e;r=e}this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,r];return(I.get(this.constructor)??[]).push(r),r}get rootComponent(){let e=this;for(;e.parentComponent;)e=e.parentComponent;return e}#E;connectedCallback(){let e=t.closest(this.parentNode,(e=>e instanceof K||e.host instanceof K),"parentNode");this.#d=e?e instanceof K?e:e.host:null,this.__init()}disconnectedCallback(){}__init(){if(this.#y)return;if(this.#v)return;this.#v=!0,this.#b();const e=this.#T();this.propsReady(e);for(const t in e){const r=e[t];this.#r[t]=r}this.#C(),t.each(this.#r,((e,t)=>{let r=Reflect.getOwnPropertyDescriptor(this.#r,t);Reflect.defineProperty(this,t,{get(){let e=Reflect.get(this.#n,t);return r?.get?r?.get():e},set(e){r?.set?r?.set(e):Reflect.set(this.#n,t,e)}})})),Reflect.defineProperty(this.#r,"__isData",{enumerable:!1,value:!0}),this.#n=U(this.#r,this);let r=t.get(this.constructor,s.COMPUTED);t.each(r,((e,t)=>{D.startCollect(this,n.COMPUTED),D.setUpdater((()=>{this.#n[t]=e.call(this)})),this.#r[t]=e.call(this),D.endCollect(),Reflect.defineProperty(this,t,{get(){return Reflect.get(this.#n,t)},set(e){l(this.tagName,"Cannot set a computed property '"+t+"'")}})}));let o=t.get(this.constructor,s.WATCH);t.each(o,((e,r)=>{e.forEach((e=>{let{source:n,options:s,handler:o}=e,i=o.bind(this);t.get(s,"once",!1)&&(i=t.once(i));const a=function(e,r,s,o){let a=t.get(this,n.replaceAll(w,"."));i(a,r,t.join(e,"."),s,o)}.bind(this);let l=t.get(s,"deep",!1);if(a.deep=l,D.collectWatch(this,(()=>a),r),!t.get(s,"immediate",!1))return;let c=t.get(this,n.replaceAll(w,"."));i(c,void 0,n)}))}));let i=function(e,r){let n,s=[];if(We.has(r.constructor)){let o=We.get(r.constructor),i=function(e,r){let n=t.concat(r.vars),s=r.strings.length-1;for(let o=0;o<=s;o++){let s=t.get(r.vars,o,"");if(s instanceof at){let[t,r]=Xe(e,s);n.splice(o,1,...r)}}return n}(r,e);n=Ve.has(r.constructor)?function(e,r,n){let s=Ve.get(n.constructor)?.cloneNode(!0),o=Ie.get(n.constructor);const i=document.createNodeIterator(s,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let a,l,c=0,u=0;for(;a=i.nextNode();){let s;if(u++,l&&!l.contains(a)&&(l=void 0),a instanceof HTMLElement||a instanceof SVGElement){a instanceof K&&(l=a);let i={},d=o[u];d&&d.forEach((o=>{let u=r[c++];switch(o.type){case Be.Event:s=t.clone(o.up),o.value||c--,o.value&&Pe(o.name,u.bind(n),a,n),a.removeAttribute(o.attrName);break;case Be.AttrSlot:l&&o.name,a.removeAttribute(o.attrName);break;case Be.Ref:s=t.clone(o.up),u.current=a,a.removeAttribute(o.attrName);break;case Be.AttrKey:s=t.clone(o.up),a.setAttribute(Re,u);break;case Be.AttrBool:s=t.clone(o.up),s.value=!!u,s.node=a,s.value&&a.setAttribute(o.name,""),a.removeAttribute(o.attrName);break;case Be.AttrProp:s=t.clone(o.up),s.value=u,s.node=a,i[o.name]=u,o.attrName&&a.removeAttribute(o.attrName);break;case Be.AttrRef:case Be.Attr:s=t.clone(o.up),s.value=u,s.node=a,a.setAttribute(o.attrName,u),Be.AttrRef===o.type&&a.removeAttribute(o.name);break;case Be.DirectiveAttr:case Be.DirectiveTag:case Be.DirectiveProp:s=t.clone(o.up),s.value=u,s.node=a;let e=t.clone(o.point);e.startNode=a;let[r,d,p,h,f]=u,g=Qe.get(a);if(g||(g={},Qe.set(a,g)),g[o.attrName??Symbol.keyFor(r)]=[e,n,l],p(e,d,void 0,{renderComponent:n,slotComponent:l,varChain:f}),Be.DirectiveAttr===o.type){let e=a.getAttribute(o.attrName);e=t.replace(e,Je,""),a.setAttribute(o.attrName,e)}o.name&&a.removeAttribute(o.name)}s&&e.push(s)})),a instanceof K?(a._regWrapper(n),t.size(i)>0&&a._initProps(i)):a instanceof HTMLSlotElement&&n._bindSlot(a,a.name||"default",i)}else{let i=o[u];i&&i.forEach((o=>{let i=r[c++];switch(o.type){case Be.DirectiveSlot:case Be.DirectiveText:s=t.clone(o.up),s.value=i,s.node=a;let[e,r,c,u,d]=i,p=Symbol.keyFor(e),h=document.createComment(`compelem-${n.tagName}-${p}-start`);s.textNode=h,a.parentNode.insertBefore(h,a),a.nodeValue=`compelem-${n.tagName}-${p}-end`;let f=t.clone(o.point);f.startNode=h,f.endNode=a,Ge.set(a,[f,n,l,r,d]),ze.set(a,c),Ke.set(a,s),D.startRender(a);let g=c(f,r,void 0,{renderComponent:n,slotComponent:l,varChain:d});D.endRender(n);let m=tt(a,g[1],n);m&&m.length>0&&st.insertBefore(a,Array.from(m));break;case Be.Text:s=t.clone(o.up),s.node=a;let y=t.toString(i??""),v=document.createTextNode(y);a.replaceWith(v),s.textNode=v}s&&e.push(s)}))}}return s.childNodes}(s,i,r):et(s,o,i,r)}else{let[t,o]=Xe(r,e);We.set(r.constructor,t),n=et(s,t,o,r)}return $e.set(r,s),n}(this.render(),this);i&&(this.#o.append(...i),this.#u=t.filter(this.#o.childNodes,(e=>e.nodeType===Node.ELEMENT_NODE)),this.#c=this.#u[0]),t.each(this.#h,((e,t)=>{this.#N(t)}));const a=this;let c=t.get(this.constructor,m);c&&c.sort(((e,t)=>t.priority-e.priority)).forEach((e=>{e.beforeMount(this,((e,t)=>(a.#n[e]=t,a.#n[e])))}));let u=t.get(this.constructor,"hostStyles"),d=this.#p?.shadowRoot??this.ownerDocument,p=z.get(d);if(!p?.includes(this.constructor)&&u.length>0){let e=[];t.each(u,(r=>{if(t.isString(r)){let t=new CSSStyleSheet;t.replaceSync(r),e.push(t)}else e.push(r)})),d.adoptedStyleSheets=[...d.adoptedStyleSheets,...e],p?.push(this.constructor)}this.beforeMount();let h=t.get(this.constructor,s.EVENTS);h&&h.forEach((async e=>{let r=e.name,n=t.assign({target:document,once:!1,passive:!1,capture:!1},e.options),s=t.bind(e.fn,this),o=n.target;t.isFunction(o)&&(o=await o.call(this,this)),o?o.addEventListener(r,s,n):l(this.tagName,"The target of @event('"+r+"',...) is invalid")})),setTimeout((()=>{this.#f=!0,D.startCollect(this,n.CSS);let e=[];this.styles.forEach((r=>{if(!t.isFunction(r))return;let n=new CSSStyleSheet;e.push(n),D.setUpdater((()=>{let e=r()??"";n.replaceSync(e)}));let s=r();t.isBlank(s)||n.replaceSync(s)})),D.endCollect(),e.length>0&&(this.#o.adoptedStyleSheets=[...this.#o.adoptedStyleSheets,...e]),this.mounted(),c&&c.forEach((e=>{e.mounted(this,((e,t)=>(a.#n[e]=t,a.#n[e])))}))}),0),this.#y=!0}propsReady(e){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}#_(e,r){this.#b();let n=t.get(this.#t[r],"props");n&&t.each(this.slots,((e,r)=>{e.filter((e=>e.nodeType===Node.ELEMENT_NODE)).forEach((e=>{e instanceof K?e._updateProps(n):t.each(n,((r,n)=>{if(e instanceof HTMLSlotElement){let s=t.get(e,"__l_comp");if(s){let t=e.name||"default",o=s.#t[t];o||(o=s.#t[t]={props:{}}),o.props||(o.props={}),o.props[n]=r,s.#_(e,t)}}else e.setAttribute(n,r)}))}))})),this.slotChange(e,r)}slotChange(e,t){}attributeChangedCallback(e,r,n){if(Object.is(n,r))return;let o=t.camelCase(e);if(d(t.get(this.constructor,[s.PROPS,o]).type)){let e=!t.isNull(n)&&p(n);if(t.get(this,o)===e)return}this.#A(e,r,n)}shouldUpdate(e){return!0}updated(e){}#P={};_notify(e,r){let n=[];for(let s=0;s<r.length;s++){const o=r[s];n.push(o);let i=t.get(this,n),a=c(n);this.#s[a]={value:i,chain:"slots"===a?["slots"]:n,oldValue:e,end:n.length===r.length}}return this.#E}#S(){if(t.size(this.#s)<1)return;if(!this.isMounted)return;const e=this.#s;if(this.#s={},!this.shouldUpdate(e))return;const r=Object.keys(e);let n=t.get(this.constructor,m);n&&n.sort(((e,t)=>t.priority-e.priority)).forEach((t=>{t.updated(this,e)}));let s=new Set;const o=this.#i;t.each(e,(({value:e,chain:t,oldValue:r,end:n},i)=>{o[i]&&o[i].forEach((e=>{s.add(e)}))})),s.forEach((e=>{e===this?rt(this.render(),this,void 0,r):nt(e,this,void 0,void 0,r)})),this.#w.forEach((e=>{this.#N(e)})),this.updated(e)}#T(){let e=t.get(this.constructor,s.PROPS),r=this.attributes,n=this.tagName,o=this.#l,i={};t.each(r,(({name:r,value:n})=>{if(r[0]===we||r[0]===De||r[0]===Me||r===xe||"slot"===r)return;let s=t.camelCase(r);e&&!e[s]&&(i[r]=n)})),this.#a=this.#a?t.assign(this.#a,i):i;let a={};if(!e)return Object.seal(a);let c=Object.keys(e),u=c.length;for(let s=0;s<u;s++){const i=c[s],u=t.kebabCase(i),d=this.hasAttribute(u);let p,h=e[i],f=t.has(o,i),g=t.get(this,i);if(!("_defaultValue"in h)&&(h._defaultValue=g,!h.type)){t.isUndefined(g)&&l(n,"Prop '"+i+"' has neither propType nor defaultValue be used for type inference");let e=typeof g;t.isArray(g)&&(e="array");let r=V[e];h.type=r}if(f)p=t.isNil(o[i])?g:o[i];else{p=g;let e=r.getNamedItem(u)||r.getNamedItem(De+u);e&&(f=!0,p=e.value)}if(h.required&&!f){l(n,"Prop '"+i+"' is required");break}p=this.#D(e,i,p,d);let m=t.get(e,[i,"getter"]);m&&(m=t.bind(m,this));let y=t.get(e,[i,"setter"]);y&&(y=t.bind(y,this)),(m||y)&&Reflect.defineProperty(this.#r,i,{set:y||function(e){},get:m}),h.attribute&&t.isDefined(p)&&!t.isObject(p)&&this.#M(h,i,p),this.#r[i]=p,a[i]=p}return Object.seal(a)}#M(e,r,n){let s=t.kebabCase(r),o=t.trim(n);d(e.type)?(o=p(n),t.isBoolean(o)?o&&!this.hasAttribute(s)?this.toggleAttribute(s,!0):!o&&this.hasAttribute(s)&&this.toggleAttribute(s,!1):this.getAttribute(s)!==o&&this.setAttribute(s,o)):this.getAttribute(s)!==o&&this.setAttribute(s,o)}#k(e,r){let n=e;try{for(let s=0;s<r.length;s++){const o=r[s];n=o===Boolean?p(e):o===Number?Number(e):o===String?String(e):o===Object||o===Array?t.parseJSON(e):o===Date?new Date(e):new o(e)}}catch(t){l(this.tagName,"Convert attribute error with "+e)}return n}#D(e,r,n,s){let o=e[r];if(!o)return n;let i=o.isValid,a=o.type,c=t.isArray(a)?a:[a],u=o.converter,d=n;if(!t.some(c,(e=>e===String))&&t.isString(d)&&!t.isNull(d))try{d=u?u(d):this.#k(d,c)}catch(e){l(this.tagName,`Convert attribute '${r}' error with `+d)}for(let e=0;e<c.length;e++){"Boolean"===c[e].name&&s&&(d=p(d))}if(t.isNil(d))return d;let h=typeof d,f=!t.isDefined(d);for(let e=0;e<c.length;e++){const r=c[e];if(t.test(h,r.name,"i")||d instanceof r||Object.prototype.toString.call(d)===Object.prototype.toString.call(r.prototype)){f=!0;break}}return f||l(this.tagName,`Invalid prop '${r}'. expected '${c.map((e=>e.name||e))}' but got '${h}'`),i&&(i.call(this,d,this.#r)||l(this.tagName,`Invalid prop '${r}'. IsValid() check failed`)),d}#C(){let e=t.get(this.constructor,s.STATES);t.each(e,((r,n)=>{let s=e[n],o=t.get(this,n);if(s){let e=s.prop;o=e?t.cloneDeep(this.#r[e]):t.get(this,n)}this.#r[n]=o}))}#O=t.debounce(this.propsReady,100);_updateProps(e){let r=t.get(this.constructor,s.PROPS),n=[];t.each(e,((e,s)=>{let o=t.camelCase(s),i=r[o];i&&(e=this.#D(r,o,e),i.attribute&&t.isDefined(e)&&!t.isObject(e)&&n.push([i,o,e]),D.__skipCheck=!0,t.set(this,o,e),D.__skipCheck=!1)})),t.assign(this.#l,e),n.forEach((([e,t,r])=>{this.#M(e,t,r)})),this.#l&&this.#O(this.#l)}_wrapperProp={};_initProps(e,r){this.#l=t.merge(this.#l||{},e),this.#a=t.merge(this.#a||{},r),t.each(e,((e,r)=>{if(t.isObject(e)){let n=k.get(e);if(n){let e=n.join(w);this._wrapperProp[e]=r;let o=t.get(this.wrapperComponent?.constructor,s.STATES),i=n[0];if(o&&o[i]){let e=t.get(this.constructor,s.PROPS);t.set(e,[r,"shallow"],o[i].shallow)}}}}))}_bindSlot(e,r,n){if(this.#g[r]||(this.#g[r]=e,Reflect.defineProperty(e,"__l_comp",{value:this})),e.addEventListener("slotchange",(t=>{this.#y&&this.#_(e,"default"===r?"":r)})),!t.isEmpty(n)){let e=this.#t[r];e||(e=this.#t[r]={}),e.props=n}}_bindSlotHook(e,t){this.#h[e]=t}#w=new Set;_updateSlot(e,t,r){let n=this.#g[e],s=this.#h[e];if(!s&&!n)return;let o=this.#t[e];if(t&&(o.props||(o.props={}),o.props[t]=r),s)this.#w.add(e);else{let e=n.assignedElements({flatten:!0});for(let n=0;n<e.length;n++){e[n].setAttribute(t,r+"")}}}#b(){const e=t.flatMap(this.childNodes,(e=>e.nodeType===Node.COMMENT_NODE?[]:e instanceof HTMLSlotElement?e.assignedNodes({flatten:!0}):e));let r=t.groupBy(e,(e=>e.nodeType===Node.TEXT_NODE?"default":e instanceof Element?e.getAttribute("slot")||"default":void 0));if(t.isEmpty(r))return void(t.isEmpty(this.#r["#slots"])||(this.#y?this.#n["#slots"]={}:this.#r["#slots"]={}));t.each(r,((e,r)=>{if(r){for(;e.length>0;){let r=e[0];if(!(r.nodeType===Node.TEXT_NODE&&t.isBlank(r.textContent)||r instanceof HTMLSlotElement&&t.isEmpty(r.assignedNodes({flatten:!0}))))break;e.shift()}for(;e.length>0;){let r=t.last(e);if(!(r.nodeType===Node.TEXT_NODE&&t.isBlank(r.textContent)||r instanceof HTMLSlotElement&&t.isEmpty(r.assignedNodes({flatten:!0}))))break;e.pop()}}}));let n={};t.each(r,((e,r)=>{t.isEmpty(e)||(n[r]=e)})),this.#y?this.#n["#slots"]=n:this.#r["#slots"]=n}#N(e){let r=this.#h[e];if(!r)return;let n=this.#t[e];if(!this.#r["#slots"][e])return;this.renderAsync(r,t.get(n,"props"));const s=this._asyncDirectives.get(r);let o=s?.buildView(r(t.get(n,"props"))),i=t.reject(t.toArray(o),(e=>e.nodeType===Node.COMMENT_NODE));if(i){let r=this.#m[e];if(!t.isEmpty(r))for(let e=0;e<r.length;e++){const t=r[e];t.parentNode?.removeChild(t)}this.#m[e]=i,this.append(...i),this.#w.clear()}}_asyncDirectives=new WeakMap;renderAsync(e,...t){}#A(e,r,n){if(!this.#y)return;if(N(this.constructor).has(e)){let r=t.camelCase(e);if(t.isNull(n)){n=t.get(this.constructor,s.PROPS)[r]._defaultValue}this._updateProps({[r]:n})}}_regDeps(e,t){let r=this.#i[e];r||(r=this.#i[e]=new Set),r.add(t);let n=e.split(w);if(n.pop(),n.length<1)return;let s=n.join(w);r=this.#i[s],r||(r=this.#i[s]=new Set),r.add(t)}_regWrapper(e){this.#p=e}_getPrivateData(){return this.#r}emit(e,r={},n){n&&n.event&&(r.event=n.event),r.target=this,this.dispatchEvent(new CustomEvent(e,{bubbles:t.get(n,"bubbles",!1),composed:t.get(n,"composed",!1),cancelable:!0,detail:r}))}on(e,t){this.#P[e]||(this.#P[e]=[]);let r=t.bind(this);this.#P[e].push(r),this.addEventListener(e,r)}nextTick(e,t){W.pushNext(e,t)}forceUpdate(){t.each(this.#n,((e,t)=>{this.#s[t]={value:void 0,chain:void 0}})),this.#S()}}class Q{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(e,t,r){this.startNode=e,this.attrName=t,this.type=r}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}}var X;!function(e){e.AFTER_BEGIN="afterbegin"}(X||(X={}));const q={};function Y(r,n,s,o,i,l,c,u=!1){let d;if(u?(D.startRender(r.endNode),d=o(r,n,s,{renderComponent:i,slotComponent:l,varChain:c}),D.endRender(i)):d=o(r,n,s,{renderComponent:i,slotComponent:l,varChain:c}),!d)return;let[p,h]=d;if(p===e.DirectiveUpdateTag.NONE)return;let f=r.getNodes();if(p===e.DirectiveUpdateTag.REMOVE)for(let e=0;e<f.length;e++){const t=f[e];t.parentNode?.removeChild(t)}else if(p===e.DirectiveUpdateTag.REPLACE){let e=[];for(let e=0;e<f.length;e++){const t=f[e];t.parentNode?.removeChild(t)}let n=tt(r.endNode,h,i);e=t.toArray(n);let s=document.createDocumentFragment();s.append(...e),r.endNode.parentNode.insertBefore(s,r.endNode)}else if(p===e.DirectiveUpdateTag.UPDATE){let e,n={},s=[],o=[],l=Fe.get(r.endNode);if(h||(h=new at([],[])),t.isEmpty(f)){let e=tt(r.endNode,h,i);return void r.startNode.after(...e)}let c={};h instanceof at&&h.vars.forEach((e=>{if(e instanceof at){const t=e.getKey();c[t]=e,n[t]=!0,o.push(t)}})),f=t.filter(t.compact(f),(e=>e.nodeType===Node.ELEMENT_NODE)),e=t.filter(t.compact(t.toArray(e)),(e=>e.nodeType===Node.ELEMENT_NODE));let u={},d="",p={};for(let e=0;e<f.length;e++){let t=f[e],r=t.getAttribute("key");if(r){if(u[r]){d=r;break}u[r]=t,s.push(r),p[r]=!0}}if(d)return void a(`${t.camelCase(r.endNode._diName)} - duplicate key '${d}'`);let g=n;const m=r.startNode.parentNode;let y=[],v=[];t.each(p,((e,r)=>{g[r]||(v.push(r),delete p[r],t.remove(s,(e=>e===r)))}));let b,E=!1;if(!t.isEmpty(o)){let e=-1,n=[],i=[],a=0,l=0;for(;l<o.length;l++){const c=o[l];let d=s.findIndex((e=>e===c));if(d<0){let e=o[l-1],t=e?u[e]||e:r.startNode;y.push({prevNode:t,newkey:c}),a++}else if(d>-1&&d!==l-a){if(e<0||1===Math.abs(e-d)){let e=t.last(n);n.push({nodeId:c,targetId:0===l?X.AFTER_BEGIN:e?e.nodeId:o[l-1]})}else i.push({moveGroup:n,moveIndex:l+n.length}),n=[],n.push({nodeId:c,targetId:o[l-1]});e=d}}if(n.length>0&&i.push({moveGroup:n,moveIndex:l+n.length}),i.length>0){E=!0;let e=i.sort(((e,t)=>e.moveGroup.length-t.moveGroup.length));if(e.length<2){let{moveGroup:n}=e[0];if(n.length>1){let e=t.last(n).targetId;n[n.length-2].nodeId===e&&(n=t.initial(n))}n.forEach((({targetId:e,nodeId:t})=>{let n,s=u[t];e===X.AFTER_BEGIN?(n=r.startNode,n.after(s)):(n=u[e],n.after(s))}))}else{let n=t.last(e).moveIndex;1===Math.abs(e[e.length-2].moveIndex-n)&&(e=t.initial(e)),e.forEach((({moveGroup:e})=>{e.forEach((({targetId:e,nodeId:t})=>{let n,s=u[t];e===X.AFTER_BEGIN?(n=r.startNode,n.after(s)):(n=u[e],n.after(s))}))}))}}}if(y.length>0&&(b=function(e,r,n,s,o,i){const a=[],l=[],c=[];let u,d=[];e.forEach((e=>{let n=t.last(d);n&&u===e.prevNode?(n.group||(n.group=[u]),n.group.push(e.newkey)):d.push(e),u=e.newkey;let s=e.newkey;c.push(s),a.push(""),l.push(r[s])})),a.push("");let p=new at(a,l),h=[...o],f=tt(i,p,s),g=Fe.get(i);o.length=0,o.push(...g);let m=new Map;return f.forEach((e=>{const t=e.getAttribute("key");c.includes(t)&&(m.set(t,!0),q[t]=e)})),h.forEach(((e,t)=>{const r=e.key+"";!m.get(r)&&n.includes(r)&&o.push(e)})),d}(y,c,o,i,l,r.endNode),b.forEach(((e,n)=>{let s=e.newkey,o=q[s],i=e.prevNode;if(e.group){let r=document.createDocumentFragment();r.append(...t.map(e.group,(e=>q[e]))),o=r}i===r.endNode?i.before(o):i===r.startNode?i.after(o):"string"==typeof i?q[i].after(o):i.after(o)}))),v.forEach((e=>{let t=u[e];t&&t.parentNode&&m.removeChild(t)})),h.vars[0]instanceof at){let e=[],r=[];t.each(h.vars,(n=>{r.push(...n.vars),e.push(...t.map(n.vars,(e=>"1")))})),e.push("1"),h=new at(e,r)}if(E||v.length>0||b){const e=t.groupBy(l,(e=>e.key));let r=[],n=0;o.forEach((t=>{e[t].forEach((e=>{e.varIndex=n++,r.push(e)}))})),l=r}nt(r.endNode,i,h,l)}}let Z=0;function J(e,t){let r=e.name||"Di-"+Z++,n=Symbol.for(r);return(...t)=>{let r=e(...t);return[n,t,r,e=>{},D.popDirectiveQ()]}}const ee=["resize","outside","mutate"],te=new WeakMap,re=[],ne=[],se=[],oe=new ResizeObserver((e=>{for(const t of e){const e=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize,r=Array.isArray(t.borderBoxSize)?t.borderBoxSize[0]:t.borderBoxSize;let n=te.get(t.target);if(n){n(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:r.inlineSize,h:r.blockSize},contentBox:{w:e.inlineSize,h:e.blockSize}}}),t.target)}}}));var ie;!function(e){e.Child="child",e.Tree="tree",e.Attr="attr",e.Char="char"}(ie||(ie={}));const ae=new WeakMap,le=new MutationObserver((e=>{for(let t=0;t<e.length;t++){const r=e[t];let n=ae.get(r.target);if(!n)return;let s={target:r.target},o=null;switch(r.type){case"subtree":s.type=ie.Tree,o=n[ie.Tree];break;case"childList":s.type=ie.Child,s.addedNodes=r.addedNodes,s.removedNodes=r.removedNodes,o=n[ie.Child];break;case"attributes":s.type=ie.Attr,s.attributeName=r.attributeName,s.oldValue=r.oldValue,o=n[ie.Attr];break;case"characterData":s.type=ie.Char,s.oldValue=r.oldValue,o=n[ie.Char]}if(o){o(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:s}))}}}));function ce(e,r,n,s){if("resize"===e)!function(e,t){te.has(e)||(te.set(e,t),oe.observe(e))}(r,n);else if("outside"===e)switch(s[0]){case"mousedown":!function(e,t){re.push([e,t])}(r,n);break;case"dblclick":!function(e,t){se.push([e,t])}(r,n);break;default:!function(e,t){ne.push([e,t])}(r,n)}else"mutate"===e&&function(e,r,n){let s=t.includes(n,"child"),o=t.includes(n,"attr"),i=t.includes(n,"char"),a=t.includes(n,"tree"),l=ae.get(e);l||(l={},ae.set(e,l),s&&(l[ie.Child]=r),o&&(l[ie.Attr]=r),i&&(l[ie.Char]=r),a&&(l[ie.Tree]=r),le.observe(e,{childList:s,attributes:o,characterData:i,subtree:a}))}(r,n,s)}document.addEventListener("mousedown",(e=>{let r=t.get(e.composedPath(),0,e.target);re.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1),document.addEventListener("click",(e=>{let r=t.get(e.composedPath(),0,e.target);ne.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1),document.addEventListener("dblclick",(e=>{let r=t.get(e.composedPath(),0,e.target);se.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1);const ue=/,|^(debounce:.+)|(debounce$)/,de=/,|^(throttle:.+)|(throttle$)/,pe="self",he="stop",fe="prevent",ge="once",me="capture",ye="passive",ve="left",be="right",Ee="middle",Se="ctrl",Te="alt",Ce="shift",Ne="meta",_e={esc:"escape"},Ae=":";function Pe(e,r,n,s){let o,i=e.split("."),a=i.shift(),l=i.includes(ge),c=r;if(o=t.find(i,(e=>ue.test(e)))){let e=o.split(Ae);c=t.debounce(c,parseInt(e[1])||100)}if(o=t.find(i,(e=>de.test(e)))){let e=o.split(Ae);c=t.throttle(c,parseInt(e[1])||100)}if(l&&(c=t.once(c)),function(e){return ee.includes(e)}(a))return ce(a,n,c,i),c;let u=e=>{if(i.includes(fe)&&e.preventDefault(),i.includes(he)&&e.stopPropagation(),!i.includes(pe)||e.target===e.currentTarget){if(e instanceof MouseEvent){if(i.includes(ve)&&0!=e.button)return;if(i.includes(be)&&2!=e.button)return;if(i.includes(Ee)&&1!=e.button)return}else if(e instanceof KeyboardEvent){if(t.remove(i,(e=>e==Se))[0]&&!e.ctrlKey)return;if(t.remove(i,(e=>e==Te))[0]&&!e.altKey)return;if(t.remove(i,(e=>e==Ce))[0]&&!e.shiftKey)return;if(t.remove(i,(e=>e==Ne))[0]&&!e.metaKey)return;let r=t.map(i,(e=>_e[e]||e));if(t.size(r)>0&&!r.includes(e.key.toLowerCase()))return}c(e)}},d={capture:i.includes(me)||!1,passive:i.includes(ye)||!1};n.addEventListener(a,u,d);let p=s.__events[a];return p||(p=s.__events[a]=[]),p.push([n,u,d]),u}const we="@",De=".",Me="?",ke="*",Oe=":",xe="ref",Re="key",Le=/(<\/?)\s*([A-Z][A-Za-z0-9]*)([\s>])/gm,Ue=/\s+([\.?@*])?((?:[a-zA-Z]*[A-Z][^\s<>="']+))(?=[\s=>])/gm,He=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,je="slot-props",We=new Map,Ve=new Map,Ie=new Map;var Be;!function(e){e.Event="event",e.Directive="directive",e.DirectiveTag="directiveTag",e.DirectiveAttr="directiveAttr",e.DirectiveProp="directiveProp",e.DirectiveText="directiveText",e.DirectiveSlot="directiveSlot",e.Attr="attr",e.AttrProp="attrProp",e.AttrBool="attrBool",e.AttrRef="attrRef",e.AttrSlot="attrSlot",e.AttrKey="key",e.Ref="ref",e.Text="text"}(Be||(Be={}));const $e=new WeakMap,Fe=new WeakMap,ze=new WeakMap,Ge=new WeakMap,Ke=new WeakMap,Qe=new WeakMap;function Xe(e,r){let n="",s=t.concat(r.vars),o=r.strings.length-1,i=r.vars.length-1,a=0;for(let l=0;l<=o;l++){const o=r.strings[l];let c=t.get(s,a,"");if(c instanceof at){let[t,r]=Xe(e,c);c=t,s.splice(a,1,...r),a+=r.length-1}else c=l>i?"":Ye;a++,n=n+o+c}let l=0;return n=n.replace(He,((e,r)=>t.replaceAll(e,Ye,(()=>Ye.replace("--\x3e","")+l++)))),n=n.replace(it,"$1><").trim(),n=qe(n),[n,s]}function qe(e){return t.isString(e)?e=(e=e.replace(Ue,((e,r,n)=>` ${r??""}${t.kebabCase(n)}`))).replace(Le,((e,t,r,n)=>t+i[r]+n)):e+""}const Ye="\x3c!--c_ui-pl_df--\x3e",Ze="\x3c!--c_ui-pl_df",Je=/<!--c_ui-pl_df\d*(-->)?/;function et(r,n,s,o,i=!1){const a=document.createElement("div");a.innerHTML=n;const l=Ie.has(o.constructor);i||!l||Ve.has(o.constructor)||Ve.set(o.constructor,a.cloneNode(!0));let c=0;const u=document.createNodeIterator(a,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let d,p,h=0,f=l?void 0:{},g=null,m="";for(;d=u.nextNode();){c++;let n=l?void 0:[];if(p&&!p.contains(d)&&(p=void 0),d instanceof HTMLElement||d instanceof SVGElement){d instanceof K&&(p=d);let i={},a=t.toArray(d.attributes);for(let l=0;l<a.length;l++){const c=a[l];let{name:u,value:f}=c;if(u!==je)if(t.startsWith(u,Ze)){let i=s[h];if(t.isArray(i)&&t.isSymbol(i[0])){let[,t,s,a,l]=i;a(e.EnterPointType.TAG);let c=new Q(d,u.substring(1),e.EnterPointType.TAG),f=Qe.get(d);f||(f={},Qe.set(d,f)),f[Symbol.keyFor(i[0])]=[c,o,p];let y=new P(h,d);y.isDirective=!0,y.value=i,y.isComponent=!!p,r.push(y),g&&g?.contains(d)&&(y.key=m),h++,s(c,t,void 0,{renderComponent:o,slotComponent:p,varChain:l}),n&&n.push({type:Be.DirectiveTag,point:c,up:y,name:u})}d.removeAttribute(u)}else if(u[0]!==we)if(u!==xe)if(u!==Re){if(Je.test(f)){let a=s[h],l=new P(h,d,u.replace(/\.|\?|@/,""),f);if(l.isComponent=!!p,g&&g?.contains(d)&&(l.key=m),u[0]===De||u[0]===Me||u[0]===ke){if(t.isArray(a)&&t.isSymbol(a[0])){let[,t,r,s,i]=a;s(e.EnterPointType.PROP);let c=u.substring(1),h=new Q(d,c,e.EnterPointType.PROP),f=Qe.get(d);f||(f={},Qe.set(d,f)),f[c]=[h,o,p],r(h,t,void 0,{renderComponent:o,slotComponent:p,varChain:i}),l.value=a,l.isDirective=!0,n&&n.push({type:Be.DirectiveProp,up:l,point:h,name:u,attrName:c})}else if(u[0]===Me){l.isToggleProp=!0,l.value=!!a;let e=u.substring(1);l.value&&d.setAttribute(e,""),n&&n.push({type:Be.AttrBool,name:e,up:l,attrName:u})}else if(u[0]===ke){l.value=a;let e=u.substring(1);const[r,s]=e.split(Oe);let o=r;switch(s){case"camel":o=t.camelCase(o);break;case"kebab":o=t.kebabCase(o);break;case"snake":o=t.snakeCase(o)}l.attrName=o,d.setAttribute(o,a),n&&n.push({type:Be.AttrRef,up:l,name:u,attrName:o})}else{let e=t.camelCase(u.substring(1));l.value=a,l.isProp=!0,i[e]=a,n&&n.push({type:Be.AttrProp,up:l,name:e,attrName:u})}d.removeAttribute(u),a=""}else{let r,s;l.value=a;let i={type:Be.Attr,up:l,attrName:u};if(t.isArray(a)&&t.isSymbol(a[0])){let t=e.EnterPointType.ATTR;"class"===u?t=e.EnterPointType.CLASS:"style"===u&&(t=e.EnterPointType.STYLE);let[,n,c,h,f]=a;h(t),l.isDirective=!0,l.attrName=u;let g=new Q(d,u,t),m=Qe.get(d);m||(m={},Qe.set(d,m)),m[u]=[g,o,p],s=n,r=c,a="",i.type=Be.DirectiveAttr,i.point=g}f=t.replace(f,Je,a),c.value=f,t.isDefined(f)&&d.setAttribute(u,f),r&&r(i.point,s,void 0,{renderComponent:o,slotComponent:p}),n&&n.push(i)}r.push(l),h++}}else{let e=s[h];d.setAttribute(u,e);let t=new P(h,d);t.notUpdated=!0,g&&g?.contains(d)&&(t.key=m),r.push(t),h++,g=d,m=e,n&&n.push({up:t,type:Be.AttrKey}),r.length>0&&r.forEach((t=>{t.key=t.key??e}))}else{if(Je.test(f)){let e=s[h],t=new P(h,d);t.notUpdated=!0,g&&g?.contains(d)&&(t.key=m),r.push(t),h++,e.current=d,n&&n.push({type:Be.Ref,up:t,attrName:u})}d.removeAttribute(u)}else{let e=e=>{},t=null,i=!1;if(Je.test(f)){t=new P(h,d),t.notUpdated=!0,g&&g?.contains(d)&&(t.key=m),r.push(t),e=s[h].bind(o),h++,i=!0}let a=u.substring(1);Pe(a,e,d,o),d.removeAttribute(u),n&&n.push({type:Be.Event,up:t,name:a,attrName:u,value:i})}else{let e=d.getAttribute("name")||"default";n&&n.push({type:Be.AttrSlot,name:e,attrName:u})}}d instanceof K?(d._regWrapper(o),t.size(i)>0&&d._initProps(i)):d instanceof HTMLSlotElement&&o._bindSlot(d,d.name||"default",i)}else{let i=d;if(`\x3c!--${i.nodeValue}--\x3e`!==Ye)continue;let a=new P(h,d);g&&g?.contains(d)&&(a.key=m),r.push(a),a.isComponent=!!p,a.isText=!0;let l=s[h];if(t.isArray(l)&&t.isSymbol(l[0])){const t=Symbol.keyFor(l[0]);let r;r=document.createComment(`compelem-${o.tagName}-${t}-start`),a.textNode=r,i.parentNode.insertBefore(r,i),i.nodeValue=`compelem-${o.tagName}-${t}-end`,i._diName=t,a.isDirective=!0,a.value=l;let s=p?e.EnterPointType.SLOT:e.EnterPointType.TEXT,[,c,u,d,h]=l;d(s);let f=new Q(r,"",s);f.endNode=i,Ge.set(i,[f,o,p,c,h]),ze.set(i,u),Ke.set(i,a),D.startRender(i);let g=u(f,c,void 0,{renderComponent:o,slotComponent:p,varChain:h});if(D.endRender(o),g){let e=tt(i,g[1],o);e&&e.length>0&&st.insertBefore(i,Array.from(e))}l=void 0,n&&n.push({type:s===e.EnterPointType.SLOT?Be.DirectiveSlot:Be.DirectiveText,up:a,point:f})}else a.value=l,n&&n.push({type:Be.Text,up:a});h++;let c=t.toString(l??""),u=document.createTextNode(c);i.parentNode.insertBefore(u,i),a.textNode=u}f&&n&&(f[c]=n),g&&!g.contains(d)&&g!==d&&(g=null,m="")}return!i&&f&&Ie.set(o.constructor,f),a.childNodes}function tt(e,t,r){let[n,s]=Xe(r,t),o=[],i=et(o,n,s,r,!0);return Fe.set(e,o),i}function rt(r,n,s,o){if(t.isBlank(t.join(r.strings)))return;if(!$e.has(n))return;s=s??$e.get(n);let i=r.flatVars(n);for(let r=0;r<s.length;r++){const a=s[r];let l=a.varIndex;if(l<0)continue;if(a.notUpdated)continue;let c=a.value,u=i,d=a.node,p=t.split(l,w);for(let e=0;e<p.length;e++){const n=p[e];u=t.get(u,n),u&&u.vars&&r<p.length-1&&(u=u.vars)}if(!t.isObject(c)&&c===u)continue;let h=d;if(a.isDirective){let[r,n,s,,o]=a.value,i=Ge.get(d);if(!i){const e=Qe.get(d);i=e[a.attrName]||e[Symbol.keyFor(r)]}if(!t.isArray(u))continue;let[l,c,p]=i,[,h]=u;const f=Ke.get(d);if(f){f.value=u;Ge.get(d)[3]=h}Y(l,h,n,s,c,p,o,l.type==e.EnterPointType.TEXT||l.type==e.EnterPointType.SLOT)}else if(a.isToggleProp){if(!!u===c)continue;h.toggleAttribute(a.attrName,!!u),t.set(h,a.attrName,!!u)}else if(a.isProp){if(!t.isObject(u)&&u===c)continue;if(d instanceof K)if(t.isObject(u)&&Object.is(u,c)){let e,r=t.camelCase(a.attrName),n=[r],s=u;if(o&&o.length>0){let e="",i=t.join(k.get(a.value),w);o.forEach((t=>{t.startsWith(i)&&t.length>e.length&&(e=t)})),n=t.concat(t.split(e.replace(i,r),w)),s=t.get(d,n)}H(d,c,n,s,e)}else d._updateProps({[a.attrName]:u});else d instanceof HTMLSlotElement&&n._updateSlot(d.getAttribute("name")||"default",a.attrName,u)}else if(a.attrName){if(!t.isEqual(c,u))switch(a.attrName){case"value":if(d instanceof HTMLInputElement){d.value=u;break}default:d.setAttribute(a.attrName,t.replace(a.attrTmpl,Je,u+""))}}else if(a.isText){a.textNode.textContent=t.toString(u??"")}a.value=u}}function nt(e,r,n,s,o){const i=ze.get(e),[a,l,c,u,d]=Ge.get(e),p=Ke.get(e);if(!n){let e=i(a,p.value[1],u,{renderComponent:l,slotComponent:c,varChain:d});if(!e)return;n=e[1]}if(n&&n.vars[0]instanceof at){let e=[],r=[];t.each(n.vars,(n=>{r.push(...n.vars),e.push(...t.map(n.vars,(e=>"1")))})),e.push("1"),n=new at(e,r)}s&&Fe.set(e,s),rt(n,r,s=s??Fe.get(e),o)}const st={insertBefore:function(e,t){if(!e.parentNode)return;let r=document.createDocumentFragment();r.append(...t),e.parentNode.insertBefore(r,e)},remove:function(e,t){if(e===t)return void e?.parentNode?.removeChild(e);let r=e.nextSibling;for(;r&&r!==t;)r?.parentNode?.removeChild(r),r=e.nextSibling}};function ot(e,...r){return new at(t.isString(e)?[e]:e,r)}const it=/([a-z0-9"'])\s*>\s*</gim;class at{strings;vars;constructor(e,r){this.strings=t.concat(e),this.vars=r}getKey(){let e=this.vars,n="";return t.each(this.strings,((s,o)=>{if(r.test(s))return n=t.toString(e[o]),!1})),n}getKeys(){let e=this.vars,n=[];for(let s=0;s<this.strings.length;s++){const o=this.strings[s];if(r.test(o)){let r=t.toString(e[s]);n.push(r)}}return t.isEmpty(n)&&e.forEach((e=>{if(e instanceof at){let t=e.getKey();n.push(t)}})),n}append(e){let r=t.last(this.strings);return e.strings.forEach(((e,t)=>{0!=t?this.strings.push(e):this.strings[this.strings.length-1]=r+e})),this.vars=t.concat(this.vars,e.vars),this}insert(e,t){let r=t.strings.shift();return this.strings[e]+=r,this.strings.splice(e+1,0,...t.strings),this.vars.splice(e,0,...t.vars),this}getHTML(e){let[r,n]=Xe(e,this),s=et([],r,n,e);return t.reduce(s,((e,t)=>e+(t.outerHTML??"")),"")}flatVars(e){let r=t.concat(this.vars),n=this.strings.length-1,s=0;for(let o=0;o<=n;o++){let n=t.get(r,s,"");if(n instanceof at&&n.vars.length>0){let[t,o]=Xe(e,n);n=t,r.splice(s,1,...o),s+=o.length-1}s++}return r}}const lt=E(class extends f{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.get(e,n);t.set(e,n,t.debounce(o,this.wait,this.immediate));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;immediate;result;constructor(e,t=!1){super(),this.wait=e,this.immediate=t}});const ct=E(class extends f{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.bind(t.get(e,n),e);t.set(e,n,t.once(o));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;result;constructor(){super()}});var ut;e.QueryCache=void 0,(ut=e.QueryCache||(e.QueryCache={})).ONCE="once",ut.UPDATABLE="updatable";class dt extends f{static get priority(){return Number.MAX_VALUE}created(e,t,r,...n){}mounted(e,t,...r){}get targets(){return[e.DecoratorType.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,r,n,...s){const o=this;Reflect.defineProperty(e,n,{get:()=>(o.result&&o.cache||o.getter(e),o.result)})}updated(t,r){this.cache===e.QueryCache.UPDATABLE&&this.getter(t)}}const pt=E(dt),ht=E(class extends dt{getter(e){this.result=e.shadowRoot?.querySelectorAll(this.selector)}});function ft(e,r,n){if(!t.has(e.constructor,s.STATES)){const r={};let n=e.constructor;for(;(n=u(n))!==K;)t.merge(r,n[s.STATES]?t.cloneDeep(n[s.STATES]):{});Reflect.defineProperty(e.constructor,s.STATES,{configurable:!1,enumerable:!1,value:r})}n.shallow=n.shallow||!1,e.constructor[s.STATES][r]=n}const gt=E(class extends f{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.get(e,n);t.set(e,n,t.throttle(o,this.wait));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;result;constructor(e){super(),this.wait=e}});const mt=["key"],yt=J((function(e){return(e,[r],n)=>{let o=e.startNode;if(n)t.each(r,((e,t)=>{o.setAttribute(t,e)}));else if(o instanceof K){let e={},n={},i=t.get(o.constructor,s.PROPS);t.each(r,((r,s)=>{if(mt.includes(s))return;let o=t.camelCase(s);i[o]?e[s]=r:n[s]=r+""})),o._initProps(e,n)}else t.each(r,((e,t)=>{o.setAttribute(t,e)}))}}),e.EnterPointType.TAG),vt=new Map,bt=J((function(e){return(e,[r],n,{renderComponent:s})=>{let o=[];if(t.isArray(r)?o=t.compact(r):t.isObject(r)?o=t.flatMap(r,((e,t)=>e?t:[])):t.isString(r)&&(o=r.split(" ")),o.length<1&&!n)return;let i=e.startNode;if(vt.get(i)&&vt.get(i).length===o.length&&t.isMatch(vt.get(i),o))return;let a=vt.get(i);t.each(a,(e=>{i.classList.remove(e)})),t.each(o,(e=>{i.classList.add(e)})),a=t.concat(o),vt.set(i,a)}}),e.EnterPointType.CLASS),Et=new Map,St=new Map,Tt=J((function(n,s){return(n,o,i,{varChain:l})=>{let c=n.startNode,u=function(e,n,s){let o=t.map(e,((e,t)=>n(e,t)));if(o.length<1){let e=new at([],[]);return St.set(s,e),e}let i=[],l=[];const c=[],u=[];for(let e=0;e<o.length;e++){const n=o[e];let s=t.last(l),d=n.vars,p=!0,h=n.strings;for(let e=0;e<h.length;e++){const t=h[e];if(r.test(t)){let t=d[e]+"";if(i.includes(t))return void a(`forEach - duplicate key '${t}'`);i.push(t),p=!1}0==e&&s?l[l.length-1]=s+t:l.push(t)}if(p)return void a("forEach - missing 'key' prop");let f=t.last(c);f&&h.length>0&&(c[c.length-1]=t.trim(f)+h.shift()),c.push(""),u.push(n)}c.push("");let d=new at(c,u);return St.set(s,d),d}(o[0],s,c);if(i&&i[0]){const r=Et.get(c);if(t.isEmpty(n.getNodes())&&(!o||t.isEmpty(o[0])))return[e.DirectiveUpdateTag.NONE,u];if(r&&t.isMatch(r,o[0])&&r.length===o[0].length)return[e.DirectiveUpdateTag.NONE,u]}return Et.set(c,t.clone(o[0])),i?[e.DirectiveUpdateTag.UPDATE,u]:[e.DirectiveUpdateTag.APPEND,u]}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT));let Ct=document.createElement("div");const Nt=J((function(e){return(e,r,n,{renderComponent:s,slotComponent:o})=>{n&&r[0]==n[0]||t.isNil(r[0])||(Ct.innerHTML=qe(r[0]),e.startNode.after(...Ct.childNodes))}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT)),_t=J((function(e){return(e,r,n,{renderComponent:s,slotComponent:o})=>{n&&r[0]==n[0]||t.isNil(r[0])||(e.startNode.innerHTML=qe(r[0]))}}),e.EnterPointType.TAG),At=new WeakMap,Pt=J((function(t,r,n){return(s,[o,i],a,{renderComponent:l})=>{let c=s.endNode;if(a){if(!!o==!!a[0]){let t=At.get(c);return[e.DirectiveUpdateTag.NONE,t.call(l,o)]}let t=o?r:n;return At.set(c,t),[e.DirectiveUpdateTag.REPLACE,t.call(l,o)]}{let s=o?r:n;return At.set(c,s),[e.DirectiveUpdateTag.APPEND,s.call(l,t)]}}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT)),wt=J((function(t,r){return(t,[r,n],s)=>s?r===s[0]?[e.DirectiveUpdateTag.NONE,r?n():ot``]:r?[e.DirectiveUpdateTag.REPLACE,r?n():ot``]:[e.DirectiveUpdateTag.REMOVE]:[e.DirectiveUpdateTag.APPEND,r?n():ot``]}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT));var Dt;e.ModelTriggerType=void 0,(Dt=e.ModelTriggerType||(e.ModelTriggerType={})).CHANGE="change",Dt.INPUT="input";const Mt=J((function(e,r="value",n){return(s,o,i,{varChain:l,renderComponent:c})=>{const u=s.startNode;if(i){const e=i[0],n=o[0];let s=t.get(u,r);if(!t.isObject(n)&&Object.is(n,e)&&Object.is(s,n))return;if(u instanceof K)u._updateProps({[r]:n});else if(u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement){if(u.setAttribute(r,n+""),u instanceof HTMLSelectElement){let e=t.find(u.querySelectorAll("option"),(e=>e.value==n));e&&(e.selected=!0)}}else if(u instanceof HTMLInputElement){if(u.value==n)return;switch(u.type){case"checkbox":case"radio":n?u.setAttribute("checked",""):u.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":u.setAttribute(r,n+""),t.set(u,r,n);break;default:u.setAttribute(r,n+"")}}return}if("binded"===t.get(u,"_model"))return;let d;d=t.isString(n)?t.toPath(n):t.last(l);const p=d[0];if(p in c||c._wrapperProp[p]||a(`model - property '${p}' is not defined on the instance of `+c.tagName),t.isObject(e)||t.trim(e)||(e=""),u instanceof K)u._initProps({[r]:e}),u.addEventListener("update:"+r,(e=>{let r=c,n=c._wrapperProp[p];!(p in c)&&n&&t.get(c.wrapperComponent,p)===t.get(c,n)&&(r=c.wrapperComponent||r),t.set(r,d,e.detail.value)})),t.set(u,"_model","binded");else if(u instanceof HTMLTextAreaElement)u.setAttribute(r,e+""),u.addEventListener("input",(e=>{let r=e.target;t.set(c,d,r.value)})),t.set(u,"_model","binded");else if(u instanceof HTMLInputElement){let n="",s="";switch(u.type){case"checkbox":case"radio":n="checked",s="change";break;default:n="value",s="input"}u.setAttribute(r??n,e+""),u.addEventListener(s,(e=>{let r=e.target;t.set(c,d,r.value)})),t.set(u,"_model","binded")}else u instanceof HTMLSelectElement&&(u.setAttribute(r,e+""),u.addEventListener("change",(e=>{let r=e.target,n=c,s=c._wrapperProp[p];!(p in c)&&s&&t.get(c.wrapperComponent,p)===t.get(c,s)&&(n=c.wrapperComponent||n),t.set(n,d,r.value)})),t.set(u,"_model","binded"))}}),e.EnterPointType.TAG),kt=new Map,Ot=J((function(e,t){return(e,[r],n)=>{if(n&&r===n[0])return;let s=e.startNode;if(!kt.has(s)){let e=s.style.display;kt.set(s,"none"==e?"unset":e)}s.style.display=r?kt.get(s):"none",t&&t(s,r)}}),e.EnterPointType.TAG),xt=J((function(e,t){return(r,n,s,{renderComponent:o,slotComponent:i})=>{s||(e=e.bind(o),i._bindSlotHook(t||"default",e))}}),e.EnterPointType.SLOT);class Rt{static getCssText(e,r=!1){return t.isString(e)?e:t.join(t.map(e,((e,n)=>n.startsWith("--")?n+":"+e+(r?" !important":""):t.kebabCase(n)+":"+e+(r?" !important":""))),";")}static setStyle(e,r){if(t.isString(e)&&!t.trim(e))return{};let n=Rt.getCssText(e),s={};return t.each(n.split(";"),(e=>{let n=e.split(":"),o=t.trim(n[0]),i=t.trim(n[1]);s[o]=r.style.getPropertyValue(o),r.style.setProperty(o,i)})),s}}const Lt=new Map;let Ut=0;const Ht=J((function(e){return(e,t,r,{renderComponent:n})=>{let s=e.startNode,o=Lt.get(s);o||(o="style_d"+Ut++,Lt.set(s,o)),n.isMounted?n.nextTick((()=>{Rt.setStyle(t[0],s)}),o):Rt.setStyle(t[0],s)}}),e.EnterPointType.STYLE),jt=J((function(e){return(r,n,s,{renderComponent:o,varChain:i})=>{const a=r.startNode;if(s){if(!t.isEqual(n,s)){let e=r.attrName;a._updateProps({[e]:n[0]})}return}let l=t.last(i),c=r.attrName;a._initProps({[c]:e}),a.addEventListener("update:"+c,(e=>{t.set(o,l,e.detail.value)}))}}),e.EnterPointType.PROP),Wt=J((function(r,n){return(r,[n,s],o)=>{let i=()=>ot``,a=[],l=[];t.each(s,((e,r)=>{if(t.isFunction(e))a.push(r),l.push(e);else{let t=e[0],r=e[1];a.push(t),l.push(r)}"default"===r&&(i=e)}));let c=t.findIndex(a,(e=>t.isFunction(e)?e(n):e==n));return o?[e.DirectiveUpdateTag.REPLACE,t.call(l[c]??i)]:[e.DirectiveUpdateTag.APPEND,t.call(l[c]??i)]}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT));e.CompElem=K,e.CssHelper=Rt,e.Decorator=f,e.DecoratorWrapper=v,e.EnterPoint=Q,e.GetKeyFnName=g,e.PATH_SEPARATOR=w,e.PROP_OBJECT_KEY_MAP_SYMBOL=G,e.Template=at,e.UpdatePoint=P,e._DecoratorMap=y,e._DecoratorsKey=m,e._getObservedAttrs=N,e.bind=yt,e.buildHTML=Xe,e.classes=bt,e.computed=function(e,r,n){n.get||a(`Computed '${r}' must be a getter`),t.has(e.constructor,s.COMPUTED)||(e.constructor[s.COMPUTED]=t.isEmpty(e.constructor[s.COMPUTED])?{}:t.cloneDeep(e.constructor[s.COMPUTED])),e.constructor[s.COMPUTED][r]=n.get},e.createRef=function(e){return{current:e}},e.debounced=lt,e.decorator=E,e.directive=J,e.event=function(e,r){return(n,o,i)=>{t.has(n.constructor,s.EVENTS)||(n.constructor[s.EVENTS]=t.isEmpty(n.constructor[s.EVENTS])?[]:t.cloneDeep(n.constructor[s.EVENTS])),n.constructor[s.EVENTS].push({name:e,options:r,fn:n[o]})}},e.forEach=Tt,e.html=ot,e.htmlC=Nt,e.htmlD=_t,e.ifElse=Pt,e.ifTrue=wt,e.makeState=function(e,t,r){ft(e.prototype,t,r||{prop:""})},e.model=Mt,e.onced=ct,e.prop=function(e){if(1===arguments.length)return(t,r,n)=>{e.required=e.required||!1,e.attribute=!1!==e.attribute,T(t,r,e,n)};let r=arguments[0],n=arguments[1],s=arguments[2];e={type:void 0,required:!1,attribute:!0},s&&"function"==typeof s.type&&(e=t.defaults(s,e),s=void 0),T(r,n,e,s)},e.query=pt,e.queryAll=ht,e.show=Ot,e.slot=xt,e.state=function(e){if(1===arguments.length)return(t,r)=>{ft(t,r,e)};ft(arguments[0],arguments[1],{prop:""})},e.styles=Ht,e.sync=jt,e.tag=function(e){return t=>{if(t){if(t.prototype.hasOwnProperty("attributeChangedCallback")){let e=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,r,n){K.prototype.attributeChangedCallback.call(this,t,r,n),e.call(this,t,r,n)}}if(t.prototype.hasOwnProperty("connectedCallback")){let e=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){K.prototype.connectedCallback.call(this),e.call(this)}}if(t.prototype.hasOwnProperty("disconnectedCallback")){let e=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){K.prototype.disconnectedCallback.call(this),e.call(this)}}i[t.name]=e,customElements.define(e,t)}}},e.throttled=gt,e.updateDirective=Y,e.watch=function(e,r){return(n,o)=>{t.has(n.constructor,s.WATCH)||(n.constructor[s.WATCH]=t.isEmpty(n.constructor[s.WATCH])?{}:t.cloneDeep(n.constructor[s.WATCH]));(t.isArray(e)?e:[e]).forEach((e=>{let i=e.replaceAll(".",w),a=n.constructor[s.WATCH][i];t.isArray(a)||(a=n.constructor[s.WATCH][i]=[]),a.push({source:e,options:r,handler:n[o]})}))}},e.when=Wt,Object.defineProperty(e,"__esModule",{value:!0})}));