compelem 0.22.0 → 0.22.1
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/index.js +2 -2
- package/package.json +1 -1
- package/render/render.d.ts +1 -1
- package/types.d.ts +1 -1
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* compelem v0.22.
|
|
2
|
+
* compelem v0.22.1.1780839141
|
|
3
3
|
* A modern, reactive, fast, lightweight and flexible lib for building web components
|
|
4
4
|
* @holyhigh2
|
|
5
5
|
* git+https://github.com/holyhigh2/compelem.git
|
|
6
6
|
*/
|
|
7
|
-
import t,{toPath as e,some as s,isString as r,isUndefined as n,isBlank as o,closest as i,isObject as a,isFunction as l,startsWith as c,get as u,concat as h,toArray as d,isSymbol as p,isArray as f,size as g,eachRight as _,slice as m,defaults as v,merge as y,each as E,kebabCase as w,has as b,set as S,includes as N,find as T,debounce as C,throttle as k,once as M,remove as P,map as A,flatMap as x,test as R,assign as D,first as O,walkTree as L,isEmpty as I,filter as V,isNil as W,camelCase as H,isNull as U,isDefined as B,trim as $,isBoolean as j,parseJSON as F,cloneDeep as z,keys as G,groupBy as X,last as K,reject as q,toString as Q,reduce as Z,compact as Y,initial as J,except as tt,join as et,split as st,isEqual as rt,replace as nt,replaceAll as ot,snakeCase as it,bind as at,isMatch as lt,clone as ct,findIndex as ut,call as ht}from"myfx";const dt="default",pt=/\s+\.?key\s*=/;var ft,gt;!function(t){t[t.RENDER=1]="RENDER",t[t.COMPUTED=2]="COMPUTED",t[t.DIRECTIVE=3]="DIRECTIVE"}(ft||(ft={})),function(t){t.Prod="prod",t.Dev="dev"}(gt||(gt={}));const _t=new Map,mt={},vt={},yt=new WeakMap,Et=new WeakMap,wt=new WeakMap,bt=new Map,St=new Map,Nt=new WeakMap,Tt=new WeakMap,Ct=new WeakMap,kt=new WeakMap,Mt=new WeakMap,Pt=new WeakMap,At=new WeakMap,xt=new WeakMap,Rt=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,Lt=new WeakMap,It=new WeakMap,Vt="__data_";function Wt(t){console.error("[CompElem]",t)}function Ht(t,e){console.error(`[CompElem <${t}>]`,e)}function Ut(...t){console.warn("[CompElem]",...t)}function Bt(t,e){console.warn(`[CompElem <${t}>]`,e)}function $t(t){return e(t).join("-")}function jt(t){return Object.getPrototypeOf(t)}function Ft(t){return t===Boolean||s(t,(t=>t===Boolean))}function zt(t){let e=t;return r(t)&&/(?:^true$)|(?:^false$)/.test(e)?e="true"===e:(n(e)||o(e))&&(e=!0),e}const Gt={getNodes(t,e){let s=t.nextSibling;if(!e)return[s];let r=[];for(;s&&s!==e;)r.push(s),s=s?.nextSibling;return r},insertBefore:function(t,e){if(!t.parentNode)return;let s=document.createDocumentFragment();s.append(...e),t.parentNode.insertBefore(s,t)},remove:function(t,e){if(t===e)return void t?.parentNode?.removeChild(t);let s=t.nextSibling;for(;s&&s!==e;)s?.parentNode?.removeChild(s),s=t.nextSibling},clear(t,e){if(!t)return;let s,r=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT);for(r=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_ELEMENT);s=r.nextNode();)t!==s&&(s instanceof Comment||s instanceof Ve&&s.destroy())}};function Xt(t,e){let s=i(t,(t=>t.host&&t.host instanceof Ve),"parentNode");if(!s||s.host!==e)return s?s.host:void 0}function Kt(t,e){let s=e,r=Reflect.get(s[Vt],t);if(Jt.__collecting&&Jt.__varPathList.push(t),se.has(r)){let t=ne.get(r);return t||(t=new Set,ne.set(r,t)),t.add(s.__thisRef),se.get(r)}if(a(r)&&!l(r)&&!(r instanceof Node)&&!Object.isFrozen(r)){let e=xt.get(s.constructor),n=e?.has(t);n||(e=Rt.get(s.constructor),n=e?.has(t)),r=n||"slots"===t?r:oe(r,s,t)}return r}function qt(t,e,s){let r=s;if(!r.__inited)return void Reflect.set(r[Vt],t,e);let n=r[Vt][t],o=Dt.get(r.constructor),i=o?.get(t);if(i){if(!i.call(r,e,n,[t],e,n))return!0}else if(Object.is(n,e))return!0;Qt(r,e,n,t),Zt(r,t),Yt(r,t),Reflect.set(r[Vt],t,e),r._notify(n,[t]);let a=At.get(r.constructor);a?.has(t)&&r.emit("update:"+t,{value:e})}function Qt(t,e,s,r,n,o){let i=jt(t.constructor),a=Ct.get(t.constructor)??Ct.get(i),l=Tt.get(t.constructor)??Tt.get(i),p=Mt.get(t.constructor)??Mt.get(i),f=kt.get(t.constructor)??kt.get(i),g=Nt.get(t.constructor)??Nt.get(i);a?.forEach((i=>{(r===i||c(i,r+".")&&!Object.is(u(t._getPrivateData(),i),u(e,i))||c(r,i+".")&&l?.includes(i)&&!Object.is(u(t._getPrivateData(),i),u(e,i)))&&h(d(f[i]),d(p[i])).forEach((a=>{a&&!0!==g.get(i)&&(t._watchUpdateArgsInNextTick.set(a,{newValue:e,oldValue:s,chain:r.split("."),rootObjNew:n,rootObjOld:o,fullMatch:i===r}),t._watchUpdateSetInNextTick.add(a),g.has(i)&&g.set(i,!0))}))}))}function Zt(t,e){let s=Ot.get(t.constructor);s?.has(e)&&s.get(e)?.forEach((e=>{t._computedUpdateSetInNextTick.add(e)}))}function Yt(t,e){let s=Lt.get(t.constructor);if(!s)return;let r=e.split("."),n="";r.forEach((e=>{n=n?n+"."+e:e,s.has(n)&&(t._cssUpdateInNextTick=!0)}))}const Jt={popDirectiveQ(){return this.__varPathList.reduceRight(((t,e)=>(t.includes(e)||t.unshift(e),t)),[])},start(){this.__collecting=!0,this.__varPathList=[]},end(t,e){t&&e&&t._regSubViewDeps(Jt.popVarPathList(),e),this.__collecting=!1},popVarPathList(){let t=Array.from(new Set(this.__varPathList));return this.__varPathList=[],t},__varPathList:[],__collecting:!1},te=new WeakMap,ee=new WeakMap,se=new WeakMap,re=new WeakMap,ne=new WeakMap;function oe(t,e,s){if(se.has(t))return se.get(t);if(re.has(t)){if(s){let r=te.get(e);r||(r=new WeakMap,te.set(e,r)),r.set(t,s);let n=ne.get(t);n||(n=new Set,ne.set(t,n)),n.values().some((t=>t.deref()===e))||n.add(new WeakRef(e))}return t}const r=new Proxy(t,{get(t,s,r){if(!s)return;const n=Reflect.get(t,s,r);if(p(s))return n;if(l(n))return n;if("length"===s&&f(t))return n;if("__"===s.substring(0,2))return n;if(Jt.__collecting){let t=ee.has(r)?h(ee.get(r)):[];t.push(s);let e=t.join(".");Jt.__varPathList.push(e)}if(se.has(n))return se.get(n);let o=n;if(a(n)&&!l(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){let t=ee.has(r)?h(ee.get(r)):[];o=oe(n,e),t.push(s),ee.set(o,t),se.set(n,o)}return o},set(t,s,r,n){if(!s)return!1;let o=t[s],i=ee.get(n)??[],a=h(i,[s]),l=Dt.get(e.constructor),c=l?.get(a[0]),u=a.length>1,d=r,p=o;if(u&&(p=d=e._getPrivateData()[a[0]]),c){if(!c.call(e,d,p,a,r,o))return!0}else if(Object.is(o,r))return!0;let f=r,g=Reflect.set(t,s,f),_=ne.get(n),m=a.join(".");return Qt(e,f,o,m,d,p),Zt(e,m),Yt(e,m),ie(e,p,a),_?.forEach((t=>{let e=t.deref();if(!e)return;let s=e._wrapperProp[a[0]],r=a.join(".");r=r.replace(a[0],s),Qt(e,f,o,r),Zt(e,r),Yt(e,r),ie(e,p,r.split("."))})),g}});if(ee.has(r)||ee.set(r,s?[s]:[]),se.set(t,r),s&&(re.set(r,e),!te.has(e))){let t=new WeakMap;t.set(r,s),te.set(e,t)}return r}function ie(t,e,s,r,n){let o=g(s);_(s,(r=>{let n=m(s,0,o--);t._notify(e,n)}))}const ae=new Map;class le{static nextSet=new Set;static nextPending=!1;static next;static flush(){le.nextPending=!1;let t=Array.from(le.nextSet);le.nextSet.clear(),ae.clear(),t.forEach((t=>t())),t=null}static pushNext(t){le.nextSet.add(t),le.nextPending||(le.nextPending=!0,le.next())}}function ce(t){if(1===arguments.length)return(e,s,r)=>{t.required=t.required||!1,t.attribute=!1!==t.attribute,ue(e,s,t)};let e=arguments[0],s=arguments[1],r=arguments[2];t={type:void 0,required:!1,attribute:!0},r&&"function"==typeof r.type&&(t=v(r,t),r=void 0),t.shallow=t.shallow||!1,ue(e,s,t)}function ue(t,e,s,r){let n;if(!wt.has(t.constructor)){const e={};let s=t.constructor;for(;(s=jt(s))!==Ve;)y(e,wt.get(s)??{});n=new Set,E(e,((t,e)=>{if(t.attribute){let t=w(e);n?.add(t)}})),St.set(t.constructor,n),wt.set(t.constructor,e)}if(s.attribute){n||(n=St.get(t.constructor));let s=w(e);n?.add(s)}if(b(t.constructor,"observedAttributes")||(t.constructor.observedAttributes=[]),n&&(t.constructor.observedAttributes=d(n)),S(wt.get(t.constructor),e,s),s.hasChanged){let r=Dt.get(t.constructor);r||(r=new Map,Dt.set(t.constructor,r)),r.set(e,s.hasChanged)}if(s.sync){let s=At.get(t.constructor);s||(s=new Set,At.set(t.constructor,s)),s.add(e)}if(s.shallow){let s=Rt.get(t.constructor);s||(s=new Set,Rt.set(t.constructor,s)),s.add(e)}Reflect.defineProperty(t,e,{get(){return Kt(e,this)},set(t){qt(e,t,this)}})}(()=>{const t=Promise.resolve(),e=le.flush;le.next=()=>{t.then(e)}})();const he=new Set;function de(t){return St.get(t)??he}const pe=["resize","outside","mutate"],fe=new WeakMap,ge=[],_e=[],me=[],ve=new WeakSet,ye=new ResizeObserver((t=>{for(const e of t){const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize,s=Array.isArray(e.borderBoxSize)?e.borderBoxSize[0]:e.borderBoxSize;if(!ve.has(e.target)){ve.add(e.target);continue}let r=fe.get(e.target);r&&r({target:e.target,contentBoxSize:t,borderBoxSize:s,type:"resize"})}}));var Ee;!function(t){t.Child="child",t.Tree="tree",t.Attr="attr",t.Char="char"}(Ee||(Ee={}));const we=new WeakMap,be=new MutationObserver((t=>{for(let e=0;e<t.length;e++){const s=t[e];let r=we.get(s.target);if(!r)return;let n={target:s.target},o=null;switch(s.type){case"subtree":n.type=Ee.Tree,o=r[Ee.Tree];break;case"childList":n.type=Ee.Child,n.addedNodes=s.addedNodes,n.removedNodes=s.removedNodes,o=r[Ee.Child];break;case"attributes":n.type=Ee.Attr,n.attributeName=s.attributeName,n.oldValue=s.oldValue,o=r[Ee.Attr];break;case"characterData":n.type=Ee.Char,n.oldValue=s.oldValue,o=r[Ee.Char]}o&&(n.type="mutate",o(n))}}));function Se(e,s,r,n,o){if("resize"===e)return function(t,e){if(fe.has(t))return;fe.set(t,e),ye.observe(t);let s=ye;return(e=!1)=>{s.unobserve(t),fe.delete(t),e&&(s=t=null)}}(s,r);if("outside"===e)switch(n[0]){case"mousedown":return function(e,s){return ge.push([e,s]),(r=!1)=>{t.remove(ge,(t=>t[0]===e&&t[1]===s))}}(s,r);case"dblclick":return function(e,s){return me.push([e,s]),(r=!1)=>{t.remove(me,(t=>t[0]===e&&t[1]===s))}}(s,r);default:return function(e,s){return _e.push([e,s]),(r=!1)=>{t.remove(_e,(t=>t[0]===e&&t[1]===s))}}(s,r)}else if("mutate"===e)return function(t,e,s){let r=N(s,"child"),n=N(s,"attr"),o=N(s,"char"),i=N(s,"tree"),a=we.get(t);if(!a)return a={},we.set(t,a),r&&(a[Ee.Child]=e),n&&(a[Ee.Attr]=e),o&&(a[Ee.Char]=e),i&&(a[Ee.Tree]=e),be.observe(t,{childList:r,attributes:n,characterData:o,subtree:i}),(e=!1)=>{we.delete(t),e&&(t=null)}}(s,r,n)}document.addEventListener("mousedown",(t=>{let e=u(t.composedPath(),0,t.target);ge.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"mousedown",event:t})}))}),!1),document.addEventListener("click",(t=>{let e=u(t.composedPath(),0,t.target);_e.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"click",event:t})}))}),!1),document.addEventListener("dblclick",(t=>{let e=u(t.composedPath(),0,t.target);me.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"dblclick",event:t})}))}),!1);const Ne=/,|^(debounce:.+)|(debounce$)/,Te=/,|^(throttle:.+)|(throttle$)/,Ce="native",ke={esc:"escape"},Me=()=>{};function Pe(t,e,s,r){let n,o=t.split("."),i=o.shift(),a=o.includes("once"),l=e??Me;if(n=T(o,(t=>Ne.test(t)))){let t=n.split(":");l=C(l,parseInt(t[1])||100)}if(n=T(o,(t=>Te.test(t)))){let t=n.split(":");l=k(l,parseInt(t[1])||100)}if(a&&(l=M(l)),s instanceof Ve&&(s!==r||o.includes(Ce)||o.push(Ce),!o.includes(Ce)))return s._addEvent(i,e);if(function(t){return pe.includes(t)}(i))return Se(i,s,l,o);let c=t=>{if(o.includes("prevent")&&t.preventDefault(),o.includes("stop")&&t.stopPropagation(),!o.includes("self")||t.target===t.currentTarget){if(t instanceof MouseEvent){if(o.includes("left")&&0!=t.button)return;if(o.includes("right")&&2!=t.button)return;if(o.includes("middle")&&1!=t.button)return}else if(t instanceof KeyboardEvent){if(P(o,(t=>"ctrl"==t))[0]&&!t.ctrlKey)return;if(P(o,(t=>"alt"==t))[0]&&!t.altKey)return;if(P(o,(t=>"shift"==t))[0]&&!t.shiftKey)return;if(P(o,(t=>"meta"==t))[0]&&!t.metaKey)return;let e=A(o,(t=>ke[t]||t));if(g(e)>0&&!e.includes(t.key.toLowerCase()))return}l(t)}},u={capture:o.includes("capture")||!1,passive:o.includes("passive")||!1};return s.addEventListener(i,c,u),(t=!1)=>{s.removeEventListener(i,c,u),t&&(s=null)}}const Ae={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},xe=new WeakMap;let Re=[],De=0;const Oe=new WeakMap,Le={},Ie="slots";class Ve extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(t){Re=x(t.css,(t=>{if(r(t)){let e=new CSSStyleSheet;return e.replaceSync(t),e}return t instanceof CSSStyleSheet?t:[]})),t.global,E(t,((t,e)=>{R(e[0],/[A-Z]/)}))}#t;#e={};__data_={};#s={};#r;__updateTree;_eventBindList;_listerners={};__docoEventMap;__updateSubViewDeps;_cssUpdateInNextTick=!1;_cssVarOldValueMap;__cssSheets;_watchUpdateSetInNextTick;_watchUpdateArgsInNextTick;_computedUpdateSetInNextTick;get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#t}get attrs(){return this.#n}get props(){return this.#o}get renderRoot(){return this.#i?.deref()}get renderRoots(){return this.#a.flatMap((t=>t.deref()??[]))}get parentComponent(){return this.#l?.deref()}get wrapperComponent(){return this.__wrapperComponent?.deref()}get slots(){return Le}get slotHooks(){return this.#c}get cssSheets(){return xe.get(this.constructor)}get globalCssSheet(){return Ve.__l_globalRule.sheet}get isMounted(){return this.#u}#n;#o;#i;#a;#l;__wrapperComponent;#h={};#c={};#d={};#u=!1;#p=!1;#f;static get css(){return[]}static get globalCss(){}static get hostCss(){}get cssVars(){return{}}__inited=!1;#g=!1;#_;__thisRef;constructor(...t){super(),this.#t=De++,this.__updateTree=[],this.__thisRef=new WeakRef(this),this.#_=this.#m.bind(this),1===g(t)&&(this.#o={},D(this.#o,O(t))),Reflect.getOwnPropertyDescriptor(this.constructor.prototype,"slots")||Reflect.defineProperty(this.constructor.prototype,"slots",{get(){return Kt("slots",this)},set(t){qt("slots",t,this)}});let e=bt.get(this.constructor)??bt.get(jt(this.constructor));e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((t=>t.create(this))),this.#v=this.#y.bind(this)}insertStyleSheet(t){if(!this.#r)return null;let e;if(r(t)){e=new CSSStyleSheet;try{e.replaceSync(t)}catch(t){}}else{if(this.#r.adoptedStyleSheets.includes(t))return t;e=t}return this.#r.adoptedStyleSheets=[...this.#r.adoptedStyleSheets,e],e}get rootComponent(){let t=this;for(;t.parentComponent;)t=t.parentComponent;return t}#v;connectedCallback(){let t=i(this.parentNode,(t=>t instanceof Ve||t.host instanceof Ve),"parentNode");this.#l=t?t instanceof Ve?new WeakRef(t):new WeakRef(t.host):void 0,Ve.__l_globalRule.parentNode||document.head.appendChild(Ve.__l_globalRule);let e=u(this.constructor,"hostCss"),s=u(this.constructor,"hostCssSheet");if(e){s||(r(e)?(s=new CSSStyleSheet,s.replaceSync(e)):s=e,S(this.constructor,"hostCssSheet",s));let t=this.__wrapperComponent?.deref()?.shadowRoot??this.#l?.deref()?.shadowRoot??this.ownerDocument;this.__wrapperComponent&&!this.__wrapperComponent.deref()?.shadowRoot?.contains(this)&&(t=i(this,(t=>t instanceof HTMLDocument||t instanceof ShadowRoot),"parentNode")),t&&s&&!t.adoptedStyleSheets.includes(s)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,s])}this.__init(),this.__bindEvents()}disconnectedCallback(){this.__unbindEvents()}__bindEvents(){let t=this._eventBindList;E(t,(t=>{let[e,s,r,n]=t;if(n)return;if(!r)return;let o=Pe(e,s?s.bind(this):s,r,this);t[3]=o}));let e=_t.get(this.constructor);g(e)>0&&(this.__docoEventMap||(this.__docoEventMap=new Map),E(e,(({name:t,targetFn:e,fnName:s})=>{if(this.__docoEventMap.has(t+"@"+s))return;let r=e?e(this):this,n=u(this,s),o=Pe(t,n?n.bind(this):n,r,this);this.__docoEventMap.set(t+"@"+s,o)})))}__unbindEvents(){E(this._eventBindList,(t=>{let[,,,e]=t;e&&e(),t[3]=null}));let t=[];E(this.__docoEventMap,((e,s)=>{e&&e(),t.push(s)})),t.forEach((t=>this.__docoEventMap.delete(t)))}beforeDestroyed(){}destroyed(){}get isDestroyed(){return this.#E}#E=!1;destroy(){if(this.#E)return;this.#E=!0;let t=bt.get(this.constructor)??bt.get(jt(this.constructor));if(t&&t.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.destroy(this)})),this.beforeDestroyed(),this.__unbindEvents(),this._listerners=null,this.__docoEventMap?.clear(),this.__docoEventMap=this._eventBindList=null,It.get(this)?.clear(),It.delete(this),this._watchUpdateArgsInNextTick?.clear(),this._watchUpdateSetInNextTick?.clear(),this._computedUpdateSetInNextTick?.clear(),this._computedUpdateSetInNextTick=null,this.__cssSheets=null,this.__updateSubViewDeps?.clear(),this.#l){let t=this.#l.deref();t&&L(t.__updateTree,(e=>{e.__destroyed||e.node?.deref()===this&&(e.destroy(t),P(e.parent?e.parent.children:t.__updateTree,(t=>t===e)))}))}E(this.__updateTree,(t=>t?.destroy(this))),E(this.#h,(t=>{Oe.delete(t),t.remove()})),E(this.#d,(t=>{E(t,(t=>t.remove()))})),E(this.__data_.slots,((t,e)=>{E(t,(t=>t.remove()))})),this.#w.clear(),this.#d=this.#h=this.#w=this.#e=this.__data_.slots=null,this.remove(),this._wrapperProp=this.#b=this.#i=this.#a=this.#r=this.#s=this.#n=this.#o=this.#i=this.#a=this.#c=this.#v=this.__data_=this.__updateTree=this.#l=this._asyncDirectives=this.__wrapperComponent=null,this.destroyed()}__init(){if(this.__inited)return;if(this.#g)return;this.#g=!0;let t=u(this.constructor,"globalCss");I(t)||!r(t)||u(this.constructor,"_globalRuleInserted")||(Ve.__l_globalRule.textContent+=t,S(this.constructor,"_globalRuleInserted",!0));let e=xe.get(this.constructor),s=e??[];e||(E(u(this.constructor,"css"),(t=>{if(r(t)){let e=new CSSStyleSheet;e.replaceSync(t),s.push(e)}else l(t)||s.push(t)})),xe.set(this.constructor,s));const n=this.#S();this.propsReady(n);for(const t in n){const e=n[t];this.__data_[t]=e}this.#N(),this.__data_.slots={},Reflect.defineProperty(this.__data_,"__isData",{enumerable:!1,value:!0});let i=jt(this.constructor);if(Ct.get(this.constructor)??Ct.get(i)){this._watchUpdateSetInNextTick=new Set,this._watchUpdateArgsInNextTick=new Map;let t=Nt.get(this.constructor)??Nt.get(i),e=Pt.get(this.constructor)??Pt.get(i);E(e,((e,s)=>{let r=u(this,s);e.forEach((t=>{t.call(this,r,void 0,s)})),t.has(s)&&t.set(s,!0)}))}let a=D({},yt.get(this.constructor),yt.get(i));if(a){this._computedUpdateSetInNextTick=new Set;let t=Ot.get(this.constructor);t?E(a,((t,e)=>{this[Vt][e]=t.call(this)})):(t=new Map,Ot.set(this.constructor,t),E(a,((e,s)=>{S(e,"key",s),Jt.start(),this[Vt][s]=e.call(this),Jt.end(),Jt.popVarPathList().forEach((s=>{let r=t.get(s);r||(r=new Set,t.set(s,r)),r.add(e)}))})))}Jt.start();let c=this.render();Jt.end();let h,d=Jt.popVarPathList();this.constructor.prototype._viewDeps||(this.constructor.prototype._viewDeps=d),null===c?(this.#a=[],this.#i=void 0):(this.#r=this.attachShadow({mode:"open"}),this.#r.adoptedStyleSheets=[...Re,...xe.get(this.constructor)??[]],h=function(t,e){let s,r=[];if(is.has(e.constructor)){s=ps(r,is.get(e.constructor),cs(e,t),e)}else{let[n,o]=as(e,t);is.set(e.constructor,n),s=ps(r,n,o,e)}return e.__updateTree=r,s}(c,this),h&&(this.#a=V(h,(t=>t.nodeType===Node.ELEMENT_NODE)).map((t=>new WeakRef(t))),this.#i=this.#a[0])),this.__inited=!0,this.#T(),E(this.#c,((t,e)=>{this.#C(e)}));const p=this;let f=bt.get(this.constructor)??bt.get(jt(this.constructor));f&&f.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.beforeMount(this,((t,e)=>(p.__data_[t]=e,p.__data_[t])))})),this.beforeMount(),setTimeout((()=>{if(!this.isDestroyed){if(this.#u=!0,this.#r){Jt.start();let t=this.cssVars;if(Jt.end(),!I(t)){this._cssVarOldValueMap={};let e=Lt.get(this.constructor);e||(e=new Set(Jt.popVarPathList()),Lt.set(this.constructor,e));let s="";E(t,((t,e)=>{let r="--"+w(e).replace(/^-+/,"");(o(t)||W(t))&&(t="initial"),this._cssVarOldValueMap[r]=t,s+=";"+r+":"+t})),this.style.cssText+=s}}h&&this.#r.append(...h),f&&f.forEach((t=>{t.mounted(this,((t,e)=>(p.__data_[t]=e,p.__data_[t])))})),this.#f&&this.#f.forEach((t=>le.pushNext(t))),this.#p&&le.pushNext(this.#v),this.__bindEvents(),this.mounted()}}),0)}propsReady(t){}render(){return null}beforeMount(){}mounted(){}#m(t){let e=t.currentTarget,s="";E(this.#h,((t,r)=>{if(t===e)return s=r,!1})),this.__inited&&this.#k(e,s===dt?"":s)}#k(t,e){this.#T();let s=u(this.#e[e],"props");s&&E(this.slots,((t,e)=>{t.filter((t=>t.nodeType===Node.ELEMENT_NODE)).forEach((t=>{t instanceof Ve?t._updateProps(s):E(s,((e,s)=>{if(t instanceof HTMLSlotElement){let r=Oe.get(t);if(r){let n=t.name||dt,o=r.#e[n];o||(o=r.#e[n]={props:{}}),o.props||(o.props={}),o.props[s]=e,r.#k(t,n)}}else t.setAttribute(s,e)}))}))})),this.slotChange(t,e)}slotChange(t,e){}attributeChangedCallback(t,e,s){if(!this.__inited)return;if(Object.is(s,e))return;"undefined"===s&&(s=null);let r=H(t);if(Ft(wt.get(this.constructor)[r].type)){let t=!U(s)&&zt(s);if(u(this,r)===t)return}this.#M(t,e,s)}shouldUpdate(t){return!0}updated(t){}_notify(t,e,s,r){let n=[];for(let o=0;o<e.length;o++){const i=e[o];n.push(i);let a=u(this,n),l=$t(n);this.#s[l]={value:a,chain:l===Ie?[Ie]:n,oldValue:t,end:n.length===e.length,subNewValue:s,subOldValue:r}}this.isMounted?le.pushNext(this.#v):this.#p=!0}#y(){if(g(this.#s)<1)return;if(!this.isMounted)return;const t=this.#s;if(this.#s={},!this.shouldUpdate(t))return;let e=bt.get(this.constructor)??bt.get(jt(this.constructor));e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((e=>{e.updated(this,t)}));let s=!1,r=new Set,n=this.constructor.prototype._viewDeps;if(E(t,((t,e)=>{if(!s&&n?.includes(e)&&(s=!0),this.__updateSubViewDeps?.has(e)){let t=this.__updateSubViewDeps.get(e);t&&t.forEach((t=>{r.add(t)}))}})),this._watchUpdateSetInNextTick?.forEach((t=>{let{newValue:e,oldValue:s,chain:r,rootObjNew:n,rootObjOld:o,fullMatch:i}=this._watchUpdateArgsInNextTick.get(t),a=i?e:n,l=i?s:o;t.call(this,a,l,r,e,s)})),this._watchUpdateSetInNextTick?.clear(),this._watchUpdateArgsInNextTick?.clear(),this._computedUpdateSetInNextTick?.forEach((t=>{let e=u(t,"key"),s=this.__data_[e],r=t.call(this);(a(r)||r!==s)&&(this.__data_[e]=r,this._notify(s,[e]))})),this._computedUpdateSetInNextTick?.clear(),this._cssUpdateInNextTick){let t=this.cssVars;E(t,((t,e)=>{let s="--"+w(e).replace(/^-+/,"");this._cssVarOldValueMap[s]!=t&&((o(t)||W(t))&&(t="initial"),this._cssVarOldValueMap[s]=t,this.style.setProperty(s,t+""))}))}this.#i?.deref()&&(s&&gs(this.render(),this,this.__updateTree,r),g(r)>0&&r.forEach((t=>{_s(t,this,void 0)}))),this.#w.forEach((t=>{this.#C(t)})),this.updated(t)}#S(){let t=wt.get(this.constructor)??wt.get(jt(this.constructor)),e=this.attributes,s=this.tagName,r=this.#o,o={};E(e,(({name:e,value:s})=>{if(e[0]===qe||e[0]===Qe||e[0]===Ze||e===ts||"slot"===e)return;let r=H(e);t&&!t[r]&&(o[e]=s)})),this.#n=this.#n?D(this.#n,o):o;let i={};if(!t)return i;let l=Object.keys(t),c=l.length;for(let o=0;o<c;o++){const c=l[o],h=w(c),d=this.hasAttribute(h);let p,g=t[c],_=b(r,c),m=u(this,c);if(!("_defaultValue"in g)&&(g._defaultValue=m,!g.type)){n(m)&&Ht(s,"Prop '"+c+"' has neither propType nor defaultValue be used for type inference");let t=typeof m;f(m)&&(t="array");let e=Ae[t];g.type=e}if(_)p=W(r[c])?m:r[c];else{p=m;let t=e.getNamedItem(h)||e.getNamedItem(Qe+h);t&&(_=!0,p=t.value)}if(g.required&&!_){Ht(s,"Prop '"+c+"' is required");break}p=this.#P(t,c,p,d),g.attribute&&B(p)&&!a(p)&&this.#A(g,c,p),this.__data_[c]=p,i[c]=p,delete this[c]}return i}#A(t,e,s){let r=w(e),n=$(s);Ft(t.type)?(n=zt(s),j(n)?n&&!this.hasAttribute(r)?this.toggleAttribute(r,!0):!n&&this.hasAttribute(r)&&this.toggleAttribute(r,!1):this.getAttribute(r)!==n&&this.setAttribute(r,n)):this.getAttribute(r)!==n&&this.setAttribute(r,n)}#x(t,e){let s=t;try{for(let r=0;r<e.length;r++){const n=e[r];s=n===Boolean?zt(t):n===Number?Number(t):n===String?String(t):n===Object||n===Array?F(t):n===Date?new Date(t):new n(t)}}catch(e){Ht(this.tagName,"Convert attribute error with "+t)}return s}#P(t,e,n,o){let i=t[e];if(!i)return n;let a=i.isValid,l=i.type,c=f(l)?l:[l],u=i.converter,h=n;if(!s(c,(t=>t===String))&&r(h)&&!U(h))try{h=u?u(h):this.#x(h,c)}catch(t){Ht(this.tagName,`Convert attribute '${e}' error with `+h)}for(let t=0;t<c.length;t++){"Boolean"===c[t].name&&o&&(h=zt(h))}if(W(h))return h;let d=typeof h,p=!B(h);for(let t=0;t<c.length;t++){const e=c[t];if(R(d,e.name,"i")||h instanceof e||Object.prototype.toString.call(h)===Object.prototype.toString.call(e.prototype)){p=!0;break}}return p||Ht(this.tagName,`Invalid prop '${e}'. expected '${c.map((t=>t.name||t))}' but got '${d}'`),a&&(a.call(this,h,this.__data_)||Ht(this.tagName,`Invalid prop '${e}'. IsValid() check failed`)),h}#N(){let t=Et.get(this.constructor)??Et.get(jt(this.constructor));t&&E(t,((e,s)=>{let r=t[s],n=u(this,s);if(r){let t=r.prop;n=t?z(this.__data_[t]):u(this,s)}this.__data_[s]=n,delete this[s]}))}#b=C(this.propsReady,100);_updateProps(t){let e=wt.get(this.constructor);if(!e)return;let s=[];E(t,((t,r)=>{let n=H(r),o=e[n];o&&(t=this.#P(e,n,t),o.attribute&&B(t)&&!a(t)&&s.push([o,n,t]),S(this,n,t))})),D(this.#o,t),s.forEach((([t,e,s])=>{this.#A(t,e,s)})),this.#o&&this.#b(this.#o)}_wrapperProp={};_initProps(t,e){this.#o=y(this.#o||{},t),this.#n=y(this.#n||{},e),E(t,((t,e)=>{if(a(t)){let s=ee.get(t);if(s){let t=s.join("-");this._wrapperProp[t]=e;let r=this.wrapperComponent?Et.get(this.wrapperComponent?.constructor):null,n=s[0];if(r&&r[n]){let t=wt.get(this.constructor);S(t,[e,"shallow"],r[n].shallow)}}}}))}_bindSlot(t,e,s){this.#h[e]||(this.#h[e]=t,Oe.set(t,this));let r="slotchange",n=Pe(r,this.#_,t,this);if(this._eventBindList.push([r,this.#_,t,n]),!I(s)){let t=this.#e[e];t||(t=this.#e[e]={}),t.props=s}}_bindSlotHook(t,e){this.#c[t]=e}#w=new Set;_updateSlot(t,e,s){let r=this.#h[t],n=this.#c[t];if(!n&&!r)return;let o=this.#e[t];if(e&&(o.props||(o.props={}),o.props[e]=s),n)this.#w.add(t);else{let t=r.assignedElements({flatten:!0});for(let r=0;r<t.length;r++){t[r].setAttribute(e,s+"")}}}#T(){if(!this.#i)return;let t=G(this.#h);if(I(t))return;const e=x(this.childNodes,(t=>t.nodeType===Node.COMMENT_NODE?[]:t instanceof HTMLSlotElement?t.assignedNodes({flatten:!0}):t));let s=X(e,(e=>{if(e.nodeType===Node.TEXT_NODE&&t.includes(dt))return dt;if(e instanceof Element){let s=e.getAttribute("slot")||dt;if(t.includes(s))return s}}));if(I(s))return void(this.slots={});E(s,((t,e)=>{if(e){for(;t.length>0;){let e=t[0];if(!(e.nodeType===Node.TEXT_NODE&&o(e.textContent)||e instanceof HTMLSlotElement&&I(e.assignedNodes({flatten:!0}))))break;t.shift()}for(;t.length>0;){let e=K(t);if(!(e.nodeType===Node.TEXT_NODE&&o(e.textContent)||e instanceof HTMLSlotElement&&I(e.assignedNodes({flatten:!0}))))break;t.pop()}}}));let r={};E(s,((t,e)=>{I(t)||(r[e]=t)})),this.slots=r}#C(t){let e=this.#c[t];if(!e)return;let s=this.#e[t];if(!this.__data_.slots)return;if(!this.__data_.slots[t])return;this.renderAsync(e,u(s,"props"));const r=this._asyncDirectives.get(e);let n=r?.buildView(e(u(s,"props"))),o=q(d(n),(t=>t.nodeType===Node.COMMENT_NODE));if(o){let e=this.#d[t];if(!I(e))for(let t=0;t<e.length;t++){const s=e[t];s.parentNode?.removeChild(s)}this.#d[t]=o,this.append(...o),this.#w.clear()}}_asyncDirectives=new WeakMap;renderAsync(t,...e){}#M(t,e,s){if(!this.__inited)return;if(de(this.constructor).has(t)){let e=H(t);if(U(s)){let t=wt.get(this.constructor);t&&(s=t[e]._defaultValue)}this._updateProps({[e]:s})}}_regSubViewDeps(t,e){this.__updateSubViewDeps||(this.__updateSubViewDeps=new Map),t.forEach((t=>{let s=this.__updateSubViewDeps.get(t);s||(s=new Set,this.__updateSubViewDeps.set(t,s)),s.add(e)}))}_getPrivateData(){return this.__data_}emit(t,e={},s){s&&(e.event=s),e.target=this,b(this.#n,"emit-native")?this.dispatchEvent(new CustomEvent(t,{bubbles:!1,composed:!1,cancelable:!0,detail:e})):this._listerners[t]&&this._listerners[t](e)}_addEvent(t,e){this._listerners||(this._listerners={}),this._listerners[t]=e}nextTick(t){if(!this.isMounted)return this.#f||(this.#f=[]),void this.#f.push(t);le.pushNext(t)}forceUpdate(){E(this.__data_,((t,e)=>{this.#s[e]={value:void 0,chain:void 0}})),this.#y()}}class We{strings;vars;constructor(t,e){this.strings=h(t),this.vars=e}getKey(){let t=this.vars,e="";return E(this.strings,((s,r)=>{if(pt.test(s))return e=Q(t[r]),!1})),e}getKeys(){let t=this.vars,e=[];for(let s=0;s<this.strings.length;s++){const r=this.strings[s];if(pt.test(r)){let r=Q(t[s]);e.push(r)}}return I(e)&&t.forEach((t=>{if(t instanceof We){let s=t.getKey();e.push(s)}})),e}append(t){let e=K(this.strings);return t.strings.forEach(((t,s)=>{0!=s?this.strings.push(t):this.strings[this.strings.length-1]=e+t})),this.vars=h(this.vars,t.vars),this}insert(t,e){let s=e.strings.shift();return this.strings[t]+=s,this.strings.splice(t+1,0,...e.strings),this.vars.splice(t,0,...e.vars),this}getHTML(t){let[e,s]=as(t,this),r=ps([],e,s,t);return Z(r,((t,e)=>t+(e.outerHTML??"")),"")}flatVars(t){let e=h(this.vars),s=this.strings.length-1,r=0;for(let n=0;n<=s;n++){let s=u(e,r,"");if(s instanceof We&&s.vars.length>0){let[n,o]=as(t,s);s=n,e.splice(r,1,...o),r+=o.length-1}r++}return e}destroy(){this.strings=this.vars=null}}var He,Ue;!function(t){t.ATTR="attr",t.PROP="prop",t.TEXT="text",t.CLASS="class",t.STYLE="style",t.SLOT="slot",t.TAG="tag"}(He||(He={})),function(t){t.NONE="NONE",t.REMOVE="REMOVE",t.REPLACE="REPLACE",t.UPDATE="UPDATE",t.APPEND="APPEND"}(Ue||(Ue={}));class Be{key;varIndex;value;node;attrName;attrTmpl;isText=!1;isDirective=!1;isComponent=!1;isProp=!1;isToggleProp=!1;isPlaceholder;__destroyed=!1;directiveOldValue;children;parent;constructor(t,e,s,r){this.varIndex=t,e&&(this.node=e),s&&(this.attrName=s),r&&(this.attrTmpl=r)}static createFrom(t){let e=new Be(t.varIndex,t.node,t.attrName,t.attrTmpl);return e.key=t.key,e.value=t.value,e.isText=t.isText,e.isDirective=t.isDirective,e.isComponent=t.isComponent,e.isProp=t.isProp,e.isToggleProp=t.isToggleProp,e.isPlaceholder=t.isPlaceholder,e}destroy(t){if(this.__destroyed)return;this.__destroyed=!0;let e=this.node,s=this.children;this.parent;if(this.node=this.value=this.directiveOldValue=this.children=this.parent=null,!e)return;let r=s;r?.forEach(((e,s)=>{e.destroy(t)})),e instanceof Ve&&e.destroy(),t&&Gt.clear(e.deref(),t),e.deref()?.remove()}insert(t){t.parent=this,this.children||(this.children=[]),this.children.push(t)}}const $e=new WeakMap,je=new Map;var Fe;!function(t){t.AFTER_BEGIN="afterbegin"}(Fe||(Fe={}));let ze={};function Ge(t,e,s,r,n,o,i,a){let l;if([He.TEXT,He.SLOT].includes(u(r,"__scope",""))?(Jt.start(),l=r(t,e,s,{renderComponent:n,slotComponent:o,varChain:i}),Jt.end(n,a)):l=r(t,e,s,{renderComponent:n,slotComponent:o,varChain:i}),!l)return;let[c,h]=l;if(c===Ue.NONE)return;let p=$e.get(t),f=Gt.getNodes(p,t),g=a.children;if(c===Ue.REMOVE){for(let t=0;t<f.length;t++){const e=f[t];e.remove(),e instanceof Ve&&e.destroy()}g?.forEach(((t,e)=>{t.destroy(n)}))}else if(c===Ue.REPLACE){let e=[];for(let t=0;t<f.length;t++){const e=f[t];e.parentNode?.removeChild(e),e instanceof Ve&&e.destroy()}g?.forEach(((t,e)=>{t.destroy(n)}));let s=fs(t,h,n,a,!0);e=d(s);let r=document.createDocumentFragment();r.append(...e),t.parentNode.insertBefore(r,t)}else if(c===Ue.UPDATE){let e,s={},r=[],o=[];if(h||(h=new We([],[])),I(f)){let e=fs(t,h,n,a,!0);return void p.after(...e)}let i={};h instanceof We&&h.vars.forEach((t=>{if(t instanceof We){const e=t.getKey();i[e]=t,s[e]=!0,o.push(e)}})),f=V(Y(f),(t=>t.nodeType===Node.ELEMENT_NODE)),e=V(Y(d(e)),(t=>t.nodeType===Node.ELEMENT_NODE));let l={},c="",u={};for(let t=0;t<f.length;t++){let e=f[t],s=e.getAttribute("key");if(!W(s)){if(l[s]){c=s;break}l[s]=e,r.push(s),u[s]=!0}}if(c)return void Wt(`${H(t.nodeValue)} - duplicate key '${c}'`);let _=s,m=[],v=[];E(u,((t,e)=>{_[e]||(v.push(e),delete u[e],P(r,(t=>t===e)))}));let y,w=!1;if(!I(o)){let t=-1,e=[],s=[],n=0,i=0;for(;i<o.length;i++){const a=o[i];let c=r.findIndex((t=>t===a));if(c<0){let t=o[i-1],e=t?l[t]||t:p;m.push({prevNode:e,newkey:a}),n++}else if(c>-1&&c!==i-n){if(t<0||1===Math.abs(t-c)){let t=K(e);e.push({nodeId:a,targetId:0===i?Fe.AFTER_BEGIN:t?t.nodeId:o[i-1]})}else s.push({moveGroup:e,moveIndex:i+e.length}),e=[],e.push({nodeId:a,targetId:o[i-1]});t=c}}if(e.length>0&&s.push({moveGroup:e,moveIndex:i+e.length}),s.length>0){w=!0;let t=s.sort(((t,e)=>t.moveGroup.length-e.moveGroup.length));if(t.length<2){let{moveGroup:e}=t[0];if(e.length>1){let t=K(e).targetId;e[e.length-2].nodeId===t&&(e=J(e))}e.forEach((({targetId:t,nodeId:e})=>{let s,r=l[e];t===Fe.AFTER_BEGIN?(s=p,s.after(r)):l[t]&&(s=l[t],s.after(r))}))}else{let e=K(t).moveIndex;1===Math.abs(t[t.length-2].moveIndex-e)&&(t=J(t)),t.forEach((({moveGroup:t})=>{t.forEach((({targetId:t,nodeId:e})=>{let s,r=l[e];t===Fe.AFTER_BEGIN?(s=p,s.after(r)):(s=l[t],s.after(r))}))}))}}}if(v.forEach((t=>{let e=l[t];if(e&&e.parentNode){l[t]=null,e.remove();let s=P(g,(e=>e.key==t));s.forEach((t=>t.destroy(n)))}})),m.length>0&&(y=function(t,e,s,r,n,o){const i=[],a=[],l=[];let c,u=[];t.forEach((t=>{let s=K(u);s&&c===t.prevNode?(s.group||(s.group=[c]),s.group.push(t.newkey)):u.push(t),c=t.newkey;let r=t.newkey;l.push(r),i.push(""),a.push(e[r])})),i.push("");let h=fs(r,new We(i,a),s,o,!0),d=new Map;return h.forEach((t=>{const e=t.getAttribute("key");l.includes(e)&&(d.set(e,!0),n[e]=t)})),u}(m,i,n,t,ze,a),y.forEach(((e,s)=>{let r=e.newkey,n=ze[r],o=e.prevNode;if(e.group){let t=document.createDocumentFragment();t.append(...A(e.group,(t=>ze[t]))),n=t}o===t?o.before(n):o===p?o.after(n):"string"==typeof o?ze[o].after(n):o.after(n)})),ze=null,ze={}),h.vars[0]instanceof We){let t=[],e=[];E(h.vars,(s=>{e.push(...s.vars),t.push(...A(s.vars,(t=>"1")))})),t.push("1"),h=new We(t,e)}if(w||v.length>0||y){const t=X(g,(t=>t.key));let e=[],s=0;o.forEach((r=>{t[r]&&t[r].forEach((t=>{t.varIndex=s++,e.push(t)}))})),tt(g,e).forEach((t=>t.destroy(n))),a.children=e}_s(a,n,h)}}let Xe=0;function Ke(t,e){let s=t.name||"Di-"+Xe++,r=Symbol.for(s);return(...n)=>{let o=t(...n);return(N(e,He.TEXT)||N(e,He.SLOT))&&je.set(s,o),S(o,"__scope",e[0]),[r,n,o,t=>{},Jt.popDirectiveQ()]}}const qe="@",Qe=".",Ze="?",Ye="*",Je=":",ts="ref",es="key",ss=/(<\/?)\s*([A-Z][A-Za-z0-9]*)([\s>])/gm,rs=/\s+([\.?@*])?((?:[a-zA-Z]*[A-Z][^\s<>="']+))(?=[\s=>])/gm,ns=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,os="slot-props",is=new Map;function as(t,e){let s="",r=h(e.vars),n=e.strings.length-1,o=e.vars.length-1,i=0;for(let a=0;a<=n;a++){const n=e.strings[a];let l=u(r,i,"");if(l instanceof We){let[e,s]=as(t,l);l=e,r.splice(i,1,...s),i+=s.length-1}else l=a>o?"":us;i++,s=s+n+l}let a=0;return s=s.replace(ns,((t,e)=>ot(t,us,(()=>us.replace("--\x3e","")+a++)))),s=s.replace(vs,"$1><").trim(),s=ls(s),[s,r]}function ls(t){return r(t)?t=(t=t.replace(rs,((t,e,s)=>` ${e??""}${w(s)}`))).replace(ss,((t,e,s,r)=>e+mt[s]+r)):t+""}function cs(t,e){let s=h(e.vars),r=e.strings.length-1;for(let n=0;n<=r;n++){let r=u(e.vars,n,"");if(r instanceof We){let e=cs(t,r);s.splice(n,1,...e)}}return s}const us="\x3c!--c_ui-pl_df--\x3e",hs="\x3c!--c_ui-pl_df",ds=/<!--c_ui-pl_df\d*(-->)?/;function ps(t,e,s,r){const n=document.createElement("div");n.innerHTML=e;let o=r._eventBindList;o||(o=r._eventBindList=[]);const i=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let a,l,u=0,h=null,_="";for(;a=i.nextNode();){if(l&&!l.contains(a)&&(l=void 0),a instanceof HTMLElement||a instanceof SVGElement){a instanceof Ve&&(l=a);let e={},n=d(a.attributes);for(let i=0;i<n.length;i++){const d=n[i];let{name:g,value:m}=d;if(g!==os)if(c(g,hs)){let e=s[u];if(f(e)&&p(e[0])){let[,s,n,o,i]=e;o(He.TAG);let c=new Be(u,new WeakRef(a));c.isDirective=!0,c.value=e,c.isComponent=!!l,t.push(c),h&&h?.contains(a)&&(c.key=_),u++,n(a,s,void 0,{renderComponent:r,slotComponent:l,varChain:i})}a.removeAttribute(g)}else if(g[0]!==qe)if(g!==ts)if(g!==es){if(ds.test(m)){let n=s[u],o=new Be(u,new WeakRef(a),g.replace(/\.|\?|@/,""),m);if(o.isComponent=!!l,h&&h?.contains(a)&&(o.key=_),g[0]===Qe||g[0]===Ze||g[0]===Ye){if(f(n)&&p(n[0])){let[,t,e,s,i]=n;s(He.PROP),e(a,t,void 0,{renderComponent:r,slotComponent:l,varChain:i,attrName:g.substring(1)}),o.value=n,o.isDirective=!0}else if(g[0]===Ze){o.isToggleProp=!0,o.value=!!n;let t=g.substring(1);o.value&&a.setAttribute(t,n)}else if(g[0]===Ye){o.value=n;let t=g.substring(1);const[e,s]=t.split(Je);let r=e;switch(s){case"camel":r=H(r);break;case"kebab":r=w(r);break;case"snake":r=it(r)}o.attrName=r,a.setAttribute(r,n)}else{let t=H(g.substring(1));o.value=n,o.isProp=!0,e[t]=n}a.removeAttribute(g),n=""}else{let t,e;if(o.value=n,f(n)&&p(n[0])){He.ATTR,"class"===g?He.CLASS:"style"===g&&He.STYLE;let[,s,r,i]=n;o.isDirective=!0,o.attrName=g,e=s,t=r,n=""}m=nt(m,ds,n),d.value=m,B(m)&&a.setAttribute(g,m),t&&t(a,e,void 0,{renderComponent:r,slotComponent:l})}t.push(o),u++}}else{let e=s[u];a.setAttribute(g,e);let r=new Be(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=_),t.push(r),u++,h=a,_=e,t.length>0&&t.forEach((t=>{t.key=t.key??e}))}else{if(ds.test(m)){let e=s[u],r=new Be(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=_),t.push(r),u++,e.__setRef(new WeakRef(a))}a.removeAttribute(g)}else{let e;if(ds.test(m)){let r=new Be(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=_),t.push(r),e=s[u],u++}let r=g.substring(1);o.push([r,e,a]),a.removeAttribute(g)}}a instanceof Ve?(m=r,a.__wrapperComponent=new WeakRef(m),g(e)>0&&a._initProps(e)):a instanceof HTMLSlotElement&&r._bindSlot(a,a.name||"default",e)}else{let e=a;if(`\x3c!--${e.nodeValue}--\x3e`!==us)continue;let n=new Be(u,new WeakRef(a));h&&h?.contains(a)&&(n.key=_),t.push(n),n.isComponent=!!l,n.isText=!0;let o=s[u];if(f(o)&&p(o[0])){const t=Symbol.keyFor(o[0]);let s;s=document.createComment(`compelem-${r.tagName}-${t}-start`),e.parentNode.insertBefore(s,e),e.nodeValue=`compelem-${r.tagName}-${t}-end`,e._diName=t,$e.set(e,s),n.isDirective=!0,n.value=o;let i=l?He.SLOT:He.TEXT,[,a,c,u,h]=o;u(i),n.directiveOldValue=[a,h],Jt.start();let d=c(e,a,void 0,{renderComponent:r,slotComponent:l,varChain:h});if(Jt.end(r,n),d){let t=fs(e,d[1],r,n),s=t.length;t&&s>0&&Gt.insertBefore(e,Array.from(t))}o=void 0}else n.value=o,n.node=null;if(u++,!n.isDirective){let t=Q(o??""),s=document.createTextNode(t);e.parentNode.insertBefore(s,e),e.remove(),a=s,n.node=new WeakRef(s)}}h&&!h.contains(a)&&h!==a&&(h=null,_="")}var m;return n.childNodes}function fs(t,e,s,r,n=!1){let[o,i]=as(s,e),a=[],l=ps(a,o,i,s);return n&&s.__bindEvents(),a.forEach((t=>{r.insert(t)})),l}function gs(t,e,s,r){if(o(et(t.strings)))return;let n=t.flatVars(e);for(let t=0;t<s.length;t++){const o=s[t];let i=o.varIndex;if(i<0)continue;if(o.isPlaceholder)continue;if(o.__destroyed)continue;let l=o.value,c=n,h=o.node.deref();if(!h)continue;let d=st(i,"-");for(let e=0;e<d.length;e++){const s=d[e];c=u(c,s),c&&c.vars&&t<d.length-1&&(c=c.vars)}if(!a(l)&&l===c)continue;let p=h;if(o.isDirective){if(r?.has(o))continue;let[,t,s,,n]=o.value;if(!f(c))continue;let i=Xt(h,e),[,a]=c;Ge(h,a,t,s,e,i,n,o)}else if(o.isToggleProp){if(!!c===l)continue;p.toggleAttribute(o.attrName,!!c),S(p,o.attrName,!!c)}else if(o.isProp){if(!a(c)&&c===l)continue;h instanceof Ve?h._updateProps({[o.attrName]:c}):h instanceof HTMLSlotElement&&e._updateSlot(h.getAttribute("name")||"default",o.attrName,c)}else if(o.attrName){if(!rt(l,c))switch(o.attrName){case"value":if(h instanceof HTMLInputElement){h.value=c;break}default:h.setAttribute(o.attrName,nt(o.attrTmpl,ds,c+""))}}else if(o.isText){o.node.deref().textContent=Q(c??"")}o.value=c}}function _s(t,e,s){if(!t||t.__destroyed)return;let r=t.node.deref();const n=je.get(r._diName);let o=Xt(r,e);const[i,a]=t.directiveOldValue;if(!s){let l=n(r,t.value[1],i,{renderComponent:e,slotComponent:o,varChain:a});if(!l)return;s=l[1]}if(s){if(s.vars[0]instanceof We){let t=[],e=[];E(s.vars,(s=>{e.push(...s.vars),t.push(...A(s.vars,(t=>"1")))})),t.push("1"),s=new We(t,e)}gs(s,e,t.children)}}function ms(t,...e){return new We(r(t)?[t]:t,e)}const vs=/([a-z0-9"'])\s*>\s*</gim;class ys{#R;get current(){return this.#R?.deref()}__setRef(t){this.#R=t}}function Es(){return new ys}var ws;!function(t){t.CLASS="class",t.FIELD="field",t.METHOD="method"}(ws||(ws={}));class bs{static get priority(){return 0}created(t,...e){}beforeMount(t,e,...s){}mounted(t,e,...s){}updated(t,e){}beforeDestroy(t,...e){}}class Ss{metadata;decorator;key;priority=0;constructor(t,e,s){this.metadata=e,this.decorator=new s(...t),this.priority=u(s,"priority",0)}dispose(){this.metadata=null,this.decorator=null}create(t){let e,s=this.decorator.targets,r=this.metadata[1];a(r)&&B(u(r,"configurable"))?e=ws.METHOD:n(this.metadata[1])&&(e=ws.FIELD),!I(s)&&e&&s.includes(e)?this.decorator.created(t,...this.metadata):Wt(`Decorator '${this.decorator.constructor.name}' is out of targets, expect '${s.join(",")}' bug got '${e}'`)}beforeMount(t,e){this.decorator.beforeMount(t,e,...this.metadata)}mounted(t,e){this.decorator.mounted(t,e,...this.metadata)}updated(t,e){this.decorator.updated(t,e)}destroy(t){this.decorator.beforeDestroy(t,...this.metadata)}}function Ns(t){return(...e)=>(...s)=>{let r=s[0].constructor,n=bt.get(r);if(!bt.has(r)){let t=Object.getPrototypeOf(r);n=t?h(bt.get(t)??[]):[],bt.set(r,n)}let o=new Ss(e,s.splice(1),t);return n?.push(o),o}}function Ts(t){return(...e)=>{if(!e||e.length<1)return;let s=e[0].constructor,r=bt.get(s);if(!bt.has(s)){let t=Object.getPrototypeOf(s);r=t?h(bt.get(t)??[]):[],bt.set(s,r)}let n=new Ss([],e.splice(1),t);return r?.push(n),n}}function Cs(t,e,s){return s.get||Wt(`Computed '${e}' must be a getter`),yt.has(t.constructor)||yt.set(t.constructor,{}),yt.get(t.constructor)[e]=s.get,delete t[e],Reflect.defineProperty(t,e,{get(){return Jt.__collecting&&Jt.__varPathList.push(e),Reflect.get(this[Vt],e)}}),Reflect.getOwnPropertyDescriptor(t,e)}const ks=Ns(class extends bs{static get priority(){return Number.MAX_VALUE}created(t,e,...s){let r=u(t,e);S(t,e,C(r,this.wait,this.immediate)),S(t,e+"_$__",r)}beforeDestroy(t,e){S(t,e,null),S(t,e+"_$__",null)}get targets(){return[ws.METHOD]}wait;immediate;constructor(t,e=!1){super(),this.wait=t,this.immediate=e}});function Ms(t,e){return(s,r,n)=>{if(!_t.has(s.constructor)){let t=[],e=s.constructor;for(;(e=jt(e))!==Ve;)t=h(t,_t.get(e)??[]);_t.set(s.constructor,t)}_t.get(s.constructor)?.push({name:t,targetFn:e,fnName:r})}}const Ps=Ns(class extends bs{static get priority(){return Number.MAX_VALUE}created(t,e,s,...r){let n=at(u(t,s),t);S(t,s,M(n)),S(t,s+"_$__",n)}beforeDestroy(t,e){S(t,e,null),S(t,e+"_$__",null)}get targets(){return[ws.METHOD]}});var As;!function(t){t.ONCE="once"}(As||(As={}));const xs=new WeakMap;class Rs extends bs{static get priority(){return Number.MAX_VALUE}get targets(){return[ws.FIELD]}selector;cache;constructor(t,e){super(),this.selector=t,this.cache=e}static getKey(t){return t}getter(t){let e=t?.shadowRoot?.querySelector(this.selector),s=xs.get(t);s||(s=new Map,xs.set(t,s)),s.set(this.selector,e)}mounted(t,e,s,...r){const n=this;let o=new WeakRef(t);Reflect.defineProperty(t,s,{configurable:!0,get(){let t=o.deref();return xs.has(t)&&xs.get(t)?.has(n.selector)&&n.cache===As.ONCE||n.getter(t),xs.get(t)?.get(n.selector)}})}beforeDestroy(t,e){xs.get(t)?.clear(),xs.delete(t)}updated(t,e){this.cache!==As.ONCE&&this.getter(t)}}const Ds=Ns(Rs),Os=Ns(class extends Rs{getter(t){let e=t.shadowRoot?.querySelectorAll(this.selector),s=xs.get(t);s||(s=new Map,xs.set(t,s)),s.set(this.selector,e)}});function Ls(t){if(1===arguments.length)return(e,s)=>{Is(e,s,t)};Is(arguments[0],arguments[1],{prop:""})}function Is(t,e,s){if(!Et.has(t.constructor)){const e={};let s=t.constructor;for(;(s=jt(s))!==Ve;)y(e,Et.get(s)??{});Et.set(t.constructor,e)}if(s.shallow=s.shallow||!1,S(Et.get(t.constructor),e,s),s.hasChanged){let r=Dt.get(t.constructor);r||(r=new Map,Dt.set(t.constructor,r)),r.set(e,s.hasChanged)}if(s.shallow){let s=xt.get(t.constructor);s||(s=new Set,xt.set(t.constructor,s)),s.add(e)}Reflect.defineProperty(t.constructor.prototype,e,{get(){return Kt(e,this)},set(t){qt(e,t,this)}})}function Vs(t,e,s){Is(t.prototype,e,s||{prop:""})}function Ws(t){return e=>{e&&(mt[e.name]=t,vt[t]=e)}}const Hs=Ns(class extends bs{static get priority(){return Number.MAX_VALUE}created(t,e,...s){let r=u(t,e);S(t,e,k(r,this.wait)),S(t,e+"_$__",r)}beforeDestroy(t,e){S(t,e,null),S(t,e+"_$__",null)}get targets(){return[ws.METHOD]}wait;constructor(t){super(),this.wait=t}});function Us(t,e){return(s,r)=>{let n=Mt.get(s.constructor),o=kt.get(s.constructor),i=Nt.get(s.constructor),a=Tt.get(s.constructor),l=Ct.get(s.constructor),c=Pt.get(s.constructor);if(!l){l=[],Ct.set(s.constructor,l),a=[],Tt.set(s.constructor,a),i=new Map,Nt.set(s.constructor,i),n={},Mt.set(s.constructor,n),o={},kt.set(s.constructor,o),c={},Pt.set(s.constructor,c);let t=jt(s.constructor);for(;t;)Ct.has(t)&&(l.push(...Ct.get(t)),a.push(...Tt.get(t)),Nt.get(t)?.forEach(((t,e)=>{i.set(e,t)})),D(n,Mt.get(t)),D(o,kt.get(t)),D(c,Pt.get(t))),t=jt(t)}(f(t)?t:[t]).forEach((t=>{let h=s[r];u(e,"once",!1)&&i.set(t,!1);let d=u(e,"deep",!1);if(l.push(t),d?(n[t]=n[t]??new Set,n[t].add(h),a.push(t)):(o[t]=o[t]??new Set,o[t].add(h)),u(e,"immediate",!1)){let e=c[t];e||(e=c[t]=new Set),e.add(h)}}))}}const Bs=["key"],$s=Ke((function(t){return(t,[e],s)=>{let r=t;if(s)E(e,((t,e)=>{r.setAttribute(e,t)}));else if(r instanceof Ve){let t={},s={},n=wt.get(r.constructor);E(e,((e,r)=>{if(Bs.includes(r))return;let o=H(r);(n?n[o]:void 0)?t[r]=e:s[r]=e+""})),r._initProps(t,s)}else E(e,((t,e)=>{r.setAttribute(e,t)}))}}),[He.TAG]),js=new WeakMap,Fs=Ke((function(t){return(t,[e],s,{renderComponent:n})=>{let o=[];if(f(e)?o=Y(e):a(e)?o=x(e,((t,e)=>t?e:[])):r(e)&&(o=e.split(" ")),o.length<1&&!s)return;let i=t;if(js.get(i)&&js.get(i).length===o.length&<(js.get(i),o))return;let l=js.get(i);E(l,(t=>{i.classList.remove(t)})),E(o,(t=>{i.classList.add(t)})),l=h(o),js.set(i,l)}}),[He.CLASS]),zs=new WeakMap,Gs=new WeakMap,Xs=Ke((function(t,e){return(t,e,s,{varChain:r})=>{let n=t,o=function(t,e,s){let r=A(t,((t,s)=>e(t,s)));if(r.length<1){let t=new We([],[]);return Gs.set(s,t),t}let n=[],o=[];const i=[],a=[];for(let t=0;t<r.length;t++){const e=r[t];let s=K(o),l=e.vars,c=!0,u=e.strings;for(let t=0;t<u.length;t++){const e=u[t];if(pt.test(e)){let e=l[t]+"";if(n.includes(e))return void Wt(`forEach - duplicate key '${e}'`);n.push(e),c=!1}0==t&&s?o[o.length-1]=s+e:o.push(e)}if(c)return void Wt("forEach - missing 'key' prop");let h=K(i);h&&u.length>0&&(i[i.length-1]=$(h)+u.shift()),i.push(""),a.push(e)}i.push("");let l=new We(i,a);return Gs.set(s,l),l}(e[0],e[1],n);if(s&&s[0]){const s=zs.get(n);let r=$e.get(t),i=Gt.getNodes(r,t);if(I(i)&&(!e||I(e[0])))return[Ue.NONE,o];if(s&<(s,e[0])&&s.length===e[0].length)return[Ue.NONE,o]}return zs.set(n,ct(e[0])),s?[Ue.UPDATE,o]:[Ue.APPEND,o]}}),[He.TEXT,He.SLOT]);let Ks=document.createElement("div");const qs=Ke((function(t){return(t,e,s,{renderComponent:r,slotComponent:n})=>{s&&e[0]==s[0]||W(e[0])||(Ks.innerHTML=ls(e[0]),t.after(...Ks.childNodes))}}),[He.TEXT,He.SLOT]),Qs=Ke((function(t){return(t,e,s,{renderComponent:r,slotComponent:n})=>{s&&e[0]==s[0]||W(e[0])||(t.innerHTML=ls(e[0]))}}),[He.TAG]),Zs=new WeakMap,Ys=Ke((function(t,e,s){return(t,[e,s,r],n,{renderComponent:o})=>{let i=t;if(n){if(!!e==!!n[0]){let t=Zs.get(i);return[Ue.NONE,t.call(o,e)]}let t=e?s:r;return Zs.set(i,t),[Ue.REPLACE,t.call(o,e)]}{let t=e?s:r;return Zs.set(i,t),[Ue.APPEND,t.call(o,e)]}}}),[He.TEXT,He.SLOT]),Js=Ke((function(t,e){return(t,[e,s],r)=>r?e===r[0]?[Ue.NONE,e?s():ms``]:e?[Ue.REPLACE,e?s():ms``]:[Ue.REMOVE]:[Ue.APPEND,e?s():ms``]}),[He.TEXT,He.SLOT]);var tr;!function(t){t.CHANGE="change",t.INPUT="input"}(tr||(tr={}));const er=Ke((function(t,s="value",n){return(t,[s,n,o],i,{varChain:l,renderComponent:c})=>{n=n??"value";const h=t;if(i){const t=i[0],e=s;if(!a(e)&&Object.is(e,t))return;if(h instanceof Ve)h._updateProps({[n]:e});else if(h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement){if(h.setAttribute(n,e+""),h instanceof HTMLSelectElement){let t=T(h.querySelectorAll("option"),(t=>t.value==e));t&&(t.selected=!0)}}else if(h instanceof HTMLInputElement){if(h.value==e)return;switch(h.type){case"checkbox":case"radio":e?h.setAttribute("checked",""):h.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":h.setAttribute(n,e+""),S(h,n,e);break;default:h.setAttribute(n,e+"")}}return}let d;d=r(o)?e(o)[0]:K(l);const p=st(d,".")[0];p in c||c._wrapperProp[p]||Wt(`model - property '${p}' is not defined on the instance of `+c.tagName);let f=c._eventBindList;if(a(s)||$(s)||(s=""),h instanceof Ve){h._initProps({[n]:s});let t="update:"+n;f.push([t,function(t){let e=this,s=e._wrapperProp[p];!(p in e)&&s&&u(e.wrapperComponent,p)===u(e,s)&&(e=e.wrapperComponent||e),S(e,d,t.value)},h])}else if(h instanceof HTMLTextAreaElement){h.setAttribute(n,s+"");let t="input";f.push([t,function(t){let e=t.target;S(this,d,e.value)},h])}else if(h instanceof HTMLInputElement){let t="",e="";switch(h.type){case"checkbox":case"radio":t="checked",e="change";break;default:t="value",e="input"}h.setAttribute(n??t,s+""),f.push([e,function(t){let e=t.target;S(this,d,e.value)},h])}else h instanceof HTMLSelectElement&&(h.setAttribute(n,s+""),f.push(["change",function(t){let e=t.target,s=this,r=s._wrapperProp[p];!(p in s)&&r&&u(s.wrapperComponent,p)===u(s,r)&&(s=s.wrapperComponent||s),S(s,d,e.value)},h]))}}),[He.TAG]),sr=new WeakMap,rr=Ke((function(t,e){return(t,[e,s],r)=>{if(r&&e===r[0])return;let n=t;if(!sr.has(n)){let t=n.style.display;sr.set(n,"none"==t?"unset":t)}n.style.display=e?sr.get(n):"none",s&&s(n,e)}}),[He.TAG]),nr=Ke((function(t,e){return(t,[e,s],r,{renderComponent:n,slotComponent:o})=>{r||(e=e.bind(n),o._bindSlotHook(s||"default",e))}}),[He.SLOT]);class or{static getCssText(t,e=!1){return r(t)?t:et(A(t,((t,s)=>s.startsWith("--")?s+":"+t+(e?" !important":""):w(s)+":"+t+(e?" !important":""))),";")+";"}static setStyle(t,e){if(r(t)&&!$(t))return;let s=or.getCssText(t);e.style.cssText=s}}const ir=Ke((function(...t){return(t,e,s,{renderComponent:r})=>{let n=t,o=Z(e,((t,e)=>t+or.getCssText(e)),""),i=Y(o.split(";").map((t=>t.split(":")[0]))),a=Y(n.style.cssText.split(";")),l=q(a,(t=>i.some((e=>t.trim().startsWith(e)))));n.style.cssText=o+l.join(";")}}),[He.STYLE]),ar=Ke((function(t){return(t,e,s,{renderComponent:r,varChain:n,attrName:o})=>{const i=t;if(s)return void(rt(e,s)||i._updateProps({[o]:e[0]}));let a=K(n);i._initProps({[o]:e[0]}),i.addEventListener("update:"+o,(t=>{S(r,a,t.detail.value)}))}}),[He.PROP]),lr=new WeakMap,cr=Ke((function(t,e){return(t,[e,s],r)=>{let n=()=>ms``,o=[],i=[];E(s,((t,e)=>{if(l(t))o.push(e),i.push(t);else{let e=t[0],s=t[1];o.push(e),i.push(s)}"default"===e&&(n=t)}));let a=ut(o,(t=>l(t)?t(e):t==e)),c=lr.get(t);return lr.set(t,a),r?c==a?[Ue.UPDATE,ht(i[a]??n)]:[Ue.REPLACE,ht(i[a]??n)]:[Ue.APPEND,ht(i[a]??n)]}}),[He.TEXT,He.SLOT]);function ur(){E(vt,((t,e)=>{customElements.define(e,t)}))}export{Ve as CompElem,or as CssHelper,$e as DI_COMMENT_START_NODE_MAP,bs as Decorator,ws as DecoratorType,Ss as DecoratorWrapper,Ue as DirectiveUpdateTag,Gt as DomUtil,He as EnterPointType,tr as ModelTriggerType,As as QueryCache,We as Template,je as TextOrSlotDirectiveExecutorMap,Be as UpdatePoint,de as _getObservedAttrs,jt as _getSuper,$t as _toUpdatePath,$s as bind,as as buildHTML,Fs as classes,Cs as computed,Es as createRef,ks as debounced,Ns as decorator,Ts as decoratorWithNoArgs,Ke as directive,Ms as event,Xs as forEach,zt as getBooleanValue,Xt as getSlotComponent,ms as html,qs as htmlC,Qs as htmlD,Ys as ifElse,Js as ifTrue,Ft as isBooleanProp,Vs as makeState,er as model,Ps as onced,ce as prop,Ds as query,Os as queryAll,ur as regComponents,rr as show,Wt as showError,Ht as showTagError,Bt as showTagWarn,Ut as showWarn,nr as slot,Ls as state,ir as styles,ar as sync,Ws as tag,Hs as throttled,Ge as updateDirective,Us as watch,cr as when};
|
|
7
|
+
import t,{toPath as e,some as s,isString as r,isUndefined as n,isBlank as o,closest as i,isObject as a,isFunction as l,startsWith as c,get as u,concat as h,toArray as d,isSymbol as p,isArray as f,size as g,eachRight as _,slice as m,defaults as v,merge as y,each as E,kebabCase as w,has as b,set as S,includes as N,find as T,debounce as C,throttle as k,once as M,remove as P,map as A,flatMap as x,test as D,assign as R,first as L,walkTree as O,isEmpty as I,filter as V,isNil as W,camelCase as H,isNull as U,isDefined as B,trim as $,isBoolean as j,parseJSON as F,cloneDeep as z,keys as G,groupBy as X,last as K,reject as q,toString as Q,reduce as Y,compact as Z,initial as J,except as tt,join as et,split as st,isEqual as rt,replace as nt,replaceAll as ot,snakeCase as it,bind as at,isMatch as lt,clone as ct,findIndex as ut,call as ht}from"myfx";const dt="default",pt=/\s+\.?key\s*=/;var ft,gt;!function(t){t[t.RENDER=1]="RENDER",t[t.COMPUTED=2]="COMPUTED",t[t.DIRECTIVE=3]="DIRECTIVE"}(ft||(ft={})),function(t){t.Prod="prod",t.Dev="dev"}(gt||(gt={}));const _t=new Map,mt={},vt={},yt=new WeakMap,Et=new WeakMap,wt=new WeakMap,bt=new Map,St=new Map,Nt=new WeakMap,Tt=new WeakMap,Ct=new WeakMap,kt=new WeakMap,Mt=new WeakMap,Pt=new WeakMap,At=new WeakMap,xt=new WeakMap,Dt=new WeakMap,Rt=new WeakMap,Lt=new WeakMap,Ot=new WeakMap,It=new WeakMap,Vt="__data_";function Wt(t){console.error("[CompElem]",t)}function Ht(t,e){console.error(`[CompElem <${t}>]`,e)}function Ut(...t){console.warn("[CompElem]",...t)}function Bt(t,e){console.warn(`[CompElem <${t}>]`,e)}function $t(t){return e(t).join("-")}function jt(t){return Object.getPrototypeOf(t)}function Ft(t){return t===Boolean||s(t,(t=>t===Boolean))}function zt(t){let e=t;return r(t)&&/(?:^true$)|(?:^false$)/.test(e)?e="true"===e:(n(e)||o(e))&&(e=!0),e}const Gt={getNodes(t,e){let s=t.nextSibling;if(!e)return[s];let r=[];for(;s&&s!==e;)r.push(s),s=s?.nextSibling;return r},insertBefore:function(t,e){if(!t.parentNode)return;let s=document.createDocumentFragment();s.append(...e),t.parentNode.insertBefore(s,t)},remove:function(t,e){if(t===e)return void t?.parentNode?.removeChild(t);let s=t.nextSibling;for(;s&&s!==e;)s?.parentNode?.removeChild(s),s=t.nextSibling},clear(t,e){if(!t)return;let s,r=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT);for(r=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_ELEMENT);s=r.nextNode();)t!==s&&(s instanceof Comment||s instanceof Ve&&s.destroy())}};function Xt(t,e){let s=i(t,(t=>t.host&&t.host instanceof Ve),"parentNode");if(!s||s.host!==e)return s?s.host:void 0}function Kt(t,e){let s=e,r=Reflect.get(s[Vt],t);if(Jt.__collecting&&Jt.__varPathList.push(t),se.has(r)){let t=ne.get(r);return t||(t=new Set,ne.set(r,t)),t.add(s.__thisRef),se.get(r)}if(a(r)&&!l(r)&&!(r instanceof Node)&&!Object.isFrozen(r)){let e=xt.get(s.constructor),n=e?.has(t);n||(e=Dt.get(s.constructor),n=e?.has(t)),r=n||"slots"===t?r:oe(r,s,t)}return r}function qt(t,e,s){let r=s;if(!r.__inited)return void Reflect.set(r[Vt],t,e);let n=r[Vt][t],o=Rt.get(r.constructor),i=o?.get(t);if(i){if(!i.call(r,e,n,[t],e,n))return!0}else if(Object.is(n,e))return!0;Qt(r,e,n,t),Yt(r,t),Zt(r,t),Reflect.set(r[Vt],t,e),r._notify(n,[t]);let a=At.get(r.constructor);a?.has(t)&&r.emit("update:"+t,{value:e})}function Qt(t,e,s,r,n,o){let i=jt(t.constructor),a=Ct.get(t.constructor)??Ct.get(i),l=Tt.get(t.constructor)??Tt.get(i),p=Mt.get(t.constructor)??Mt.get(i),f=kt.get(t.constructor)??kt.get(i),g=Nt.get(t.constructor)??Nt.get(i);a?.forEach((i=>{(r===i||c(i,r+".")&&!Object.is(u(t._getPrivateData(),i),u(e,i))||c(r,i+".")&&l?.includes(i)&&!Object.is(u(t._getPrivateData(),i),u(e,i)))&&h(d(f[i]),d(p[i])).forEach((a=>{a&&!0!==g.get(i)&&(t._watchUpdateArgsInNextTick.set(a,{newValue:e,oldValue:s,chain:r.split("."),rootObjNew:n,rootObjOld:o,fullMatch:i===r}),t._watchUpdateSetInNextTick.add(a),g.has(i)&&g.set(i,!0))}))}))}function Yt(t,e){let s=Lt.get(t.constructor);s?.has(e)&&s.get(e)?.forEach((e=>{t._computedUpdateSetInNextTick.add(e)}))}function Zt(t,e){let s=Ot.get(t.constructor);if(!s)return;let r=e.split("."),n="";r.forEach((e=>{n=n?n+"."+e:e,s.has(n)&&(t._cssUpdateInNextTick=!0)}))}const Jt={popDirectiveQ(){return this.__varPathList.reduceRight(((t,e)=>(t.includes(e)||t.unshift(e),t)),[])},start(){this.__collecting=!0,this.__varPathList=[]},end(t,e){t&&e&&t._regSubViewDeps(Jt.popVarPathList(),e),this.__collecting=!1},popVarPathList(){let t=Array.from(new Set(this.__varPathList));return this.__varPathList=[],t},__varPathList:[],__collecting:!1},te=new WeakMap,ee=new WeakMap,se=new WeakMap,re=new WeakMap,ne=new WeakMap;function oe(t,e,s){if(se.has(t))return se.get(t);if(re.has(t)){if(s){let r=te.get(e);r||(r=new WeakMap,te.set(e,r)),r.set(t,s);let n=ne.get(t);n||(n=new Set,ne.set(t,n)),n.values().some((t=>t.deref()===e))||n.add(new WeakRef(e))}return t}const r=new Proxy(t,{get(t,s,r){if(!s)return;const n=Reflect.get(t,s,r);if(p(s))return n;if(l(n))return n;if("length"===s&&f(t))return n;if("__"===s.substring(0,2))return n;if(Jt.__collecting){let t=ee.has(r)?h(ee.get(r)):[];t.push(s);let e=t.join(".");Jt.__varPathList.push(e)}if(se.has(n))return se.get(n);let o=n;if(a(n)&&!l(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){let t=ee.has(r)?h(ee.get(r)):[];o=oe(n,e),t.push(s),ee.set(o,t),se.set(n,o)}return o},set(t,s,r,n){if(!s)return!1;let o=t[s],i=ee.get(n)??[],a=h(i,[s]),l=Rt.get(e.constructor),c=l?.get(a[0]),u=a.length>1,d=r,p=o;if(u&&(p=d=e._getPrivateData()[a[0]]),c){if(!c.call(e,d,p,a,r,o))return!0}else if(Object.is(o,r))return!0;let f=r,g=Reflect.set(t,s,f),_=ne.get(n),m=a.join(".");return Qt(e,f,o,m,d,p),Yt(e,m),Zt(e,m),ie(e,p,a),_?.forEach((t=>{let e=t.deref();if(!e)return;let s=e._wrapperProp[a[0]],r=a.join(".");r=r.replace(a[0],s),Qt(e,f,o,r),Yt(e,r),Zt(e,r),ie(e,p,r.split("."))})),g}});if(ee.has(r)||ee.set(r,s?[s]:[]),se.set(t,r),s&&(re.set(r,e),!te.has(e))){let t=new WeakMap;t.set(r,s),te.set(e,t)}return r}function ie(t,e,s,r,n){let o=g(s);_(s,(r=>{let n=m(s,0,o--);t._notify(e,n)}))}const ae=new Map;class le{static nextSet=new Set;static nextPending=!1;static next;static flush(){le.nextPending=!1;let t=Array.from(le.nextSet);le.nextSet.clear(),ae.clear(),t.forEach((t=>t())),t=null}static pushNext(t){le.nextSet.add(t),le.nextPending||(le.nextPending=!0,le.next())}}function ce(t){if(1===arguments.length)return(e,s,r)=>{t.required=t.required||!1,t.attribute=!1!==t.attribute,ue(e,s,t)};let e=arguments[0],s=arguments[1],r=arguments[2];t={type:void 0,required:!1,attribute:!0},r&&"function"==typeof r.type&&(t=v(r,t),r=void 0),t.shallow=t.shallow||!1,ue(e,s,t)}function ue(t,e,s,r){let n;if(!wt.has(t.constructor)){const e={};let s=t.constructor;for(;(s=jt(s))!==Ve;)y(e,wt.get(s)??{});n=new Set,E(e,((t,e)=>{if(t.attribute){let t=w(e);n?.add(t)}})),St.set(t.constructor,n),wt.set(t.constructor,e)}if(s.attribute){n||(n=St.get(t.constructor));let s=w(e);n?.add(s)}if(b(t.constructor,"observedAttributes")||(t.constructor.observedAttributes=[]),n&&(t.constructor.observedAttributes=d(n)),S(wt.get(t.constructor),e,s),s.hasChanged){let r=Rt.get(t.constructor);r||(r=new Map,Rt.set(t.constructor,r)),r.set(e,s.hasChanged)}if(s.sync){let s=At.get(t.constructor);s||(s=new Set,At.set(t.constructor,s)),s.add(e)}if(s.shallow){let s=Dt.get(t.constructor);s||(s=new Set,Dt.set(t.constructor,s)),s.add(e)}Reflect.defineProperty(t,e,{get(){return Kt(e,this)},set(t){qt(e,t,this)}})}(()=>{const t=Promise.resolve(),e=le.flush;le.next=()=>{t.then(e)}})();const he=new Set;function de(t){return St.get(t)??he}const pe=["resize","outside","mutate"],fe=new WeakMap,ge=[],_e=[],me=[],ve=new WeakSet,ye=new ResizeObserver((t=>{for(const e of t){const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize,s=Array.isArray(e.borderBoxSize)?e.borderBoxSize[0]:e.borderBoxSize;if(!ve.has(e.target)){ve.add(e.target);continue}let r=fe.get(e.target);r&&r({target:e.target,contentBoxSize:t,borderBoxSize:s,type:"resize"})}}));var Ee;!function(t){t.Child="child",t.Tree="tree",t.Attr="attr",t.Char="char"}(Ee||(Ee={}));const we=new WeakMap,be=new MutationObserver((t=>{for(let e=0;e<t.length;e++){const s=t[e];let r=we.get(s.target);if(!r)return;let n={target:s.target},o=null;switch(s.type){case"subtree":n.type=Ee.Tree,o=r[Ee.Tree];break;case"childList":n.type=Ee.Child,n.addedNodes=s.addedNodes,n.removedNodes=s.removedNodes,o=r[Ee.Child];break;case"attributes":n.type=Ee.Attr,n.attributeName=s.attributeName,n.oldValue=s.oldValue,o=r[Ee.Attr];break;case"characterData":n.type=Ee.Char,n.oldValue=s.oldValue,o=r[Ee.Char]}o&&(n.type="mutate",o(n))}}));function Se(e,s,r,n,o){if("resize"===e)return function(t,e){if(fe.has(t))return;fe.set(t,e),ye.observe(t);let s=ye;return(e=!1)=>{s.unobserve(t),fe.delete(t),e&&(s=t=null)}}(s,r);if("outside"===e)switch(n[0]){case"mousedown":return function(e,s){return ge.push([e,s]),(r=!1)=>{t.remove(ge,(t=>t[0]===e&&t[1]===s))}}(s,r);case"dblclick":return function(e,s){return me.push([e,s]),(r=!1)=>{t.remove(me,(t=>t[0]===e&&t[1]===s))}}(s,r);default:return function(e,s){return _e.push([e,s]),(r=!1)=>{t.remove(_e,(t=>t[0]===e&&t[1]===s))}}(s,r)}else if("mutate"===e)return function(t,e,s){let r=N(s,"child"),n=N(s,"attr"),o=N(s,"char"),i=N(s,"tree"),a=we.get(t);if(!a)return a={},we.set(t,a),r&&(a[Ee.Child]=e),n&&(a[Ee.Attr]=e),o&&(a[Ee.Char]=e),i&&(a[Ee.Tree]=e),be.observe(t,{childList:r,attributes:n,characterData:o,subtree:i}),(e=!1)=>{we.delete(t),e&&(t=null)}}(s,r,n)}document.addEventListener("mousedown",(t=>{let e=u(t.composedPath(),0,t.target);ge.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"mousedown",event:t})}))}),!1),document.addEventListener("click",(t=>{let e=u(t.composedPath(),0,t.target);_e.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"click",event:t})}))}),!1),document.addEventListener("dblclick",(t=>{let e=u(t.composedPath(),0,t.target);me.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"dblclick",event:t})}))}),!1);const Ne=/,|^(debounce:.+)|(debounce$)/,Te=/,|^(throttle:.+)|(throttle$)/,Ce="native",ke={esc:"escape"},Me=()=>{};function Pe(t,e,s,r){let n,o=t.split("."),i=o.shift(),a=o.includes("once"),l=e??Me;if(n=T(o,(t=>Ne.test(t)))){let t=n.split(":");l=C(l,parseInt(t[1])||100)}if(n=T(o,(t=>Te.test(t)))){let t=n.split(":");l=k(l,parseInt(t[1])||100)}if(a&&(l=M(l)),s instanceof Ve&&(s!==r||o.includes(Ce)||o.push(Ce),!o.includes(Ce)))return s._addEvent(i,e);if(function(t){return pe.includes(t)}(i))return Se(i,s,l,o);let c=t=>{if(o.includes("prevent")&&t.preventDefault(),o.includes("stop")&&t.stopPropagation(),!o.includes("self")||t.target===t.currentTarget){if(t instanceof MouseEvent){if(o.includes("left")&&0!=t.button)return;if(o.includes("right")&&2!=t.button)return;if(o.includes("middle")&&1!=t.button)return}else if(t instanceof KeyboardEvent){if(P(o,(t=>"ctrl"==t))[0]&&!t.ctrlKey)return;if(P(o,(t=>"alt"==t))[0]&&!t.altKey)return;if(P(o,(t=>"shift"==t))[0]&&!t.shiftKey)return;if(P(o,(t=>"meta"==t))[0]&&!t.metaKey)return;let e=A(o,(t=>ke[t]||t));if(g(e)>0&&!e.includes(t.key.toLowerCase()))return}l(t)}},u={capture:o.includes("capture")||!1,passive:o.includes("passive")||!1};return s.addEventListener(i,c,u),(t=!1)=>{s.removeEventListener(i,c,u),t&&(s=null)}}const Ae={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},xe=new WeakMap;let De=[],Re=0;const Le=new WeakMap,Oe={},Ie="slots";class Ve extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(t){De=x(t.css,(t=>{if(r(t)){let e=new CSSStyleSheet;return e.replaceSync(t),e}return t instanceof CSSStyleSheet?t:[]})),t.global,E(t,((t,e)=>{D(e[0],/[A-Z]/)}))}#t;#e={};__data_={};#s={};#r;__updateTree;_eventBindList;_listerners={};__docoEventMap;__updateSubViewDeps;_cssUpdateInNextTick=!1;_cssVarOldValueMap;__cssSheets;_watchUpdateSetInNextTick;_watchUpdateArgsInNextTick;_computedUpdateSetInNextTick;get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#t}get attrs(){return this.#n}get props(){return this.#o}get renderRoot(){return this.#i?.deref()}get renderRoots(){return this.#a.flatMap((t=>t.deref()??[]))}get parentComponent(){return this.#l?.deref()}get wrapperComponent(){return this.__wrapperComponent?.deref()}get slots(){return Oe}get slotHooks(){return this.#c}get cssSheets(){return xe.get(this.constructor)}get globalCssSheet(){return Ve.__l_globalRule.sheet}get isMounted(){return this.#u}#n;#o;#i;#a;#l;__wrapperComponent;#h={};#c={};#d={};#u=!1;#p=!1;#f;static get css(){return[]}static get globalCss(){}static get hostCss(){}get cssVars(){return{}}__inited=!1;#g=!1;#_;__thisRef;constructor(...t){super(),this.#t=Re++,this.__updateTree=[],this.__thisRef=new WeakRef(this),this.#_=this.#m.bind(this),1===g(t)&&(this.#o={},R(this.#o,L(t))),Reflect.getOwnPropertyDescriptor(this.constructor.prototype,"slots")||Reflect.defineProperty(this.constructor.prototype,"slots",{get(){return Kt("slots",this)},set(t){qt("slots",t,this)}});let e=bt.get(this.constructor)??bt.get(jt(this.constructor));e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((t=>t.create(this))),this.#v=this.#y.bind(this)}insertStyleSheet(t){if(!this.#r)return null;let e;if(r(t)){e=new CSSStyleSheet;try{e.replaceSync(t)}catch(t){}}else{if(this.#r.adoptedStyleSheets.includes(t))return t;e=t}return this.#r.adoptedStyleSheets=[...this.#r.adoptedStyleSheets,e],e}get rootComponent(){let t=this;for(;t.parentComponent;)t=t.parentComponent;return t}#v;connectedCallback(){let t=i(this.parentNode,(t=>t instanceof Ve||t.host instanceof Ve),"parentNode");this.#l=t?t instanceof Ve?new WeakRef(t):new WeakRef(t.host):void 0,Ve.__l_globalRule.parentNode||document.head.appendChild(Ve.__l_globalRule);let e=u(this.constructor,"hostCss"),s=u(this.constructor,"hostCssSheet");if(e){s||(r(e)?(s=new CSSStyleSheet,s.replaceSync(e)):s=e,S(this.constructor,"hostCssSheet",s));let t=this.__wrapperComponent?.deref()?.shadowRoot??this.#l?.deref()?.shadowRoot??this.ownerDocument;this.__wrapperComponent&&!this.__wrapperComponent.deref()?.shadowRoot?.contains(this)&&(t=i(this,(t=>t instanceof HTMLDocument||t instanceof ShadowRoot),"parentNode")),t&&s&&!t.adoptedStyleSheets.includes(s)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,s])}this.__init(),this.__bindEvents()}disconnectedCallback(){this.__unbindEvents()}__bindEvents(){let t=this._eventBindList;E(t,(t=>{let[e,s,r,n]=t;if(n)return;if(!r)return;let o=Pe(e,s?s.bind(this):s,r,this);t[3]=o}));let e=_t.get(this.constructor);g(e)>0&&(this.__docoEventMap||(this.__docoEventMap=new Map),E(e,(({name:t,targetFn:e,fnName:s})=>{if(this.__docoEventMap.has(t+"@"+s))return;let r=e?e(this):this,n=u(this,s),o=Pe(t,n?n.bind(this):n,r,this);this.__docoEventMap.set(t+"@"+s,o)})))}__unbindEvents(){E(this._eventBindList,(t=>{let[,,,e]=t;e&&e(),t[3]=null}));let t=[];E(this.__docoEventMap,((e,s)=>{e&&e(),t.push(s)})),t.forEach((t=>this.__docoEventMap.delete(t)))}beforeDestroyed(){}destroyed(){}get isDestroyed(){return this.#E}#E=!1;destroy(){if(this.#E)return;this.#E=!0;let t=bt.get(this.constructor)??bt.get(jt(this.constructor));if(t&&t.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.destroy(this)})),this.beforeDestroyed(),this.__unbindEvents(),this._listerners=null,this.__docoEventMap?.clear(),this.__docoEventMap=this._eventBindList=null,It.get(this)?.clear(),It.delete(this),this._watchUpdateArgsInNextTick?.clear(),this._watchUpdateSetInNextTick?.clear(),this._computedUpdateSetInNextTick?.clear(),this._computedUpdateSetInNextTick=null,this.__cssSheets=null,this.__updateSubViewDeps?.clear(),this.#l){let t=this.#l.deref();t&&O(t.__updateTree,(e=>{e.__destroyed||e.node?.deref()===this&&(e.destroy(t),P(e.parent?e.parent.children:t.__updateTree,(t=>t===e)))}))}E(this.__updateTree,(t=>t?.destroy(this))),E(this.#h,(t=>{Le.delete(t),t.remove()})),E(this.#d,(t=>{E(t,(t=>t.remove()))})),E(this.__data_.slots,((t,e)=>{E(t,(t=>t.remove()))})),this.#w.clear(),this.#d=this.#h=this.#w=this.#e=this.__data_.slots=null,this.remove(),this._wrapperProp=this.#b=this.#i=this.#a=this.#r=this.#s=this.#n=this.#o=this.#i=this.#a=this.#c=this.#v=this.__data_=this.__updateTree=this.#l=this._asyncDirectives=this.__wrapperComponent=null,this.destroyed()}__init(){if(this.__inited)return;if(this.#g)return;this.#g=!0;let t=u(this.constructor,"globalCss");I(t)||!r(t)||u(this.constructor,"_globalRuleInserted")||(Ve.__l_globalRule.textContent+=t,S(this.constructor,"_globalRuleInserted",!0));let e=xe.get(this.constructor),s=e??[];e||(E(u(this.constructor,"css"),(t=>{if(r(t)){let e=new CSSStyleSheet;e.replaceSync(t),s.push(e)}else l(t)||s.push(t)})),xe.set(this.constructor,s));const n=this.#S();this.propsReady(n);for(const t in n){const e=n[t];this.__data_[t]=e}this.#N(),this.__data_.slots={},Reflect.defineProperty(this.__data_,"__isData",{enumerable:!1,value:!0});let i=jt(this.constructor);if(Ct.get(this.constructor)??Ct.get(i)){this._watchUpdateSetInNextTick=new Set,this._watchUpdateArgsInNextTick=new Map;let t=Nt.get(this.constructor)??Nt.get(i),e=Pt.get(this.constructor)??Pt.get(i);E(e,((e,s)=>{let r=u(this,s);e.forEach((t=>{t.call(this,r,void 0,s)})),t.has(s)&&t.set(s,!0)}))}let a=R({},yt.get(this.constructor),yt.get(i));if(a){this._computedUpdateSetInNextTick=new Set;let t=Lt.get(this.constructor);t?E(a,((t,e)=>{this[Vt][e]=t.call(this)})):(t=new Map,Lt.set(this.constructor,t),E(a,((e,s)=>{S(e,"key",s),Jt.start(),this[Vt][s]=e.call(this),Jt.end(),Jt.popVarPathList().forEach((s=>{let r=t.get(s);r||(r=new Set,t.set(s,r)),r.add(e)}))})))}Jt.start();let c=this.render();Jt.end();let h,d=Jt.popVarPathList();this.constructor.prototype._viewDeps||(this.constructor.prototype._viewDeps=d),null===c?(this.#a=[],this.#i=void 0):(this.#r=this.attachShadow({mode:"open"}),this.#r.adoptedStyleSheets=[...De,...xe.get(this.constructor)??[]],h=function(t,e){let s,r=[];if(is.has(e.constructor)){s=ps(r,is.get(e.constructor),cs(e,t),e)}else{let[n,o]=as(e,t);is.set(e.constructor,n),s=ps(r,n,o,e)}return e.__updateTree=r,s}(c,this),h&&(this.#a=V(h,(t=>t.nodeType===Node.ELEMENT_NODE)).map((t=>new WeakRef(t))),this.#i=this.#a[0])),this.__inited=!0,this.#T(),E(this.#c,((t,e)=>{this.#C(e)}));const p=this;let f=bt.get(this.constructor)??bt.get(jt(this.constructor));f&&f.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.beforeMount(this,((t,e)=>(p.__data_[t]=e,p.__data_[t])))})),this.beforeMount(),setTimeout((()=>{if(!this.isDestroyed){if(this.#u=!0,this.#r){Jt.start();let t=this.cssVars;if(Jt.end(),!I(t)){this._cssVarOldValueMap={};let e=Ot.get(this.constructor);e||(e=new Set(Jt.popVarPathList()),Ot.set(this.constructor,e));let s="";E(t,((t,e)=>{let r="--"+w(e).replace(/^-+/,"");(o(t)||W(t))&&(t="initial"),this._cssVarOldValueMap[r]=t,s+=";"+r+":"+t})),this.style.cssText+=s}}h&&this.#r.append(...h),f&&f.forEach((t=>{t.mounted(this,((t,e)=>(p.__data_[t]=e,p.__data_[t])))})),this.#f&&this.#f.forEach((t=>le.pushNext(t))),this.#p&&le.pushNext(this.#v),this.__bindEvents(),this.mounted()}}),0)}propsReady(t){}render(){return null}beforeMount(){}mounted(){}#m(t){let e=t.currentTarget,s="";E(this.#h,((t,r)=>{if(t===e)return s=r,!1})),this.__inited&&this.#k(e,s===dt?"":s)}#k(t,e){this.#T();let s=u(this.#e[e],"props");s&&E(this.slots,((t,e)=>{t.filter((t=>t.nodeType===Node.ELEMENT_NODE)).forEach((t=>{t instanceof Ve?t._updateProps(s):E(s,((e,s)=>{if(t instanceof HTMLSlotElement){let r=Le.get(t);if(r){let n=t.name||dt,o=r.#e[n];o||(o=r.#e[n]={props:{}}),o.props||(o.props={}),o.props[s]=e,r.#k(t,n)}}else t.setAttribute(s,e)}))}))})),this.slotChange(t,e)}slotChange(t,e){}attributeChangedCallback(t,e,s){if(!this.__inited)return;if(Object.is(s,e))return;"undefined"===s&&(s=null);let r=H(t);if(Ft(wt.get(this.constructor)[r].type)){let t=!U(s)&&zt(s);if(u(this,r)===t)return}this.#M(t,e,s)}shouldUpdate(t){return!0}updated(t){}_notify(t,e,s,r){let n=[];for(let o=0;o<e.length;o++){const i=e[o];n.push(i);let a=u(this,n),l=$t(n);this.#s[l]={value:a,chain:l===Ie?[Ie]:n,oldValue:t,end:n.length===e.length,subNewValue:s,subOldValue:r}}this.isMounted?le.pushNext(this.#v):this.#p=!0}#y(){if(g(this.#s)<1)return;if(!this.isMounted)return;const t=this.#s;if(this.#s={},!this.shouldUpdate(t))return;let e=bt.get(this.constructor)??bt.get(jt(this.constructor));e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((e=>{e.updated(this,t)}));let s=!1,r=new Set,n=this.constructor.prototype._viewDeps;if(E(t,((t,e)=>{if(!s&&n?.includes(e)&&(s=!0),this.__updateSubViewDeps?.has(e)){let t=this.__updateSubViewDeps.get(e);t&&t.forEach((t=>{r.add(t)}))}})),this._watchUpdateSetInNextTick?.forEach((t=>{let{newValue:e,oldValue:s,chain:r,rootObjNew:n,rootObjOld:o,fullMatch:i}=this._watchUpdateArgsInNextTick.get(t),a=i?e:n,l=i?s:o;t.call(this,a,l,r,e,s)})),this._watchUpdateSetInNextTick?.clear(),this._watchUpdateArgsInNextTick?.clear(),this._computedUpdateSetInNextTick?.forEach((t=>{let e=u(t,"key"),s=this.__data_[e],r=t.call(this);(a(r)||r!==s)&&(this.__data_[e]=r,this._notify(s,[e]))})),this._computedUpdateSetInNextTick?.clear(),this._cssUpdateInNextTick){let t=this.cssVars;E(t,((t,e)=>{let s="--"+w(e).replace(/^-+/,"");this._cssVarOldValueMap[s]!=t&&((o(t)||W(t))&&(t="initial"),this._cssVarOldValueMap[s]=t,this.style.setProperty(s,t+""))}))}this.#i?.deref()&&(s&&gs(this.render(),this,this.__updateTree,r),g(r)>0&&r.forEach((t=>{_s(t,this,void 0)}))),this.#w.forEach((t=>{this.#C(t)})),this.updated(t)}#S(){let t=wt.get(this.constructor)??wt.get(jt(this.constructor)),e=this.attributes,s=this.tagName,r=this.#o,o={};E(e,(({name:e,value:s})=>{if(e[0]===qe||e[0]===Qe||e[0]===Ye||e===ts||"slot"===e)return;let r=H(e);t&&!t[r]&&(o[e]=s)})),this.#n=this.#n?R(this.#n,o):o;let i={};if(!t)return i;let l=Object.keys(t),c=l.length;for(let o=0;o<c;o++){const c=l[o],h=w(c),d=this.hasAttribute(h);let p,g=t[c],_=b(r,c),m=u(this,c);if(!("_defaultValue"in g)&&(g._defaultValue=m,!g.type)){n(m)&&Ht(s,"Prop '"+c+"' has neither propType nor defaultValue be used for type inference");let t=typeof m;f(m)&&(t="array");let e=Ae[t];g.type=e}if(_)p=W(r[c])?m:r[c];else{p=m;let t=e.getNamedItem(h)||e.getNamedItem(Qe+h);t&&(_=!0,p=t.value)}if(g.required&&!_){Ht(s,"Prop '"+c+"' is required");break}p=this.#P(t,c,p,d),g.attribute&&B(p)&&!a(p)&&this.#A(g,c,p),this.__data_[c]=p,i[c]=p,delete this[c]}return i}#A(t,e,s){let r=w(e),n=$(s);Ft(t.type)?(n=zt(s),j(n)?n&&!this.hasAttribute(r)?this.toggleAttribute(r,!0):!n&&this.hasAttribute(r)&&this.toggleAttribute(r,!1):this.getAttribute(r)!==n&&this.setAttribute(r,n)):this.getAttribute(r)!==n&&this.setAttribute(r,n)}#x(t,e){let s=t;try{for(let r=0;r<e.length;r++){const n=e[r];s=n===Boolean?zt(t):n===Number?Number(t):n===String?String(t):n===Object||n===Array?F(t):n===Date?new Date(t):new n(t)}}catch(e){Ht(this.tagName,"Convert attribute error with "+t)}return s}#P(t,e,n,o){let i=t[e];if(!i)return n;let a=i.isValid,l=i.type,c=f(l)?l:[l],u=i.converter,h=n;if(!s(c,(t=>t===String))&&r(h)&&!U(h))try{h=u?u(h):this.#x(h,c)}catch(t){Ht(this.tagName,`Convert attribute '${e}' error with `+h)}for(let t=0;t<c.length;t++){"Boolean"===c[t].name&&o&&(h=zt(h))}if(W(h))return h;let d=typeof h,p=!B(h);for(let t=0;t<c.length;t++){const e=c[t];if(D(d,e.name,"i")||h instanceof e||Object.prototype.toString.call(h)===Object.prototype.toString.call(e.prototype)){p=!0;break}}return p||Ht(this.tagName,`Invalid prop '${e}'. expected '${c.map((t=>t.name||t))}' but got '${d}'`),a&&(a.call(this,h,this.__data_)||Ht(this.tagName,`Invalid prop '${e}'. IsValid() check failed`)),h}#N(){let t=Et.get(this.constructor)??Et.get(jt(this.constructor));t&&E(t,((e,s)=>{let r=t[s],n=u(this,s);if(r){let t=r.prop;n=t?z(this.__data_[t]):u(this,s)}this.__data_[s]=n,delete this[s]}))}#b=C(this.propsReady,100);_updateProps(t){let e=wt.get(this.constructor);if(!e)return;let s=[];E(t,((t,r)=>{let n=H(r),o=e[n];o&&(t=this.#P(e,n,t),o.attribute&&B(t)&&!a(t)&&s.push([o,n,t]),S(this,n,t))})),R(this.#o,t),s.forEach((([t,e,s])=>{this.#A(t,e,s)})),this.#o&&this.#b(this.#o)}_wrapperProp={};_initProps(t,e){this.#o=y(this.#o||{},t),this.#n=y(this.#n||{},e),E(t,((t,e)=>{if(a(t)){let s=ee.get(t);if(s){let t=s.join("-");this._wrapperProp[t]=e;let r=this.wrapperComponent?Et.get(this.wrapperComponent?.constructor):null,n=s[0];if(r&&r[n]){let t=wt.get(this.constructor);S(t,[e,"shallow"],r[n].shallow)}}}}))}_bindSlot(t,e,s){this.#h[e]||(this.#h[e]=t,Le.set(t,this));let r="slotchange",n=Pe(r,this.#_,t,this);if(this._eventBindList.push([r,this.#_,t,n]),!I(s)){let t=this.#e[e];t||(t=this.#e[e]={}),t.props=s}}_bindSlotHook(t,e){this.#c[t]=e}#w=new Set;_updateSlot(t,e,s){let r=this.#h[t],n=this.#c[t];if(!n&&!r)return;let o=this.#e[t];if(e&&(o.props||(o.props={}),o.props[e]=s),n)this.#w.add(t);else{let t=r.assignedElements({flatten:!0});for(let r=0;r<t.length;r++){t[r].setAttribute(e,s+"")}}}#T(){if(!this.#i)return;let t=G(this.#h);if(I(t))return;const e=x(this.childNodes,(t=>t.nodeType===Node.COMMENT_NODE?[]:t instanceof HTMLSlotElement?t.assignedNodes({flatten:!0}):t));let s=X(e,(e=>{if(e.nodeType===Node.TEXT_NODE&&t.includes(dt))return dt;if(e instanceof Element){let s=e.getAttribute("slot")||dt;if(t.includes(s))return s}}));if(I(s))return void(this.slots={});E(s,((t,e)=>{if(e){for(;t.length>0;){let e=t[0];if(!(e.nodeType===Node.TEXT_NODE&&o(e.textContent)||e instanceof HTMLSlotElement&&I(e.assignedNodes({flatten:!0}))))break;t.shift()}for(;t.length>0;){let e=K(t);if(!(e.nodeType===Node.TEXT_NODE&&o(e.textContent)||e instanceof HTMLSlotElement&&I(e.assignedNodes({flatten:!0}))))break;t.pop()}}}));let r={};E(s,((t,e)=>{I(t)||(r[e]=t)})),this.slots=r}#C(t){let e=this.#c[t];if(!e)return;let s=this.#e[t];if(!this.__data_.slots)return;if(!this.__data_.slots[t])return;this.renderAsync(e,u(s,"props"));const r=this._asyncDirectives.get(e);let n=r?.buildView(e(u(s,"props"))),o=q(d(n),(t=>t.nodeType===Node.COMMENT_NODE));if(o){let e=this.#d[t];if(!I(e))for(let t=0;t<e.length;t++){const s=e[t];s.parentNode?.removeChild(s)}this.#d[t]=o,this.append(...o),this.#w.clear()}}_asyncDirectives=new WeakMap;renderAsync(t,...e){}#M(t,e,s){if(!this.__inited)return;if(de(this.constructor).has(t)){let e=H(t);if(U(s)){let t=wt.get(this.constructor);t&&(s=t[e]._defaultValue)}this._updateProps({[e]:s})}}_regSubViewDeps(t,e){this.__updateSubViewDeps||(this.__updateSubViewDeps=new Map),t.forEach((t=>{let s=this.__updateSubViewDeps.get(t);s||(s=new Set,this.__updateSubViewDeps.set(t,s)),s.add(e)}))}_getPrivateData(){return this.__data_}emit(t,e={},s){s&&(e.event=s),e.target=this,b(this.#n,"emit-native")?this.dispatchEvent(new CustomEvent(t,{bubbles:!1,composed:!1,cancelable:!0,detail:e})):this._listerners[t]&&this._listerners[t](e)}_addEvent(t,e){this._listerners||(this._listerners={}),this._listerners[t]=e}nextTick(t){if(!this.isMounted)return this.#f||(this.#f=[]),void this.#f.push(t);le.pushNext(t)}forceUpdate(){E(this.__data_,((t,e)=>{this.#s[e]={value:void 0,chain:void 0}})),this.#y()}}class We{strings;vars;constructor(t,e){this.strings=h(t),this.vars=e}getKey(){let t=this.vars,e="";return E(this.strings,((s,r)=>{if(pt.test(s))return e=Q(t[r]),!1})),e}getKeys(){let t=this.vars,e=[];for(let s=0;s<this.strings.length;s++){const r=this.strings[s];if(pt.test(r)){let r=Q(t[s]);e.push(r)}}return I(e)&&t.forEach((t=>{if(t instanceof We){let s=t.getKey();e.push(s)}})),e}append(t){let e=K(this.strings);return t.strings.forEach(((t,s)=>{0!=s?this.strings.push(t):this.strings[this.strings.length-1]=e+t})),this.vars=h(this.vars,t.vars),this}insert(t,e){let s=e.strings.shift();return this.strings[t]+=s,this.strings.splice(t+1,0,...e.strings),this.vars.splice(t,0,...e.vars),this}getHTML(t){let[e,s]=as(t,this),r=ps([],e,s,t);return Y(r,((t,e)=>t+(e.nodeType==Node.TEXT_NODE?e.nodeValue:e.outerHTML??"")),"")}flatVars(t){let e=h(this.vars),s=this.strings.length-1,r=0;for(let n=0;n<=s;n++){let s=u(e,r,"");if(s instanceof We&&s.vars.length>0){let[n,o]=as(t,s);s=n,e.splice(r,1,...o),r+=o.length-1}r++}return e}destroy(){this.strings=this.vars=null}}var He,Ue;!function(t){t.ATTR="attr",t.PROP="prop",t.TEXT="text",t.CLASS="class",t.STYLE="style",t.SLOT="slot",t.TAG="tag"}(He||(He={})),function(t){t.NONE="NONE",t.REMOVE="REMOVE",t.REPLACE="REPLACE",t.UPDATE="UPDATE",t.APPEND="APPEND"}(Ue||(Ue={}));class Be{key;varIndex;value;node;attrName;attrTmpl;isText=!1;isDirective=!1;isComponent=!1;isProp=!1;isToggleProp=!1;isPlaceholder;__destroyed=!1;directiveOldValue;children;parent;constructor(t,e,s,r){this.varIndex=t,e&&(this.node=e),s&&(this.attrName=s),r&&(this.attrTmpl=r)}static createFrom(t){let e=new Be(t.varIndex,t.node,t.attrName,t.attrTmpl);return e.key=t.key,e.value=t.value,e.isText=t.isText,e.isDirective=t.isDirective,e.isComponent=t.isComponent,e.isProp=t.isProp,e.isToggleProp=t.isToggleProp,e.isPlaceholder=t.isPlaceholder,e}destroy(t){if(this.__destroyed)return;this.__destroyed=!0;let e=this.node,s=this.children;this.parent;if(this.node=this.value=this.directiveOldValue=this.children=this.parent=null,!e)return;let r=s;r?.forEach(((e,s)=>{e.destroy(t)})),e instanceof Ve&&e.destroy(),t&&Gt.clear(e.deref(),t),e.deref()?.remove()}insert(t){t.parent=this,this.children||(this.children=[]),this.children.push(t)}}const $e=new WeakMap,je=new Map;var Fe;!function(t){t.AFTER_BEGIN="afterbegin"}(Fe||(Fe={}));let ze={};function Ge(t,e,s,r,n,o,i,a){let l;if([He.TEXT,He.SLOT].includes(u(r,"__scope",""))?(Jt.start(),l=r(t,e,s,{renderComponent:n,slotComponent:o,varChain:i}),Jt.end(n,a)):l=r(t,e,s,{renderComponent:n,slotComponent:o,varChain:i}),!l)return;let[c,h]=l;if(c===Ue.NONE)return;let p=$e.get(t),f=Gt.getNodes(p,t),g=a.children;if(c===Ue.REMOVE){for(let t=0;t<f.length;t++){const e=f[t];e.remove(),e instanceof Ve&&e.destroy()}g?.forEach(((t,e)=>{t.destroy(n)}))}else if(c===Ue.REPLACE){let e=[];for(let t=0;t<f.length;t++){const e=f[t];e.parentNode?.removeChild(e),e instanceof Ve&&e.destroy()}g?.forEach(((t,e)=>{t.destroy(n)}));let s=fs(t,h,n,a,!0);e=d(s);let r=document.createDocumentFragment();r.append(...e),t.parentNode.insertBefore(r,t)}else if(c===Ue.UPDATE){let e,s={},r=[],o=[];if(h||(h=new We([],[])),I(f)){let e=fs(t,h,n,a,!0);return void p.after(...e)}let i={};h instanceof We&&h.vars.forEach((t=>{if(t instanceof We){const e=t.getKey();i[e]=t,s[e]=!0,o.push(e)}})),f=V(Z(f),(t=>t.nodeType===Node.ELEMENT_NODE)),e=V(Z(d(e)),(t=>t.nodeType===Node.ELEMENT_NODE));let l={},c="",u={};for(let t=0;t<f.length;t++){let e=f[t],s=e.getAttribute("key");if(!W(s)){if(l[s]){c=s;break}l[s]=e,r.push(s),u[s]=!0}}if(c)return void Wt(`${H(t.nodeValue)} - duplicate key '${c}'`);let _=s,m=[],v=[];E(u,((t,e)=>{_[e]||(v.push(e),delete u[e],P(r,(t=>t===e)))}));let y,w=!1;if(!I(o)){let t=-1,e=[],s=[],n=0,i=0;for(;i<o.length;i++){const a=o[i];let c=r.findIndex((t=>t===a));if(c<0){let t=o[i-1],e=t?l[t]||t:p;m.push({prevNode:e,newkey:a}),n++}else if(c>-1&&c!==i-n){if(t<0||1===Math.abs(t-c)){let t=K(e);e.push({nodeId:a,targetId:0===i?Fe.AFTER_BEGIN:t?t.nodeId:o[i-1]})}else s.push({moveGroup:e,moveIndex:i+e.length}),e=[],e.push({nodeId:a,targetId:o[i-1]});t=c}}if(e.length>0&&s.push({moveGroup:e,moveIndex:i+e.length}),s.length>0){w=!0;let t=s.sort(((t,e)=>t.moveGroup.length-e.moveGroup.length));if(t.length<2){let{moveGroup:e}=t[0];if(e.length>1){let t=K(e).targetId;e[e.length-2].nodeId===t&&(e=J(e))}e.forEach((({targetId:t,nodeId:e})=>{let s,r=l[e];t===Fe.AFTER_BEGIN?(s=p,s.after(r)):l[t]&&(s=l[t],s.after(r))}))}else{let e=K(t).moveIndex;1===Math.abs(t[t.length-2].moveIndex-e)&&(t=J(t)),t.forEach((({moveGroup:t})=>{t.forEach((({targetId:t,nodeId:e})=>{let s,r=l[e];t===Fe.AFTER_BEGIN?(s=p,s.after(r)):(s=l[t],s.after(r))}))}))}}}if(v.forEach((t=>{let e=l[t];if(e&&e.parentNode){l[t]=null,e.remove();let s=P(g,(e=>e.key==t));s.forEach((t=>t.destroy(n)))}})),m.length>0&&(y=function(t,e,s,r,n,o){const i=[],a=[],l=[];let c,u=[];t.forEach((t=>{let s=K(u);s&&c===t.prevNode?(s.group||(s.group=[c]),s.group.push(t.newkey)):u.push(t),c=t.newkey;let r=t.newkey;l.push(r),i.push(""),a.push(e[r])})),i.push("");let h=fs(r,new We(i,a),s,o,!0),d=new Map;return h.forEach((t=>{const e=t.getAttribute("key");l.includes(e)&&(d.set(e,!0),n[e]=t)})),u}(m,i,n,t,ze,a),y.forEach(((e,s)=>{let r=e.newkey,n=ze[r],o=e.prevNode;if(e.group){let t=document.createDocumentFragment();t.append(...A(e.group,(t=>ze[t]))),n=t}o===t?o.before(n):o===p?o.after(n):"string"==typeof o?ze[o].after(n):o.after(n)})),ze=null,ze={}),h.vars[0]instanceof We){let t=[],e=[];E(h.vars,(s=>{e.push(...s.vars),t.push(...A(s.vars,(t=>"1")))})),t.push("1"),h=new We(t,e)}if(w||v.length>0||y){const t=X(g,(t=>t.key));let e=[],s=0;o.forEach((r=>{t[r]&&t[r].forEach((t=>{t.varIndex=s++,e.push(t)}))})),tt(g,e).forEach((t=>t.destroy(n))),a.children=e}_s(a,n,h)}}let Xe=0;function Ke(t,e){let s=t.name||"Di-"+Xe++,r=Symbol.for(s);return(...n)=>{let o=t(...n);return(N(e,He.TEXT)||N(e,He.SLOT))&&je.set(s,o),S(o,"__scope",e[0]),[r,n,o,(t,e)=>{},Jt.popDirectiveQ()]}}const qe="@",Qe=".",Ye="?",Ze="*",Je=":",ts="ref",es="key",ss=/(<\/?)\s*([A-Z][A-Za-z0-9]*)([\s>])/gm,rs=/\s+([\.?@*])?((?:[a-zA-Z]*[A-Z][^\s<>="']+))(?=[\s=>])/gm,ns=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,os="slot-props",is=new Map;function as(t,e){let s="",r=h(e.vars),n=e.strings.length-1,o=e.vars.length-1,i=0;for(let a=0;a<=n;a++){const n=e.strings[a];let l=u(r,i,"");if(l instanceof We){let[e,s]=as(t,l);l=e,r.splice(i,1,...s),i+=s.length-1}else l=a>o?"":us;i++,s=s+n+l}let a=0;return s=s.replace(ns,((t,e)=>ot(t,us,(()=>us.replace("--\x3e","")+a++)))),s=s.replace(vs,"$1><").trim(),s=ls(s),[s,r]}function ls(t){return r(t)?t=(t=t.replace(rs,((t,e,s)=>` ${e??""}${w(s)}`))).replace(ss,((t,e,s,r)=>e+mt[s]+r)):t+""}function cs(t,e){let s=h(e.vars),r=e.strings.length-1;for(let n=0;n<=r;n++){let r=u(e.vars,n,"");if(r instanceof We){let e=cs(t,r);s.splice(n,1,...e)}}return s}const us="\x3c!--c_ui-pl_df--\x3e",hs="\x3c!--c_ui-pl_df",ds=/<!--c_ui-pl_df\d*(-->)?/;function ps(t,e,s,r){const n=document.createElement("div");n.innerHTML=e;let o=r._eventBindList;o||(o=r._eventBindList=[]);const i=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let a,l,u=0,h=null,d="";for(;a=i.nextNode();){if(l&&!l.contains(a)&&(l=void 0),a instanceof HTMLElement||a instanceof SVGElement){a instanceof Ve&&(l=a);let e={},n=A(a.attributes,(t=>({name:t.name,value:t.value})));for(let i=0;i<n.length;i++){const g=n[i];let{name:_,value:m}=g;if(_!==os)if(c(_,hs)){let e=s[u];if(f(e)&&p(e[0])){let[,s,n,o,i]=e;o(He.TAG,r.tagName);let c=new Be(u,new WeakRef(a));c.isDirective=!0,c.value=e,c.isComponent=!!l,t.push(c),h&&h?.contains(a)&&(c.key=d),u++,n(a,s,void 0,{renderComponent:r,slotComponent:l,varChain:i})}a.removeAttribute(_)}else if(_[0]!==qe)if(_!==ts)if(_!==es){if(ds.test(m)){let n=s[u],o=new Be(u,new WeakRef(a),_.replace(/\.|\?|@/,""),m);if(o.isComponent=!!l,h&&h?.contains(a)&&(o.key=d),_[0]===Qe||_[0]===Ye||_[0]===Ze){if(f(n)&&p(n[0])){let[,t,e,s,i]=n,c=He.PROP,u=_.substring(1);u!==He.STYLE&&u!==He.CLASS||(c=u),s(c,r.tagName),e(a,t,void 0,{renderComponent:r,slotComponent:l,varChain:i,attrName:u}),o.value=n,o.isDirective=!0}else if(_[0]===Ye){o.isToggleProp=!0,o.value=!!n;let t=_.substring(1);o.value&&a.setAttribute(t,n)}else if(_[0]===Ze){o.value=n;let t=_.substring(1);const[e,s]=t.split(Je);let r=e;switch(s){case"camel":r=H(r);break;case"kebab":r=w(r);break;case"snake":r=it(r)}o.attrName=r,a.setAttribute(r,n)}else{let t=H(_.substring(1));o.value=n,o.isProp=!0,e[t]=n}a.removeAttribute(_),n=""}else{let t,e;if(o.value=n,f(n)&&p(n[0])){He.ATTR,_===He.CLASS?He.CLASS:_===He.STYLE&&He.STYLE;let[,s,r,i]=n;o.isDirective=!0,o.attrName=_,e=s,t=r,n=""}m=nt(m,ds,n),a.getAttributeNode(_).value=m,B(m)&&a.setAttribute(_,m),t&&t(a,e,void 0,{renderComponent:r,slotComponent:l})}t.push(o),u++}}else{let e=s[u];a.setAttribute(_,e);let r=new Be(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=d),t.push(r),u++,h=a,d=e,t.length>0&&t.forEach((t=>{t.key=t.key??e}))}else{if(ds.test(m)){let e=s[u],r=new Be(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=d),t.push(r),u++,e.__setRef(new WeakRef(a))}a.removeAttribute(_)}else{let e;if(ds.test(m)){let r=new Be(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=d),t.push(r),e=s[u],u++}let r=_.substring(1);o.push([r,e,a]),a.removeAttribute(_)}}a instanceof Ve?(_=r,a.__wrapperComponent=new WeakRef(_),g(e)>0&&a._initProps(e)):a instanceof HTMLSlotElement&&r._bindSlot(a,a.name||"default",e)}else{let e=a;if(`\x3c!--${e.nodeValue}--\x3e`!==us)continue;let n=new Be(u,new WeakRef(a));h&&h?.contains(a)&&(n.key=d),t.push(n),n.isComponent=!!l,n.isText=!0;let o=s[u];if(f(o)&&p(o[0])){const t=Symbol.keyFor(o[0]);let s;s=document.createComment(`compelem-${r.tagName}-${t}-start`),e.parentNode.insertBefore(s,e),e.nodeValue=`compelem-${r.tagName}-${t}-end`,e._diName=t,$e.set(e,s),n.isDirective=!0,n.value=o;let i=l?He.SLOT:He.TEXT,[,a,c,u,h]=o;u(i,r.tagName),n.directiveOldValue=[a,h],Jt.start();let d=c(e,a,void 0,{renderComponent:r,slotComponent:l,varChain:h});if(Jt.end(r,n),d){let t=fs(e,d[1],r,n),s=t.length;t&&s>0&&Gt.insertBefore(e,Array.from(t))}o=void 0}else n.value=o,n.node=null;if(u++,!n.isDirective){let t=Q(o??""),s=document.createTextNode(t);e.parentNode.insertBefore(s,e),e.remove(),a=s,n.node=new WeakRef(s)}}h&&!h.contains(a)&&h!==a&&(h=null,d="")}var _;return n.childNodes}function fs(t,e,s,r,n=!1){let[o,i]=as(s,e),a=[],l=ps(a,o,i,s);return n&&s.__bindEvents(),a.forEach((t=>{r.insert(t)})),l}function gs(t,e,s,r){if(o(et(t.strings)))return;let n=t.flatVars(e);for(let t=0;t<s.length;t++){const o=s[t];let i=o.varIndex;if(i<0)continue;if(o.isPlaceholder)continue;if(o.__destroyed)continue;let l=o.value,c=n,h=o.node.deref();if(!h)continue;let d=st(i,"-");for(let e=0;e<d.length;e++){const s=d[e];c=u(c,s),c&&c.vars&&t<d.length-1&&(c=c.vars)}if(!a(l)&&l===c)continue;let p=h;if(o.isDirective){if(r?.has(o))continue;let[,t,s,,n]=o.value;if(!f(c))continue;let i=Xt(h,e),[,a]=c;Ge(h,a,t,s,e,i,n,o)}else if(o.isToggleProp){if(!!c===l)continue;p.toggleAttribute(o.attrName,!!c),S(p,o.attrName,!!c)}else if(o.isProp){if(!a(c)&&c===l)continue;h instanceof Ve?h._updateProps({[o.attrName]:c}):h instanceof HTMLSlotElement&&e._updateSlot(h.getAttribute("name")||"default",o.attrName,c)}else if(o.attrName){if(!rt(l,c))switch(o.attrName){case"value":if(h instanceof HTMLInputElement){h.value=c;break}default:h.setAttribute(o.attrName,nt(o.attrTmpl,ds,c+""))}}else if(o.isText){o.node.deref().textContent=Q(c??"")}o.value=c}}function _s(t,e,s){if(!t||t.__destroyed)return;let r=t.node.deref();const n=je.get(r._diName);let o=Xt(r,e);const[i,a]=t.directiveOldValue;if(!s){let l=n(r,t.value[1],i,{renderComponent:e,slotComponent:o,varChain:a});if(!l)return;s=l[1]}if(s){if(s.vars[0]instanceof We){let t=[],e=[];E(s.vars,(s=>{e.push(...s.vars),t.push(...A(s.vars,(t=>"1")))})),t.push("1"),s=new We(t,e)}gs(s,e,t.children)}}function ms(t,...e){return new We(r(t)?[t]:t,e)}const vs=/([a-z0-9"'])\s*>\s*</gim;class ys{__ref;get current(){return this.__ref?.deref()}__setRef(t){this.__ref=t}}function Es(){return new ys}var ws;!function(t){t.CLASS="class",t.FIELD="field",t.METHOD="method"}(ws||(ws={}));class bs{static get priority(){return 0}created(t,...e){}beforeMount(t,e,...s){}mounted(t,e,...s){}updated(t,e){}beforeDestroy(t,...e){}}class Ss{metadata;decorator;key;priority=0;constructor(t,e,s){this.metadata=e,this.decorator=new s(...t),this.priority=u(s,"priority",0)}dispose(){this.metadata=null,this.decorator=null}create(t){let e,s=this.decorator.targets,r=this.metadata[1];a(r)&&B(u(r,"configurable"))?e=ws.METHOD:n(this.metadata[1])&&(e=ws.FIELD),!I(s)&&e&&s.includes(e)?this.decorator.created(t,...this.metadata):Wt(`Decorator '${this.decorator.constructor.name}' is out of targets, expect '${s.join(",")}' bug got '${e}'`)}beforeMount(t,e){this.decorator.beforeMount(t,e,...this.metadata)}mounted(t,e){this.decorator.mounted(t,e,...this.metadata)}updated(t,e){this.decorator.updated(t,e)}destroy(t){this.decorator.beforeDestroy(t,...this.metadata)}}function Ns(t){return(...e)=>(...s)=>{let r=s[0].constructor,n=bt.get(r);if(!bt.has(r)){let t=Object.getPrototypeOf(r);n=t?h(bt.get(t)??[]):[],bt.set(r,n)}let o=new Ss(e,s.splice(1),t);return n?.push(o),o}}function Ts(t){return(...e)=>{if(!e||e.length<1)return;let s=e[0].constructor,r=bt.get(s);if(!bt.has(s)){let t=Object.getPrototypeOf(s);r=t?h(bt.get(t)??[]):[],bt.set(s,r)}let n=new Ss([],e.splice(1),t);return r?.push(n),n}}function Cs(t,e,s){return s.get||Wt(`Computed '${e}' must be a getter`),yt.has(t.constructor)||yt.set(t.constructor,{}),yt.get(t.constructor)[e]=s.get,delete t[e],Reflect.defineProperty(t,e,{get(){return Jt.__collecting&&Jt.__varPathList.push(e),Reflect.get(this[Vt],e)}}),Reflect.getOwnPropertyDescriptor(t,e)}const ks=Ns(class extends bs{static get priority(){return Number.MAX_VALUE}created(t,e,...s){let r=u(t,e);S(t,e,C(r,this.wait,this.immediate)),S(t,e+"_$__",r)}beforeDestroy(t,e){S(t,e,null),S(t,e+"_$__",null)}get targets(){return[ws.METHOD]}wait;immediate;constructor(t,e=!1){super(),this.wait=t,this.immediate=e}});function Ms(t,e){return(s,r,n)=>{if(!_t.has(s.constructor)){let t=[],e=s.constructor;for(;(e=jt(e))!==Ve;)t=h(t,_t.get(e)??[]);_t.set(s.constructor,t)}_t.get(s.constructor)?.push({name:t,targetFn:e,fnName:r})}}const Ps=Ns(class extends bs{static get priority(){return Number.MAX_VALUE}created(t,e,s,...r){let n=at(u(t,s),t);S(t,s,M(n)),S(t,s+"_$__",n)}beforeDestroy(t,e){S(t,e,null),S(t,e+"_$__",null)}get targets(){return[ws.METHOD]}});var As;!function(t){t.ONCE="once"}(As||(As={}));const xs=new WeakMap;class Ds extends bs{static get priority(){return Number.MAX_VALUE}get targets(){return[ws.FIELD]}selector;cache;constructor(t,e){super(),this.selector=t,this.cache=e}static getKey(t){return t}getter(t){let e=t?.shadowRoot?.querySelector(this.selector),s=xs.get(t);s||(s=new Map,xs.set(t,s)),s.set(this.selector,e)}mounted(t,e,s,...r){const n=this;let o=new WeakRef(t);Reflect.defineProperty(t,s,{configurable:!0,get(){let t=o.deref();return xs.has(t)&&xs.get(t)?.has(n.selector)&&n.cache===As.ONCE||n.getter(t),xs.get(t)?.get(n.selector)}})}beforeDestroy(t,e){xs.get(t)?.clear(),xs.delete(t)}updated(t,e){this.cache!==As.ONCE&&this.getter(t)}}const Rs=Ns(Ds),Ls=Ns(class extends Ds{getter(t){let e=t.shadowRoot?.querySelectorAll(this.selector),s=xs.get(t);s||(s=new Map,xs.set(t,s)),s.set(this.selector,e)}});function Os(t){if(1===arguments.length)return(e,s)=>{Is(e,s,t)};Is(arguments[0],arguments[1],{prop:""})}function Is(t,e,s){if(!Et.has(t.constructor)){const e={};let s=t.constructor;for(;(s=jt(s))!==Ve;)y(e,Et.get(s)??{});Et.set(t.constructor,e)}if(s.shallow=s.shallow||!1,S(Et.get(t.constructor),e,s),s.hasChanged){let r=Rt.get(t.constructor);r||(r=new Map,Rt.set(t.constructor,r)),r.set(e,s.hasChanged)}if(s.shallow){let s=xt.get(t.constructor);s||(s=new Set,xt.set(t.constructor,s)),s.add(e)}Reflect.defineProperty(t.constructor.prototype,e,{get(){return Kt(e,this)},set(t){qt(e,t,this)}})}function Vs(t,e,s){Is(t.prototype,e,s||{prop:""})}function Ws(t){return e=>{e&&(mt[e.name]=t,vt[t]=e)}}const Hs=Ns(class extends bs{static get priority(){return Number.MAX_VALUE}created(t,e,...s){let r=u(t,e);S(t,e,k(r,this.wait)),S(t,e+"_$__",r)}beforeDestroy(t,e){S(t,e,null),S(t,e+"_$__",null)}get targets(){return[ws.METHOD]}wait;constructor(t){super(),this.wait=t}});function Us(t,e){return(s,r)=>{let n=Mt.get(s.constructor),o=kt.get(s.constructor),i=Nt.get(s.constructor),a=Tt.get(s.constructor),l=Ct.get(s.constructor),c=Pt.get(s.constructor);if(!l){l=[],Ct.set(s.constructor,l),a=[],Tt.set(s.constructor,a),i=new Map,Nt.set(s.constructor,i),n={},Mt.set(s.constructor,n),o={},kt.set(s.constructor,o),c={},Pt.set(s.constructor,c);let t=jt(s.constructor);for(;t;)Ct.has(t)&&(l.push(...Ct.get(t)),a.push(...Tt.get(t)),Nt.get(t)?.forEach(((t,e)=>{i.set(e,t)})),R(n,Mt.get(t)),R(o,kt.get(t)),R(c,Pt.get(t))),t=jt(t)}(f(t)?t:[t]).forEach((t=>{let h=s[r];u(e,"once",!1)&&i.set(t,!1);let d=u(e,"deep",!1);if(l.push(t),d?(n[t]=n[t]??new Set,n[t].add(h),a.push(t)):(o[t]=o[t]??new Set,o[t].add(h)),u(e,"immediate",!1)){let e=c[t];e||(e=c[t]=new Set),e.add(h)}}))}}const Bs=["key"],$s=Ke((function(t){return(t,[e],s)=>{let r=t;if(s)E(e,((t,e)=>{r.setAttribute(e,t)}));else if(r instanceof Ve){let t={},s={},n=wt.get(r.constructor);E(e,((e,r)=>{if(Bs.includes(r))return;let o=H(r);(n?n[o]:void 0)?t[r]=e:s[r]=e+""})),r._initProps(t,s)}else E(e,((t,e)=>{r.setAttribute(e,t)}))}}),[He.TAG]),js=new WeakMap,Fs=Ke((function(t){return(t,[e],s,{renderComponent:n})=>{let o=[];if(f(e)?o=Z(e):a(e)?o=x(e,((t,e)=>t?e:[])):r(e)&&(o=e.split(" ")),o.length<1&&!s)return;let i=t;if(js.get(i)&&js.get(i).length===o.length&<(js.get(i),o))return;let l=js.get(i);E(l,(t=>{i.classList.remove(t)})),E(o,(t=>{i.classList.add(t)})),l=h(o),js.set(i,l)}}),[He.CLASS]),zs=new WeakMap,Gs=new WeakMap,Xs=Ke((function(t,e){return(t,e,s,{varChain:r})=>{let n=t,o=function(t,e,s){let r=A(t,((t,s)=>e(t,s)));if(r.length<1){let t=new We([],[]);return Gs.set(s,t),t}let n=[],o=[];const i=[],a=[];for(let t=0;t<r.length;t++){const e=r[t];let s=K(o),l=e.vars,c=!0,u=e.strings;for(let t=0;t<u.length;t++){const e=u[t];if(pt.test(e)){let e=l[t]+"";if(n.includes(e))return void Wt(`forEach - duplicate key '${e}'`);n.push(e),c=!1}0==t&&s?o[o.length-1]=s+e:o.push(e)}if(c)return void Wt("forEach - missing 'key' prop");let h=K(i);h&&u.length>0&&(i[i.length-1]=$(h)+u.shift()),i.push(""),a.push(e)}i.push("");let l=new We(i,a);return Gs.set(s,l),l}(e[0],e[1],n);if(s&&s[0]){const s=zs.get(n);let r=$e.get(t),i=Gt.getNodes(r,t);if(I(i)&&(!e||I(e[0])))return[Ue.NONE,o];if(s&<(s,e[0])&&s.length===e[0].length)return[Ue.NONE,o]}return zs.set(n,ct(e[0])),s?[Ue.UPDATE,o]:[Ue.APPEND,o]}}),[He.TEXT,He.SLOT]);let Ks=document.createElement("div");const qs=Ke((function(t){return(t,e,s,{renderComponent:r,slotComponent:n})=>{s&&e[0]==s[0]||W(e[0])||(Ks.innerHTML=ls(e[0]),t.after(...Ks.childNodes))}}),[He.TEXT,He.SLOT]),Qs=Ke((function(t){return(t,e,s,{renderComponent:r,slotComponent:n})=>{s&&e[0]==s[0]||W(e[0])||(t.innerHTML=ls(e[0]))}}),[He.TAG]),Ys=new WeakMap,Zs=Ke((function(t,e,s){return(t,[e,s,r],n,{renderComponent:o})=>{let i=t;if(n){if(!!e==!!n[0]){let t=Ys.get(i);return[Ue.NONE,t.call(o,e)]}let t=e?s:r;return Ys.set(i,t),[Ue.REPLACE,t.call(o,e)]}{let t=e?s:r;return Ys.set(i,t),[Ue.APPEND,t.call(o,e)]}}}),[He.TEXT,He.SLOT]),Js=Ke((function(t,e){return(t,[e,s],r)=>r?e===r[0]?[Ue.NONE,e?s():ms``]:e?[Ue.REPLACE,e?s():ms``]:[Ue.REMOVE]:[Ue.APPEND,e?s():ms``]}),[He.TEXT,He.SLOT]);var tr;!function(t){t.CHANGE="change",t.INPUT="input"}(tr||(tr={}));const er=Ke((function(t,s="value",n){return(t,[s,n,o],i,{varChain:l,renderComponent:c})=>{n=n??"value";const h=t;if(i){const t=i[0],e=s;if(!a(e)&&Object.is(e,t))return;if(h instanceof Ve)h._updateProps({[n]:e});else if(h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement){if(h.setAttribute(n,e+""),h instanceof HTMLSelectElement){let t=T(h.querySelectorAll("option"),(t=>t.value==e));t&&(t.selected=!0)}}else if(h instanceof HTMLInputElement){if(h.value==e)return;switch(h.type){case"checkbox":case"radio":e?h.setAttribute("checked",""):h.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":h.setAttribute(n,e+""),S(h,n,e);break;default:h.setAttribute(n,e+"")}}return}let d;d=r(o)?e(o)[0]:K(l);const p=st(d,".")[0];p in c||c._wrapperProp[p]||Wt(`model - property '${p}' is not defined on the instance of `+c.tagName);let f=c._eventBindList;if(a(s)||$(s)||(s=""),h instanceof Ve){h._initProps({[n]:s});let t="update:"+n;f.push([t,function(t){let e=this,s=e._wrapperProp[p];!(p in e)&&s&&u(e.wrapperComponent,p)===u(e,s)&&(e=e.wrapperComponent||e),S(e,d,t.value)},h])}else if(h instanceof HTMLTextAreaElement){h.setAttribute(n,s+"");let t="input";f.push([t,function(t){let e=t.target;S(this,d,e.value)},h])}else if(h instanceof HTMLInputElement){let t="",e="";switch(h.type){case"checkbox":case"radio":t="checked",e="change";break;default:t="value",e="input"}h.setAttribute(n??t,s+""),f.push([e,function(t){let e=t.target;S(this,d,e.value)},h])}else h instanceof HTMLSelectElement&&(h.setAttribute(n,s+""),f.push(["change",function(t){let e=t.target,s=this,r=s._wrapperProp[p];!(p in s)&&r&&u(s.wrapperComponent,p)===u(s,r)&&(s=s.wrapperComponent||s),S(s,d,e.value)},h]))}}),[He.TAG]),sr=new WeakMap,rr=Ke((function(t,e){return(t,[e,s],r)=>{if(r&&e===r[0])return;let n=t;if(!sr.has(n)){let t=n.style.display;sr.set(n,"none"==t?"unset":t)}n.style.display=e?sr.get(n):"none",s&&s(n,e)}}),[He.TAG]),nr=Ke((function(t,e){return(t,[e,s],r,{renderComponent:n,slotComponent:o})=>{r||(e=e.bind(n),o._bindSlotHook(s||"default",e))}}),[He.SLOT]);class or{static getCssText(t,e=!1){return r(t)?t:et(A(t,((t,s)=>s.startsWith("--")?s+":"+t+(e?" !important":""):w(s)+":"+t+(e?" !important":""))),";")+";"}static setStyle(t,e){if(r(t)&&!$(t))return;let s=or.getCssText(t);e.style.cssText=s}}const ir=Ke((function(...t){return(t,e,s,{renderComponent:r})=>{let n=t,o=Y(e,((t,e)=>t+or.getCssText(e)),""),i=Z(o.split(";").map((t=>t.split(":")[0]))),a=Z(n.style.cssText.split(";")),l=q(a,(t=>i.some((e=>t.trim().startsWith(e)))));n.style.cssText=o+l.join(";")}}),[He.STYLE]),ar=Ke((function(t){return(t,e,s,{renderComponent:r,varChain:n,attrName:o})=>{const i=t;if(s)return void(rt(e,s)||i._updateProps({[o]:e[0]}));let a=K(n);i._initProps({[o]:e[0]}),i.addEventListener("update:"+o,(t=>{S(r,a,t.detail.value)}))}}),[He.PROP]),lr=new WeakMap,cr=Ke((function(t,e){return(t,[e,s],r)=>{let n=()=>ms``,o=[],i=[];E(s,((t,e)=>{if(l(t))o.push(e),i.push(t);else{let e=t[0],s=t[1];o.push(e),i.push(s)}"default"===e&&(n=t)}));let a=ut(o,(t=>l(t)?t(e):t==e)),c=lr.get(t);return lr.set(t,a),r?c==a?[Ue.UPDATE,ht(i[a]??n)]:[Ue.REPLACE,ht(i[a]??n)]:[Ue.APPEND,ht(i[a]??n)]}}),[He.TEXT,He.SLOT]);function ur(){E(vt,((t,e)=>{customElements.define(e,t)}))}export{Ve as CompElem,or as CssHelper,$e as DI_COMMENT_START_NODE_MAP,bs as Decorator,ws as DecoratorType,Ss as DecoratorWrapper,Ue as DirectiveUpdateTag,Gt as DomUtil,He as EnterPointType,tr as ModelTriggerType,As as QueryCache,We as Template,je as TextOrSlotDirectiveExecutorMap,Be as UpdatePoint,de as _getObservedAttrs,jt as _getSuper,$t as _toUpdatePath,$s as bind,as as buildHTML,Fs as classes,Cs as computed,Es as createRef,ks as debounced,Ns as decorator,Ts as decoratorWithNoArgs,Ke as directive,Ms as event,Xs as forEach,zt as getBooleanValue,Xt as getSlotComponent,ms as html,qs as htmlC,Qs as htmlD,Zs as ifElse,Js as ifTrue,Ft as isBooleanProp,Vs as makeState,er as model,Ps as onced,ce as prop,Rs as query,Ls as queryAll,ur as regComponents,rr as show,Wt as showError,Ht as showTagError,Bt as showTagWarn,Ut as showWarn,nr as slot,Os as state,ir as styles,ar as sync,Ws as tag,Hs as throttled,Ge as updateDirective,Us as watch,cr as when};
|
package/package.json
CHANGED
package/render/render.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare function updateSubScopeView(subScopeUpdatePoint: UpdatePoint, ren
|
|
|
31
31
|
*/
|
|
32
32
|
export declare function html(strings: TemplateStringsArray, ...vars: any): Template;
|
|
33
33
|
declare class RefObject<T extends Node> {
|
|
34
|
-
|
|
34
|
+
__ref: WeakRef<T> | undefined;
|
|
35
35
|
get current(): T | undefined;
|
|
36
36
|
__setRef(ref: WeakRef<T>): void;
|
|
37
37
|
}
|
package/types.d.ts
CHANGED