Comparing version 0.3.24 to 0.3.25
@@ -209,4 +209,4 @@ import { CancellationToken } from '../utilities/cancellation_token'; | ||
toArray(): T[]; | ||
sort(comparator: (a: T, b: T) => number, cancellationToken?: CancellationToken): SortedArrayView<T>; | ||
map<D>(mapper: (data: T) => D, cancellationToken?: CancellationToken): MappedArrayView<T, D>; | ||
sort(comparator: (a: T, b: T) => number, dependencies?: DataSource<any>[], cancellationToken?: CancellationToken): SortedArrayView<T>; | ||
map<D>(mapper: (data: T) => D, dependencies?: DataSource<any>[], cancellationToken?: CancellationToken): MappedArrayView<T, D>; | ||
filter(callback: Predicate<T>, dependencies?: DataSource<any>[], cancellationToken?: CancellationToken): FilteredArrayView<T>; | ||
@@ -217,8 +217,12 @@ forEach(callbackfn: (value: T, index: number, array: T[]) => void): void; | ||
export declare class MappedArrayView<D, T> extends ArrayDataSource<T> { | ||
private parent; | ||
private mapper; | ||
constructor(parent: ArrayDataSource<D>, mapper: (a: D) => T, cancellationToken?: CancellationToken); | ||
refresh(): void; | ||
} | ||
export declare class SortedArrayView<T> extends ArrayDataSource<T> { | ||
private comparator; | ||
private parent; | ||
constructor(parent: ArrayDataSource<T>, comparator: (a: T, b: T) => number, cancellationToken?: CancellationToken); | ||
refresh(): void; | ||
} | ||
@@ -225,0 +229,0 @@ export declare class FilteredArrayView<T> extends ArrayDataSource<T> { |
@@ -513,7 +513,15 @@ import { EventEmitter } from '../utilities/event_emitter'; | ||
} | ||
sort(comparator, cancellationToken) { | ||
return new SortedArrayView(this, comparator, cancellationToken); | ||
sort(comparator, dependencies = [], cancellationToken) { | ||
const view = new SortedArrayView(this, comparator, cancellationToken); | ||
dependencies.forEach((dep) => { | ||
dep.unique().listen(() => view.refresh()); | ||
}); | ||
return view; | ||
} | ||
map(mapper, cancellationToken) { | ||
return new MappedArrayView(this, mapper, cancellationToken); | ||
map(mapper, dependencies = [], cancellationToken) { | ||
const view = new MappedArrayView(this, mapper, cancellationToken); | ||
dependencies.forEach((dep) => { | ||
dep.unique().listen(() => view.refresh()); | ||
}); | ||
return view; | ||
} | ||
@@ -538,2 +546,3 @@ filter(callback, dependencies = [], cancellationToken) { | ||
super(initial); | ||
this.parent = parent; | ||
this.mapper = mapper; | ||
@@ -569,2 +578,8 @@ parent.listen((change) => { | ||
} | ||
refresh() { | ||
this.clear(); | ||
//@ts-ignore | ||
const data = this.parent.data.map(this.mapper); | ||
this.merge(data); | ||
} | ||
} | ||
@@ -579,6 +594,6 @@ export class SortedArrayView extends ArrayDataSource { | ||
case 'removeLeft': | ||
this.removeLeft(change.count); | ||
break; | ||
case 'removeRight': | ||
this.removeRight(change.count); | ||
for (const item of change.items) { | ||
this.remove(item); | ||
} | ||
break; | ||
@@ -589,3 +604,3 @@ case 'remove': | ||
case 'clear': | ||
this.data.length = 0; | ||
this.clear(); | ||
break; | ||
@@ -597,3 +612,3 @@ case 'prepend': | ||
case 'append': | ||
this.push(...change.items); | ||
this.merge(change.items); | ||
this.data.sort(this.comparator); | ||
@@ -610,2 +625,6 @@ break; | ||
} | ||
refresh() { | ||
this.clear(); | ||
this.merge(this.parent.getData().sort(this.comparator)); | ||
} | ||
} | ||
@@ -641,3 +660,3 @@ export class FilteredArrayView extends ArrayDataSource { | ||
filteredItems = change.items.filter(this.viewFilter); | ||
this.push(...filteredItems); | ||
this.merge(filteredItems); | ||
break; | ||
@@ -685,5 +704,5 @@ case 'swap': | ||
const data = this.parent.data.filter(this.viewFilter); | ||
this.push(...data); | ||
this.merge(data); | ||
} | ||
} | ||
//# sourceMappingURL=data_source.js.map |
{ | ||
"name": "aurumjs", | ||
"version": "0.3.24", | ||
"version": "0.3.25", | ||
"description": "Fast and concise declarative DOM rendering library for javascript", | ||
@@ -5,0 +5,0 @@ "main": "dist/aurum.js", |
@@ -1,2 +0,2 @@ | ||
var t=function(){this.subscribeChannel=[],this.onAfterFire=[]},e={subscriptions:{configurable:!0}};e.subscriptions.get=function(){return this.subscribeChannel.length},t.prototype.subscribe=function(t,e){return this.createSubscription(t,this.subscribeChannel,e).facade},t.prototype.hasSubscriptions=function(){return this.subscriptions>0},t.prototype.cancelAll=function(){var t=this;this.isFiring?this.onAfterFire.push(function(){return t.subscribeChannel.length=0}):this.subscribeChannel.length=0},t.prototype.afterFire=function(){this.onAfterFire.length>0&&(this.onAfterFire.forEach(function(t){return t()}),this.onAfterFire.length=0)},t.prototype.fire=function(t){this.isFiring=!0;for(var e=this.subscribeChannel.length,n=0;n<e;n++)this.subscribeChannel[n].callback(t);this.isFiring=!1,this.afterFire()},t.prototype.createSubscription=function(t,e,n){var o=this,r={callback:t},i={cancel:function(){o.cancel(r,e)}};return void 0!==n&&n.addCancelable(function(){return o.cancel(r,e)}),e.push(r),{subscription:r,facade:i}},t.prototype.cancel=function(t,e){var n=this,o=e.indexOf(t);o>=0&&(this.isFiring?this.onAfterFire.push(function(){return n.cancel(t,e)}):e.splice(o,1))},Object.defineProperties(t.prototype,e);var n=function(e){this.value=e,this.updateEvent=new t};n.prototype.update=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateEvent.fire(t),this.updating=!1},n.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},n.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},n.prototype.filter=function(t,e){var o=new n;return this.listen(function(e){t(e,o.value)&&o.update(e)},e),o},n.prototype.max=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)>0:t>e})},n.prototype.min=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)<0:t<e})},n.prototype.pipe=function(t,e){this.listen(function(e){return t.update(e)},e)},n.prototype.map=function(t,e){var o=new n(t(this.value));return this.listen(function(e){o.update(t(e))},e),o},n.prototype.tap=function(t,e){var o=new n(this.value);return this.listen(function(e){t(e),o.update(e)},e),o},n.prototype.await=function(t){var e=new n;return this.listen(function(t){try{var n=e.update;return Promise.resolve(t).then(function(t){n.call(e,t)})}catch(t){return Promise.reject(t)}},t),e},n.prototype.unique=function(t){var e=new n(this.value);return this.listen(function(t){t!==e.value&&e.update(t)},t),e},n.prototype.diff=function(t){var e=new n({new:this.value,old:void 0});return this.listen(function(t){e.update({new:t,old:e.value})},t),e},n.prototype.reduce=function(t,e,o){var r=new n(e);return this.listen(function(e){return r.update(t(r.value,e))},o),r},n.prototype.aggregate=function(t,e,o){var r=this,i=new n(e(this.value,t.value));return this.listen(function(){return i.update(e(r.value,t.value))},o),t.listen(function(){return i.update(e(r.value,t.value))},o),i},n.prototype.aggregateThree=function(t,e,o,r){var i=this,a=new n(o(this.value,t.value,e.value));return this.listen(function(){return a.update(o(i.value,t.value,e.value))},r),t.listen(function(){return a.update(o(i.value,t.value,e.value))},r),e.listen(function(){return a.update(o(i.value,t.value,e.value))},r),a},n.prototype.aggregateFour=function(t,e,o,r,i){var a=this,s=new n(r(this.value,t.value,e.value,o.value));return this.listen(function(){return s.update(r(a.value,t.value,e.value,o.value))},i),t.listen(function(){return s.update(r(a.value,t.value,e.value,o.value))},i),e.listen(function(){return s.update(r(a.value,t.value,e.value,o.value))},i),o.listen(function(){return s.update(r(a.value,t.value,e.value,o.value))},i),s},n.prototype.stringJoin=function(t,e){var o=new n("");return this.listen(function(e){return o.update(o.value+t+e.toString())},e),o},n.prototype.combine=function(t,e){var o=new n;this.pipe(o,e);for(var r=0,i=t;r<i.length;r+=1)i[r].pipe(o,e);return o},n.prototype.delay=function(t,e){var o=new n(this.value);return this.listen(function(e){setTimeout(function(){o.update(e)},t)},e),o},n.prototype.debounce=function(t,e){var o,r=new n(this.value);return this.listen(function(e){clearTimeout(o),o=setTimeout(function(){r.update(e)},t)},e),r},n.prototype.throttle=function(t,e){var o=new n(this.value),r=!1;return this.listen(function(e){r||(o.update(e),r=!0,setTimeout(function(){r=!1},t))},e),o},n.prototype.buffer=function(t,e){var o,r=new n,i=[];return this.listen(function(e){i.push(e),o||(o=setTimeout(function(){o=void 0,r.update(i),i=[]},t))},e),r},n.prototype.accumulate=function(t){var e=new o;return this.listen(function(t){e.push(t)},t),e},n.prototype.pick=function(t,e){var o,r=new n(null===(o=this.value)||void 0===o?void 0:o[t]);return this.listen(function(e){r.update(null!=e?e[t]:e)},e),r},n.prototype.cancelAll=function(){this.updateEvent.cancelAll()};var o=function(e){this.data=e?e.slice():[],this.lengthSource=new n(this.data.length).unique(),this.updateEvent=new t},r={length:{configurable:!0}};o.prototype.listenAndRepeat=function(t,e){return t({operation:"add",operationDetailed:"append",index:0,items:this.data,newState:this.data,count:this.data.length}),this.listen(t,e)},o.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},r.length.get=function(){return this.lengthSource},o.prototype.getData=function(){return this.data.slice()},o.prototype.get=function(t){return this.data[t]},o.prototype.set=function(t,e){var n=this.data[t];n!==e&&(this.data[t]=e,this.update({operation:"replace",operationDetailed:"replace",target:n,count:1,index:t,items:[e],newState:this.data}),this.lengthSource.update(this.data.length))},o.prototype.swap=function(t,e){if(t!==e){var n=this.data[t],o=this.data[e];this.data[e]=n,this.data[t]=o,this.update({operation:"swap",operationDetailed:"swap",index:t,index2:e,items:[n,o],newState:this.data}),this.lengthSource.update(this.data.length)}},o.prototype.swapItems=function(t,e){if(t!==e){var n=this.data.indexOf(t),o=this.data.indexOf(e);-1!==n&&-1!==o&&(this.data[o]=t,this.data[n]=e),this.update({operation:"swap",operationDetailed:"swap",index:n,index2:o,items:[t,e],newState:this.data}),this.lengthSource.update(this.data.length)}},o.prototype.appendArray=function(t){var e=this.data;this.data=new Array(e.length);var n=0;for(n=0;n<e.length;n++)this.data[n]=e[n];for(var o=0;o<t.length;o++)this.data[n+o]=t[o];this.update({operation:"add",operationDetailed:"append",count:t.length,index:this.data.length-t.length,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.push=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.appendArray(t),this.lengthSource.update(this.data.length)},o.prototype.unshift=function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];(t=this.data).unshift.apply(t,e),this.update({operation:"add",operationDetailed:"prepend",count:e.length,items:e,index:0,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.pop=function(){var t=this.data.pop();return this.update({operation:"remove",operationDetailed:"removeRight",count:1,index:this.data.length,items:[t],newState:this.data}),this.lengthSource.update(this.data.length),t},o.prototype.merge=function(t){for(var e=0;e<t.length;e++)this.data[e]!==t[e]&&(this.data.length>e?this.set(e,t[e]):this.push(t[e]));this.data.length>t.length&&this.removeRight(this.data.length-t.length),this.lengthSource.update(this.data.length)},o.prototype.removeRight=function(t){var e=this.data.length,n=this.data.splice(e-t,t);this.update({operation:"remove",operationDetailed:"removeRight",count:t,index:e-t,items:n,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.removeLeft=function(t){var e=this.data.splice(0,t);this.update({operation:"remove",operationDetailed:"removeLeft",count:t,index:0,items:e,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.remove=function(t){var e=this.data.indexOf(t);-1!==e&&(this.data.splice(e,1),this.update({operation:"remove",operationDetailed:"remove",count:1,index:e,items:[t],newState:this.data}),this.lengthSource.update(this.data.length))},o.prototype.clear=function(){var t=this.data;this.data=[],this.update({operation:"remove",operationDetailed:"clear",count:t.length,index:0,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.shift=function(){var t=this.data.shift();return this.update({operation:"remove",operationDetailed:"removeLeft",items:[t],count:1,index:0,newState:this.data}),this.lengthSource.update(this.data.length),t},o.prototype.toArray=function(){return this.data.slice()},o.prototype.sort=function(t,e){return new a(this,t,e)},o.prototype.map=function(t,e){return new i(this,t,e)},o.prototype.filter=function(t,e,n){void 0===e&&(e=[]);var o=new s(this,t,n);return e.forEach(function(t){t.unique().listen(function(){return o.refresh()})}),o},o.prototype.forEach=function(t){return this.data.forEach(t)},o.prototype.update=function(t){this.updateEvent.fire(t)},Object.defineProperties(o.prototype,r);var i=function(t){function e(e,n,o){var r=this,i=e.getData().map(n);t.call(this,i),this.mapper=n,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(r.data[t.index]);break;case"clear":r.clear();break;case"prepend":(e=r).unshift.apply(e,t.items.map(r.mapper));break;case"append":r.appendArray(t.items.map(r.mapper));break;case"swap":r.swap(t.index,t.index2);break;case"replace":r.set(t.index,r.mapper(t.items[0]))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(o),a=function(t){function e(e,n,o){var r=this,i=e.getData().sort(n);t.call(this,i),this.comparator=n,e.listen(function(t){var e,n;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(t.items[0]);break;case"clear":r.data.length=0;break;case"prepend":(e=r).unshift.apply(e,t.items),r.data.sort(r.comparator);break;case"append":(n=r).push.apply(n,t.items),r.data.sort(r.comparator);break;case"swap":break;case"replace":r.set(t.index,t.items[0]),r.data.sort(r.comparator)}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(o),s=function(t){function e(e,n,o){var r=this;Array.isArray(e)&&(e=new t(e));var i=e.data.filter(n=null!=n?n:function(){return!0});t.call(this,i),this.parent=e,this.viewFilter=n,e.listen(function(t){var e,n,o;switch(t.operationDetailed){case"clear":r.clear();break;case"removeLeft":case"removeRight":case"remove":for(var i=0,a=t.items;i<a.length;i+=1)r.remove(a[i]);break;case"prepend":o=t.items.filter(r.viewFilter),(e=r).unshift.apply(e,o);break;case"append":o=t.items.filter(r.viewFilter),(n=r).push.apply(n,o);break;case"swap":var s=r.data.indexOf(t.items[0]),c=r.data.indexOf(t.items[1]);-1!==s&&-1!==c&&r.swap(s,c);break;case"replace":var u=r.data.indexOf(t.target);-1!==u&&(r.viewFilter(t.items[0])?r.set(u,t.items[0]):r.remove(t.target))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.updateFilter=function(t){if(this.viewFilter!==t)return this.viewFilter=t,this.refresh(),this.data.length},e.prototype.refresh=function(){var t;this.clear();var e=this.parent.data.filter(this.viewFilter);(t=this).push.apply(t,e)},e}(o),c=function(e){e&&(this.data=e),this.updateEvent=new t,this.updateEventOnKey=new Map};c.prototype.pick=function(t,e){var o,r=new n(null===(o=this.data)||void 0===o?void 0:o[t]);return this.listenOnKey(t,function(t){r.update(t.newValue)},e),r},c.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},c.prototype.listenOnKeyAndRepeat=function(t,e,n){return e({key:t,newValue:this.data[t],oldValue:void 0}),this.listenOnKey(t,e,n)},c.prototype.listenOnKey=function(e,n,o){return this.updateEventOnKey.has(e)||this.updateEventOnKey.set(e,new t),this.updateEventOnKey.get(e).subscribe(n,o).cancel},c.prototype.keys=function(){return Object.keys(this.data)},c.prototype.values=function(){return Object.values(this.data)},c.prototype.get=function(t){return this.data[t]},c.prototype.delete=function(t,e){var n=this.data[t];delete this.data[t],this.updateEvent.fire({oldValue:n,key:t,newValue:void 0,deleted:!0})},c.prototype.set=function(t,e){if(this.data[t]!==e){var n=this.data[t];this.data[t]=e,this.updateEvent.fire({oldValue:n,key:t,newValue:this.data[t]}),this.updateEventOnKey.has(t)&&this.updateEventOnKey.get(t).fire({oldValue:n,key:t,newValue:this.data[t]})}},c.prototype.assign=function(t){if(t instanceof c)for(var e=0,n=t.keys();e<n.length;e+=1){var o=n[e];this.set(o,t.data[o])}else for(var r=0,i=Object.keys(t);r<i.length;r+=1){var a=i[r];this.set(a,t[a])}},c.prototype.toObject=function(){return Object.assign({},this.data)},c.prototype.toDataSource=function(){var t=this,e=new n(this.data);return this.listen(function(n){e.update(t.data)}),e};var u,p=Symbol("owner"),l=function(t){var e=this;this.node=this.create(t),t instanceof n&&t.listen(function(t){e.node&&(e.node.textContent=t)})};l.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},l.prototype.create=function(t){var e=document.createTextNode(this.resolveStringSource(t));return e[p]=this,e},l.prototype.remove=function(){this.hasParent()&&this.node.parentElement[p].removeChild(this.node)},l.prototype.hasParent=function(){return!!this.node.parentElement},function(t){t[t.UPSTREAM=0]="UPSTREAM",t[t.DOWNSTREAM=1]="DOWNSTREAM"}(u||(u={}));var h=function(e){this.value=e,this.updateDownstreamEvent=new t,this.updateUpstreamEvent=new t};h.fromTwoDataSource=function(t,e,n){var o=new h(n);o.updateDownstreamEvent=t.updateEvent,o.updateUpstreamEvent=e.updateEvent},h.createOneWay=function(t,e){return void 0===t&&(t=u.DOWNSTREAM),new h(e).oneWayFlow(t)},h.prototype.updateDownstream=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateDownstreamEvent.fire(t),this.updating=!1},h.prototype.updateUpstream=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateUpstreamEvent.fire(t),this.updating=!1},h.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},h.prototype.listen=function(t,e){return this.updateDownstreamEvent.subscribe(t,e),this.updateUpstreamEvent.subscribe(t,e).cancel},h.prototype.listenUpstream=function(t,e){return this.updateUpstreamEvent.subscribe(t,e).cancel},h.prototype.listenDownstream=function(t,e){return this.updateDownstreamEvent.subscribe(t,e).cancel},h.prototype.filter=function(t,e,n){var o=this;e||(e=t);var r=new h;return this.listenDownstream(function(e){t(e)&&r.updateDownstream(e)},n),r.listenUpstream(function(n){(null!=e?e:t)(n)&&o.updateUpstream(n)},n),r},h.prototype.pipe=function(t,e){var n=this;this.listenDownstream(function(e){return t.updateDownstream(e)},e),t.listenUpstream(function(t){return n.updateUpstream(t)},e)},h.prototype.map=function(t,e,n){var o=this,r=new h(t(this.value));return this.listenDownstream(function(e){return r.updateDownstream(t(e))},n),r.listenUpstream(function(t){return o.updateUpstream(e(t))},n),r},h.prototype.unique=function(t){var e=this,n=new h(this.value);return this.listenDownstream(function(t){n.value!==t&&n.updateDownstream(t)},t),n.listenUpstream(function(t){e.value!==t&&e.updateUpstream(t)},t),n},h.prototype.oneWayFlow=function(t,e){var n=this;void 0===t&&(t=u.DOWNSTREAM);var o=new h(this.value);return t===u.DOWNSTREAM?(this.listenDownstream(function(t){return o.updateDownstream(t)},e),o.updateUpstream=function(){}):(o.listenUpstream(function(t){return n.updateUpstream(t)}),o.updateDownstream=function(){}),o},h.prototype.cancelAll=function(){this.updateDownstreamEvent.cancelAll(),this.updateUpstreamEvent.cancelAll()};var d=Symbol("AurumElementModel"),f={drag:"onDrag",dragstart:"onDragStart",dragend:"onDragEnd",dragexit:"onDragExit",dragover:"onDragOver",dragenter:"onDragEnter",dragleave:"onDragLeave",blur:"onBlur",focus:"onFocus",click:"onClick",dblclick:"onDblClick",keydown:"onKeyDown",keyhit:"onKeyHit",keyup:"onKeyUp",mousedown:"onMouseDown",mouseup:"onMouseUp",mousemove:"onMouseMove",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",load:"onLoad",error:"onError"},v=["id","name","draggable","tabindex","style","role","contentEditable"];function y(t){return t&&t[d]?y(t.constructor(t.props,t.innerNodes)):t}var m=function(t,e,n){var o,r;this.node=this.create(n),this.children=[],null!=t&&(t.onAttach&&(this.onAttach=t.onAttach,this.needAttach=!0),this.onDetach=t.onDetach,this.initialize(t),null===(r=(o=t).onCreate)||void 0===r||r.call(o,this.node)),e&&this.addChildren(e)};m.prototype.initialize=function(t){this.createEventHandlers(f,t);var e=Object.keys(t).filter(function(t){return t.includes("-")});this.bindProps(v,t,e),t.class&&this.handleClass(t.class)},m.prototype.bindProps=function(t,e,n){for(var o=0,r=t;o<r.length;o+=1){var i=r[o];e[i]&&this.assignStringSourceToAttribute(e[i],i)}if(n)for(var a=0,s=n;a<s.length;a+=1){var c=s[a];e[c]&&this.assignStringSourceToAttribute(e[c],c)}},m.prototype.createEventHandlers=function(t,e){var o=this,r=function(r){e[t[r]]&&(e[t[r]]instanceof n?o.node.addEventListener(r,function(n){return e[t[r]].update(n)}):e[t[r]]instanceof h?o.node.addEventListener(r,function(n){return e[t[r]].updateDownstream(n)}):"function"==typeof e[t[r]]&&o.node.addEventListener(r,function(n){return e[t[r]](n)}))};for(var i in t)r(i)},m.prototype.render=function(){for(var t=0,e=0;e<this.children.length;e++,t++)this.children[e]instanceof b?t=this.renderFragment(this.children[e],t):this.renderChild(this.children[e],t);for(;this.node.childNodes.length>t;)this.node.removeChild(this.node.childNodes[this.node.childNodes.length-1])},m.prototype.renderFragment=function(t,e){for(var n=0;n<t.children.length;n++,e++)t.children[n]instanceof b?e=this.renderFragment(t.children[n],e):this.renderChild(t.children[n],e);return--e},m.prototype.renderChild=function(t,e){if(this.node.childNodes.length<=e)return this.addChildDom(t);if(this.node.childNodes[e][p]!==t){var n=this.getChildIndex(t.node);-1!==n?this.swapChildrenDom(e,n):this.addDomNodeAt(t.node,e)}},m.prototype.assignStringSourceToAttribute=function(t,e){var n=this;"string"==typeof t||"boolean"==typeof t?"boolean"==typeof t?t?this.node.setAttribute(e,""):this.node.removeAttribute(e):this.node.setAttribute(e,t):t.unique().listenAndRepeat(function(t){"boolean"==typeof t?t?n.node.setAttribute(e,""):n.node.removeAttribute(e):n.node.setAttribute(e,t)})},m.prototype.handleAttach=function(t){var e,n,o,r;if(this.needAttach)if(t.isConnected()){null===(e=this.onAttach)||void 0===e||e.call(this,this.node);for(var i=0,a=this.node.childNodes;i<a.length;i+=1)null===(r=null===(n=a[i][p])||void 0===n?void 0:(o=n).handleAttach)||void 0===r||r.call(o,this)}else t.needAttach=!0},m.prototype.handleDetach=function(){var t,e,n;if(!this.node.isConnected){null===(t=this.onDetach)||void 0===t||t.call(this,this.node);for(var o=0,r=this.node.childNodes;o<r.length;o+=1){var i=r[o];i[p]&&(null===(n=(e=i[p]).handleDetach)||void 0===n||n.call(e))}}},m.prototype.handleClass=function(t){var e=this;if("string"==typeof t)this.node.className=t;else if(t instanceof n)t.value&&(Array.isArray(t.value)?(this.node.className=t.value.join(" "),t.unique().listen(function(){e.node.className=t.value.join(" ")})):(this.node.className=t.value,t.unique().listen(function(){e.node.className=t.value}))),t.unique().listen(function(t){return e.node.className=t});else{var o=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");this.node.className=o;for(var r=0,i=t;r<i.length;r+=1){var a=i[r];a instanceof n&&a.unique().listen(function(n){var o=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");e.node.className=o})}}},m.prototype.create=function(t){var e=document.createElement(t);return e[p]=this,e},m.prototype.getChildIndex=function(t){for(var e=0,n=0,o=this.node.childNodes;n<o.length;n+=1){if(o[n]===t)return e;e++}return-1},m.prototype.hasChild=function(t){for(var e=0,n=t.childNodes;e<n.length;e+=1)if(n[e]===t)return!0;return!1},m.prototype.addChildDom=function(t){var e,n;this.node.appendChild(t.node),null===(n=(e=t).handleAttach)||void 0===n||n.call(e,this)},m.prototype.swapChildrenDom=function(t,e){if(t!==e){var n=this.node.childNodes[t],o=this.node.childNodes[e];n.remove(),o.remove(),t<e?(this.addDomNodeAt(o,t),this.addDomNodeAt(n,e)):(this.addDomNodeAt(n,e),this.addDomNodeAt(o,t))}},m.prototype.addDomNodeAt=function(t,e){var n,o,r,i;e>=this.node.childNodes.length?(this.node.appendChild(t),null===(o=(n=t[p]).handleAttach)||void 0===o||o.call(n,this)):(this.node.insertBefore(t,this.node.childNodes[e]),null===(i=(r=t[p]).handleAttach)||void 0===i||i.call(r,this))},m.prototype.remove=function(){this.hasParent()&&this.node.parentElement[p].removeChild(this.node)},m.prototype.hasParent=function(){return!!this.node.parentElement},m.prototype.isConnected=function(){return this.node.isConnected},m.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1),this.render()},m.prototype.removeChildAt=function(t){this.children.splice(t,1),this.render()},m.prototype.swapChildren=function(t,e){if(t!==e){var n=this.children[t];this.children[t]=this.children[e],this.children[e]=n,this.render()}},m.prototype.clearChildren=function(){this.children.length=0,this.render()},m.prototype.addChild=function(t){if(null!=t&&(!t[d]||void 0!==(t=y(t))))if(Array.isArray(t))for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e]);else this.children.push(this.childNodeToAurum(t)),this.render()},m.prototype.childNodeToAurum=function(t){var e=this;if(t instanceof m)return t;if(t instanceof Promise){var r=new b({});return t.then(function(t){r.addChildren([t]),e.render()}),r}if(t instanceof o){var i=new b({repeatModel:t});return i.onChange.subscribe(function(){return e.render()}),i}if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return new l(t.toString());if(t instanceof n){var a=new b({},[t]);return a.onChange.subscribe(function(){return e.render()}),a}throw new Error("Unsupported child type")},m.prototype.addChildAt=function(t,e){this.children.splice(e,0,this.childNodeToAurum(t)),this.render()},m.prototype.addChildren=function(t){if(0!==t.length)for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e])};var b=function(e,n){this.onChange=new t,this.children=[],e.repeatModel?this.handleRepeat(e.repeatModel):n&&this.addChildren(n)};b.prototype.addChildren=function(t){for(var e=this,o=function(){var t=i[r],o=void 0;if((o=t[d]?y(t):t)instanceof m)e.children.push(o);else{if(!(o instanceof n))throw new Error("case not yet implemented");var a=void 0,s=void 0,c={ts:void 0};o.unique().listenAndRepeat(function(t){if(c.ts=Date.now(),null==t&&s)return e.children.length=0,e.onChange.fire(),void(s=!1);if(!Array.isArray(t)&&s&&(e.children.length=0,e.onChange.fire(),s=!1),Array.isArray(t)){s=!0,e.children.length=0,e.onChange.fire();for(var n=0,r=t;n<r.length;n+=1)e.handleSourceChild(r[n],void 0,void 0,c,c.ts)}else a=e.handleSourceChild(t,a,o,c,c.ts)})}},r=0,i=t;r<i.length;r+=1)o()},b.prototype.handleSourceChild=function(t,e,r,i,a){var s=this;if(null!=t){if(t[d]&&(t=y(t)),"string"==typeof t||"bigint"==typeof t||"number"==typeof t||"boolean"==typeof t)if(e){if(e instanceof m){var c=new l(null!=r?r:t);this.children.splice(this.children.indexOf(e),1,c),e=c,this.onChange.fire()}}else{var u=new l(null!=r?r:t);this.children.push(u),e=u,this.onChange.fire()}else if(t instanceof m)t!==e&&(e?this.children.splice(this.children.indexOf(e),1,t):this.children.push(t),e=t,this.onChange.fire());else if(t instanceof Promise)t.then(function(t){i.ts===a&&(s.addChildren([t]),s.onChange.fire())});else if(t instanceof n)if(e){if(e!==t){var p=new b({},[t]);p.onChange.subscribe(function(){return s.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,p),e=p,this.onChange.fire()}}else{var h=new b({},[t]);e=h,this.children.push(h),h.onChange.subscribe(function(){return s.onChange.fire()}),this.onChange.fire()}else if(t instanceof o)if(e){if(e!==t){var f=new b({repeatModel:t});f.onChange.subscribe(function(){return s.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,f),e=f,this.onChange.fire()}}else{var v=new b({repeatModel:t});e=v,this.children.push(v),v.onChange.subscribe(function(){return s.onChange.fire()}),this.onChange.fire()}return e}e&&(this.children.splice(this.children.indexOf(e),1),e=void 0,this.onChange.fire())},b.prototype.handleRepeat=function(t){var e=this;t.listenAndRepeat(function(t){var n;switch(t.operationDetailed){case"replace":e.children[t.index]=y(t.items[0]);break;case"swap":var o=e.children[t.index2];e.children[t.index2]=e.children[t.index],e.children[t.index]=o;break;case"append":e.children=e.children.concat(t.items.map(y));break;case"prepend":(n=e.children).unshift.apply(n,t.items.map(y));break;case"remove":case"removeLeft":case"removeRight":e.children.splice(t.index,t.count);break;case"clear":e.children=[];break;default:throw new Error("unhandled operation")}e.onChange.fire()})};var _=function(t){function e(e,n){t.call(this,e,n,"div")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),g=function(t){function e(e,n){t.call(this,e,n,"button"),null!==e&&this.bindProps(["disabled"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),w={input:"onInput",change:"onChange"},C=["placeholder","readonly","disabled","accept","alt","autocomplete","autofocus","checked","defaultChecked","formAction","formEnctype","formMethod","formNoValidate","formTarget","max","maxLength","min","minLength","pattern","multiple","required","type"],x=function(t){function e(e,o){var r,i,a=this;t.call(this,e,o,"input"),null!==e&&(e.value instanceof n||e.value instanceof h?(e.value.unique().listenAndRepeat(function(t){return a.node.value=t}),this.node.addEventListener("input",function(){e.value instanceof n?e.value.update(a.node.value):e.value instanceof h&&e.value.updateUpstream(a.node.value)})):this.node.value=null!=(r=e.value)?r:"",e.checked instanceof n||e.checked instanceof h?(e.checked.unique().listenAndRepeat(function(t){return a.node.checked=t}),this.node.addEventListener("change",function(){e.checked instanceof n?e.checked.update(a.node.checked):e.checked instanceof h&&e.checked.updateUpstream(a.node.checked)})):this.node.checked=null!=(i=e.checked)&&i,this.bindProps(C,e),this.createEventHandlers(w,e))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),O=function(t){function e(e,n){t.call(this,e,n,"li")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),A=function(t){function e(e,n){t.call(this,e,n,"span")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),E=function(t){function e(e,n){t.call(this,e,n,"style"),null!==e&&this.bindProps(["media"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),S=function(t){function e(e,n){t.call(this,e,n,"audio"),null!==e&&this.bindProps(["controls","autoplay","loop","muted","preload","src"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),j=function(t){function e(e,n){t.call(this,e,n,"ul")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),D=function(t){function e(e,n){t.call(this,e,n,"p")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),k=function(t){function e(e,n){t.call(this,e,n,"img"),null!==e&&this.bindProps(["src","alt","width","height","referrerPolicy","sizes","srcset","useMap"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),N=function(t){function e(e,n){t.call(this,e,n,"link"),null!==e&&this.bindProps(["href","rel","media","as","disabled","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),P=function(t){function e(e,n){t.call(this,e,n,"canvas"),null!==e&&this.bindProps(["width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),R=function(t){function e(e,n){t.call(this,e,n,"a"),null!==e&&this.bindProps(["href","target"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),F=function(t){function e(e,n){t.call(this,e,n,"article")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),T=function(t){function e(e,n){t.call(this,e,n,"br")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),U=function(t){function e(e,n){t.call(this,e,n,"form")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),L=function(t){function e(e,n){t.call(this,e,n,"label"),null!==e&&this.bindProps(["for"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),I=function(t){function e(e,n){t.call(this,e,n,"ol")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),M=function(t){function e(e,n){t.call(this,e,n,"pre")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),q=function(t){function e(e,n){t.call(this,e,n,"progress"),null!==e&&this.bindProps(["max","value"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),V=function(t){function e(e,n){t.call(this,e,n,"table")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),K=function(t){function e(e,n){t.call(this,e,n,"td")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),W=function(t){function e(e,n){t.call(this,e,n,"tr")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),H=function(t){function e(e,n){t.call(this,e,n,"th")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),z={input:"onInput",change:"onChange"},B=["placeholder","readonly","disabled","rows","wrap","autocomplete","autofocus","max","maxLength","min","minLength","required","type"],J=function(t){function e(e,n){var o,r,i,a=this;t.call(this,e,n,"textArea"),null!==e&&(e.inputValueSource?(this.node.value=null!=(r=null!=(o=e.initialValue)?o:e.inputValueSource.value)?r:"",e.inputValueSource.unique().listen(function(t){return a.node.value=t})):this.node.value=null!=(i=e.initialValue)?i:"",this.bindProps(B,e),this.createEventHandlers(z,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(a.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),G=function(t){function e(e,n){t.call(this,e,n,"h1")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Q=function(t){function e(e,n){t.call(this,e,n,"h2")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),X=function(t){function e(e,n){t.call(this,e,n,"h3")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Y=function(t){function e(e,n){t.call(this,e,n,"h4")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Z=function(t){function e(e,n){t.call(this,e,n,"h5")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),$=function(t){function e(e,n){t.call(this,e,n,"h6")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),tt=function(t){function e(e,n){t.call(this,e,n,"header")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),et=function(t){function e(e,n){t.call(this,e,n,"footer")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),nt=function(t){function e(e,n){t.call(this,e,n,"nav")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),ot=function(t){function e(e,n){t.call(this,e,n,"b")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),rt=function(t){function e(e,n){t.call(this,e,n,"i")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),it=function(t){function e(e,n){t.call(this,e,n,"script"),null!==e&&this.bindProps(["src","async","defer","integrity","noModule","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),at=function(t){function e(e,n){t.call(this,e,n,"abbr")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),st=function(t){function e(e,n){t.call(this,e,n,"area")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),ct=function(t){function e(e,n){t.call(this,e,n,"aside")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),ut=function(t){function e(e,n){t.call(this,e,n,"em")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),pt=function(t){function e(e,n){t.call(this,e,n,"heading")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),lt=function(t){function e(e,n){t.call(this,e,n,"iframe"),null!==e&&this.bindProps(["src","srcdoc","width","height","allow","allowFullscreen","allowPaymentRequest"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),ht=function(t){function e(e,n){t.call(this,e,n,"noscript")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),dt=function(t){function e(e,n){t.call(this,e,n,"q")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),ft={change:"onChange"},vt=function(t){function e(e,n){var o,r=this;t.call(this,e,n,"select"),null!==e&&(this.createEventHandlers(ft,e),this.initialSelection=e.initialSelection,e.selectedIndexSource?(this.selectedIndexSource=e.selectedIndexSource,e.selectedIndexSource.unique().listenAndRepeat(function(t){return r.node.selectedIndex=t})):this.node.selectedIndex=null!=(o=e.initialSelection)?o:-1,e.selectedIndexSource&&(this.needAttach=!0,this.node.addEventListener("change",function(){e.selectedIndexSource.update(r.node.selectedIndex)})))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleAttach=function(e){t.prototype.handleAttach.call(this,e),this.node.isConnected&&(this.selectedIndexSource?this.node.selectedIndex=this.selectedIndexSource.value:void 0!==this.initialSelection&&(this.node.selectedIndex=this.initialSelection))},e}(m),yt=function(t){function e(e,n){t.call(this,e,n,"source"),null!==e&&this.bindProps(["src","srcSet","media","sizes","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),mt=function(t){function e(e,n){t.call(this,e,n,"title")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),bt=function(t){function e(e,n){t.call(this,e,n,"video"),null!==e&&this.bindProps(["controls","autoplay","loop","muted","preload","src","poster","width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),_t=function(t){function e(e,n){t.call(this,e,n,"tbody")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),gt=function(t){function e(e,n){t.call(this,e,n,"tfoot")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),wt=function(t){function e(e,n){t.call(this,e,n,"thead")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Ct=function(t){function e(e,n){t.call(this,e,n,"summary")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),xt=function(t){function e(e,n){t.call(this,e,n,"details")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Ot=function(t){function e(e,n){t.call(this,e,n,"sub")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),At=function(t){function e(e,n){t.call(this,e,n,"sup")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Et=function(t){function e(e,n){t.call(this,e,n,"svg"),null!==e&&this.bindProps(["width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),St=function(t){function e(e,n){t.call(this,e,n,"data"),null!==e&&this.bindProps(["datalue"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),jt=function(t){function e(e,n){t.call(this,e,n,"time"),null!==e&&this.bindProps(["datetime"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Dt={button:g,div:_,input:x,li:O,span:A,style:E,ul:j,p:D,img:k,link:N,canvas:P,a:R,article:F,br:T,form:U,label:L,ol:I,pre:M,progress:q,table:V,td:K,tr:W,th:H,textarea:J,h1:G,h2:Q,h3:X,h4:Y,h5:Z,h6:$,header:tt,footer:et,nav:nt,b:ot,i:rt,script:it,abbr:at,area:st,aside:ct,audio:S,em:ut,heading:pt,iframe:lt,noscript:ht,option:function(t){function e(e,n){t.call(this,e,n,"option")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),q:dt,select:vt,source:yt,title:mt,video:bt,tbody:_t,tfoot:gt,thead:wt,summary:Ct,details:xt,sub:Ot,sup:At,svg:Et,data:St,time:jt,template:function(t){function e(e,n){t.call(this,e,n,"template")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m)},kt=function(){};kt.attach=function(t,e){var n=y(t);if(e[p])throw new Error("This node is already managed by aurum and cannot be used");if(!(n instanceof m))throw new Error("Root node of aurum application must be a single dom node");e.appendChild(n.node),n.handleAttach(n),e[p]=n},kt.isAttached=function(t){return void 0!==t[p]},kt.detach=function(t){t[p]&&(t[p].node.remove(),t[p].handleDetach(),t[p]=void 0)},kt.factory=function(t,e){for(var n,o,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];if("string"==typeof t){var a=t;if(void 0===(t=Dt[t]))throw new Error("Node "+a+" does not exist or is not supported")}return Object.getPrototypeOf(t)===m?((n={})[d]=!0,n.constructor=function(e,n){return new t(e,n)},n.props=e,n.innerNodes=r,n):((o={})[d]=!0,o.constructor=t,o.props=e,o.innerNodes=r,o)};var Nt=function(t){this.data=t};Nt.prototype.deleteNext=function(){if(this.next){var t=this.next.next;this.next.next=void 0,this.next.previous=void 0,this.next=t,this.next&&(this.next.previous=this)}},Nt.prototype.deletePrevious=function(){if(this.previous){var t=this.previous.previous;this.previous.next=void 0,this.previous.previous=void 0,this.previous=t,this.previous&&(this.previous.next=this)}};var Pt=function(t){var e=this;void 0===t&&(t=[]),this.length=0,t.forEach(function(t){return e.append(t)})};Pt.prototype.find=function(t){for(var e=this.rootNode;e&&!t(e);)e=e.next;return e},Pt.prototype.append=function(t){return this.rootNode||this.lastNode?(this.lastNode.next=new Nt(t),this.lastNode.next.previous=this.lastNode,this.lastNode=this.lastNode.next):this.rootNode=this.lastNode=new Nt(t),this.length++,t},Pt.prototype.forEach=function(t){this.find(function(e){return t(e.data),!1})},Pt.prototype.remove=function(t){if(t===this.rootNode.data)this.rootNode=this.rootNode===this.lastNode?this.lastNode=void 0:this.rootNode.next,this.length--;else{var e=this.find(function(e){return e.next&&e.next.data===t});e&&(e.next===this.lastNode&&(this.lastNode=e),e.deleteNext(),this.length--)}};var Rt=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.cancelables=new Pt(t),this._isCancelled=!1},Ft={isCanceled:{configurable:!0}};Ft.isCanceled.get=function(){return this._isCancelled},Rt.prototype.addCancelable=function(t){return this.throwIfCancelled("attempting to add cancellable to token that is already cancelled"),this.cancelables.append(t),this.cancelables.length>200&&console.log("potential memory leak: cancellation token has over 200 clean up calls"),this},Rt.prototype.removeCancelable=function(t){return this.throwIfCancelled("attempting to remove cancellable from token that is already cancelled"),this.cancelables.remove(t),this},Rt.prototype.addDisposable=function(t){return this.addCancelable(function(){return t.dispose()}),this},Rt.prototype.callIfNotCancelled=function(t){this.isCanceled||t()},Rt.prototype.setTimeout=function(t,e){var n=this;void 0===e&&(e=0);var o=setTimeout(function(){n.removeCancelable(r),t()},e),r=function(){return clearTimeout(o)};this.addCancelable(r)},Rt.prototype.setInterval=function(t,e){var n=setInterval(t,e);this.addCancelable(function(){return clearInterval(n)})},Rt.prototype.requestAnimationFrame=function(t){var e=this,n=requestAnimationFrame(function(){e.removeCancelable(o),t()}),o=function(){return cancelAnimationFrame(n)};this.addCancelable(o)},Rt.prototype.animationLoop=function(t){var e=requestAnimationFrame(function n(o){t(o),e=requestAnimationFrame(n)});this.addCancelable(function(){return cancelAnimationFrame(e)})},Rt.prototype.throwIfCancelled=function(t){if(this.isCanceled)throw new Error(t||"cancellation token is cancelled")},Rt.prototype.chain=function(t,e){return void 0===e&&(e=!1),e&&t.chain(this,!1),this.addCancelable(function(){return t.cancel()}),this},Rt.prototype.registerDomEvent=function(t,e,n){return t.addEventListener(e,n),this.addCancelable(function(){return t.removeEventListener(e,n)}),this},Rt.prototype.cancel=function(){this.isCanceled||(this._isCancelled=!0,this.cancelables.forEach(function(t){return t()}),this.cancelables=void 0)},Object.defineProperties(Rt.prototype,Ft);var Tt=function(t){function e(e,n){t.call(this,e,n,e.tag),e.attributes&&null!==e&&this.bindProps(Object.keys(e.attributes),e.attributes)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Ut=Symbol("route");function Lt(){var t=location.hash.substring(1);return t.includes("?")?t.substring(0,t.indexOf("?")):t.includes("#")?t.substring(0,t.indexOf("#")):t}var It=Symbol("switchCase");exports.DataSource=n,exports.ArrayDataSource=o,exports.MappedArrayView=i,exports.SortedArrayView=a,exports.FilteredArrayView=s,exports.ObjectDataSource=c,exports.Aurum=kt,exports.CancellationToken=Rt,exports.Custom=Tt,exports.AurumRouter=function(t,e){if((e=e.map(y)).some(function(t){return!t[Ut]}))throw new Error("Aurum Router only accepts Route and DefaultRoute instances as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default routes only 0 or 1 allowed");var o=new n(Lt());return window.addEventListener("hashchange",function(){o.update(Lt())}),o.unique().map(function(t){return function(t,e){var n,o;if(null==t)return null===(n=e.find(function(t){return t.default}))||void 0===n?void 0:n.content;if(e.find(function(e){return e.href===t}))return e.find(function(e){return e.href===t}).content;var r=t.split("/");r.pop();for(var i=function(){var t=r.join("/");if(e.find(function(e){return e.href===t}))return{v:e.find(function(e){return e.href===t}).content};r.pop()};r.length;){var a=i();if(a)return a.v}return null===(o=e.find(function(t){return t.default}))||void 0===o?void 0:o.content}(t,e)})},exports.Route=function(t,e){var n;return(n={})[Ut]=!0,n.content=e,n.default=!1,n.href=t.href,n},exports.DefaultRoute=function(t,e){var n;return(n={})[Ut]=!0,n.content=e,n.default=!0,n.href=void 0,n},exports.Suspense=function(t,e){var o=new n(t.fallback);return Promise.all(e.map(y)).then(function(t){o.update(t)}),o},exports.Switch=function(t,e){if((e=e.map(y)).some(function(t){return!t[It]}))throw new Error("Switch only accepts SwitchCase as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default switch cases only 0 or 1 allowed");return t.state.unique().map(function(t){return function(t,e){var n,o,r;return null!==(o=null===(n=e.find(function(e){return e.value===t}))||void 0===n?void 0:n.content)&&void 0!==o?o:null===(r=e.find(function(t){return t.default}))||void 0===r?void 0:r.content}(t,e)})},exports.SwitchCase=function(t,e){var n;return(n={})[It]=!0,n.content=e,n.default=!1,n.value=t.when,n},exports.DefaultSwitchCase=function(t,e){var n;return(n={})[It]=!0,n.content=e,n.default=!0,n.value=void 0,n},exports.aurumElementModelIdentitiy=d,exports.prerender=y,exports.AurumElement=m,exports.AurumFragment=b; | ||
var t=function(){this.subscribeChannel=[],this.onAfterFire=[]},e={subscriptions:{configurable:!0}};e.subscriptions.get=function(){return this.subscribeChannel.length},t.prototype.subscribe=function(t,e){return this.createSubscription(t,this.subscribeChannel,e).facade},t.prototype.hasSubscriptions=function(){return this.subscriptions>0},t.prototype.cancelAll=function(){var t=this;this.isFiring?this.onAfterFire.push(function(){return t.subscribeChannel.length=0}):this.subscribeChannel.length=0},t.prototype.afterFire=function(){this.onAfterFire.length>0&&(this.onAfterFire.forEach(function(t){return t()}),this.onAfterFire.length=0)},t.prototype.fire=function(t){this.isFiring=!0;for(var e=this.subscribeChannel.length,n=0;n<e;n++)this.subscribeChannel[n].callback(t);this.isFiring=!1,this.afterFire()},t.prototype.createSubscription=function(t,e,n){var o=this,r={callback:t},i={cancel:function(){o.cancel(r,e)}};return void 0!==n&&n.addCancelable(function(){return o.cancel(r,e)}),e.push(r),{subscription:r,facade:i}},t.prototype.cancel=function(t,e){var n=this,o=e.indexOf(t);o>=0&&(this.isFiring?this.onAfterFire.push(function(){return n.cancel(t,e)}):e.splice(o,1))},Object.defineProperties(t.prototype,e);var n=function(e){this.value=e,this.updateEvent=new t};n.prototype.update=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateEvent.fire(t),this.updating=!1},n.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},n.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},n.prototype.filter=function(t,e){var o=new n;return this.listen(function(e){t(e,o.value)&&o.update(e)},e),o},n.prototype.max=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)>0:t>e})},n.prototype.min=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)<0:t<e})},n.prototype.pipe=function(t,e){this.listen(function(e){return t.update(e)},e)},n.prototype.map=function(t,e){var o=new n(t(this.value));return this.listen(function(e){o.update(t(e))},e),o},n.prototype.tap=function(t,e){var o=new n(this.value);return this.listen(function(e){t(e),o.update(e)},e),o},n.prototype.await=function(t){var e=new n;return this.listen(function(t){try{var n=e.update;return Promise.resolve(t).then(function(t){n.call(e,t)})}catch(t){return Promise.reject(t)}},t),e},n.prototype.unique=function(t){var e=new n(this.value);return this.listen(function(t){t!==e.value&&e.update(t)},t),e},n.prototype.diff=function(t){var e=new n({new:this.value,old:void 0});return this.listen(function(t){e.update({new:t,old:e.value})},t),e},n.prototype.reduce=function(t,e,o){var r=new n(e);return this.listen(function(e){return r.update(t(r.value,e))},o),r},n.prototype.aggregate=function(t,e,o){var r=this,i=new n(e(this.value,t.value));return this.listen(function(){return i.update(e(r.value,t.value))},o),t.listen(function(){return i.update(e(r.value,t.value))},o),i},n.prototype.aggregateThree=function(t,e,o,r){var i=this,a=new n(o(this.value,t.value,e.value));return this.listen(function(){return a.update(o(i.value,t.value,e.value))},r),t.listen(function(){return a.update(o(i.value,t.value,e.value))},r),e.listen(function(){return a.update(o(i.value,t.value,e.value))},r),a},n.prototype.aggregateFour=function(t,e,o,r,i){var a=this,s=new n(r(this.value,t.value,e.value,o.value));return this.listen(function(){return s.update(r(a.value,t.value,e.value,o.value))},i),t.listen(function(){return s.update(r(a.value,t.value,e.value,o.value))},i),e.listen(function(){return s.update(r(a.value,t.value,e.value,o.value))},i),o.listen(function(){return s.update(r(a.value,t.value,e.value,o.value))},i),s},n.prototype.stringJoin=function(t,e){var o=new n("");return this.listen(function(e){return o.update(o.value+t+e.toString())},e),o},n.prototype.combine=function(t,e){var o=new n;this.pipe(o,e);for(var r=0,i=t;r<i.length;r+=1)i[r].pipe(o,e);return o},n.prototype.delay=function(t,e){var o=new n(this.value);return this.listen(function(e){setTimeout(function(){o.update(e)},t)},e),o},n.prototype.debounce=function(t,e){var o,r=new n(this.value);return this.listen(function(e){clearTimeout(o),o=setTimeout(function(){r.update(e)},t)},e),r},n.prototype.throttle=function(t,e){var o=new n(this.value),r=!1;return this.listen(function(e){r||(o.update(e),r=!0,setTimeout(function(){r=!1},t))},e),o},n.prototype.buffer=function(t,e){var o,r=new n,i=[];return this.listen(function(e){i.push(e),o||(o=setTimeout(function(){o=void 0,r.update(i),i=[]},t))},e),r},n.prototype.accumulate=function(t){var e=new o;return this.listen(function(t){e.push(t)},t),e},n.prototype.pick=function(t,e){var o,r=new n(null===(o=this.value)||void 0===o?void 0:o[t]);return this.listen(function(e){r.update(null!=e?e[t]:e)},e),r},n.prototype.cancelAll=function(){this.updateEvent.cancelAll()};var o=function(e){this.data=e?e.slice():[],this.lengthSource=new n(this.data.length).unique(),this.updateEvent=new t},r={length:{configurable:!0}};o.prototype.listenAndRepeat=function(t,e){return t({operation:"add",operationDetailed:"append",index:0,items:this.data,newState:this.data,count:this.data.length}),this.listen(t,e)},o.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},r.length.get=function(){return this.lengthSource},o.prototype.getData=function(){return this.data.slice()},o.prototype.get=function(t){return this.data[t]},o.prototype.set=function(t,e){var n=this.data[t];n!==e&&(this.data[t]=e,this.update({operation:"replace",operationDetailed:"replace",target:n,count:1,index:t,items:[e],newState:this.data}),this.lengthSource.update(this.data.length))},o.prototype.swap=function(t,e){if(t!==e){var n=this.data[t],o=this.data[e];this.data[e]=n,this.data[t]=o,this.update({operation:"swap",operationDetailed:"swap",index:t,index2:e,items:[n,o],newState:this.data}),this.lengthSource.update(this.data.length)}},o.prototype.swapItems=function(t,e){if(t!==e){var n=this.data.indexOf(t),o=this.data.indexOf(e);-1!==n&&-1!==o&&(this.data[o]=t,this.data[n]=e),this.update({operation:"swap",operationDetailed:"swap",index:n,index2:o,items:[t,e],newState:this.data}),this.lengthSource.update(this.data.length)}},o.prototype.appendArray=function(t){var e=this.data;this.data=new Array(e.length);var n=0;for(n=0;n<e.length;n++)this.data[n]=e[n];for(var o=0;o<t.length;o++)this.data[n+o]=t[o];this.update({operation:"add",operationDetailed:"append",count:t.length,index:this.data.length-t.length,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.push=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.appendArray(t),this.lengthSource.update(this.data.length)},o.prototype.unshift=function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];(t=this.data).unshift.apply(t,e),this.update({operation:"add",operationDetailed:"prepend",count:e.length,items:e,index:0,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.pop=function(){var t=this.data.pop();return this.update({operation:"remove",operationDetailed:"removeRight",count:1,index:this.data.length,items:[t],newState:this.data}),this.lengthSource.update(this.data.length),t},o.prototype.merge=function(t){for(var e=0;e<t.length;e++)this.data[e]!==t[e]&&(this.data.length>e?this.set(e,t[e]):this.push(t[e]));this.data.length>t.length&&this.removeRight(this.data.length-t.length),this.lengthSource.update(this.data.length)},o.prototype.removeRight=function(t){var e=this.data.length,n=this.data.splice(e-t,t);this.update({operation:"remove",operationDetailed:"removeRight",count:t,index:e-t,items:n,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.removeLeft=function(t){var e=this.data.splice(0,t);this.update({operation:"remove",operationDetailed:"removeLeft",count:t,index:0,items:e,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.remove=function(t){var e=this.data.indexOf(t);-1!==e&&(this.data.splice(e,1),this.update({operation:"remove",operationDetailed:"remove",count:1,index:e,items:[t],newState:this.data}),this.lengthSource.update(this.data.length))},o.prototype.clear=function(){var t=this.data;this.data=[],this.update({operation:"remove",operationDetailed:"clear",count:t.length,index:0,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.shift=function(){var t=this.data.shift();return this.update({operation:"remove",operationDetailed:"removeLeft",items:[t],count:1,index:0,newState:this.data}),this.lengthSource.update(this.data.length),t},o.prototype.toArray=function(){return this.data.slice()},o.prototype.sort=function(t,e,n){void 0===e&&(e=[]);var o=new a(this,t,n);return e.forEach(function(t){t.unique().listen(function(){return o.refresh()})}),o},o.prototype.map=function(t,e,n){void 0===e&&(e=[]);var o=new i(this,t,n);return e.forEach(function(t){t.unique().listen(function(){return o.refresh()})}),o},o.prototype.filter=function(t,e,n){void 0===e&&(e=[]);var o=new s(this,t,n);return e.forEach(function(t){t.unique().listen(function(){return o.refresh()})}),o},o.prototype.forEach=function(t){return this.data.forEach(t)},o.prototype.update=function(t){this.updateEvent.fire(t)},Object.defineProperties(o.prototype,r);var i=function(t){function e(e,n,o){var r=this,i=e.getData().map(n);t.call(this,i),this.parent=e,this.mapper=n,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(r.data[t.index]);break;case"clear":r.clear();break;case"prepend":(e=r).unshift.apply(e,t.items.map(r.mapper));break;case"append":r.appendArray(t.items.map(r.mapper));break;case"swap":r.swap(t.index,t.index2);break;case"replace":r.set(t.index,r.mapper(t.items[0]))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.refresh=function(){this.clear();var t=this.parent.data.map(this.mapper);this.merge(t)},e}(o),a=function(t){function e(e,n,o){var r=this,i=e.getData().sort(n);t.call(this,i),this.comparator=n,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":case"removeRight":for(var n=0,o=t.items;n<o.length;n+=1)r.remove(o[n]);break;case"remove":r.remove(t.items[0]);break;case"clear":r.clear();break;case"prepend":(e=r).unshift.apply(e,t.items),r.data.sort(r.comparator);break;case"append":r.merge(t.items),r.data.sort(r.comparator);break;case"swap":break;case"replace":r.set(t.index,t.items[0]),r.data.sort(r.comparator)}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.refresh=function(){this.clear(),this.merge(this.parent.getData().sort(this.comparator))},e}(o),s=function(t){function e(e,n,o){var r=this;Array.isArray(e)&&(e=new t(e));var i=e.data.filter(n=null!=n?n:function(){return!0});t.call(this,i),this.parent=e,this.viewFilter=n,e.listen(function(t){var e,n;switch(t.operationDetailed){case"clear":r.clear();break;case"removeLeft":case"removeRight":case"remove":for(var o=0,i=t.items;o<i.length;o+=1)r.remove(i[o]);break;case"prepend":n=t.items.filter(r.viewFilter),(e=r).unshift.apply(e,n);break;case"append":n=t.items.filter(r.viewFilter),r.merge(n);break;case"swap":var a=r.data.indexOf(t.items[0]),s=r.data.indexOf(t.items[1]);-1!==a&&-1!==s&&r.swap(a,s);break;case"replace":var c=r.data.indexOf(t.target);-1!==c&&(r.viewFilter(t.items[0])?r.set(c,t.items[0]):r.remove(t.target))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.updateFilter=function(t){if(this.viewFilter!==t)return this.viewFilter=t,this.refresh(),this.data.length},e.prototype.refresh=function(){this.clear();var t=this.parent.data.filter(this.viewFilter);this.merge(t)},e}(o),c=function(e){e&&(this.data=e),this.updateEvent=new t,this.updateEventOnKey=new Map};c.prototype.pick=function(t,e){var o,r=new n(null===(o=this.data)||void 0===o?void 0:o[t]);return this.listenOnKey(t,function(t){r.update(t.newValue)},e),r},c.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},c.prototype.listenOnKeyAndRepeat=function(t,e,n){return e({key:t,newValue:this.data[t],oldValue:void 0}),this.listenOnKey(t,e,n)},c.prototype.listenOnKey=function(e,n,o){return this.updateEventOnKey.has(e)||this.updateEventOnKey.set(e,new t),this.updateEventOnKey.get(e).subscribe(n,o).cancel},c.prototype.keys=function(){return Object.keys(this.data)},c.prototype.values=function(){return Object.values(this.data)},c.prototype.get=function(t){return this.data[t]},c.prototype.delete=function(t,e){var n=this.data[t];delete this.data[t],this.updateEvent.fire({oldValue:n,key:t,newValue:void 0,deleted:!0})},c.prototype.set=function(t,e){if(this.data[t]!==e){var n=this.data[t];this.data[t]=e,this.updateEvent.fire({oldValue:n,key:t,newValue:this.data[t]}),this.updateEventOnKey.has(t)&&this.updateEventOnKey.get(t).fire({oldValue:n,key:t,newValue:this.data[t]})}},c.prototype.assign=function(t){if(t instanceof c)for(var e=0,n=t.keys();e<n.length;e+=1){var o=n[e];this.set(o,t.data[o])}else for(var r=0,i=Object.keys(t);r<i.length;r+=1){var a=i[r];this.set(a,t[a])}},c.prototype.toObject=function(){return Object.assign({},this.data)},c.prototype.toDataSource=function(){var t=this,e=new n(this.data);return this.listen(function(n){e.update(t.data)}),e};var u,p=Symbol("owner"),l=function(t){var e=this;this.node=this.create(t),t instanceof n&&t.listen(function(t){e.node&&(e.node.textContent=t)})};l.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},l.prototype.create=function(t){var e=document.createTextNode(this.resolveStringSource(t));return e[p]=this,e},l.prototype.remove=function(){this.hasParent()&&this.node.parentElement[p].removeChild(this.node)},l.prototype.hasParent=function(){return!!this.node.parentElement},function(t){t[t.UPSTREAM=0]="UPSTREAM",t[t.DOWNSTREAM=1]="DOWNSTREAM"}(u||(u={}));var h=function(e){this.value=e,this.updateDownstreamEvent=new t,this.updateUpstreamEvent=new t};h.fromTwoDataSource=function(t,e,n){var o=new h(n);o.updateDownstreamEvent=t.updateEvent,o.updateUpstreamEvent=e.updateEvent},h.createOneWay=function(t,e){return void 0===t&&(t=u.DOWNSTREAM),new h(e).oneWayFlow(t)},h.prototype.updateDownstream=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateDownstreamEvent.fire(t),this.updating=!1},h.prototype.updateUpstream=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateUpstreamEvent.fire(t),this.updating=!1},h.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},h.prototype.listen=function(t,e){return this.updateDownstreamEvent.subscribe(t,e),this.updateUpstreamEvent.subscribe(t,e).cancel},h.prototype.listenUpstream=function(t,e){return this.updateUpstreamEvent.subscribe(t,e).cancel},h.prototype.listenDownstream=function(t,e){return this.updateDownstreamEvent.subscribe(t,e).cancel},h.prototype.filter=function(t,e,n){var o=this;e||(e=t);var r=new h;return this.listenDownstream(function(e){t(e)&&r.updateDownstream(e)},n),r.listenUpstream(function(n){(null!=e?e:t)(n)&&o.updateUpstream(n)},n),r},h.prototype.pipe=function(t,e){var n=this;this.listenDownstream(function(e){return t.updateDownstream(e)},e),t.listenUpstream(function(t){return n.updateUpstream(t)},e)},h.prototype.map=function(t,e,n){var o=this,r=new h(t(this.value));return this.listenDownstream(function(e){return r.updateDownstream(t(e))},n),r.listenUpstream(function(t){return o.updateUpstream(e(t))},n),r},h.prototype.unique=function(t){var e=this,n=new h(this.value);return this.listenDownstream(function(t){n.value!==t&&n.updateDownstream(t)},t),n.listenUpstream(function(t){e.value!==t&&e.updateUpstream(t)},t),n},h.prototype.oneWayFlow=function(t,e){var n=this;void 0===t&&(t=u.DOWNSTREAM);var o=new h(this.value);return t===u.DOWNSTREAM?(this.listenDownstream(function(t){return o.updateDownstream(t)},e),o.updateUpstream=function(){}):(o.listenUpstream(function(t){return n.updateUpstream(t)}),o.updateDownstream=function(){}),o},h.prototype.cancelAll=function(){this.updateDownstreamEvent.cancelAll(),this.updateUpstreamEvent.cancelAll()};var d=Symbol("AurumElementModel"),f={drag:"onDrag",dragstart:"onDragStart",dragend:"onDragEnd",dragexit:"onDragExit",dragover:"onDragOver",dragenter:"onDragEnter",dragleave:"onDragLeave",blur:"onBlur",focus:"onFocus",click:"onClick",dblclick:"onDblClick",keydown:"onKeyDown",keyhit:"onKeyHit",keyup:"onKeyUp",mousedown:"onMouseDown",mouseup:"onMouseUp",mousemove:"onMouseMove",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",load:"onLoad",error:"onError"},v=["id","name","draggable","tabindex","style","role","contentEditable"];function y(t){return t&&t[d]?y(t.constructor(t.props,t.innerNodes)):t}var m=function(t,e,n){var o,r;this.node=this.create(n),this.children=[],null!=t&&(t.onAttach&&(this.onAttach=t.onAttach,this.needAttach=!0),this.onDetach=t.onDetach,this.initialize(t),null===(r=(o=t).onCreate)||void 0===r||r.call(o,this.node)),e&&this.addChildren(e)};m.prototype.initialize=function(t){this.createEventHandlers(f,t);var e=Object.keys(t).filter(function(t){return t.includes("-")});this.bindProps(v,t,e),t.class&&this.handleClass(t.class)},m.prototype.bindProps=function(t,e,n){for(var o=0,r=t;o<r.length;o+=1){var i=r[o];e[i]&&this.assignStringSourceToAttribute(e[i],i)}if(n)for(var a=0,s=n;a<s.length;a+=1){var c=s[a];e[c]&&this.assignStringSourceToAttribute(e[c],c)}},m.prototype.createEventHandlers=function(t,e){var o=this,r=function(r){e[t[r]]&&(e[t[r]]instanceof n?o.node.addEventListener(r,function(n){return e[t[r]].update(n)}):e[t[r]]instanceof h?o.node.addEventListener(r,function(n){return e[t[r]].updateDownstream(n)}):"function"==typeof e[t[r]]&&o.node.addEventListener(r,function(n){return e[t[r]](n)}))};for(var i in t)r(i)},m.prototype.render=function(){for(var t=0,e=0;e<this.children.length;e++,t++)this.children[e]instanceof b?t=this.renderFragment(this.children[e],t):this.renderChild(this.children[e],t);for(;this.node.childNodes.length>t;)this.node.removeChild(this.node.childNodes[this.node.childNodes.length-1])},m.prototype.renderFragment=function(t,e){for(var n=0;n<t.children.length;n++,e++)t.children[n]instanceof b?e=this.renderFragment(t.children[n],e):this.renderChild(t.children[n],e);return--e},m.prototype.renderChild=function(t,e){if(this.node.childNodes.length<=e)return this.addChildDom(t);if(this.node.childNodes[e][p]!==t){var n=this.getChildIndex(t.node);-1!==n?this.swapChildrenDom(e,n):this.addDomNodeAt(t.node,e)}},m.prototype.assignStringSourceToAttribute=function(t,e){var n=this;"string"==typeof t||"boolean"==typeof t?"boolean"==typeof t?t?this.node.setAttribute(e,""):this.node.removeAttribute(e):this.node.setAttribute(e,t):t.unique().listenAndRepeat(function(t){"boolean"==typeof t?t?n.node.setAttribute(e,""):n.node.removeAttribute(e):n.node.setAttribute(e,t)})},m.prototype.handleAttach=function(t){var e,n,o,r;if(this.needAttach)if(t.isConnected()){null===(e=this.onAttach)||void 0===e||e.call(this,this.node);for(var i=0,a=this.node.childNodes;i<a.length;i+=1)null===(r=null===(n=a[i][p])||void 0===n?void 0:(o=n).handleAttach)||void 0===r||r.call(o,this)}else t.needAttach=!0},m.prototype.handleDetach=function(){var t,e,n;if(!this.node.isConnected){null===(t=this.onDetach)||void 0===t||t.call(this,this.node);for(var o=0,r=this.node.childNodes;o<r.length;o+=1){var i=r[o];i[p]&&(null===(n=(e=i[p]).handleDetach)||void 0===n||n.call(e))}}},m.prototype.handleClass=function(t){var e=this;if("string"==typeof t)this.node.className=t;else if(t instanceof n)t.value&&(Array.isArray(t.value)?(this.node.className=t.value.join(" "),t.unique().listen(function(){e.node.className=t.value.join(" ")})):(this.node.className=t.value,t.unique().listen(function(){e.node.className=t.value}))),t.unique().listen(function(t){return e.node.className=t});else{var o=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");this.node.className=o;for(var r=0,i=t;r<i.length;r+=1){var a=i[r];a instanceof n&&a.unique().listen(function(n){var o=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");e.node.className=o})}}},m.prototype.create=function(t){var e=document.createElement(t);return e[p]=this,e},m.prototype.getChildIndex=function(t){for(var e=0,n=0,o=this.node.childNodes;n<o.length;n+=1){if(o[n]===t)return e;e++}return-1},m.prototype.hasChild=function(t){for(var e=0,n=t.childNodes;e<n.length;e+=1)if(n[e]===t)return!0;return!1},m.prototype.addChildDom=function(t){var e,n;this.node.appendChild(t.node),null===(n=(e=t).handleAttach)||void 0===n||n.call(e,this)},m.prototype.swapChildrenDom=function(t,e){if(t!==e){var n=this.node.childNodes[t],o=this.node.childNodes[e];n.remove(),o.remove(),t<e?(this.addDomNodeAt(o,t),this.addDomNodeAt(n,e)):(this.addDomNodeAt(n,e),this.addDomNodeAt(o,t))}},m.prototype.addDomNodeAt=function(t,e){var n,o,r,i;e>=this.node.childNodes.length?(this.node.appendChild(t),null===(o=(n=t[p]).handleAttach)||void 0===o||o.call(n,this)):(this.node.insertBefore(t,this.node.childNodes[e]),null===(i=(r=t[p]).handleAttach)||void 0===i||i.call(r,this))},m.prototype.remove=function(){this.hasParent()&&this.node.parentElement[p].removeChild(this.node)},m.prototype.hasParent=function(){return!!this.node.parentElement},m.prototype.isConnected=function(){return this.node.isConnected},m.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1),this.render()},m.prototype.removeChildAt=function(t){this.children.splice(t,1),this.render()},m.prototype.swapChildren=function(t,e){if(t!==e){var n=this.children[t];this.children[t]=this.children[e],this.children[e]=n,this.render()}},m.prototype.clearChildren=function(){this.children.length=0,this.render()},m.prototype.addChild=function(t){if(null!=t&&(!t[d]||void 0!==(t=y(t))))if(Array.isArray(t))for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e]);else this.children.push(this.childNodeToAurum(t)),this.render()},m.prototype.childNodeToAurum=function(t){var e=this;if(t instanceof m)return t;if(t instanceof Promise){var r=new b({});return t.then(function(t){r.addChildren([t]),e.render()}),r}if(t instanceof o){var i=new b({repeatModel:t});return i.onChange.subscribe(function(){return e.render()}),i}if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return new l(t.toString());if(t instanceof n){var a=new b({},[t]);return a.onChange.subscribe(function(){return e.render()}),a}throw new Error("Unsupported child type")},m.prototype.addChildAt=function(t,e){this.children.splice(e,0,this.childNodeToAurum(t)),this.render()},m.prototype.addChildren=function(t){if(0!==t.length)for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e])};var b=function(e,n){this.onChange=new t,this.children=[],e.repeatModel?this.handleRepeat(e.repeatModel):n&&this.addChildren(n)};b.prototype.addChildren=function(t){for(var e=this,o=function(){var t=i[r],o=void 0;if((o=t[d]?y(t):t)instanceof m)e.children.push(o);else{if(!(o instanceof n))throw new Error("case not yet implemented");var a=void 0,s=void 0,c={ts:void 0};o.unique().listenAndRepeat(function(t){if(c.ts=Date.now(),null==t&&s)return e.children.length=0,e.onChange.fire(),void(s=!1);if(!Array.isArray(t)&&s&&(e.children.length=0,e.onChange.fire(),s=!1),Array.isArray(t)){s=!0,e.children.length=0,e.onChange.fire();for(var n=0,r=t;n<r.length;n+=1)e.handleSourceChild(r[n],void 0,void 0,c,c.ts)}else a=e.handleSourceChild(t,a,o,c,c.ts)})}},r=0,i=t;r<i.length;r+=1)o()},b.prototype.handleSourceChild=function(t,e,r,i,a){var s=this;if(null!=t){if(t[d]&&(t=y(t)),"string"==typeof t||"bigint"==typeof t||"number"==typeof t||"boolean"==typeof t)if(e){if(e instanceof m){var c=new l(null!=r?r:t);this.children.splice(this.children.indexOf(e),1,c),e=c,this.onChange.fire()}}else{var u=new l(null!=r?r:t);this.children.push(u),e=u,this.onChange.fire()}else if(t instanceof m)t!==e&&(e?this.children.splice(this.children.indexOf(e),1,t):this.children.push(t),e=t,this.onChange.fire());else if(t instanceof Promise)t.then(function(t){i.ts===a&&(s.addChildren([t]),s.onChange.fire())});else if(t instanceof n)if(e){if(e!==t){var p=new b({},[t]);p.onChange.subscribe(function(){return s.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,p),e=p,this.onChange.fire()}}else{var h=new b({},[t]);e=h,this.children.push(h),h.onChange.subscribe(function(){return s.onChange.fire()}),this.onChange.fire()}else if(t instanceof o)if(e){if(e!==t){var f=new b({repeatModel:t});f.onChange.subscribe(function(){return s.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,f),e=f,this.onChange.fire()}}else{var v=new b({repeatModel:t});e=v,this.children.push(v),v.onChange.subscribe(function(){return s.onChange.fire()}),this.onChange.fire()}return e}e&&(this.children.splice(this.children.indexOf(e),1),e=void 0,this.onChange.fire())},b.prototype.handleRepeat=function(t){var e=this;t.listenAndRepeat(function(t){var n;switch(t.operationDetailed){case"replace":e.children[t.index]=y(t.items[0]);break;case"swap":var o=e.children[t.index2];e.children[t.index2]=e.children[t.index],e.children[t.index]=o;break;case"append":e.children=e.children.concat(t.items.map(y));break;case"prepend":(n=e.children).unshift.apply(n,t.items.map(y));break;case"remove":case"removeLeft":case"removeRight":e.children.splice(t.index,t.count);break;case"clear":e.children=[];break;default:throw new Error("unhandled operation")}e.onChange.fire()})};var g=function(t){function e(e,n){t.call(this,e,n,"div")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),_=function(t){function e(e,n){t.call(this,e,n,"button"),null!==e&&this.bindProps(["disabled"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),w={input:"onInput",change:"onChange"},C=["placeholder","readonly","disabled","accept","alt","autocomplete","autofocus","checked","defaultChecked","formAction","formEnctype","formMethod","formNoValidate","formTarget","max","maxLength","min","minLength","pattern","multiple","required","type"],x=function(t){function e(e,o){var r,i,a=this;t.call(this,e,o,"input"),null!==e&&(e.value instanceof n||e.value instanceof h?(e.value.unique().listenAndRepeat(function(t){return a.node.value=t}),this.node.addEventListener("input",function(){e.value instanceof n?e.value.update(a.node.value):e.value instanceof h&&e.value.updateUpstream(a.node.value)})):this.node.value=null!=(r=e.value)?r:"",e.checked instanceof n||e.checked instanceof h?(e.checked.unique().listenAndRepeat(function(t){return a.node.checked=t}),this.node.addEventListener("change",function(){e.checked instanceof n?e.checked.update(a.node.checked):e.checked instanceof h&&e.checked.updateUpstream(a.node.checked)})):this.node.checked=null!=(i=e.checked)&&i,this.bindProps(C,e),this.createEventHandlers(w,e))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),O=function(t){function e(e,n){t.call(this,e,n,"li")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),A=function(t){function e(e,n){t.call(this,e,n,"span")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),E=function(t){function e(e,n){t.call(this,e,n,"style"),null!==e&&this.bindProps(["media"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),S=function(t){function e(e,n){t.call(this,e,n,"audio"),null!==e&&this.bindProps(["controls","autoplay","loop","muted","preload","src"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),D=function(t){function e(e,n){t.call(this,e,n,"ul")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),j=function(t){function e(e,n){t.call(this,e,n,"p")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),k=function(t){function e(e,n){t.call(this,e,n,"img"),null!==e&&this.bindProps(["src","alt","width","height","referrerPolicy","sizes","srcset","useMap"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),N=function(t){function e(e,n){t.call(this,e,n,"link"),null!==e&&this.bindProps(["href","rel","media","as","disabled","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),P=function(t){function e(e,n){t.call(this,e,n,"canvas"),null!==e&&this.bindProps(["width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),F=function(t){function e(e,n){t.call(this,e,n,"a"),null!==e&&this.bindProps(["href","target"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),R=function(t){function e(e,n){t.call(this,e,n,"article")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),T=function(t){function e(e,n){t.call(this,e,n,"br")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),U=function(t){function e(e,n){t.call(this,e,n,"form")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),q=function(t){function e(e,n){t.call(this,e,n,"label"),null!==e&&this.bindProps(["for"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),I=function(t){function e(e,n){t.call(this,e,n,"ol")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),L=function(t){function e(e,n){t.call(this,e,n,"pre")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),M=function(t){function e(e,n){t.call(this,e,n,"progress"),null!==e&&this.bindProps(["max","value"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),V=function(t){function e(e,n){t.call(this,e,n,"table")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),K=function(t){function e(e,n){t.call(this,e,n,"td")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),W=function(t){function e(e,n){t.call(this,e,n,"tr")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),H=function(t){function e(e,n){t.call(this,e,n,"th")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),z={input:"onInput",change:"onChange"},B=["placeholder","readonly","disabled","rows","wrap","autocomplete","autofocus","max","maxLength","min","minLength","required","type"],J=function(t){function e(e,n){var o,r,i,a=this;t.call(this,e,n,"textArea"),null!==e&&(e.inputValueSource?(this.node.value=null!=(r=null!=(o=e.initialValue)?o:e.inputValueSource.value)?r:"",e.inputValueSource.unique().listen(function(t){return a.node.value=t})):this.node.value=null!=(i=e.initialValue)?i:"",this.bindProps(B,e),this.createEventHandlers(z,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(a.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),G=function(t){function e(e,n){t.call(this,e,n,"h1")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Q=function(t){function e(e,n){t.call(this,e,n,"h2")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),X=function(t){function e(e,n){t.call(this,e,n,"h3")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Y=function(t){function e(e,n){t.call(this,e,n,"h4")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Z=function(t){function e(e,n){t.call(this,e,n,"h5")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),$=function(t){function e(e,n){t.call(this,e,n,"h6")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),tt=function(t){function e(e,n){t.call(this,e,n,"header")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),et=function(t){function e(e,n){t.call(this,e,n,"footer")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),nt=function(t){function e(e,n){t.call(this,e,n,"nav")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),ot=function(t){function e(e,n){t.call(this,e,n,"b")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),rt=function(t){function e(e,n){t.call(this,e,n,"i")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),it=function(t){function e(e,n){t.call(this,e,n,"script"),null!==e&&this.bindProps(["src","async","defer","integrity","noModule","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),at=function(t){function e(e,n){t.call(this,e,n,"abbr")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),st=function(t){function e(e,n){t.call(this,e,n,"area")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),ct=function(t){function e(e,n){t.call(this,e,n,"aside")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),ut=function(t){function e(e,n){t.call(this,e,n,"em")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),pt=function(t){function e(e,n){t.call(this,e,n,"heading")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),lt=function(t){function e(e,n){t.call(this,e,n,"iframe"),null!==e&&this.bindProps(["src","srcdoc","width","height","allow","allowFullscreen","allowPaymentRequest"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),ht=function(t){function e(e,n){t.call(this,e,n,"noscript")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),dt=function(t){function e(e,n){t.call(this,e,n,"q")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),ft={change:"onChange"},vt=function(t){function e(e,n){var o,r=this;t.call(this,e,n,"select"),null!==e&&(this.createEventHandlers(ft,e),this.initialSelection=e.initialSelection,e.selectedIndexSource?(this.selectedIndexSource=e.selectedIndexSource,e.selectedIndexSource.unique().listenAndRepeat(function(t){return r.node.selectedIndex=t})):this.node.selectedIndex=null!=(o=e.initialSelection)?o:-1,e.selectedIndexSource&&(this.needAttach=!0,this.node.addEventListener("change",function(){e.selectedIndexSource.update(r.node.selectedIndex)})))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleAttach=function(e){t.prototype.handleAttach.call(this,e),this.node.isConnected&&(this.selectedIndexSource?this.node.selectedIndex=this.selectedIndexSource.value:void 0!==this.initialSelection&&(this.node.selectedIndex=this.initialSelection))},e}(m),yt=function(t){function e(e,n){t.call(this,e,n,"source"),null!==e&&this.bindProps(["src","srcSet","media","sizes","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),mt=function(t){function e(e,n){t.call(this,e,n,"title")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),bt=function(t){function e(e,n){t.call(this,e,n,"video"),null!==e&&this.bindProps(["controls","autoplay","loop","muted","preload","src","poster","width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),gt=function(t){function e(e,n){t.call(this,e,n,"tbody")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),_t=function(t){function e(e,n){t.call(this,e,n,"tfoot")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),wt=function(t){function e(e,n){t.call(this,e,n,"thead")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Ct=function(t){function e(e,n){t.call(this,e,n,"summary")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),xt=function(t){function e(e,n){t.call(this,e,n,"details")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Ot=function(t){function e(e,n){t.call(this,e,n,"sub")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),At=function(t){function e(e,n){t.call(this,e,n,"sup")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Et=function(t){function e(e,n){t.call(this,e,n,"svg"),null!==e&&this.bindProps(["width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),St=function(t){function e(e,n){t.call(this,e,n,"data"),null!==e&&this.bindProps(["datalue"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Dt=function(t){function e(e,n){t.call(this,e,n,"time"),null!==e&&this.bindProps(["datetime"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),jt={button:_,div:g,input:x,li:O,span:A,style:E,ul:D,p:j,img:k,link:N,canvas:P,a:F,article:R,br:T,form:U,label:q,ol:I,pre:L,progress:M,table:V,td:K,tr:W,th:H,textarea:J,h1:G,h2:Q,h3:X,h4:Y,h5:Z,h6:$,header:tt,footer:et,nav:nt,b:ot,i:rt,script:it,abbr:at,area:st,aside:ct,audio:S,em:ut,heading:pt,iframe:lt,noscript:ht,option:function(t){function e(e,n){t.call(this,e,n,"option")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),q:dt,select:vt,source:yt,title:mt,video:bt,tbody:gt,tfoot:_t,thead:wt,summary:Ct,details:xt,sub:Ot,sup:At,svg:Et,data:St,time:Dt,template:function(t){function e(e,n){t.call(this,e,n,"template")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m)},kt=function(){};kt.attach=function(t,e){var n=y(t);if(e[p])throw new Error("This node is already managed by aurum and cannot be used");if(!(n instanceof m))throw new Error("Root node of aurum application must be a single dom node");e.appendChild(n.node),n.handleAttach(n),e[p]=n},kt.isAttached=function(t){return void 0!==t[p]},kt.detach=function(t){t[p]&&(t[p].node.remove(),t[p].handleDetach(),t[p]=void 0)},kt.factory=function(t,e){for(var n,o,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];if("string"==typeof t){var a=t;if(void 0===(t=jt[t]))throw new Error("Node "+a+" does not exist or is not supported")}return Object.getPrototypeOf(t)===m?((n={})[d]=!0,n.constructor=function(e,n){return new t(e,n)},n.props=e,n.innerNodes=r,n):((o={})[d]=!0,o.constructor=t,o.props=e,o.innerNodes=r,o)};var Nt=function(t){this.data=t};Nt.prototype.deleteNext=function(){if(this.next){var t=this.next.next;this.next.next=void 0,this.next.previous=void 0,this.next=t,this.next&&(this.next.previous=this)}},Nt.prototype.deletePrevious=function(){if(this.previous){var t=this.previous.previous;this.previous.next=void 0,this.previous.previous=void 0,this.previous=t,this.previous&&(this.previous.next=this)}};var Pt=function(t){var e=this;void 0===t&&(t=[]),this.length=0,t.forEach(function(t){return e.append(t)})};Pt.prototype.find=function(t){for(var e=this.rootNode;e&&!t(e);)e=e.next;return e},Pt.prototype.append=function(t){return this.rootNode||this.lastNode?(this.lastNode.next=new Nt(t),this.lastNode.next.previous=this.lastNode,this.lastNode=this.lastNode.next):this.rootNode=this.lastNode=new Nt(t),this.length++,t},Pt.prototype.forEach=function(t){this.find(function(e){return t(e.data),!1})},Pt.prototype.remove=function(t){if(t===this.rootNode.data)this.rootNode=this.rootNode===this.lastNode?this.lastNode=void 0:this.rootNode.next,this.length--;else{var e=this.find(function(e){return e.next&&e.next.data===t});e&&(e.next===this.lastNode&&(this.lastNode=e),e.deleteNext(),this.length--)}};var Ft=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.cancelables=new Pt(t),this._isCancelled=!1},Rt={isCanceled:{configurable:!0}};Rt.isCanceled.get=function(){return this._isCancelled},Ft.prototype.addCancelable=function(t){return this.throwIfCancelled("attempting to add cancellable to token that is already cancelled"),this.cancelables.append(t),this.cancelables.length>200&&console.log("potential memory leak: cancellation token has over 200 clean up calls"),this},Ft.prototype.removeCancelable=function(t){return this.throwIfCancelled("attempting to remove cancellable from token that is already cancelled"),this.cancelables.remove(t),this},Ft.prototype.addDisposable=function(t){return this.addCancelable(function(){return t.dispose()}),this},Ft.prototype.callIfNotCancelled=function(t){this.isCanceled||t()},Ft.prototype.setTimeout=function(t,e){var n=this;void 0===e&&(e=0);var o=setTimeout(function(){n.removeCancelable(r),t()},e),r=function(){return clearTimeout(o)};this.addCancelable(r)},Ft.prototype.setInterval=function(t,e){var n=setInterval(t,e);this.addCancelable(function(){return clearInterval(n)})},Ft.prototype.requestAnimationFrame=function(t){var e=this,n=requestAnimationFrame(function(){e.removeCancelable(o),t()}),o=function(){return cancelAnimationFrame(n)};this.addCancelable(o)},Ft.prototype.animationLoop=function(t){var e=requestAnimationFrame(function n(o){t(o),e=requestAnimationFrame(n)});this.addCancelable(function(){return cancelAnimationFrame(e)})},Ft.prototype.throwIfCancelled=function(t){if(this.isCanceled)throw new Error(t||"cancellation token is cancelled")},Ft.prototype.chain=function(t,e){return void 0===e&&(e=!1),e&&t.chain(this,!1),this.addCancelable(function(){return t.cancel()}),this},Ft.prototype.registerDomEvent=function(t,e,n){return t.addEventListener(e,n),this.addCancelable(function(){return t.removeEventListener(e,n)}),this},Ft.prototype.cancel=function(){this.isCanceled||(this._isCancelled=!0,this.cancelables.forEach(function(t){return t()}),this.cancelables=void 0)},Object.defineProperties(Ft.prototype,Rt);var Tt=function(t){function e(e,n){t.call(this,e,n,e.tag),e.attributes&&null!==e&&this.bindProps(Object.keys(e.attributes),e.attributes)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(m),Ut=Symbol("route");function qt(){var t=location.hash.substring(1);return t.includes("?")?t.substring(0,t.indexOf("?")):t.includes("#")?t.substring(0,t.indexOf("#")):t}var It=Symbol("switchCase");exports.DataSource=n,exports.ArrayDataSource=o,exports.MappedArrayView=i,exports.SortedArrayView=a,exports.FilteredArrayView=s,exports.ObjectDataSource=c,exports.Aurum=kt,exports.CancellationToken=Ft,exports.Custom=Tt,exports.AurumRouter=function(t,e){if((e=e.map(y)).some(function(t){return!t[Ut]}))throw new Error("Aurum Router only accepts Route and DefaultRoute instances as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default routes only 0 or 1 allowed");var o=new n(qt());return window.addEventListener("hashchange",function(){o.update(qt())}),o.unique().map(function(t){return function(t,e){var n,o;if(null==t)return null===(n=e.find(function(t){return t.default}))||void 0===n?void 0:n.content;if(e.find(function(e){return e.href===t}))return e.find(function(e){return e.href===t}).content;var r=t.split("/");r.pop();for(var i=function(){var t=r.join("/");if(e.find(function(e){return e.href===t}))return{v:e.find(function(e){return e.href===t}).content};r.pop()};r.length;){var a=i();if(a)return a.v}return null===(o=e.find(function(t){return t.default}))||void 0===o?void 0:o.content}(t,e)})},exports.Route=function(t,e){var n;return(n={})[Ut]=!0,n.content=e,n.default=!1,n.href=t.href,n},exports.DefaultRoute=function(t,e){var n;return(n={})[Ut]=!0,n.content=e,n.default=!0,n.href=void 0,n},exports.Suspense=function(t,e){var o=new n(t.fallback);return Promise.all(e.map(y)).then(function(t){o.update(t)}),o},exports.Switch=function(t,e){if((e=e.map(y)).some(function(t){return!t[It]}))throw new Error("Switch only accepts SwitchCase as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default switch cases only 0 or 1 allowed");return t.state.unique().map(function(t){return function(t,e){var n,o,r;return null!==(o=null===(n=e.find(function(e){return e.value===t}))||void 0===n?void 0:n.content)&&void 0!==o?o:null===(r=e.find(function(t){return t.default}))||void 0===r?void 0:r.content}(t,e)})},exports.SwitchCase=function(t,e){var n;return(n={})[It]=!0,n.content=e,n.default=!1,n.value=t.when,n},exports.DefaultSwitchCase=function(t,e){var n;return(n={})[It]=!0,n.content=e,n.default=!0,n.value=void 0,n},exports.aurumElementModelIdentitiy=d,exports.prerender=y,exports.AurumElement=m,exports.AurumFragment=b; | ||
//# sourceMappingURL=aurumjs.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.aurum={})}(this,function(t){var e=function(){this.subscribeChannel=[],this.onAfterFire=[]},n={subscriptions:{configurable:!0}};n.subscriptions.get=function(){return this.subscribeChannel.length},e.prototype.subscribe=function(t,e){return this.createSubscription(t,this.subscribeChannel,e).facade},e.prototype.hasSubscriptions=function(){return this.subscriptions>0},e.prototype.cancelAll=function(){var t=this;this.isFiring?this.onAfterFire.push(function(){return t.subscribeChannel.length=0}):this.subscribeChannel.length=0},e.prototype.afterFire=function(){this.onAfterFire.length>0&&(this.onAfterFire.forEach(function(t){return t()}),this.onAfterFire.length=0)},e.prototype.fire=function(t){this.isFiring=!0;for(var e=this.subscribeChannel.length,n=0;n<e;n++)this.subscribeChannel[n].callback(t);this.isFiring=!1,this.afterFire()},e.prototype.createSubscription=function(t,e,n){var o=this,r={callback:t},i={cancel:function(){o.cancel(r,e)}};return void 0!==n&&n.addCancelable(function(){return o.cancel(r,e)}),e.push(r),{subscription:r,facade:i}},e.prototype.cancel=function(t,e){var n=this,o=e.indexOf(t);o>=0&&(this.isFiring?this.onAfterFire.push(function(){return n.cancel(t,e)}):e.splice(o,1))},Object.defineProperties(e.prototype,n);var o=function(t){this.value=t,this.updateEvent=new e};o.prototype.update=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateEvent.fire(t),this.updating=!1},o.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},o.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},o.prototype.filter=function(t,e){var n=new o;return this.listen(function(e){t(e,n.value)&&n.update(e)},e),n},o.prototype.max=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)>0:t>e})},o.prototype.min=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)<0:t<e})},o.prototype.pipe=function(t,e){this.listen(function(e){return t.update(e)},e)},o.prototype.map=function(t,e){var n=new o(t(this.value));return this.listen(function(e){n.update(t(e))},e),n},o.prototype.tap=function(t,e){var n=new o(this.value);return this.listen(function(e){t(e),n.update(e)},e),n},o.prototype.await=function(t){var e=new o;return this.listen(function(t){try{var n=e.update;return Promise.resolve(t).then(function(t){n.call(e,t)})}catch(t){return Promise.reject(t)}},t),e},o.prototype.unique=function(t){var e=new o(this.value);return this.listen(function(t){t!==e.value&&e.update(t)},t),e},o.prototype.diff=function(t){var e=new o({new:this.value,old:void 0});return this.listen(function(t){e.update({new:t,old:e.value})},t),e},o.prototype.reduce=function(t,e,n){var r=new o(e);return this.listen(function(e){return r.update(t(r.value,e))},n),r},o.prototype.aggregate=function(t,e,n){var r=this,i=new o(e(this.value,t.value));return this.listen(function(){return i.update(e(r.value,t.value))},n),t.listen(function(){return i.update(e(r.value,t.value))},n),i},o.prototype.aggregateThree=function(t,e,n,r){var i=this,a=new o(n(this.value,t.value,e.value));return this.listen(function(){return a.update(n(i.value,t.value,e.value))},r),t.listen(function(){return a.update(n(i.value,t.value,e.value))},r),e.listen(function(){return a.update(n(i.value,t.value,e.value))},r),a},o.prototype.aggregateFour=function(t,e,n,r,i){var a=this,s=new o(r(this.value,t.value,e.value,n.value));return this.listen(function(){return s.update(r(a.value,t.value,e.value,n.value))},i),t.listen(function(){return s.update(r(a.value,t.value,e.value,n.value))},i),e.listen(function(){return s.update(r(a.value,t.value,e.value,n.value))},i),n.listen(function(){return s.update(r(a.value,t.value,e.value,n.value))},i),s},o.prototype.stringJoin=function(t,e){var n=new o("");return this.listen(function(e){return n.update(n.value+t+e.toString())},e),n},o.prototype.combine=function(t,e){var n=new o;this.pipe(n,e);for(var r=0,i=t;r<i.length;r+=1)i[r].pipe(n,e);return n},o.prototype.delay=function(t,e){var n=new o(this.value);return this.listen(function(e){setTimeout(function(){n.update(e)},t)},e),n},o.prototype.debounce=function(t,e){var n,r=new o(this.value);return this.listen(function(e){clearTimeout(n),n=setTimeout(function(){r.update(e)},t)},e),r},o.prototype.throttle=function(t,e){var n=new o(this.value),r=!1;return this.listen(function(e){r||(n.update(e),r=!0,setTimeout(function(){r=!1},t))},e),n},o.prototype.buffer=function(t,e){var n,r=new o,i=[];return this.listen(function(e){i.push(e),n||(n=setTimeout(function(){n=void 0,r.update(i),i=[]},t))},e),r},o.prototype.accumulate=function(t){var e=new r;return this.listen(function(t){e.push(t)},t),e},o.prototype.pick=function(t,e){var n,r=new o(null===(n=this.value)||void 0===n?void 0:n[t]);return this.listen(function(e){r.update(null!=e?e[t]:e)},e),r},o.prototype.cancelAll=function(){this.updateEvent.cancelAll()};var r=function(t){this.data=t?t.slice():[],this.lengthSource=new o(this.data.length).unique(),this.updateEvent=new e},i={length:{configurable:!0}};r.prototype.listenAndRepeat=function(t,e){return t({operation:"add",operationDetailed:"append",index:0,items:this.data,newState:this.data,count:this.data.length}),this.listen(t,e)},r.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},i.length.get=function(){return this.lengthSource},r.prototype.getData=function(){return this.data.slice()},r.prototype.get=function(t){return this.data[t]},r.prototype.set=function(t,e){var n=this.data[t];n!==e&&(this.data[t]=e,this.update({operation:"replace",operationDetailed:"replace",target:n,count:1,index:t,items:[e],newState:this.data}),this.lengthSource.update(this.data.length))},r.prototype.swap=function(t,e){if(t!==e){var n=this.data[t],o=this.data[e];this.data[e]=n,this.data[t]=o,this.update({operation:"swap",operationDetailed:"swap",index:t,index2:e,items:[n,o],newState:this.data}),this.lengthSource.update(this.data.length)}},r.prototype.swapItems=function(t,e){if(t!==e){var n=this.data.indexOf(t),o=this.data.indexOf(e);-1!==n&&-1!==o&&(this.data[o]=t,this.data[n]=e),this.update({operation:"swap",operationDetailed:"swap",index:n,index2:o,items:[t,e],newState:this.data}),this.lengthSource.update(this.data.length)}},r.prototype.appendArray=function(t){var e=this.data;this.data=new Array(e.length);var n=0;for(n=0;n<e.length;n++)this.data[n]=e[n];for(var o=0;o<t.length;o++)this.data[n+o]=t[o];this.update({operation:"add",operationDetailed:"append",count:t.length,index:this.data.length-t.length,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.push=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.appendArray(t),this.lengthSource.update(this.data.length)},r.prototype.unshift=function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];(t=this.data).unshift.apply(t,e),this.update({operation:"add",operationDetailed:"prepend",count:e.length,items:e,index:0,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.pop=function(){var t=this.data.pop();return this.update({operation:"remove",operationDetailed:"removeRight",count:1,index:this.data.length,items:[t],newState:this.data}),this.lengthSource.update(this.data.length),t},r.prototype.merge=function(t){for(var e=0;e<t.length;e++)this.data[e]!==t[e]&&(this.data.length>e?this.set(e,t[e]):this.push(t[e]));this.data.length>t.length&&this.removeRight(this.data.length-t.length),this.lengthSource.update(this.data.length)},r.prototype.removeRight=function(t){var e=this.data.length,n=this.data.splice(e-t,t);this.update({operation:"remove",operationDetailed:"removeRight",count:t,index:e-t,items:n,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.removeLeft=function(t){var e=this.data.splice(0,t);this.update({operation:"remove",operationDetailed:"removeLeft",count:t,index:0,items:e,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.remove=function(t){var e=this.data.indexOf(t);-1!==e&&(this.data.splice(e,1),this.update({operation:"remove",operationDetailed:"remove",count:1,index:e,items:[t],newState:this.data}),this.lengthSource.update(this.data.length))},r.prototype.clear=function(){var t=this.data;this.data=[],this.update({operation:"remove",operationDetailed:"clear",count:t.length,index:0,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.shift=function(){var t=this.data.shift();return this.update({operation:"remove",operationDetailed:"removeLeft",items:[t],count:1,index:0,newState:this.data}),this.lengthSource.update(this.data.length),t},r.prototype.toArray=function(){return this.data.slice()},r.prototype.sort=function(t,e){return new s(this,t,e)},r.prototype.map=function(t,e){return new a(this,t,e)},r.prototype.filter=function(t,e,n){void 0===e&&(e=[]);var o=new c(this,t,n);return e.forEach(function(t){t.unique().listen(function(){return o.refresh()})}),o},r.prototype.forEach=function(t){return this.data.forEach(t)},r.prototype.update=function(t){this.updateEvent.fire(t)},Object.defineProperties(r.prototype,i);var a=function(t){function e(e,n,o){var r=this,i=e.getData().map(n);t.call(this,i),this.mapper=n,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(r.data[t.index]);break;case"clear":r.clear();break;case"prepend":(e=r).unshift.apply(e,t.items.map(r.mapper));break;case"append":r.appendArray(t.items.map(r.mapper));break;case"swap":r.swap(t.index,t.index2);break;case"replace":r.set(t.index,r.mapper(t.items[0]))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(r),s=function(t){function e(e,n,o){var r=this,i=e.getData().sort(n);t.call(this,i),this.comparator=n,e.listen(function(t){var e,n;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(t.items[0]);break;case"clear":r.data.length=0;break;case"prepend":(e=r).unshift.apply(e,t.items),r.data.sort(r.comparator);break;case"append":(n=r).push.apply(n,t.items),r.data.sort(r.comparator);break;case"swap":break;case"replace":r.set(t.index,t.items[0]),r.data.sort(r.comparator)}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(r),c=function(t){function e(e,n,o){var r=this;Array.isArray(e)&&(e=new t(e));var i=e.data.filter(n=null!=n?n:function(){return!0});t.call(this,i),this.parent=e,this.viewFilter=n,e.listen(function(t){var e,n,o;switch(t.operationDetailed){case"clear":r.clear();break;case"removeLeft":case"removeRight":case"remove":for(var i=0,a=t.items;i<a.length;i+=1)r.remove(a[i]);break;case"prepend":o=t.items.filter(r.viewFilter),(e=r).unshift.apply(e,o);break;case"append":o=t.items.filter(r.viewFilter),(n=r).push.apply(n,o);break;case"swap":var s=r.data.indexOf(t.items[0]),c=r.data.indexOf(t.items[1]);-1!==s&&-1!==c&&r.swap(s,c);break;case"replace":var u=r.data.indexOf(t.target);-1!==u&&(r.viewFilter(t.items[0])?r.set(u,t.items[0]):r.remove(t.target))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.updateFilter=function(t){if(this.viewFilter!==t)return this.viewFilter=t,this.refresh(),this.data.length},e.prototype.refresh=function(){var t;this.clear();var e=this.parent.data.filter(this.viewFilter);(t=this).push.apply(t,e)},e}(r),u=function(t){t&&(this.data=t),this.updateEvent=new e,this.updateEventOnKey=new Map};u.prototype.pick=function(t,e){var n,r=new o(null===(n=this.data)||void 0===n?void 0:n[t]);return this.listenOnKey(t,function(t){r.update(t.newValue)},e),r},u.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},u.prototype.listenOnKeyAndRepeat=function(t,e,n){return e({key:t,newValue:this.data[t],oldValue:void 0}),this.listenOnKey(t,e,n)},u.prototype.listenOnKey=function(t,n,o){return this.updateEventOnKey.has(t)||this.updateEventOnKey.set(t,new e),this.updateEventOnKey.get(t).subscribe(n,o).cancel},u.prototype.keys=function(){return Object.keys(this.data)},u.prototype.values=function(){return Object.values(this.data)},u.prototype.get=function(t){return this.data[t]},u.prototype.delete=function(t,e){var n=this.data[t];delete this.data[t],this.updateEvent.fire({oldValue:n,key:t,newValue:void 0,deleted:!0})},u.prototype.set=function(t,e){if(this.data[t]!==e){var n=this.data[t];this.data[t]=e,this.updateEvent.fire({oldValue:n,key:t,newValue:this.data[t]}),this.updateEventOnKey.has(t)&&this.updateEventOnKey.get(t).fire({oldValue:n,key:t,newValue:this.data[t]})}},u.prototype.assign=function(t){if(t instanceof u)for(var e=0,n=t.keys();e<n.length;e+=1){var o=n[e];this.set(o,t.data[o])}else for(var r=0,i=Object.keys(t);r<i.length;r+=1){var a=i[r];this.set(a,t[a])}},u.prototype.toObject=function(){return Object.assign({},this.data)},u.prototype.toDataSource=function(){var t=this,e=new o(this.data);return this.listen(function(n){e.update(t.data)}),e};var l,p=Symbol("owner"),h=function(t){var e=this;this.node=this.create(t),t instanceof o&&t.listen(function(t){e.node&&(e.node.textContent=t)})};h.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},h.prototype.create=function(t){var e=document.createTextNode(this.resolveStringSource(t));return e[p]=this,e},h.prototype.remove=function(){this.hasParent()&&this.node.parentElement[p].removeChild(this.node)},h.prototype.hasParent=function(){return!!this.node.parentElement},function(t){t[t.UPSTREAM=0]="UPSTREAM",t[t.DOWNSTREAM=1]="DOWNSTREAM"}(l||(l={}));var d=function(t){this.value=t,this.updateDownstreamEvent=new e,this.updateUpstreamEvent=new e};d.fromTwoDataSource=function(t,e,n){var o=new d(n);o.updateDownstreamEvent=t.updateEvent,o.updateUpstreamEvent=e.updateEvent},d.createOneWay=function(t,e){return void 0===t&&(t=l.DOWNSTREAM),new d(e).oneWayFlow(t)},d.prototype.updateDownstream=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateDownstreamEvent.fire(t),this.updating=!1},d.prototype.updateUpstream=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateUpstreamEvent.fire(t),this.updating=!1},d.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},d.prototype.listen=function(t,e){return this.updateDownstreamEvent.subscribe(t,e),this.updateUpstreamEvent.subscribe(t,e).cancel},d.prototype.listenUpstream=function(t,e){return this.updateUpstreamEvent.subscribe(t,e).cancel},d.prototype.listenDownstream=function(t,e){return this.updateDownstreamEvent.subscribe(t,e).cancel},d.prototype.filter=function(t,e,n){var o=this;e||(e=t);var r=new d;return this.listenDownstream(function(e){t(e)&&r.updateDownstream(e)},n),r.listenUpstream(function(n){(null!=e?e:t)(n)&&o.updateUpstream(n)},n),r},d.prototype.pipe=function(t,e){var n=this;this.listenDownstream(function(e){return t.updateDownstream(e)},e),t.listenUpstream(function(t){return n.updateUpstream(t)},e)},d.prototype.map=function(t,e,n){var o=this,r=new d(t(this.value));return this.listenDownstream(function(e){return r.updateDownstream(t(e))},n),r.listenUpstream(function(t){return o.updateUpstream(e(t))},n),r},d.prototype.unique=function(t){var e=this,n=new d(this.value);return this.listenDownstream(function(t){n.value!==t&&n.updateDownstream(t)},t),n.listenUpstream(function(t){e.value!==t&&e.updateUpstream(t)},t),n},d.prototype.oneWayFlow=function(t,e){var n=this;void 0===t&&(t=l.DOWNSTREAM);var o=new d(this.value);return t===l.DOWNSTREAM?(this.listenDownstream(function(t){return o.updateDownstream(t)},e),o.updateUpstream=function(){}):(o.listenUpstream(function(t){return n.updateUpstream(t)}),o.updateDownstream=function(){}),o},d.prototype.cancelAll=function(){this.updateDownstreamEvent.cancelAll(),this.updateUpstreamEvent.cancelAll()};var f=Symbol("AurumElementModel"),v={drag:"onDrag",dragstart:"onDragStart",dragend:"onDragEnd",dragexit:"onDragExit",dragover:"onDragOver",dragenter:"onDragEnter",dragleave:"onDragLeave",blur:"onBlur",focus:"onFocus",click:"onClick",dblclick:"onDblClick",keydown:"onKeyDown",keyhit:"onKeyHit",keyup:"onKeyUp",mousedown:"onMouseDown",mouseup:"onMouseUp",mousemove:"onMouseMove",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",load:"onLoad",error:"onError"},y=["id","name","draggable","tabindex","style","role","contentEditable"];function m(t){return t&&t[f]?m(t.constructor(t.props,t.innerNodes)):t}var b=function(t,e,n){var o,r;this.node=this.create(n),this.children=[],null!=t&&(t.onAttach&&(this.onAttach=t.onAttach,this.needAttach=!0),this.onDetach=t.onDetach,this.initialize(t),null===(r=(o=t).onCreate)||void 0===r||r.call(o,this.node)),e&&this.addChildren(e)};b.prototype.initialize=function(t){this.createEventHandlers(v,t);var e=Object.keys(t).filter(function(t){return t.includes("-")});this.bindProps(y,t,e),t.class&&this.handleClass(t.class)},b.prototype.bindProps=function(t,e,n){for(var o=0,r=t;o<r.length;o+=1){var i=r[o];e[i]&&this.assignStringSourceToAttribute(e[i],i)}if(n)for(var a=0,s=n;a<s.length;a+=1){var c=s[a];e[c]&&this.assignStringSourceToAttribute(e[c],c)}},b.prototype.createEventHandlers=function(t,e){var n=this,r=function(r){e[t[r]]&&(e[t[r]]instanceof o?n.node.addEventListener(r,function(n){return e[t[r]].update(n)}):e[t[r]]instanceof d?n.node.addEventListener(r,function(n){return e[t[r]].updateDownstream(n)}):"function"==typeof e[t[r]]&&n.node.addEventListener(r,function(n){return e[t[r]](n)}))};for(var i in t)r(i)},b.prototype.render=function(){for(var t=0,e=0;e<this.children.length;e++,t++)this.children[e]instanceof _?t=this.renderFragment(this.children[e],t):this.renderChild(this.children[e],t);for(;this.node.childNodes.length>t;)this.node.removeChild(this.node.childNodes[this.node.childNodes.length-1])},b.prototype.renderFragment=function(t,e){for(var n=0;n<t.children.length;n++,e++)t.children[n]instanceof _?e=this.renderFragment(t.children[n],e):this.renderChild(t.children[n],e);return--e},b.prototype.renderChild=function(t,e){if(this.node.childNodes.length<=e)return this.addChildDom(t);if(this.node.childNodes[e][p]!==t){var n=this.getChildIndex(t.node);-1!==n?this.swapChildrenDom(e,n):this.addDomNodeAt(t.node,e)}},b.prototype.assignStringSourceToAttribute=function(t,e){var n=this;"string"==typeof t||"boolean"==typeof t?"boolean"==typeof t?t?this.node.setAttribute(e,""):this.node.removeAttribute(e):this.node.setAttribute(e,t):t.unique().listenAndRepeat(function(t){"boolean"==typeof t?t?n.node.setAttribute(e,""):n.node.removeAttribute(e):n.node.setAttribute(e,t)})},b.prototype.handleAttach=function(t){var e,n,o,r;if(this.needAttach)if(t.isConnected()){null===(e=this.onAttach)||void 0===e||e.call(this,this.node);for(var i=0,a=this.node.childNodes;i<a.length;i+=1)null===(r=null===(n=a[i][p])||void 0===n?void 0:(o=n).handleAttach)||void 0===r||r.call(o,this)}else t.needAttach=!0},b.prototype.handleDetach=function(){var t,e,n;if(!this.node.isConnected){null===(t=this.onDetach)||void 0===t||t.call(this,this.node);for(var o=0,r=this.node.childNodes;o<r.length;o+=1){var i=r[o];i[p]&&(null===(n=(e=i[p]).handleDetach)||void 0===n||n.call(e))}}},b.prototype.handleClass=function(t){var e=this;if("string"==typeof t)this.node.className=t;else if(t instanceof o)t.value&&(Array.isArray(t.value)?(this.node.className=t.value.join(" "),t.unique().listen(function(){e.node.className=t.value.join(" ")})):(this.node.className=t.value,t.unique().listen(function(){e.node.className=t.value}))),t.unique().listen(function(t){return e.node.className=t});else{var n=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");this.node.className=n;for(var r=0,i=t;r<i.length;r+=1){var a=i[r];a instanceof o&&a.unique().listen(function(n){var o=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");e.node.className=o})}}},b.prototype.create=function(t){var e=document.createElement(t);return e[p]=this,e},b.prototype.getChildIndex=function(t){for(var e=0,n=0,o=this.node.childNodes;n<o.length;n+=1){if(o[n]===t)return e;e++}return-1},b.prototype.hasChild=function(t){for(var e=0,n=t.childNodes;e<n.length;e+=1)if(n[e]===t)return!0;return!1},b.prototype.addChildDom=function(t){var e,n;this.node.appendChild(t.node),null===(n=(e=t).handleAttach)||void 0===n||n.call(e,this)},b.prototype.swapChildrenDom=function(t,e){if(t!==e){var n=this.node.childNodes[t],o=this.node.childNodes[e];n.remove(),o.remove(),t<e?(this.addDomNodeAt(o,t),this.addDomNodeAt(n,e)):(this.addDomNodeAt(n,e),this.addDomNodeAt(o,t))}},b.prototype.addDomNodeAt=function(t,e){var n,o,r,i;e>=this.node.childNodes.length?(this.node.appendChild(t),null===(o=(n=t[p]).handleAttach)||void 0===o||o.call(n,this)):(this.node.insertBefore(t,this.node.childNodes[e]),null===(i=(r=t[p]).handleAttach)||void 0===i||i.call(r,this))},b.prototype.remove=function(){this.hasParent()&&this.node.parentElement[p].removeChild(this.node)},b.prototype.hasParent=function(){return!!this.node.parentElement},b.prototype.isConnected=function(){return this.node.isConnected},b.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1),this.render()},b.prototype.removeChildAt=function(t){this.children.splice(t,1),this.render()},b.prototype.swapChildren=function(t,e){if(t!==e){var n=this.children[t];this.children[t]=this.children[e],this.children[e]=n,this.render()}},b.prototype.clearChildren=function(){this.children.length=0,this.render()},b.prototype.addChild=function(t){if(null!=t&&(!t[f]||void 0!==(t=m(t))))if(Array.isArray(t))for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e]);else this.children.push(this.childNodeToAurum(t)),this.render()},b.prototype.childNodeToAurum=function(t){var e=this;if(t instanceof b)return t;if(t instanceof Promise){var n=new _({});return t.then(function(t){n.addChildren([t]),e.render()}),n}if(t instanceof r){var i=new _({repeatModel:t});return i.onChange.subscribe(function(){return e.render()}),i}if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return new h(t.toString());if(t instanceof o){var a=new _({},[t]);return a.onChange.subscribe(function(){return e.render()}),a}throw new Error("Unsupported child type")},b.prototype.addChildAt=function(t,e){this.children.splice(e,0,this.childNodeToAurum(t)),this.render()},b.prototype.addChildren=function(t){if(0!==t.length)for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e])};var _=function(t,n){this.onChange=new e,this.children=[],t.repeatModel?this.handleRepeat(t.repeatModel):n&&this.addChildren(n)};_.prototype.addChildren=function(t){for(var e=this,n=function(){var t=i[r],n=void 0;if((n=t[f]?m(t):t)instanceof b)e.children.push(n);else{if(!(n instanceof o))throw new Error("case not yet implemented");var a=void 0,s=void 0,c={ts:void 0};n.unique().listenAndRepeat(function(t){if(c.ts=Date.now(),null==t&&s)return e.children.length=0,e.onChange.fire(),void(s=!1);if(!Array.isArray(t)&&s&&(e.children.length=0,e.onChange.fire(),s=!1),Array.isArray(t)){s=!0,e.children.length=0,e.onChange.fire();for(var o=0,r=t;o<r.length;o+=1)e.handleSourceChild(r[o],void 0,void 0,c,c.ts)}else a=e.handleSourceChild(t,a,n,c,c.ts)})}},r=0,i=t;r<i.length;r+=1)n()},_.prototype.handleSourceChild=function(t,e,n,i,a){var s=this;if(null!=t){if(t[f]&&(t=m(t)),"string"==typeof t||"bigint"==typeof t||"number"==typeof t||"boolean"==typeof t)if(e){if(e instanceof b){var c=new h(null!=n?n:t);this.children.splice(this.children.indexOf(e),1,c),e=c,this.onChange.fire()}}else{var u=new h(null!=n?n:t);this.children.push(u),e=u,this.onChange.fire()}else if(t instanceof b)t!==e&&(e?this.children.splice(this.children.indexOf(e),1,t):this.children.push(t),e=t,this.onChange.fire());else if(t instanceof Promise)t.then(function(t){i.ts===a&&(s.addChildren([t]),s.onChange.fire())});else if(t instanceof o)if(e){if(e!==t){var l=new _({},[t]);l.onChange.subscribe(function(){return s.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,l),e=l,this.onChange.fire()}}else{var p=new _({},[t]);e=p,this.children.push(p),p.onChange.subscribe(function(){return s.onChange.fire()}),this.onChange.fire()}else if(t instanceof r)if(e){if(e!==t){var d=new _({repeatModel:t});d.onChange.subscribe(function(){return s.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,d),e=d,this.onChange.fire()}}else{var v=new _({repeatModel:t});e=v,this.children.push(v),v.onChange.subscribe(function(){return s.onChange.fire()}),this.onChange.fire()}return e}e&&(this.children.splice(this.children.indexOf(e),1),e=void 0,this.onChange.fire())},_.prototype.handleRepeat=function(t){var e=this;t.listenAndRepeat(function(t){var n;switch(t.operationDetailed){case"replace":e.children[t.index]=m(t.items[0]);break;case"swap":var o=e.children[t.index2];e.children[t.index2]=e.children[t.index],e.children[t.index]=o;break;case"append":e.children=e.children.concat(t.items.map(m));break;case"prepend":(n=e.children).unshift.apply(n,t.items.map(m));break;case"remove":case"removeLeft":case"removeRight":e.children.splice(t.index,t.count);break;case"clear":e.children=[];break;default:throw new Error("unhandled operation")}e.onChange.fire()})};var g=function(t){function e(e,n){t.call(this,e,n,"div")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),w=function(t){function e(e,n){t.call(this,e,n,"button"),null!==e&&this.bindProps(["disabled"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),C={input:"onInput",change:"onChange"},O=["placeholder","readonly","disabled","accept","alt","autocomplete","autofocus","checked","defaultChecked","formAction","formEnctype","formMethod","formNoValidate","formTarget","max","maxLength","min","minLength","pattern","multiple","required","type"],A=function(t){function e(e,n){var r,i,a=this;t.call(this,e,n,"input"),null!==e&&(e.value instanceof o||e.value instanceof d?(e.value.unique().listenAndRepeat(function(t){return a.node.value=t}),this.node.addEventListener("input",function(){e.value instanceof o?e.value.update(a.node.value):e.value instanceof d&&e.value.updateUpstream(a.node.value)})):this.node.value=null!=(r=e.value)?r:"",e.checked instanceof o||e.checked instanceof d?(e.checked.unique().listenAndRepeat(function(t){return a.node.checked=t}),this.node.addEventListener("change",function(){e.checked instanceof o?e.checked.update(a.node.checked):e.checked instanceof d&&e.checked.updateUpstream(a.node.checked)})):this.node.checked=null!=(i=e.checked)&&i,this.bindProps(O,e),this.createEventHandlers(C,e))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),x=function(t){function e(e,n){t.call(this,e,n,"li")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),E=function(t){function e(e,n){t.call(this,e,n,"span")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),S=function(t){function e(e,n){t.call(this,e,n,"style"),null!==e&&this.bindProps(["media"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),j=function(t){function e(e,n){t.call(this,e,n,"audio"),null!==e&&this.bindProps(["controls","autoplay","loop","muted","preload","src"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),D=function(t){function e(e,n){t.call(this,e,n,"ul")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),k=function(t){function e(e,n){t.call(this,e,n,"p")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),N=function(t){function e(e,n){t.call(this,e,n,"img"),null!==e&&this.bindProps(["src","alt","width","height","referrerPolicy","sizes","srcset","useMap"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),P=function(t){function e(e,n){t.call(this,e,n,"link"),null!==e&&this.bindProps(["href","rel","media","as","disabled","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),R=function(t){function e(e,n){t.call(this,e,n,"canvas"),null!==e&&this.bindProps(["width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),F=function(t){function e(e,n){t.call(this,e,n,"a"),null!==e&&this.bindProps(["href","target"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),T=function(t){function e(e,n){t.call(this,e,n,"article")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),U=function(t){function e(e,n){t.call(this,e,n,"br")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),L=function(t){function e(e,n){t.call(this,e,n,"form")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),I=function(t){function e(e,n){t.call(this,e,n,"label"),null!==e&&this.bindProps(["for"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),M=function(t){function e(e,n){t.call(this,e,n,"ol")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),q=function(t){function e(e,n){t.call(this,e,n,"pre")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),V=function(t){function e(e,n){t.call(this,e,n,"progress"),null!==e&&this.bindProps(["max","value"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),K=function(t){function e(e,n){t.call(this,e,n,"table")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),W=function(t){function e(e,n){t.call(this,e,n,"td")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),H=function(t){function e(e,n){t.call(this,e,n,"tr")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),z=function(t){function e(e,n){t.call(this,e,n,"th")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),B={input:"onInput",change:"onChange"},J=["placeholder","readonly","disabled","rows","wrap","autocomplete","autofocus","max","maxLength","min","minLength","required","type"],G=function(t){function e(e,n){var o,r,i,a=this;t.call(this,e,n,"textArea"),null!==e&&(e.inputValueSource?(this.node.value=null!=(r=null!=(o=e.initialValue)?o:e.inputValueSource.value)?r:"",e.inputValueSource.unique().listen(function(t){return a.node.value=t})):this.node.value=null!=(i=e.initialValue)?i:"",this.bindProps(J,e),this.createEventHandlers(B,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(a.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Q=function(t){function e(e,n){t.call(this,e,n,"h1")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),X=function(t){function e(e,n){t.call(this,e,n,"h2")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Y=function(t){function e(e,n){t.call(this,e,n,"h3")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Z=function(t){function e(e,n){t.call(this,e,n,"h4")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),$=function(t){function e(e,n){t.call(this,e,n,"h5")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),tt=function(t){function e(e,n){t.call(this,e,n,"h6")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),et=function(t){function e(e,n){t.call(this,e,n,"header")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),nt=function(t){function e(e,n){t.call(this,e,n,"footer")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),ot=function(t){function e(e,n){t.call(this,e,n,"nav")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),rt=function(t){function e(e,n){t.call(this,e,n,"b")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),it=function(t){function e(e,n){t.call(this,e,n,"i")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),at=function(t){function e(e,n){t.call(this,e,n,"script"),null!==e&&this.bindProps(["src","async","defer","integrity","noModule","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),st=function(t){function e(e,n){t.call(this,e,n,"abbr")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),ct=function(t){function e(e,n){t.call(this,e,n,"area")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),ut=function(t){function e(e,n){t.call(this,e,n,"aside")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),lt=function(t){function e(e,n){t.call(this,e,n,"em")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),pt=function(t){function e(e,n){t.call(this,e,n,"heading")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),ht=function(t){function e(e,n){t.call(this,e,n,"iframe"),null!==e&&this.bindProps(["src","srcdoc","width","height","allow","allowFullscreen","allowPaymentRequest"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),dt=function(t){function e(e,n){t.call(this,e,n,"noscript")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),ft=function(t){function e(e,n){t.call(this,e,n,"q")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),vt={change:"onChange"},yt=function(t){function e(e,n){var o,r=this;t.call(this,e,n,"select"),null!==e&&(this.createEventHandlers(vt,e),this.initialSelection=e.initialSelection,e.selectedIndexSource?(this.selectedIndexSource=e.selectedIndexSource,e.selectedIndexSource.unique().listenAndRepeat(function(t){return r.node.selectedIndex=t})):this.node.selectedIndex=null!=(o=e.initialSelection)?o:-1,e.selectedIndexSource&&(this.needAttach=!0,this.node.addEventListener("change",function(){e.selectedIndexSource.update(r.node.selectedIndex)})))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleAttach=function(e){t.prototype.handleAttach.call(this,e),this.node.isConnected&&(this.selectedIndexSource?this.node.selectedIndex=this.selectedIndexSource.value:void 0!==this.initialSelection&&(this.node.selectedIndex=this.initialSelection))},e}(b),mt=function(t){function e(e,n){t.call(this,e,n,"source"),null!==e&&this.bindProps(["src","srcSet","media","sizes","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),bt=function(t){function e(e,n){t.call(this,e,n,"title")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),_t=function(t){function e(e,n){t.call(this,e,n,"video"),null!==e&&this.bindProps(["controls","autoplay","loop","muted","preload","src","poster","width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),gt=function(t){function e(e,n){t.call(this,e,n,"tbody")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),wt=function(t){function e(e,n){t.call(this,e,n,"tfoot")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Ct=function(t){function e(e,n){t.call(this,e,n,"thead")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Ot=function(t){function e(e,n){t.call(this,e,n,"summary")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),At=function(t){function e(e,n){t.call(this,e,n,"details")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),xt=function(t){function e(e,n){t.call(this,e,n,"sub")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Et=function(t){function e(e,n){t.call(this,e,n,"sup")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),St=function(t){function e(e,n){t.call(this,e,n,"svg"),null!==e&&this.bindProps(["width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),jt=function(t){function e(e,n){t.call(this,e,n,"data"),null!==e&&this.bindProps(["datalue"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Dt=function(t){function e(e,n){t.call(this,e,n,"time"),null!==e&&this.bindProps(["datetime"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),kt={button:w,div:g,input:A,li:x,span:E,style:S,ul:D,p:k,img:N,link:P,canvas:R,a:F,article:T,br:U,form:L,label:I,ol:M,pre:q,progress:V,table:K,td:W,tr:H,th:z,textarea:G,h1:Q,h2:X,h3:Y,h4:Z,h5:$,h6:tt,header:et,footer:nt,nav:ot,b:rt,i:it,script:at,abbr:st,area:ct,aside:ut,audio:j,em:lt,heading:pt,iframe:ht,noscript:dt,option:function(t){function e(e,n){t.call(this,e,n,"option")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),q:ft,select:yt,source:mt,title:bt,video:_t,tbody:gt,tfoot:wt,thead:Ct,summary:Ot,details:At,sub:xt,sup:Et,svg:St,data:jt,time:Dt,template:function(t){function e(e,n){t.call(this,e,n,"template")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b)},Nt=function(){};Nt.attach=function(t,e){var n=m(t);if(e[p])throw new Error("This node is already managed by aurum and cannot be used");if(!(n instanceof b))throw new Error("Root node of aurum application must be a single dom node");e.appendChild(n.node),n.handleAttach(n),e[p]=n},Nt.isAttached=function(t){return void 0!==t[p]},Nt.detach=function(t){t[p]&&(t[p].node.remove(),t[p].handleDetach(),t[p]=void 0)},Nt.factory=function(t,e){for(var n,o,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];if("string"==typeof t){var a=t;if(void 0===(t=kt[t]))throw new Error("Node "+a+" does not exist or is not supported")}return Object.getPrototypeOf(t)===b?((n={})[f]=!0,n.constructor=function(e,n){return new t(e,n)},n.props=e,n.innerNodes=r,n):((o={})[f]=!0,o.constructor=t,o.props=e,o.innerNodes=r,o)};var Pt=function(t){this.data=t};Pt.prototype.deleteNext=function(){if(this.next){var t=this.next.next;this.next.next=void 0,this.next.previous=void 0,this.next=t,this.next&&(this.next.previous=this)}},Pt.prototype.deletePrevious=function(){if(this.previous){var t=this.previous.previous;this.previous.next=void 0,this.previous.previous=void 0,this.previous=t,this.previous&&(this.previous.next=this)}};var Rt=function(t){var e=this;void 0===t&&(t=[]),this.length=0,t.forEach(function(t){return e.append(t)})};Rt.prototype.find=function(t){for(var e=this.rootNode;e&&!t(e);)e=e.next;return e},Rt.prototype.append=function(t){return this.rootNode||this.lastNode?(this.lastNode.next=new Pt(t),this.lastNode.next.previous=this.lastNode,this.lastNode=this.lastNode.next):this.rootNode=this.lastNode=new Pt(t),this.length++,t},Rt.prototype.forEach=function(t){this.find(function(e){return t(e.data),!1})},Rt.prototype.remove=function(t){if(t===this.rootNode.data)this.rootNode=this.rootNode===this.lastNode?this.lastNode=void 0:this.rootNode.next,this.length--;else{var e=this.find(function(e){return e.next&&e.next.data===t});e&&(e.next===this.lastNode&&(this.lastNode=e),e.deleteNext(),this.length--)}};var Ft=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.cancelables=new Rt(t),this._isCancelled=!1},Tt={isCanceled:{configurable:!0}};Tt.isCanceled.get=function(){return this._isCancelled},Ft.prototype.addCancelable=function(t){return this.throwIfCancelled("attempting to add cancellable to token that is already cancelled"),this.cancelables.append(t),this.cancelables.length>200&&console.log("potential memory leak: cancellation token has over 200 clean up calls"),this},Ft.prototype.removeCancelable=function(t){return this.throwIfCancelled("attempting to remove cancellable from token that is already cancelled"),this.cancelables.remove(t),this},Ft.prototype.addDisposable=function(t){return this.addCancelable(function(){return t.dispose()}),this},Ft.prototype.callIfNotCancelled=function(t){this.isCanceled||t()},Ft.prototype.setTimeout=function(t,e){var n=this;void 0===e&&(e=0);var o=setTimeout(function(){n.removeCancelable(r),t()},e),r=function(){return clearTimeout(o)};this.addCancelable(r)},Ft.prototype.setInterval=function(t,e){var n=setInterval(t,e);this.addCancelable(function(){return clearInterval(n)})},Ft.prototype.requestAnimationFrame=function(t){var e=this,n=requestAnimationFrame(function(){e.removeCancelable(o),t()}),o=function(){return cancelAnimationFrame(n)};this.addCancelable(o)},Ft.prototype.animationLoop=function(t){var e=requestAnimationFrame(function n(o){t(o),e=requestAnimationFrame(n)});this.addCancelable(function(){return cancelAnimationFrame(e)})},Ft.prototype.throwIfCancelled=function(t){if(this.isCanceled)throw new Error(t||"cancellation token is cancelled")},Ft.prototype.chain=function(t,e){return void 0===e&&(e=!1),e&&t.chain(this,!1),this.addCancelable(function(){return t.cancel()}),this},Ft.prototype.registerDomEvent=function(t,e,n){return t.addEventListener(e,n),this.addCancelable(function(){return t.removeEventListener(e,n)}),this},Ft.prototype.cancel=function(){this.isCanceled||(this._isCancelled=!0,this.cancelables.forEach(function(t){return t()}),this.cancelables=void 0)},Object.defineProperties(Ft.prototype,Tt);var Ut=function(t){function e(e,n){t.call(this,e,n,e.tag),e.attributes&&null!==e&&this.bindProps(Object.keys(e.attributes),e.attributes)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Lt=Symbol("route");function It(){var t=location.hash.substring(1);return t.includes("?")?t.substring(0,t.indexOf("?")):t.includes("#")?t.substring(0,t.indexOf("#")):t}var Mt=Symbol("switchCase");t.DataSource=o,t.ArrayDataSource=r,t.MappedArrayView=a,t.SortedArrayView=s,t.FilteredArrayView=c,t.ObjectDataSource=u,t.Aurum=Nt,t.CancellationToken=Ft,t.Custom=Ut,t.AurumRouter=function(t,e){if((e=e.map(m)).some(function(t){return!t[Lt]}))throw new Error("Aurum Router only accepts Route and DefaultRoute instances as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default routes only 0 or 1 allowed");var n=new o(It());return window.addEventListener("hashchange",function(){n.update(It())}),n.unique().map(function(t){return function(t,e){var n,o;if(null==t)return null===(n=e.find(function(t){return t.default}))||void 0===n?void 0:n.content;if(e.find(function(e){return e.href===t}))return e.find(function(e){return e.href===t}).content;var r=t.split("/");r.pop();for(var i=function(){var t=r.join("/");if(e.find(function(e){return e.href===t}))return{v:e.find(function(e){return e.href===t}).content};r.pop()};r.length;){var a=i();if(a)return a.v}return null===(o=e.find(function(t){return t.default}))||void 0===o?void 0:o.content}(t,e)})},t.Route=function(t,e){var n;return(n={})[Lt]=!0,n.content=e,n.default=!1,n.href=t.href,n},t.DefaultRoute=function(t,e){var n;return(n={})[Lt]=!0,n.content=e,n.default=!0,n.href=void 0,n},t.Suspense=function(t,e){var n=new o(t.fallback);return Promise.all(e.map(m)).then(function(t){n.update(t)}),n},t.Switch=function(t,e){if((e=e.map(m)).some(function(t){return!t[Mt]}))throw new Error("Switch only accepts SwitchCase as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default switch cases only 0 or 1 allowed");return t.state.unique().map(function(t){return function(t,e){var n,o,r;return null!==(o=null===(n=e.find(function(e){return e.value===t}))||void 0===n?void 0:n.content)&&void 0!==o?o:null===(r=e.find(function(t){return t.default}))||void 0===r?void 0:r.content}(t,e)})},t.SwitchCase=function(t,e){var n;return(n={})[Mt]=!0,n.content=e,n.default=!1,n.value=t.when,n},t.DefaultSwitchCase=function(t,e){var n;return(n={})[Mt]=!0,n.content=e,n.default=!0,n.value=void 0,n},t.aurumElementModelIdentitiy=f,t.prerender=m,t.AurumElement=b,t.AurumFragment=_}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.aurum={})}(this,function(t){var e=function(){this.subscribeChannel=[],this.onAfterFire=[]},n={subscriptions:{configurable:!0}};n.subscriptions.get=function(){return this.subscribeChannel.length},e.prototype.subscribe=function(t,e){return this.createSubscription(t,this.subscribeChannel,e).facade},e.prototype.hasSubscriptions=function(){return this.subscriptions>0},e.prototype.cancelAll=function(){var t=this;this.isFiring?this.onAfterFire.push(function(){return t.subscribeChannel.length=0}):this.subscribeChannel.length=0},e.prototype.afterFire=function(){this.onAfterFire.length>0&&(this.onAfterFire.forEach(function(t){return t()}),this.onAfterFire.length=0)},e.prototype.fire=function(t){this.isFiring=!0;for(var e=this.subscribeChannel.length,n=0;n<e;n++)this.subscribeChannel[n].callback(t);this.isFiring=!1,this.afterFire()},e.prototype.createSubscription=function(t,e,n){var o=this,r={callback:t},i={cancel:function(){o.cancel(r,e)}};return void 0!==n&&n.addCancelable(function(){return o.cancel(r,e)}),e.push(r),{subscription:r,facade:i}},e.prototype.cancel=function(t,e){var n=this,o=e.indexOf(t);o>=0&&(this.isFiring?this.onAfterFire.push(function(){return n.cancel(t,e)}):e.splice(o,1))},Object.defineProperties(e.prototype,n);var o=function(t){this.value=t,this.updateEvent=new e};o.prototype.update=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateEvent.fire(t),this.updating=!1},o.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},o.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},o.prototype.filter=function(t,e){var n=new o;return this.listen(function(e){t(e,n.value)&&n.update(e)},e),n},o.prototype.max=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)>0:t>e})},o.prototype.min=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)<0:t<e})},o.prototype.pipe=function(t,e){this.listen(function(e){return t.update(e)},e)},o.prototype.map=function(t,e){var n=new o(t(this.value));return this.listen(function(e){n.update(t(e))},e),n},o.prototype.tap=function(t,e){var n=new o(this.value);return this.listen(function(e){t(e),n.update(e)},e),n},o.prototype.await=function(t){var e=new o;return this.listen(function(t){try{var n=e.update;return Promise.resolve(t).then(function(t){n.call(e,t)})}catch(t){return Promise.reject(t)}},t),e},o.prototype.unique=function(t){var e=new o(this.value);return this.listen(function(t){t!==e.value&&e.update(t)},t),e},o.prototype.diff=function(t){var e=new o({new:this.value,old:void 0});return this.listen(function(t){e.update({new:t,old:e.value})},t),e},o.prototype.reduce=function(t,e,n){var r=new o(e);return this.listen(function(e){return r.update(t(r.value,e))},n),r},o.prototype.aggregate=function(t,e,n){var r=this,i=new o(e(this.value,t.value));return this.listen(function(){return i.update(e(r.value,t.value))},n),t.listen(function(){return i.update(e(r.value,t.value))},n),i},o.prototype.aggregateThree=function(t,e,n,r){var i=this,a=new o(n(this.value,t.value,e.value));return this.listen(function(){return a.update(n(i.value,t.value,e.value))},r),t.listen(function(){return a.update(n(i.value,t.value,e.value))},r),e.listen(function(){return a.update(n(i.value,t.value,e.value))},r),a},o.prototype.aggregateFour=function(t,e,n,r,i){var a=this,s=new o(r(this.value,t.value,e.value,n.value));return this.listen(function(){return s.update(r(a.value,t.value,e.value,n.value))},i),t.listen(function(){return s.update(r(a.value,t.value,e.value,n.value))},i),e.listen(function(){return s.update(r(a.value,t.value,e.value,n.value))},i),n.listen(function(){return s.update(r(a.value,t.value,e.value,n.value))},i),s},o.prototype.stringJoin=function(t,e){var n=new o("");return this.listen(function(e){return n.update(n.value+t+e.toString())},e),n},o.prototype.combine=function(t,e){var n=new o;this.pipe(n,e);for(var r=0,i=t;r<i.length;r+=1)i[r].pipe(n,e);return n},o.prototype.delay=function(t,e){var n=new o(this.value);return this.listen(function(e){setTimeout(function(){n.update(e)},t)},e),n},o.prototype.debounce=function(t,e){var n,r=new o(this.value);return this.listen(function(e){clearTimeout(n),n=setTimeout(function(){r.update(e)},t)},e),r},o.prototype.throttle=function(t,e){var n=new o(this.value),r=!1;return this.listen(function(e){r||(n.update(e),r=!0,setTimeout(function(){r=!1},t))},e),n},o.prototype.buffer=function(t,e){var n,r=new o,i=[];return this.listen(function(e){i.push(e),n||(n=setTimeout(function(){n=void 0,r.update(i),i=[]},t))},e),r},o.prototype.accumulate=function(t){var e=new r;return this.listen(function(t){e.push(t)},t),e},o.prototype.pick=function(t,e){var n,r=new o(null===(n=this.value)||void 0===n?void 0:n[t]);return this.listen(function(e){r.update(null!=e?e[t]:e)},e),r},o.prototype.cancelAll=function(){this.updateEvent.cancelAll()};var r=function(t){this.data=t?t.slice():[],this.lengthSource=new o(this.data.length).unique(),this.updateEvent=new e},i={length:{configurable:!0}};r.prototype.listenAndRepeat=function(t,e){return t({operation:"add",operationDetailed:"append",index:0,items:this.data,newState:this.data,count:this.data.length}),this.listen(t,e)},r.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},i.length.get=function(){return this.lengthSource},r.prototype.getData=function(){return this.data.slice()},r.prototype.get=function(t){return this.data[t]},r.prototype.set=function(t,e){var n=this.data[t];n!==e&&(this.data[t]=e,this.update({operation:"replace",operationDetailed:"replace",target:n,count:1,index:t,items:[e],newState:this.data}),this.lengthSource.update(this.data.length))},r.prototype.swap=function(t,e){if(t!==e){var n=this.data[t],o=this.data[e];this.data[e]=n,this.data[t]=o,this.update({operation:"swap",operationDetailed:"swap",index:t,index2:e,items:[n,o],newState:this.data}),this.lengthSource.update(this.data.length)}},r.prototype.swapItems=function(t,e){if(t!==e){var n=this.data.indexOf(t),o=this.data.indexOf(e);-1!==n&&-1!==o&&(this.data[o]=t,this.data[n]=e),this.update({operation:"swap",operationDetailed:"swap",index:n,index2:o,items:[t,e],newState:this.data}),this.lengthSource.update(this.data.length)}},r.prototype.appendArray=function(t){var e=this.data;this.data=new Array(e.length);var n=0;for(n=0;n<e.length;n++)this.data[n]=e[n];for(var o=0;o<t.length;o++)this.data[n+o]=t[o];this.update({operation:"add",operationDetailed:"append",count:t.length,index:this.data.length-t.length,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.push=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.appendArray(t),this.lengthSource.update(this.data.length)},r.prototype.unshift=function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];(t=this.data).unshift.apply(t,e),this.update({operation:"add",operationDetailed:"prepend",count:e.length,items:e,index:0,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.pop=function(){var t=this.data.pop();return this.update({operation:"remove",operationDetailed:"removeRight",count:1,index:this.data.length,items:[t],newState:this.data}),this.lengthSource.update(this.data.length),t},r.prototype.merge=function(t){for(var e=0;e<t.length;e++)this.data[e]!==t[e]&&(this.data.length>e?this.set(e,t[e]):this.push(t[e]));this.data.length>t.length&&this.removeRight(this.data.length-t.length),this.lengthSource.update(this.data.length)},r.prototype.removeRight=function(t){var e=this.data.length,n=this.data.splice(e-t,t);this.update({operation:"remove",operationDetailed:"removeRight",count:t,index:e-t,items:n,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.removeLeft=function(t){var e=this.data.splice(0,t);this.update({operation:"remove",operationDetailed:"removeLeft",count:t,index:0,items:e,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.remove=function(t){var e=this.data.indexOf(t);-1!==e&&(this.data.splice(e,1),this.update({operation:"remove",operationDetailed:"remove",count:1,index:e,items:[t],newState:this.data}),this.lengthSource.update(this.data.length))},r.prototype.clear=function(){var t=this.data;this.data=[],this.update({operation:"remove",operationDetailed:"clear",count:t.length,index:0,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.shift=function(){var t=this.data.shift();return this.update({operation:"remove",operationDetailed:"removeLeft",items:[t],count:1,index:0,newState:this.data}),this.lengthSource.update(this.data.length),t},r.prototype.toArray=function(){return this.data.slice()},r.prototype.sort=function(t,e,n){void 0===e&&(e=[]);var o=new s(this,t,n);return e.forEach(function(t){t.unique().listen(function(){return o.refresh()})}),o},r.prototype.map=function(t,e,n){void 0===e&&(e=[]);var o=new a(this,t,n);return e.forEach(function(t){t.unique().listen(function(){return o.refresh()})}),o},r.prototype.filter=function(t,e,n){void 0===e&&(e=[]);var o=new c(this,t,n);return e.forEach(function(t){t.unique().listen(function(){return o.refresh()})}),o},r.prototype.forEach=function(t){return this.data.forEach(t)},r.prototype.update=function(t){this.updateEvent.fire(t)},Object.defineProperties(r.prototype,i);var a=function(t){function e(e,n,o){var r=this,i=e.getData().map(n);t.call(this,i),this.parent=e,this.mapper=n,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(r.data[t.index]);break;case"clear":r.clear();break;case"prepend":(e=r).unshift.apply(e,t.items.map(r.mapper));break;case"append":r.appendArray(t.items.map(r.mapper));break;case"swap":r.swap(t.index,t.index2);break;case"replace":r.set(t.index,r.mapper(t.items[0]))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.refresh=function(){this.clear();var t=this.parent.data.map(this.mapper);this.merge(t)},e}(r),s=function(t){function e(e,n,o){var r=this,i=e.getData().sort(n);t.call(this,i),this.comparator=n,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":case"removeRight":for(var n=0,o=t.items;n<o.length;n+=1)r.remove(o[n]);break;case"remove":r.remove(t.items[0]);break;case"clear":r.clear();break;case"prepend":(e=r).unshift.apply(e,t.items),r.data.sort(r.comparator);break;case"append":r.merge(t.items),r.data.sort(r.comparator);break;case"swap":break;case"replace":r.set(t.index,t.items[0]),r.data.sort(r.comparator)}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.refresh=function(){this.clear(),this.merge(this.parent.getData().sort(this.comparator))},e}(r),c=function(t){function e(e,n,o){var r=this;Array.isArray(e)&&(e=new t(e));var i=e.data.filter(n=null!=n?n:function(){return!0});t.call(this,i),this.parent=e,this.viewFilter=n,e.listen(function(t){var e,n;switch(t.operationDetailed){case"clear":r.clear();break;case"removeLeft":case"removeRight":case"remove":for(var o=0,i=t.items;o<i.length;o+=1)r.remove(i[o]);break;case"prepend":n=t.items.filter(r.viewFilter),(e=r).unshift.apply(e,n);break;case"append":n=t.items.filter(r.viewFilter),r.merge(n);break;case"swap":var a=r.data.indexOf(t.items[0]),s=r.data.indexOf(t.items[1]);-1!==a&&-1!==s&&r.swap(a,s);break;case"replace":var c=r.data.indexOf(t.target);-1!==c&&(r.viewFilter(t.items[0])?r.set(c,t.items[0]):r.remove(t.target))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.updateFilter=function(t){if(this.viewFilter!==t)return this.viewFilter=t,this.refresh(),this.data.length},e.prototype.refresh=function(){this.clear();var t=this.parent.data.filter(this.viewFilter);this.merge(t)},e}(r),u=function(t){t&&(this.data=t),this.updateEvent=new e,this.updateEventOnKey=new Map};u.prototype.pick=function(t,e){var n,r=new o(null===(n=this.data)||void 0===n?void 0:n[t]);return this.listenOnKey(t,function(t){r.update(t.newValue)},e),r},u.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},u.prototype.listenOnKeyAndRepeat=function(t,e,n){return e({key:t,newValue:this.data[t],oldValue:void 0}),this.listenOnKey(t,e,n)},u.prototype.listenOnKey=function(t,n,o){return this.updateEventOnKey.has(t)||this.updateEventOnKey.set(t,new e),this.updateEventOnKey.get(t).subscribe(n,o).cancel},u.prototype.keys=function(){return Object.keys(this.data)},u.prototype.values=function(){return Object.values(this.data)},u.prototype.get=function(t){return this.data[t]},u.prototype.delete=function(t,e){var n=this.data[t];delete this.data[t],this.updateEvent.fire({oldValue:n,key:t,newValue:void 0,deleted:!0})},u.prototype.set=function(t,e){if(this.data[t]!==e){var n=this.data[t];this.data[t]=e,this.updateEvent.fire({oldValue:n,key:t,newValue:this.data[t]}),this.updateEventOnKey.has(t)&&this.updateEventOnKey.get(t).fire({oldValue:n,key:t,newValue:this.data[t]})}},u.prototype.assign=function(t){if(t instanceof u)for(var e=0,n=t.keys();e<n.length;e+=1){var o=n[e];this.set(o,t.data[o])}else for(var r=0,i=Object.keys(t);r<i.length;r+=1){var a=i[r];this.set(a,t[a])}},u.prototype.toObject=function(){return Object.assign({},this.data)},u.prototype.toDataSource=function(){var t=this,e=new o(this.data);return this.listen(function(n){e.update(t.data)}),e};var l,p=Symbol("owner"),h=function(t){var e=this;this.node=this.create(t),t instanceof o&&t.listen(function(t){e.node&&(e.node.textContent=t)})};h.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},h.prototype.create=function(t){var e=document.createTextNode(this.resolveStringSource(t));return e[p]=this,e},h.prototype.remove=function(){this.hasParent()&&this.node.parentElement[p].removeChild(this.node)},h.prototype.hasParent=function(){return!!this.node.parentElement},function(t){t[t.UPSTREAM=0]="UPSTREAM",t[t.DOWNSTREAM=1]="DOWNSTREAM"}(l||(l={}));var d=function(t){this.value=t,this.updateDownstreamEvent=new e,this.updateUpstreamEvent=new e};d.fromTwoDataSource=function(t,e,n){var o=new d(n);o.updateDownstreamEvent=t.updateEvent,o.updateUpstreamEvent=e.updateEvent},d.createOneWay=function(t,e){return void 0===t&&(t=l.DOWNSTREAM),new d(e).oneWayFlow(t)},d.prototype.updateDownstream=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateDownstreamEvent.fire(t),this.updating=!1},d.prototype.updateUpstream=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateUpstreamEvent.fire(t),this.updating=!1},d.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},d.prototype.listen=function(t,e){return this.updateDownstreamEvent.subscribe(t,e),this.updateUpstreamEvent.subscribe(t,e).cancel},d.prototype.listenUpstream=function(t,e){return this.updateUpstreamEvent.subscribe(t,e).cancel},d.prototype.listenDownstream=function(t,e){return this.updateDownstreamEvent.subscribe(t,e).cancel},d.prototype.filter=function(t,e,n){var o=this;e||(e=t);var r=new d;return this.listenDownstream(function(e){t(e)&&r.updateDownstream(e)},n),r.listenUpstream(function(n){(null!=e?e:t)(n)&&o.updateUpstream(n)},n),r},d.prototype.pipe=function(t,e){var n=this;this.listenDownstream(function(e){return t.updateDownstream(e)},e),t.listenUpstream(function(t){return n.updateUpstream(t)},e)},d.prototype.map=function(t,e,n){var o=this,r=new d(t(this.value));return this.listenDownstream(function(e){return r.updateDownstream(t(e))},n),r.listenUpstream(function(t){return o.updateUpstream(e(t))},n),r},d.prototype.unique=function(t){var e=this,n=new d(this.value);return this.listenDownstream(function(t){n.value!==t&&n.updateDownstream(t)},t),n.listenUpstream(function(t){e.value!==t&&e.updateUpstream(t)},t),n},d.prototype.oneWayFlow=function(t,e){var n=this;void 0===t&&(t=l.DOWNSTREAM);var o=new d(this.value);return t===l.DOWNSTREAM?(this.listenDownstream(function(t){return o.updateDownstream(t)},e),o.updateUpstream=function(){}):(o.listenUpstream(function(t){return n.updateUpstream(t)}),o.updateDownstream=function(){}),o},d.prototype.cancelAll=function(){this.updateDownstreamEvent.cancelAll(),this.updateUpstreamEvent.cancelAll()};var f=Symbol("AurumElementModel"),v={drag:"onDrag",dragstart:"onDragStart",dragend:"onDragEnd",dragexit:"onDragExit",dragover:"onDragOver",dragenter:"onDragEnter",dragleave:"onDragLeave",blur:"onBlur",focus:"onFocus",click:"onClick",dblclick:"onDblClick",keydown:"onKeyDown",keyhit:"onKeyHit",keyup:"onKeyUp",mousedown:"onMouseDown",mouseup:"onMouseUp",mousemove:"onMouseMove",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",load:"onLoad",error:"onError"},y=["id","name","draggable","tabindex","style","role","contentEditable"];function m(t){return t&&t[f]?m(t.constructor(t.props,t.innerNodes)):t}var b=function(t,e,n){var o,r;this.node=this.create(n),this.children=[],null!=t&&(t.onAttach&&(this.onAttach=t.onAttach,this.needAttach=!0),this.onDetach=t.onDetach,this.initialize(t),null===(r=(o=t).onCreate)||void 0===r||r.call(o,this.node)),e&&this.addChildren(e)};b.prototype.initialize=function(t){this.createEventHandlers(v,t);var e=Object.keys(t).filter(function(t){return t.includes("-")});this.bindProps(y,t,e),t.class&&this.handleClass(t.class)},b.prototype.bindProps=function(t,e,n){for(var o=0,r=t;o<r.length;o+=1){var i=r[o];e[i]&&this.assignStringSourceToAttribute(e[i],i)}if(n)for(var a=0,s=n;a<s.length;a+=1){var c=s[a];e[c]&&this.assignStringSourceToAttribute(e[c],c)}},b.prototype.createEventHandlers=function(t,e){var n=this,r=function(r){e[t[r]]&&(e[t[r]]instanceof o?n.node.addEventListener(r,function(n){return e[t[r]].update(n)}):e[t[r]]instanceof d?n.node.addEventListener(r,function(n){return e[t[r]].updateDownstream(n)}):"function"==typeof e[t[r]]&&n.node.addEventListener(r,function(n){return e[t[r]](n)}))};for(var i in t)r(i)},b.prototype.render=function(){for(var t=0,e=0;e<this.children.length;e++,t++)this.children[e]instanceof g?t=this.renderFragment(this.children[e],t):this.renderChild(this.children[e],t);for(;this.node.childNodes.length>t;)this.node.removeChild(this.node.childNodes[this.node.childNodes.length-1])},b.prototype.renderFragment=function(t,e){for(var n=0;n<t.children.length;n++,e++)t.children[n]instanceof g?e=this.renderFragment(t.children[n],e):this.renderChild(t.children[n],e);return--e},b.prototype.renderChild=function(t,e){if(this.node.childNodes.length<=e)return this.addChildDom(t);if(this.node.childNodes[e][p]!==t){var n=this.getChildIndex(t.node);-1!==n?this.swapChildrenDom(e,n):this.addDomNodeAt(t.node,e)}},b.prototype.assignStringSourceToAttribute=function(t,e){var n=this;"string"==typeof t||"boolean"==typeof t?"boolean"==typeof t?t?this.node.setAttribute(e,""):this.node.removeAttribute(e):this.node.setAttribute(e,t):t.unique().listenAndRepeat(function(t){"boolean"==typeof t?t?n.node.setAttribute(e,""):n.node.removeAttribute(e):n.node.setAttribute(e,t)})},b.prototype.handleAttach=function(t){var e,n,o,r;if(this.needAttach)if(t.isConnected()){null===(e=this.onAttach)||void 0===e||e.call(this,this.node);for(var i=0,a=this.node.childNodes;i<a.length;i+=1)null===(r=null===(n=a[i][p])||void 0===n?void 0:(o=n).handleAttach)||void 0===r||r.call(o,this)}else t.needAttach=!0},b.prototype.handleDetach=function(){var t,e,n;if(!this.node.isConnected){null===(t=this.onDetach)||void 0===t||t.call(this,this.node);for(var o=0,r=this.node.childNodes;o<r.length;o+=1){var i=r[o];i[p]&&(null===(n=(e=i[p]).handleDetach)||void 0===n||n.call(e))}}},b.prototype.handleClass=function(t){var e=this;if("string"==typeof t)this.node.className=t;else if(t instanceof o)t.value&&(Array.isArray(t.value)?(this.node.className=t.value.join(" "),t.unique().listen(function(){e.node.className=t.value.join(" ")})):(this.node.className=t.value,t.unique().listen(function(){e.node.className=t.value}))),t.unique().listen(function(t){return e.node.className=t});else{var n=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");this.node.className=n;for(var r=0,i=t;r<i.length;r+=1){var a=i[r];a instanceof o&&a.unique().listen(function(n){var o=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");e.node.className=o})}}},b.prototype.create=function(t){var e=document.createElement(t);return e[p]=this,e},b.prototype.getChildIndex=function(t){for(var e=0,n=0,o=this.node.childNodes;n<o.length;n+=1){if(o[n]===t)return e;e++}return-1},b.prototype.hasChild=function(t){for(var e=0,n=t.childNodes;e<n.length;e+=1)if(n[e]===t)return!0;return!1},b.prototype.addChildDom=function(t){var e,n;this.node.appendChild(t.node),null===(n=(e=t).handleAttach)||void 0===n||n.call(e,this)},b.prototype.swapChildrenDom=function(t,e){if(t!==e){var n=this.node.childNodes[t],o=this.node.childNodes[e];n.remove(),o.remove(),t<e?(this.addDomNodeAt(o,t),this.addDomNodeAt(n,e)):(this.addDomNodeAt(n,e),this.addDomNodeAt(o,t))}},b.prototype.addDomNodeAt=function(t,e){var n,o,r,i;e>=this.node.childNodes.length?(this.node.appendChild(t),null===(o=(n=t[p]).handleAttach)||void 0===o||o.call(n,this)):(this.node.insertBefore(t,this.node.childNodes[e]),null===(i=(r=t[p]).handleAttach)||void 0===i||i.call(r,this))},b.prototype.remove=function(){this.hasParent()&&this.node.parentElement[p].removeChild(this.node)},b.prototype.hasParent=function(){return!!this.node.parentElement},b.prototype.isConnected=function(){return this.node.isConnected},b.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1),this.render()},b.prototype.removeChildAt=function(t){this.children.splice(t,1),this.render()},b.prototype.swapChildren=function(t,e){if(t!==e){var n=this.children[t];this.children[t]=this.children[e],this.children[e]=n,this.render()}},b.prototype.clearChildren=function(){this.children.length=0,this.render()},b.prototype.addChild=function(t){if(null!=t&&(!t[f]||void 0!==(t=m(t))))if(Array.isArray(t))for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e]);else this.children.push(this.childNodeToAurum(t)),this.render()},b.prototype.childNodeToAurum=function(t){var e=this;if(t instanceof b)return t;if(t instanceof Promise){var n=new g({});return t.then(function(t){n.addChildren([t]),e.render()}),n}if(t instanceof r){var i=new g({repeatModel:t});return i.onChange.subscribe(function(){return e.render()}),i}if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return new h(t.toString());if(t instanceof o){var a=new g({},[t]);return a.onChange.subscribe(function(){return e.render()}),a}throw new Error("Unsupported child type")},b.prototype.addChildAt=function(t,e){this.children.splice(e,0,this.childNodeToAurum(t)),this.render()},b.prototype.addChildren=function(t){if(0!==t.length)for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e])};var g=function(t,n){this.onChange=new e,this.children=[],t.repeatModel?this.handleRepeat(t.repeatModel):n&&this.addChildren(n)};g.prototype.addChildren=function(t){for(var e=this,n=function(){var t=i[r],n=void 0;if((n=t[f]?m(t):t)instanceof b)e.children.push(n);else{if(!(n instanceof o))throw new Error("case not yet implemented");var a=void 0,s=void 0,c={ts:void 0};n.unique().listenAndRepeat(function(t){if(c.ts=Date.now(),null==t&&s)return e.children.length=0,e.onChange.fire(),void(s=!1);if(!Array.isArray(t)&&s&&(e.children.length=0,e.onChange.fire(),s=!1),Array.isArray(t)){s=!0,e.children.length=0,e.onChange.fire();for(var o=0,r=t;o<r.length;o+=1)e.handleSourceChild(r[o],void 0,void 0,c,c.ts)}else a=e.handleSourceChild(t,a,n,c,c.ts)})}},r=0,i=t;r<i.length;r+=1)n()},g.prototype.handleSourceChild=function(t,e,n,i,a){var s=this;if(null!=t){if(t[f]&&(t=m(t)),"string"==typeof t||"bigint"==typeof t||"number"==typeof t||"boolean"==typeof t)if(e){if(e instanceof b){var c=new h(null!=n?n:t);this.children.splice(this.children.indexOf(e),1,c),e=c,this.onChange.fire()}}else{var u=new h(null!=n?n:t);this.children.push(u),e=u,this.onChange.fire()}else if(t instanceof b)t!==e&&(e?this.children.splice(this.children.indexOf(e),1,t):this.children.push(t),e=t,this.onChange.fire());else if(t instanceof Promise)t.then(function(t){i.ts===a&&(s.addChildren([t]),s.onChange.fire())});else if(t instanceof o)if(e){if(e!==t){var l=new g({},[t]);l.onChange.subscribe(function(){return s.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,l),e=l,this.onChange.fire()}}else{var p=new g({},[t]);e=p,this.children.push(p),p.onChange.subscribe(function(){return s.onChange.fire()}),this.onChange.fire()}else if(t instanceof r)if(e){if(e!==t){var d=new g({repeatModel:t});d.onChange.subscribe(function(){return s.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,d),e=d,this.onChange.fire()}}else{var v=new g({repeatModel:t});e=v,this.children.push(v),v.onChange.subscribe(function(){return s.onChange.fire()}),this.onChange.fire()}return e}e&&(this.children.splice(this.children.indexOf(e),1),e=void 0,this.onChange.fire())},g.prototype.handleRepeat=function(t){var e=this;t.listenAndRepeat(function(t){var n;switch(t.operationDetailed){case"replace":e.children[t.index]=m(t.items[0]);break;case"swap":var o=e.children[t.index2];e.children[t.index2]=e.children[t.index],e.children[t.index]=o;break;case"append":e.children=e.children.concat(t.items.map(m));break;case"prepend":(n=e.children).unshift.apply(n,t.items.map(m));break;case"remove":case"removeLeft":case"removeRight":e.children.splice(t.index,t.count);break;case"clear":e.children=[];break;default:throw new Error("unhandled operation")}e.onChange.fire()})};var _=function(t){function e(e,n){t.call(this,e,n,"div")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),w=function(t){function e(e,n){t.call(this,e,n,"button"),null!==e&&this.bindProps(["disabled"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),C={input:"onInput",change:"onChange"},O=["placeholder","readonly","disabled","accept","alt","autocomplete","autofocus","checked","defaultChecked","formAction","formEnctype","formMethod","formNoValidate","formTarget","max","maxLength","min","minLength","pattern","multiple","required","type"],A=function(t){function e(e,n){var r,i,a=this;t.call(this,e,n,"input"),null!==e&&(e.value instanceof o||e.value instanceof d?(e.value.unique().listenAndRepeat(function(t){return a.node.value=t}),this.node.addEventListener("input",function(){e.value instanceof o?e.value.update(a.node.value):e.value instanceof d&&e.value.updateUpstream(a.node.value)})):this.node.value=null!=(r=e.value)?r:"",e.checked instanceof o||e.checked instanceof d?(e.checked.unique().listenAndRepeat(function(t){return a.node.checked=t}),this.node.addEventListener("change",function(){e.checked instanceof o?e.checked.update(a.node.checked):e.checked instanceof d&&e.checked.updateUpstream(a.node.checked)})):this.node.checked=null!=(i=e.checked)&&i,this.bindProps(O,e),this.createEventHandlers(C,e))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),x=function(t){function e(e,n){t.call(this,e,n,"li")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),E=function(t){function e(e,n){t.call(this,e,n,"span")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),S=function(t){function e(e,n){t.call(this,e,n,"style"),null!==e&&this.bindProps(["media"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),j=function(t){function e(e,n){t.call(this,e,n,"audio"),null!==e&&this.bindProps(["controls","autoplay","loop","muted","preload","src"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),D=function(t){function e(e,n){t.call(this,e,n,"ul")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),k=function(t){function e(e,n){t.call(this,e,n,"p")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),N=function(t){function e(e,n){t.call(this,e,n,"img"),null!==e&&this.bindProps(["src","alt","width","height","referrerPolicy","sizes","srcset","useMap"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),P=function(t){function e(e,n){t.call(this,e,n,"link"),null!==e&&this.bindProps(["href","rel","media","as","disabled","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),F=function(t){function e(e,n){t.call(this,e,n,"canvas"),null!==e&&this.bindProps(["width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),R=function(t){function e(e,n){t.call(this,e,n,"a"),null!==e&&this.bindProps(["href","target"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),T=function(t){function e(e,n){t.call(this,e,n,"article")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),U=function(t){function e(e,n){t.call(this,e,n,"br")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),q=function(t){function e(e,n){t.call(this,e,n,"form")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),I=function(t){function e(e,n){t.call(this,e,n,"label"),null!==e&&this.bindProps(["for"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),L=function(t){function e(e,n){t.call(this,e,n,"ol")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),M=function(t){function e(e,n){t.call(this,e,n,"pre")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),V=function(t){function e(e,n){t.call(this,e,n,"progress"),null!==e&&this.bindProps(["max","value"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),K=function(t){function e(e,n){t.call(this,e,n,"table")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),W=function(t){function e(e,n){t.call(this,e,n,"td")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),H=function(t){function e(e,n){t.call(this,e,n,"tr")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),z=function(t){function e(e,n){t.call(this,e,n,"th")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),B={input:"onInput",change:"onChange"},J=["placeholder","readonly","disabled","rows","wrap","autocomplete","autofocus","max","maxLength","min","minLength","required","type"],G=function(t){function e(e,n){var o,r,i,a=this;t.call(this,e,n,"textArea"),null!==e&&(e.inputValueSource?(this.node.value=null!=(r=null!=(o=e.initialValue)?o:e.inputValueSource.value)?r:"",e.inputValueSource.unique().listen(function(t){return a.node.value=t})):this.node.value=null!=(i=e.initialValue)?i:"",this.bindProps(J,e),this.createEventHandlers(B,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(a.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Q=function(t){function e(e,n){t.call(this,e,n,"h1")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),X=function(t){function e(e,n){t.call(this,e,n,"h2")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Y=function(t){function e(e,n){t.call(this,e,n,"h3")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Z=function(t){function e(e,n){t.call(this,e,n,"h4")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),$=function(t){function e(e,n){t.call(this,e,n,"h5")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),tt=function(t){function e(e,n){t.call(this,e,n,"h6")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),et=function(t){function e(e,n){t.call(this,e,n,"header")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),nt=function(t){function e(e,n){t.call(this,e,n,"footer")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),ot=function(t){function e(e,n){t.call(this,e,n,"nav")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),rt=function(t){function e(e,n){t.call(this,e,n,"b")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),it=function(t){function e(e,n){t.call(this,e,n,"i")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),at=function(t){function e(e,n){t.call(this,e,n,"script"),null!==e&&this.bindProps(["src","async","defer","integrity","noModule","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),st=function(t){function e(e,n){t.call(this,e,n,"abbr")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),ct=function(t){function e(e,n){t.call(this,e,n,"area")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),ut=function(t){function e(e,n){t.call(this,e,n,"aside")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),lt=function(t){function e(e,n){t.call(this,e,n,"em")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),pt=function(t){function e(e,n){t.call(this,e,n,"heading")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),ht=function(t){function e(e,n){t.call(this,e,n,"iframe"),null!==e&&this.bindProps(["src","srcdoc","width","height","allow","allowFullscreen","allowPaymentRequest"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),dt=function(t){function e(e,n){t.call(this,e,n,"noscript")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),ft=function(t){function e(e,n){t.call(this,e,n,"q")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),vt={change:"onChange"},yt=function(t){function e(e,n){var o,r=this;t.call(this,e,n,"select"),null!==e&&(this.createEventHandlers(vt,e),this.initialSelection=e.initialSelection,e.selectedIndexSource?(this.selectedIndexSource=e.selectedIndexSource,e.selectedIndexSource.unique().listenAndRepeat(function(t){return r.node.selectedIndex=t})):this.node.selectedIndex=null!=(o=e.initialSelection)?o:-1,e.selectedIndexSource&&(this.needAttach=!0,this.node.addEventListener("change",function(){e.selectedIndexSource.update(r.node.selectedIndex)})))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleAttach=function(e){t.prototype.handleAttach.call(this,e),this.node.isConnected&&(this.selectedIndexSource?this.node.selectedIndex=this.selectedIndexSource.value:void 0!==this.initialSelection&&(this.node.selectedIndex=this.initialSelection))},e}(b),mt=function(t){function e(e,n){t.call(this,e,n,"source"),null!==e&&this.bindProps(["src","srcSet","media","sizes","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),bt=function(t){function e(e,n){t.call(this,e,n,"title")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),gt=function(t){function e(e,n){t.call(this,e,n,"video"),null!==e&&this.bindProps(["controls","autoplay","loop","muted","preload","src","poster","width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),_t=function(t){function e(e,n){t.call(this,e,n,"tbody")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),wt=function(t){function e(e,n){t.call(this,e,n,"tfoot")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Ct=function(t){function e(e,n){t.call(this,e,n,"thead")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Ot=function(t){function e(e,n){t.call(this,e,n,"summary")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),At=function(t){function e(e,n){t.call(this,e,n,"details")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),xt=function(t){function e(e,n){t.call(this,e,n,"sub")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Et=function(t){function e(e,n){t.call(this,e,n,"sup")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),St=function(t){function e(e,n){t.call(this,e,n,"svg"),null!==e&&this.bindProps(["width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),jt=function(t){function e(e,n){t.call(this,e,n,"data"),null!==e&&this.bindProps(["datalue"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),Dt=function(t){function e(e,n){t.call(this,e,n,"time"),null!==e&&this.bindProps(["datetime"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),kt={button:w,div:_,input:A,li:x,span:E,style:S,ul:D,p:k,img:N,link:P,canvas:F,a:R,article:T,br:U,form:q,label:I,ol:L,pre:M,progress:V,table:K,td:W,tr:H,th:z,textarea:G,h1:Q,h2:X,h3:Y,h4:Z,h5:$,h6:tt,header:et,footer:nt,nav:ot,b:rt,i:it,script:at,abbr:st,area:ct,aside:ut,audio:j,em:lt,heading:pt,iframe:ht,noscript:dt,option:function(t){function e(e,n){t.call(this,e,n,"option")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),q:ft,select:yt,source:mt,title:bt,video:gt,tbody:_t,tfoot:wt,thead:Ct,summary:Ot,details:At,sub:xt,sup:Et,svg:St,data:jt,time:Dt,template:function(t){function e(e,n){t.call(this,e,n,"template")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b)},Nt=function(){};Nt.attach=function(t,e){var n=m(t);if(e[p])throw new Error("This node is already managed by aurum and cannot be used");if(!(n instanceof b))throw new Error("Root node of aurum application must be a single dom node");e.appendChild(n.node),n.handleAttach(n),e[p]=n},Nt.isAttached=function(t){return void 0!==t[p]},Nt.detach=function(t){t[p]&&(t[p].node.remove(),t[p].handleDetach(),t[p]=void 0)},Nt.factory=function(t,e){for(var n,o,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];if("string"==typeof t){var a=t;if(void 0===(t=kt[t]))throw new Error("Node "+a+" does not exist or is not supported")}return Object.getPrototypeOf(t)===b?((n={})[f]=!0,n.constructor=function(e,n){return new t(e,n)},n.props=e,n.innerNodes=r,n):((o={})[f]=!0,o.constructor=t,o.props=e,o.innerNodes=r,o)};var Pt=function(t){this.data=t};Pt.prototype.deleteNext=function(){if(this.next){var t=this.next.next;this.next.next=void 0,this.next.previous=void 0,this.next=t,this.next&&(this.next.previous=this)}},Pt.prototype.deletePrevious=function(){if(this.previous){var t=this.previous.previous;this.previous.next=void 0,this.previous.previous=void 0,this.previous=t,this.previous&&(this.previous.next=this)}};var Ft=function(t){var e=this;void 0===t&&(t=[]),this.length=0,t.forEach(function(t){return e.append(t)})};Ft.prototype.find=function(t){for(var e=this.rootNode;e&&!t(e);)e=e.next;return e},Ft.prototype.append=function(t){return this.rootNode||this.lastNode?(this.lastNode.next=new Pt(t),this.lastNode.next.previous=this.lastNode,this.lastNode=this.lastNode.next):this.rootNode=this.lastNode=new Pt(t),this.length++,t},Ft.prototype.forEach=function(t){this.find(function(e){return t(e.data),!1})},Ft.prototype.remove=function(t){if(t===this.rootNode.data)this.rootNode=this.rootNode===this.lastNode?this.lastNode=void 0:this.rootNode.next,this.length--;else{var e=this.find(function(e){return e.next&&e.next.data===t});e&&(e.next===this.lastNode&&(this.lastNode=e),e.deleteNext(),this.length--)}};var Rt=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.cancelables=new Ft(t),this._isCancelled=!1},Tt={isCanceled:{configurable:!0}};Tt.isCanceled.get=function(){return this._isCancelled},Rt.prototype.addCancelable=function(t){return this.throwIfCancelled("attempting to add cancellable to token that is already cancelled"),this.cancelables.append(t),this.cancelables.length>200&&console.log("potential memory leak: cancellation token has over 200 clean up calls"),this},Rt.prototype.removeCancelable=function(t){return this.throwIfCancelled("attempting to remove cancellable from token that is already cancelled"),this.cancelables.remove(t),this},Rt.prototype.addDisposable=function(t){return this.addCancelable(function(){return t.dispose()}),this},Rt.prototype.callIfNotCancelled=function(t){this.isCanceled||t()},Rt.prototype.setTimeout=function(t,e){var n=this;void 0===e&&(e=0);var o=setTimeout(function(){n.removeCancelable(r),t()},e),r=function(){return clearTimeout(o)};this.addCancelable(r)},Rt.prototype.setInterval=function(t,e){var n=setInterval(t,e);this.addCancelable(function(){return clearInterval(n)})},Rt.prototype.requestAnimationFrame=function(t){var e=this,n=requestAnimationFrame(function(){e.removeCancelable(o),t()}),o=function(){return cancelAnimationFrame(n)};this.addCancelable(o)},Rt.prototype.animationLoop=function(t){var e=requestAnimationFrame(function n(o){t(o),e=requestAnimationFrame(n)});this.addCancelable(function(){return cancelAnimationFrame(e)})},Rt.prototype.throwIfCancelled=function(t){if(this.isCanceled)throw new Error(t||"cancellation token is cancelled")},Rt.prototype.chain=function(t,e){return void 0===e&&(e=!1),e&&t.chain(this,!1),this.addCancelable(function(){return t.cancel()}),this},Rt.prototype.registerDomEvent=function(t,e,n){return t.addEventListener(e,n),this.addCancelable(function(){return t.removeEventListener(e,n)}),this},Rt.prototype.cancel=function(){this.isCanceled||(this._isCancelled=!0,this.cancelables.forEach(function(t){return t()}),this.cancelables=void 0)},Object.defineProperties(Rt.prototype,Tt);var Ut=function(t){function e(e,n){t.call(this,e,n,e.tag),e.attributes&&null!==e&&this.bindProps(Object.keys(e.attributes),e.attributes)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(b),qt=Symbol("route");function It(){var t=location.hash.substring(1);return t.includes("?")?t.substring(0,t.indexOf("?")):t.includes("#")?t.substring(0,t.indexOf("#")):t}var Lt=Symbol("switchCase");t.DataSource=o,t.ArrayDataSource=r,t.MappedArrayView=a,t.SortedArrayView=s,t.FilteredArrayView=c,t.ObjectDataSource=u,t.Aurum=Nt,t.CancellationToken=Rt,t.Custom=Ut,t.AurumRouter=function(t,e){if((e=e.map(m)).some(function(t){return!t[qt]}))throw new Error("Aurum Router only accepts Route and DefaultRoute instances as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default routes only 0 or 1 allowed");var n=new o(It());return window.addEventListener("hashchange",function(){n.update(It())}),n.unique().map(function(t){return function(t,e){var n,o;if(null==t)return null===(n=e.find(function(t){return t.default}))||void 0===n?void 0:n.content;if(e.find(function(e){return e.href===t}))return e.find(function(e){return e.href===t}).content;var r=t.split("/");r.pop();for(var i=function(){var t=r.join("/");if(e.find(function(e){return e.href===t}))return{v:e.find(function(e){return e.href===t}).content};r.pop()};r.length;){var a=i();if(a)return a.v}return null===(o=e.find(function(t){return t.default}))||void 0===o?void 0:o.content}(t,e)})},t.Route=function(t,e){var n;return(n={})[qt]=!0,n.content=e,n.default=!1,n.href=t.href,n},t.DefaultRoute=function(t,e){var n;return(n={})[qt]=!0,n.content=e,n.default=!0,n.href=void 0,n},t.Suspense=function(t,e){var n=new o(t.fallback);return Promise.all(e.map(m)).then(function(t){n.update(t)}),n},t.Switch=function(t,e){if((e=e.map(m)).some(function(t){return!t[Lt]}))throw new Error("Switch only accepts SwitchCase as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default switch cases only 0 or 1 allowed");return t.state.unique().map(function(t){return function(t,e){var n,o,r;return null!==(o=null===(n=e.find(function(e){return e.value===t}))||void 0===n?void 0:n.content)&&void 0!==o?o:null===(r=e.find(function(t){return t.default}))||void 0===r?void 0:r.content}(t,e)})},t.SwitchCase=function(t,e){var n;return(n={})[Lt]=!0,n.content=e,n.default=!1,n.value=t.when,n},t.DefaultSwitchCase=function(t,e){var n;return(n={})[Lt]=!0,n.content=e,n.default=!0,n.value=void 0,n},t.aurumElementModelIdentitiy=f,t.prerender=m,t.AurumElement=b,t.AurumFragment=g}); | ||
//# sourceMappingURL=aurumjs.umd.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4450093
134595