aberdeen 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/aberdeen.js +13 -3
- package/dist/aberdeen.js.map +3 -3
- package/dist-min/aberdeen.js +3 -3
- package/dist-min/aberdeen.js.map +3 -3
- package/package.json +1 -1
- package/src/aberdeen.ts +17 -2
- package/README.md.bak +0 -212
package/dist-min/aberdeen.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
class m{keyProp;tail;symbols;constructor(J){this.keyProp=J;this.tail={},this.symbols=[Symbol(0)]}add(J){if(this.symbols[0]in J)return!1;let X=1+(Math.clz32(Math.random()*4294967295)>>2);for(let Z=this.symbols.length;Z<X;Z++)this.symbols.push(Symbol(Z));let W=this.keyProp,z=J[W],F,U=this.tail;for(let Z=this.symbols.length-1;Z>=0;Z--){let j=this.symbols[Z];while((F=U[j])&&F[W]>z)U=F;if(Z<X)J[j]=U[j],U[j]=J}return!0}has(J){return this.symbols[0]in J}fetchLast(){let J=this.tail[this.symbols[0]];if(J)return this.remove(J),J}isEmpty(){return this.tail[this.symbols[0]]===void 0}get(J){let X=this.keyProp,W,z=this.tail;for(let F=this.symbols.length-1;F>=0;F--){let U=this.symbols[F];while((W=z[U])&&W[X]>J)z=W}return z[this.symbols[0]]?.[X]===J?z[this.symbols[0]]:void 0}*[Symbol.iterator](){let J=this.symbols[0],X=this.tail[J];while(X)yield X,X=X[J]}prev(J){return J[this.symbols[0]]}remove(J){if(!(this.symbols[0]in J))return!1;let X=this.keyProp,W=J[X],z,F=this.tail;for(let U=this.symbols.length-1;U>=0;U--){let Z=this.symbols[U];while((z=F[Z])&&z[X]>=W&&z!==J)F=z;if(z===J)F[Z]=z[Z],delete z[Z]}return z===J}clear(){let J=this.symbols[0],X=this.tail;while(X){let W=X[J];for(let z of this.symbols){if(!(z in X))break;delete X[z]}X=W}this.tail={}}}var R,h=0,_;function w(J){if(!R)R=new m("prio"),setTimeout(CJ,0);else if(!(h&1)){if(h++,h>98)throw Error("Too many recursive updates from observes")}R.add(J)}function CJ(){let J=Date.now();while(R){let X=R.fetchLast();if(!X)break;if(h&1)h++;X.queueRun()}if(R=void 0,h=0,J=Date.now()-J,J>9)console.debug(`Aberdeen queue took ${J}ms`)}function e(J){if(typeof J==="string")return`${J}\x01`;let X="",W=Math.abs(Math.round(J)),z=J<0;while(W>0)X=String.fromCharCode(z?65534-W%65533:2+W%65533)+X,W=Math.floor(W/65533);return String.fromCharCode(128+(z?-X.length:X.length))+X}function bJ(J){let X="";for(let W=0;W<J.length;W++)X+=String.fromCodePoint(65535-J.charCodeAt(W));return X}var VJ=0;class o{prio=--VJ;onChange(J){w(this)}remove(){let J=this.getLastNode();if(J)S(J,this.getPrecedingNode());this.delete()}}class P extends o{cleaners;constructor(J=[]){super();this.cleaners=J}lastChild;redraw(){}getLastNode(){return D(this.lastChild)}delete(){for(let J of this.cleaners)if(typeof J==="function")J();else J.delete(this);this.cleaners.length=0,R?.remove(this),this.lastChild=void 0}queueRun(){this.remove(),_=this,this.redraw(),_=void 0}getInsertAfterNode(){return this.getLastNode()||this.getPrecedingNode()}onChange(){w(this)}getChildPrevSibling(){return this.lastChild}}class g extends P{el;svg;prevSibling;constructor(J,X,W=!1){super(W?q.cleaners:[]);this.el=J;this.svg=X;if(J===q.el)this.prevSibling=q.getChildPrevSibling(),q.lastChild=this;if(!W)q.cleaners.push(this)}getPrecedingNode(){return D(this.prevSibling)}getChildPrevSibling(){return this.lastChild||this.prevSibling}}class a extends g{renderer;constructor(J,X,W){super(J,X);this.renderer=W;this.redraw()}redraw(){let J=q;q=this;try{this.renderer()}catch(X){t(X,!0)}q=J}}class r extends P{el=document.body;svg=!1;getPrecedingNode(){return}}class ZJ extends P{el;renderer;svg;constructor(J,X){super();this.el=J;this.renderer=X;this.svg=J.namespaceURI==="http://www.w3.org/2000/svg",this.redraw(),q.cleaners.push(this)}redraw(){a.prototype.redraw.call(this)}getPrecedingNode(){return}delete(){S(this.getLastNode(),this.getPrecedingNode()),super.delete()}remove(){this.delete()}}function S(J,X){while(J&&J!==X){let W=J.previousSibling,z=l.get(J);if(z&&J instanceof Element){if(z!==!0){if(typeof z==="function")z(J);else wJ(J,z);l.set(J,!0)}}else J.remove();J=W}}function D(J){if(!J||J instanceof Node)return J;return J.getLastNode()||J.getPrecedingNode()}class jJ extends g{renderer;result=B({value:void 0});constructor(J){super(q.el,q.svg);this.renderer=J;this.redraw()}redraw(){let J=q;q=this;try{this.result.value=this.renderer()}catch(X){t(X,!0)}q=J}}class qJ extends g{key;target;svg=!1;constructor(J,X,W){super(J,J.namespaceURI==="http://www.w3.org/2000/svg");this.key=X;this.target=W;this.redraw()}redraw(){let J=q;q=this,L(this.el,this.key,this.target.value),q=J}}class HJ extends o{renderer;makeSortKey;parentElement=q.el;prevSibling;target;byIndex=new Map;sortedSet=new m("sortKey");changedIndexes=new Set;constructor(J,X,W){super();this.renderer=X;this.makeSortKey=W;let z=this.target=J[H]||J;if(N(z,A,this),this.prevSibling=q.getChildPrevSibling(),q.lastChild=this,q.cleaners.push(this),z instanceof Array)for(let F=0;F<z.length;F++)new x(this,F,!1);else for(let F of z instanceof Map?z.keys():Object.keys(z))new x(this,F,!1)}getPrecedingNode(){return D(this.prevSibling)}onChange(J){if(!(this.target instanceof Array)||typeof J==="number")this.changedIndexes.add(J);w(this)}queueRun(){let J=this.changedIndexes;this.changedIndexes=new Set;for(let X of J){let W=this.byIndex.get(X);if(W)W.remove();if(this.target instanceof Map?this.target.has(X):(X in this.target))new x(this,X,!0);else this.byIndex.delete(X)}_=void 0}delete(){for(let J of this.byIndex.values())J.delete();R?.remove(this),this.byIndex.clear(),setTimeout(()=>{this.sortedSet.clear()},1)}getLastNode(){for(let J of this.sortedSet){let X=J.getActualLastNode();if(X)return X}}}class x extends P{parent;itemIndex;sortKey;el;svg;constructor(J,X,W){super();this.parent=J;this.itemIndex=X;if(this.el=J.parentElement,this.svg=q.svg,this.parent.byIndex.set(this.itemIndex,this),this.lastChild=this,W)_=this;this.redraw()}getPrecedingNode(){this.parent.sortedSet.add(this);let J=this.parent.sortedSet.prev(this);if(J)return D(J.lastChild);return this.parent.getPrecedingNode()}getLastNode(){return this.getPrecedingNode()}getActualLastNode(){let J=this.lastChild;while(J&&J!==this){if(J instanceof Node)return J;let X=J.getLastNode();if(X)return X;J=J.getPrecedingNode()}}queueRun(){if(q!==b)FJ(4);if(this.sortKey!==void 0){let J=this.getActualLastNode();if(J)S(J,this.getPrecedingNode())}this.delete(),this.lastChild=this,_=this,this.redraw(),_=void 0}redraw(){let J,X=this.parent.target,W=this.itemIndex;if(X instanceof Map)J=B(X.get(W)),W=B(W);else J=B(X[W]);let z=q;q=this;let F;try{if(this.parent.makeSortKey){let U=this.parent.makeSortKey(J,W);if(U!=null)F=U instanceof Array?U.map(e).join(""):U}else F=W;if(typeof F==="number")F=e(F);if(this.sortKey!==F)this.parent.sortedSet.remove(this),this.sortKey=F;if(F!=null)this.parent.renderer(J,W)}catch(U){t(U,F!=null)}q=z}getInsertAfterNode(){if(this.sortKey==null)FJ(1);return D(this.lastChild)}remove(){if(this.sortKey!==void 0){let J=this.getActualLastNode();if(J)S(J,this.getPrecedingNode());this.parent.sortedSet.remove(this),this.sortKey=void 0}this.delete()}}function y(J,X){if(J!==q.el){J.appendChild(X);return}let W=q.el,z=q.getInsertAfterNode();W.insertBefore(X,z?z.nextSibling:W.firstChild),q.lastChild=X}var b=new r,q=b;function mJ(J){let X=q;q=new r;try{return J()}finally{q=X}}var A=Symbol("any"),H=Symbol("target"),T=Symbol("mapSize"),p=new WeakMap,i=0;function N(J,X,W=q){if(W===b||i)return;let z=p.get(J);if(!z)p.set(J,z=new Map);if(X!==A&&z.get(A)?.has(W))return;let F=z.get(X);if(!F)z.set(X,F=new Set);if(F.has(W))return;if(F.add(W),W===q)q.cleaners.push(F);else q.cleaners.push(()=>{F.delete(W)})}function u(J,X,W){if(!J||typeof J!=="object")throw Error("onEach requires an object");J=J[H]||J,new HJ(J,X,W)}function $J(J){for(let X of Object.keys(J))return!1;return!0}var K=Symbol("empty");function vJ(J){let X=J[H]||J,W=q;if(X instanceof Array)return N(X,"length",(F,U,Z)=>{if(!U!==!Z)w(W)}),!X.length;if(X instanceof Map)return N(X,T,(F,U,Z)=>{if(!U!==!Z)w(W)}),!X.size;let z=$J(X);return N(X,A,(F,U,Z)=>{if(z?Z===K:U===K)w(W)}),z}function xJ(J){if(J instanceof Array)return n(J,"length");if(J instanceof Map)return n(J,"size");let X=J[H]||J,W=0;for(let F of Object.keys(X))if(X[F]!==void 0)W++;let z=hJ(W);return N(X,A,(F,U,Z)=>{if(Z===U);else if(Z===K)z.value=++W;else if(U===K)z.value=--W}),z}function IJ(J,X,W,z){if(W===z&&W!==void 0)return;let F=p.get(J);if(F===void 0)return;for(let U of[X,A]){let Z=F.get(U);if(Z)for(let j of Z)if(typeof j==="function")j(X,W,z);else j.onChange(X)}}var Q=IJ,RJ={get(J,X){if(X===H)return J;return N(J,X),B(J[X])},set(J,X,W){if(typeof W==="object"&&W)W=W[H]||W;let z=J.hasOwnProperty(X)?J[X]:K;if(W!==z)J[X]=W,Q(J,X,W,z);return!0},deleteProperty(J,X){let W=J.hasOwnProperty(X)?J[X]:K;return delete J[X],Q(J,X,K,W),!0},has(J,X){return N(J,X),J.hasOwnProperty(X)},ownKeys(J){return N(J,A),Reflect.ownKeys(J)}};function LJ(J,X,W){if(typeof W==="object"&&W)W=W[H]||W;let z=J[X];if(z===void 0&&!J.hasOwnProperty(X))z=K;if(W!==z){let F=J.length;if(X==="length"){J.length=W;for(let U=W;U<F;U++)Q(J,U,K,J[U])}else{if(typeof X==="string"){let U=0|X;if(String(U)===X&&U>=0)X=U}J[X]=W,Q(J,X,W,z)}if(J.length!==F)Q(J,"length",J.length,F)}return!0}var _J={get(J,X){if(X===H)return J;if(typeof X==="string"){let W=0|X;if(String(W)===X&&W>=0)X=W}return N(J,X),B(J[X])},set:LJ,deleteProperty(J,X){if(typeof X==="string"){let z=0|X;if(String(z)===X&&z>=0)X=z}let W=J[X];if(W===void 0&&!J.hasOwnProperty(X))W=K;return delete J[X],Q(J,X,K,W),!0}};function JJ(J){return{[Symbol.iterator](){return this},next(){let X=J.next();if(X.done)return X;return{done:!1,value:B(X.value)}}}}function XJ(J){return{[Symbol.iterator](){return this},next(){let X=J.next();if(X.done)return X;return{done:!1,value:[B(X.value[0]),B(X.value[1])]}}}}var WJ={get(J){let X=this[H];if(typeof J==="object"&&J)J=J[H]||J;return N(X,J),B(X.get(J))},set(J,X){let W=this[H];if(typeof J==="object"&&J)J=J[H]||J;if(typeof X==="object"&&X)X=X[H]||X;let z=W.get(J);if(z===void 0&&!W.has(J))z=K;if(X!==z){let F=W.size;W.set(J,X),Q(W,J,X,z),Q(W,T,W.size,F)}return this},delete(J){let X=this[H];if(typeof J==="object"&&J)J=J[H]||J;let W=X.get(J);if(W===void 0&&!X.has(J))W=K;let z=X.delete(J);if(z)Q(X,J,K,W),Q(X,T,X.size,X.size+1);return z},clear(){let J=this[H],X=J.size;for(let W of J.keys())Q(J,W,void 0,J.get(W));J.clear(),Q(J,T,0,X)},has(J){let X=this[H];if(typeof J==="object"&&J)J=J[H]||J;return N(X,J),X.has(J)},keys(){let J=this[H];return N(J,A),JJ(J.keys())},values(){let J=this[H];return N(J,A),JJ(J.values())},entries(){let J=this[H];return N(J,A),XJ(J.entries())},[Symbol.iterator](){let J=this[H];return N(J,A),XJ(J[Symbol.iterator]())}},fJ={get(J,X){if(X===H)return J;if(WJ.hasOwnProperty(X))return WJ[X];if(X==="size")return N(J,T),J.size;return J[X]}},zJ=new WeakMap;function B(J){if(typeof J!=="object"||!J||J[H]!==void 0||f in J)return J;let X=zJ.get(J);if(X)return X;let W;if(J instanceof Array)W=_J;else if(J instanceof Map)W=fJ;else W=RJ;return X=new Proxy(J,W),zJ.set(J,X),X}function hJ(J){if(J instanceof Promise){let X=B({busy:!0});return J.then((W)=>{X.value=W,X.busy=!1}).catch((W)=>{X.error=W,X.busy=!1}),X}return B(typeof J==="object"&&J!==null?J:{value:J})}function QJ(J){return J?J[H]||J:J}var l=new WeakMap;function wJ(J,X){let W=X.split(".").filter((z)=>z);J.classList.add(...W),setTimeout(()=>J.remove(),2000)}function kJ(J,X,W){if(arguments.length>2)return KJ(J,X,W,0);return c(J,X,0)}function KJ(J,X,W,z){let F=OJ(J,X);if(W===F)return!1;if(typeof F==="object"&&F&&typeof W==="object"&&W&&F.constructor===W.constructor)return c(F,W,z);if(W=O(W),J instanceof Map)J.set(X,W);else J[X]=O(W);return!0}function SJ(J,X,W){if(arguments.length>2)return KJ(J,X,W,E);return c(J,X,E)}function c(J,X,W){let z=J[H];if(z)J=z,W|=V;if(z=X[H],z){if(X=z,q!==b&&!i)W|=GJ}return k(J,X,W)}function k(J,X,W){if(W&GJ)N(X,A);let z=!1;if(X instanceof Array&&J instanceof Array){let F=J.length,U=X.length;for(let Z=0;Z<U;Z++){let j=J[Z];if(j===void 0&&!J.hasOwnProperty(Z))j=K;let $=X[Z];if($===void 0&&!X.hasOwnProperty(Z)){if(delete J[Z],W&V)Q(J,Z,K,j);z=!0}else if(j!==$){if($&&typeof $==="object"){if(typeof j==="object"&&j&&$.constructor===j.constructor&&!(f in $)){z=k(j,$,W)||z;continue}$=O($)}if(J[Z]=$,W&V)Q(J,Z,$,j);z=!0}}if(U!==F){if(W&V){for(let Z=U;Z<F;Z++){let j=J[Z];delete J[Z],Q(J,Z,K,j)}J.length=U,Q(J,"length",U,F)}else J.length=U;z=!0}}else if(X instanceof Map&&J instanceof Map){for(let F of X.keys()){let U=X.get(F),Z=J.get(F);if(Z===void 0&&!J.has(F))Z=K;if(Z!==U){if(U&&typeof U==="object"){if(typeof Z==="object"&&Z&&U.constructor===Z.constructor&&!(f in U)){z=k(Z,U,W)||z;continue}U=O(U)}if(J.set(F,U),W&V)Q(J,F,U,Z);z=!0}}if(!(W&E)){for(let F of J.keys())if(!X.has(F)){let U=J.get(F);if(J.delete(F),W&V)Q(J,F,void 0,U);z=!0}}}else if(X.constructor===J.constructor){for(let F of Object.keys(X)){let U=X[F],Z=J.hasOwnProperty(F)?J[F]:K;if(Z!==U){if(U&&typeof U==="object"){if(typeof Z==="object"&&Z&&U.constructor===Z.constructor&&!(f in U)){z=k(Z,U,W)||z;continue}U=O(U)}if(J[F]=U,W&V)Q(J,F,U,Z);z=!0}}if(!(W&E)){for(let F of Object.keys(J))if(!X.hasOwnProperty(F)){let U=J[F];if(delete J[F],W&V&&U!==void 0)Q(J,F,void 0,U);z=!0}}}else throw Error(`Incompatible or non-object types: ${X?.constructor?.name||typeof X} vs ${J?.constructor?.name||typeof J}`);return z}var E=1,GJ=32,V=64,f=Symbol("NO_COPY");Promise.prototype[f]=!0;function O(J){if(f in J)return J;let X=Array.isArray(J)?[]:J instanceof Map?new Map:Object.create(Object.getPrototypeOf(J));return c(X,J,E),X}var YJ={get(J,X){if(X===H)return n(QJ(J.proxy),J.index);if(X==="value")return J.proxy[J.index]},set(J,X,W){if(X==="value")return J.proxy[J.index]=W,!0;return!1}};function n(J,X){return new Proxy({proxy:J,index:X},YJ)}function MJ(J,X){let W,z,F=J.getAttribute("type"),U=QJ(X).value;if(F==="checkbox"){if(U===void 0)X.value=J.checked;W=()=>{J.checked=X.value},z=()=>{X.value=J.checked}}else if(F==="radio"){if(U===void 0&&J.checked)X.value=J.value;W=()=>{J.checked=X.value===J.value},z=()=>{if(J.checked)X.value=J.value}}else{if(z=()=>{X.value=F==="number"||F==="range"?J.value===""?null:+J.value:J.value},U===void 0)z();W=()=>{if(J.value=X.value,J.tagName==="SELECT"&&J.value!=X.value)throw Error(`SELECT has no '${X.value}' OPTION (yet)`)}}TJ(W),J.addEventListener("input",z),Y(()=>{J.removeEventListener("input",z)})}var UJ={create:(J,X)=>{if(q!==_)return;if(typeof X==="function")X(J);else{let W=X.split(".").filter((z)=>z);J.classList.add(...W),(async()=>{J.offsetHeight,J.classList.remove(...W)})()}},destroy:(J,X)=>{l.set(J,X)},html:(J,X)=>{let W=document.createElement(q.el.tagName);W.innerHTML=`${X}`;while(W.firstChild)y(J,W.firstChild)},text:(J,X)=>{y(J,document.createTextNode(X))}};function I(...J){let{el:X,svg:W}=q,z=J.length;for(let F=0;F<z;F++){let U=J[F];if(U==null||U===!1);else if(typeof U==="string"){let Z=U.length,j=0;for(let $=0;$<Z;$=j+1){j=v(U," .=:#",$);let M=U[j];if(M===":"||M==="="){let G=U.substring($,j);if(M===":")G="$"+G;if(j+1>=Z){L(X,G,J[++F]);break}if(U[j+1]==='"'){let C=v(U,'"',j+2),d=U.substring(j+2,C);L(X,G,d),j=C}else{let C=v(U," ",j+1),d=U.substring(j+1,C);L(X,G,d),j=C}}else{if(j>$){let G=U.substring($,j);W||=G==="svg";let C=W?document.createElementNS("http://www.w3.org/2000/svg",G):document.createElement(G);y(X,C),X=C}if(M==="#"){let G=j+1<Z?U.substring(j+1):J[++F];L(X,"text",G);break}if(M==="."){let G=v(U," #=.",j+1);if(U[G]==="="&&G+1>=Z)L(X,U.substring(j,G),J[++F]),j=G;else{let C=U.substring(j+1,G);X.classList.add(C||J[++F]),j=G-1}}}}}else if(typeof U==="object")if(U.constructor!==Object)if(U instanceof Node){if(y(X,U),U instanceof Element)X=U,W=U.namespaceURI==="http://www.w3.org/2000/svg"}else throw Error(`Unexpected argument: ${U}`);else for(let Z of Object.keys(U))L(X,Z,U[Z]);else if(typeof U==="function")new a(X,W,U);else throw Error(`Unexpected argument: ${U}`)}return X}function v(J,X,W){if(X.length===1){let F=J.indexOf(X,W);return F>=0?F:J.length}let z=J.length;for(let F=W;F<z;F++)if(X.indexOf(J[F])>=0)return F;return z}var NJ=0;function yJ(J,X=!1){let W=X?"":`.AbdStl${++NJ}`,z=s(J,W);if(z)I(`style#${z}`);return W}function s(J,X){let W="",z="";for(let F of Object.keys(J)){let U=J[F];for(let Z of F.split(/, ?/g))if(U&&typeof U==="object")if(Z.startsWith("@"))z+=`${Z}{
|
|
1
|
+
class m{keyProp;tail;symbols;constructor(J){this.keyProp=J;this.tail={},this.symbols=[Symbol(0)]}add(J){if(this.symbols[0]in J)return!1;let X=1+(Math.clz32(Math.random()*4294967295)>>2);for(let Z=this.symbols.length;Z<X;Z++)this.symbols.push(Symbol(Z));let W=this.keyProp,z=J[W],F,U=this.tail;for(let Z=this.symbols.length-1;Z>=0;Z--){let j=this.symbols[Z];while((F=U[j])&&F[W]>z)U=F;if(Z<X)J[j]=U[j],U[j]=J}return!0}has(J){return this.symbols[0]in J}fetchLast(){let J=this.tail[this.symbols[0]];if(J)return this.remove(J),J}isEmpty(){return this.tail[this.symbols[0]]===void 0}get(J){let X=this.keyProp,W,z=this.tail;for(let F=this.symbols.length-1;F>=0;F--){let U=this.symbols[F];while((W=z[U])&&W[X]>J)z=W}return z[this.symbols[0]]?.[X]===J?z[this.symbols[0]]:void 0}*[Symbol.iterator](){let J=this.symbols[0],X=this.tail[J];while(X)yield X,X=X[J]}prev(J){return J[this.symbols[0]]}remove(J){if(!(this.symbols[0]in J))return!1;let X=this.keyProp,W=J[X],z,F=this.tail;for(let U=this.symbols.length-1;U>=0;U--){let Z=this.symbols[U];while((z=F[Z])&&z[X]>=W&&z!==J)F=z;if(z===J)F[Z]=z[Z],delete z[Z]}return z===J}clear(){let J=this.symbols[0],X=this.tail;while(X){let W=X[J];for(let z of this.symbols){if(!(z in X))break;delete X[z]}X=W}this.tail={}}}var L,w=0,_;function f(J){if(!L)L=new m("prio"),setTimeout(IJ,0);else if(!(w&1)){if(w++,w>98)throw Error("Too many recursive updates from observes")}L.add(J)}function IJ(){let J=Date.now();while(L){let X=L.fetchLast();if(!X)break;if(w&1)w++;X.queueRun()}if(L=void 0,w=0,J=Date.now()-J,J>9)console.debug(`Aberdeen queue took ${J}ms`)}function e(J){if(typeof J==="string")return`${J}\x01`;let X="",W=Math.abs(Math.round(J)),z=J<0;while(W>0)X=String.fromCharCode(z?65534-W%65533:2+W%65533)+X,W=Math.floor(W/65533);return String.fromCharCode(128+(z?-X.length:X.length))+X}function mJ(J){let X="";for(let W=0;W<J.length;W++)X+=String.fromCodePoint(65535-J.charCodeAt(W));return X}var ZJ=0;class o{prio=--ZJ;onChange(J){f(this)}remove(){let J=this.getLastNode();if(J)S(J,this.getPrecedingNode());this.delete()}}class jJ{queueRun;prio=--ZJ;constructor(J){this.queueRun=J;f(this)}}class P extends o{cleaners;constructor(J=[]){super();this.cleaners=J}lastChild;redraw(){}getLastNode(){return D(this.lastChild)}delete(){for(let J of this.cleaners)if(typeof J==="function")J();else J.delete(this);this.cleaners.length=0,L?.remove(this),this.lastChild=void 0}queueRun(){this.remove(),_=this,this.redraw(),_=void 0}getInsertAfterNode(){return this.getLastNode()||this.getPrecedingNode()}onChange(){f(this)}getChildPrevSibling(){return this.lastChild}}class g extends P{el;svg;prevSibling;constructor(J,X,W=!1){super(W?q.cleaners:[]);this.el=J;this.svg=X;if(J===q.el)this.prevSibling=q.getChildPrevSibling(),q.lastChild=this;if(!W)q.cleaners.push(this)}getPrecedingNode(){return D(this.prevSibling)}getChildPrevSibling(){return this.lastChild||this.prevSibling}}class a extends g{renderer;constructor(J,X,W){super(J,X);this.renderer=W;this.redraw()}redraw(){let J=q;q=this;try{this.renderer()}catch(X){t(X,!0)}q=J}}class r extends P{el=document.body;svg=!1;getPrecedingNode(){return}}class qJ extends P{el;renderer;svg;constructor(J,X){super();this.el=J;this.renderer=X;this.svg=J.namespaceURI==="http://www.w3.org/2000/svg",this.redraw(),q.cleaners.push(this)}redraw(){a.prototype.redraw.call(this)}getPrecedingNode(){return}delete(){S(this.getLastNode(),this.getPrecedingNode()),super.delete()}remove(){this.delete()}}function S(J,X){while(J&&J!==X){let W=J.previousSibling,z=l.get(J);if(z&&J instanceof Element){if(z!==!0){if(typeof z==="function")z(J);else YJ(J,z);l.set(J,!0)}}else J.remove();J=W}}function D(J){if(!J||J instanceof Node)return J;return J.getLastNode()||J.getPrecedingNode()}class HJ extends g{renderer;result=B({value:void 0});constructor(J){super(q.el,q.svg);this.renderer=J;this.redraw()}redraw(){let J=q;q=this;try{this.result.value=this.renderer()}catch(X){t(X,!0)}q=J}}class $J extends g{key;target;svg=!1;constructor(J,X,W){super(J,J.namespaceURI==="http://www.w3.org/2000/svg");this.key=X;this.target=W;this.redraw()}redraw(){let J=q;q=this,R(this.el,this.key,this.target.value),q=J}}class QJ extends o{renderer;makeSortKey;parentElement=q.el;prevSibling;target;byIndex=new Map;sortedSet=new m("sortKey");changedIndexes=new Set;constructor(J,X,W){super();this.renderer=X;this.makeSortKey=W;let z=this.target=J[H]||J;if(N(z,A,this),this.prevSibling=q.getChildPrevSibling(),q.lastChild=this,q.cleaners.push(this),z instanceof Array)for(let F=0;F<z.length;F++)new x(this,F,!1);else for(let F of z instanceof Map?z.keys():Object.keys(z))new x(this,F,!1)}getPrecedingNode(){return D(this.prevSibling)}onChange(J){if(!(this.target instanceof Array)||typeof J==="number")this.changedIndexes.add(J);f(this)}queueRun(){let J=this.changedIndexes;this.changedIndexes=new Set;for(let X of J){let W=this.byIndex.get(X);if(W)W.remove();if(this.target instanceof Map?this.target.has(X):(X in this.target))new x(this,X,!0);else this.byIndex.delete(X)}_=void 0}delete(){for(let J of this.byIndex.values())J.delete();L?.remove(this),this.byIndex.clear(),setTimeout(()=>{this.sortedSet.clear()},1)}getLastNode(){for(let J of this.sortedSet){let X=J.getActualLastNode();if(X)return X}}}class x extends P{parent;itemIndex;sortKey;el;svg;constructor(J,X,W){super();this.parent=J;this.itemIndex=X;if(this.el=J.parentElement,this.svg=q.svg,this.parent.byIndex.set(this.itemIndex,this),this.lastChild=this,W)_=this;this.redraw()}getPrecedingNode(){this.parent.sortedSet.add(this);let J=this.parent.sortedSet.prev(this);if(J)return D(J.lastChild);return this.parent.getPrecedingNode()}getLastNode(){return this.getPrecedingNode()}getActualLastNode(){let J=this.lastChild;while(J&&J!==this){if(J instanceof Node)return J;let X=J.getLastNode();if(X)return X;J=J.getPrecedingNode()}}queueRun(){if(q!==b)FJ(4);if(this.sortKey!==void 0){let J=this.getActualLastNode();if(J)S(J,this.getPrecedingNode())}this.delete(),this.lastChild=this,_=this,this.redraw(),_=void 0}redraw(){let J,X=this.parent.target,W=this.itemIndex;if(X instanceof Map)J=B(X.get(W)),W=B(W);else J=B(X[W]);let z=q;q=this;let F;try{if(this.parent.makeSortKey){let U=this.parent.makeSortKey(J,W);if(U!=null)F=U instanceof Array?U.map(e).join(""):U}else F=W;if(typeof F==="number")F=e(F);if(this.sortKey!==F)this.parent.sortedSet.remove(this),this.sortKey=F;if(F!=null)this.parent.renderer(J,W)}catch(U){t(U,F!=null)}q=z}getInsertAfterNode(){if(this.sortKey==null)FJ(1);return D(this.lastChild)}remove(){if(this.sortKey!==void 0){let J=this.getActualLastNode();if(J)S(J,this.getPrecedingNode());this.parent.sortedSet.remove(this),this.sortKey=void 0}this.delete()}}function y(J,X){if(J!==q.el){J.appendChild(X);return}let W=q.el,z=q.getInsertAfterNode();W.insertBefore(X,z?z.nextSibling:W.firstChild),q.lastChild=X}var b=new r,q=b;function vJ(J){let X=q;q=new r;try{return J()}finally{q=X}}var A=Symbol("any"),H=Symbol("target"),T=Symbol("mapSize"),p=new WeakMap,i=0;function N(J,X,W=q){if(W===b||i)return;let z=p.get(J);if(!z)p.set(J,z=new Map);if(X!==A&&z.get(A)?.has(W))return;let F=z.get(X);if(!F)z.set(X,F=new Set);if(F.has(W))return;if(F.add(W),W===q)q.cleaners.push(F);else q.cleaners.push(()=>{F.delete(W)})}function u(J,X,W){if(!J||typeof J!=="object")throw Error("onEach requires an object");J=J[H]||J,new QJ(J,X,W)}function KJ(J){for(let X of Object.keys(J))return!1;return!0}var K=Symbol("empty");function xJ(J){let X=J[H]||J,W=q;if(X instanceof Array)return N(X,"length",(F,U,Z)=>{if(!U!==!Z)f(W)}),!X.length;if(X instanceof Map)return N(X,T,(F,U,Z)=>{if(!U!==!Z)f(W)}),!X.size;let z=KJ(X);return N(X,A,(F,U,Z)=>{if(z?Z===K:U===K)f(W)}),z}function kJ(J){if(J instanceof Array)return n(J,"length");if(J instanceof Map)return n(J,"size");let X=J[H]||J,W=0;for(let F of Object.keys(X))if(X[F]!==void 0)W++;let z=wJ(W);return N(X,A,(F,U,Z)=>{if(Z===U);else if(Z===K)z.value=++W;else if(U===K)z.value=--W}),z}function LJ(J,X,W,z){if(W===z&&W!==void 0)return;let F=p.get(J);if(F===void 0)return;for(let U of[X,A]){let Z=F.get(U);if(Z)for(let j of Z)if(typeof j==="function")j(X,W,z);else j.onChange(X)}}var Q=LJ,RJ={get(J,X){if(X===H)return J;return N(J,X),B(J[X])},set(J,X,W){if(typeof W==="object"&&W)W=W[H]||W;let z=J.hasOwnProperty(X)?J[X]:K;if(W!==z)J[X]=W,Q(J,X,W,z);return!0},deleteProperty(J,X){let W=J.hasOwnProperty(X)?J[X]:K;return delete J[X],Q(J,X,K,W),!0},has(J,X){return N(J,X),J.hasOwnProperty(X)},ownKeys(J){return N(J,A),Reflect.ownKeys(J)}};function _J(J,X,W){if(typeof W==="object"&&W)W=W[H]||W;let z=J[X];if(z===void 0&&!J.hasOwnProperty(X))z=K;if(W!==z){let F=J.length;if(X==="length"){J.length=W;for(let U=W;U<F;U++)Q(J,U,K,J[U])}else{if(typeof X==="string"){let U=0|X;if(String(U)===X&&U>=0)X=U}J[X]=W,Q(J,X,W,z)}if(J.length!==F)Q(J,"length",J.length,F)}return!0}var fJ={get(J,X){if(X===H)return J;if(typeof X==="string"){let W=0|X;if(String(W)===X&&W>=0)X=W}return N(J,X),B(J[X])},set:_J,deleteProperty(J,X){if(typeof X==="string"){let z=0|X;if(String(z)===X&&z>=0)X=z}let W=J[X];if(W===void 0&&!J.hasOwnProperty(X))W=K;return delete J[X],Q(J,X,K,W),!0}};function JJ(J){return{[Symbol.iterator](){return this},next(){let X=J.next();if(X.done)return X;return{done:!1,value:B(X.value)}}}}function XJ(J){return{[Symbol.iterator](){return this},next(){let X=J.next();if(X.done)return X;return{done:!1,value:[B(X.value[0]),B(X.value[1])]}}}}var WJ={get(J){let X=this[H];if(typeof J==="object"&&J)J=J[H]||J;return N(X,J),B(X.get(J))},set(J,X){let W=this[H];if(typeof J==="object"&&J)J=J[H]||J;if(typeof X==="object"&&X)X=X[H]||X;let z=W.get(J);if(z===void 0&&!W.has(J))z=K;if(X!==z){let F=W.size;W.set(J,X),Q(W,J,X,z),Q(W,T,W.size,F)}return this},delete(J){let X=this[H];if(typeof J==="object"&&J)J=J[H]||J;let W=X.get(J);if(W===void 0&&!X.has(J))W=K;let z=X.delete(J);if(z)Q(X,J,K,W),Q(X,T,X.size,X.size+1);return z},clear(){let J=this[H],X=J.size;for(let W of J.keys())Q(J,W,void 0,J.get(W));J.clear(),Q(J,T,0,X)},has(J){let X=this[H];if(typeof J==="object"&&J)J=J[H]||J;return N(X,J),X.has(J)},keys(){let J=this[H];return N(J,A),JJ(J.keys())},values(){let J=this[H];return N(J,A),JJ(J.values())},entries(){let J=this[H];return N(J,A),XJ(J.entries())},[Symbol.iterator](){let J=this[H];return N(J,A),XJ(J[Symbol.iterator]())}},hJ={get(J,X){if(X===H)return J;if(WJ.hasOwnProperty(X))return WJ[X];if(X==="size")return N(J,T),J.size;return J[X]}},zJ=new WeakMap;function B(J){if(typeof J!=="object"||!J||J[H]!==void 0||h in J)return J;let X=zJ.get(J);if(X)return X;let W;if(J instanceof Array)W=fJ;else if(J instanceof Map)W=hJ;else W=RJ;return X=new Proxy(J,W),zJ.set(J,X),X}function wJ(J){if(J instanceof Promise){let X=B({busy:!0});return J.then((W)=>{X.value=W,X.busy=!1}).catch((W)=>{X.error=W,X.busy=!1}),X}return B(typeof J==="object"&&J!==null?J:{value:J})}function GJ(J){return J?J[H]||J:J}var l=new WeakMap;function YJ(J,X){let W=X.split(".").filter((z)=>z);J.classList.add(...W),setTimeout(()=>J.remove(),2000)}function SJ(J,X,W){if(arguments.length>2)return NJ(J,X,W,0);return c(J,X,0)}function NJ(J,X,W,z){let F=DJ(J,X);if(W===F)return!1;if(typeof F==="object"&&F&&typeof W==="object"&&W&&F.constructor===W.constructor)return c(F,W,z);if(W=O(W),J instanceof Map)J.set(X,W);else J[X]=O(W);return!0}function yJ(J,X,W){if(arguments.length>2)return NJ(J,X,W,E);return c(J,X,E)}function c(J,X,W){let z=J[H];if(z)J=z,W|=V;if(z=X[H],z){if(X=z,q!==b&&!i)W|=BJ}return k(J,X,W)}function k(J,X,W){if(W&BJ)N(X,A);let z=!1;if(X instanceof Array&&J instanceof Array){let F=J.length,U=X.length;for(let Z=0;Z<U;Z++){let j=J[Z];if(j===void 0&&!J.hasOwnProperty(Z))j=K;let $=X[Z];if($===void 0&&!X.hasOwnProperty(Z)){if(delete J[Z],W&V)Q(J,Z,K,j);z=!0}else if(j!==$){if($&&typeof $==="object"){if(typeof j==="object"&&j&&$.constructor===j.constructor&&!(h in $)){z=k(j,$,W)||z;continue}$=O($)}if(J[Z]=$,W&V)Q(J,Z,$,j);z=!0}}if(U!==F){if(W&V){for(let Z=U;Z<F;Z++){let j=J[Z];delete J[Z],Q(J,Z,K,j)}J.length=U,Q(J,"length",U,F)}else J.length=U;z=!0}}else if(X instanceof Map&&J instanceof Map){for(let F of X.keys()){let U=X.get(F),Z=J.get(F);if(Z===void 0&&!J.has(F))Z=K;if(Z!==U){if(U&&typeof U==="object"){if(typeof Z==="object"&&Z&&U.constructor===Z.constructor&&!(h in U)){z=k(Z,U,W)||z;continue}U=O(U)}if(J.set(F,U),W&V)Q(J,F,U,Z);z=!0}}if(!(W&E)){for(let F of J.keys())if(!X.has(F)){let U=J.get(F);if(J.delete(F),W&V)Q(J,F,void 0,U);z=!0}}}else if(X.constructor===J.constructor){for(let F of Object.keys(X)){let U=X[F],Z=J.hasOwnProperty(F)?J[F]:K;if(Z!==U){if(U&&typeof U==="object"){if(typeof Z==="object"&&Z&&U.constructor===Z.constructor&&!(h in U)){z=k(Z,U,W)||z;continue}U=O(U)}if(J[F]=U,W&V)Q(J,F,U,Z);z=!0}}if(!(W&E)){for(let F of Object.keys(J))if(!X.hasOwnProperty(F)){let U=J[F];if(delete J[F],W&V&&U!==void 0)Q(J,F,void 0,U);z=!0}}}else throw Error(`Incompatible or non-object types: ${X?.constructor?.name||typeof X} vs ${J?.constructor?.name||typeof J}`);return z}var E=1,BJ=32,V=64,h=Symbol("NO_COPY");Promise.prototype[h]=!0;function O(J){if(h in J)return J;let X=Array.isArray(J)?[]:J instanceof Map?new Map:Object.create(Object.getPrototypeOf(J));return c(X,J,E),X}var MJ={get(J,X){if(X===H)return n(GJ(J.proxy),J.index);if(X==="value")return J.proxy[J.index]},set(J,X,W){if(X==="value")return J.proxy[J.index]=W,!0;return!1}};function n(J,X){return new Proxy({proxy:J,index:X},MJ)}function TJ(J,X){let W,z,F=J.getAttribute("type"),U=GJ(X).value;if(F==="checkbox"){if(U===void 0)X.value=J.checked;W=()=>{J.checked=X.value},z=()=>{X.value=J.checked}}else if(F==="radio"){if(U===void 0&&J.checked)X.value=J.value;W=()=>{J.checked=X.value===J.value},z=()=>{if(J.checked)X.value=J.value}}else{if(z=()=>{X.value=F==="number"||F==="range"?J.value===""?null:+J.value:J.value},U===void 0)z();W=()=>{if(J.value=X.value,J.tagName==="SELECT"&&J.value!=X.value)new jJ(()=>J.value=X.value)}}OJ(W),J.addEventListener("input",z),Y(()=>{J.removeEventListener("input",z)})}var UJ={create:(J,X)=>{if(q!==_)return;if(typeof X==="function")X(J);else{let W=X.split(".").filter((z)=>z);J.classList.add(...W),(async()=>{J.offsetHeight,J.classList.remove(...W)})()}},destroy:(J,X)=>{l.set(J,X)},html:(J,X)=>{let W=document.createElement(q.el.tagName);W.innerHTML=`${X}`;while(W.firstChild)y(J,W.firstChild)},text:(J,X)=>{y(J,document.createTextNode(X))}};function I(...J){let{el:X,svg:W}=q,z=J.length;for(let F=0;F<z;F++){let U=J[F];if(U==null||U===!1);else if(typeof U==="string"){let Z=U.length,j=0;for(let $=0;$<Z;$=j+1){j=v(U," .=:#",$);let M=U[j];if(M===":"||M==="="){let G=U.substring($,j);if(M===":")G="$"+G;if(j+1>=Z){R(X,G,J[++F]);break}if(U[j+1]==='"'){let C=v(U,'"',j+2),d=U.substring(j+2,C);R(X,G,d),j=C}else{let C=v(U," ",j+1),d=U.substring(j+1,C);R(X,G,d),j=C}}else{if(j>$){let G=U.substring($,j);W||=G==="svg";let C=W?document.createElementNS("http://www.w3.org/2000/svg",G):document.createElement(G);y(X,C),X=C}if(M==="#"){let G=j+1<Z?U.substring(j+1):J[++F];R(X,"text",G);break}if(M==="."){let G=v(U," #=.",j+1);if(U[G]==="="&&G+1>=Z)R(X,U.substring(j,G),J[++F]),j=G;else{let C=U.substring(j+1,G);X.classList.add(C||J[++F]),j=G-1}}}}}else if(typeof U==="object")if(U.constructor!==Object)if(U instanceof Node){if(y(X,U),U instanceof Element)X=U,W=U.namespaceURI==="http://www.w3.org/2000/svg"}else throw Error(`Unexpected argument: ${U}`);else for(let Z of Object.keys(U))R(X,Z,U[Z]);else if(typeof U==="function")new a(X,W,U);else throw Error(`Unexpected argument: ${U}`)}return X}function v(J,X,W){if(X.length===1){let F=J.indexOf(X,W);return F>=0?F:J.length}let z=J.length;for(let F=W;F<z;F++)if(X.indexOf(J[F])>=0)return F;return z}var AJ=0;function iJ(J,X=!1){let W=X?"":`.AbdStl${++AJ}`,z=s(J,W);if(z)I(`style#${z}`);return W}function s(J,X){let W="",z="";for(let F of Object.keys(J)){let U=J[F];for(let Z of F.split(/, ?/g))if(U&&typeof U==="object")if(Z.startsWith("@"))z+=`${Z}{
|
|
2
2
|
${s(U,X)}}
|
|
3
3
|
`;else z+=s(U,Z.includes("&")?Z.replace(/&/g,X):`${X} ${Z}`);else W+=`${Z.replace(/[A-Z]/g,(j)=>`-${j.toLowerCase()}`)}:${U};`}if(W)z=`${X.trimStart()||"*"}{${W}}
|
|
4
|
-
${z}`;return z}function
|
|
4
|
+
${z}`;return z}function R(J,X,W){if(typeof W==="object"&&W!==null&&W[H])if(X==="bind")TJ(J,W);else new $J(J,X,W);else if(X[0]==="."){let z=X.substring(1).split(".");if(W)J.classList.add(...z);else J.classList.remove(...z)}else if(X[0]==="$"){let z=X.substring(1);if(W==null||W===!1)J.style[z]="";else J.style[z]=`${W}`}else if(W==null);else if(X in UJ)UJ[X](J,W);else if(typeof W==="function"){if(J.addEventListener(X,W),J===q.el)Y(()=>J.removeEventListener(X,W))}else if(W===!0||W===!1||X==="value"||X==="selectedIndex")J[X]=W;else J.setAttribute(X,W)}function CJ(J){return console.error("Error while in Aberdeen render:",J),!0}var VJ=CJ;function gJ(J){VJ=J||CJ}function uJ(){return q.el}function Y(J){q.cleaners.push(J)}function OJ(J){return new HJ(J).result}function cJ(J,X){new qJ(J,X)}function dJ(){b.remove(),AJ=0}function DJ(J,X){i++;try{if(arguments.length===1)return J();else return J instanceof Map?J.get(X):J[X]}finally{i--}}function pJ(J,X){let W;if(J instanceof Array)W=B([]);else if(J instanceof Map)W=B(new Map);else W=B({});return u(J,(z,F)=>{let U=X(z,F);if(U!==void 0)if(W instanceof Map)W.set(F,U),Y(()=>{W.delete(F)});else W[F]=U,Y(()=>{delete W[F]})}),W}function lJ(J,X){let W=B({});return u(J,(z,F)=>{let U=X(z,F);if(U){for(let Z of Object.keys(U))W[Z]=U[Z];Y(()=>{for(let Z of Object.keys(U))delete W[Z]})}}),W}function nJ(J,X){let W={},z=B(W);return u(J,(F,U)=>{let Z=X(F,U);if(Z!=null){let j=Z instanceof Array?Z:[Z];if(j.length){for(let $ of j)if(W[$])z[$][U]=F;else z[$]={[U]:F};Y(()=>{for(let $ of j)if(delete z[$][U],KJ(W[$]))delete z[$]})}}}),z}function EJ(J){if(J&&typeof J==="object"){let X=J.constructor.name.toLowerCase()||"unknown object";if(I(`#<${X}>`),h in J)I("# [NO_COPY]");else I("ul",()=>{u(J,(W,z)=>{I("li",()=>{I(`#${JSON.stringify(z)}: `),EJ(W)})})})}else if(J!==void 0)I("#"+JSON.stringify(J));return J}function FJ(J){throw Error(`Aberdeen internal error ${J}`)}function t(J,X){try{if(VJ(J)===!1)X=!1}catch(W){console.error(W)}try{if(X)I("div.aberdeen-error#Error")}catch{}}function sJ(J,X){let W=Q;Q=J;try{X()}finally{Q=W}}export{sJ as withEmitHandler,GJ as unproxy,dJ as unmountAll,gJ as setErrorHandler,IJ as runQueue,n as ref,wJ as proxy,DJ as peek,nJ as partition,u as onEach,lJ as multiMap,cJ as mount,yJ as merge,pJ as map,vJ as leakScope,xJ as isEmpty,mJ as invertString,iJ as insertCss,uJ as getParentElement,EJ as dump,OJ as derive,LJ as defaultEmitHandler,kJ as count,SJ as copy,O as clone,Y as clean,h as NO_COPY,I as $};
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
6
|
+
//# debugId=3210A06A1A2AF9CE64756E2164756E21
|
|
7
7
|
//# sourceMappingURL=aberdeen.js.map
|