ezh 0.1.1 → 0.1.3
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/lib/bundle.min.js +1 -1
- package/lib/index.d.ts +0 -4
- package/package.json +3 -3
package/lib/bundle.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";class e{a4(){return!this.k}G(e){for(;e.parent?.e;){let t=e.parent,i=t.parent;if(t===i.c){const n=i.d;n?.e?(t.e=!1,n.e=!1,i.e=!0,e=i):(e===t.d&&(e=t,this.y(e),t=e.parent,i=t.parent),t.e=!1,i.e=!0,this.z(i))}else{const n=i.c;!0===n?.e?(t.e=!1,n.e=!1,i.e=!0,e=i):(e===t.c&&(e=t,this.z(e),t=e.parent,i=t.parent),t.e=!1,i.e=!0,this.y(i))}}this.k.e=!1}v(e){const{c:t,d:i,parent:n}=e;if(!t)return n?(n.c===e?n.c=i:n.d=i,i?(i.parent=n,void(i.e=!1)):void(e.e||this.H(n))):(this.k=i,void(i&&(i.parent=void 0,i.e=!1)));if(!i)return n?n.c===e?n.c=t:n.d=t:this.k=t,t.parent=n,void(t.e=!1);let r,s,a=i;if(a.c){do{a=a.c}while(a.c);s=a.d,r=a.parent,r.c===a?r.c=s:r.d=s,s&&(s.parent=r),a.d=i,i.parent=a}else r=a,s=a.d;n?n.c===e?n.c=a:n.d=a:this.k=a,a.parent=n,a.c=t,t.parent=a;const o=a.e;a.e=e.e,s?s.e=!1:o||this.H(r)}H(e){let t,i;for(;;){if(t===e.c){if(i=e.d,i.e){this.y(e),i.e=!1,e.e=!0,i=e.d;continue}if(i.d?.e)return this.y(e),i.e=e.e,e.e=!1,void(i.d.e=!1);if(i.c?.e){i.c.e=!1,this.z(i),i.e=!0,i=e.d;continue}}else{if(i=e.c,i.e){this.z(e),i.e=!1,e.e=!0,i=e.c;continue}if(i.c?.e)return this.z(e),i.e=e.e,e.e=!1,void(i.c.e=!1);if(i.d?.e){i.d.e=!1,this.y(i),i.e=!0,i=e.c;continue}}if(e.e)return e.e=!1,void(i.e=!0);if(i.e=!0,t=e,!t.parent)return;e=t.parent}}y(e){const t=e.d;e.d=t?.c,t?.c&&(t.c.parent=e),t.parent=e.parent,e.parent?e===e.parent.c?e.parent.c=t:e.parent.d=t:this.k=t,t.c=e,e.parent=t}z(e){const t=e.c;e.c=t?.d,t?.d&&(t.d.parent=e),t.parent=e.parent,e.parent?e===e.parent.d?e.parent.d=t:e.parent.c=t:this.k=t,t.d=e,e.parent=t}k}class t extends e{search(e){return this.I(e)?.value}delete(e){const t=this.I(e);if(t)return this.v(t),t.value}C(e,t,i){let n=this.k;if(n){let r;for(;e!==n.key;){if(e<n.key){if(n.c){n=n.c;continue}r={key:e,value:t,e:!0,parent:n,c:void 0,d:void 0},n.c=r}else{if(n.d){n=n.d;continue}r={key:e,value:t,e:!0,parent:n,c:void 0,d:void 0},n.d=r}return void this.G(r)}const s=n.value;return i&&(n.value=t),s}this.k={key:e,value:t,e:!1,parent:void 0,c:void 0,d:void 0}}a5(e,t){let i=0,n=this.k;if(n){const r=[];if(void 0!==t)for(;;){if(t<n.key){if(n.c){r.push(n),n=n.c;continue}}else if(t>n.key){if(n.d){n=n.d;continue}return i}break}else for(;n.c;)r.push(n),n=n.c;let s;for(;;){const t=e(n.key,n.value);if(i++,2&t&&(s??(s=[])).push(n),1&t){i=-i;break}if(n.d)for(n=n.d;n.c;)r.push(n),n=n.c;else if(n=r.pop(),!n)break}if(s){let e=s.length;for(;e>0;)this.v(s[--e])}}return i}O(e,t){let i=0,n=this.k;if(n){const r=[];if(void 0!==t)for(;;){if(t>n.key){if(n.d){r.push(n),n=n.d;continue}}else if(t<n.key){if(n.c){n=n.c;continue}return i}break}else for(;n.d;)r.push(n),n=n.d;let s;for(;;){const t=e(n.key,n.value);if(i++,2&t&&(s??(s=[])).push(n),1&t){i=-i;break}if(n.c)for(n=n.c;n.d;)r.push(n),n=n.d;else if(n=r.pop(),!n)break}if(s){let e=s.length;for(;e>0;)this.v(s[--e])}}return i}I(e){let t=this.k;if(t)for(;e!==t.key;){if(e<t.key){if(t.c){t=t.c;continue}}else if(t.d){t=t.d;continue}return}return t}}const i={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBrailleLabel:"aria-braillelabel",ariaBrailleRoleDescription:"aria-brailleroledescription",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",alignmentBaseline:"alignment-baseline",annotationXml:"annotation-xml",baselineShift:"baseline-shift",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",pointerEvents:"pointer-events",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",style:"style",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",unicodeBidi:"unicode-bidi",vectorEffect:"vector-effect",wordSpacing:"word-spacing",writingMode:"writing-mode"},n={},r=[];Object.freeze(n),Object.freeze(r);const s=()=>!1,a=[],o=new Set,l=new t,h=new t,c=[],d=[],f={id:"",index:0,firstElement:null,attachTo:s,move:s,detachFrom:s,update:s,refresh:s,release:s,version:0,parentCom:{},markChanged:s,watchMountChange:s};let u="";const p=new t,m=new Map;let v=f,g=(e,t)=>document.createElement(e);const b={svg:(e,t)=>(t.a9(),document.createElementNS("http://www.w3.org/2000/svg",e)),math:(e,t)=>(t.a9(),document.createElementNS("http://www.w3.org/1998/Math/MathML",e)),foreignObject:(e,t)=>"foreignObject"!==e?document.createElement(e):(t.a9(),document.createElementNS("http://www.w3.org/2000/svg",e))},k=(e,t)=>{const i=["",t];for(;e.constructor!==M;)i.push(e.id),e=e.parent;return i.reverse().join(",")},w=()=>{do{p.a5(((e,t)=>{const{newChildren:i,parent:n}=t;return i&&(n&&C(n)?(t.refresh(i),n.currentBefore=void 0):t.constructor===$&&l.C(e,t)),2}))}while(!p.a4());for(const{parent:e,element:t}of a)if(t.detachFrom(n),t.parent!==e&&!h.a4()&&C(e)){const i=!t.parent,n=k(e,t.id);h.a5(((e,t)=>e.startsWith(n)?(t._(t.D,i),2):1),n)}a.length=0},y=(e,t=[],i=0)=>{let n=e[i];for(;;){if(n&&void 0!==n.id)t.push(n);else if(null!=n)switch(typeof n){case"object":y(n,t);break;case"function":n=n();continue;case"boolean":case"number":case"bigint":n=""+n;default:t.push(new S("",n))}if(!(++i<e.length))break;n=e[i]}return t},x=(e,t,i)=>{let n;const r=e.length;let s=t,a=0;for(;a<r;){const t=e[a];if(t!==s[a]){if(a===s.length)return s;const e=s[a];if(!e||void 0===e.id){s=y(s,s.slice(0,a),a);continue}if(n!==s)break}n||t.parent===i||(n=e),a++}return a===s.length?n:s===t?y(s,e.slice(0,a),a):s},C=e=>{let t=e;do{if(t.constructor===M)return!0;t=t.parent}while(t);return!1},E=(e,t,i,n)=>{let r,s,a;if(t!==e&&e.length){const o=[];let l;for(s=t.length,r=1e7;--s>=0;)if(a=t[s],a.parent===i){const e=s-a.index;e===r?(l.H++,a.index=s):(l={from:a.index,to:s,H:1},r=e,a.index=-o.push(l))}else 1e7!==r&&(r=1e7);const h=[];for(s=e.length-1;s>=0;)a=e[s],a.index<0?(l=o[-a.index-1],h.push(l),s-=l.H):(a.detachFrom(i),s--);let c,d,f=0;for(s=t.length-1;s>=0;)if(a=t[s],a.parent!==i)a.index=s--,a.attachTo(i);else{if(l=o[-a.index-1],d=l.H,c=h[f],a.index=s,!n){if(c===l){f++,s-=l.H,i.currentBefore=void 0;continue}if(c.from>l.from){r=f;do{d-=c.H,c=h[++r]}while(c.from>l.from&&d>0);if(d>0){s-=l.H,i.currentBefore=void 0,f=r;continue}}}r=s-l.H;do{a.move()}while(--s>r&&(a=t[s]))}}else for(s=t.length-1;s>=0;s--)a=t[s],a.index=s,i!==a.parent&&a.attachTo(i);i.currentBefore=void 0};class S{constructor(e,t){this.id=e,this.parent=void 0,this.index=0,this.n=0,this.ag=t}id;parent;index;firstElement;attachTo(e){this.firstElement||(this.firstElement=document.createTextNode(this.ag));const{parent:t,firstElement:i,index:n}=this;this.id&&(this.n++||o.delete(this),t&&(i.remove(),a.push({parent:t,element:this}))),this.parent=e;let r=e.currentBefore;void 0===r&&(r=e.findNextSiblingElement(n)),e.element.insertBefore(i,r),e.currentBefore=i}move(){const{parent:e,index:t,firstElement:i}=this;let n=e.currentBefore;void 0===n&&(n=e.findNextSiblingElement(t)),e.element.insertBefore(i,n),e.currentBefore=i}detachFrom(e){this.parent===e?(this.firstElement.remove(),this.parent=void 0,this.id&&a.push({parent:e,element:this})):this.id&&! --this.n&&this.release()}update(e){return this.ag!==e&&(this.ag=e,this.firstElement&&(this.firstElement.nodeValue=e)),!1}refresh(){}release(e){e&&this.parent===e&&(this.firstElement.remove(),this.parent=void 0),this.id&&--this.n<=0&&m.delete(this.id)}n;ag}class B{constructor(e,t,i){this.id=e,this.parent=void 0,this.index=0,this.n=0,this.newChildren=this.d=i?y(t):t||r,this.currentBefore=void 0}id;parent;index;newChildren;currentBefore;get element(){return this.parent.element}get firstElement(){const{d:e}=this;for(let t=0;t<e.length;t++){const i=e[t].firstElement;if(i)return i}return null}attachTo(e){const{parent:t,d:i,newChildren:n}=this;if(this.n++||o.delete(this),t){a.push({parent:t,element:this});for(let e=i.length-1;e>=0;e--)i[e].detachFrom(this)}this.parent=e;const r=n||i;for(let e=r.length-1;e>=0;e--){const t=r[e];t.index=e,t.attachTo(this)}e.currentBefore=this.currentBefore,this.currentBefore=void 0,this.d=r,this.newChildren=void 0}move(){const{d:e,newChildren:t}=this;if(t)E(e,t,this,!0),this.d=t,this.newChildren=void 0;else{for(let t=e.length-1;t>=0;t--)e[t].move();this.currentBefore=void 0}}detachFrom(e){if(this.parent===e){const{d:t}=this;for(const e of t)e.detachFrom(this);this.parent=void 0,a.push({parent:e,element:this})}else--this.n||this.release()}update(e,t){if(t){const e=x(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}refresh(e){E(this.d,e,this),this.d=e,this.newChildren=void 0}release(e){if(e&&this.parent===e){const{d:e}=this;for(const t of e)t.detachFrom(this);this.parent=void 0}--this.n<=0&&m.delete(this.id)}findNextSiblingElement(e){const t=this.newChildren||this.d;let i,n=e+1,r=t[n];for(;r;){if(i=r.firstElement,i)return i;r=t[++n]}return i=this.parent.currentBefore,void 0!==i?i:this.parent.findNextSiblingElement(this.index)}n;d}class j{constructor(e,t,i,s,a,o){if(this.id=e,this.parent=void 0,this.index=0,this.n=0,this.firstElement=this.element=g(t,this),this.newChildren=this.d=o?y(s):s||r,this.currentBefore=void 0,i){if(this.p=n,this.u=-1,"select"===t){const e=this.element,t=i,n=t.value;if(n){t.value=void 0;const i=this.refresh;this.refresh=r=>{if(E(this.d,r,this),this.d=r,this.newChildren=void 0,Array.isArray(n)){const t=n,[i,r,s]=t;e.value=s;const a=t[3]=e=>i[r]=e.target.value;e.addEventListener("change",a)}else e.value=n;t.value=n,this.refresh=i}}}this.update(i),this.u=a??0}else this.p=i,this.u=0}id;element;parent;newChildren;index;currentBefore;firstElement;attachTo(e){const{parent:t,element:i,newChildren:n,index:r}=this;this.n++||o.delete(this),t&&(i.remove(),a.push({parent:t,element:this})),this.parent=e,n&&this.refresh(n);let s=e.currentBefore;void 0===s&&(s=e.findNextSiblingElement(r)),e.element.insertBefore(i,s),e.currentBefore=i}move(){const{parent:e,newChildren:t,index:i,element:n}=this;t&&this.refresh(t);let r=e.currentBefore;void 0===r&&(r=e.findNextSiblingElement(i)),e.element.insertBefore(n,r),e.currentBefore=n}detachFrom(e){this.parent===e?(this.element.remove(),this.parent=void 0,a.push({parent:e,element:this})):--this.n||this.release()}update(e,t){const{element:r,p:s,u:a}=this;if(s&&a){this.p=e;let t=a;for(const a in e){const o=e[a],l=s[a];if(o!==l)if(null!=o)switch(typeof o){case"string":{const e=i[a];e?r.setAttribute(e,o):r[a]=o;break}case"number":case"boolean":case"function":r[a]=o;break;default:if(Array.isArray(o)){const[e,t,i]=o;if(l){const[n,s,h,c]=l;if(h!==i&&r[a]!==i&&(r[a]=i),n===e&&s===t)o[3]=c;else{const i=o[3]=i=>e[t]=i.target[a];r.removeEventListener("change",c),r.addEventListener("change",i)}}else{r[a]=i;const n=o[3]=i=>e[t]=i.target[a];r.addEventListener("change",n)}break}if("style"===a){if(!l){const t=r.style,i={};let n=0;for(const e in o){const r=o[e];i[e]=r,n++,t[e]=r}e[a]=i,i.k=n;break}const t=r.style,i={};let n=0,s=l.k;for(const e in o){const r=o[e];i[e]=r,e in l&&s--,n++,r!==l[a]&&(t[e]=r)}if(e[a]=i,i.k=n,s)for(const e in l)if(!(e in o)&&(t[e]=null,! --s))break;break}r[a]=o}else switch(typeof l){case"string":{const e=i[a];e?this.element.removeAttribute(e):this.element[a]=o;break}case"object":l?Array.isArray(l)?r.removeEventListener("change",l[3]):l===n&&(r[a]=o):r[a]=o;break;default:r[a]=o}if(! --t)break}}if(t){const e=x(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}refresh(e){E(this.d,e,this),this.d=e,this.newChildren=void 0}release(e){if(e&&this.parent===e&&(this.element.remove(),this.parent=void 0),--this.n<=0){const{d:e}=this;for(const t of e)t.release(this);m.delete(this.id)}}findNextSiblingElement(e){const t=this.newChildren||this.d;let i,n=e+1,r=t[n];for(;r;){if(i=r.firstElement,i)return i;r=t[++n]}return null}a9(){this.update=this.aP}aP(e,t){const{element:n,p:r,u:s}=this;if(r&&s){this.p=e;let t=s;for(const s in e){const a=e[s],o=r[s];if(a!==o)if(null!=a)switch(typeof a){case"string":n.setAttribute(i[s]??s,a);break;case"number":case"boolean":n.setAttribute(i[s]??s,""+a);break;case"function":n[s]=a;break;default:if("style"===s){if(!o){const t=n.style,i={};let r=0;for(const e in a){const n=a[e];i[e]=n,r++,t[e]=n}e[s]=i,i.k=r;break}const t=n.style,i={};let r=0,l=o.k;for(const e in a){const n=a[e];i[e]=n,e in o&&l--,r++,n!==o[s]&&(t[e]=n)}if(e[s]=i,i.k=r,l)for(const e in o)if(!(e in a)&&(t[e]=null,! --l))break;break}n[s]=a}else switch(typeof o){case"string":case"number":case"boolean":n.removeAttribute(i[s]??s);break;default:n[s]=a}if(! --t)break}}if(t){const e=x(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}n;p;d;u}class ${constructor(e,t,i,n,s,a,o){this.id=e,this.parentCom=t,this.parent=void 0,this.index=0,this.version=0,this.n=0,this.aC=i,this.p=n,this.newChildren=this.d=o?y(s):s||r,this.u=a??0}id;parentCom;parent;newChildren;index;version;get firstElement(){return this.j?.firstElement||null}attachTo(e){const{parent:t,newChildren:i,j:n}=this;this.parent=e,i?this.refresh(i):n&&(n.index=this.index,n.attachTo(e)),this.n++||o.delete(this),t&&a.push({parent:t,element:this})}move(){const{newChildren:e,j:t}=this;e?this.refresh(e):t&&(t.index=this.index,t.move())}detachFrom(e){this.parent===e?(this.j?.detachFrom(e),this.parent=void 0,a.push({parent:e,element:this})):--this.n||this.release()}update(e,t){const{p:i,d:n,u:r}=this;if(this.p=e,t){const e=x(n,t,this.parent);if(e)return this.newChildren=e,!0}if(!this.newChildren&&r){let t=r;for(const r in i){if(i[r]!==e[r])return this.newChildren=n,!0;if(! --t)break}}return!1}refresh(e){const{id:t,parent:i,j:r,index:s}=this,a=v;v=this;let o=this.aC(this.p||n,e);if(o!==r)switch(typeof o){case"boolean":case"number":case"bigint":o=""+o;case"string":o=new S("",o),this.j=o,o.index=s,o.attachTo(i),r?.detachFrom(i);break;default:o?(this.j=o,o.index=s,o.attachTo(i),r?.detachFrom(i),l.a4()||l.a5(((e,i)=>e.startsWith(t)?i.parent&&C(i.parent)?(p.C(e,i),2):0:1),t)):(this.j=void 0,r?.detachFrom(i))}else r&&(r.parent!==i?(r.index=s,r.attachTo(i)):r.index!==s&&(r.index=s,r.move()));this.d=e,this.newChildren=void 0,v=a}release(e){e&&this.parent===e&&(this.j?.detachFrom(e),this.parent=void 0),--this.n<=0&&(this.newChildren&&l.delete(this.id),m.delete(this.id))}markChanged(){return!this.newChildren&&(this.newChildren=this.d,!0)}watchMountChange(e,t,i){const n=k(this.parent,this.id);h.C(n+e,{_:t,D:i},!0)}n;aC;p;d;u;j}class M{constructor(e,t){this.id=e,this.element=t,this.currentBefore=void 0}id;element;parent;currentBefore;findNextSiblingElement(e){return null}render(e){this.ah||(this.ah=new $(this.id,f,e,null,r),m.set(this.id,this.ah),this.ah.attachTo(this))}ah}let A=(e,t)=>{const i=e[t];if(i){for(const[e,t]of i){const i=m.get(e);i?.version===t&&i.markChanged()&&(p.a4()&&queueMicrotask(w),p.C(e,i))}i.clear()}};const F=()=>{u=d.pop()};var N,T;(T=N||(N={})).render=(e,t)=>{const i=(c.length||"")+"|",n=new M(i,e);c.push(n),n.render(t)},T.$=(e,t,i,n,r,s)=>{const a=`${v.id}${e}${u}`;let o=m.get(a);return o?((i||n)&&o.update(i,n)&&p.C(a,o),o):(o=new j(a,t,i,n,r,s),m.set(a,o),o)},T.$c=(e,t,i,n,r,s)=>{const a=`${v.id}${e}${u}`;let o=m.get(a);return o?((i||n)&&o.update(i,n)&&p.C(a,o),o):(o=new $(a,v,t,i,n,r,s),m.set(a,o),o)},T.$f=(e,t,i)=>{const n=`${v.id}${e}${u}`;let r=m.get(n);return r?(t&&r.update(null,t)&&p.C(n,r),r):(r=new B(n,t,i),m.set(n,r),r)},T.$k=e=>(d.push(u),u=`${u||"{"}${e}}`,F),T.$n=e=>{const t=g;return g=b[e],()=>{g=t}},T.$s=(e,t)=>(e(),t),T.$t=(e,t,i)=>{const n=`${v.id}${e}${u}`;let r=m.get(n);return r?(i&&r.update(t),r):(r=new S(n,t),m.set(r.id,r),r)};const z=Symbol(),H=Array.prototype,L=(e,t)=>{if(v.id){let i=e[t];i||(i=new Map,e[t]=i),i.set(v.id,v.version)}};let R=(e,t)=>{R=A,R(e,t)},I=!1;const O=new WeakMap,P=e=>function(...t){const i=this.length;let n,r,s;switch(e){case H.push:n=i,r=n+t.length,s=i;break;case H.unshift:n=0,r=t.length,s=i;break;case H.fill:n=t[1],void 0===n||n<=-i?n=0:n<0&&(n=i+n),r=t[2],void 0===r||r>i?r=i:r<=-i?r=0:r<0&&(r=i+r),s=r;break;case H.sort:case H.reverse:n=r=0,s=i;break;case H.pop:n=r=i-1,s=i;break;case H.shift:n=r=0,s=i;break;default:n=t[0],n<0&&(n=i+n),r=t.length>2?t.length-2:0,s=t[1],void 0===s&&(s=i-n),s=s>0?s!==r?i:n+r:r?i:n,r+=n}const a=e.bind(this)(...t),o=this[z];let l;for(let e=n;e<r;e++){switch(l=this[e],typeof l){case"object":if(l){for(;e<r;)l=this[e],l&&!l[z]&&(this[e]=q(l)),e++;break}case"undefined":continue}break}return i!==this.length&&R(o,"length"),R(o,Symbol.iterator),a},D={push:P(H.push),unshift:P(H.unshift),fill:P(H.fill),sort:P(H.sort),reverse:P(H.reverse),pop:P(H.pop),shift:P(H.shift),splice:P(H.splice)},V={get(e,t){if(t!==z){let i=e[t];if(i&&i===H[t]){const n=D[t];if(n)return n.bind(e);i=i.bind(e)}return L(e[z],"length"!==t?Symbol.iterator:t),i}return e},set(e,t,i){if(t!==z){if(e[t]===i)return!0;const n=e[z];return i&&"object"==typeof i&&(i=q(i)),e[t]=i,"length"===t&&R(n,t),R(n,Symbol.iterator),!0}return((e,t)=>{const i=t.length,n=e.length;let r;for(let n=0;n<i;n++){let s=t[n];if(s&&"object"==typeof s){do{s=t[n],r=e[n],s?r?r!==s&&(r[z]=s):e[n]=q(s):e[n]=s}while(++n<i);break}if(null!=s){do{e[n]=t[n]}while(++n<i);break}e[n]=s}const s=e[z];n!==i&&(n>i&&(e.length=i),R(s,"length")),R(s,Symbol.iterator)})(e,i),!0},has:(e,t)=>(L(e[z],isNaN(parseInt(t))?t:Symbol.iterator),t in e),deleteProperty:(e,t)=>(isNaN(parseInt(t))||(t=Symbol.iterator),void 0!==e[t]&&R(e[z],t),delete e[t])},W={get(e,t){if(t!==z){const i=e[t];return"id"!==t&&L(e[z],t),i}return e},set(e,t,i,n){if(t!==z){if(e[t]===i)return!0;const n=e[z];return i&&"object"==typeof i&&(i=q(i)),e[t]=i,R(n,t),!0}return((e,t,i)=>{const n={...e};let r;for(const s in i){delete n[s];const a=i[s];a&&"object"==typeof a&&(r=e[s],r)?r[z]=a:e[s]!==a&&(t[s]=a)}for(const e in n)delete t[e]})(e,n,i),!0},has:(e,t)=>(L(e[z],t),t in e),deleteProperty:(e,t)=>(void 0!==e[t]&&R(e[z],t),delete e[t])},q=e=>{let t;if(Array.isArray(e)){t=[];const i=e.length;for(let n=0;n<i;n++){let r=e[n];if(r&&"object"==typeof r){do{t[n]=(r=e[n])&&q(r)}while(++n<i);break}if(null!=r){do{t[n]=e[n]}while(++n<i);break}t[n]=r}e=new Proxy(t,V)}else{t={};for(const i in e){const n=e[i];t[i]=n&&"object"==typeof n?q(n):n}e=new Proxy(t,W)}return t[z]={},e},G=(e,t)=>{t?e.w=!0:e.com.watchMountChange("s",G,e)};let _=0;const K=(e=>{const t=v;if(t.id){let i=O.get(t);if(i){const n=i.e;return i.w?(I=!0,"function"==typeof e&&(e=e()),n[z]=e,I=!1,i.w=!1,t.watchMountChange("s",G,i)):"function"==typeof e&&(I=!0,(e=e(n))!==n&&(n[z]=e),I=!1),n}"function"==typeof e&&(e=e());const n=q(e);return i={com:t,e:n,w:!1},O.set(t,i),n}return"function"==typeof e&&(e=e()),q(e)})({c:0});window.addEventListener("popstate",(()=>{K.c=++_}))})();
|
|
1
|
+
var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{ye:()=>q,N_:()=>$e,Wt:()=>je,Ix:()=>Pe,On:()=>M,er:()=>ee,te:()=>L,oo:()=>we,LU:()=>N,wE:()=>Ee,J0:()=>te});class r{a4(){return!this.k}G(e){for(;e.parent?.e;){let t=e.parent,r=t.parent;if(t===r.c){const n=r.d;n?.e?(t.e=!1,n.e=!1,r.e=!0,e=r):(e===t.d&&(e=t,this.y(e),t=e.parent,r=t.parent),t.e=!1,r.e=!0,this.z(r))}else{const n=r.c;!0===n?.e?(t.e=!1,n.e=!1,r.e=!0,e=r):(e===t.c&&(e=t,this.z(e),t=e.parent,r=t.parent),t.e=!1,r.e=!0,this.y(r))}}this.k.e=!1}v(e){const{c:t,d:r,parent:n}=e;if(!t)return n?(n.c===e?n.c=r:n.d=r,r?(r.parent=n,void(r.e=!1)):void(e.e||this.H(n))):(this.k=r,void(r&&(r.parent=void 0,r.e=!1)));if(!r)return n?n.c===e?n.c=t:n.d=t:this.k=t,t.parent=n,void(t.e=!1);let i,a,s=r;if(s.c){do{s=s.c}while(s.c);a=s.d,i=s.parent,i.c===s?i.c=a:i.d=a,a&&(a.parent=i),s.d=r,r.parent=s}else i=s,a=s.d;n?n.c===e?n.c=s:n.d=s:this.k=s,s.parent=n,s.c=t,t.parent=s;const o=s.e;s.e=e.e,a?a.e=!1:o||this.H(i)}H(e){let t,r;for(;;){if(t===e.c){if(r=e.d,r.e){this.y(e),r.e=!1,e.e=!0,r=e.d;continue}if(r.d?.e)return this.y(e),r.e=e.e,e.e=!1,void(r.d.e=!1);if(r.c?.e){r.c.e=!1,this.z(r),r.e=!0,r=e.d;continue}}else{if(r=e.c,r.e){this.z(e),r.e=!1,e.e=!0,r=e.c;continue}if(r.c?.e)return this.z(e),r.e=e.e,e.e=!1,void(r.c.e=!1);if(r.d?.e){r.d.e=!1,this.y(r),r.e=!0,r=e.c;continue}}if(e.e)return e.e=!1,void(r.e=!0);if(r.e=!0,t=e,!t.parent)return;e=t.parent}}y(e){const t=e.d;e.d=t?.c,t?.c&&(t.c.parent=e),t.parent=e.parent,e.parent?e===e.parent.c?e.parent.c=t:e.parent.d=t:this.k=t,t.c=e,e.parent=t}z(e){const t=e.c;e.c=t?.d,t?.d&&(t.d.parent=e),t.parent=e.parent,e.parent?e===e.parent.d?e.parent.d=t:e.parent.c=t:this.k=t,t.d=e,e.parent=t}k}class n extends r{search(e){return this.I(e)?.value}delete(e){const t=this.I(e);if(t)return this.v(t),t.value}C(e,t,r){let n=this.k;if(n){let i;for(;e!==n.key;){if(e<n.key){if(n.c){n=n.c;continue}i={key:e,value:t,e:!0,parent:n,c:void 0,d:void 0},n.c=i}else{if(n.d){n=n.d;continue}i={key:e,value:t,e:!0,parent:n,c:void 0,d:void 0},n.d=i}return void this.G(i)}const a=n.value;return r&&(n.value=t),a}this.k={key:e,value:t,e:!1,parent:void 0,c:void 0,d:void 0}}a5(e,t){let r=0,n=this.k;if(n){const i=[];if(void 0!==t)for(;;){if(t<n.key){if(n.c){i.push(n),n=n.c;continue}}else if(t>n.key){if(n.d){n=n.d;continue}return r}break}else for(;n.c;)i.push(n),n=n.c;let a;for(;;){const t=e(n.key,n.value);if(r++,2&t&&(a??(a=[])).push(n),1&t){r=-r;break}if(n.d)for(n=n.d;n.c;)i.push(n),n=n.c;else if(n=i.pop(),!n)break}if(a){let e=a.length;for(;e>0;)this.v(a[--e])}}return r}O(e,t){let r=0,n=this.k;if(n){const i=[];if(void 0!==t)for(;;){if(t>n.key){if(n.d){i.push(n),n=n.d;continue}}else if(t<n.key){if(n.c){n=n.c;continue}return r}break}else for(;n.d;)i.push(n),n=n.d;let a;for(;;){const t=e(n.key,n.value);if(r++,2&t&&(a??(a=[])).push(n),1&t){r=-r;break}if(n.c)for(n=n.c;n.d;)i.push(n),n=n.d;else if(n=i.pop(),!n)break}if(a){let e=a.length;for(;e>0;)this.v(a[--e])}}return r}I(e){let t=this.k;if(t)for(;e!==t.key;){if(e<t.key){if(t.c){t=t.c;continue}}else if(t.d){t=t.d;continue}return}return t}}const i={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBrailleLabel:"aria-braillelabel",ariaBrailleRoleDescription:"aria-brailleroledescription",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",alignmentBaseline:"alignment-baseline",annotationXml:"annotation-xml",baselineShift:"baseline-shift",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",pointerEvents:"pointer-events",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",style:"style",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",unicodeBidi:"unicode-bidi",vectorEffect:"vector-effect",wordSpacing:"word-spacing",writingMode:"writing-mode"},a={},s=[];Object.freeze(a),Object.freeze(s);const o=()=>!1,l=[],c=new Set,h=new n,u=new n,d=[],f=[],p={id:"",index:0,firstElement:null,attachTo:o,move:o,detachFrom:o,update:o,refresh:o,release:o,version:0,parentCom:{},markChanged:o,watchMountChange:o};let m,v="",g=2e4,y=0,b=0;const w=new n,k=new Map;let x=p,C=(e,t)=>document.createElement(e);const E={svg:(e,t)=>(t.a9(),document.createElementNS("http://www.w3.org/2000/svg",e)),math:(e,t)=>(t.a9(),document.createElementNS("http://www.w3.org/1998/Math/MathML",e)),foreignObject:(e,t)=>"foreignObject"!==e?document.createElement(e):(t.a9(),document.createElementNS("http://www.w3.org/2000/svg",e))},P=()=>{if(++b>=y){for(const e of c)if(c.delete(e),e.id)e.release();else if(--b<y){c.add(e);break}}else c.add(Object.create(p));m&&(m=setTimeout(P,g))},S=(e,t)=>{const r=["",t];for(;e.constructor!==T;)r.push(e.id),e=e.parent;return r.reverse().join(",")},$=()=>{do{w.a5(((e,t)=>{const{newChildren:r,parent:n}=t;return r&&(n&&R(n)?(t.refresh(r),n.currentBefore=void 0):t.constructor===I&&h.C(e,t)),2}))}while(!w.a4());for(const{parent:e,element:t}of l)if(t.detachFrom(a),t.parent!==e&&!u.a4()&&R(e)){const r=!t.parent,n=S(e,t.id);u.a5(((e,t)=>e.startsWith(n)?(t._(t.D,r),2):1),n)}l.length=0},j=(e,t=[],r=0)=>{let n=e[r];for(;;){if(n&&void 0!==n.id)t.push(n);else if(null!=n)switch(typeof n){case"object":j(n,t);break;case"function":n=n();continue;case"boolean":case"number":case"bigint":n=""+n;default:t.push(new F("",n))}if(!(++r<e.length))break;n=e[r]}return t},A=(e,t,r)=>{let n;const i=e.length;let a=t,s=0;for(;s<i;){const t=e[s];if(t!==a[s]){if(s===a.length)return a;const e=a[s];if(!e||void 0===e.id){a=j(a,a.slice(0,s),s);continue}if(n!==a)break}n||t.parent===r||(n=e),s++}return s===a.length?n:a===t?j(a,e.slice(0,s),s):a},R=e=>{let t=e;do{if(t.constructor===T)return!0;t=t.parent}while(t);return!1},B=(e,t,r,n)=>{let i,a,s;if(t!==e&&e.length){const o=[];let l;for(a=t.length,i=1e7;--a>=0;)if(s=t[a],s.parent===r){const e=a-s.index;e===i?(l.H++,s.index=a):(l={from:s.index,to:a,H:1},i=e,s.index=-o.push(l))}else 1e7!==i&&(i=1e7);const c=[];for(a=e.length-1;a>=0;)s=e[a],s.index<0?(l=o[-s.index-1],c.push(l),a-=l.H):(s.detachFrom(r),a--);let h,u,d=0;for(a=t.length-1;a>=0;)if(s=t[a],s.parent!==r)s.index=a--,s.attachTo(r);else{if(l=o[-s.index-1],u=l.H,h=c[d],s.index=a,!n){if(h===l){d++,a-=l.H,r.currentBefore=void 0;continue}if(h.from>l.from){i=d;do{u-=h.H,h=c[++i]}while(h.from>l.from&&u>0);if(u>0){a-=l.H,r.currentBefore=void 0,d=i;continue}}}i=a-l.H;do{s.move()}while(--a>i&&(s=t[a]))}}else for(a=t.length-1;a>=0;a--)s=t[a],s.index=a,r!==s.parent&&s.attachTo(r);r.currentBefore=void 0};class F{constructor(e,t){this.id=e,this.parent=void 0,this.index=0,this.n=0,this.ag=t}id;parent;index;firstElement;attachTo(e){this.firstElement||(this.firstElement=document.createTextNode(this.ag));const{parent:t,firstElement:r,index:n}=this;this.id&&(this.n++||c.delete(this),t&&(r.remove(),l.push({parent:t,element:this}))),this.parent=e;let i=e.currentBefore;void 0===i&&(i=e.findNextSiblingElement(n)),e.element.insertBefore(r,i),e.currentBefore=r}move(){const{parent:e,index:t,firstElement:r}=this;let n=e.currentBefore;void 0===n&&(n=e.findNextSiblingElement(t)),e.element.insertBefore(r,n),e.currentBefore=r}detachFrom(e){this.parent===e?(this.firstElement.remove(),this.parent=void 0,this.id&&l.push({parent:e,element:this})):this.id&&! --this.n&&(y?c.add(this):this.release())}update(e){return this.ag!==e&&(this.ag=e,this.firstElement&&(this.firstElement.nodeValue=e)),!1}refresh(){}release(e){e&&this.parent===e&&(this.firstElement.remove(),this.parent=void 0),this.id&&--this.n<=0&&k.delete(this.id)}n;ag}class O{constructor(e,t,r){this.id=e,this.parent=void 0,this.index=0,this.n=0,this.newChildren=this.d=r?j(t):t||s,this.currentBefore=void 0}id;parent;index;newChildren;currentBefore;get element(){return this.parent.element}get firstElement(){const{d:e}=this;for(let t=0;t<e.length;t++){const r=e[t].firstElement;if(r)return r}return null}attachTo(e){const{parent:t,d:r,newChildren:n}=this;if(this.n++||c.delete(this),t){l.push({parent:t,element:this});for(let e=r.length-1;e>=0;e--)r[e].detachFrom(this)}this.parent=e;const i=n||r;for(let e=i.length-1;e>=0;e--){const t=i[e];t.index=e,t.attachTo(this)}e.currentBefore=this.currentBefore,this.currentBefore=void 0,this.d=i,this.newChildren=void 0}move(){const{d:e,newChildren:t}=this;if(t)B(e,t,this,!0),this.d=t,this.newChildren=void 0;else{for(let t=e.length-1;t>=0;t--)e[t].move();this.currentBefore=void 0}}detachFrom(e){if(this.parent===e){const{d:t}=this;for(const e of t)e.detachFrom(this);this.parent=void 0,l.push({parent:e,element:this})}else--this.n||(y?c.add(this):this.release())}update(e,t){if(t){const e=A(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}refresh(e){B(this.d,e,this),this.d=e,this.newChildren=void 0}release(e){if(e&&this.parent===e){const{d:e}=this;for(const t of e)t.detachFrom(this);this.parent=void 0}--this.n<=0&&k.delete(this.id)}findNextSiblingElement(e){const t=this.newChildren||this.d;let r,n=e+1,i=t[n];for(;i;){if(r=i.firstElement,r)return r;i=t[++n]}return r=this.parent.currentBefore,void 0!==r?r:this.parent.findNextSiblingElement(this.index)}n;d}class z{constructor(e,t,r,n,i,o){if(this.id=e,this.parent=void 0,this.index=0,this.n=0,this.firstElement=this.element=C(t,this),this.newChildren=this.d=o?j(n):n||s,this.currentBefore=void 0,r){if(this.p=a,this.u=-1,"select"===t){const e=this.element,t=r,n=t.value;if(n){t.value=void 0;const r=this.refresh;this.refresh=i=>{if(B(this.d,i,this),this.d=i,this.newChildren=void 0,Array.isArray(n)){const t=n,[r,i,a]=t;e.value=a;const s=t[3]=e=>r[i]=e.target.value;e.addEventListener("change",s)}else e.value=n;t.value=n,this.refresh=r}}}this.update(r),this.u=i??0}else this.p=r,this.u=0}id;element;parent;newChildren;index;currentBefore;firstElement;attachTo(e){const{parent:t,element:r,newChildren:n,index:i}=this;this.n++||c.delete(this),t&&(r.remove(),l.push({parent:t,element:this})),this.parent=e,n&&this.refresh(n);let a=e.currentBefore;void 0===a&&(a=e.findNextSiblingElement(i)),e.element.insertBefore(r,a),e.currentBefore=r}move(){const{parent:e,newChildren:t,index:r,element:n}=this;t&&this.refresh(t);let i=e.currentBefore;void 0===i&&(i=e.findNextSiblingElement(r)),e.element.insertBefore(n,i),e.currentBefore=n}detachFrom(e){this.parent===e?(this.element.remove(),this.parent=void 0,l.push({parent:e,element:this})):--this.n||(y?c.add(this):this.release())}update(e,t){const{element:r,p:n,u:s}=this;if(n&&s){this.p=e;let t=s;for(const s in e){const o=e[s],l=n[s];if(o!==l)if(null!=o)switch(typeof o){case"string":{const e=i[s];e?r.setAttribute(e,o):r[s]=o;break}case"number":case"boolean":case"function":r[s]=o;break;default:if(Array.isArray(o)){const[e,t,n]=o;if(l){const[i,a,c,h]=l;if(c!==n&&r[s]!==n&&(r[s]=n),i===e&&a===t)o[3]=h;else{const n=o[3]=r=>e[t]=r.target[s];r.removeEventListener("change",h),r.addEventListener("change",n)}}else{r[s]=n;const i=o[3]=r=>e[t]=r.target[s];r.addEventListener("change",i)}break}if("style"===s){if(!l){const t=r.style,n={};let i=0;for(const e in o){const r=o[e];n[e]=r,i++,t[e]=r}e[s]=n,n.k=i;break}const t=r.style,n={};let i=0,a=l.k;for(const e in o){const r=o[e];n[e]=r,e in l&&a--,i++,r!==l[s]&&(t[e]=r)}if(e[s]=n,n.k=i,a)for(const e in l)if(!(e in o)&&(t[e]=null,! --a))break;break}r[s]=o}else switch(typeof l){case"string":{const e=i[s];e?this.element.removeAttribute(e):this.element[s]=o;break}case"object":l?Array.isArray(l)?r.removeEventListener("change",l[3]):l===a&&(r[s]=o):r[s]=o;break;default:r[s]=o}if(! --t)break}}if(t){const e=A(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}refresh(e){B(this.d,e,this),this.d=e,this.newChildren=void 0}release(e){if(e&&this.parent===e&&(this.element.remove(),this.parent=void 0),--this.n<=0){const{d:e}=this;for(const t of e)t.release(this);k.delete(this.id)}}findNextSiblingElement(e){const t=this.newChildren||this.d;let r,n=e+1,i=t[n];for(;i;){if(r=i.firstElement,r)return r;i=t[++n]}return null}a9(){this.update=this.aP}aP(e,t){const{element:r,p:n,u:a}=this;if(n&&a){this.p=e;let t=a;for(const a in e){const s=e[a],o=n[a];if(s!==o)if(null!=s)switch(typeof s){case"string":r.setAttribute(i[a]??a,s);break;case"number":case"boolean":r.setAttribute(i[a]??a,""+s);break;case"function":r[a]=s;break;default:if("style"===a){if(!o){const t=r.style,n={};let i=0;for(const e in s){const r=s[e];n[e]=r,i++,t[e]=r}e[a]=n,n.k=i;break}const t=r.style,n={};let i=0,l=o.k;for(const e in s){const r=s[e];n[e]=r,e in o&&l--,i++,r!==o[a]&&(t[e]=r)}if(e[a]=n,n.k=i,l)for(const e in o)if(!(e in s)&&(t[e]=null,! --l))break;break}r[a]=s}else switch(typeof o){case"string":case"number":case"boolean":r.removeAttribute(i[a]??a);break;default:r[a]=s}if(! --t)break}}if(t){const e=A(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}n;p;d;u}class I{constructor(e,t,r,n,i,a,o){this.id=e,this.parentCom=t,this.parent=void 0,this.index=0,this.version=0,this.n=0,this.aC=r,this.p=n,this.newChildren=this.d=o?j(i):i||s,this.u=a??0}id;parentCom;parent;newChildren;index;version;get firstElement(){return this.j?.firstElement||null}attachTo(e){const{parent:t,newChildren:r,j:n}=this;this.parent=e,r?this.refresh(r):n&&(n.index=this.index,n.attachTo(e)),this.n++||c.delete(this),t&&l.push({parent:t,element:this})}move(){const{newChildren:e,j:t}=this;e?this.refresh(e):t&&(t.index=this.index,t.move())}detachFrom(e){this.parent===e?(this.j?.detachFrom(e),this.parent=void 0,l.push({parent:e,element:this})):--this.n||(y?c.add(this):this.release())}update(e,t){const{p:r,d:n,u:i}=this;if(this.p=e,t){const e=A(n,t,this.parent);if(e)return this.newChildren=e,!0}if(!this.newChildren&&i){let t=i;for(const i in r){if(r[i]!==e[i])return this.newChildren=n,!0;if(! --t)break}}return!1}refresh(e){const{id:t,parent:r,j:n,index:i}=this,s=x;x=this;let o=this.aC(this.p||a,e);if(o!==n)switch(typeof o){case"boolean":case"number":case"bigint":o=""+o;case"string":o=new F("",o),this.j=o,o.index=i,o.attachTo(r),n?.detachFrom(r);break;default:o?(this.j=o,o.index=i,o.attachTo(r),n?.detachFrom(r),h.a4()||h.a5(((e,r)=>e.startsWith(t)?r.parent&&R(r.parent)?(w.C(e,r),2):0:1),t)):(this.j=void 0,n?.detachFrom(r))}else n&&(n.parent!==r?(n.index=i,n.attachTo(r)):n.index!==i&&(n.index=i,n.move()));this.d=e,this.newChildren=void 0,x=s}release(e){e&&this.parent===e&&(this.j?.detachFrom(e),this.parent=void 0),--this.n<=0&&(this.newChildren&&h.delete(this.id),k.delete(this.id))}markChanged(){return!this.newChildren&&(this.newChildren=this.d,!0)}watchMountChange(e,t,r){const n=S(this.parent,this.id);u.C(n+e,{_:t,D:r},!0)}n;aC;p;d;u;j}class T{constructor(e,t){this.id=e,this.element=t,this.currentBefore=void 0}id;element;parent;currentBefore;findNextSiblingElement(e){return null}render(e){this.ah||(this.ah=new I(this.id,p,e,null,s),k.set(this.id,this.ah),this.ah.attachTo(this))}ah}const M=(e,t)=>{if(x.id){let r=e[t];r||(r=new Map,e[t]=r),r.set(x.id,x.version)}};let N=(e,t)=>{const r=e[t];if(r){for(const[e,t]of r){const r=k.get(e);r?.version===t&&r.markChanged()&&(w.a4()&&queueMicrotask($),w.C(e,r))}r.clear()}};const L=(e,t=2e4)=>{if(e>=0&&t>=1e3){if(g=t,y&&clearTimeout(m),e)m=setTimeout(P,g);else if(m){m=void 0;for(let e=0;e<y;e++)P()}return y=e,!0}return!1},U=()=>{v=f.pop()};var q;!function(e){e.render=(e,t)=>{const r=(d.length||"")+"|",n=new T(r,e);d.push(n),n.render(t)},e.$=(e,t,r,n,i,a)=>{const s=`${x.id}${e}${v}`;let o=k.get(s);return o?((r||n)&&o.update(r,n)&&w.C(s,o),o):(o=new z(s,t,r,n,i,a),k.set(s,o),o)},e.$c=(e,t,r,n,i,a)=>{const s=`${x.id}${e}${v}`;let o=k.get(s);return o?((r||n)&&o.update(r,n)&&w.C(s,o),o):(o=new I(s,x,t,r,n,i,a),k.set(s,o),o)},e.$f=(e,t,r)=>{const n=`${x.id}${e}${v}`;let i=k.get(n);return i?(t&&i.update(null,t)&&w.C(n,i),i):(i=new O(n,t,r),k.set(n,i),i)},e.$k=e=>(f.push(v),v=`${v||"{"}${e}}`,U),e.$n=e=>{const t=C;return C=E[e],()=>{C=t}},e.$s=(e,t)=>(e(),t),e.$t=(e,t,r)=>{const n=`${x.id}${e}${v}`;let i=k.get(n);return i?(r&&i.update(t),i):(i=new F(n,t),k.set(i.id,i),i)}}(q||(q={}));const H=Symbol(),_=Array.prototype,D=M;let Z=(e,t)=>{Z=N,Z(e,t)},V=!1;const W=new WeakMap,Q=e=>function(...t){const r=this.length;let n,i,a;switch(e){case _.push:n=r,i=n+t.length,a=r;break;case _.unshift:n=0,i=t.length,a=r;break;case _.fill:n=t[1],void 0===n||n<=-r?n=0:n<0&&(n=r+n),i=t[2],void 0===i||i>r?i=r:i<=-r?i=0:i<0&&(i=r+i),a=i;break;case _.sort:case _.reverse:n=i=0,a=r;break;case _.pop:n=i=r-1,a=r;break;case _.shift:n=i=0,a=r;break;default:n=t[0],n<0&&(n=r+n),i=t.length>2?t.length-2:0,a=t[1],void 0===a&&(a=r-n),a=a>0?a!==i?r:n+i:i?r:n,i+=n}const s=e.bind(this)(...t),o=this[H];let l;for(let e=n;e<i;e++){switch(l=this[e],typeof l){case"object":if(l){for(;e<i;)l=this[e],l&&!l[H]&&(this[e]=X(l)),e++;break}case"undefined":continue}break}return r!==this.length&&Z(o,"length"),Z(o,Symbol.iterator),s},G={push:Q(_.push),unshift:Q(_.unshift),fill:Q(_.fill),sort:Q(_.sort),reverse:Q(_.reverse),pop:Q(_.pop),shift:Q(_.shift),splice:Q(_.splice)},J={get(e,t){if(t!==H){let r=e[t];if(r&&r===_[t]){const n=G[t];if(n)return n.bind(e);r=r.bind(e)}return D(e[H],"length"!==t?Symbol.iterator:t),r}return e},set(e,t,r){if(t!==H){if(e[t]===r)return!0;const n=e[H];return r&&"object"==typeof r&&(r=X(r)),e[t]=r,"length"===t&&Z(n,t),Z(n,Symbol.iterator),!0}return((e,t)=>{const r=t.length,n=e.length;let i;for(let n=0;n<r;n++){let a=t[n];if(a&&"object"==typeof a){do{a=t[n],i=e[n],a?i?i!==a&&(i[H]=a):e[n]=X(a):e[n]=a}while(++n<r);break}if(null!=a){do{e[n]=t[n]}while(++n<r);break}e[n]=a}const a=e[H];n!==r&&(n>r&&(e.length=r),Z(a,"length")),Z(a,Symbol.iterator)})(e,r),!0},has:(e,t)=>(D(e[H],isNaN(parseInt(t))?t:Symbol.iterator),t in e),deleteProperty:(e,t)=>(isNaN(parseInt(t))||(t=Symbol.iterator),void 0!==e[t]&&Z(e[H],t),delete e[t])},K={get(e,t){if(t!==H){const r=e[t];return"id"!==t&&D(e[H],t),r}return e},set(e,t,r,n){if(t!==H){if(e[t]===r)return!0;const n=e[H];return r&&"object"==typeof r&&(r=X(r)),e[t]=r,Z(n,t),!0}return((e,t,r)=>{const n={...e};let i;for(const a in r){delete n[a];const s=r[a];s&&"object"==typeof s&&(i=e[a],i)?i[H]=s:e[a]!==s&&(t[a]=s)}for(const e in n)delete t[e]})(e,n,r),!0},has:(e,t)=>(D(e[H],t),t in e),deleteProperty:(e,t)=>(void 0!==e[t]&&Z(e[H],t),delete e[t])},X=e=>{let t;if(Array.isArray(e)){t=[];const r=e.length;for(let n=0;n<r;n++){let i=e[n];if(i&&"object"==typeof i){do{t[n]=(i=e[n])&&X(i)}while(++n<r);break}if(null!=i){do{t[n]=e[n]}while(++n<r);break}t[n]=i}e=new Proxy(t,J)}else{t={};for(const r in e){const n=e[r];t[r]=n&&"object"==typeof n?X(n):n}e=new Proxy(t,K)}return t[H]={},e},Y=(e,t)=>{t?e.w=!0:e.com.watchMountChange("s",Y,e)},ee=(e,t)=>[e,t,e[t]],te=(e,t)=>{const r=x;if(r.id){let n=W.get(r);if(n){const t=n.e;return n.w?(V=!0,"function"==typeof e&&(e=e()),t[H]=e,V=!1,n.w=!1,r.watchMountChange("s",Y,n)):"function"==typeof e&&(V=!0,(e=e(t))!==t&&(t[H]=e),V=!1),t}"function"==typeof e&&(e=e());const i=X(e);return n={com:r,e:i,w:!1},W.set(r,n),t&&r.watchMountChange("s",Y,n),i}return"function"==typeof e&&(e=e()),X(e)};var re=function(){return re=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},re.apply(this,arguments)},ne=function(e){return void 0===e&&(e={}),{arrayFormat:e.arrayFormat||"none",booleanFormat:e.booleanFormat||"none",nullFormat:e.nullFormat||"default"}},ie=function(e){return encodeURIComponent(e)},ae=function(e){return decodeURIComponent(e)},se=function(e,t){var r=ne(t);return function(e){var t=e.indexOf("?");return-1===t?e:e.slice(t+1)}(e).split("&").reduce((function(e,t){var n=t.split("="),i=n[0],a=n[1],s=function(e){var t=e.indexOf("["),r=-1!==t;return{hasBrackets:r,name:r?e.slice(0,t):e}}(i),o=s.hasBrackets,l=s.name,c=e[l],h=function(e,t){if(void 0===e)return"empty-true"===t.booleanFormat||null;if("string"===t.booleanFormat){if("true"===e)return!0;if("false"===e)return!1}if("unicode"===t.booleanFormat){if("✓"===ae(e))return!0;if("✗"===ae(e))return!1}return"string"===t.nullFormat&&"null"===e?null:ae(e)}(a,r);return e[l]=void 0===c?o?[h]:h:(Array.isArray(c)?c:[c]).concat(h),e}),{})},oe=/[^!$'()*+,;|:]/g,le=function(e){return e.replace(oe,(function(e){return encodeURIComponent(e)}))},ce={default:le,uri:encodeURI,uriComponent:encodeURIComponent,none:function(e){return e},legacy:encodeURI},he={default:decodeURIComponent,uri:decodeURI,uriComponent:decodeURIComponent,none:function(e){return e},legacy:decodeURIComponent},ue=function(e,t,r){var n=ce[t]||le;return r?String(e).split("/").map(n).join("/"):n(String(e))},de=function(e){return"("+(e?e.replace(/(^<|>$)/g,""):"[a-zA-Z0-9-_.~%':|=+\\*@$]+")+")"},fe=[{name:"url-parameter",pattern:/^:([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(<(.+?)>)?/,regex:function(e){return new RegExp(de(e[2]))}},{name:"url-parameter-splat",pattern:/^\*([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/,regex:/([^?]*)/},{name:"url-parameter-matrix",pattern:/^;([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(<(.+?)>)?/,regex:function(e){return new RegExp(";"+e[1]+"="+de(e[2]))}},{name:"query-parameter",pattern:/^(?:\?|&)(?::)?([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/},{name:"delimiter",pattern:/^(\/|\?)/,regex:function(e){return new RegExp("\\"+e[0])}},{name:"sub-delimiter",pattern:/^(!|&|-|_|\.|;)/,regex:function(e){return new RegExp(e[0])}},{name:"fragment",pattern:/^([0-9a-zA-Z]+)/,regex:function(e){return new RegExp(e[0])}}],pe=function e(t,r){if(void 0===r&&(r=[]),!fe.some((function(n){var i=t.match(n.pattern);return!!i&&(r.push({type:n.name,match:i[0],val:i.slice(1,2),otherVal:i.slice(2),regex:n.regex instanceof Function?n.regex(i):n.regex}),i[0].length<t.length&&(r=e(t.substr(i[0].length),r)),!0)})))throw new Error("Could not parse path '"+t+"'");return r},me=function(e){return null!=e},ve={urlParamsEncoding:"default"},ge=function(){function e(e,t){if(!e)throw new Error("Missing path in Path constructor");this.path=e,this.options=re(re({},ve),t),this.tokens=pe(e),this.hasUrlParams=this.tokens.filter((function(e){return/^url-parameter/.test(e.type)})).length>0,this.hasSpatParam=this.tokens.filter((function(e){return/splat$/.test(e.type)})).length>0,this.hasMatrixParams=this.tokens.filter((function(e){return/matrix$/.test(e.type)})).length>0,this.hasQueryParams=this.tokens.filter((function(e){return/^query-parameter/.test(e.type)})).length>0,this.spatParams=this.getParams("url-parameter-splat"),this.urlParams=this.getParams(/^url-parameter/),this.queryParams=this.getParams("query-parameter"),this.params=this.urlParams.concat(this.queryParams),this.source=this.tokens.filter((function(e){return void 0!==e.regex})).map((function(e){return e.regex.source})).join("")}return e.createPath=function(t,r){return new e(t,r)},e.prototype.isQueryParam=function(e){return-1!==this.queryParams.indexOf(e)},e.prototype.isSpatParam=function(e){return-1!==this.spatParams.indexOf(e)},e.prototype.test=function(e,t){var r=this,n=re(re({caseSensitive:!1,strictTrailingSlash:!1},this.options),t),i=function(e,t){return t||"\\/"===e?e:e.replace(/\\\/$/,"")+"(?:\\/)?"}(this.source,n.strictTrailingSlash),a=this.urlTest(e,i+(this.hasQueryParams?"(\\?.*$|$)":"$"),n.caseSensitive,n.urlParamsEncoding);if(!a||!this.hasQueryParams)return a;var s=se(e,n.queryParams);return 0===Object.keys(s).filter((function(e){return!r.isQueryParam(e)})).length?(Object.keys(s).forEach((function(e){return a[e]=s[e]})),a):null},e.prototype.partialTest=function(e,t){var r=this,n=re(re({caseSensitive:!1,delimited:!0},this.options),t),i=function(e,t){return t?/(\/)$/.test(e)?e:e+"(\\/|\\?|\\.|;|$)":e}(this.source,n.delimited),a=this.urlTest(e,i,n.caseSensitive,n.urlParamsEncoding);if(!a)return a;if(!this.hasQueryParams)return a;var s=se(e,n.queryParams);return Object.keys(s).filter((function(e){return r.isQueryParam(e)})).forEach((function(e){return function(e,t,r){void 0===r&&(r="");var n=e[t];return e[t]=void 0===n?r:Array.isArray(n)?n.concat(r):[n,r],e}(a,e,s[e])})),a},e.prototype.build=function(e,t){var r=this;void 0===e&&(e={});var n=re(re({ignoreConstraints:!1,ignoreSearch:!1,queryParams:{}},this.options),t),i=Object.keys(e).filter((function(e){return!r.isQueryParam(e)})).reduce((function(t,i){if(!me(e[i]))return t;var a=e[i],s=r.isSpatParam(i);return"boolean"==typeof a?t[i]=a:Array.isArray(a)?t[i]=a.map((function(e){return ue(e,n.urlParamsEncoding,s)})):t[i]=ue(a,n.urlParamsEncoding,s),t}),{});if(this.urlParams.some((function(t){return!me(e[t])}))){var a=this.urlParams.filter((function(t){return!me(e[t])}));throw new Error("Cannot build path: '"+this.path+"' requires missing parameters { "+a.join(", ")+" }")}if(!n.ignoreConstraints){var s=this.tokens.filter((function(e){return/^url-parameter/.test(e.type)&&!/-splat$/.test(e.type)})).every((function(e){return new RegExp("^"+de(e.otherVal[0])+"$").test(i[e.val])}));if(!s)throw new Error("Some parameters of '"+this.path+"' are of invalid format")}var o=this.tokens.filter((function(e){return!1===/^query-parameter/.test(e.type)})).map((function(e){return"url-parameter-matrix"===e.type?";"+e.val+"="+i[e.val[0]]:/^url-parameter/.test(e.type)?i[e.val[0]]:e.match})).join("");if(n.ignoreSearch)return o;var l=function(e,t){var r=ne(t);return Object.keys(e).filter((function(t){return void 0!==e[t]})).map((function(t){return function(e,t,r){return null===t?function(e,t){return"hidden"===t.nullFormat?"":"string"===t.nullFormat?e+"=null":e}(e,r):"boolean"==typeof t?function(e,t,r){return"empty-true"===r.booleanFormat&&t?e:e+"="+("unicode"===r.booleanFormat?t?"✓":"✗":t.toString())}(e,t,r):Array.isArray(t)?function(e,t,r){var n=function(e){return"index"===e.arrayFormat?function(e,t){return e+"["+t+"]"}:"brackets"===e.arrayFormat?function(e){return e+"[]"}:function(e){return e}}(r);return t.map((function(t,r){return n(e,r)+"="+ie(t)})).join("&")}(e,t,r):e+"="+ie(t)}(t,e[t],r)})).filter(Boolean).join("&")}(this.queryParams.filter((function(t){return-1!==Object.keys(e).indexOf(t)})).reduce((function(t,r){return t[r]=e[r],t}),{}),n.queryParams);return l?o+"?"+l:o},e.prototype.getParams=function(e){var t=e instanceof RegExp?function(t){return e.test(t.type)}:function(t){return t.type===e};return this.tokens.filter(t).map((function(e){return e.val[0]}))},e.prototype.urlTest=function(e,t,r,n){var i=this,a=new RegExp("^"+t,r?"":"i"),s=e.match(a);return s?this.urlParams.length?s.slice(1,this.urlParams.length+1).reduce((function(e,t,r){return e[i.urlParams[r]]=(he[n]||decodeURIComponent)(t),e}),{}):{}:null},e}();let ye=0;const be=te({c:0});window.addEventListener("popstate",(()=>{be.c=++ye}));const we=(e,t)=>{const{pathname:r,search:n,hash:i}=window.location;e!==`${r}${n}${i}`&&(t?window.history.replaceState(void 0,"",e):window.history.pushState(void 0,"",e),queueMicrotask((()=>{be.c=++ye})))},ke="ezhEZH";class xe{constructor(e,t,r){this.com=e,this.b=ge.createPath(t+ke),this.needAuth=r}com;needAuth;parseParam(e){const t=this.b.test(e);if(t)return delete t[ke],t}buildUrl(e){throw new Error("WildcardRoute does not support buildUrl")}b}class Ce{constructor(e,t,r){this.com=e,this.b=ge.createPath(t),this.needAuth=r}com;needAuth;parseParam(e){return this.b.test(e)}buildUrl(e){return this.b.build(e)}b}const Ee=(e,t,r=!0)=>t.endsWith("*")?new xe(e,t,r):new Ce(e,t,r),Pe=({routes:e,notFound:t,checkAuth:r})=>{ye=be.c;const{pathname:n,search:i,hash:a}=window.location,s=`${n}${i}${a}`,{$s:o,$k:l,$c:c}=q;for(const t in e){const n=e[t],i=n.parseParam(s);if(i){if(r&&n.needAuth){const e=r(s);if(e)return void we(e)}return o(l(t),c("_",n.com,i,void 0,i))}}return t?o(l("404"),c("_",t,{})):void 0},Se=(e,t,r)=>{e.preventDefault();const{pathname:n,search:i,hash:a}=window.location;t!==`${n}${i}${a}`&&(r?window.history.replaceState(void 0,"",t):window.history.pushState(void 0,"",t),be.c=++ye)},$e=(e,t)=>{const{href:r,className:n,style:i,title:a,replace:s}=e,o=r?e=>Se(e,r,s):void 0;return q.$("_","a",{className:n,style:i,title:a,href:r,onclick:o},t,-1,1)},je=(e,t)=>{const{route:r,params:n,className:i,style:a,title:s,replace:o}=e,l=r.buildUrl(n);return q.$("_","a",{className:i,style:a,title:s,href:l,onclick:e=>Se(e,l,o)},t,-1,1)};var Ae=t.ye,Re=t.N_,Be=t.Wt,Fe=t.Ix,Oe=t.On,ze=t.er,Ie=t.te,Te=t.oo,Me=t.LU,Ne=t.wE,Le=t.J0;export{Ae as $ezh,Re as Link,Be as RouteLink,Fe as Router,Oe as addComReader,ze as bindData,Ie as configGC,Te as navigate,Me as refreshComReaders,Ne as route,Le as useState};
|
package/lib/index.d.ts
CHANGED
|
@@ -24,10 +24,6 @@ export type BasicObject = {
|
|
|
24
24
|
};
|
|
25
25
|
export type State<T extends StateBasicType> = StateBase<ExcludeNonState<T>>;
|
|
26
26
|
export type ReaderRecord = Record<string | number | symbol, Map<string, number> | undefined>;
|
|
27
|
-
export interface IWrapper<DataT> {
|
|
28
|
-
get buff(): Uint8Array;
|
|
29
|
-
get data(): DataT;
|
|
30
|
-
}
|
|
31
27
|
export interface EzBaseSVGElement {
|
|
32
28
|
id?: string;
|
|
33
29
|
className?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ezh",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "webpack serve"
|
|
6
6
|
},
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"default": "./lib/index.js",
|
|
15
15
|
"types": "./lib/index.d.ts"
|
|
16
16
|
},
|
|
17
|
-
"./debug": {
|
|
17
|
+
"./debug-check": {
|
|
18
18
|
"default": "./lib/debugCheck.js",
|
|
19
19
|
"types": "./lib/debugCheck.d.ts"
|
|
20
20
|
}
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"sass-loader": "^16.0.5",
|
|
42
42
|
"style-loader": "^4.0.0",
|
|
43
43
|
"ts-loader": "^9.5.2",
|
|
44
|
-
"typescript": "^5.
|
|
44
|
+
"typescript": "^5.8.2",
|
|
45
45
|
"webpack": "^5.98.0",
|
|
46
46
|
"webpack-cli": "^6.0.1",
|
|
47
47
|
"webpack-dev-server": "^5.2.0"
|